Files
chinese-family-tree-2/.next/static/chunks/f73e23bd6c5909c4.js
T
freedakgmail bec270c9af 0.0.8.2
2025-11-23 19:51:42 +08:00

19 lines
104 KiB
JavaScript

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1316,(e,t,r)=>{"use strict";var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},l={};a(l,{Decimal:()=>e2,Public:()=>u,getRuntime:()=>E,makeStrictEnum:()=>b,objectEnumValues:()=>v}),t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of o(t))s.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=i(t,l))||a.enumerable});return e})(n({},"__esModule",{value:!0}),l);var u={};function c(){return e=>e}a(u,{validator:()=>c});var d=Symbol(),f=new WeakMap,h=class{constructor(e){e===d?f.set(this,"Prisma.".concat(this._getName())):f.set(this,"new Prisma.".concat(this._getNamespace(),".").concat(this._getName(),"()"))}_getName(){return this.constructor.name}toString(){return f.get(this)}},p=class extends h{_getNamespace(){return"NullTypes"}},m=class extends p{};x(m,"DbNull");var g=class extends p{};x(g,"JsonNull");var w=class extends p{};x(w,"AnyNull");var v={classes:{DbNull:m,JsonNull:g,AnyNull:w},instances:{DbNull:new m(d),JsonNull:new g(d),AnyNull:new w(d)}};function x(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var y=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function b(e){return new Proxy(e,{get(e,t){if(t in e)return e[t];if(!y.has(t))throw TypeError("Invalid enum value: ".concat(String(t)))}})}var N={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function E(){var e,t,r;let n="object"==typeof Netlify?"netlify":"string"==typeof EdgeRuntime?"edge-light":(null==(e=globalThis.navigator)?void 0:e.userAgent)==="Cloudflare-Workers"?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":(null==(r=null==(t=globalThis.process)?void 0:t.release)?void 0:r.name)==="node"?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown";return{id:n,prettyName:N[n]||n,isEdge:["workerd","deno","netlify","edge-light"].includes(n)}}var R,j,C="0123456789abcdef",P="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",M="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",S={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},A=!0,k="[DecimalError] ",D=k+"Invalid argument: ",T=k+"Precision limit exceeded",I=k+"crypto unavailable",O="[object Decimal]",L=Math.floor,F=Math.pow,_=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,H=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,$=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,U=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,q=P.length-1,B=M.length-1,z={toStringTag:O};function V(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)(r=7-(n=e[t]+"").length)&&(o+=er(r)),o+=n;(r=7-(n=(s=e[t])+"").length)&&(o+=er(r))}else if(0===s)return"0";for(;s%10==0;)s/=10;return o+s}function W(e,t,r){if(e!==~~e||e<t||e>r)throw Error(D+e)}function K(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=F(10,7-t),a=e[i]%o|0,null==n?t<3?(0==t?a=a/100|0:1==t&&(a=a/10|0),s=r<4&&99999==a||r>3&&49999==a||5e4==a||0==a):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==F(10,t-2)-1||(a==o/2||0==a)&&(e[i+1]/o/100|0)==0:t<4?(0==t?a=a/1e3|0:1==t?a=a/100|0:2==t&&(a=a/10|0),s=(n||r<4)&&9999==a||!n&&r>3&&4999==a):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==F(10,t-3)-1,s}function Z(e,t,r){for(var n,i,o=[0],s=0,a=e.length;s<a;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=C.indexOf(e.charAt(s++)),n=0;n<o.length;n++)o[n]>r-1&&(void 0===o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}z.absoluteValue=z.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),J(e)},z.ceil=function(){return J(new this.constructor(this),this.e+1,2)},z.clampedTo=z.clamp=function(e,t){var r=this.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(D+t);return 0>this.cmp(e)?e:this.cmp(t)>0?t:new r(this)},z.comparedTo=z.cmp=function(e){var t,r,n,i,o=this.d,s=(e=new this.constructor(e)).d,a=this.s,l=e.s;if(!o||!s)return a&&l?a!==l?a:o===s?0:!o^a<0?1:-1:NaN;if(!o[0]||!s[0])return o[0]?a:s[0]?-l:0;if(a!==l)return a;if(this.e!==e.e)return this.e>e.e^a<0?1:-1;for(n=o.length,i=s.length,t=0,r=n<i?n:i;t<r;++t)if(o[t]!==s[t])return o[t]>s[t]^a<0?1:-1;return n===i?0:n>i^a<0?1:-1},z.cosine=z.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n,i;if(t.isZero())return t;(n=t.d.length)<32?i=(1/ed(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ec(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}(n,ef(n,r)),n.precision=e,n.rounding=t,J(2==j||3==j?r.neg():r,e,t,!0)):new n(1):new n(NaN)},z.cubeRoot=z.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,c=this.constructor;if(!this.isFinite()||this.isZero())return new c(this);for(A=!1,(o=this.s*F(this.s*this,1/3))&&Math.abs(o)!=1/0?n=new c(o.toString()):(r=V(this.d),(o=((e=this.e)-r.length+1)%3)&&(r+=1==o||-2==o?"0":"00"),o=F(r,1/3),e=L((e+1)/3)-(e%3==(e<0?-1:2)),(n=new c(r=o==1/0?"5e"+e:(r=o.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=this.s),s=(e=c.precision)+3;;)if(n=G((u=(l=(a=n).times(a).times(a)).plus(this)).plus(this).times(a),u.plus(l),s+2,1),V(a.d).slice(0,s)===(r=V(n.d)).slice(0,s))if("9999"!=(r=r.slice(s-3,s+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(J(n,e+1,1),t=!n.times(n).times(n).eq(this));break}else{if(!i&&(J(a,e+1,0),a.times(a).times(a).eq(this))){n=a;break}s+=4,i=1}return A=!0,J(n,e,c.rounding,t)},z.decimalPlaces=z.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=((e=t.length-1)-L(this.e/7))*7,e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},z.dividedBy=z.div=function(e){return G(this,new this.constructor(e))},z.dividedToIntegerBy=z.divToInt=function(e){var t=this.constructor;return J(G(this,new t(e),0,1,1),t.precision,t.rounding)},z.equals=z.eq=function(e){return 0===this.cmp(e)},z.floor=function(){return J(new this.constructor(this),this.e+1,3)},z.greaterThan=z.gt=function(e){return this.cmp(e)>0},z.greaterThanOrEqualTo=z.gte=function(e){var t=this.cmp(e);return 1==t||0===t},z.hyperbolicCosine=z.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,(i=o.d.length)<32?t=(1/ed(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=ec(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return J(o,s.precision=r,s.rounding=n,!0)},z.hyperbolicSine=z.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(n=i.d.length)<3)i=ec(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=ec(o,2,i=i.times(1/ed(5,e)),i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,J(i,t,r,!0)},z.hyperbolicTangent=z.tanh=function(){var e,t,r=this.constructor;return this.isFinite()?this.isZero()?new r(this):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,G(this.sinh(),this.cosh(),r.precision=e,r.rounding=t)):new r(this.s)},z.inverseCosine=z.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return -1!==n?0===n?t.isNeg()?ee(r,i,o):new r(0):new r(NaN):t.isZero()?ee(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ee(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))},z.inverseHyperbolicCosine=z.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,A=!1,r=r.times(r).minus(1).sqrt().plus(r),A=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},z.inverseHyperbolicSine=z.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,A=!1,r=r.times(r).plus(1).sqrt().plus(r),A=!0,n.precision=e,n.rounding=t,r.ln())},z.inverseHyperbolicTangent=z.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,Math.max(n=i.sd(),e)<-(2*i.e)-1?J(new o(i),e,t,!0):(o.precision=r=n-i.e,i=G(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},z.inverseSine=z.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,-1!==t?0===t?((e=ee(o,r+4,n).times(.5)).s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))},z.inverseTangent=z.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,c=u.constructor,d=c.precision,f=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&d+4<=B)return(s=ee(c,d+4,f).times(.25)).s=u.s,s}else{if(!u.s)return new c(NaN);if(d+4<=B)return(s=ee(c,d+4,f).times(.5)).s=u.s,s}for(c.precision=a=d+10,c.rounding=1,e=r=Math.min(28,a/7+2|0);e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(A=!1,t=Math.ceil(a/7),n=1,l=u.times(u),s=new c(u),i=u;-1!==e;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),void 0!==(s=o.plus(i.div(n+=2))).d[t])for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),A=!0,J(s,c.precision=d,c.rounding=f,!0)},z.isFinite=function(){return!!this.d},z.isInteger=z.isInt=function(){return!!this.d&&L(this.e/7)>this.d.length-2},z.isNaN=function(){return!this.s},z.isNegative=z.isNeg=function(){return this.s<0},z.isPositive=z.isPos=function(){return this.s>0},z.isZero=function(){return!!this.d&&0===this.d[0]},z.lessThan=z.lt=function(e){return 0>this.cmp(e)},z.lessThanOrEqualTo=z.lte=function(e){return 1>this.cmp(e)},z.logarithm=z.log=function(e){var t,r,n,i,o,s,a,l=this.constructor,u=l.precision,c=l.rounding;if(null==e)e=new l(10),t=!0;else{if(r=(e=new l(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(r=this.d,this.s<0||!r||!r[0]||this.eq(1))return new l(r&&!r[0]?-1/0:1!=this.s?NaN:r?0:1/0);if(t)if(r.length>1)i=!0;else{for(n=r[0];n%10==0;)n/=10;i=1!==n}if(A=!1,K((a=G(o=ea(this,s=u+5),t?Q(l,s+10):ea(e,s),s,1)).d,n=u,c))do if(s+=10,a=G(o=ea(this,s),t?Q(l,s+10):ea(e,s),s,1),!i){+V(a.d).slice(n+1,n+15)+1==1e14&&(a=J(a,u+1,0));break}while(K(a.d,n+=10,c))return A=!0,J(a,u,c)},z.minus=z.sub=function(e){var t,r,n,i,o,s,a,l,u,c,d,f,h=this.constructor;if(e=new h(e),!this.d||!e.d)return this.s&&e.s?this.d?e.s=-e.s:e=new h(e.d||this.s!==e.s?this:NaN):e=new h(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.plus(e);if(u=this.d,f=e.d,a=h.precision,l=h.rounding,!u[0]||!f[0]){if(f[0])e.s=-e.s;else{if(!u[0])return new h(3===l?-0:0);e=new h(this)}return A?J(e,a,l):e}if(r=L(e.e/7),c=L(this.e/7),u=u.slice(),o=c-r){for((d=o<0)?(t=u,o=-o,s=f.length):(t=f,r=c,s=u.length),o>(n=Math.max(Math.ceil(a/7),s)+2)&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for((d=(n=u.length)<(s=f.length))&&(s=n),n=0;n<s;n++)if(u[n]!=f[n]){d=u[n]<f[n];break}o=0}for(d&&(t=u,u=f,f=t,e.s=-e.s),s=u.length,n=f.length-s;n>0;--n)u[s++]=0;for(n=f.length;n>o;){if(u[--n]<f[n]){for(i=n;i&&0===u[--i];)u[i]=1e7-1;--u[i],u[n]+=1e7}u[n]-=f[n]}for(;0===u[--s];)u.pop();for(;0===u[0];u.shift())--r;return u[0]?(e.d=u,e.e=Y(u,r),A?J(e,a,l):e):new h(3===l?-0:0)},z.modulo=z.mod=function(e){var t,r=this.constructor;return e=new r(e),this.d&&e.s&&(!e.d||e.d[0])?e.d&&(!this.d||this.d[0])?(A=!1,9==r.modulo?(t=G(this,e.abs(),0,3,1),t.s*=e.s):t=G(this,e,0,r.modulo,1),t=t.times(e),A=!0,this.minus(t)):J(new r(this),r.precision,r.rounding):new r(NaN)},z.naturalExponential=z.exp=function(){return es(this)},z.naturalLogarithm=z.ln=function(){return ea(this)},z.negated=z.neg=function(){var e=new this.constructor(this);return e.s=-e.s,J(e)},z.plus=z.add=function(e){var t,r,n,i,o,s,a,l,u,c,d=this.constructor;if(e=new d(e),!this.d||!e.d)return this.s&&e.s?this.d||(e=new d(e.d||this.s===e.s?this:NaN)):e=new d(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.minus(e);if(u=this.d,c=e.d,a=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(e=new d(this)),A?J(e,a,l):e;if(o=L(this.e/7),n=L(e.e/7),u=u.slice(),i=o-n){for(i<0?(r=u,i=-i,s=c.length):(r=c,n=o,s=u.length),i>(s=(o=Math.ceil(a/7))>s?o+1:s+1)&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((s=u.length)-(i=c.length)<0&&(i=s,r=c,c=u,u=r),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/1e7|0,u[i]%=1e7;for(t&&(u.unshift(t),++n),s=u.length;0==u[--s];)u.pop();return e.d=u,e.e=Y(u,n),A?J(e,a,l):e},z.precision=z.sd=function(e){var t;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(D+e);return this.d?(t=et(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},z.round=function(){var e=this.constructor;return J(new e(this),this.e+1,e.rounding)},z.sine=z.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ec(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=ec(e,2,t=t.times(1/ed(5,r)),t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}(n,ef(n,r)),n.precision=e,n.rounding=t,J(j>2?r.neg():r,e,t,!0)):new n(NaN)},z.squareRoot=z.sqrt=function(){var e,t,r,n,i,o,s=this.d,a=this.e,l=this.s,u=this.constructor;if(1!==l||!s||!s[0])return new u(!l||l<0&&(!s||s[0])?NaN:s?this:1/0);for(A=!1,0==(l=Math.sqrt(+this))||l==1/0?(((t=V(s)).length+a)%2==0&&(t+="0"),l=Math.sqrt(t),a=L((a+1)/2)-(a<0||a%2),n=new u(t=l==1/0?"5e"+a:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+a)):n=new u(l.toString()),r=(a=u.precision)+3;;)if(n=(o=n).plus(G(this,o,r+2,1)).times(.5),V(o.d).slice(0,r)===(t=V(n.d)).slice(0,r))if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(J(n,a+1,1),e=!n.times(n).eq(this));break}else{if(!i&&(J(o,a+1,0),o.times(o).eq(this))){n=o;break}r+=4,i=1}return A=!0,J(n,a,u.rounding,e)},z.tangent=z.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=G(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,J(2==j||4==j?r.neg():r,e,t,!0)):new n(NaN)},z.times=z.mul=function(e){var t,r,n,i,o,s,a,l,u,c=this.constructor,d=this.d,f=(e=new c(e)).d;if(e.s*=this.s,!d||!d[0]||!f||!f[0])return new c(!e.s||d&&!d[0]&&!f||f&&!f[0]&&!d?NaN:!d||!f?e.s/0:0*e.s);for(r=L(this.e/7)+L(e.e/7),(l=d.length)<(u=f.length)&&(o=d,d=f,f=o,s=l,l=u,u=s),o=[],n=s=l+u;n--;)o.push(0);for(n=u;--n>=0;){for(t=0,i=l+n;i>n;)a=o[i]+f[n]*d[i-n-1]+t,o[i--]=a%1e7|0,t=a/1e7|0;o[i]=(o[i]+t)%1e7|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Y(o,r),A?J(e,c.precision,c.rounding):e},z.toBinary=function(e,t){return eh(this,2,e,t)},z.toDecimalPlaces=z.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(W(e,0,1e9),void 0===t?t=n.rounding:W(t,0,8),J(r,e+r.e+1,t))},z.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=X(n,!0):(W(e,0,1e9),void 0===t?t=i.rounding:W(t,0,8),r=X(n=J(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},z.toFixed=function(e,t){var r,n,i=this.constructor;return void 0===e?r=X(this):(W(e,0,1e9),void 0===t?t=i.rounding:W(t,0,8),r=X(n=J(new i(this),e+this.e+1,t),!1,e+n.e+1)),this.isNeg()&&!this.isZero()?"-"+r:r},z.toFraction=function(e){var t,r,n,i,o,s,a,l,u,c,d,f,h=this.d,p=this.constructor;if(!h)return new p(this);if(u=r=new p(1),n=l=new p(0),s=(o=(t=new p(n)).e=et(h)-this.e-1)%7,t.d[0]=F(10,s<0?7+s:s),null==e)e=o>0?t:u;else{if(!(a=new p(e)).isInt()||a.lt(u))throw Error(D+a);e=a.gt(t)?o>0?t:u:a}for(A=!1,a=new p(V(h)),c=p.precision,p.precision=o=7*h.length*2;d=G(a,t,0,1,1),1!=(i=r.plus(d.times(n))).cmp(e);)r=n,n=i,i=u,u=l.plus(d.times(i)),l=i,i=t,t=a.minus(d.times(i)),a=i;return i=G(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=this.s,f=1>G(u,n,o,1).minus(this).abs().cmp(G(l,r,o,1).minus(this).abs())?[u,n]:[l,r],p.precision=c,A=!0,f},z.toHexadecimal=z.toHex=function(e,t){return eh(this,16,e,t)},z.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:W(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(A=!1,r=G(r,e,0,t,1).times(e),A=!0,J(r)):(e.s=r.s,r=e),r},z.toNumber=function(){return+this},z.toOctal=function(e,t){return eh(this,8,e,t)},z.toPower=z.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(F(+a,u));if((a=new l(a)).eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return J(a,n,o);if((t=L(e.e/7))>=e.d.length-1&&(r=u<0?-u:u)<=0x1fffffffffffff)return i=en(l,a,r,n),e.s<0?new l(1).div(i):J(i,n,o);if((s=a.s)<0){if(t<e.d.length-1)return new l(NaN);if(1&e.d[t]||(s=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=s,a}return(t=0!=(r=F(+a,u))&&isFinite(r)?new l(r+"").e:L(u*(Math.log("0."+V(a.d))/Math.LN10+a.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?s/0:0):(A=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),(i=es(e.times(ea(a,n+r)),n)).d&&K((i=J(i,n+5,1)).d,n,o)&&(t=n+10,+V((i=J(es(e.times(ea(a,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=J(i,n+1,0))),i.s=s,A=!0,l.rounding=o,J(i,n,o))},z.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=X(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(W(e,1,1e9),void 0===t?t=i.rounding:W(t,0,8),r=X(n=J(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},z.toSignificantDigits=z.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(W(e,1,1e9),void 0===t?t=r.rounding:W(t,0,8)),J(new r(this),e,t)},z.toString=function(){var e=this.constructor,t=X(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+t:t},z.truncated=z.trunc=function(){return J(new this.constructor(this),this.e+1,1)},z.valueOf=z.toJSON=function(){var e=this.constructor,t=X(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+t:t};var G=function(){function e(e,t,r){var n,i=0,o=e.length;for(e=e.slice();o--;)n=e[o]*t+i,e[o]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=+(e[r]<t[r]),e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;)e.shift()}return function(n,i,o,s,a,l){var u,c,d,f,h,p,m,g,w,v,x,y,b,N,E,j,C,P,M,S,A=n.constructor,k=n.s==i.s?1:-1,D=n.d,T=i.d;if(!D||!D[0]||!T||!T[0])return new A(!n.s||!i.s||(D?T&&D[0]==T[0]:!T)?NaN:D&&0==D[0]||!T?0*k:k/0);for(l?(h=1,c=n.e-i.e):(l=1e7,h=7,c=L(n.e/h)-L(i.e/h)),M=T.length,C=D.length,v=(w=new A(k)).d=[],d=0;T[d]==(D[d]||0);d++);if(T[d]>(D[d]||0)&&c--,null==o?(N=o=A.precision,s=A.rounding):N=a?o+(n.e-i.e)+1:o,N<0)v.push(1),p=!0;else{if(N=N/h+2|0,d=0,1==M){for(f=0,T=T[0],N++;(d<C||f)&&N--;d++)E=f*l+(D[d]||0),v[d]=E/T|0,f=E%T|0;p=f||d<C}else{for((f=l/(T[0]+1)|0)>1&&(T=e(T,f,l),D=e(D,f,l),M=T.length,C=D.length),j=M,y=(x=D.slice(0,M)).length;y<M;)x[y++]=0;(S=T.slice()).unshift(0),P=T[0],T[1]>=l/2&&++P;do f=0,(u=t(T,x,M,y))<0?(b=x[0],M!=y&&(b=b*l+(x[1]||0)),(f=b/P|0)>1?(f>=l&&(f=l-1),g=(m=e(T,f,l)).length,y=x.length,1==(u=t(m,x,g,y))&&(f--,r(m,M<g?S:T,g,l))):(0==f&&(u=f=1),m=T.slice()),(g=m.length)<y&&m.unshift(0),r(x,m,y,l),-1==u&&(y=x.length,(u=t(T,x,M,y))<1&&(f++,r(x,M<y?S:T,y,l))),y=x.length):0===u&&(f++,x=[0]),v[d++]=f,u&&x[0]?x[y++]=D[j]||0:(x=[D[j]],y=1);while((j++<C||void 0!==x[0])&&N--)p=void 0!==x[0]}v[0]||v.shift()}if(1==h)w.e=c,R=p;else{for(d=1,f=v[0];f>=10;f/=10)d++;w.e=d+c*h-1,J(w,a?o+w.e+1:o,s,p)}return w}}();function J(e,t,r,n){var i,o,s,a,l,u,c,d,f,h=e.constructor;e:if(null!=t){if(!(d=e.d))return e;for(i=1,a=d[0];a>=10;a/=10)i++;if((o=t-i)<0)o+=7,s=t,l=(c=d[f=0])/F(10,i-s-1)%10|0;else if((f=Math.ceil((o+1)/7))>=(a=d.length))if(n){for(;a++<=f;)d.push(0);c=l=0,i=1,o%=7,s=o-7+1}else break e;else{for(c=a=d[f],i=1;a>=10;a/=10)i++;o%=7,l=(s=o-7+i)<0?0:c/F(10,i-s-1)%10|0}if(n=n||t<0||void 0!==d[f+1]||(s<0?c:c%F(10,i-s-1)),u=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(o>0?s>0?c/F(10,i-s):0:d[f-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,u?(t-=e.e+1,d[0]=F(10,(7-t%7)%7),e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=f,a=1,f--):(d.length=f+1,a=F(10,7-o),d[f]=s>0?(c/F(10,i-s)%F(10,s)|0)*a:0),u)for(;;)if(0==f){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,1e7==d[0]&&(d[0]=1));break}else{if(d[f]+=a,1e7!=d[f])break;d[f--]=0,a=1}for(o=d.length;0===d[--o];)d.pop()}return A&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function X(e,t,r){if(!e.isFinite())return el(e);var n,i=e.e,o=V(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+er(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+er(-i-1)+o,r&&(n=r-s)>0&&(o+=er(n))):i>=s?(o+=er(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+er(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=er(n))),o}function Y(e,t){var r=e[0];for(t*=7;r>=10;r/=10)t++;return t}function Q(e,t,r){if(t>q)throw A=!0,r&&(e.precision=r),Error(T);return J(new e(P),t,1,!0)}function ee(e,t,r){if(t>B)throw Error(T);return J(new e(M),t,r,!0)}function et(e){var t=e.length-1,r=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function er(e){for(var t="";e--;)t+="0";return t}function en(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/7+4);for(A=!1;;){if(r%2&&ep((o=o.times(t)).d,s)&&(i=!0),0===(r=L(r/2))){r=o.d.length-1,i&&0===o.d[r]&&++o.d[r];break}ep((t=t.times(t)).d,s)}return A=!0,o}function ei(e){return 1&e.d[e.d.length-1]}function eo(e,t,r){for(var n,i=new e(t[0]),o=0;++o<t.length;)if((n=new e(t[o])).s)i[r](n)&&(i=n);else{i=n;break}return i}function es(e,t){var r,n,i,o,s,a,l,u=0,c=0,d=0,f=e.constructor,h=f.rounding,p=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(A=!1,l=p):l=t,a=new f(.03125);e.e>-2;)e=e.times(a),d+=5;for(l+=n=Math.log(F(2,d))/Math.LN10*2+5|0,r=o=s=new f(1),f.precision=l;;){if(o=J(o.times(e),l,1),r=r.times(++c),V((a=s.plus(G(o,r,l,1))).d).slice(0,l)===V(s.d).slice(0,l)){for(i=d;i--;)s=J(s.times(s),l,1);if(null!=t)return f.precision=p,s;if(!(u<3&&K(s.d,l-n,h,u)))return J(s,f.precision=p,h,A=!0);f.precision=l+=10,r=o=a=new f(1),c=0,u++}s=a}}function ea(e,t){var r,n,i,o,s,a,l,u,c,d,f,h=1,p=e,m=p.d,g=p.constructor,w=g.rounding,v=g.precision;if(p.s<0||!m||!m[0]||!p.e&&1==m[0]&&1==m.length)return new g(m&&!m[0]?-1/0:1!=p.s?NaN:m?0:p);if(null==t?(A=!1,c=v):c=t,g.precision=c+=10,n=(r=V(m)).charAt(0),!(15e14>Math.abs(o=p.e)))return u=Q(g,c+2,v).times(o+""),p=ea(new g(n+"."+r.slice(1)),c-10).plus(u),g.precision=v,null==t?J(p,v,w,A=!0):p;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=V((p=p.times(e)).d)).charAt(0),h++;for(o=p.e,n>1?(p=new g("0."+r),o++):p=new g(n+"."+r.slice(1)),d=p,l=s=p=G(p.minus(1),p.plus(1),c,1),f=J(p.times(p),c,1),i=3;;){if(s=J(s.times(f),c,1),V((u=l.plus(G(s,new g(i),c,1))).d).slice(0,c)===V(l.d).slice(0,c))if(l=l.times(2),0!==o&&(l=l.plus(Q(g,c+2,v).times(o+""))),l=G(l,new g(h),c,1),null!=t)return g.precision=v,l;else{if(!K(l.d,c-10,w,a))return J(l,g.precision=v,w,A=!0);g.precision=c+=10,u=s=p=G(d.minus(1),d.plus(1),c,1),f=J(p.times(p),c,1),i=a=1}l=u,i+=2}}function el(e){return String(e.s*e.s/0)}function eu(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%7,r<0&&(n+=7),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=7;n<i;)e.d.push(+t.slice(n,n+=7));n=7-(t=t.slice(n)).length}else n-=i;for(;n--;)t+="0";e.d.push(+t),A&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function ec(e,t,r,n,i){var o,s,a,l,u=e.precision,c=Math.ceil(u/7);for(A=!1,l=r.times(r),a=new e(n);;){if(s=G(a.times(l),new e(t++*t++),u,1),a=i?n.plus(s):n.minus(s),n=G(s.times(l),new e(t++*t++),u,1),void 0!==(s=a.plus(n)).d[c]){for(o=c;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=n,n=s,s=o}return A=!0,s.d.length=c+1,s}function ed(e,t){for(var r=e;--t;)r*=e;return r}function ef(e,t){var r,n=t.s<0,i=ee(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return j=n?4:1,t;if((r=t.divToInt(i)).isZero())j=n?3:2;else{if((t=t.minus(r.times(i))).lte(o))return j=ei(r)?n?2:3:n?4:1,t;j=ei(r)?n?1:4:n?3:2}return t.minus(i).abs()}function eh(e,t,r,n){var i,o,s,a,l,u,c,d,f,h=e.constructor,p=void 0!==r;if(p?(W(r,1,1e9),void 0===n?n=h.rounding:W(n,0,8)):(r=h.precision,n=h.rounding),e.isFinite()){for(s=(c=X(e)).indexOf("."),p?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,s>=0&&(c=c.replace(".",""),(f=new h(1)).e=c.length-s,f.d=Z(X(f),10,i),f.e=f.d.length),o=l=(d=Z(c,10,i)).length;0==d[--l];)d.pop();if(d[0]){if(s<0?o--:((e=new h(e)).d=d,e.e=o,d=(e=G(e,f,r,n,0,i)).d,o=e.e,u=R),s=d[r],a=i/2,u=u||void 0!==d[r+1],u=n<4?(void 0!==s||u)&&(0===n||n===(e.s<0?3:2)):s>a||s===a&&(4===n||u||6===n&&1&d[r-1]||n===(e.s<0?8:7)),d.length=r,u)for(;++d[--r]>i-1;)d[r]=0,r||(++o,d.unshift(1));for(l=d.length;!d[l-1];--l);for(s=0,c="";s<l;s++)c+=C.charAt(d[s]);if(p){if(l>1)if(16==t||8==t){for(s=16==t?4:3,--l;l%s;l++)c+="0";for(l=(d=Z(c,i,t)).length;!d[l-1];--l);for(s=1,c="1.";s<l;s++)c+=C.charAt(d[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}else c=p?"0p+0":"0";c=(16==t?"0x":2==t?"0b":8==t?"0o":"")+c}else c=el(e);return e.s<0?"-"+c:c}function ep(e,t){if(e.length>t)return e.length=t,!0}function em(e){return new this(e).abs()}function eg(e){return new this(e).acos()}function ew(e){return new this(e).acosh()}function ev(e,t){return new this(e).plus(t)}function ex(e){return new this(e).asin()}function ey(e){return new this(e).asinh()}function eb(e){return new this(e).atan()}function eN(e){return new this(e).atanh()}function eE(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?ee(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=ee(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,r=this.atan(G(e,t,o,1)),t=ee(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(G(e,t,o,1)):(r=ee(this,o,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function eR(e){return new this(e).cbrt()}function ej(e){return J(e=new this(e),e.e+1,2)}function eC(e,t,r){return new this(e).clamp(t,r)}function eP(e){if(!e||"object"!=typeof e)throw Error(k+"Object expected");var t,r,n,i=!0===e.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=S[r]),void 0!==(n=e[r]))if(L(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(D+r+": "+n);if(r="crypto",i&&(this[r]=S[r]),void 0!==(n=e[r]))if(!0===n||!1===n||0===n||1===n)if(n)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(I);else this[r]=!1;else throw Error(D+r+": "+n);return this}function eM(e){return new this(e).cos()}function eS(e){return new this(e).cosh()}function eA(e,t){return new this(e).div(t)}function ek(e){return new this(e).exp()}function eD(e){return J(e=new this(e),e.e+1,3)}function eT(){var e,t,r=new this(0);for(A=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return A=!0,new this(1/0);r=t}return A=!0,r.sqrt()}function eI(e){return e instanceof e1||e&&e.toStringTag===O||!1}function eO(e){return new this(e).ln()}function eL(e,t){return new this(e).log(t)}function eF(e){return new this(e).log(2)}function e_(e){return new this(e).log(10)}function eH(){return eo(this,arguments,"lt")}function e$(){return eo(this,arguments,"gt")}function eU(e,t){return new this(e).mod(t)}function eq(e,t){return new this(e).mul(t)}function eB(e,t){return new this(e).pow(t)}function ez(e){var t,r,n,i,o=0,s=new this(1),a=[];if(void 0===e?e=this.precision:W(e,1,1e9),n=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)(i=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)(i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(I);else for(;o<n;)a[o++]=1e7*Math.random()|0;for(n=a[--o],e%=7,n&&e&&(i=F(10,7-e),a[o]=(n/i|0)*i);0===a[o];o--)a.pop();if(o<0)r=0,a=[0];else{for(r=-1;0===a[0];r-=7)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<7&&(r-=7-n)}return s.e=r,s.d=a,s}function eV(e){return J(e=new this(e),e.e+1,this.rounding)}function eW(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function eK(e){return new this(e).sin()}function eZ(e){return new this(e).sinh()}function eG(e){return new this(e).sqrt()}function eJ(e,t){return new this(e).sub(t)}function eX(){var e=0,t=arguments,r=new this(t[0]);for(A=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return A=!0,J(r,this.precision,this.rounding)}function eY(e){return new this(e).tan()}function eQ(e){return new this(e).tanh()}function e0(e){return J(e=new this(e),e.e+1,1)}z[Symbol.for("nodejs.util.inspect.custom")]=z.toString,z[Symbol.toStringTag]="Decimal";var e1=z.constructor=function e(t){var r,n,i;function o(e){var t,r,n;if(!(this instanceof o))return new o(e);if(this.constructor=o,eI(e)){this.s=e.s,A?!e.d||e.e>o.maxE?(this.e=NaN,this.d=null):e.e<o.minE?(this.e=0,this.d=[0]):(this.e=e.e,this.d=e.d.slice()):(this.e=e.e,this.d=e.d?e.d.slice():e.d);return}if("number"==(n=typeof e)){if(0===e){this.s=1/e<0?-1:1,this.e=0,this.d=[0];return}if(e<0?(e=-e,this.s=-1):this.s=1,e===~~e&&e<1e7){for(t=0,r=e;r>=10;r/=10)t++;A?t>o.maxE?(this.e=NaN,this.d=null):t<o.minE?(this.e=0,this.d=[0]):(this.e=t,this.d=[e]):(this.e=t,this.d=[e]);return}if(0*e!=0){e||(this.s=NaN),this.e=NaN,this.d=null;return}return eu(this,e.toString())}if("string"!==n)throw Error(D+e);return 45===(r=e.charCodeAt(0))?(e=e.slice(1),this.s=-1):(43===r&&(e=e.slice(1)),this.s=1),U.test(e)?eu(this,e):function(e,t){var r,n,i,o,s,a,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),U.test(t))return eu(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(H.test(t))r=16,t=t.toLowerCase();else if(_.test(t))r=2;else if($.test(t))r=8;else throw Error(D+t);for((o=t.search(/p/i))>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),s=(o=t.indexOf("."))>=0,n=e.constructor,s&&(o=(a=(t=t.replace(".","")).length)-o,i=en(n,new n(r),o,2*o)),o=c=(u=Z(t,r,1e7)).length-1;0===u[o];--o)u.pop();return o<0?new n(0*e.s):(e.e=Y(u,c),e.d=u,A=!1,s&&(e=G(e,i,4*a)),l&&(e=e.times(54>Math.abs(l)?F(2,l):e1.pow(2,l))),A=!0,e)}(this,e)}if(o.prototype=z,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=eP,o.clone=e,o.isDecimal=eI,o.abs=em,o.acos=eg,o.acosh=ew,o.add=ev,o.asin=ex,o.asinh=ey,o.atan=eb,o.atanh=eN,o.atan2=eE,o.cbrt=eR,o.ceil=ej,o.clamp=eC,o.cos=eM,o.cosh=eS,o.div=eA,o.exp=ek,o.floor=eD,o.hypot=eT,o.ln=eO,o.log=eL,o.log10=e_,o.log2=eF,o.max=eH,o.min=e$,o.mod=eU,o.mul=eq,o.pow=eB,o.random=ez,o.round=eV,o.sign=eW,o.sin=eK,o.sinh=eZ,o.sqrt=eG,o.sub=eJ,o.sum=eX,o.tan=eY,o.tanh=eQ,o.trunc=e0,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<i.length;)t.hasOwnProperty(n=i[r++])||(t[n]=this[n]);return o.config(t),o}(S);P=new e1(P),M=new e1(M);var e2=e1},2870,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});let{Decimal:n,objectEnumValues:i,makeStrictEnum:o,Public:s,getRuntime:a,skip:l}=e.r(1316),u={};r.Prisma=u,r.$Enums={},u.prismaVersion={client:"5.22.0",engine:"605197351a3c8bdd595af2d2a9bc3025bca48ea2"},u.PrismaClientKnownRequestError=()=>{let e=a().prettyName;throw Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.PrismaClientUnknownRequestError=()=>{let e=a().prettyName;throw Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.PrismaClientRustPanicError=()=>{let e=a().prettyName;throw Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.PrismaClientInitializationError=()=>{let e=a().prettyName;throw Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.PrismaClientValidationError=()=>{let e=a().prettyName;throw Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.NotFoundError=()=>{let e=a().prettyName;throw Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.Decimal=n,u.sql=()=>{let e=a().prettyName;throw Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.empty=()=>{let e=a().prettyName;throw Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.join=()=>{let e=a().prettyName;throw Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.raw=()=>{let e=a().prettyName;throw Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.validator=s.validator,u.getExtensionContext=()=>{let e=a().prettyName;throw Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.defineExtension=()=>{let e=a().prettyName;throw Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${e}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},u.DbNull=i.instances.DbNull,u.JsonNull=i.instances.JsonNull,u.AnyNull=i.instances.AnyNull,u.NullTypes={DbNull:i.classes.DbNull,JsonNull:i.classes.JsonNull,AnyNull:i.classes.AnyNull},r.Prisma.TransactionIsolationLevel=o({ReadUncommitted:"ReadUncommitted",ReadCommitted:"ReadCommitted",RepeatableRead:"RepeatableRead",Serializable:"Serializable"}),r.Prisma.UserScalarFieldEnum={id:"id",email:"email",name:"name",password:"password",avatar:"avatar",createdAt:"createdAt",updatedAt:"updatedAt"},r.Prisma.FamilyTreeScalarFieldEnum={id:"id",name:"name",description:"description",rootMemberId:"rootMemberId",ownerId:"ownerId",createdAt:"createdAt",updatedAt:"updatedAt"},r.Prisma.TreeCollaboratorScalarFieldEnum={id:"id",treeId:"treeId",userId:"userId",role:"role",invitedBy:"invitedBy",invitedAt:"invitedAt"},r.Prisma.FamilyMemberScalarFieldEnum={id:"id",treeId:"treeId",surname:"surname",givenName:"givenName",fullName:"fullName",gender:"gender",generation:"generation",generationName:"generationName",courtesyName:"courtesyName",artName:"artName",posthumousName:"posthumousName",rank:"rank",birthDate:"birthDate",deathDate:"deathDate",isLunarDate:"isLunarDate",ancestralHome:"ancestralHome",birthPlace:"birthPlace",burialPlace:"burialPlace",phone:"phone",telephone:"telephone",email:"email",address:"address",fatherId:"fatherId",motherId:"motherId",spouseIds:"spouseIds",childrenIds:"childrenIds",spouseFatherName:"spouseFatherName",spouseMotherName:"spouseMotherName",bio:"bio",tags:"tags",avatarUrl:"avatarUrl",avatarImageId:"avatarImageId",photoIds:"photoIds",createdAt:"createdAt",updatedAt:"updatedAt"},r.Prisma.ActivityLogScalarFieldEnum={id:"id",treeId:"treeId",userId:"userId",action:"action",entityType:"entityType",entityId:"entityId",entityName:"entityName",changes:"changes",timestamp:"timestamp"},r.Prisma.SortOrder={asc:"asc",desc:"desc"},r.Prisma.NullableJsonNullValueInput={DbNull:u.DbNull,JsonNull:u.JsonNull},r.Prisma.QueryMode={default:"default",insensitive:"insensitive"},r.Prisma.NullsOrder={first:"first",last:"last"},r.Prisma.JsonNullValueFilter={DbNull:u.DbNull,JsonNull:u.JsonNull,AnyNull:u.AnyNull},r.Role=r.$Enums.Role={OWNER:"OWNER",EDITOR:"EDITOR",VIEWER:"VIEWER"},r.Gender=r.$Enums.Gender={MALE:"MALE",FEMALE:"FEMALE"},r.Action=r.$Enums.Action={CREATE:"CREATE",UPDATE:"UPDATE",DELETE:"DELETE",IMPORT:"IMPORT",EXPORT:"EXPORT"},r.EntityType=r.$Enums.EntityType={MEMBER:"MEMBER",PHOTO:"PHOTO",STORY:"STORY",SETTINGS:"SETTINGS"},r.Prisma.ModelName={User:"User",FamilyTree:"FamilyTree",TreeCollaborator:"TreeCollaborator",FamilyMember:"FamilyMember",ActivityLog:"ActivityLog"},r.PrismaClient=class{constructor(){return new Proxy(this,{get(e,t){let r=a();throw Error((r.isEdge?`PrismaClient is not configured to run in ${r.prettyName}. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
`:"PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `"+r.prettyName+"`).")+`
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`)}})}},Object.assign(r,u)},51322,(e,t,r)=>{t.exports=e.r(2870)},82772,89926,30846,51788,55772,49515,29300,34072,59786,34811,79096,47934,77760,88434,99490,68072,99495,59210,e=>{"use strict";var t=e.i(36792),r=e.i(3965),n=e.i(27458),i=e.i(27706);let o=(0,i.default)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);e.s(["default",()=>o],89926),e.s(["Search",()=>o],30846);let s=(0,i.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",()=>s],51788);let a=(0,i.default)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]),l=(0,i.default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["default",()=>l],55772),e.s(["ChevronDown",()=>l],49515);let u=(0,i.default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>u],29300);let c=(0,i.default)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);e.s(["Trash2",()=>c],34072);let d=(0,i.default)("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]),f=(0,i.default)("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var h=e.i(9991),p=e.i(77627),m=e.i(34346),g=e.i(57213),w=e.i(60515),v=e.i(42668),x=e.i(14268),y="Avatar",[b,N]=(0,g.createContextScope)(y),[E,R]=b(y),j=m.forwardRef((e,r)=>{let{__scopeAvatar:n,...i}=e,[o,s]=m.useState("idle");return(0,t.jsx)(E,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:s,children:(0,t.jsx)(x.Primitive.span,{...i,ref:r})})});j.displayName=y;var C="AvatarImage",P=m.forwardRef((e,r)=>{let{__scopeAvatar:n,src:i,onLoadingStatusChange:o=()=>{},...s}=e,a=R(C,n),l=function(e,t){let[r,n]=m.useState("idle");return(0,v.useLayoutEffect)(()=>{if(!e)return void n("error");let r=!0,i=new window.Image,o=e=>()=>{r&&n(e)};return n("loading"),i.onload=o("loaded"),i.onerror=o("error"),i.src=e,t&&(i.referrerPolicy=t),()=>{r=!1}},[e,t]),r}(i,s.referrerPolicy),u=(0,w.useCallbackRef)(e=>{o(e),a.onImageLoadingStatusChange(e)});return(0,v.useLayoutEffect)(()=>{"idle"!==l&&u(l)},[l,u]),"loaded"===l?(0,t.jsx)(x.Primitive.img,{...s,ref:r,src:i}):null});P.displayName=C;var M="AvatarFallback",S=m.forwardRef((e,r)=>{let{__scopeAvatar:n,delayMs:i,...o}=e,s=R(M,n),[a,l]=m.useState(void 0===i);return m.useEffect(()=>{if(void 0!==i){let e=window.setTimeout(()=>l(!0),i);return()=>window.clearTimeout(e)}},[i]),a&&"loaded"!==s.imageLoadingStatus?(0,t.jsx)(x.Primitive.span,{...o,ref:r}):null});S.displayName=M;var A=e.i(69744);function k({className:e,...r}){return(0,t.jsx)(j,{"data-slot":"avatar",className:(0,A.cn)("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...r})}function D({className:e,...r}){return(0,t.jsx)(P,{"data-slot":"avatar-image",className:(0,A.cn)("aspect-square size-full",e),...r})}function T({className:e,...r}){return(0,t.jsx)(S,{"data-slot":"avatar-fallback",className:(0,A.cn)("bg-muted flex size-full items-center justify-center rounded-full",e),...r})}e.s(["Avatar",()=>k,"AvatarFallback",()=>T,"AvatarImage",()=>D],59786);var I=e.i(82502),O=e.i(6580),L=e.i(53607),F=e.i(22436);function _(e){let r=e+"CollectionProvider",[n,i]=(0,g.createContextScope)(r),[o,s]=n(r,{collectionRef:{current:null},itemMap:new Map}),a=e=>{let{scope:r,children:n}=e,i=m.default.useRef(null),s=m.default.useRef(new Map).current;return(0,t.jsx)(o,{scope:r,itemMap:s,collectionRef:i,children:n})};a.displayName=r;let l=e+"CollectionSlot",u=m.default.forwardRef((e,r)=>{let{scope:n,children:i}=e,o=s(l,n),a=(0,O.useComposedRefs)(r,o.collectionRef);return(0,t.jsx)(F.Slot,{ref:a,children:i})});u.displayName=l;let c=e+"CollectionItemSlot",d="data-radix-collection-item",f=m.default.forwardRef((e,r)=>{let{scope:n,children:i,...o}=e,a=m.default.useRef(null),l=(0,O.useComposedRefs)(r,a),u=s(c,n);return m.default.useEffect(()=>(u.itemMap.set(a,{ref:a,...o}),()=>void u.itemMap.delete(a))),(0,t.jsx)(F.Slot,{...{[d]:""},ref:l,children:i})});return f.displayName=c,[{Provider:a,Slot:u,ItemSlot:f},function(t){let r=s(e+"CollectionConsumer",t);return m.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},i]}e.s(["createCollection",()=>_],34811);var H=m.createContext(void 0);function $(e){let t=m.useContext(H);return e||t||"ltr"}e.s(["useDirection",()=>$],79096);var U=e.i(28698),q=e.i(49989),B=e.i(76400),z=e.i(21471);let V=["top","right","bottom","left"],W=Math.min,K=Math.max,Z=Math.round,G=Math.floor,J=e=>({x:e,y:e}),X={left:"right",right:"left",bottom:"top",top:"bottom"},Y={start:"end",end:"start"};function Q(e,t){return"function"==typeof e?e(t):e}function ee(e){return e.split("-")[0]}function et(e){return e.split("-")[1]}function er(e){return"x"===e?"y":"x"}function en(e){return"y"===e?"height":"width"}let ei=new Set(["top","bottom"]);function eo(e){return ei.has(ee(e))?"y":"x"}function es(e){return e.replace(/start|end/g,e=>Y[e])}let ea=["left","right"],el=["right","left"],eu=["top","bottom"],ec=["bottom","top"];function ed(e){return e.replace(/left|right|bottom|top/g,e=>X[e])}function ef(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function eh(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function ep(e,t,r){let n,{reference:i,floating:o}=e,s=eo(t),a=er(eo(t)),l=en(a),u=ee(t),c="y"===s,d=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,h=i[l]/2-o[l]/2;switch(u){case"top":n={x:d,y:i.y-o.height};break;case"bottom":n={x:d,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:f};break;case"left":n={x:i.x-o.width,y:f};break;default:n={x:i.x,y:i.y}}switch(et(t)){case"start":n[a]-=h*(r&&c?-1:1);break;case"end":n[a]+=h*(r&&c?-1:1)}return n}let em=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,a=o.filter(Boolean),l=await (null==s.isRTL?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=ep(u,n,l),f=n,h={},p=0;for(let r=0;r<a.length;r++){let{name:o,fn:m}=a[r],{x:g,y:w,data:v,reset:x}=await m({x:c,y:d,initialPlacement:n,placement:f,strategy:i,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});c=null!=g?g:c,d=null!=w?w:d,h={...h,[o]:{...h[o],...v}},x&&p<=50&&(p++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(u=!0===x.rects?await s.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:c,y:d}=ep(u,f,l)),r=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function eg(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Q(t,e),p=ef(h),m=a[f?"floating"===d?"reference":"floating":d],g=eh(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(m)))||r?m:m.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),w="floating"===d?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await (null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),x=await (null==o.isElement?void 0:o.isElement(v))&&await (null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},y=eh(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:v,strategy:l}):w);return{top:(g.top-y.top+p.top)/x.y,bottom:(y.bottom-g.bottom+p.bottom)/x.y,left:(g.left-y.left+p.left)/x.x,right:(y.right-g.right+p.right)/x.x}}function ew(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ev(e){return V.some(t=>e[t]>=0)}let ex=new Set(["left","top"]);async function ey(e,t){let{placement:r,platform:n,elements:i}=e,o=await (null==n.isRTL?void 0:n.isRTL(i.floating)),s=ee(r),a=et(r),l="y"===eo(r),u=ex.has(s)?-1:1,c=o&&l?-1:1,d=Q(t,e),{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}function eb(){return"undefined"!=typeof window}function eN(e){return ej(e)?(e.nodeName||"").toLowerCase():"#document"}function eE(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function eR(e){var t;return null==(t=(ej(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ej(e){return!!eb()&&(e instanceof Node||e instanceof eE(e).Node)}function eC(e){return!!eb()&&(e instanceof Element||e instanceof eE(e).Element)}function eP(e){return!!eb()&&(e instanceof HTMLElement||e instanceof eE(e).HTMLElement)}function eM(e){return!!eb()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof eE(e).ShadowRoot)}let eS=new Set(["inline","contents"]);function eA(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=eU(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!eS.has(i)}let ek=new Set(["table","td","th"]),eD=[":popover-open",":modal"];function eT(e){return eD.some(t=>{try{return e.matches(t)}catch(e){return!1}})}let eI=["transform","translate","scale","rotate","perspective"],eO=["transform","translate","scale","rotate","perspective","filter"],eL=["paint","layout","strict","content"];function eF(e){let t=e_(),r=eC(e)?eU(e):e;return eI.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||eO.some(e=>(r.willChange||"").includes(e))||eL.some(e=>(r.contain||"").includes(e))}function e_(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let eH=new Set(["html","body","#document"]);function e$(e){return eH.has(eN(e))}function eU(e){return eE(e).getComputedStyle(e)}function eq(e){return eC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eB(e){if("html"===eN(e))return e;let t=e.assignedSlot||e.parentNode||eM(e)&&e.host||eR(e);return eM(t)?t.host:t}function ez(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let i=function e(t){let r=eB(t);return e$(r)?t.ownerDocument?t.ownerDocument.body:t.body:eP(r)&&eA(r)?r:e(r)}(e),o=i===(null==(n=e.ownerDocument)?void 0:n.body),s=eE(i);if(o){let e=eV(s);return t.concat(s,s.visualViewport||[],eA(i)?i:[],e&&r?ez(e):[])}return t.concat(i,ez(i,[],r))}function eV(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eW(e){let t=eU(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=eP(e),o=i?e.offsetWidth:r,s=i?e.offsetHeight:n,a=Z(r)!==o||Z(n)!==s;return a&&(r=o,n=s),{width:r,height:n,$:a}}function eK(e){return eC(e)?e:e.contextElement}function eZ(e){let t=eK(e);if(!eP(t))return J(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:o}=eW(t),s=(o?Z(r.width):r.width)/n,a=(o?Z(r.height):r.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}let eG=J(0);function eJ(e){let t=eE(e);return e_()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eG}function eX(e,t,r,n){var i;void 0===t&&(t=!1),void 0===r&&(r=!1);let o=e.getBoundingClientRect(),s=eK(e),a=J(1);t&&(n?eC(n)&&(a=eZ(n)):a=eZ(e));let l=(void 0===(i=r)&&(i=!1),n&&(!i||n===eE(s))&&i)?eJ(s):J(0),u=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(s){let e=eE(s),t=n&&eC(n)?eE(n):n,r=e,i=eV(r);for(;i&&n&&t!==r;){let e=eZ(i),t=i.getBoundingClientRect(),n=eU(i),o=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,s=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,f*=e.y,u+=o,c+=s,i=eV(r=eE(i))}}return eh({width:d,height:f,x:u,y:c})}function eY(e,t){let r=eq(e).scrollLeft;return t?t.left+r:eX(eR(e)).left+r}function eQ(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-eY(e,r),y:r.top+t.scrollTop}}let e0=new Set(["absolute","fixed"]);function e1(e,t,r){var n;let i;if("viewport"===t)i=function(e,t){let r=eE(e),n=eR(e),i=r.visualViewport,o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;let e=e_();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}let u=eY(n);if(u<=0){let e=n.ownerDocument,t=e.body,r=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,s=Math.abs(n.clientWidth-t.clientWidth-i);s<=25&&(o-=s)}else u<=25&&(o+=u);return{width:o,height:s,x:a,y:l}}(e,r);else if("document"===t){let t,r,o,s,a,l,u;n=eR(e),t=eR(n),r=eq(n),o=n.ownerDocument.body,s=K(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=K(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),l=-r.scrollLeft+eY(n),u=-r.scrollTop,"rtl"===eU(o).direction&&(l+=K(t.clientWidth,o.clientWidth)-s),i={width:s,height:a,x:l,y:u}}else if(eC(t)){let e,n,o,s,a,l;n=(e=eX(t,!0,"fixed"===r)).top+t.clientTop,o=e.left+t.clientLeft,s=eP(t)?eZ(t):J(1),a=t.clientWidth*s.x,l=t.clientHeight*s.y,i={width:a,height:l,x:o*s.x,y:n*s.y}}else{let r=eJ(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return eh(i)}function e2(e){return"static"===eU(e).position}function e7(e,t){if(!eP(e)||"fixed"===eU(e).position)return null;if(t)return t(e);let r=e.offsetParent;return eR(e)===r&&(r=r.ownerDocument.body),r}function e5(e,t){var r;let n=eE(e);if(eT(e))return n;if(!eP(e)){let t=eB(e);for(;t&&!e$(t);){if(eC(t)&&!e2(t))return t;t=eB(t)}return n}let i=e7(e,t);for(;i&&(r=i,ek.has(eN(r)))&&e2(i);)i=e7(i,t);return i&&e$(i)&&e2(i)&&!eF(i)?n:i||function(e){let t=eB(e);for(;eP(t)&&!e$(t);){if(eF(t))return t;if(eT(t))break;t=eB(t)}return null}(e)||n}let e4=async function(e){let t=this.getOffsetParent||e5,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=eP(t),i=eR(t),o="fixed"===r,s=eX(e,!0,o,t),a={scrollLeft:0,scrollTop:0},l=J(0);if(n||!n&&!o)if(("body"!==eN(t)||eA(i))&&(a=eq(t)),n){let e=eX(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=eY(i));o&&!n&&i&&(l.x=eY(i));let u=!i||n||o?J(0):eQ(i,a);return{x:s.left+a.scrollLeft-l.x-u.x,y:s.top+a.scrollTop-l.y-u.y,width:s.width,height:s.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},e9={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,o="fixed"===i,s=eR(n),a=!!t&&eT(t.floating);if(n===s||a&&o)return r;let l={scrollLeft:0,scrollTop:0},u=J(1),c=J(0),d=eP(n);if((d||!d&&!o)&&(("body"!==eN(n)||eA(s))&&(l=eq(n)),eP(n))){let e=eX(n);u=eZ(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}let f=!s||d||o?J(0):eQ(s,l);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}},getDocumentElement:eR,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,o=[..."clippingAncestors"===r?eT(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=ez(e,[],!1).filter(e=>eC(e)&&"body"!==eN(e)),i=null,o="fixed"===eU(e).position,s=o?eB(e):e;for(;eC(s)&&!e$(s);){let t=eU(s),r=eF(s);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&!!i&&e0.has(i.position)||eA(s)&&!r&&function e(t,r){let n=eB(t);return!(n===r||!eC(n)||e$(n))&&("fixed"===eU(n).position||e(n,r))}(e,s))?n=n.filter(e=>e!==s):i=t,s=eB(s)}return t.set(e,n),n}(t,this._c):[].concat(r),n],s=o[0],a=o.reduce((e,r)=>{let n=e1(t,r,i);return e.top=K(n.top,e.top),e.right=W(n.right,e.right),e.bottom=W(n.bottom,e.bottom),e.left=K(n.left,e.left),e},e1(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:e5,getElementRects:e4,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=eW(e);return{width:t,height:r}},getScale:eZ,isElement:eC,isRTL:function(e){return"rtl"===eU(e).direction}};function e3(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let e8=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=Q(e,t)||{};if(null==u)return{};let d=ef(c),f={x:r,y:n},h=er(eo(i)),p=en(h),m=await s.getDimensions(u),g="y"===h,w=g?"clientHeight":"clientWidth",v=o.reference[p]+o.reference[h]-f[h]-o.floating[p],x=f[h]-o.reference[h],y=await (null==s.getOffsetParent?void 0:s.getOffsetParent(u)),b=y?y[w]:0;b&&await (null==s.isElement?void 0:s.isElement(y))||(b=a.floating[w]||o.floating[p]);let N=b/2-m[p]/2-1,E=W(d[g?"top":"left"],N),R=W(d[g?"bottom":"right"],N),j=b-m[p]-R,C=b/2-m[p]/2+(v/2-x/2),P=K(E,W(C,j)),M=!l.arrow&&null!=et(i)&&C!==P&&o.reference[p]/2-(C<E?E:R)-m[p]/2<0,S=M?C<E?C-E:C-j:0;return{[h]:f[h]+S,data:{[h]:P,centerOffset:C-P-S,...M&&{alignmentOffset:S}},reset:M}}});var e6=e.i(76124),te="undefined"!=typeof document?m.useLayoutEffect:function(){};function tt(e,t){let r,n,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!tt(e[n],t[n]))return!1;return!0}if((r=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,i[n]))return!1;for(n=r;0!=n--;){let r=i[n];if(("_owner"!==r||!e.$$typeof)&&!tt(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function tr(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tn(e,t){let r=tr(e);return Math.round(t*r)/r}function ti(e){let t=m.useRef(e);return te(()=>{t.current=e}),t}var to=m.forwardRef((e,r)=>{let{children:n,width:i=10,height:o=5,...s}=e;return(0,t.jsx)(x.Primitive.svg,{...s,ref:r,width:i,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,t.jsx)("polygon",{points:"0,0 30,0 15,10"})})});function ts(e){let[t,r]=m.useState(void 0);return(0,v.useLayoutEffect)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,i=t.blockSize}else n=e.offsetWidth,i=e.offsetHeight;r({width:n,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}to.displayName="Arrow",e.s(["useSize",()=>ts],47934);var ta="Popper",[tl,tu]=(0,g.createContextScope)(ta),[tc,td]=tl(ta),tf=e=>{let{__scopePopper:r,children:n}=e,[i,o]=m.useState(null);return(0,t.jsx)(tc,{scope:r,anchor:i,onAnchorChange:o,children:n})};tf.displayName=ta;var th="PopperAnchor",tp=m.forwardRef((e,r)=>{let{__scopePopper:n,virtualRef:i,...o}=e,s=td(th,n),a=m.useRef(null),l=(0,O.useComposedRefs)(r,a);return m.useEffect(()=>{s.onAnchorChange(i?.current||a.current)}),i?null:(0,t.jsx)(x.Primitive.div,{...o,ref:l})});tp.displayName=th;var tm="PopperContent",[tg,tw]=tl(tm),tv=m.forwardRef((e,r)=>{var n,i,o,s,a,l,u,c,d,f,h,p,g,y,b,N,E,R,j,C,P;let{__scopePopper:M,side:S="bottom",sideOffset:A=0,align:k="center",alignOffset:D=0,arrowPadding:T=0,avoidCollisions:I=!0,collisionBoundary:L=[],collisionPadding:F=0,sticky:_="partial",hideWhenDetached:H=!1,updatePositionStrategy:$="optimized",onPlaced:U,...q}=e,B=td(tm,M),[z,V]=m.useState(null),Z=(0,O.useComposedRefs)(r,e=>V(e)),[J,X]=m.useState(null),Y=ts(J),ei=Y?.width??0,ef=Y?.height??0,eh="number"==typeof F?F:{top:0,right:0,bottom:0,left:0,...F},ep=Array.isArray(L)?L:[L],eb=ep.length>0,eN={padding:eh,boundary:ep.filter(tN),altBoundary:eb},{refs:eE,floatingStyles:ej,placement:eC,isPositioned:eP,middlewareData:eM}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=m.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=m.useState(n);tt(f,n)||h(n);let[p,g]=m.useState(null),[w,v]=m.useState(null),x=m.useCallback(e=>{e!==E.current&&(E.current=e,g(e))},[]),y=m.useCallback(e=>{e!==R.current&&(R.current=e,v(e))},[]),b=o||p,N=s||w,E=m.useRef(null),R=m.useRef(null),j=m.useRef(c),C=null!=l,P=ti(l),M=ti(i),S=ti(u),A=m.useCallback(()=>{var e,n;let i,o,s;if(!E.current||!R.current)return;let a={placement:t,strategy:r,middleware:f};M.current&&(a.platform=M.current),(e=E.current,n=R.current,i=new Map,s={...(o={platform:e9,...a}).platform,_c:i},em(e,n,{...o,platform:s})).then(e=>{let t={...e,isPositioned:!1!==S.current};k.current&&!tt(j.current,t)&&(j.current=t,e6.flushSync(()=>{d(t)}))})},[f,t,r,M,S]);te(()=>{!1===u&&j.current.isPositioned&&(j.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);let k=m.useRef(!1);te(()=>(k.current=!0,()=>{k.current=!1}),[]),te(()=>{if(b&&(E.current=b),N&&(R.current=N),b&&N){if(P.current)return P.current(b,N,A);A()}},[b,N,A,P,C]);let D=m.useMemo(()=>({reference:E,floating:R,setReference:x,setFloating:y}),[x,y]),T=m.useMemo(()=>({reference:b,floating:N}),[b,N]),I=m.useMemo(()=>{let e={position:r,left:0,top:0};if(!T.floating)return e;let t=tn(T.floating,c.x),n=tn(T.floating,c.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...tr(T.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,a,T.floating,c.x,c.y]);return m.useMemo(()=>({...c,update:A,refs:D,elements:T,floatingStyles:I}),[c,A,D,T,I])}({strategy:"fixed",placement:S+("center"!==k?"-"+k:""),whileElementsMounted:(...e)=>(function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=n,c=eK(e),d=o||s?[...c?ez(c):[],...ez(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),s&&e.addEventListener("resize",r)});let f=c&&l?function(e,t){let r,n=null,i=eR(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(a||t(),!f||!h)return;let p={rootMargin:-G(d)+"px "+-G(i.clientWidth-(c+f))+"px "+-G(i.clientHeight-(d+h))+"px "+-G(c)+"px",threshold:K(0,W(1,l))||1},m=!0;function g(t){let n=t[0].intersectionRatio;if(n!==l){if(!m)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==n||e3(u,e.getBoundingClientRect())||s(),m=!1}try{n=new IntersectionObserver(g,{...p,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(g,p)}n.observe(e)}(!0),o}(c,r):null,h=-1,p=null;a&&(p=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),r()}),c&&!u&&p.observe(c),p.observe(t));let m=u?eX(e):null;return u&&function t(){let n=eX(e);m&&!e3(m,n)&&r(),m=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",r),s&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=p)||e.disconnect(),p=null,u&&cancelAnimationFrame(i)}})(...e,{animationFrame:"always"===$}),elements:{reference:B.anchor},middleware:[{...{name:"offset",options:o=n={mainAxis:A+ef,alignmentAxis:D},async fn(e){var t,r;let{x:n,y:i,placement:s,middlewareData:a}=e,l=await ey(e,o);return s===(null==(t=a.offset)?void 0:t.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:n+l.x,y:i+l.y,data:{...l,placement:s}}}},options:[n,i]},I&&{...{name:"shift",options:d=u={mainAxis:!0,crossAxis:!1,limiter:"partial"===_?{...(void 0===(l=s)&&(l={}),{options:l,fn(e){let{x:t,y:r,placement:n,rects:i,middlewareData:o}=e,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=Q(l,e),c={x:t,y:r},d=eo(n),f=er(d),h=c[f],p=c[d],m=Q(s,e),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){let e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,r=i.reference[f]+i.reference[e]-g.mainAxis;h<t?h=t:h>r&&(h=r)}if(u){var w,v;let e="y"===f?"width":"height",t=ex.has(ee(n)),r=i.reference[d]-i.floating[e]+(t&&(null==(w=o.offset)?void 0:w[d])||0)+(t?0:g.crossAxis),s=i.reference[d]+i.reference[e]+(t?0:(null==(v=o.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);p<r?p=r:p>s&&(p=s)}return{[f]:h,[d]:p}}}),options:[s,a]}:void 0,...eN},async fn(e){let{x:t,y:r,placement:n}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...a}=Q(d,e),l={x:t,y:r},u=await eg(e,a),c=eo(ee(n)),f=er(c),h=l[f],p=l[c];if(i){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=h+u[e],n=h-u[t];h=K(r,W(h,n))}if(o){let e="y"===c?"top":"left",t="y"===c?"bottom":"right",r=p+u[e],n=p-u[t];p=K(r,W(p,n))}let m=s.fn({...e,[f]:h,[c]:p});return{...m,data:{x:m.x-t,y:m.y-r,enabled:{[f]:i,[c]:o}}}}},options:[u,c]},I&&{...{name:"flip",options:p=f={...eN},async fn(e){var t,r,n,i,o,s,a,l;let u,c,d,{placement:f,middlewareData:h,rects:m,initialPlacement:g,platform:w,elements:v}=e,{mainAxis:x=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:N="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:R=!0,...j}=Q(p,e);if(null!=(t=h.arrow)&&t.alignmentOffset)return{};let C=ee(f),P=eo(g),M=ee(g)===g,S=await (null==w.isRTL?void 0:w.isRTL(v.floating)),A=b||(M||!R?[ed(g)]:(u=ed(g),[es(g),u,es(u)])),k="none"!==E;!b&&k&&A.push(...(c=et(g),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?el:ea;return t?ea:el;case"left":case"right":return t?eu:ec;default:return[]}}(ee(g),"start"===E,S),c&&(d=d.map(e=>e+"-"+c),R&&(d=d.concat(d.map(es)))),d));let D=[g,...A],T=await eg(e,j),I=[],O=(null==(r=h.flip)?void 0:r.overflows)||[];if(x&&I.push(T[C]),y){let e,t,r,n,i=(s=f,a=m,void 0===(l=S)&&(l=!1),e=et(s),r=en(t=er(eo(s))),n="x"===t?e===(l?"end":"start")?"right":"left":"start"===e?"bottom":"top",a.reference[r]>a.floating[r]&&(n=ed(n)),[n,ed(n)]);I.push(T[i[0]],T[i[1]])}if(O=[...O,{placement:f,overflows:I}],!I.every(e=>e<=0)){let e=((null==(n=h.flip)?void 0:n.index)||0)+1,t=D[e];if(t&&("alignment"!==y||P===eo(t)||O.every(e=>eo(e.placement)!==P||e.overflows[0]>0)))return{data:{index:e,overflows:O},reset:{placement:t}};let r=null==(i=O.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!r)switch(N){case"bestFit":{let e=null==(o=O.filter(e=>{if(k){let t=eo(e.placement);return t===P||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=g}if(f!==r)return{reset:{placement:r}}}return{}}},options:[f,h]},{...{name:"size",options:b=g={...eN,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{let{width:i,height:o}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${r}px`),s.setProperty("--radix-popper-available-height",`${n}px`),s.setProperty("--radix-popper-anchor-width",`${i}px`),s.setProperty("--radix-popper-anchor-height",`${o}px`)}},async fn(e){var t,r;let n,i,{placement:o,rects:s,platform:a,elements:l}=e,{apply:u=()=>{},...c}=Q(b,e),d=await eg(e,c),f=ee(o),h=et(o),p="y"===eo(o),{width:m,height:g}=s.floating;"top"===f||"bottom"===f?(n=f,i=h===(await (null==a.isRTL?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(i=f,n="end"===h?"top":"bottom");let w=g-d.top-d.bottom,v=m-d.left-d.right,x=W(g-d[n],w),y=W(m-d[i],v),N=!e.middlewareData.shift,E=x,R=y;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(R=v),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(E=w),N&&!h){let e=K(d.left,0),t=K(d.right,0),r=K(d.top,0),n=K(d.bottom,0);p?R=m-2*(0!==e||0!==t?e+t:K(d.left,d.right)):E=g-2*(0!==r||0!==n?r+n:K(d.top,d.bottom))}await u({...e,availableWidth:R,availableHeight:E});let j=await a.getDimensions(l.floating);return m!==j.width||g!==j.height?{reset:{rects:!0}}:{}}},options:[g,y]},J&&{...{name:"arrow",options:R=N={element:J,padding:T},fn(e){let{element:t,padding:r}="function"==typeof R?R(e):R;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?e8({element:t.current,padding:r}).fn(e):{}:t?e8({element:t,padding:r}).fn(e):{}}},options:[N,E]},tE({arrowWidth:ei,arrowHeight:ef}),H&&{...{name:"hide",options:P=j={strategy:"referenceHidden",...eN},async fn(e){let{rects:t}=e,{strategy:r="referenceHidden",...n}=Q(P,e);switch(r){case"referenceHidden":{let r=ew(await eg(e,{...n,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:ev(r)}}}case"escaped":{let r=ew(await eg(e,{...n,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:ev(r)}}}default:return{}}}},options:[j,C]}]}),[eS,eA]=tR(eC),ek=(0,w.useCallbackRef)(U);(0,v.useLayoutEffect)(()=>{eP&&ek?.()},[eP,ek]);let eD=eM.arrow?.x,eT=eM.arrow?.y,eI=eM.arrow?.centerOffset!==0,[eO,eL]=m.useState();return(0,v.useLayoutEffect)(()=>{z&&eL(window.getComputedStyle(z).zIndex)},[z]),(0,t.jsx)("div",{ref:eE.setFloating,"data-radix-popper-content-wrapper":"",style:{...ej,transform:eP?ej.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eO,"--radix-popper-transform-origin":[eM.transformOrigin?.x,eM.transformOrigin?.y].join(" "),...eM.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,t.jsx)(tg,{scope:M,placedSide:eS,onArrowChange:X,arrowX:eD,arrowY:eT,shouldHideArrow:eI,children:(0,t.jsx)(x.Primitive.div,{"data-side":eS,"data-align":eA,...q,ref:Z,style:{...q.style,animation:eP?void 0:"none"}})})})});tv.displayName=tm;var tx="PopperArrow",ty={top:"bottom",right:"left",bottom:"top",left:"right"},tb=m.forwardRef(function(e,r){let{__scopePopper:n,...i}=e,o=tw(tx,n),s=ty[o.placedSide];return(0,t.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,t.jsx)(to,{...i,ref:r,style:{...i.style,display:"block"}})})});function tN(e){return null!==e}tb.displayName=tx;var tE=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:n,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,s=o?0:e.arrowWidth,a=o?0:e.arrowHeight,[l,u]=tR(r),c={start:"0%",center:"50%",end:"100%"}[u],d=(i.arrow?.x??0)+s/2,f=(i.arrow?.y??0)+a/2,h="",p="";return"bottom"===l?(h=o?c:`${d}px`,p=`${-a}px`):"top"===l?(h=o?c:`${d}px`,p=`${n.floating.height+a}px`):"right"===l?(h=`${-a}px`,p=o?c:`${f}px`):"left"===l&&(h=`${n.floating.width+a}px`,p=o?c:`${f}px`),{data:{x:h,y:p}}}});function tR(e){let[t,r="center"]=e.split("-");return[t,r]}e.s(["Anchor",()=>tp,"Arrow",()=>tb,"Content",()=>tv,"Root",()=>tf,"createPopperScope",()=>tu],77760);var tj=e.i(61896),tC=e.i(19594),tP="rovingFocusGroup.onEntryFocus",tM={bubbles:!1,cancelable:!0},tS="RovingFocusGroup",[tA,tk,tD]=_(tS),[tT,tI]=(0,g.createContextScope)(tS,[tD]),[tO,tL]=tT(tS),tF=m.forwardRef((e,r)=>(0,t.jsx)(tA.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(tA.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(t_,{...e,ref:r})})}));tF.displayName=tS;var t_=m.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:n,orientation:i,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...f}=e,h=m.useRef(null),p=(0,O.useComposedRefs)(r,h),g=$(s),[v=null,y]=(0,L.useControllableState)({prop:a,defaultProp:l,onChange:u}),[b,N]=m.useState(!1),E=(0,w.useCallbackRef)(c),R=tk(n),j=m.useRef(!1),[C,P]=m.useState(0);return m.useEffect(()=>{let e=h.current;if(e)return e.addEventListener(tP,E),()=>e.removeEventListener(tP,E)},[E]),(0,t.jsx)(tO,{scope:n,orientation:i,dir:g,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(e=>y(e),[y]),onItemShiftTab:m.useCallback(()=>N(!0),[]),onFocusableItemAdd:m.useCallback(()=>P(e=>e+1),[]),onFocusableItemRemove:m.useCallback(()=>P(e=>e-1),[]),children:(0,t.jsx)(x.Primitive.div,{tabIndex:b||0===C?-1:0,"data-orientation":i,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:(0,I.composeEventHandlers)(e.onMouseDown,()=>{j.current=!0}),onFocus:(0,I.composeEventHandlers)(e.onFocus,e=>{let t=!j.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(tP,tM);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=R().filter(e=>e.focusable);tq([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),d)}}j.current=!1}),onBlur:(0,I.composeEventHandlers)(e.onBlur,()=>N(!1))})})}),tH="RovingFocusGroupItem",t$=m.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:n,focusable:i=!0,active:o=!1,tabStopId:s,...a}=e,l=(0,z.useId)(),u=s||l,c=tL(tH,n),d=c.currentTabStopId===u,f=tk(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(i)return h(),()=>p()},[i,h,p]),(0,t.jsx)(tA.ItemSlot,{scope:n,id:u,focusable:i,active:o,children:(0,t.jsx)(x.Primitive.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:r,onMouseDown:(0,I.composeEventHandlers)(e.onMouseDown,e=>{i?c.onItemFocus(u):e.preventDefault()}),onFocus:(0,I.composeEventHandlers)(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:(0,I.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let i=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return tU[i]}(e,c.orientation,c.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){var r,n;"prev"===t&&i.reverse();let o=i.indexOf(e.currentTarget);i=c.loop?(r=i,n=o+1,r.map((e,t)=>r[(n+t)%r.length])):i.slice(o+1)}setTimeout(()=>tq(i))}})})})});t$.displayName=tH;var tU={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tq(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",()=>t$,"Root",()=>tF,"createRovingFocusGroupScope",()=>tI],88434);var tB=e.i(89123),tz=e.i(19706),tV=["Enter"," "],tW=["ArrowUp","PageDown","End"],tK=["ArrowDown","PageUp","Home",...tW],tZ={ltr:[...tV,"ArrowRight"],rtl:[...tV,"ArrowLeft"]},tG={ltr:["ArrowLeft"],rtl:["ArrowRight"]},tJ="Menu",[tX,tY,tQ]=_(tJ),[t0,t1]=(0,g.createContextScope)(tJ,[tQ,tu,tI]),t2=tu(),t7=tI(),[t5,t4]=t0(tJ),[t9,t3]=t0(tJ),t8=e=>{let{__scopeMenu:r,open:n=!1,children:i,dir:o,onOpenChange:s,modal:a=!0}=e,l=t2(r),[u,c]=m.useState(null),d=m.useRef(!1),f=(0,w.useCallbackRef)(s),h=$(o);return m.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,t.jsx)(tf,{...l,children:(0,t.jsx)(t5,{scope:r,open:n,onOpenChange:f,content:u,onContentChange:c,children:(0,t.jsx)(t9,{scope:r,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:a,children:i})})})};t8.displayName=tJ;var t6=m.forwardRef((e,r)=>{let{__scopeMenu:n,...i}=e,o=t2(n);return(0,t.jsx)(tp,{...o,...i,ref:r})});t6.displayName="MenuAnchor";var re="MenuPortal",[rt,rr]=t0(re,{forceMount:void 0}),rn=e=>{let{__scopeMenu:r,forceMount:n,children:i,container:o}=e,s=t4(re,r);return(0,t.jsx)(rt,{scope:r,forceMount:n,children:(0,t.jsx)(tC.Presence,{present:n||s.open,children:(0,t.jsx)(tj.Portal,{asChild:!0,container:o,children:i})})})};rn.displayName=re;var ri="MenuContent",[ro,rs]=t0(ri),ra=m.forwardRef((e,r)=>{let n=rr(ri,e.__scopeMenu),{forceMount:i=n.forceMount,...o}=e,s=t4(ri,e.__scopeMenu),a=t3(ri,e.__scopeMenu);return(0,t.jsx)(tX.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(tC.Presence,{present:i||s.open,children:(0,t.jsx)(tX.Slot,{scope:e.__scopeMenu,children:a.modal?(0,t.jsx)(rl,{...o,ref:r}):(0,t.jsx)(ru,{...o,ref:r})})})})}),rl=m.forwardRef((e,r)=>{let n=t4(ri,e.__scopeMenu),i=m.useRef(null),o=(0,O.useComposedRefs)(r,i);return m.useEffect(()=>{let e=i.current;if(e)return(0,tB.hideOthers)(e)},[]),(0,t.jsx)(rc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:(0,I.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ru=m.forwardRef((e,r)=>{let n=t4(ri,e.__scopeMenu);return(0,t.jsx)(rc,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),rc=m.forwardRef((e,r)=>{let{__scopeMenu:n,loop:i=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:g,...w}=e,v=t4(ri,n),x=t3(ri,n),y=t2(n),b=t7(n),N=tY(n),[E,R]=m.useState(null),j=m.useRef(null),C=(0,O.useComposedRefs)(r,j,v.onContentChange),P=m.useRef(0),M=m.useRef(""),S=m.useRef(0),A=m.useRef(null),k=m.useRef("right"),D=m.useRef(0),T=g?tz.RemoveScroll:m.Fragment,L=g?{as:F.Slot,allowPinchZoom:!0}:void 0;m.useEffect(()=>()=>window.clearTimeout(P.current),[]),(0,q.useFocusGuards)();let _=m.useCallback(e=>{var t,r;return k.current===A.current?.side&&(t=e,!!(r=A.current?.area)&&function(e,t){let{x:r,y:n}=e,i=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){let s=t[e].x,a=t[e].y,l=t[o].x,u=t[o].y;a>n!=u>n&&r<(l-s)*(n-a)/(u-a)+s&&(i=!i)}return i}({x:t.clientX,y:t.clientY},r))},[]);return(0,t.jsx)(ro,{scope:n,searchRef:M,onItemEnter:m.useCallback(e=>{_(e)&&e.preventDefault()},[_]),onItemLeave:m.useCallback(e=>{_(e)||(j.current?.focus(),R(null))},[_]),onTriggerLeave:m.useCallback(e=>{_(e)&&e.preventDefault()},[_]),pointerGraceTimerRef:S,onPointerGraceIntentChange:m.useCallback(e=>{A.current=e},[]),children:(0,t.jsx)(T,{...L,children:(0,t.jsx)(B.FocusScope,{asChild:!0,trapped:o,onMountAutoFocus:(0,I.composeEventHandlers)(s,e=>{e.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:(0,t.jsx)(U.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:(0,t.jsx)(tF,{asChild:!0,...b,dir:x.dir,orientation:"vertical",loop:i,currentTabStopId:E,onCurrentTabStopIdChange:R,onEntryFocus:(0,I.composeEventHandlers)(u,e=>{x.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,t.jsx)(tv,{role:"menu","aria-orientation":"vertical","data-state":rL(v.open),"data-radix-menu-content":"",dir:x.dir,...y,...w,ref:C,style:{outline:"none",...w.style},onKeyDown:(0,I.composeEventHandlers)(w.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;if(t){var i;let t,o,s,a,l,u;"Tab"===e.key&&e.preventDefault(),!r&&n&&(i=e.key,t=M.current+i,o=N().filter(e=>!e.disabled),s=document.activeElement,a=o.find(e=>e.ref.current===s)?.textValue,l=function(e,t,r){var n;let i=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1,s=(n=Math.max(o,0),e.map((t,r)=>e[(n+r)%e.length]));1===i.length&&(s=s.filter(e=>e!==r));let a=s.find(e=>e.toLowerCase().startsWith(i.toLowerCase()));return a!==r?a:void 0}(o.map(e=>e.textValue),t,a),u=o.find(e=>e.textValue===l)?.ref.current,function e(t){M.current=t,window.clearTimeout(P.current),""!==t&&(P.current=window.setTimeout(()=>e(""),1e3))}(t),u&&setTimeout(()=>u.focus()))}let o=j.current;if(e.target!==o||!tK.includes(e.key))return;e.preventDefault();let s=N().filter(e=>!e.disabled).map(e=>e.ref.current);tW.includes(e.key)&&s.reverse(),function(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(s)}),onBlur:(0,I.composeEventHandlers)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(P.current),M.current="")}),onPointerMove:(0,I.composeEventHandlers)(e.onPointerMove,rH(e=>{let t=e.target,r=D.current!==e.clientX;e.currentTarget.contains(t)&&r&&(k.current=e.clientX>D.current?"right":"left",D.current=e.clientX)}))})})})})})})});ra.displayName=ri;var rd=m.forwardRef((e,r)=>{let{__scopeMenu:n,...i}=e;return(0,t.jsx)(x.Primitive.div,{role:"group",...i,ref:r})});rd.displayName="MenuGroup";var rf=m.forwardRef((e,r)=>{let{__scopeMenu:n,...i}=e;return(0,t.jsx)(x.Primitive.div,{...i,ref:r})});rf.displayName="MenuLabel";var rh="MenuItem",rp="menu.itemSelect",rm=m.forwardRef((e,r)=>{let{disabled:n=!1,onSelect:i,...o}=e,s=m.useRef(null),a=t3(rh,e.__scopeMenu),l=rs(rh,e.__scopeMenu),u=(0,O.useComposedRefs)(r,s),c=m.useRef(!1);return(0,t.jsx)(rg,{...o,ref:u,disabled:n,onClick:(0,I.composeEventHandlers)(e.onClick,()=>{let e=s.current;if(!n&&e){let t=new CustomEvent(rp,{bubbles:!0,cancelable:!0});e.addEventListener(rp,e=>i?.(e),{once:!0}),(0,x.dispatchDiscreteCustomEvent)(e,t),t.defaultPrevented?c.current=!1:a.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),c.current=!0},onPointerUp:(0,I.composeEventHandlers)(e.onPointerUp,e=>{c.current||e.currentTarget?.click()}),onKeyDown:(0,I.composeEventHandlers)(e.onKeyDown,e=>{let t=""!==l.searchRef.current;n||t&&" "===e.key||tV.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});rm.displayName=rh;var rg=m.forwardRef((e,r)=>{let{__scopeMenu:n,disabled:i=!1,textValue:o,...s}=e,a=rs(rh,n),l=t7(n),u=m.useRef(null),c=(0,O.useComposedRefs)(r,u),[d,f]=m.useState(!1),[h,p]=m.useState("");return m.useEffect(()=>{let e=u.current;e&&p((e.textContent??"").trim())},[s.children]),(0,t.jsx)(tX.ItemSlot,{scope:n,disabled:i,textValue:o??h,children:(0,t.jsx)(t$,{asChild:!0,...l,focusable:!i,children:(0,t.jsx)(x.Primitive.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...s,ref:c,onPointerMove:(0,I.composeEventHandlers)(e.onPointerMove,rH(e=>{i?a.onItemLeave(e):(a.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,I.composeEventHandlers)(e.onPointerLeave,rH(e=>a.onItemLeave(e))),onFocus:(0,I.composeEventHandlers)(e.onFocus,()=>f(!0)),onBlur:(0,I.composeEventHandlers)(e.onBlur,()=>f(!1))})})})}),rw=m.forwardRef((e,r)=>{let{checked:n=!1,onCheckedChange:i,...o}=e;return(0,t.jsx)(rj,{scope:e.__scopeMenu,checked:n,children:(0,t.jsx)(rm,{role:"menuitemcheckbox","aria-checked":rF(n)?"mixed":n,...o,ref:r,"data-state":r_(n),onSelect:(0,I.composeEventHandlers)(o.onSelect,()=>i?.(!!rF(n)||!n),{checkForDefaultPrevented:!1})})})});rw.displayName="MenuCheckboxItem";var rv="MenuRadioGroup",[rx,ry]=t0(rv,{value:void 0,onValueChange:()=>{}}),rb=m.forwardRef((e,r)=>{let{value:n,onValueChange:i,...o}=e,s=(0,w.useCallbackRef)(i);return(0,t.jsx)(rx,{scope:e.__scopeMenu,value:n,onValueChange:s,children:(0,t.jsx)(rd,{...o,ref:r})})});rb.displayName=rv;var rN="MenuRadioItem",rE=m.forwardRef((e,r)=>{let{value:n,...i}=e,o=ry(rN,e.__scopeMenu),s=n===o.value;return(0,t.jsx)(rj,{scope:e.__scopeMenu,checked:s,children:(0,t.jsx)(rm,{role:"menuitemradio","aria-checked":s,...i,ref:r,"data-state":r_(s),onSelect:(0,I.composeEventHandlers)(i.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});rE.displayName=rN;var rR="MenuItemIndicator",[rj,rC]=t0(rR,{checked:!1}),rP=m.forwardRef((e,r)=>{let{__scopeMenu:n,forceMount:i,...o}=e,s=rC(rR,n);return(0,t.jsx)(tC.Presence,{present:i||rF(s.checked)||!0===s.checked,children:(0,t.jsx)(x.Primitive.span,{...o,ref:r,"data-state":r_(s.checked)})})});rP.displayName=rR;var rM=m.forwardRef((e,r)=>{let{__scopeMenu:n,...i}=e;return(0,t.jsx)(x.Primitive.div,{role:"separator","aria-orientation":"horizontal",...i,ref:r})});rM.displayName="MenuSeparator";var rS=m.forwardRef((e,r)=>{let{__scopeMenu:n,...i}=e,o=t2(n);return(0,t.jsx)(tb,{...o,...i,ref:r})});rS.displayName="MenuArrow";var[rA,rk]=t0("MenuSub"),rD="MenuSubTrigger",rT=m.forwardRef((e,r)=>{let n=t4(rD,e.__scopeMenu),i=t3(rD,e.__scopeMenu),o=rk(rD,e.__scopeMenu),s=rs(rD,e.__scopeMenu),a=m.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,c={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{let e=l.current;return()=>{window.clearTimeout(e),u(null)}},[l,u]),(0,t.jsx)(t6,{asChild:!0,...c,children:(0,t.jsx)(rg,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":rL(n.open),...e,ref:(0,O.composeRefs)(r,o.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:(0,I.composeEventHandlers)(e.onPointerMove,rH(t=>{s.onItemEnter(t),!t.defaultPrevented&&(e.disabled||n.open||a.current||(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100)))})),onPointerLeave:(0,I.composeEventHandlers)(e.onPointerLeave,rH(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i="right"===r,o=t[i?"left":"right"],a=t[i?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+(i?-5:5),y:e.clientY},{x:o,y:t.top},{x:a,y:t.top},{x:a,y:t.bottom},{x:o,y:t.bottom}],side:r}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:(0,I.composeEventHandlers)(e.onKeyDown,t=>{let r=""!==s.searchRef.current;e.disabled||r&&" "===t.key||tZ[i.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});rT.displayName=rD;var rI="MenuSubContent",rO=m.forwardRef((e,r)=>{let n=rr(ri,e.__scopeMenu),{forceMount:i=n.forceMount,...o}=e,s=t4(ri,e.__scopeMenu),a=t3(ri,e.__scopeMenu),l=rk(rI,e.__scopeMenu),u=m.useRef(null),c=(0,O.useComposedRefs)(r,u);return(0,t.jsx)(tX.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(tC.Presence,{present:i||s.open,children:(0,t.jsx)(tX.Slot,{scope:e.__scopeMenu,children:(0,t.jsx)(rc,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:c,align:"start",side:"rtl"===a.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{a.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,I.composeEventHandlers)(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:(0,I.composeEventHandlers)(e.onEscapeKeyDown,e=>{a.onClose(),e.preventDefault()}),onKeyDown:(0,I.composeEventHandlers)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),r=tG[a.dir].includes(e.key);t&&r&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});function rL(e){return e?"open":"closed"}function rF(e){return"indeterminate"===e}function r_(e){return rF(e)?"indeterminate":e?"checked":"unchecked"}function rH(e){return t=>"mouse"===t.pointerType?e(t):void 0}rO.displayName=rI;var r$="DropdownMenu",[rU,rq]=(0,g.createContextScope)(r$,[t1]),rB=t1(),[rz,rV]=rU(r$),rW=e=>{let{__scopeDropdownMenu:r,children:n,dir:i,open:o,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,u=rB(r),c=m.useRef(null),[d=!1,f]=(0,L.useControllableState)({prop:o,defaultProp:s,onChange:a});return(0,t.jsx)(rz,{scope:r,triggerId:(0,z.useId)(),triggerRef:c,contentId:(0,z.useId)(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(e=>!e),[f]),modal:l,children:(0,t.jsx)(t8,{...u,open:d,onOpenChange:f,dir:i,modal:l,children:n})})};rW.displayName=r$;var rK="DropdownMenuTrigger",rZ=m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,disabled:i=!1,...o}=e,s=rV(rK,n),a=rB(n);return(0,t.jsx)(t6,{asChild:!0,...a,children:(0,t.jsx)(x.Primitive.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...o,ref:(0,O.composeRefs)(r,s.triggerRef),onPointerDown:(0,I.composeEventHandlers)(e.onPointerDown,e=>{!i&&0===e.button&&!1===e.ctrlKey&&(s.onOpenToggle(),s.open||e.preventDefault())}),onKeyDown:(0,I.composeEventHandlers)(e.onKeyDown,e=>{!i&&(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});rZ.displayName=rK;var rG=e=>{let{__scopeDropdownMenu:r,...n}=e,i=rB(r);return(0,t.jsx)(rn,{...i,...n})};rG.displayName="DropdownMenuPortal";var rJ="DropdownMenuContent",rX=m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rV(rJ,n),s=rB(n),a=m.useRef(!1);return(0,t.jsx)(ra,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...i,ref:r,onCloseAutoFocus:(0,I.composeEventHandlers)(e.onCloseAutoFocus,e=>{a.current||o.triggerRef.current?.focus(),a.current=!1,e.preventDefault()}),onInteractOutside:(0,I.composeEventHandlers)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!o.modal||n)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});rX.displayName=rJ,m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rB(n);return(0,t.jsx)(rd,{...o,...i,ref:r})}).displayName="DropdownMenuGroup";var rY=m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rB(n);return(0,t.jsx)(rf,{...o,...i,ref:r})});rY.displayName="DropdownMenuLabel";var rQ=m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rB(n);return(0,t.jsx)(rm,{...o,...i,ref:r})});rQ.displayName="DropdownMenuItem",m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rB(n);return(0,t.jsx)(rw,{...o,...i,ref:r})}).displayName="DropdownMenuCheckboxItem",m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rB(n);return(0,t.jsx)(rb,{...o,...i,ref:r})}).displayName="DropdownMenuRadioGroup",m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rB(n);return(0,t.jsx)(rE,{...o,...i,ref:r})}).displayName="DropdownMenuRadioItem",m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rB(n);return(0,t.jsx)(rP,{...o,...i,ref:r})}).displayName="DropdownMenuItemIndicator";var r0=m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rB(n);return(0,t.jsx)(rM,{...o,...i,ref:r})});r0.displayName="DropdownMenuSeparator",m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rB(n);return(0,t.jsx)(rS,{...o,...i,ref:r})}).displayName="DropdownMenuArrow",m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rB(n);return(0,t.jsx)(rT,{...o,...i,ref:r})}).displayName="DropdownMenuSubTrigger",m.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...i}=e,o=rB(n);return(0,t.jsx)(rO,{...o,...i,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";let r1=(0,i.default)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function r2({...e}){return(0,t.jsx)(rW,{"data-slot":"dropdown-menu",...e})}function r7({...e}){return(0,t.jsx)(rZ,{"data-slot":"dropdown-menu-trigger",...e})}function r5({className:e,sideOffset:r=4,...n}){return(0,t.jsx)(rG,{children:(0,t.jsx)(rX,{"data-slot":"dropdown-menu-content",sideOffset:r,className:(0,A.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function r4({className:e,inset:r,variant:n="default",...i}){return(0,t.jsx)(rQ,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":n,className:(0,A.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i})}function r9({className:e,inset:r,...n}){return(0,t.jsx)(rY,{"data-slot":"dropdown-menu-label","data-inset":r,className:(0,A.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function r3({className:e,...r}){return(0,t.jsx)(r0,{"data-slot":"dropdown-menu-separator",className:(0,A.cn)("bg-border -mx-1 my-1 h-px",e),...r})}e.s(["default",()=>r1],99490),e.s(["CheckIcon",()=>r1],68072),(0,i.default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),(0,i.default)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),e.s(["DropdownMenu",()=>r2,"DropdownMenuContent",()=>r5,"DropdownMenuItem",()=>r4,"DropdownMenuLabel",()=>r9,"DropdownMenuSeparator",()=>r3,"DropdownMenuTrigger",()=>r7],99495);var r8=e.i(92879),r6=e.i(69074),ne=e.i(87830),nt=e.i(75212);e.i(34526);var nr=e.i(51322);globalThis.prisma??new nr.PrismaClient;let nn={canCreate:e=>"OWNER"===e||"EDITOR"===e,canCreateTree:e=>!0,canUpdate:e=>"OWNER"===e||"EDITOR"===e,canImport:e=>"OWNER"===e||"EDITOR"===e,canDeleteMember:e=>"OWNER"===e||"EDITOR"===e,canDeleteTree:e=>"OWNER"===e,canClearData:e=>"OWNER"===e,canInviteCollaborators:e=>"OWNER"===e,canRemoveCollaborators:e=>"OWNER"===e,canManageCollaborators:e=>"OWNER"===e,canView:e=>!0,canSearch:e=>!0,canExport:e=>!0,canPrint:e=>!0};function ni(){let{searchMembers:e,searchResults:i}=(0,r8.useFamily)(),{data:g,status:w}=(0,ne.useSession)(),{showAlert:v,showConfirm:x,showPrompt:y}=(0,nt.useDialog)();(0,r6.usePathname)();let b=(0,r6.useSearchParams)(),[N,E]=(0,m.useState)(""),[R,j]=(0,m.useState)(!1),[C,P]=(0,m.useState)([]),[M,S]=(0,m.useState)(null),[A,I]=(0,m.useState)(null),O=(0,m.useRef)(null),L=(0,r6.useRouter)();b.get("view");let F=e=>M?.id?`${e}?treeId=${M.id}`:e,_=async()=>{await (0,ne.signOut)({callbackUrl:"/auth/signin"})},H=async(e,t)=>{if(t.stopPropagation(),e.ownerId!==g?.user?.id)return void await v("只有家族树的创建者才能删除","权限不足");let r=`确定要删除家族树"${e.name}"吗?
此操作将永久删除所有成员、活动日志和协作者数据,且不可撤销!`;if(await x(r,"删除家族树","destructive")){if(await y(`请输入家族树名称"${e.name}"以确认删除:`,"","确认删除")!==e.name)return void await v("名称不匹配,删除已取消","操作已取消");I(e.id);try{let t=await fetch(`/api/trees/${e.id}`,{method:"DELETE"});if(!t.ok){let e=await t.json();throw Error(e.error||"删除失败")}await $(),M?.id===e.id&&(window.location.href="/")}catch(e){console.error("删除家族树失败:",e),await v("删除失败:"+e.message,"错误")}finally{I(null)}}},$=(0,m.useCallback)(()=>{if(!g?.user?.id||"authenticated"!==w)return;let e=new AbortController;return fetch("/api/trees",{signal:e.signal}).then(e=>{if(!e.ok)throw Error(`HTTP error! status: ${e.status}`);return e.json()}).then(e=>{if(e.trees){P(e.trees);let t=new URLSearchParams(window.location.search).get("treeId");if(t){let r=e.trees.find(e=>e.id===t);r?S(r):e.trees.length>0&&S(e.trees[0])}else e.trees.length>0&&S(e.trees[0])}}).catch(e=>{"AbortError"!==e.name&&"Failed to fetch"!==e.message&&console.error("获取家族树列表失败:",e)}),()=>e.abort()},[g?.user?.id,w]);return(0,m.useEffect)(()=>{$()},[$]),(0,m.useEffect)(()=>{let e=()=>{$()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[$]),(0,m.useEffect)(()=>{function e(e){O.current&&!O.current.contains(e.target)&&j(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsx)("header",{className:"sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:(0,t.jsxs)("div",{className:"container mx-auto flex h-16 items-center px-4",children:[(0,t.jsxs)("div",{className:"mr-8 flex items-center gap-4",children:[(0,t.jsxs)(r.default,{href:"/",className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-primary text-primary-foreground",children:(0,t.jsx)(n.BookOpen,{className:"h-5 w-5"})}),(0,t.jsx)("span",{className:"text-xl font-serif font-bold tracking-tight",children:"华夏家谱"})]}),g&&C.length>0&&(0,t.jsxs)(r2,{children:[(0,t.jsx)(r7,{asChild:!0,children:(0,t.jsxs)(h.Button,{variant:"outline",className:"gap-2 min-w-[200px]",children:[(0,t.jsx)("span",{className:"flex-1 truncate text-left",children:M?.name||"选择家族树"}),(0,t.jsx)(l,{className:"h-4 w-4 flex-shrink-0"})]})}),(0,t.jsxs)(r5,{align:"start",className:"w-[300px]",children:[(0,t.jsx)(r9,{className:"font-light",children:"我的家族树"}),(0,t.jsx)(r3,{}),C.map(e=>(0,t.jsxs)(r4,{onClick:()=>{S(e);let t=window.location.pathname;L.push(`${t}?treeId=${e.id}`)},className:"cursor-pointer flex items-center justify-between group py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"truncate flex-1",children:e.name}),(e=>{switch(e){case"OWNER":return(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-purple-100 text-purple-700 border border-purple-200 ml-2",children:"所有者"});case"EDITOR":return(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-blue-100 text-blue-700 border border-blue-200 ml-2",children:"编辑"});case"VIEWER":return(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-gray-100 text-gray-700 border border-gray-200 ml-2",children:"查看"});default:return null}})(e.currentUserRole),M?.id===e.id&&(0,t.jsx)("span",{className:"text-primary flex-shrink-0",children:"✓"})]}),nn.canDeleteTree(e.currentUserRole)&&(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 ml-2 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:t=>H(e,t),disabled:A===e.id,children:(0,t.jsx)(c,{className:"h-3 w-3"})})]},e.id)),(0,t.jsx)(r3,{}),g&&(0,t.jsxs)(r4,{onClick:()=>L.push("/trees/new"),className:"gap-2",children:[(0,t.jsx)(u,{className:"h-4 w-4"}),"创建新家族树"]})]})]})]}),(0,t.jsxs)("nav",{className:"hidden md:flex items-center gap-6 text-sm font-medium text-muted-foreground",children:[(0,t.jsx)(r.default,{href:F("/"),className:"transition-colors hover:text-foreground data-[active=true]:text-foreground data-[active=true]:font-semibold",children:"总览 (Overview)"}),(0,t.jsx)(r.default,{href:F("/tree"),className:"transition-colors hover:text-foreground",children:"族谱 (Tree)"}),(0,t.jsx)(r.default,{href:F("/members"),className:"transition-colors hover:text-foreground",children:"成员 (Members)"}),(0,t.jsx)(r.default,{href:F("/timeline"),className:"transition-colors hover:text-foreground",children:"大事记 (Timeline)"})]}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"relative hidden sm:block",ref:O,children:[(0,t.jsx)(o,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(p.Input,{type:"search",placeholder:"搜索成员...",value:N,onChange:t=>{var r;E(r=t.target.value),e(r),j(r.length>0)},className:"h-9 w-64 rounded-full bg-muted pl-9 text-sm focus-visible:ring-primary"}),R&&i.length>0&&(0,t.jsx)("div",{className:"absolute top-full mt-2 w-full bg-background border border-border rounded-lg shadow-lg max-h-96 overflow-y-auto z-50",children:i.map(e=>(0,t.jsx)("button",{onClick:()=>{var t;return t=e.id,void(L.push(`/members/${t}`),E(""),j(!1))},className:"w-full px-4 py-3 text-left hover:bg-muted transition-colors border-b border-border last:border-0",children:(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.fullName}),(0,t.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded ${"MALE"===e.gender?"bg-blue-100 text-blue-700":"bg-pink-100 text-pink-700"}`,children:"MALE"===e.gender?"男":"女"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["第",e.generation,"世"]})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:[e.birthDate&&`生于 ${e.birthDate}`,e.birthPlace&&` \xb7 ${e.birthPlace}`]})]})})},e.id))}),R&&N&&0===i.length&&(0,t.jsx)("div",{className:"absolute top-full mt-2 w-full bg-background border border-border rounded-lg shadow-lg p-4 text-center text-sm text-muted-foreground z-50",children:"未找到匹配的成员"})]}),(0,t.jsx)(r.default,{href:"/relationship",children:(0,t.jsxs)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",children:[(0,t.jsx)(d,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"sr-only",children:"Relationship Calculator"})]})}),(0,t.jsx)(r.default,{href:"/settings",children:(0,t.jsxs)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",children:[(0,t.jsx)(s,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"sr-only",children:"Settings"})]})}),(0,t.jsx)(r.default,{href:"/help",children:(0,t.jsxs)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",children:[(0,t.jsx)(f,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"sr-only",children:"Help"})]})}),"loading"===w?(0,t.jsx)(k,{className:"h-8 w-8 border border-border",children:(0,t.jsx)(T,{children:"..."})}):g?(0,t.jsxs)(r2,{children:[(0,t.jsx)(r7,{asChild:!0,children:(0,t.jsx)(h.Button,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:(0,t.jsxs)(k,{className:"h-8 w-8 border border-border",children:[(0,t.jsx)(D,{src:void 0,alt:g.user?.name||"User"}),(0,t.jsx)(T,{children:g?.user?.name?g.user.name.charAt(0).toUpperCase():g?.user?.email?g.user.email.charAt(0).toUpperCase():"U"})]})})}),(0,t.jsxs)(r5,{className:"w-56",align:"end",forceMount:!0,children:[(0,t.jsx)(r9,{className:"font-normal",children:(0,t.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium leading-none",children:g.user?.name||"用户"}),(0,t.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:g.user?.email})]})}),(0,t.jsx)(r3,{}),(0,t.jsx)(r4,{asChild:!0,children:(0,t.jsxs)(r.default,{href:"/settings",className:"cursor-pointer",children:[(0,t.jsx)(s,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{children:"系统设置"})]})}),(0,t.jsx)(r3,{}),(0,t.jsxs)(r4,{onClick:_,className:"cursor-pointer text-red-600",children:[(0,t.jsx)(a,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{children:"退出登录"})]})]})]}):(0,t.jsx)(r.default,{href:"/auth/signin",children:(0,t.jsx)(h.Button,{variant:"default",size:"sm",children:"登录"})})]})]})})}e.s(["permissions",0,nn],59210),e.s(["SiteHeader",()=>ni],82772)}]);