beesoft-components 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +305 -307
- package/dist/index.es.js.gz +0 -0
- package/dist/index.umd.js +9 -9
- package/dist/index.umd.js.gz +0 -0
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -11,19 +11,19 @@ or
|
|
|
11
11
|
|
|
12
12
|
bash: npm install skia-canvas
|
|
13
13
|
js: import "konva/skia-backend";
|
|
14
|
-
`,c5=()=>{if(typeof document>"u")throw new Error(TT)};class Qi{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new Qi(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){const i=this.m;return{x:i[0]*t.x+i[2]*t.y+i[4],y:i[1]*t.x+i[3]*t.y+i[5]}}translate(t,i){return this.m[4]+=this.m[0]*t+this.m[2]*i,this.m[5]+=this.m[1]*t+this.m[3]*i,this}scale(t,i){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=i,this.m[3]*=i,this}rotate(t){const i=Math.cos(t),s=Math.sin(t),u=this.m[0]*i+this.m[2]*s,c=this.m[1]*i+this.m[3]*s,f=this.m[0]*-s+this.m[2]*i,p=this.m[1]*-s+this.m[3]*i;return this.m[0]=u,this.m[1]=c,this.m[2]=f,this.m[3]=p,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,i){const s=this.m[0]+this.m[2]*i,u=this.m[1]+this.m[3]*i,c=this.m[2]+this.m[0]*t,f=this.m[3]+this.m[1]*t;return this.m[0]=s,this.m[1]=u,this.m[2]=c,this.m[3]=f,this}multiply(t){const i=this.m[0]*t.m[0]+this.m[2]*t.m[1],s=this.m[1]*t.m[0]+this.m[3]*t.m[1],u=this.m[0]*t.m[2]+this.m[2]*t.m[3],c=this.m[1]*t.m[2]+this.m[3]*t.m[3],f=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],p=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=i,this.m[1]=s,this.m[2]=u,this.m[3]=c,this.m[4]=f,this.m[5]=p,this}invert(){const t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),i=this.m[3]*t,s=-this.m[1]*t,u=-this.m[2]*t,c=this.m[0]*t,f=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),p=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=i,this.m[1]=s,this.m[2]=u,this.m[3]=c,this.m[4]=f,this.m[5]=p,this}getMatrix(){return this.m}decompose(){const t=this.m[0],i=this.m[1],s=this.m[2],u=this.m[3],c=this.m[4],f=this.m[5],p=t*u-i*s,m={x:c,y:f,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||i!=0){const S=Math.sqrt(t*t+i*i);m.rotation=i>0?Math.acos(t/S):-Math.acos(t/S),m.scaleX=S,m.scaleY=p/S,m.skewX=(t*s+i*u)/p,m.skewY=0}else if(s!=0||u!=0){const S=Math.sqrt(s*s+u*u);m.rotation=Math.PI/2-(u>0?Math.acos(-s/S):-Math.acos(s/S)),m.scaleX=p/S,m.scaleY=S,m.skewX=0,m.skewY=(t*s+i*u)/p}return m.rotation=k._getRotation(m.rotation),m}}const CT="[object Array]",_T="[object Number]",xT="[object String]",DT="[object Boolean]",AT=Math.PI/180,MT=180/Math.PI,Hp="#",NT="",OT="0",RT="Konva warning: ",f5="Konva error: ",zT="rgb(",S2={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},HT=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let E1=[],wp=null;const wT=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(n){setTimeout(n,60)},k={_isElement(n){return!!(n&&n.nodeType==1)},_isFunction(n){return!!(n&&n.constructor&&n.call&&n.apply)},_isPlainObject(n){return!!n&&n.constructor===Object},_isArray(n){return Object.prototype.toString.call(n)===CT},_isNumber(n){return Object.prototype.toString.call(n)===_T&&!isNaN(n)&&isFinite(n)},_isString(n){return Object.prototype.toString.call(n)===xT},_isBoolean(n){return Object.prototype.toString.call(n)===DT},isObject(n){return n instanceof Object},isValidSelector(n){if(typeof n!="string")return!1;const t=n[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(n){return n===0||n>0?1:-1},requestAnimFrame(n){E1.push(n),E1.length===1&&wT(function(){const t=E1;E1=[],t.forEach(function(i){i()})})},createCanvasElement(){c5();const n=document.createElement("canvas");try{n.style=n.style||{}}catch{}return n},createImageElement(){return c5(),document.createElement("img")},_isInDocument(n){for(;n=n.parentNode;)if(n==document)return!0;return!1},_urlToImage(n,t){const i=k.createImageElement();i.onload=function(){t(i)},i.src=n},_rgbToHex(n,t,i){return((1<<24)+(n<<16)+(t<<8)+i).toString(16).slice(1)},_hexToRgb(n){n=n.replace(Hp,NT);const t=parseInt(n,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){let n=(Math.random()*16777215<<0).toString(16);for(;n.length<6;)n=OT+n;return Hp+n},isCanvasFarblingActive(){if(wp!==null)return wp;if(typeof document>"u")return wp=!1,!1;const n=this.createCanvasElement();n.width=10,n.height=10;const t=n.getContext("2d",{willReadFrequently:!0});t.clearRect(0,0,10,10),t.fillStyle="#282828",t.fillRect(0,0,10,10);const i=t.getImageData(0,0,10,10).data;let s=!1;for(let u=0;u<100;u++)if(i[u*4]!==40||i[u*4+1]!==40||i[u*4+2]!==40||i[u*4+3]!==255){s=!0;break}return wp=s,this.releaseCanvas(n),wp},getHitColor(){const n=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(n):n},getHitColorKey(n,t,i){return this.isCanvasFarblingActive()&&(n=Math.round(n/5)*5,t=Math.round(t/5)*5,i=Math.round(i/5)*5),Hp+this._rgbToHex(n,t,i)},getSnappedHexColor(n){const t=this._hexToRgb(n);return Hp+this._rgbToHex(Math.round(t.r/5)*5,Math.round(t.g/5)*5,Math.round(t.b/5)*5)},getRGB(n){let t;return n in S2?(t=S2[n],{r:t[0],g:t[1],b:t[2]}):n[0]===Hp?this._hexToRgb(n.substring(1)):n.substr(0,4)===zT?(t=HT.exec(n.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(n){return n=n||"black",k._namedColorToRBA(n)||k._hex3ColorToRGBA(n)||k._hex4ColorToRGBA(n)||k._hex6ColorToRGBA(n)||k._hex8ColorToRGBA(n)||k._rgbColorToRGBA(n)||k._rgbaColorToRGBA(n)||k._hslColorToRGBA(n)},_namedColorToRBA(n){const t=S2[n.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(n){if(n.indexOf("rgb(")===0){n=n.match(/rgb\(([^)]+)\)/)[1];const t=n.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(n){if(n.indexOf("rgba(")===0){n=n.match(/rgba\(([^)]+)\)/)[1];const t=n.split(/ *, */).map((i,s)=>i.slice(-1)==="%"?s===3?parseInt(i)/100:parseInt(i)/100*255:Number(i));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(n){if(n[0]==="#"&&n.length===9)return{r:parseInt(n.slice(1,3),16),g:parseInt(n.slice(3,5),16),b:parseInt(n.slice(5,7),16),a:parseInt(n.slice(7,9),16)/255}},_hex6ColorToRGBA(n){if(n[0]==="#"&&n.length===7)return{r:parseInt(n.slice(1,3),16),g:parseInt(n.slice(3,5),16),b:parseInt(n.slice(5,7),16),a:1}},_hex4ColorToRGBA(n){if(n[0]==="#"&&n.length===5)return{r:parseInt(n[1]+n[1],16),g:parseInt(n[2]+n[2],16),b:parseInt(n[3]+n[3],16),a:parseInt(n[4]+n[4],16)/255}},_hex3ColorToRGBA(n){if(n[0]==="#"&&n.length===4)return{r:parseInt(n[1]+n[1],16),g:parseInt(n[2]+n[2],16),b:parseInt(n[3]+n[3],16),a:1}},_hslColorToRGBA(n){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(n)){const[t,...i]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(n),s=Number(i[0])/360,u=Number(i[1])/100,c=Number(i[2])/100;let f,p,m;if(u===0)return m=c*255,{r:Math.round(m),g:Math.round(m),b:Math.round(m),a:1};c<.5?f=c*(1+u):f=c+u-c*u;const S=2*c-f,b=[0,0,0];for(let _=0;_<3;_++)p=s+1/3*-(_-1),p<0&&p++,p>1&&p--,6*p<1?m=S+(f-S)*6*p:2*p<1?m=f:3*p<2?m=S+(f-S)*(2/3-p)*6:m=S,b[_]=m*255;return{r:Math.round(b[0]),g:Math.round(b[1]),b:Math.round(b[2]),a:1}}},haveIntersection(n,t){return!(t.x>n.x+n.width||t.x+t.width<n.x||t.y>n.y+n.height||t.y+t.height<n.y)},cloneObject(n){const t={};for(const i in n)this._isPlainObject(n[i])?t[i]=this.cloneObject(n[i]):this._isArray(n[i])?t[i]=this.cloneArray(n[i]):t[i]=n[i];return t},cloneArray(n){return n.slice(0)},degToRad(n){return n*AT},radToDeg(n){return n*MT},_degToRad(n){return k.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),k.degToRad(n)},_radToDeg(n){return k.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),k.radToDeg(n)},_getRotation(n){return Ot.angleDeg?k.radToDeg(n):n},_capitalize(n){return n.charAt(0).toUpperCase()+n.slice(1)},throw(n){throw new Error(f5+n)},error(n){console.error(f5+n)},warn(n){Ot.showWarnings&&console.warn(RT+n)},each(n,t){for(const i in n)t(i,n[i])},_inRange(n,t,i){return t<=n&&n<i},_getProjectionToSegment(n,t,i,s,u,c){let f,p,m;const S=(n-i)*(n-i)+(t-s)*(t-s);if(S==0)f=n,p=t,m=(u-i)*(u-i)+(c-s)*(c-s);else{const b=((u-n)*(i-n)+(c-t)*(s-t))/S;b<0?(f=n,p=t,m=(n-u)*(n-u)+(t-c)*(t-c)):b>1?(f=i,p=s,m=(i-u)*(i-u)+(s-c)*(s-c)):(f=n+b*(i-n),p=t+b*(s-t),m=(f-u)*(f-u)+(p-c)*(p-c))}return[f,p,m]},_getProjectionToLine(n,t,i){const s=k.cloneObject(n);let u=Number.MAX_VALUE;return t.forEach(function(c,f){if(!i&&f===t.length-1)return;const p=t[(f+1)%t.length],m=k._getProjectionToSegment(c.x,c.y,p.x,p.y,n.x,n.y),S=m[0],b=m[1],_=m[2];_<u&&(s.x=S,s.y=b,u=_)}),s},_prepareArrayForTween(n,t,i){const s=[],u=[];if(n.length>t.length){const f=t;t=n,n=f}for(let f=0;f<n.length;f+=2)s.push({x:n[f],y:n[f+1]});for(let f=0;f<t.length;f+=2)u.push({x:t[f],y:t[f+1]});const c=[];return u.forEach(function(f){const p=k._getProjectionToLine(f,s,i);c.push(p.x),c.push(p.y)}),c},_prepareToStringify(n){let t;n.visitedByCircularReferenceRemoval=!0;for(const i in n)if(n.hasOwnProperty(i)&&n[i]&&typeof n[i]=="object"){if(t=Object.getOwnPropertyDescriptor(n,i),n[i].visitedByCircularReferenceRemoval||k._isElement(n[i]))if(t.configurable)delete n[i];else return null;else if(k._prepareToStringify(n[i])===null)if(t.configurable)delete n[i];else return null}return delete n.visitedByCircularReferenceRemoval,n},_assign(n,t){for(const i in t)n[i]=t[i];return n},_getFirstPointerId(n){return n.touches?n.changedTouches[0].identifier:n.pointerId||999},releaseCanvas(...n){Ot.releaseCanvasOnDestroy&&n.forEach(t=>{t.width=0,t.height=0})},drawRoundedRectPath(n,t,i,s){let u=t<0?t:0,c=i<0?i:0;t=Math.abs(t),i=Math.abs(i);let f=0,p=0,m=0,S=0;typeof s=="number"?f=p=m=S=Math.min(s,t/2,i/2):(f=Math.min(s[0]||0,t/2,i/2),p=Math.min(s[1]||0,t/2,i/2),S=Math.min(s[2]||0,t/2,i/2),m=Math.min(s[3]||0,t/2,i/2)),n.moveTo(u+f,c),n.lineTo(u+t-p,c),n.arc(u+t-p,c+p,p,Math.PI*3/2,0,!1),n.lineTo(u+t,c+i-S),n.arc(u+t-S,c+i-S,S,0,Math.PI/2,!1),n.lineTo(u+m,c+i),n.arc(u+m,c+i-m,m,Math.PI/2,Math.PI,!1),n.lineTo(u,c+f),n.arc(u+f,c+f,f,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(n,t,i,s,u){s=Math.abs(s);for(let c=0;c<i;c++){const f=t[(c-1+i)%i],p=t[c],m=t[(c+1)%i],S={x:p.x-f.x,y:p.y-f.y},b={x:m.x-p.x,y:m.y-p.y},_=Math.hypot(S.x,S.y),x=Math.hypot(b.x,b.y);let D;typeof u=="number"?D=u:D=c<u.length?u[c]:0,D=s*Math.cos(Math.PI/i)*Math.min(1,D/s*2);const N={x:S.x/_,y:S.y/_},R={x:b.x/x,y:b.y/x},O={x:p.x-N.x*D,y:p.y-N.y*D},U={x:p.x+R.x*D,y:p.y+R.y*D};c===0?n.moveTo(O.x,O.y):n.lineTo(O.x,O.y),n.arcTo(p.x,p.y,U.x,U.y,D)}}};function UT(n){const t=[],i=n.length,s=k;for(let u=0;u<i;u++){let c=n[u];s._isNumber(c)?c=Math.round(c*1e3)/1e3:s._isString(c)||(c=c+""),t.push(c)}return t}const h5=",",BT="(",VT=")",GT="([",jT="])",LT=";",PT="()",YT="=",d5=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],qT=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],XT=100;let T1=null;function p5(){if(T1!==null)return T1;try{const t=k.createCanvasElement().getContext("2d");return t?!!t&&"filter"in t:(T1=!1,!1)}catch{return T1=!1,!1}}class C1{constructor(t){this.canvas=t,Ot.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,i){let s=this.traceArr,u=s.length,c="",f,p,m,S;for(f=0;f<u;f++)p=s[f],m=p.method,m?(S=p.args,c+=m,t?c+=PT:k._isArray(S[0])?c+=GT+S.join(h5)+jT:(i&&(S=S.map(b=>typeof b=="number"?Math.floor(b):b)),c+=BT+S.join(h5)+VT)):(c+=p.property,t||(c+=YT+p.val)),c+=LT;return c}clearTrace(){this.traceArr=[]}_trace(t){let i=this.traceArr,s;i.push(t),s=i.length,s>=XT&&i.shift()}reset(){const t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){const i=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,i.getWidth()/i.pixelRatio,i.getHeight()/i.pixelRatio)}_applyLineCap(t){const i=t.attrs.lineCap;i&&this.setAttr("lineCap",i)}_applyOpacity(t){const i=t.getAbsoluteOpacity();i!==1&&this.setAttr("globalAlpha",i)}_applyLineJoin(t){const i=t.attrs.lineJoin;i&&this.setAttr("lineJoin",i)}_applyMiterLimit(t){const i=t.attrs.miterLimit;i!=null&&this.setAttr("miterLimit",i)}setAttr(t,i){this._context[t]=i}arc(t,i,s,u,c,f){this._context.arc(t,i,s,u,c,f)}arcTo(t,i,s,u,c){this._context.arcTo(t,i,s,u,c)}beginPath(){this._context.beginPath()}bezierCurveTo(t,i,s,u,c,f){this._context.bezierCurveTo(t,i,s,u,c,f)}clearRect(t,i,s,u){this._context.clearRect(t,i,s,u)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,i){const s=arguments;if(s.length===2)return this._context.createImageData(t,i);if(s.length===1)return this._context.createImageData(t)}createLinearGradient(t,i,s,u){return this._context.createLinearGradient(t,i,s,u)}createPattern(t,i){return this._context.createPattern(t,i)}createRadialGradient(t,i,s,u,c,f){return this._context.createRadialGradient(t,i,s,u,c,f)}drawImage(t,i,s,u,c,f,p,m,S){const b=arguments,_=this._context;b.length===3?_.drawImage(t,i,s):b.length===5?_.drawImage(t,i,s,u,c):b.length===9&&_.drawImage(t,i,s,u,c,f,p,m,S)}ellipse(t,i,s,u,c,f,p,m){this._context.ellipse(t,i,s,u,c,f,p,m)}isPointInPath(t,i,s,u){return s?this._context.isPointInPath(s,t,i,u):this._context.isPointInPath(t,i,u)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,i,s,u){this._context.fillRect(t,i,s,u)}strokeRect(t,i,s,u){this._context.strokeRect(t,i,s,u)}fillText(t,i,s,u){u?this._context.fillText(t,i,s,u):this._context.fillText(t,i,s)}measureText(t){return this._context.measureText(t)}getImageData(t,i,s,u){return this._context.getImageData(t,i,s,u)}lineTo(t,i){this._context.lineTo(t,i)}moveTo(t,i){this._context.moveTo(t,i)}rect(t,i,s,u){this._context.rect(t,i,s,u)}roundRect(t,i,s,u,c){this._context.roundRect(t,i,s,u,c)}putImageData(t,i,s){this._context.putImageData(t,i,s)}quadraticCurveTo(t,i,s,u){this._context.quadraticCurveTo(t,i,s,u)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,i){this._context.scale(t,i)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,i,s,u,c,f){this._context.setTransform(t,i,s,u,c,f)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,i,s,u){this._context.strokeText(t,i,s,u)}transform(t,i,s,u,c,f){this._context.transform(t,i,s,u,c,f)}translate(t,i){this._context.translate(t,i)}_enableTrace(){let t=this,i=d5.length,s=this.setAttr,u,c;const f=function(p){let m=t[p],S;t[p]=function(){return c=UT(Array.prototype.slice.call(arguments,0)),S=m.apply(t,arguments),t._trace({method:p,args:c}),S}};for(u=0;u<i;u++)f(d5[u]);t.setAttr=function(){s.apply(t,arguments);const p=arguments[0];let m=arguments[1];(p==="shadowOffsetX"||p==="shadowOffsetY"||p==="shadowBlur")&&(m=m/this.canvas.getPixelRatio()),t._trace({property:p,val:m})}}_applyGlobalCompositeOperation(t){const i=t.attrs.globalCompositeOperation;!i||i==="source-over"||this.setAttr("globalCompositeOperation",i)}}qT.forEach(function(n){Object.defineProperty(C1.prototype,n,{get(){return this._context[n]},set(t){this._context[n]=t}})});class KT extends C1{constructor(t,{willReadFrequently:i=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:i})}_fillColor(t){const i=t.fill();this.setAttr("fillStyle",i),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){const i=t._getLinearGradient();i&&(this.setAttr("fillStyle",i),t._fillFunc(this))}_fillRadialGradient(t){const i=t._getRadialGradient();i&&(this.setAttr("fillStyle",i),t._fillFunc(this))}_fill(t){const i=t.fill(),s=t.getFillPriority();if(i&&s==="color"){this._fillColor(t);return}const u=t.getFillPatternImage();if(u&&s==="pattern"){this._fillPattern(t);return}const c=t.getFillLinearGradientColorStops();if(c&&s==="linear-gradient"){this._fillLinearGradient(t);return}const f=t.getFillRadialGradientColorStops();if(f&&s==="radial-gradient"){this._fillRadialGradient(t);return}i?this._fillColor(t):u?this._fillPattern(t):c?this._fillLinearGradient(t):f&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const i=t.getStrokeLinearGradientStartPoint(),s=t.getStrokeLinearGradientEndPoint(),u=t.getStrokeLinearGradientColorStops(),c=this.createLinearGradient(i.x,i.y,s.x,s.y);if(u){for(let f=0;f<u.length;f+=2)c.addColorStop(u[f],u[f+1]);this.setAttr("strokeStyle",c)}}_stroke(t){const i=t.dash(),s=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!s){this.save();const c=this.getCanvas().getPixelRatio();this.setTransform(c,0,0,c,0,0)}this._applyLineCap(t),i&&t.dashEnabled()&&(this.setLineDash(i),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),t.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),s||this.restore()}}_applyShadow(t){var i,s,u;const c=(i=t.getShadowRGBA())!==null&&i!==void 0?i:"black",f=(s=t.getShadowBlur())!==null&&s!==void 0?s:5,p=(u=t.getShadowOffset())!==null&&u!==void 0?u:{x:0,y:0},m=t.getAbsoluteScale(),S=this.canvas.getPixelRatio(),b=m.x*S,_=m.y*S;this.setAttr("shadowColor",c),this.setAttr("shadowBlur",f*Math.min(Math.abs(b),Math.abs(_))),this.setAttr("shadowOffsetX",p.x*b),this.setAttr("shadowOffsetY",p.y*_)}}class QT extends C1{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const i=t.getStrokeScaleEnabled();if(!i){this.save();const c=this.getCanvas().getPixelRatio();this.setTransform(c,0,0,c,0,0)}this._applyLineCap(t);const s=t.hitStrokeWidth(),u=s==="auto"?t.strokeWidth():s;this.setAttr("lineWidth",u),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),i||this.restore()}}}let _1;function ZT(){if(_1)return _1;const n=k.createCanvasElement(),t=n.getContext("2d");return _1=(function(){const i=Ot._global.devicePixelRatio||1,s=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/s})(),k.releaseCanvas(n),_1}class b2{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const s=(t||{}).pixelRatio||Ot.pixelRatio||ZT();this.pixelRatio=s,this._canvas=k.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){const i=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/i,this.getHeight()/i)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";const i=this.pixelRatio;this.getContext()._context.scale(i,i)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";const i=this.pixelRatio;this.getContext()._context.scale(i,i)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,i){this.setWidth(t||0),this.setHeight(i||0)}toDataURL(t,i){try{return this._canvas.toDataURL(t,i)}catch{try{return this._canvas.toDataURL()}catch(u){return k.error("Unable to get data URL. "+u.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class Vo extends b2{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new KT(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}class E2 extends b2{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new QT(this),this.setSize(t.width,t.height)}}const Ne={get isDragging(){let n=!1;return Ne._dragElements.forEach(t=>{t.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){let n;return Ne._dragElements.forEach(t=>{n=t.node}),n},_dragElements:new Map,_drag(n){const t=[];Ne._dragElements.forEach((i,s)=>{const{node:u}=i,c=u.getStage();c.setPointersPositions(n),i.pointerId===void 0&&(i.pointerId=k._getFirstPointerId(n));const f=c._changedPointerPositions.find(p=>p.id===i.pointerId);if(f){if(i.dragStatus!=="dragging"){const p=u.dragDistance();if(Math.max(Math.abs(f.x-i.startPointerPos.x),Math.abs(f.y-i.startPointerPos.y))<p||(u.startDrag({evt:n}),!u.isDragging()))return}u._setDragPosition(n,i),t.push(u)}}),t.forEach(i=>{i.fire("dragmove",{type:"dragmove",target:i,evt:n},!0)})},_endDragBefore(n){const t=[];Ne._dragElements.forEach(i=>{const{node:s}=i,u=s.getStage();if(n&&u.setPointersPositions(n),!u._changedPointerPositions.find(p=>p.id===i.pointerId))return;(i.dragStatus==="dragging"||i.dragStatus==="stopped")&&(Ne.justDragged=!0,Ot._mouseListenClick=!1,Ot._touchListenClick=!1,Ot._pointerListenClick=!1,i.dragStatus="stopped");const f=i.node.getLayer()||i.node instanceof Ot.Stage&&i.node;f&&t.indexOf(f)===-1&&t.push(f)}),t.forEach(i=>{i.draw()})},_endDragAfter(n){Ne._dragElements.forEach((t,i)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:n},!0),t.dragStatus!=="dragging"&&Ne._dragElements.delete(i)})}};Ot.isBrowser&&(window.addEventListener("mouseup",Ne._endDragBefore,!0),window.addEventListener("touchend",Ne._endDragBefore,!0),window.addEventListener("touchcancel",Ne._endDragBefore,!0),window.addEventListener("mousemove",Ne._drag),window.addEventListener("touchmove",Ne._drag),window.addEventListener("mouseup",Ne._endDragAfter,!1),window.addEventListener("touchend",Ne._endDragAfter,!1),window.addEventListener("touchcancel",Ne._endDragAfter,!1));function Go(n){return k._isString(n)?'"'+n+'"':Object.prototype.toString.call(n)==="[object Number]"||k._isBoolean(n)?n:Object.prototype.toString.call(n)}function m5(n){return n>255?255:n<0?0:Math.round(n)}function Dt(){if(Ot.isUnminified)return function(n,t){return k._isNumber(n)||k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),n}}function x1(n){if(Ot.isUnminified)return function(t,i){let s=k._isNumber(t),u=k._isArray(t)&&t.length==n;return!s&&!u&&k.warn(Go(t)+' is a not valid value for "'+i+'" attribute. The value should be a number or Array<number>('+n+")"),t}}function T2(){if(Ot.isUnminified)return function(n,t){return k._isNumber(n)||n==="auto"||k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),n}}function oc(){if(Ot.isUnminified)return function(n,t){return k._isString(n)||k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),n}}function g5(){if(Ot.isUnminified)return function(n,t){const i=k._isString(n),s=Object.prototype.toString.call(n)==="[object CanvasGradient]"||n&&n.addColorStop;return i||s||k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),n}}function JT(){if(Ot.isUnminified)return function(n,t){const i=Int8Array?Object.getPrototypeOf(Int8Array):null;return i&&n instanceof i||(k._isArray(n)?n.forEach(function(s){k._isNumber(s)||k.warn('"'+t+'" attribute has non numeric element '+s+". Make sure that all elements are numbers.")}):k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),n}}function sl(){if(Ot.isUnminified)return function(n,t){return n===!0||n===!1||k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),n}}function FT(n){if(Ot.isUnminified)return function(t,i){return t==null||k.isObject(t)||k.warn(Go(t)+' is a not valid value for "'+i+'" attribute. The value should be an object with properties '+n),t}}const Up="get",Bp="set",G={addGetterSetter(n,t,i,s,u){G.addGetter(n,t,i),G.addSetter(n,t,s,u),G.addOverloadedGetterSetter(n,t)},addGetter(n,t,i){const s=Up+k._capitalize(t);n.prototype[s]=n.prototype[s]||function(){const u=this.attrs[t];return u===void 0?i:u}},addSetter(n,t,i,s){const u=Bp+k._capitalize(t);n.prototype[u]||G.overWriteSetter(n,t,i,s)},overWriteSetter(n,t,i,s){const u=Bp+k._capitalize(t);n.prototype[u]=function(c){return i&&c!==void 0&&c!==null&&(c=i.call(this,c,t)),this._setAttr(t,c),s&&s.call(this),this}},addComponentsGetterSetter(n,t,i,s,u){const c=i.length,f=k._capitalize,p=Up+f(t),m=Bp+f(t);n.prototype[p]=function(){const b={};for(let _=0;_<c;_++){const x=i[_];b[x]=this.getAttr(t+f(x))}return b};const S=FT(i);n.prototype[m]=function(b){const _=this.attrs[t];s&&(b=s.call(this,b,t)),S&&S.call(this,b,t);for(const x in b)b.hasOwnProperty(x)&&this._setAttr(t+f(x),b[x]);return b||i.forEach(x=>{this._setAttr(t+f(x),void 0)}),this._fireChangeEvent(t,_,b),u&&u.call(this),this},G.addOverloadedGetterSetter(n,t)},addOverloadedGetterSetter(n,t){const i=k._capitalize(t),s=Bp+i,u=Up+i;n.prototype[t]=function(){return arguments.length?(this[s](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(n,t,i,s){k.error("Adding deprecated "+t);const u=Up+k._capitalize(t),c=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";n.prototype[u]=function(){k.error(c);const f=this.attrs[t];return f===void 0?i:f},G.addSetter(n,t,s,function(){k.error(c)}),G.addOverloadedGetterSetter(n,t)},backCompat(n,t){k.each(t,function(i,s){const u=n.prototype[s],c=Up+k._capitalize(i),f=Bp+k._capitalize(i);function p(){u.apply(this,arguments),k.error('"'+i+'" method is deprecated and will be removed soon. Use ""'+s+'" instead.')}n.prototype[i]=p,n.prototype[c]=p,n.prototype[f]=p})},afterSetFilter(){this._filterUpToDate=!1}};function kT(n){const t=/(\w+)\(([^)]+)\)/g;let i;for(;(i=t.exec(n))!==null;){const[,s,u]=i;switch(s){case"blur":{const c=parseFloat(u.replace("px",""));return function(f){this.blurRadius(c*.5);const p=Ot.Filters;p&&p.Blur&&p.Blur.call(this,f)}}case"brightness":{const c=u.includes("%")?parseFloat(u)/100:parseFloat(u);return function(f){this.brightness(c);const p=Ot.Filters;p&&p.Brightness&&p.Brightness.call(this,f)}}case"contrast":{const c=parseFloat(u);return function(f){const p=100*(Math.sqrt(c)-1);this.contrast(p);const m=Ot.Filters;m&&m.Contrast&&m.Contrast.call(this,f)}}case"grayscale":return function(c){const f=Ot.Filters;f&&f.Grayscale&&f.Grayscale.call(this,c)};case"sepia":return function(c){const f=Ot.Filters;f&&f.Sepia&&f.Sepia.call(this,c)};case"invert":return function(c){const f=Ot.Filters;f&&f.Invert&&f.Invert.call(this,c)};default:k.warn(`CSS filter "${s}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const D1="absoluteOpacity",A1="allEventListeners",Mr="absoluteTransform",y5="absoluteScale",uc="canvas",IT="Change",WT="children",$T="konva",C2="listening",tC="mouseenter",eC="mouseleave",nC="pointerenter",aC="pointerleave",iC="touchenter",sC="touchleave",v5="set",S5="Shape",M1=" ",b5="stage",jo="transform",lC="Stage",_2="visible",rC=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(M1);let oC=1,Nt=class u5{constructor(t){this._id=oC++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===jo||t===Mr)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,i){let s=this._cache.get(t);return(s===void 0||(t===jo||t===Mr)&&s.dirty===!0)&&(s=i.call(this),this._cache.set(t,s)),s}_calculate(t,i,s){if(!this._attachedDepsListeners.get(t)){const u=i.map(c=>c+"Change.konva").join(M1);this.on(u,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,s)}_getCanvasCache(){return this._cache.get(uc)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Mr&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(uc)){const{scene:t,filter:i,hit:s,buffer:u}=this._cache.get(uc);k.releaseCanvas(t,i,s,u),this._cache.delete(uc)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){const i=t||{};let s={};(i.x===void 0||i.y===void 0||i.width===void 0||i.height===void 0)&&(s=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let u=Math.ceil(i.width||s.width),c=Math.ceil(i.height||s.height),f=i.pixelRatio,p=i.x===void 0?Math.floor(s.x):i.x,m=i.y===void 0?Math.floor(s.y):i.y,S=i.offset||0,b=i.drawBorder||!1,_=i.hitCanvasPixelRatio||1;if(!u||!c){k.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const x=Math.abs(Math.round(s.x)-p)>.5?1:0,D=Math.abs(Math.round(s.y)-m)>.5?1:0;u+=S*2+x,c+=S*2+D,p-=S,m-=S;const A=new Vo({pixelRatio:f,width:u,height:c}),N=new Vo({pixelRatio:f,width:0,height:0,willReadFrequently:!0}),R=new E2({pixelRatio:_,width:u,height:c}),O=A.getContext(),U=R.getContext(),j=new Vo({width:A.width/A.pixelRatio+Math.abs(p),height:A.height/A.pixelRatio+Math.abs(m),pixelRatio:A.pixelRatio}),V=j.getContext();return R.isCache=!0,A.isCache=!0,this._cache.delete(uc),this._filterUpToDate=!1,i.imageSmoothingEnabled===!1&&(A.getContext()._context.imageSmoothingEnabled=!1,N.getContext()._context.imageSmoothingEnabled=!1),O.save(),U.save(),V.save(),O.translate(-p,-m),U.translate(-p,-m),V.translate(-p,-m),j.x=p,j.y=m,this._isUnderCache=!0,this._clearSelfAndDescendantCache(D1),this._clearSelfAndDescendantCache(y5),this.drawScene(A,this,j),this.drawHit(R,this),this._isUnderCache=!1,O.restore(),U.restore(),b&&(O.save(),O.beginPath(),O.rect(0,0,u,c),O.closePath(),O.setAttr("strokeStyle","red"),O.setAttr("lineWidth",5),O.stroke(),O.restore()),this._cache.set(uc,{scene:A,filter:N,hit:R,buffer:j,x:p,y:m}),this._requestDraw(),this}isCached(){return this._cache.has(uc)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,i){const s=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}];let u=1/0,c=1/0,f=-1/0,p=-1/0;const m=this.getAbsoluteTransform(i);return s.forEach(function(S){const b=m.point(S);u===void 0&&(u=f=b.x,c=p=b.y),u=Math.min(u,b.x),c=Math.min(c,b.y),f=Math.max(f,b.x),p=Math.max(p,b.y)}),{x:u,y:c,width:f-u,height:p-c}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const i=this._getCanvasCache();t.translate(i.x,i.y);const s=this._getCachedSceneCanvas(),u=s.pixelRatio;t.drawImage(s._canvas,0,0,s.width/u,s.height/u),t.restore()}_drawCachedHitCanvas(t){const i=this._getCanvasCache(),s=i.hit;t.save(),t.translate(i.x,i.y),t.drawImage(s._canvas,0,0,s.width/s.pixelRatio,s.height/s.pixelRatio),t.restore()}_getCachedSceneCanvas(){let t=this.filters(),i=this._getCanvasCache(),s=i.scene,u=i.filter,c=u.getContext(),f,p,m,S;if(!t||t.length===0)return s;if(this._filterUpToDate)return u;let b=!0;for(let x=0;x<t.length;x++)if(typeof t[x]=="string"&&p5(),typeof t[x]!="string"||!p5()){b=!1;break}const _=s.pixelRatio;if(u.setSize(s.width/s.pixelRatio,s.height/s.pixelRatio),b){const x=t.join(" ");return c.save(),c.setAttr("filter",x),c.drawImage(s._canvas,0,0,s.getWidth()/_,s.getHeight()/_),c.restore(),this._filterUpToDate=!0,u}try{for(f=t.length,c.clear(),c.drawImage(s._canvas,0,0,s.getWidth()/_,s.getHeight()/_),p=c.getImageData(0,0,u.getWidth(),u.getHeight()),m=0;m<f;m++)S=t[m],typeof S=="string"&&(S=kT(S)),S.call(this,p),c.putImageData(p,0,0)}catch(x){k.error("Unable to apply filter. "+x.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,u}on(t,i){if(this._cache&&this._cache.delete(A1),arguments.length===3)return this._delegate.apply(this,arguments);const s=t.split(M1);for(let u=0;u<s.length;u++){const f=s[u].split("."),p=f[0],m=f[1]||"";this.eventListeners[p]||(this.eventListeners[p]=[]),this.eventListeners[p].push({name:m,handler:i})}return this}off(t,i){let s=(t||"").split(M1),u=s.length,c,f,p,m,S,b;if(this._cache&&this._cache.delete(A1),!t)for(f in this.eventListeners)this._off(f);for(c=0;c<u;c++)if(p=s[c],m=p.split("."),S=m[0],b=m[1],S)this.eventListeners[S]&&this._off(S,b,i);else for(f in this.eventListeners)this._off(f,b,i);return this}dispatchEvent(t){const i={target:this,type:t.type,evt:t};return this.fire(t.type,i),this}addEventListener(t,i){return this.on(t,function(s){i.call(this,s.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,i,s){const u=this;this.on(t,function(c){const f=c.target.findAncestors(i,!0,u);for(let p=0;p<f.length;p++)c=k.cloneObject(c),c.currentTarget=f[p],s.call(f[p],c)})}remove(){return this.isDragging()&&this.stopDrag(),Ne._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Mr),this._clearSelfAndDescendantCache(D1),this._clearSelfAndDescendantCache(y5),this._clearSelfAndDescendantCache(b5),this._clearSelfAndDescendantCache(_2),this._clearSelfAndDescendantCache(C2)}_remove(){this._clearCaches();const t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){const i="get"+k._capitalize(t);return k._isFunction(this[i])?this[i]():this.attrs[t]}getAncestors(){let t=this.getParent(),i=[];for(;t;)i.push(t),t=t.getParent();return i}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{let i,s;if(!t)return this;for(i in t)i!==WT&&(s=v5+k._capitalize(i),k._isFunction(this[s])?this[s](t[i]):this._setAttr(i,t[i]))}),this}isListening(){return this._getCache(C2,this._isListening)}_isListening(t){if(!this.listening())return!1;const s=this.getParent();return s&&s!==t&&this!==t?s._isListening(t):!0}isVisible(){return this._getCache(_2,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const s=this.getParent();return s&&s!==t&&this!==t?s._isVisible(t):!0}shouldDrawHit(t,i=!1){if(t)return this._isVisible(t)&&this._isListening(t);const s=this.getLayer();let u=!1;Ne._dragElements.forEach(f=>{f.dragStatus==="dragging"&&(f.node.nodeType==="Stage"||f.node.getLayer()===s)&&(u=!0)});const c=!i&&!Ot.hitOnDragEnabled&&(u||Ot.isTransforming());return this.isListening()&&this.isVisible()&&!c}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let t=this.getDepth(),i=this,s=0,u,c,f,p;function m(b){for(u=[],c=b.length,f=0;f<c;f++)p=b[f],s++,p.nodeType!==S5&&(u=u.concat(p.getChildren().slice())),p._id===i._id&&(f=c);u.length>0&&u[0].getDepth()<=t&&m(u)}const S=this.getStage();return i.nodeType!==lC&&S&&m(S.getChildren()),s}getDepth(){let t=0,i=this.parent;for(;i;)t++,i=i.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(jo),this._clearSelfAndDescendantCache(Mr)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;const i=t.getPointerPosition();if(!i)return null;const s=this.getAbsoluteTransform().copy();return s.invert(),s.point(i)}getAbsolutePosition(t){let i=!1,s=this.parent;for(;s;){if(s.isCached()){i=!0;break}s=s.parent}i&&!t&&(t=!0);const u=this.getAbsoluteTransform(t).getMatrix(),c=new Qi,f=this.offset();return c.m=u.slice(),c.translate(f.x,f.y),c.getTranslation()}setAbsolutePosition(t){const{x:i,y:s,...u}=this._clearTransform();this.attrs.x=i,this.attrs.y=s,this._clearCache(jo);const c=this._getAbsoluteTransform().copy();return c.invert(),c.translate(t.x,t.y),t={x:this.attrs.x+c.getTranslation().x,y:this.attrs.y+c.getTranslation().y},this._setTransform(u),this.setPosition({x:t.x,y:t.y}),this._clearCache(jo),this._clearSelfAndDescendantCache(Mr),this}_setTransform(t){let i;for(i in t)this.attrs[i]=t[i]}_clearTransform(){const t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){let i=t.x,s=t.y,u=this.x(),c=this.y();return i!==void 0&&(u+=i),s!==void 0&&(c+=s),this.setPosition({x:u,y:c}),this}_eachAncestorReverse(t,i){let s=[],u=this.getParent(),c,f;if(!(i&&i._id===this._id)){for(s.unshift(this);u&&(!i||u._id!==i._id);)s.unshift(u),u=u.parent;for(c=s.length,f=0;f<c;f++)t(s[f])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return k.warn("Node has no parent. moveToTop function is ignored."),!1;const t=this.index,i=this.parent.getChildren().length;return t<i-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return k.warn("Node has no parent. moveUp function is ignored."),!1;const t=this.index,i=this.parent.getChildren().length;return t<i-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return k.warn("Node has no parent. moveDown function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return k.warn("Node has no parent. moveToBottom function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return k.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&k.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const i=this.index;return this.parent.children.splice(i,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(D1,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let t=this.opacity();const i=this.getParent();return i&&!i._isUnderCache&&(t*=i.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){let t=this.getAttrs(),i,s,u,c,f;const p={attrs:{},className:this.getClassName()};for(i in t)s=t[i],f=k.isObject(s)&&!k._isPlainObject(s)&&!k._isArray(s),!f&&(u=typeof this[i]=="function"&&this[i],delete t[i],c=u?u.call(this):null,t[i]=s,c!==s&&(p.attrs[i]=s));return k._prepareToStringify(p)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,i,s){const u=[];i&&this._isMatch(t)&&u.push(this);let c=this.parent;for(;c;){if(c===s)return u;c._isMatch(t)&&u.push(c),c=c.parent}return u}isAncestorOf(t){return!1}findAncestor(t,i,s){return this.findAncestors(t,i,s)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);let i=t.replace(/ /g,"").split(","),s=i.length,u,c;for(u=0;u<s;u++)if(c=i[u],k.isValidSelector(c)||(k.warn('Selector "'+c+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),k.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),k.warn("Konva is awesome, right?")),c.charAt(0)==="#"){if(this.id()===c.slice(1))return!0}else if(c.charAt(0)==="."){if(this.hasName(c.slice(1)))return!0}else if(this.className===c||this.nodeType===c)return!0;return!1}getLayer(){const t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(b5,this._getStage)}_getStage(){const t=this.getParent();return t?t.getStage():null}fire(t,i={},s){return i.target=i.target||this,s?this._fireAndBubble(t,i):this._fire(t,i),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(Mr,this._getAbsoluteTransform)}_getAbsoluteTransform(t){let i;if(t)return i=new Qi,this._eachAncestorReverse(function(s){const u=s.transformsEnabled();u==="all"?i.multiply(s.getTransform()):u==="position"&&i.translate(s.x()-s.offsetX(),s.y()-s.offsetY())},t),i;{i=this._cache.get(Mr)||new Qi,this.parent?this.parent.getAbsoluteTransform().copyInto(i):i.reset();const s=this.transformsEnabled();if(s==="all")i.multiply(this.getTransform());else if(s==="position"){const u=this.attrs.x||0,c=this.attrs.y||0,f=this.attrs.offsetX||0,p=this.attrs.offsetY||0;i.translate(u-f,c-p)}return i.dirty=!1,i}}getAbsoluteScale(t){let i=this;for(;i;)i._isUnderCache&&(t=i),i=i.getParent();const u=this.getAbsoluteTransform(t).decompose();return{x:u.scaleX,y:u.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(jo,this._getTransform)}_getTransform(){var t,i;const s=this._cache.get(jo)||new Qi;s.reset();const u=this.x(),c=this.y(),f=Ot.getAngle(this.rotation()),p=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,m=(i=this.attrs.scaleY)!==null&&i!==void 0?i:1,S=this.attrs.skewX||0,b=this.attrs.skewY||0,_=this.attrs.offsetX||0,x=this.attrs.offsetY||0;return(u!==0||c!==0)&&s.translate(u,c),f!==0&&s.rotate(f),(S!==0||b!==0)&&s.skew(S,b),(p!==1||m!==1)&&s.scale(p,m),(_!==0||x!==0)&&s.translate(-1*_,-1*x),s.dirty=!1,s}clone(t){let i=k.cloneObject(this.attrs),s,u,c,f,p;for(s in t)i[s]=t[s];const m=new this.constructor(i);for(s in this.eventListeners)for(u=this.eventListeners[s],c=u.length,f=0;f<c;f++)p=u[f],p.name.indexOf($T)<0&&(m.eventListeners[s]||(m.eventListeners[s]=[]),m.eventListeners[s].push(p));return m}_toKonvaCanvas(t){t=t||{};const i=this.getClientRect(),s=this.getStage(),u=t.x!==void 0?t.x:Math.floor(i.x),c=t.y!==void 0?t.y:Math.floor(i.y),f=t.pixelRatio||1,p=new Vo({width:t.width||Math.ceil(i.width)||(s?s.width():0),height:t.height||Math.ceil(i.height)||(s?s.height():0),pixelRatio:f}),m=p.getContext(),S=new Vo({width:p.width/p.pixelRatio+Math.abs(u),height:p.height/p.pixelRatio+Math.abs(c),pixelRatio:p.pixelRatio});return t.imageSmoothingEnabled===!1&&(m._context.imageSmoothingEnabled=!1),m.save(),(u||c)&&m.translate(-1*u,-1*c),this.drawScene(p,void 0,S),m.restore(),p}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};const i=t.mimeType||null,s=t.quality||null,u=this._toKonvaCanvas(t).toDataURL(i,s);return t.callback&&t.callback(u),u}toImage(t){return new Promise((i,s)=>{try{const u=t?.callback;u&&delete t.callback,k._urlToImage(this.toDataURL(t),function(c){i(c),u?.(c)})}catch(u){s(u)}})}toBlob(t){return new Promise((i,s)=>{try{const u=t?.callback;u&&delete t.callback,this.toCanvas(t).toBlob(c=>{i(c),u?.(c)},t?.mimeType,t?.quality)}catch(u){s(u)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Ot.dragDistance}_off(t,i,s){let u=this.eventListeners[t],c,f,p;for(c=0;c<u.length;c++)if(f=u[c].name,p=u[c].handler,(f!=="konva"||i==="konva")&&(!i||f===i)&&(!s||s===p)){if(u.splice(c,1),u.length===0){delete this.eventListeners[t];break}c--}}_fireChangeEvent(t,i,s){this._fire(t+IT,{oldVal:i,newVal:s})}addName(t){if(!this.hasName(t)){const i=this.name(),s=i?i+" "+t:t;this.name(s)}return this}hasName(t){if(!t)return!1;const i=this.name();return i?(i||"").split(/\s/g).indexOf(t)!==-1:!1}removeName(t){const i=(this.name()||"").split(/\s/g),s=i.indexOf(t);return s!==-1&&(i.splice(s,1),this.name(i.join(" "))),this}setAttr(t,i){const s=this[v5+k._capitalize(t)];return k._isFunction(s)?s.call(this,i):this._setAttr(t,i),this}_requestDraw(){if(Ot.autoDrawEnabled){const t=this.getLayer()||this.getStage();t?.batchDraw()}}_setAttr(t,i){const s=this.attrs[t];s===i&&!k.isObject(i)||(i==null?delete this.attrs[t]:this.attrs[t]=i,this._shouldFireChangeEvents&&this._fireChangeEvent(t,s,i),this._requestDraw())}_setComponentAttr(t,i,s){let u;s!==void 0&&(u=this.attrs[t],u||(this.attrs[t]=this.getAttr(t)),this.attrs[t][i]=s,this._fireChangeEvent(t,u,s))}_fireAndBubble(t,i,s){i&&this.nodeType===S5&&(i.target=this);const u=[tC,eC,nC,aC,iC,sC];if(!(u.indexOf(t)!==-1&&(s&&(this===s||this.isAncestorOf&&this.isAncestorOf(s))||this.nodeType==="Stage"&&!s))){this._fire(t,i);const f=u.indexOf(t)!==-1&&s&&s.isAncestorOf&&s.isAncestorOf(this)&&!s.isAncestorOf(this.parent);(i&&!i.cancelBubble||!i)&&this.parent&&this.parent.isListening()&&!f&&(s&&s.parent?this._fireAndBubble.call(this.parent,t,i,s):this._fireAndBubble.call(this.parent,t,i))}}_getProtoListeners(t){var i,s,u;const c=(i=this._cache.get(A1))!==null&&i!==void 0?i:{};let f=c?.[t];if(f===void 0){f=[];let p=Object.getPrototypeOf(this);for(;p;){const m=(u=(s=p.eventListeners)===null||s===void 0?void 0:s[t])!==null&&u!==void 0?u:[];f.push(...m),p=Object.getPrototypeOf(p)}c[t]=f,this._cache.set(A1,c)}return f}_fire(t,i){i=i||{},i.currentTarget=this,i.type=t;const s=this._getProtoListeners(t);if(s)for(let c=0;c<s.length;c++)s[c].handler.call(this,i);const u=this.eventListeners[t];if(u)for(let c=0;c<u.length;c++)u[c].handler.call(this,i)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){const i=t?t.pointerId:void 0,s=this.getStage(),u=this.getAbsolutePosition();if(!s)return;const c=s._getPointerById(i)||s._changedPointerPositions[0]||u;Ne._dragElements.set(this._id,{node:this,startPointerPos:c,offset:{x:c.x-u.x,y:c.y-u.y},dragStatus:"ready",pointerId:i})}startDrag(t,i=!0){Ne._dragElements.has(this._id)||this._createDragElement(t);const s=Ne._dragElements.get(this._id);s.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},i)}_setDragPosition(t,i){const s=this.getStage()._getPointerById(i.pointerId);if(!s)return;let u={x:s.x-i.offset.x,y:s.y-i.offset.y};const c=this.dragBoundFunc();if(c!==void 0){const f=c.call(this,u,t);f?u=f:k.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==u.x||this._lastPos.y!==u.y)&&(this.setAbsolutePosition(u),this._requestDraw()),this._lastPos=u}stopDrag(t){const i=Ne._dragElements.get(this._id);i&&(i.dragStatus="stopped"),Ne._endDragBefore(t),Ne._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Ne._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){if(!(!(t.evt.button!==void 0)||Ot.dragButtons.indexOf(t.evt.button)>=0)||this.isDragging())return;let u=!1;Ne._dragElements.forEach(c=>{this.isAncestorOf(c.node)&&(u=!0)}),u||this._createDragElement(t)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const i=Ne._dragElements.get(this._id),s=i&&i.dragStatus==="dragging",u=i&&i.dragStatus==="ready";s?this.stopDrag():u&&Ne._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const i=this.getStage();if(!i)return!1;const s={x:-t.x,y:-t.y,width:i.width()+2*t.x,height:i.height()+2*t.y};return k.haveIntersection(s,this.getClientRect())}static create(t,i){return k._isString(t)&&(t=JSON.parse(t)),this._createNode(t,i)}static _createNode(t,i){let s=u5.prototype.getClassName.call(t),u=t.children,c,f,p;i&&(t.attrs.container=i),Ot[s]||(k.warn('Can not find a node with class name "'+s+'". Fallback to "Shape".'),s="Shape");const m=Ot[s];if(c=new m(t.attrs),u)for(f=u.length,p=0;p<f;p++)c.add(u5._createNode(u[p]));return c}};Nt.prototype.nodeType="Node",Nt.prototype._attrsAffectingSize=[],Nt.prototype.eventListeners={},Nt.prototype.on.call(Nt.prototype,rC,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(jo),this._clearSelfAndDescendantCache(Mr)}),Nt.prototype.on.call(Nt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(_2)}),Nt.prototype.on.call(Nt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(C2)}),Nt.prototype.on.call(Nt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(D1)});const Ke=G.addGetterSetter;Ke(Nt,"zIndex"),Ke(Nt,"absolutePosition"),Ke(Nt,"position"),Ke(Nt,"x",0,Dt()),Ke(Nt,"y",0,Dt()),Ke(Nt,"globalCompositeOperation","source-over",oc()),Ke(Nt,"opacity",1,Dt()),Ke(Nt,"name","",oc()),Ke(Nt,"id","",oc()),Ke(Nt,"rotation",0,Dt()),G.addComponentsGetterSetter(Nt,"scale",["x","y"]),Ke(Nt,"scaleX",1,Dt()),Ke(Nt,"scaleY",1,Dt()),G.addComponentsGetterSetter(Nt,"skew",["x","y"]),Ke(Nt,"skewX",0,Dt()),Ke(Nt,"skewY",0,Dt()),G.addComponentsGetterSetter(Nt,"offset",["x","y"]),Ke(Nt,"offsetX",0,Dt()),Ke(Nt,"offsetY",0,Dt()),Ke(Nt,"dragDistance",void 0,Dt()),Ke(Nt,"width",0,Dt()),Ke(Nt,"height",0,Dt()),Ke(Nt,"listening",!0,sl()),Ke(Nt,"preventDefault",!0,sl()),Ke(Nt,"filters",void 0,function(n){return this._filterUpToDate=!1,n}),Ke(Nt,"visible",!0,sl()),Ke(Nt,"transformsEnabled","all",oc()),Ke(Nt,"size"),Ke(Nt,"dragBoundFunc"),Ke(Nt,"draggable",!1,sl()),G.backCompat(Nt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class Zi extends Nt{constructor(){super(...arguments),this.children=[]}getChildren(t){const i=this.children||[];return t?i.filter(t):i}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(let s=0;s<t.length;s++)this.add(t[s]);return this}const i=t[0];return i.getParent()?(i.moveTo(this),this):(this._validateAdd(i),i.index=this.getChildren().length,i.parent=this,i._clearCaches(),this.getChildren().push(i),this._fire("add",{child:i}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){const i=this._generalFind(t,!0);return i.length>0?i[0]:void 0}_generalFind(t,i){const s=[];return this._descendants(u=>{const c=u._isMatch(t);return c&&s.push(u),!!(c&&i)}),s}_descendants(t){let i=!1;const s=this.getChildren();for(const u of s){if(i=t(u),i)return!0;if(u.hasChildren()&&(i=u._descendants(t),i))return!0}return!1}toObject(){const t=Nt.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(i=>{t.children.push(i.toObject())}),t}isAncestorOf(t){let i=t.getParent();for(;i;){if(i._id===this._id)return!0;i=i.getParent()}return!1}clone(t){const i=Nt.prototype.clone.call(this,t);return this.getChildren().forEach(function(s){i.add(s.clone())}),i}getAllIntersections(t){const i=[];return this.find("Shape").forEach(s=>{s.isVisible()&&s.intersects(t)&&i.push(s)}),i}_clearSelfAndDescendantCache(t){var i;super._clearSelfAndDescendantCache(t),!this.isCached()&&((i=this.children)===null||i===void 0||i.forEach(function(s){s._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(i,s){i.index=s}),this._requestDraw()}drawScene(t,i,s){const u=this.getLayer(),c=t||u&&u.getCanvas(),f=c&&c.getContext(),p=this._getCanvasCache(),m=p&&p.scene,S=c&&c.isCache;if(!this.isVisible()&&!S)return this;if(m){f.save();const b=this.getAbsoluteTransform(i).getMatrix();f.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(f),f.restore()}else this._drawChildren("drawScene",c,i,s);return this}drawHit(t,i){if(!this.shouldDrawHit(i))return this;const s=this.getLayer(),u=t||s&&s.hitCanvas,c=u&&u.getContext(),f=this._getCanvasCache();if(f&&f.hit){c.save();const m=this.getAbsoluteTransform(i).getMatrix();c.transform(m[0],m[1],m[2],m[3],m[4],m[5]),this._drawCachedHitCanvas(c),c.restore()}else this._drawChildren("drawHit",u,i);return this}_drawChildren(t,i,s,u){var c;const f=i&&i.getContext(),p=this.clipWidth(),m=this.clipHeight(),S=this.clipFunc(),b=typeof p=="number"&&typeof m=="number"||S,_=s===this;if(b){f.save();const D=this.getAbsoluteTransform(s);let A=D.getMatrix();f.transform(A[0],A[1],A[2],A[3],A[4],A[5]),f.beginPath();let N;if(S)N=S.call(this,f,this);else{const R=this.clipX(),O=this.clipY();f.rect(R||0,O||0,p,m)}f.clip.apply(f,N),A=D.copy().invert().getMatrix(),f.transform(A[0],A[1],A[2],A[3],A[4],A[5])}const x=!_&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";x&&(f.save(),f._applyGlobalCompositeOperation(this)),(c=this.children)===null||c===void 0||c.forEach(function(D){D[t](i,s,u)}),x&&f.restore(),b&&f.restore()}getClientRect(t={}){var i;const s=t.skipTransform,u=t.relativeTo;let c,f,p,m,S={x:1/0,y:1/0,width:0,height:0};const b=this;(i=this.children)===null||i===void 0||i.forEach(function(D){if(!D.visible())return;const A=D.getClientRect({relativeTo:b,skipShadow:t.skipShadow,skipStroke:t.skipStroke});A.width===0&&A.height===0||(c===void 0?(c=A.x,f=A.y,p=A.x+A.width,m=A.y+A.height):(c=Math.min(c,A.x),f=Math.min(f,A.y),p=Math.max(p,A.x+A.width),m=Math.max(m,A.y+A.height)))});const _=this.find("Shape");let x=!1;for(let D=0;D<_.length;D++)if(_[D]._isVisible(this)){x=!0;break}return x&&c!==void 0?S={x:c,y:f,width:p-c,height:m-f}:S={x:0,y:0,width:0,height:0},s?S:this._transformedRect(S,u)}}G.addComponentsGetterSetter(Zi,"clip",["x","y","width","height"]),G.addGetterSetter(Zi,"clipX",void 0,Dt()),G.addGetterSetter(Zi,"clipY",void 0,Dt()),G.addGetterSetter(Zi,"clipWidth",void 0,Dt()),G.addGetterSetter(Zi,"clipHeight",void 0,Dt()),G.addGetterSetter(Zi,"clipFunc");const Vp=new Map,E5=Ot._global.PointerEvent!==void 0;function x2(n){return Vp.get(n)}function D2(n){return{evt:n,pointerId:n.pointerId}}function T5(n,t){return Vp.get(n)===t}function C5(n,t){Gp(n),t.getStage()&&(Vp.set(n,t),E5&&t._fire("gotpointercapture",D2(new PointerEvent("gotpointercapture"))))}function Gp(n,t){const i=Vp.get(n);if(!i)return;const s=i.getStage();s&&s.content,Vp.delete(n),E5&&i._fire("lostpointercapture",D2(new PointerEvent("lostpointercapture")))}const uC="Stage",cC="string",_5="px",fC="mouseout",x5="mouseleave",D5="mouseover",A5="mouseenter",M5="mousemove",N5="mousedown",O5="mouseup",jp="pointermove",Lp="pointerdown",kf="pointerup",Pp="pointercancel",hC="lostpointercapture",N1="pointerout",Yp="pointerleave",O1="pointerover",R1="pointerenter",A2="contextmenu",R5="touchstart",z5="touchend",H5="touchmove",w5="touchcancel",M2="wheel",dC=5,pC=[[A5,"_pointerenter"],[N5,"_pointerdown"],[M5,"_pointermove"],[O5,"_pointerup"],[x5,"_pointerleave"],[R5,"_pointerdown"],[H5,"_pointermove"],[z5,"_pointerup"],[w5,"_pointercancel"],[D5,"_pointerover"],[M2,"_wheel"],[A2,"_contextmenu"],[Lp,"_pointerdown"],[jp,"_pointermove"],[kf,"_pointerup"],[Pp,"_pointercancel"],[Yp,"_pointerleave"],[hC,"_lostpointercapture"]],N2={mouse:{[N1]:fC,[Yp]:x5,[O1]:D5,[R1]:A5,[jp]:M5,[Lp]:N5,[kf]:O5,[Pp]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[N1]:"touchout",[Yp]:"touchleave",[O1]:"touchover",[R1]:"touchenter",[jp]:H5,[Lp]:R5,[kf]:z5,[Pp]:w5,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[N1]:N1,[Yp]:Yp,[O1]:O1,[R1]:R1,[jp]:jp,[Lp]:Lp,[kf]:kf,[Pp]:Pp,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},qp=n=>n.indexOf("pointer")>=0?"pointer":n.indexOf("touch")>=0?"touch":"mouse",If=n=>{const t=qp(n);if(t==="pointer")return Ot.pointerEventsEnabled&&N2.pointer;if(t==="touch")return N2.touch;if(t==="mouse")return N2.mouse};function U5(n={}){return(n.clipFunc||n.clipWidth||n.clipHeight)&&k.warn("Stage does not support clipping. Please use clip for Layers or Groups."),n}const mC="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",Xp=[];let z1=class extends Zi{constructor(t){super(U5(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Xp.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{U5(this.attrs)}),this._checkVisibility()}_validateAdd(t){const i=t.getType()==="Layer",s=t.getType()==="FastLayer";i||s||k.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===cC){let i;if(t.charAt(0)==="."){const s=t.slice(1);t=document.getElementsByClassName(s)[0]}else t.charAt(0)!=="#"?i=t:i=t.slice(1),t=document.getElementById(i);if(!t)throw"Can not find container in document with id "+i}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const t=this.children,i=t.length;for(let s=0;s<i;s++)t[s].clear();return this}clone(t){return t||(t={}),t.container=typeof document<"u"&&document.createElement("div"),Zi.prototype.clone.call(this,t)}destroy(){super.destroy();const t=this.content;t&&k._isInDocument(t)&&this.container().removeChild(t);const i=Xp.indexOf(this);return i>-1&&Xp.splice(i,1),k.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(k.warn(mC),null)}_getPointerById(t){return this._pointerPositions.find(i=>i.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t={...t},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();const i=new Vo({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),s=i.getContext()._context,u=this.children;return(t.x||t.y)&&s.translate(-1*t.x,-1*t.y),u.forEach(function(c){if(!c.isVisible())return;const f=c._toKonvaCanvas(t);s.drawImage(f._canvas,t.x,t.y,f.getWidth()/f.getPixelRatio(),f.getHeight()/f.getPixelRatio())}),i}getIntersection(t){if(!t)return null;const i=this.children,s=i.length,u=s-1;for(let c=u;c>=0;c--){const f=i[c].getIntersection(t);if(f)return f}return null}_resizeDOM(){const t=this.width(),i=this.height();this.content&&(this.content.style.width=t+_5,this.content.style.height=i+_5),this.bufferCanvas.setSize(t,i),this.bufferHitCanvas.setSize(t,i),this.children.forEach(s=>{s.setSize({width:t,height:i}),s.draw()})}add(t,...i){if(arguments.length>1){for(let u=0;u<arguments.length;u++)this.add(arguments[u]);return this}super.add(t);const s=this.children.length;return s>dC&&k.warn("The stage has "+s+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),Ot.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return T5(t,this)}setPointerCapture(t){C5(t,this)}releaseCapture(t){Gp(t)}getLayers(){return this.children}_bindContentEvents(){Ot.isBrowser&&pC.forEach(([t,i])=>{this.content.addEventListener(t,s=>{this[i](s)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const i=If(t.type);i&&this._fire(i.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const i=If(t.type);i&&this._fire(i.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let i=this[t+"targetShape"];return i&&!i.getStage()&&(i=null),i}_pointerleave(t){const i=If(t.type),s=qp(t.type);if(!i)return;this.setPointersPositions(t);const u=this._getTargetShape(s),c=!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled;u&&c?(u._fireAndBubble(i.pointerout,{evt:t}),u._fireAndBubble(i.pointerleave,{evt:t}),this._fire(i.pointerleave,{evt:t,target:this,currentTarget:this}),this[s+"targetShape"]=null):c&&(this._fire(i.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(i.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(t){const i=If(t.type),s=qp(t.type);if(!i)return;this.setPointersPositions(t);let u=!1;this._changedPointerPositions.forEach(c=>{const f=this.getIntersection(c);if(Ne.justDragged=!1,Ot["_"+s+"ListenClick"]=!0,!f||!f.isListening()){this[s+"ClickStartShape"]=void 0;return}Ot.capturePointerEventsEnabled&&f.setPointerCapture(c.id),this[s+"ClickStartShape"]=f,f._fireAndBubble(i.pointerdown,{evt:t,pointerId:c.id}),u=!0;const p=t.type.indexOf("touch")>=0;f.preventDefault()&&t.cancelable&&p&&t.preventDefault()}),u||this._fire(i.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(t){const i=If(t.type),s=qp(t.type);if(!i)return;const u=t.type.indexOf("touch")>=0||t.pointerType==="touch";if(Ot.isDragging()&&Ne.node.preventDefault()&&t.cancelable&&u&&t.preventDefault(),this.setPointersPositions(t),!(!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled))return;const f={};let p=!1;const m=this._getTargetShape(s);this._changedPointerPositions.forEach(S=>{const b=x2(S.id)||this.getIntersection(S),_=S.id,x={evt:t,pointerId:_},D=m!==b;if(D&&m&&(m._fireAndBubble(i.pointerout,{...x},b),m._fireAndBubble(i.pointerleave,{...x},b)),b){if(f[b._id])return;f[b._id]=!0}b&&b.isListening()?(p=!0,D&&(b._fireAndBubble(i.pointerover,{...x},m),b._fireAndBubble(i.pointerenter,{...x},m),this[s+"targetShape"]=b),b._fireAndBubble(i.pointermove,{...x})):m&&(this._fire(i.pointerover,{evt:t,target:this,currentTarget:this,pointerId:_}),this[s+"targetShape"]=null)}),p||this._fire(i.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const i=If(t.type),s=qp(t.type);if(!i)return;this.setPointersPositions(t);const u=this[s+"ClickStartShape"],c=this[s+"ClickEndShape"],f={};let p=!1;this._changedPointerPositions.forEach(m=>{const S=x2(m.id)||this.getIntersection(m);if(S){if(S.releaseCapture(m.id),f[S._id])return;f[S._id]=!0}const b=m.id,_={evt:t,pointerId:b};let x=!1;Ot["_"+s+"InDblClickWindow"]?(x=!0,clearTimeout(this[s+"DblTimeout"])):Ne.justDragged||(Ot["_"+s+"InDblClickWindow"]=!0,clearTimeout(this[s+"DblTimeout"])),this[s+"DblTimeout"]=setTimeout(function(){Ot["_"+s+"InDblClickWindow"]=!1},Ot.dblClickWindow),S&&S.isListening()?(p=!0,this[s+"ClickEndShape"]=S,S._fireAndBubble(i.pointerup,{..._}),Ot["_"+s+"ListenClick"]&&u&&u===S&&(S._fireAndBubble(i.pointerclick,{..._}),x&&c&&c===S&&S._fireAndBubble(i.pointerdblclick,{..._}))):(this[s+"ClickEndShape"]=null,p||(this._fire(i.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),p=!0),Ot["_"+s+"ListenClick"]&&this._fire(i.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:b}),x&&this._fire(i.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:b}))}),p||this._fire(i.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Ot["_"+s+"ListenClick"]=!1,t.cancelable&&s!=="touch"&&s!=="pointer"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);const i=this.getIntersection(this.getPointerPosition());i&&i.isListening()?i._fireAndBubble(A2,{evt:t}):this._fire(A2,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);const i=this.getIntersection(this.getPointerPosition());i&&i.isListening()?i._fireAndBubble(M2,{evt:t}):this._fire(M2,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const i=x2(t.pointerId)||this.getIntersection(this.getPointerPosition());i&&i._fireAndBubble(kf,D2(t)),Gp(t.pointerId)}_lostpointercapture(t){Gp(t.pointerId)}setPointersPositions(t){const i=this._getContentPosition();let s=null,u=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,c=>{this._pointerPositions.push({id:c.identifier,x:(c.clientX-i.left)/i.scaleX,y:(c.clientY-i.top)/i.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,c=>{this._changedPointerPositions.push({id:c.identifier,x:(c.clientX-i.left)/i.scaleX,y:(c.clientY-i.top)/i.scaleY})})):(s=(t.clientX-i.left)/i.scaleX,u=(t.clientY-i.top)/i.scaleY,this.pointerPos={x:s,y:u},this._pointerPositions=[{x:s,y:u,id:k._getFirstPointerId(t)}],this._changedPointerPositions=[{x:s,y:u,id:k._getFirstPointerId(t)}])}_setPointerPosition(t){k.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Vo({width:this.width(),height:this.height()}),this.bufferHitCanvas=new E2({pixelRatio:1,width:this.width(),height:this.height()}),!Ot.isBrowser)return;const t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}cache(){return k.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}};z1.prototype.nodeType=uC,En(z1),G.addGetterSetter(z1,"container"),Ot.isBrowser&&document.addEventListener("visibilitychange",()=>{Xp.forEach(n=>{n.batchDraw()})});const B5="hasShadow",V5="shadowRGBA",G5="patternImage",j5="linearGradient",L5="radialGradient";let H1;function O2(){return H1||(H1=k.createCanvasElement().getContext("2d"),H1)}const Kp={};function gC(n){const t=this.attrs.fillRule;t?n.fill(t):n.fill()}function yC(n){n.stroke()}function vC(n){const t=this.attrs.fillRule;t?n.fill(t):n.fill()}function SC(n){n.stroke()}function bC(){this._clearCache(B5)}function EC(){this._clearCache(V5)}function TC(){this._clearCache(G5)}function CC(){this._clearCache(j5)}function _C(){this._clearCache(L5)}class Ct extends Nt{constructor(t){super(t);let i,s=0;for(;i=k.getHitColor(),!(i&&!(i in Kp));)if(s++,s>=1e4){k.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),i=k.getRandomColor();break}this.colorKey=i,Kp[i]=this}getContext(){return k.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return k.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(B5,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(G5,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const i=O2().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(i&&i.setTransform){const s=new Qi;s.translate(this.fillPatternX(),this.fillPatternY()),s.rotate(Ot.getAngle(this.fillPatternRotation())),s.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),s.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const u=s.getMatrix(),c=typeof DOMMatrix>"u"?{a:u[0],b:u[1],c:u[2],d:u[3],e:u[4],f:u[5]}:new DOMMatrix(u);i.setTransform(c)}return i}}_getLinearGradient(){return this._getCache(j5,this.__getLinearGradient)}__getLinearGradient(){const t=this.fillLinearGradientColorStops();if(t){const i=O2(),s=this.fillLinearGradientStartPoint(),u=this.fillLinearGradientEndPoint(),c=i.createLinearGradient(s.x,s.y,u.x,u.y);for(let f=0;f<t.length;f+=2)c.addColorStop(t[f],t[f+1]);return c}}_getRadialGradient(){return this._getCache(L5,this.__getRadialGradient)}__getRadialGradient(){const t=this.fillRadialGradientColorStops();if(t){const i=O2(),s=this.fillRadialGradientStartPoint(),u=this.fillRadialGradientEndPoint(),c=i.createRadialGradient(s.x,s.y,this.fillRadialGradientStartRadius(),u.x,u.y,this.fillRadialGradientEndRadius());for(let f=0;f<t.length;f+=2)c.addColorStop(t[f],t[f+1]);return c}}getShadowRGBA(){return this._getCache(V5,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const t=k.colorToRGBA(this.shadowColor());if(t)return"rgba("+t.r+","+t.g+","+t.b+","+t.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){const i=this.getStage();if(!i)return!1;const s=i.bufferHitCanvas;return s.getContext().clear(),this.drawHit(s,void 0,!0),s.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data[3]>0}destroy(){return Nt.prototype.destroy.call(this),delete Kp[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var i;if(!((i=this.attrs.perfectDrawEnabled)!==null&&i!==void 0?i:!0))return!1;const u=t||this.hasFill(),c=this.hasStroke(),f=this.getAbsoluteOpacity()!==1;if(u&&c&&f)return!0;const p=this.hasShadow(),m=this.shadowForStrokeEnabled();return!!(u&&c&&p&&m)}setStrokeHitEnabled(t){k.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){let i=!1,s=this.getParent();for(;s;){if(s.isCached()){i=!0;break}s=s.getParent()}const u=t.skipTransform,c=t.relativeTo||i&&this.getStage()||void 0,f=this.getSelfRect(),m=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,S=f.width+m,b=f.height+m,_=!t.skipShadow&&this.hasShadow(),x=_?this.shadowOffsetX():0,D=_?this.shadowOffsetY():0,A=S+Math.abs(x),N=b+Math.abs(D),R=_&&this.shadowBlur()||0,O=A+R*2,U=N+R*2,j={width:O,height:U,x:-(m/2+R)+Math.min(x,0)+f.x,y:-(m/2+R)+Math.min(D,0)+f.y};return u?j:this._transformedRect(j,c)}drawScene(t,i,s){const u=this.getLayer(),c=t||u.getCanvas(),f=c.getContext(),p=this._getCanvasCache(),m=this.getSceneFunc(),S=this.hasShadow();let b;const _=i===this;if(!this.isVisible()&&!_)return this;if(p){f.save();const x=this.getAbsoluteTransform(i).getMatrix();return f.transform(x[0],x[1],x[2],x[3],x[4],x[5]),this._drawCachedSceneCanvas(f),f.restore(),this}if(!m)return this;if(f.save(),this._useBufferCanvas()){b=this.getStage();const x=s||b.bufferCanvas,D=x.getContext();D.clear(),D.save(),D._applyLineJoin(this),D._applyMiterLimit(this);const A=this.getAbsoluteTransform(i).getMatrix();D.transform(A[0],A[1],A[2],A[3],A[4],A[5]),m.call(this,D,this),D.restore();const N=x.pixelRatio;S&&f._applyShadow(this),_||(f._applyOpacity(this),f._applyGlobalCompositeOperation(this)),f.drawImage(x._canvas,x.x||0,x.y||0,x.width/N,x.height/N)}else{if(f._applyLineJoin(this),f._applyMiterLimit(this),!_){const x=this.getAbsoluteTransform(i).getMatrix();f.transform(x[0],x[1],x[2],x[3],x[4],x[5]),f._applyOpacity(this),f._applyGlobalCompositeOperation(this)}S&&f._applyShadow(this),m.call(this,f,this)}return f.restore(),this}drawHit(t,i,s=!1){if(!this.shouldDrawHit(i,s))return this;const u=this.getLayer(),c=t||u.hitCanvas,f=c&&c.getContext(),p=this.hitFunc()||this.sceneFunc(),m=this._getCanvasCache(),S=m&&m.hit;if(this.colorKey||k.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),S){f.save();const _=this.getAbsoluteTransform(i).getMatrix();return f.transform(_[0],_[1],_[2],_[3],_[4],_[5]),this._drawCachedHitCanvas(f),f.restore(),this}if(!p)return this;if(f.save(),f._applyLineJoin(this),f._applyMiterLimit(this),!(this===i)){const _=this.getAbsoluteTransform(i).getMatrix();f.transform(_[0],_[1],_[2],_[3],_[4],_[5])}return p.call(this,f,this),f.restore(),this}drawHitFromCache(t=0){const i=this._getCanvasCache(),s=this._getCachedSceneCanvas(),u=i.hit,c=u.getContext(),f=u.getWidth(),p=u.getHeight();c.clear(),c.drawImage(s._canvas,0,0,f,p);try{const m=c.getImageData(0,0,f,p),S=m.data,b=S.length,_=k._hexToRgb(this.colorKey);for(let x=0;x<b;x+=4)S[x+3]>t?(S[x]=_.r,S[x+1]=_.g,S[x+2]=_.b,S[x+3]=255):S[x+3]=0;c.putImageData(m,0,0)}catch(m){k.error("Unable to draw hit graph from cached scene canvas. "+m.message)}return this}hasPointerCapture(t){return T5(t,this)}setPointerCapture(t){C5(t,this)}releaseCapture(t){Gp(t)}}Ct.prototype._fillFunc=gC,Ct.prototype._strokeFunc=yC,Ct.prototype._fillFuncHit=vC,Ct.prototype._strokeFuncHit=SC,Ct.prototype._centroid=!1,Ct.prototype.nodeType="Shape",En(Ct),Ct.prototype.eventListeners={},Ct.prototype.on.call(Ct.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",bC),Ct.prototype.on.call(Ct.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",EC),Ct.prototype.on.call(Ct.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",TC),Ct.prototype.on.call(Ct.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",CC),Ct.prototype.on.call(Ct.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",_C),G.addGetterSetter(Ct,"stroke",void 0,g5()),G.addGetterSetter(Ct,"strokeWidth",2,Dt()),G.addGetterSetter(Ct,"fillAfterStrokeEnabled",!1),G.addGetterSetter(Ct,"hitStrokeWidth","auto",T2()),G.addGetterSetter(Ct,"strokeHitEnabled",!0,sl()),G.addGetterSetter(Ct,"perfectDrawEnabled",!0,sl()),G.addGetterSetter(Ct,"shadowForStrokeEnabled",!0,sl()),G.addGetterSetter(Ct,"lineJoin"),G.addGetterSetter(Ct,"lineCap"),G.addGetterSetter(Ct,"miterLimit"),G.addGetterSetter(Ct,"sceneFunc"),G.addGetterSetter(Ct,"hitFunc"),G.addGetterSetter(Ct,"dash"),G.addGetterSetter(Ct,"dashOffset",0,Dt()),G.addGetterSetter(Ct,"shadowColor",void 0,oc()),G.addGetterSetter(Ct,"shadowBlur",0,Dt()),G.addGetterSetter(Ct,"shadowOpacity",1,Dt()),G.addComponentsGetterSetter(Ct,"shadowOffset",["x","y"]),G.addGetterSetter(Ct,"shadowOffsetX",0,Dt()),G.addGetterSetter(Ct,"shadowOffsetY",0,Dt()),G.addGetterSetter(Ct,"fillPatternImage"),G.addGetterSetter(Ct,"fill",void 0,g5()),G.addGetterSetter(Ct,"fillPatternX",0,Dt()),G.addGetterSetter(Ct,"fillPatternY",0,Dt()),G.addGetterSetter(Ct,"fillLinearGradientColorStops"),G.addGetterSetter(Ct,"strokeLinearGradientColorStops"),G.addGetterSetter(Ct,"fillRadialGradientStartRadius",0),G.addGetterSetter(Ct,"fillRadialGradientEndRadius",0),G.addGetterSetter(Ct,"fillRadialGradientColorStops"),G.addGetterSetter(Ct,"fillPatternRepeat","repeat"),G.addGetterSetter(Ct,"fillEnabled",!0),G.addGetterSetter(Ct,"strokeEnabled",!0),G.addGetterSetter(Ct,"shadowEnabled",!0),G.addGetterSetter(Ct,"dashEnabled",!0),G.addGetterSetter(Ct,"strokeScaleEnabled",!0),G.addGetterSetter(Ct,"fillPriority","color"),G.addComponentsGetterSetter(Ct,"fillPatternOffset",["x","y"]),G.addGetterSetter(Ct,"fillPatternOffsetX",0,Dt()),G.addGetterSetter(Ct,"fillPatternOffsetY",0,Dt()),G.addComponentsGetterSetter(Ct,"fillPatternScale",["x","y"]),G.addGetterSetter(Ct,"fillPatternScaleX",1,Dt()),G.addGetterSetter(Ct,"fillPatternScaleY",1,Dt()),G.addComponentsGetterSetter(Ct,"fillLinearGradientStartPoint",["x","y"]),G.addComponentsGetterSetter(Ct,"strokeLinearGradientStartPoint",["x","y"]),G.addGetterSetter(Ct,"fillLinearGradientStartPointX",0),G.addGetterSetter(Ct,"strokeLinearGradientStartPointX",0),G.addGetterSetter(Ct,"fillLinearGradientStartPointY",0),G.addGetterSetter(Ct,"strokeLinearGradientStartPointY",0),G.addComponentsGetterSetter(Ct,"fillLinearGradientEndPoint",["x","y"]),G.addComponentsGetterSetter(Ct,"strokeLinearGradientEndPoint",["x","y"]),G.addGetterSetter(Ct,"fillLinearGradientEndPointX",0),G.addGetterSetter(Ct,"strokeLinearGradientEndPointX",0),G.addGetterSetter(Ct,"fillLinearGradientEndPointY",0),G.addGetterSetter(Ct,"strokeLinearGradientEndPointY",0),G.addComponentsGetterSetter(Ct,"fillRadialGradientStartPoint",["x","y"]),G.addGetterSetter(Ct,"fillRadialGradientStartPointX",0),G.addGetterSetter(Ct,"fillRadialGradientStartPointY",0),G.addComponentsGetterSetter(Ct,"fillRadialGradientEndPoint",["x","y"]),G.addGetterSetter(Ct,"fillRadialGradientEndPointX",0),G.addGetterSetter(Ct,"fillRadialGradientEndPointY",0),G.addGetterSetter(Ct,"fillPatternRotation",0),G.addGetterSetter(Ct,"fillRule",void 0,oc()),G.backCompat(Ct,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const xC="beforeDraw",DC="draw",P5=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],AC=P5.length;let cc=class extends Zi{constructor(t){super(t),this.canvas=new Vo,this.hitCanvas=new E2({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);const i=this.getStage();return i&&i.content&&(i.content.removeChild(this.getNativeCanvasElement()),t<i.children.length-1?i.content.insertBefore(this.getNativeCanvasElement(),i.children[t+1].getCanvas()._canvas):i.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Nt.prototype.moveToTop.call(this);const t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!Nt.prototype.moveUp.call(this))return!1;const i=this.getStage();return!i||!i.content?!1:(i.content.removeChild(this.getNativeCanvasElement()),this.index<i.children.length-1?i.content.insertBefore(this.getNativeCanvasElement(),i.children[this.index+1].getCanvas()._canvas):i.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Nt.prototype.moveDown.call(this)){const t=this.getStage();if(t){const i=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),i[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Nt.prototype.moveToBottom.call(this)){const t=this.getStage();if(t){const i=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),i[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const t=this.getNativeCanvasElement();return Nt.prototype.remove.call(this),t&&t.parentNode&&k._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:i}){return this.canvas.setSize(t,i),this.hitCanvas.setSize(t,i),this._setSmoothEnabled(),this}_validateAdd(t){const i=t.getType();i!=="Group"&&i!=="Shape"&&k.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t={...t},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),Nt.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){k.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){k.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,k.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;let i=1,s=!1;for(;;){for(let u=0;u<AC;u++){const c=P5[u],f=this._getIntersection({x:t.x+c.x*i,y:t.y+c.y*i}),p=f.shape;if(p)return p;if(s=!!f.antialiased,!f.antialiased)break}if(s)i+=1;else return null}}_getIntersection(t){const i=this.hitCanvas.pixelRatio,s=this.hitCanvas.context.getImageData(Math.round(t.x*i),Math.round(t.y*i),1,1).data,u=s[3];if(u===255){const c=k.getHitColorKey(s[0],s[1],s[2]),f=Kp[c];return f?{shape:f}:{antialiased:!0}}else if(u>0)return{antialiased:!0};return{}}drawScene(t,i,s){const u=this.getLayer(),c=t||u&&u.getCanvas();return this._fire(xC,{node:this}),this.clearBeforeDraw()&&c.getContext().clear(),Zi.prototype.drawScene.call(this,c,i,s),this._fire(DC,{node:this}),this}drawHit(t,i){const s=this.getLayer(),u=t||s&&s.hitCanvas;return s&&s.clearBeforeDraw()&&s.getHitCanvas().getContext().clear(),Zi.prototype.drawHit.call(this,u,i),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){k.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return k.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const t=this.parent;!!this.hitCanvas._canvas.parentNode?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}destroy(){return k.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};cc.prototype.nodeType="Layer",En(cc),G.addGetterSetter(cc,"imageSmoothingEnabled",!0),G.addGetterSetter(cc,"clearBeforeDraw",!0),G.addGetterSetter(cc,"hitGraphEnabled",!0,sl());class R2 extends cc{constructor(t){super(t),this.listening(!1),k.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}R2.prototype.nodeType="FastLayer",En(R2);let Wf=class extends Zi{_validateAdd(t){const i=t.getType();i!=="Group"&&i!=="Shape"&&k.throw("You may only add groups and shapes to groups.")}};Wf.prototype.nodeType="Group",En(Wf);const z2=(function(){return rc.performance&&rc.performance.now?function(){return rc.performance.now()}:function(){return new Date().getTime()}})();class Ss{constructor(t,i){this.id=Ss.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:z2(),frameRate:0},this.func=t,this.setLayers(i)}setLayers(t){let i=[];return t&&(i=Array.isArray(t)?t:[t]),this.layers=i,this}getLayers(){return this.layers}addLayer(t){const i=this.layers,s=i.length;for(let u=0;u<s;u++)if(i[u]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const i=Ss.animations,s=i.length;for(let u=0;u<s;u++)if(i[u].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=z2(),Ss._addAnimation(this),this}stop(){return Ss._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const i=t.id,s=this.animations,u=s.length;for(let c=0;c<u;c++)if(s[c].id===i){this.animations.splice(c,1);break}}static _runFrames(){const t={},i=this.animations;for(let s=0;s<i.length;s++){const u=i[s],c=u.layers,f=u.func;u._updateFrameObject(z2());const p=c.length;let m;if(f?m=f.call(u,u.frame)!==!1:m=!0,!!m)for(let S=0;S<p;S++){const b=c[S];b._id!==void 0&&(t[b._id]=b)}}for(const s in t)t.hasOwnProperty(s)&&t[s].batchDraw()}static _animationLoop(){const t=Ss;t.animations.length?(t._runFrames(),k.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,k.requestAnimFrame(this._animationLoop))}}Ss.animations=[],Ss.animIdCounter=0,Ss.animRunning=!1;const MC={node:1,duration:1,easing:1,onFinish:1,yoyo:1},NC=1,Y5=2,q5=3,X5=["fill","stroke","shadowColor"];let OC=0;class RC{constructor(t,i,s,u,c,f,p){this.prop=t,this.propFunc=i,this.begin=u,this._pos=u,this.duration=f,this._change=0,this.prevPos=0,this.yoyo=p,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=s,this._change=c-this.begin,this.pause()}fire(t){const i=this[t];i&&i()}setTime(t){t>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=Y5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=q5,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const t=this.getTimer()-this._startTime;this.state===Y5?this.setTime(t):this.state===q5&&this.setTime(this.duration-t)}pause(){this.state=NC,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Ze{constructor(t){const i=this,s=t.node,u=s._id,c=t.easing||Qp.Linear,f=!!t.yoyo;let p,m;typeof t.duration>"u"?p=.3:t.duration===0?p=.001:p=t.duration,this.node=s,this._id=OC++;const S=s.getLayer()||(s instanceof Ot.Stage?s.getLayers():null);S||k.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Ss(function(){i.tween.onEnterFrame()},S),this.tween=new RC(m,function(b){i._tweenFunc(b)},c,0,1,p*1e3,f),this._addListeners(),Ze.attrs[u]||(Ze.attrs[u]={}),Ze.attrs[u][this._id]||(Ze.attrs[u][this._id]={}),Ze.tweens[u]||(Ze.tweens[u]={});for(m in t)MC[m]===void 0&&this._addAttr(m,t[m]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,i){const s=this.node,u=s._id;let c,f,p,m,S;const b=Ze.tweens[u][t];b&&delete Ze.attrs[u][b][t];let _=s.getAttr(t);if(k._isArray(i))if(c=[],f=Math.max(i.length,_.length),t==="points"&&i.length!==_.length&&(i.length>_.length?(m=_,_=k._prepareArrayForTween(_,i,s.closed())):(p=i,i=k._prepareArrayForTween(i,_,s.closed()))),t.indexOf("fill")===0)for(let x=0;x<f;x++)if(x%2===0)c.push(i[x]-_[x]);else{const D=k.colorToRGBA(_[x]);S=k.colorToRGBA(i[x]),_[x]=D,c.push({r:S.r-D.r,g:S.g-D.g,b:S.b-D.b,a:S.a-D.a})}else for(let x=0;x<f;x++)c.push(i[x]-_[x]);else X5.indexOf(t)!==-1?(_=k.colorToRGBA(_),S=k.colorToRGBA(i),c={r:S.r-_.r,g:S.g-_.g,b:S.b-_.b,a:S.a-_.a}):c=i-_;Ze.attrs[u][this._id][t]={start:_,diff:c,end:i,trueEnd:p,trueStart:m},Ze.tweens[u][t]=this._id}_tweenFunc(t){const i=this.node,s=Ze.attrs[i._id][this._id];let u,c,f,p,m,S,b,_;for(u in s){if(c=s[u],f=c.start,p=c.diff,_=c.end,k._isArray(f))if(m=[],b=Math.max(f.length,_.length),u.indexOf("fill")===0)for(S=0;S<b;S++)S%2===0?m.push((f[S]||0)+p[S]*t):m.push("rgba("+Math.round(f[S].r+p[S].r*t)+","+Math.round(f[S].g+p[S].g*t)+","+Math.round(f[S].b+p[S].b*t)+","+(f[S].a+p[S].a*t)+")");else for(S=0;S<b;S++)m.push((f[S]||0)+p[S]*t);else X5.indexOf(u)!==-1?m="rgba("+Math.round(f.r+p.r*t)+","+Math.round(f.g+p.g*t)+","+Math.round(f.b+p.b*t)+","+(f.a+p.a*t)+")":m=f+p*t;i.setAttr(u,m)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const t=this.node,i=Ze.attrs[t._id][this._id];i.points&&i.points.trueEnd&&t.setAttr("points",i.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const t=this.node,i=Ze.attrs[t._id][this._id];i.points&&i.points.trueStart&&t.points(i.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const t=this.node._id,i=this._id,s=Ze.tweens[t];this.pause(),this.anim&&this.anim.stop();for(const u in s)delete Ze.tweens[t][u];delete Ze.attrs[t][i],Ze.tweens[t]&&(Object.keys(Ze.tweens[t]).length===0&&delete Ze.tweens[t],Object.keys(Ze.attrs[t]).length===0&&delete Ze.attrs[t])}}Ze.attrs={},Ze.tweens={},Nt.prototype.to=function(n){const t=n.onFinish;n.node=this,n.onFinish=function(){this.destroy(),t&&t()},new Ze(n).play()};const Qp={BackEaseIn(n,t,i,s){return i*(n/=s)*n*((1.70158+1)*n-1.70158)+t},BackEaseOut(n,t,i,s){return i*((n=n/s-1)*n*((1.70158+1)*n+1.70158)+1)+t},BackEaseInOut(n,t,i,s){let u=1.70158;return(n/=s/2)<1?i/2*(n*n*(((u*=1.525)+1)*n-u))+t:i/2*((n-=2)*n*(((u*=1.525)+1)*n+u)+2)+t},ElasticEaseIn(n,t,i,s,u,c){let f=0;return n===0?t:(n/=s)===1?t+i:(c||(c=s*.3),!u||u<Math.abs(i)?(u=i,f=c/4):f=c/(2*Math.PI)*Math.asin(i/u),-(u*Math.pow(2,10*(n-=1))*Math.sin((n*s-f)*(2*Math.PI)/c))+t)},ElasticEaseOut(n,t,i,s,u,c){let f=0;return n===0?t:(n/=s)===1?t+i:(c||(c=s*.3),!u||u<Math.abs(i)?(u=i,f=c/4):f=c/(2*Math.PI)*Math.asin(i/u),u*Math.pow(2,-10*n)*Math.sin((n*s-f)*(2*Math.PI)/c)+i+t)},ElasticEaseInOut(n,t,i,s,u,c){let f=0;return n===0?t:(n/=s/2)===2?t+i:(c||(c=s*(.3*1.5)),!u||u<Math.abs(i)?(u=i,f=c/4):f=c/(2*Math.PI)*Math.asin(i/u),n<1?-.5*(u*Math.pow(2,10*(n-=1))*Math.sin((n*s-f)*(2*Math.PI)/c))+t:u*Math.pow(2,-10*(n-=1))*Math.sin((n*s-f)*(2*Math.PI)/c)*.5+i+t)},BounceEaseOut(n,t,i,s){return(n/=s)<1/2.75?i*(7.5625*n*n)+t:n<2/2.75?i*(7.5625*(n-=1.5/2.75)*n+.75)+t:n<2.5/2.75?i*(7.5625*(n-=2.25/2.75)*n+.9375)+t:i*(7.5625*(n-=2.625/2.75)*n+.984375)+t},BounceEaseIn(n,t,i,s){return i-Qp.BounceEaseOut(s-n,0,i,s)+t},BounceEaseInOut(n,t,i,s){return n<s/2?Qp.BounceEaseIn(n*2,0,i,s)*.5+t:Qp.BounceEaseOut(n*2-s,0,i,s)*.5+i*.5+t},EaseIn(n,t,i,s){return i*(n/=s)*n+t},EaseOut(n,t,i,s){return-i*(n/=s)*(n-2)+t},EaseInOut(n,t,i,s){return(n/=s/2)<1?i/2*n*n+t:-i/2*(--n*(n-2)-1)+t},StrongEaseIn(n,t,i,s){return i*(n/=s)*n*n*n*n+t},StrongEaseOut(n,t,i,s){return i*((n=n/s-1)*n*n*n*n+1)+t},StrongEaseInOut(n,t,i,s){return(n/=s/2)<1?i/2*n*n*n*n*n+t:i/2*((n-=2)*n*n*n*n+2)+t},Linear(n,t,i,s){return i*n/s+t}},$f=k._assign(Ot,{Util:k,Transform:Qi,Node:Nt,Container:Zi,Stage:z1,stages:Xp,Layer:cc,FastLayer:R2,Group:Wf,DD:Ne,Shape:Ct,shapes:Kp,Animation:Ss,Tween:Ze,Easings:Qp,Context:C1,Canvas:b2});class Nr extends Ct{_sceneFunc(t){const i=Ot.getAngle(this.angle()),s=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,i,s),t.arc(0,0,this.innerRadius(),i,0,!s),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),i=this.outerRadius(),s=this.clockwise(),u=Ot.getAngle(s?360-this.angle():this.angle()),c=Math.cos(Math.min(u,Math.PI)),f=1,p=Math.sin(Math.min(Math.max(Math.PI,u),3*Math.PI/2)),m=Math.sin(Math.min(u,Math.PI/2)),S=c*(c>0?t:i),b=f*i,_=p*(p>0?t:i),x=m*(m>0?i:t);return{x:S,y:s?-1*x:_,width:b-S,height:x-_}}}Nr.prototype._centroid=!0,Nr.prototype.className="Arc",Nr.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],En(Nr),G.addGetterSetter(Nr,"innerRadius",0,Dt()),G.addGetterSetter(Nr,"outerRadius",0,Dt()),G.addGetterSetter(Nr,"angle",0,Dt()),G.addGetterSetter(Nr,"clockwise",!1,sl());function H2(n,t,i,s,u,c,f){const p=Math.sqrt(Math.pow(i-n,2)+Math.pow(s-t,2)),m=Math.sqrt(Math.pow(u-i,2)+Math.pow(c-s,2)),S=f*p/(p+m),b=f*m/(p+m),_=i-S*(u-n),x=s-S*(c-t),D=i+b*(u-n),A=s+b*(c-t);return[_,x,D,A]}function K5(n,t){const i=n.length,s=[];for(let u=2;u<i-2;u+=2){const c=H2(n[u-2],n[u-1],n[u],n[u+1],n[u+2],n[u+3],t);isNaN(c[0])||(s.push(c[0]),s.push(c[1]),s.push(n[u]),s.push(n[u+1]),s.push(c[2]),s.push(c[3]))}return s}let Or=class extends Ct{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){const i=this.points(),s=i.length,u=this.tension(),c=this.closed(),f=this.bezier();if(!s)return;let p=0;if(t.beginPath(),t.moveTo(i[0],i[1]),u!==0&&s>4){const m=this.getTensionPoints(),S=m.length;for(p=c?0:4,c||t.quadraticCurveTo(m[0],m[1],m[2],m[3]);p<S-2;)t.bezierCurveTo(m[p++],m[p++],m[p++],m[p++],m[p++],m[p++]);c||t.quadraticCurveTo(m[S-2],m[S-1],i[s-2],i[s-1])}else if(f)for(p=2;p<s;)t.bezierCurveTo(i[p++],i[p++],i[p++],i[p++],i[p++],i[p++]);else for(p=2;p<s;p+=2)t.lineTo(i[p],i[p+1]);c?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():K5(this.points(),this.tension())}_getTensionPointsClosed(){const t=this.points(),i=t.length,s=this.tension(),u=H2(t[i-2],t[i-1],t[0],t[1],t[2],t[3],s),c=H2(t[i-4],t[i-3],t[i-2],t[i-1],t[0],t[1],s),f=K5(t,s);return[u[2],u[3]].concat(f).concat([c[0],c[1],t[i-2],t[i-1],c[2],c[3],u[0],u[1],t[0],t[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();let i=t[0],s=t[0],u=t[1],c=t[1],f,p;for(let m=0;m<t.length/2;m++)f=t[m*2],p=t[m*2+1],i=Math.min(i,f),s=Math.max(s,f),u=Math.min(u,p),c=Math.max(c,p);return{x:i,y:u,width:s-i,height:c-u}}};Or.prototype.className="Line",Or.prototype._attrsAffectingSize=["points","bezier","tension"],En(Or),G.addGetterSetter(Or,"closed",!1),G.addGetterSetter(Or,"bezier",!1),G.addGetterSetter(Or,"tension",0,Dt()),G.addGetterSetter(Or,"points",[],JT());const zC=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],HC=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],wC=[[1],[1,1],[1,2,1],[1,3,3,1]],Q5=(n,t,i)=>{let s,u;const f=i/2;s=0;for(let p=0;p<20;p++)u=f*zC[20][p]+f,s+=HC[20][p]*UC(n,t,u);return f*s},Z5=(n,t,i)=>{i===void 0&&(i=1);const s=n[0]-2*n[1]+n[2],u=t[0]-2*t[1]+t[2],c=2*n[1]-2*n[0],f=2*t[1]-2*t[0],p=4*(s*s+u*u),m=4*(s*c+u*f),S=c*c+f*f;if(p===0)return i*Math.sqrt(Math.pow(n[2]-n[0],2)+Math.pow(t[2]-t[0],2));const b=m/(2*p),_=S/p,x=i+b,D=_-b*b,A=x*x+D>0?Math.sqrt(x*x+D):0,N=b*b+D>0?Math.sqrt(b*b+D):0,R=b+Math.sqrt(b*b+D)!==0?D*Math.log(Math.abs((x+A)/(b+N))):0;return Math.sqrt(p)/2*(x*A-b*N+R)};function UC(n,t,i){const s=w2(1,i,n),u=w2(1,i,t),c=s*s+u*u;return Math.sqrt(c)}const w2=(n,t,i)=>{const s=i.length-1;let u,c;if(s===0)return 0;if(n===0){c=0;for(let f=0;f<=s;f++)c+=wC[s][f]*Math.pow(1-t,s-f)*Math.pow(t,f)*i[f];return c}else{u=new Array(s);for(let f=0;f<s;f++)u[f]=s*(i[f+1]-i[f]);return w2(n-1,t,u)}},J5=(n,t,i)=>{let s=1,u=n/t,c=(n-i(u))/t,f=0;for(;s>.001;){const p=i(u+c),m=Math.abs(n-p)/t;if(m<s)s=m,u+=c;else{const S=i(u-c),b=Math.abs(n-S)/t;b<s?(s=b,u-=c):c/=2}if(f++,f>500)break}return u};let bs=class Ki extends Ct{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Ki.parsePathData(this.data()),this.pathLength=Ki.getPathLength(this.dataArray)}_sceneFunc(t){const i=this.dataArray;t.beginPath();let s=!1;for(let u=0;u<i.length;u++){const c=i[u].command,f=i[u].points;switch(c){case"L":t.lineTo(f[0],f[1]);break;case"M":t.moveTo(f[0],f[1]);break;case"C":t.bezierCurveTo(f[0],f[1],f[2],f[3],f[4],f[5]);break;case"Q":t.quadraticCurveTo(f[0],f[1],f[2],f[3]);break;case"A":const p=f[0],m=f[1],S=f[2],b=f[3],_=f[4],x=f[5],D=f[6],A=f[7],N=S>b?S:b,R=S>b?1:S/b,O=S>b?b/S:1;t.translate(p,m),t.rotate(D),t.scale(R,O),t.arc(0,0,N,_,_+x,1-A),t.scale(1/R,1/O),t.rotate(-D),t.translate(-p,-m);break;case"z":s=!0,t.closePath();break}}!s&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){let t=[];this.dataArray.forEach(function(m){if(m.command==="A"){const S=m.points[4],b=m.points[5],_=m.points[4]+b;let x=Math.PI/180;if(Math.abs(S-_)<x&&(x=Math.abs(S-_)),b<0)for(let D=S-x;D>_;D-=x){const A=Ki.getPointOnEllipticalArc(m.points[0],m.points[1],m.points[2],m.points[3],D,0);t.push(A.x,A.y)}else for(let D=S+x;D<_;D+=x){const A=Ki.getPointOnEllipticalArc(m.points[0],m.points[1],m.points[2],m.points[3],D,0);t.push(A.x,A.y)}}else if(m.command==="C")for(let S=0;S<=1;S+=.01){const b=Ki.getPointOnCubicBezier(S,m.start.x,m.start.y,m.points[0],m.points[1],m.points[2],m.points[3],m.points[4],m.points[5]);t.push(b.x,b.y)}else t=t.concat(m.points)});let i=t[0],s=t[0],u=t[1],c=t[1],f,p;for(let m=0;m<t.length/2;m++)f=t[m*2],p=t[m*2+1],isNaN(f)||(i=Math.min(i,f),s=Math.max(s,f)),isNaN(p)||(u=Math.min(u,p),c=Math.max(c,p));return{x:i,y:u,width:s-i,height:c-u}}getLength(){return this.pathLength}getPointAtLength(t){return Ki.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,i,s,u){return Math.sqrt((s-t)*(s-t)+(u-i)*(u-i))}static getPathLength(t){let i=0;for(let s=0;s<t.length;++s)i+=t[s].pathLength;return i}static getPointAtLengthOfDataArray(t,i){let s,u=0,c=i.length;if(!c)return null;for(;u<c&&t>i[u].pathLength;)t-=i[u].pathLength,++u;if(u===c)return s=i[u-1].points.slice(-2),{x:s[0],y:s[1]};if(t<.01)return i[u].command==="M"?(s=i[u].points.slice(0,2),{x:s[0],y:s[1]}):{x:i[u].start.x,y:i[u].start.y};const f=i[u],p=f.points;switch(f.command){case"L":return Ki.getPointOnLine(t,f.start.x,f.start.y,p[0],p[1]);case"C":return Ki.getPointOnCubicBezier(J5(t,Ki.getPathLength(i),N=>Q5([f.start.x,p[0],p[2],p[4]],[f.start.y,p[1],p[3],p[5]],N)),f.start.x,f.start.y,p[0],p[1],p[2],p[3],p[4],p[5]);case"Q":return Ki.getPointOnQuadraticBezier(J5(t,Ki.getPathLength(i),N=>Z5([f.start.x,p[0],p[2]],[f.start.y,p[1],p[3]],N)),f.start.x,f.start.y,p[0],p[1],p[2],p[3]);case"A":const m=p[0],S=p[1],b=p[2],_=p[3],x=p[5],D=p[6];let A=p[4];return A+=x*t/f.pathLength,Ki.getPointOnEllipticalArc(m,S,b,_,A,D)}return null}static getPointOnLine(t,i,s,u,c,f,p){f=f??i,p=p??s;const m=this.getLineLength(i,s,u,c);if(m<1e-10)return{x:i,y:s};if(u===i)return{x:f,y:p+(c>s?t:-t)};const S=(c-s)/(u-i),b=Math.sqrt(t*t/(1+S*S))*(u<i?-1:1),_=S*b;if(Math.abs(p-s-S*(f-i))<1e-10)return{x:f+b,y:p+_};const x=((f-i)*(u-i)+(p-s)*(c-s))/(m*m),D=i+x*(u-i),A=s+x*(c-s),N=this.getLineLength(f,p,D,A),R=Math.sqrt(t*t-N*N),O=Math.sqrt(R*R/(1+S*S))*(u<i?-1:1),U=S*O;return{x:D+O,y:A+U}}static getPointOnCubicBezier(t,i,s,u,c,f,p,m,S){function b(R){return R*R*R}function _(R){return 3*R*R*(1-R)}function x(R){return 3*R*(1-R)*(1-R)}function D(R){return(1-R)*(1-R)*(1-R)}const A=m*b(t)+f*_(t)+u*x(t)+i*D(t),N=S*b(t)+p*_(t)+c*x(t)+s*D(t);return{x:A,y:N}}static getPointOnQuadraticBezier(t,i,s,u,c,f,p){function m(D){return D*D}function S(D){return 2*D*(1-D)}function b(D){return(1-D)*(1-D)}const _=f*m(t)+u*S(t)+i*b(t),x=p*m(t)+c*S(t)+s*b(t);return{x:_,y:x}}static getPointOnEllipticalArc(t,i,s,u,c,f){const p=Math.cos(f),m=Math.sin(f),S={x:s*Math.cos(c),y:u*Math.sin(c)};return{x:t+(S.x*p-S.y*m),y:i+(S.x*m+S.y*p)}}static parsePathData(t){if(!t)return[];let i=t;const s=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];i=i.replace(new RegExp(" ","g"),",");for(let _=0;_<s.length;_++)i=i.replace(new RegExp(s[_],"g"),"|"+s[_]);const u=i.split("|"),c=[],f=[];let p=0,m=0;const S=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let b;for(let _=1;_<u.length;_++){let x=u[_],D=x.charAt(0);for(x=x.slice(1),f.length=0;b=S.exec(x);)f.push(b[0]);let A=[],N=D==="A"||D==="a"?0:-1;for(let R=0,O=f.length;R<O;R++){const U=f[R];if(U==="00"){A.push(0,0),N>=0&&(N+=2,N>=7&&(N-=7));continue}if(N>=0){if(N===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(U)){A.push(parseInt(U[0],10)),A.push(parseInt(U[1],10)),A.push(parseFloat(U.slice(2))),N+=3,N>=7&&(N-=7);continue}if(U==="11"||U==="10"||U==="01"){A.push(parseInt(U[0],10)),A.push(parseInt(U[1],10)),N+=2,N>=7&&(N-=7);continue}if(U==="0"||U==="1"){A.push(parseInt(U,10)),N+=1,N>=7&&(N-=7);continue}}else if(N===4){if(/^[01]\d+(?:\.\d+)?$/.test(U)){A.push(parseInt(U[0],10)),A.push(parseFloat(U.slice(1))),N+=2,N>=7&&(N-=7);continue}if(U==="0"||U==="1"){A.push(parseInt(U,10)),N+=1,N>=7&&(N-=7);continue}}const j=parseFloat(U);isNaN(j)?A.push(0):A.push(j),N+=1,N>=7&&(N-=7)}else{const j=parseFloat(U);isNaN(j)?A.push(0):A.push(j)}}for(;A.length>0&&!isNaN(A[0]);){let R="",O=[];const U=p,j=m;let V,J,W,st,I,et,nt,bt,rt,dt;switch(D){case"l":p+=A.shift(),m+=A.shift(),R="L",O.push(p,m);break;case"L":p=A.shift(),m=A.shift(),O.push(p,m);break;case"m":const pt=A.shift(),tt=A.shift();if(p+=pt,m+=tt,R="M",c.length>2&&c[c.length-1].command==="z"){for(let w=c.length-2;w>=0;w--)if(c[w].command==="M"){p=c[w].points[0]+pt,m=c[w].points[1]+tt;break}}O.push(p,m),D="l";break;case"M":p=A.shift(),m=A.shift(),R="M",O.push(p,m),D="L";break;case"h":p+=A.shift(),R="L",O.push(p,m);break;case"H":p=A.shift(),R="L",O.push(p,m);break;case"v":m+=A.shift(),R="L",O.push(p,m);break;case"V":m=A.shift(),R="L",O.push(p,m);break;case"C":O.push(A.shift(),A.shift(),A.shift(),A.shift()),p=A.shift(),m=A.shift(),O.push(p,m);break;case"c":O.push(p+A.shift(),m+A.shift(),p+A.shift(),m+A.shift()),p+=A.shift(),m+=A.shift(),R="C",O.push(p,m);break;case"S":J=p,W=m,V=c[c.length-1],V.command==="C"&&(J=p+(p-V.points[2]),W=m+(m-V.points[3])),O.push(J,W,A.shift(),A.shift()),p=A.shift(),m=A.shift(),R="C",O.push(p,m);break;case"s":J=p,W=m,V=c[c.length-1],V.command==="C"&&(J=p+(p-V.points[2]),W=m+(m-V.points[3])),O.push(J,W,p+A.shift(),m+A.shift()),p+=A.shift(),m+=A.shift(),R="C",O.push(p,m);break;case"Q":O.push(A.shift(),A.shift()),p=A.shift(),m=A.shift(),O.push(p,m);break;case"q":O.push(p+A.shift(),m+A.shift()),p+=A.shift(),m+=A.shift(),R="Q",O.push(p,m);break;case"T":J=p,W=m,V=c[c.length-1],V.command==="Q"&&(J=p+(p-V.points[0]),W=m+(m-V.points[1])),p=A.shift(),m=A.shift(),R="Q",O.push(J,W,p,m);break;case"t":J=p,W=m,V=c[c.length-1],V.command==="Q"&&(J=p+(p-V.points[0]),W=m+(m-V.points[1])),p+=A.shift(),m+=A.shift(),R="Q",O.push(J,W,p,m);break;case"A":st=A.shift(),I=A.shift(),et=A.shift(),nt=A.shift(),bt=A.shift(),rt=p,dt=m,p=A.shift(),m=A.shift(),R="A",O=this.convertEndpointToCenterParameterization(rt,dt,p,m,nt,bt,st,I,et);break;case"a":st=A.shift(),I=A.shift(),et=A.shift(),nt=A.shift(),bt=A.shift(),rt=p,dt=m,p+=A.shift(),m+=A.shift(),R="A",O=this.convertEndpointToCenterParameterization(rt,dt,p,m,nt,bt,st,I,et);break}c.push({command:R||D,points:O,start:{x:U,y:j},pathLength:this.calcLength(U,j,R||D,O)})}(D==="z"||D==="Z")&&c.push({command:"z",points:[],start:void 0,pathLength:0})}return c}static calcLength(t,i,s,u){let c,f,p,m;const S=Ki;switch(s){case"L":return S.getLineLength(t,i,u[0],u[1]);case"C":return Q5([t,u[0],u[2],u[4]],[i,u[1],u[3],u[5]],1);case"Q":return Z5([t,u[0],u[2]],[i,u[1],u[3]],1);case"A":c=0;const b=u[4],_=u[5],x=u[4]+_;let D=Math.PI/180;if(Math.abs(b-x)<D&&(D=Math.abs(b-x)),f=S.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],b,0),_<0)for(m=b-D;m>x;m-=D)p=S.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],m,0),c+=S.getLineLength(f.x,f.y,p.x,p.y),f=p;else for(m=b+D;m<x;m+=D)p=S.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],m,0),c+=S.getLineLength(f.x,f.y,p.x,p.y),f=p;return p=S.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],x,0),c+=S.getLineLength(f.x,f.y,p.x,p.y),c}return 0}static convertEndpointToCenterParameterization(t,i,s,u,c,f,p,m,S){const b=S*(Math.PI/180),_=Math.cos(b)*(t-s)/2+Math.sin(b)*(i-u)/2,x=-1*Math.sin(b)*(t-s)/2+Math.cos(b)*(i-u)/2,D=_*_/(p*p)+x*x/(m*m);D>1&&(p*=Math.sqrt(D),m*=Math.sqrt(D));let A=Math.sqrt((p*p*(m*m)-p*p*(x*x)-m*m*(_*_))/(p*p*(x*x)+m*m*(_*_)));c===f&&(A*=-1),isNaN(A)&&(A=0);const N=A*p*x/m,R=A*-m*_/p,O=(t+s)/2+Math.cos(b)*N-Math.sin(b)*R,U=(i+u)/2+Math.sin(b)*N+Math.cos(b)*R,j=function(nt){return Math.sqrt(nt[0]*nt[0]+nt[1]*nt[1])},V=function(nt,bt){return(nt[0]*bt[0]+nt[1]*bt[1])/(j(nt)*j(bt))},J=function(nt,bt){return(nt[0]*bt[1]<nt[1]*bt[0]?-1:1)*Math.acos(V(nt,bt))},W=J([1,0],[(_-N)/p,(x-R)/m]),st=[(_-N)/p,(x-R)/m],I=[(-1*_-N)/p,(-1*x-R)/m];let et=J(st,I);return V(st,I)<=-1&&(et=Math.PI),V(st,I)>=1&&(et=0),f===0&&et>0&&(et=et-2*Math.PI),f===1&&et<0&&(et=et+2*Math.PI),[O,U,p,m,W,et,b,f]}};bs.prototype.className="Path",bs.prototype._attrsAffectingSize=["data"],En(bs),G.addGetterSetter(bs,"data");class fc extends Or{_sceneFunc(t){super._sceneFunc(t);const i=Math.PI*2,s=this.points();let u=s;const c=this.tension()!==0&&s.length>4;c&&(u=this.getTensionPoints());const f=this.pointerLength(),p=s.length;let m,S;if(c){const x=[u[u.length-4],u[u.length-3],u[u.length-2],u[u.length-1],s[p-2],s[p-1]],D=bs.calcLength(u[u.length-4],u[u.length-3],"C",x),A=bs.getPointOnQuadraticBezier(Math.min(1,1-f/D),x[0],x[1],x[2],x[3],x[4],x[5]);m=s[p-2]-A.x,S=s[p-1]-A.y}else m=s[p-2]-s[p-4],S=s[p-1]-s[p-3];const b=(Math.atan2(S,m)+i)%i,_=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(s[p-2],s[p-1]),t.rotate(b),t.moveTo(0,0),t.lineTo(-f,_/2),t.lineTo(-f,-_/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(s[0],s[1]),c?(m=(u[0]+u[2])/2-s[0],S=(u[1]+u[3])/2-s[1]):(m=s[2]-s[0],S=s[3]-s[1]),t.rotate((Math.atan2(-S,-m)+i)%i),t.moveTo(0,0),t.lineTo(-f,_/2),t.lineTo(-f,-_/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){const i=this.dashEnabled();i&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),i&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),i=this.pointerWidth()/2;return{x:t.x,y:t.y-i,width:t.width,height:t.height+i*2}}}fc.prototype.className="Arrow",En(fc),G.addGetterSetter(fc,"pointerLength",10,Dt()),G.addGetterSetter(fc,"pointerWidth",10,Dt()),G.addGetterSetter(fc,"pointerAtBeginning",!1),G.addGetterSetter(fc,"pointerAtEnding",!0);let th=class extends Ct{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};th.prototype._centroid=!0,th.prototype.className="Circle",th.prototype._attrsAffectingSize=["radius"],En(th),G.addGetterSetter(th,"radius",0,Dt());class Lo extends Ct{_sceneFunc(t){const i=this.radiusX(),s=this.radiusY();t.beginPath(),t.save(),i!==s&&t.scale(1,s/i),t.arc(0,0,i,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}Lo.prototype.className="Ellipse",Lo.prototype._centroid=!0,Lo.prototype._attrsAffectingSize=["radiusX","radiusY"],En(Lo),G.addComponentsGetterSetter(Lo,"radius",["x","y"]),G.addGetterSetter(Lo,"radiusX",0,Dt()),G.addGetterSetter(Lo,"radiusY",0,Dt());let ll=class gT extends Ct{constructor(t){super(t),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",i=>{this._removeImageLoad(i.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",this._loadListener)}_removeImageLoad(t){t&&t.removeEventListener&&t.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const t=!!this.cornerRadius(),i=this.hasShadow();return t&&i?!0:super._useBufferCanvas(!0)}_sceneFunc(t){const i=this.getWidth(),s=this.getHeight(),u=this.cornerRadius(),c=this.attrs.image;let f;if(c){const p=this.attrs.cropWidth,m=this.attrs.cropHeight;p&&m?f=[c,this.cropX(),this.cropY(),p,m,0,0,i,s]:f=[c,0,0,i,s]}(this.hasFill()||this.hasStroke()||u)&&(t.beginPath(),u?k.drawRoundedRectPath(t,i,s,u):t.rect(0,0,i,s),t.closePath(),t.fillStrokeShape(this)),c&&(u&&t.clip(),t.drawImage.apply(t,f))}_hitFunc(t){const i=this.width(),s=this.height(),u=this.cornerRadius();t.beginPath(),u?k.drawRoundedRectPath(t,i,s,u):t.rect(0,0,i,s),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,i,s;return(s=(t=this.attrs.width)!==null&&t!==void 0?t:(i=this.image())===null||i===void 0?void 0:i.width)!==null&&s!==void 0?s:0}getHeight(){var t,i,s;return(s=(t=this.attrs.height)!==null&&t!==void 0?t:(i=this.image())===null||i===void 0?void 0:i.height)!==null&&s!==void 0?s:0}static fromURL(t,i,s=null){const u=k.createImageElement();u.onload=function(){const c=new gT({image:u});i(c)},u.onerror=s,u.crossOrigin="Anonymous",u.src=t}};ll.prototype.className="Image",ll.prototype._attrsAffectingSize=["image"],En(ll),G.addGetterSetter(ll,"cornerRadius",0,x1(4)),G.addGetterSetter(ll,"image"),G.addComponentsGetterSetter(ll,"crop",["x","y","width","height"]),G.addGetterSetter(ll,"cropX",0,Dt()),G.addGetterSetter(ll,"cropY",0,Dt()),G.addGetterSetter(ll,"cropWidth",0,Dt()),G.addGetterSetter(ll,"cropHeight",0,Dt());const F5=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],BC="Change.konva",VC="none",U2="up",B2="right",V2="down",G2="left",GC=F5.length;let j2=class extends Wf{constructor(t){super(t),this.on("add.konva",function(i){this._addListeners(i.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){let i=this,s;const u=function(){i._sync()};for(s=0;s<GC;s++)t.on(F5[s]+BC,u)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let t=this.getText(),i=this.getTag(),s,u,c,f,p,m,S;if(t&&i){switch(s=t.width(),u=t.height(),c=i.pointerDirection(),f=i.pointerWidth(),S=i.pointerHeight(),p=0,m=0,c){case U2:p=s/2,m=-1*S;break;case B2:p=s+f,m=u/2;break;case V2:p=s/2,m=u+S;break;case G2:p=-1*f,m=u/2;break}i.setAttrs({x:-1*p,y:-1*m,width:s,height:u}),t.setAttrs({x:-1*p,y:-1*m})}}};j2.prototype.className="Label",En(j2);class hc extends Ct{_sceneFunc(t){const i=this.width(),s=this.height(),u=this.pointerDirection(),c=this.pointerWidth(),f=this.pointerHeight(),p=this.cornerRadius();let m=0,S=0,b=0,_=0;typeof p=="number"?m=S=b=_=Math.min(p,i/2,s/2):(m=Math.min(p[0]||0,i/2,s/2),S=Math.min(p[1]||0,i/2,s/2),_=Math.min(p[2]||0,i/2,s/2),b=Math.min(p[3]||0,i/2,s/2)),t.beginPath(),t.moveTo(m,0),u===U2&&(t.lineTo((i-c)/2,0),t.lineTo(i/2,-1*f),t.lineTo((i+c)/2,0)),t.lineTo(i-S,0),t.arc(i-S,S,S,Math.PI*3/2,0,!1),u===B2&&(t.lineTo(i,(s-f)/2),t.lineTo(i+c,s/2),t.lineTo(i,(s+f)/2)),t.lineTo(i,s-_),t.arc(i-_,s-_,_,0,Math.PI/2,!1),u===V2&&(t.lineTo((i+c)/2,s),t.lineTo(i/2,s+f),t.lineTo((i-c)/2,s)),t.lineTo(b,s),t.arc(b,s-b,b,Math.PI/2,Math.PI,!1),u===G2&&(t.lineTo(0,(s+f)/2),t.lineTo(-1*c,s/2),t.lineTo(0,(s-f)/2)),t.lineTo(0,m),t.arc(m,m,m,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){let t=0,i=0,s=this.pointerWidth(),u=this.pointerHeight(),c=this.pointerDirection(),f=this.width(),p=this.height();return c===U2?(i-=u,p+=u):c===V2?p+=u:c===G2?(t-=s*1.5,f+=s):c===B2&&(f+=s*1.5),{x:t,y:i,width:f,height:p}}}hc.prototype.className="Tag",En(hc),G.addGetterSetter(hc,"pointerDirection",VC),G.addGetterSetter(hc,"pointerWidth",0,Dt()),G.addGetterSetter(hc,"pointerHeight",0,Dt()),G.addGetterSetter(hc,"cornerRadius",0,x1(4));let Zp=class extends Ct{_sceneFunc(t){const i=this.cornerRadius(),s=this.width(),u=this.height();t.beginPath(),i?k.drawRoundedRectPath(t,s,u,i):t.rect(0,0,s,u),t.closePath(),t.fillStrokeShape(this)}};Zp.prototype.className="Rect",En(Zp),G.addGetterSetter(Zp,"cornerRadius",0,x1(4));class Po extends Ct{_sceneFunc(t){const i=this._getPoints(),s=this.radius(),u=this.sides(),c=this.cornerRadius();if(t.beginPath(),c)k.drawRoundedPolygonPath(t,i,u,s,c);else{t.moveTo(i[0].x,i[0].y);for(let f=1;f<i.length;f++)t.lineTo(i[f].x,i[f].y)}t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,i=this.attrs.radius||0,s=[];for(let u=0;u<t;u++)s.push({x:i*Math.sin(u*2*Math.PI/t),y:-1*i*Math.cos(u*2*Math.PI/t)});return s}getSelfRect(){const t=this._getPoints();let i=t[0].x,s=t[0].x,u=t[0].y,c=t[0].y;return t.forEach(f=>{i=Math.min(i,f.x),s=Math.max(s,f.x),u=Math.min(u,f.y),c=Math.max(c,f.y)}),{x:i,y:u,width:s-i,height:c-u}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Po.prototype.className="RegularPolygon",Po.prototype._centroid=!0,Po.prototype._attrsAffectingSize=["radius"],En(Po),G.addGetterSetter(Po,"radius",0,Dt()),G.addGetterSetter(Po,"sides",0,Dt()),G.addGetterSetter(Po,"cornerRadius",0,x1(4));const k5=Math.PI*2;class dc extends Ct{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,k5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),k5,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}dc.prototype.className="Ring",dc.prototype._centroid=!0,dc.prototype._attrsAffectingSize=["innerRadius","outerRadius"],En(dc),G.addGetterSetter(dc,"innerRadius",0,Dt()),G.addGetterSetter(dc,"outerRadius",0,Dt());class Kl extends Ct{constructor(t){super(t),this._updated=!0,this.anim=new Ss(()=>{const i=this._updated;return this._updated=!1,i}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){const i=this.animation(),s=this.frameIndex(),u=s*4,c=this.animations()[i],f=this.frameOffsets(),p=c[u+0],m=c[u+1],S=c[u+2],b=c[u+3],_=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,S,b),t.closePath(),t.fillStrokeShape(this)),_)if(f){const x=f[i],D=s*2;t.drawImage(_,p,m,S,b,x[D+0],x[D+1],S,b)}else t.drawImage(_,p,m,S,b,0,0,S,b)}_hitFunc(t){const i=this.animation(),s=this.frameIndex(),u=s*4,c=this.animations()[i],f=this.frameOffsets(),p=c[u+2],m=c[u+3];if(t.beginPath(),f){const S=f[i],b=s*2;t.rect(S[b+0],S[b+1],p,m)}else t.rect(0,0,p,m);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const t=this.frameIndex(),i=this.animation(),s=this.animations(),u=s[i],c=u.length/4;t<c-1?this.frameIndex(t+1):this.frameIndex(0)}}Kl.prototype.className="Sprite",En(Kl),G.addGetterSetter(Kl,"animation"),G.addGetterSetter(Kl,"animations"),G.addGetterSetter(Kl,"frameOffsets"),G.addGetterSetter(Kl,"image"),G.addGetterSetter(Kl,"frameIndex",0,Dt()),G.addGetterSetter(Kl,"frameRate",17,Dt()),G.backCompat(Kl,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Yo extends Ct{_sceneFunc(t){const i=this.innerRadius(),s=this.outerRadius(),u=this.numPoints();t.beginPath(),t.moveTo(0,0-s);for(let c=1;c<u*2;c++){const f=c%2===0?s:i,p=f*Math.sin(c*Math.PI/u),m=-1*f*Math.cos(c*Math.PI/u);t.lineTo(p,m)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Yo.prototype.className="Star",Yo.prototype._centroid=!0,Yo.prototype._attrsAffectingSize=["innerRadius","outerRadius"],En(Yo),G.addGetterSetter(Yo,"numPoints",5,Dt()),G.addGetterSetter(Yo,"innerRadius",0,Dt()),G.addGetterSetter(Yo,"outerRadius",0,Dt());function qo(n){return[...n].reduce((t,i,s,u)=>{if(new RegExp("\\p{Emoji}","u").test(i)){const c=u[s+1];c&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(c)?(t.push(i+c),u[s+1]=""):t.push(i)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(i+(u[s+1]||""))?t.push(i+u[s+1]):s>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(i)?t[t.length-1]+=i:i&&t.push(i);return t},[])}const eh="auto",jC="center",I5="inherit",Jp="justify",LC="Change.konva",PC="2d",W5="-",$5="left",YC="text",qC="Text",XC="top",KC="bottom",t4="middle",e4="normal",QC="px ",w1=" ",ZC="right",n4="rtl",JC="word",FC="char",a4="none",L2="…",i4=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],kC=i4.length;function IC(n){return n.split(",").map(t=>{t=t.trim();const i=t.indexOf(" ")>=0,s=t.indexOf('"')>=0||t.indexOf("'")>=0;return i&&!s&&(t=`"${t}"`),t}).join(", ")}let U1;function P2(){return U1||(U1=k.createCanvasElement().getContext(PC),U1)}function WC(n){n.fillText(this._partialText,this._partialTextX,this._partialTextY)}function $C(n){n.setAttr("miterLimit",2),n.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function t_(n){return n=n||{},!n.fillLinearGradientColorStops&&!n.fillRadialGradientColorStops&&!n.fillPatternImage&&(n.fill=n.fill||"black"),n}class an extends Ct{constructor(t){super(t_(t)),this._partialTextX=0,this._partialTextY=0;for(let i=0;i<kC;i++)this.on(i4[i]+LC,this._setTextData);this._setTextData()}_sceneFunc(t){var i,s;const u=this.textArr,c=u.length;if(!this.text())return;let f=this.padding(),p=this.fontSize(),m=this.lineHeight()*p,S=this.verticalAlign(),b=this.direction(),_=0,x=this.align(),D=this.getWidth(),A=this.letterSpacing(),N=this.charRenderFunc(),R=this.fill(),O=this.textDecoration(),U=O.indexOf("underline")!==-1,j=O.indexOf("line-through")!==-1,V;b=b===I5?t.direction:b;let J=m/2,W=t4;if(!Ot.legacyTextRendering){const st=this.measureSize("M");W="alphabetic";const I=(i=st.fontBoundingBoxAscent)!==null&&i!==void 0?i:st.actualBoundingBoxAscent,et=(s=st.fontBoundingBoxDescent)!==null&&s!==void 0?s:st.actualBoundingBoxDescent;J=(I-et)/2+m/2}for(b===n4&&t.setAttr("direction",b),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",W),t.setAttr("textAlign",$5),S===t4?_=(this.getHeight()-c*m-f*2)/2:S===KC&&(_=this.getHeight()-c*m-f*2),t.translate(f,_+f),V=0;V<c;V++){let st=0,I=0;const et=u[V],nt=et.text,bt=et.width,rt=et.lastInParagraph;if(t.save(),x===ZC?st+=D-bt-f*2:x===jC&&(st+=(D-bt-f*2)/2),U){t.save(),t.beginPath();const pt=Ot.legacyTextRendering?Math.round(p/2):Math.round(p/4),tt=st,w=J+I+pt;t.moveTo(tt,w);const F=x===Jp&&!rt?D-f*2:bt;t.lineTo(tt+Math.round(F),w),t.lineWidth=p/15;const K=this._getLinearGradient();t.strokeStyle=K||R,t.stroke(),t.restore()}const dt=st;if(b!==n4&&(A!==0||x===Jp||N)){const pt=nt.split(" ").length-1,tt=qo(nt);for(let w=0;w<tt.length;w++){const F=tt[w];if(F===" "&&!rt&&x===Jp&&(st+=(D-f*2-bt)/pt),this._partialTextX=st,this._partialTextY=J+I,this._partialText=F,N){t.save();const at=u.slice(0,V).reduce(($,gt)=>$+qo(gt.text).length,0),St=w+at;N({char:F,index:St,x:st,y:J+I,lineIndex:V,column:w,isLastInLine:rt,width:this.measureSize(F).width,context:t})}t.fillStrokeShape(this),N&&t.restore(),st+=this.measureSize(F).width+A}}else A!==0&&t.setAttr("letterSpacing",`${A}px`),this._partialTextX=st,this._partialTextY=J+I,this._partialText=nt,t.fillStrokeShape(this);if(j){t.save(),t.beginPath();const pt=Ot.legacyTextRendering?0:-Math.round(p/4),tt=dt;t.moveTo(tt,J+I+pt);const w=x===Jp&&!rt?D-f*2:bt;t.lineTo(tt+Math.round(w),J+I+pt),t.lineWidth=p/15;const F=this._getLinearGradient();t.strokeStyle=F||R,t.stroke(),t.restore()}t.restore(),c>1&&(J+=m)}}_hitFunc(t){const i=this.getWidth(),s=this.getHeight();t.beginPath(),t.rect(0,0,i,s),t.closePath(),t.fillStrokeShape(this)}setText(t){const i=k._isString(t)?t:t==null?"":t+"";return this._setAttr(YC,i),this}getWidth(){return this.attrs.width===eh||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===eh||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return k.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var i,s,u,c,f,p,m,S,b,_,x;let D=P2(),A=this.fontSize(),N;D.save(),D.font=this._getContextFont(),N=D.measureText(t),D.restore();const R=A/100;return{actualBoundingBoxAscent:(i=N.actualBoundingBoxAscent)!==null&&i!==void 0?i:71.58203125*R,actualBoundingBoxDescent:(s=N.actualBoundingBoxDescent)!==null&&s!==void 0?s:0,actualBoundingBoxLeft:(u=N.actualBoundingBoxLeft)!==null&&u!==void 0?u:-7.421875*R,actualBoundingBoxRight:(c=N.actualBoundingBoxRight)!==null&&c!==void 0?c:75.732421875*R,alphabeticBaseline:(f=N.alphabeticBaseline)!==null&&f!==void 0?f:0,emHeightAscent:(p=N.emHeightAscent)!==null&&p!==void 0?p:100*R,emHeightDescent:(m=N.emHeightDescent)!==null&&m!==void 0?m:-20*R,fontBoundingBoxAscent:(S=N.fontBoundingBoxAscent)!==null&&S!==void 0?S:91*R,fontBoundingBoxDescent:(b=N.fontBoundingBoxDescent)!==null&&b!==void 0?b:21*R,hangingBaseline:(_=N.hangingBaseline)!==null&&_!==void 0?_:72.80000305175781*R,ideographicBaseline:(x=N.ideographicBaseline)!==null&&x!==void 0?x:-21*R,width:N.width,height:A}}_getContextFont(){return this.fontStyle()+w1+this.fontVariant()+w1+(this.fontSize()+QC)+IC(this.fontFamily())}_addTextLine(t){this.align()===Jp&&(t=t.trim());const s=this._getTextWidth(t);return this.textArr.push({text:t,width:s,lastInParagraph:!1})}_getTextWidth(t){const i=this.letterSpacing(),s=t.length;return P2().measureText(t).width+i*s}_setTextData(){let t=this.text().split(`
|
|
15
|
-
`),i=+this.fontSize(),s=0,u=this.lineHeight()*i,c=this.attrs.width,f=this.attrs.height,p=c!==eh&&c!==void 0,m=f!==eh&&f!==void 0,S=this.padding(),b=c-S*2,_=f-S*2,x=0,D=this.wrap(),A=D!==a4,N=D!==FC&&A,R=this.ellipsis();this.textArr=[],P2().font=this._getContextFont();const O=R?this._getTextWidth(L2):0;for(let U=0,j=t.length;U<j;++U){let V=t[U],J=this._getTextWidth(V);if(p&&J>b)for(;V.length>0;){let W=0,st=qo(V).length,I="",et=0;for(;W<st;){const nt=W+st>>>1,bt=qo(V),rt=bt.slice(0,nt+1).join(""),dt=this._getTextWidth(rt);(R&&m&&x+u>_?dt+O:dt)<=b?(W=nt+1,I=rt,et=dt):st=nt}if(I){if(N){const rt=qo(V),dt=qo(I),pt=rt[dt.length],tt=pt===w1||pt===W5;let w;if(tt&&et<=b)w=dt.length;else{const F=dt.lastIndexOf(w1),K=dt.lastIndexOf(W5);w=Math.max(F,K)+1}w>0&&(W=w,I=rt.slice(0,W).join(""),et=this._getTextWidth(I))}if(I=I.trimRight(),this._addTextLine(I),s=Math.max(s,et),x+=u,this._shouldHandleEllipsis(x)){this._tryToAddEllipsisToLastLine();break}if(V=qo(V).slice(W).join("").trimLeft(),V.length>0&&(J=this._getTextWidth(V),J<=b)){this._addTextLine(V),x+=u,s=Math.max(s,J);break}}else break}else this._addTextLine(V),x+=u,s=Math.max(s,J),this._shouldHandleEllipsis(x)&&U<j-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),m&&x+u>_)break}this.textHeight=i,this.textWidth=s}_shouldHandleEllipsis(t){const i=+this.fontSize(),s=this.lineHeight()*i,u=this.attrs.height,c=u!==eh&&u!==void 0,f=this.padding(),p=u-f*2;return!(this.wrap()!==a4)||c&&t+s>p}_tryToAddEllipsisToLastLine(){const t=this.attrs.width,i=t!==eh&&t!==void 0,s=this.padding(),u=t-s*2,c=this.ellipsis(),f=this.textArr[this.textArr.length-1];!f||!c||(i&&(this._getTextWidth(f.text+L2)<u||(f.text=f.text.slice(0,f.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(f.text+L2))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,i=this.hasShadow();return t&&i?!0:super._useBufferCanvas()}}an.prototype._fillFunc=WC,an.prototype._strokeFunc=$C,an.prototype.className=qC,an.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],En(an),G.overWriteSetter(an,"width",T2()),G.overWriteSetter(an,"height",T2()),G.addGetterSetter(an,"direction",I5),G.addGetterSetter(an,"fontFamily","Arial"),G.addGetterSetter(an,"fontSize",12,Dt()),G.addGetterSetter(an,"fontStyle",e4),G.addGetterSetter(an,"fontVariant",e4),G.addGetterSetter(an,"padding",0,Dt()),G.addGetterSetter(an,"align",$5),G.addGetterSetter(an,"verticalAlign",XC),G.addGetterSetter(an,"lineHeight",1,Dt()),G.addGetterSetter(an,"wrap",JC),G.addGetterSetter(an,"ellipsis",!1,sl()),G.addGetterSetter(an,"letterSpacing",0,Dt()),G.addGetterSetter(an,"text","",oc()),G.addGetterSetter(an,"textDecoration",""),G.addGetterSetter(an,"charRenderFunc",void 0);const e_="",s4="normal";function l4(n){n.fillText(this.partialText,0,0)}function r4(n){n.strokeText(this.partialText,0,0)}class ca extends Ct{constructor(t){super(t),this.dummyCanvas=k.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return bs.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const i=this.pathLength;return t>i?null:bs.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=bs.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();const i=this.textDecoration(),s=this.fill(),u=this.fontSize(),c=this.glyphInfo,f=i.indexOf("underline")!==-1,p=i.indexOf("line-through")!==-1;f&&t.beginPath();for(let m=0;m<c.length;m++){t.save();const S=c[m].p0;t.translate(S.x,S.y),t.rotate(c[m].rotation),this.partialText=c[m].text,t.fillStrokeShape(this),f&&(m===0&&t.moveTo(0,u/2+1),t.lineTo(c[m].width,u/2+1)),t.restore()}if(f&&(t.strokeStyle=s,t.lineWidth=u/20,t.stroke()),p){t.beginPath();for(let m=0;m<c.length;m++){t.save();const S=c[m].p0;t.translate(S.x,S.y),t.rotate(c[m].rotation),m===0&&t.moveTo(0,0),t.lineTo(c[m].width,0),t.restore()}t.strokeStyle=s,t.lineWidth=u/20,t.stroke()}t.restore()}_hitFunc(t){t.beginPath();const i=this.glyphInfo;if(i.length>=1){const s=i[0].p0;t.moveTo(s.x,s.y)}for(let s=0;s<i.length;s++){const u=i[s].p1;t.lineTo(u.x,u.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return k.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return an.prototype.setText.call(this,t)}_getContextFont(){return an.prototype._getContextFont.call(this)}_getTextSize(t){const s=this.dummyCanvas.getContext("2d");s.save(),s.font=this._getContextFont();const u=s.measureText(t);return s.restore(),{width:u.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const t=qo(this.text()),i=[];let s=0;for(let _=0;_<t.length;_++)i.push({char:t[_],width:this._getTextSize(t[_]).width}),s+=i[_].width;const{height:u}=this._getTextSize(this.attrs.text);if(this.textWidth=s,this.textHeight=u,this.glyphInfo=[],!this.attrs.data)return null;const c=this.letterSpacing(),f=this.align(),p=this.kerningFunc(),m=Math.max(this.textWidth+((this.attrs.text||"").length-1)*c,0);let S=0;f==="center"&&(S=Math.max(0,this.pathLength/2-m/2)),f==="right"&&(S=Math.max(0,this.pathLength-m));let b=S;for(let _=0;_<i.length;_++){const x=this._getPointAtLength(b);if(!x)return;const D=i[_].char;let A=i[_].width+c;if(D===" "&&f==="justify"){const V=this.text().split(" ").length-1;A+=(this.pathLength-m)/V}const N=this._getPointAtLength(b+A);if(!N)return;const R=bs.getLineLength(x.x,x.y,N.x,N.y);let O=0;if(p)try{O=p(i[_-1].char,D)*this.fontSize()}catch{O=0}x.x+=O,N.x+=O,this.textWidth+=O;const U=bs.getPointOnLine(O+R/2,x.x,x.y,N.x,N.y),j=Math.atan2(N.y-x.y,N.x-x.x);this.glyphInfo.push({transposeX:U.x,transposeY:U.y,text:t[_],rotation:j,p0:x,p1:N,width:R}),b+=A}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const t=[];this.glyphInfo.forEach(function(S){t.push(S.p0.x),t.push(S.p0.y),t.push(S.p1.x),t.push(S.p1.y)});let i=t[0]||0,s=t[0]||0,u=t[1]||0,c=t[1]||0,f,p;for(let S=0;S<t.length/2;S++)f=t[S*2],p=t[S*2+1],i=Math.min(i,f),s=Math.max(s,f),u=Math.min(u,p),c=Math.max(c,p);const m=this.fontSize();return{x:i-m/2,y:u-m/2,width:s-i+m,height:c-u+m}}destroy(){return k.releaseCanvas(this.dummyCanvas),super.destroy()}}ca.prototype._fillFunc=l4,ca.prototype._strokeFunc=r4,ca.prototype._fillFuncHit=l4,ca.prototype._strokeFuncHit=r4,ca.prototype.className="TextPath",ca.prototype._attrsAffectingSize=["text","fontSize","data"],En(ca),G.addGetterSetter(ca,"data"),G.addGetterSetter(ca,"fontFamily","Arial"),G.addGetterSetter(ca,"fontSize",12,Dt()),G.addGetterSetter(ca,"fontStyle",s4),G.addGetterSetter(ca,"align","left"),G.addGetterSetter(ca,"letterSpacing",0,Dt()),G.addGetterSetter(ca,"textBaseline","middle"),G.addGetterSetter(ca,"fontVariant",s4),G.addGetterSetter(ca,"text",e_),G.addGetterSetter(ca,"textDecoration",""),G.addGetterSetter(ca,"kerningFunc",void 0);const o4="tr-konva",n_=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(n=>n+`.${o4}`).join(" "),u4="nodesRect",a_=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],i_={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},s_="ontouchstart"in Ot._global;function l_(n,t,i){if(n==="rotater")return i;t+=k.degToRad(i_[n]||0);const s=(k.radToDeg(t)%360+360)%360;return k._inRange(s,315+22.5,360)||k._inRange(s,0,22.5)?"ns-resize":k._inRange(s,45-22.5,45+22.5)?"nesw-resize":k._inRange(s,90-22.5,90+22.5)?"ew-resize":k._inRange(s,135-22.5,135+22.5)?"nwse-resize":k._inRange(s,180-22.5,180+22.5)?"ns-resize":k._inRange(s,225-22.5,225+22.5)?"nesw-resize":k._inRange(s,270-22.5,270+22.5)?"ew-resize":k._inRange(s,315-22.5,315+22.5)?"nwse-resize":(k.error("Transformer has unknown angle for cursor detection: "+s),"pointer")}const B1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function r_(n){return{x:n.x+n.width/2*Math.cos(n.rotation)+n.height/2*Math.sin(-n.rotation),y:n.y+n.height/2*Math.cos(n.rotation)+n.width/2*Math.sin(n.rotation)}}function c4(n,t,i){const s=i.x+(n.x-i.x)*Math.cos(t)-(n.y-i.y)*Math.sin(t),u=i.y+(n.x-i.x)*Math.sin(t)+(n.y-i.y)*Math.cos(t);return{...n,rotation:n.rotation+t,x:s,y:u}}function o_(n,t){const i=r_(n);return c4(n,t,i)}function u_(n,t,i){let s=t;for(let u=0;u<n.length;u++){const c=Ot.getAngle(n[u]),f=Math.abs(c-t)%(Math.PI*2);Math.min(f,Math.PI*2-f)<i&&(s=c)}return s}let Y2=0;class ve extends Wf{constructor(t){super(t),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(n_,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return k.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return o4+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const i=t.filter(u=>u.isAncestorOf(this)?(k.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=t=i,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(u=>{const c=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(u._attrsAffectingSize.length){const f=u._attrsAffectingSize.map(p=>p+"Change."+this._getEventNamespace()).join(" ");u.on(f,c)}u.on(a_.map(f=>f+`.${this._getEventNamespace()}`).join(" "),c),u.on(`absoluteTransformChange.${this._getEventNamespace()}`,c),this._proxyDrag(u)}),this._resetTransformCache(),this.findOne(".top-left")&&this.update(),this}_proxyDrag(t){let i;t.on(`dragstart.${this._getEventNamespace()}`,s=>{i=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(s,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,s=>{if(!i)return;const u=t.getAbsolutePosition(),c=u.x-i.x,f=u.y-i.y;this.nodes().forEach(p=>{if(p===t||p.isDragging())return;const m=p.getAbsolutePosition();p.setAbsolutePosition({x:m.x+c,y:m.y+f}),p.startDrag(s)}),i=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(u4),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(u4,this.__getNodeRect)}__getNodeShape(t,i=this.rotation(),s){const u=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),c=t.getAbsoluteScale(s),f=t.getAbsolutePosition(s),p=u.x*c.x-t.offsetX()*c.x,m=u.y*c.y-t.offsetY()*c.y,S=(Ot.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),b={x:f.x+p*Math.cos(S)+m*Math.sin(-S),y:f.y+m*Math.cos(S)+p*Math.sin(S),width:u.width*c.x,height:u.height*c.y,rotation:S};return c4(b,-Ot.getAngle(i),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const i=[];this.nodes().map(S=>{const b=S.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),_=[{x:b.x,y:b.y},{x:b.x+b.width,y:b.y},{x:b.x+b.width,y:b.y+b.height},{x:b.x,y:b.y+b.height}],x=S.getAbsoluteTransform();_.forEach(function(D){const A=x.point(D);i.push(A)})});const s=new Qi;s.rotate(-Ot.getAngle(this.rotation()));let u=1/0,c=1/0,f=-1/0,p=-1/0;i.forEach(function(S){const b=s.point(S);u===void 0&&(u=f=b.x,c=p=b.y),u=Math.min(u,b.x),c=Math.min(c,b.y),f=Math.max(f,b.x),p=Math.max(p,b.y)}),s.invert();const m=s.point({x:u,y:c});return{x:m.x,y:m.y,width:f-u,height:p-c,rotation:Ot.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),B1.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){const i=new Zp({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:s_?10:"auto"}),s=this;i.on("mousedown touchstart",function(u){s._handleMouseDown(u)}),i.on("dragstart",u=>{i.stopDrag(),u.cancelBubble=!0}),i.on("dragend",u=>{u.cancelBubble=!0}),i.on("mouseenter",()=>{const u=Ot.getAngle(this.rotation()),c=this.rotateAnchorCursor(),f=l_(t,u,c);i.getStage().content&&(i.getStage().content.style.cursor=f),this._cursorChange=!0}),i.on("mouseout",()=>{i.getStage().content&&(i.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(i)}_createBack(){const t=new Ct({name:"back",width:0,height:0,sceneFunc(i,s){const u=s.getParent(),c=u.padding();i.beginPath(),i.rect(-c,-c,s.width()+c*2,s.height()+c*2),i.moveTo(s.width()/2,-c),u.rotateEnabled()&&u.rotateLineVisible()&&i.lineTo(s.width()/2,-u.rotateAnchorOffset()*k._sign(s.height())-c),i.fillStrokeShape(s)},hitFunc:(i,s)=>{if(!this.shouldOverdrawWholeArea())return;const u=this.padding();i.beginPath(),i.rect(-u,-u,s.width()+u*2,s.height()+u*2),i.fillStrokeShape(s)}});this.add(t),this._proxyDrag(t),t.on("dragstart",i=>{i.cancelBubble=!0}),t.on("dragmove",i=>{i.cancelBubble=!0}),t.on("dragend",i=>{i.cancelBubble=!0}),this.on("dragmove",i=>{this.update()})}_handleMouseDown(t){if(this._transforming)return;this._movingAnchorName=t.target.name().split(" ")[0];const i=this._getNodeRect(),s=i.width,u=i.height,c=Math.sqrt(Math.pow(s,2)+Math.pow(u,2));this.sin=Math.abs(u/c),this.cos=Math.abs(s/c),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const f=t.target.getAbsolutePosition(),p=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:p.x-f.x,y:p.y-f.y},Y2++,this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(m=>{m._fire("transformstart",{evt:t.evt,target:m})})}_handleMouseMove(t){let i,s,u;const c=this.findOne("."+this._movingAnchorName),f=c.getStage();f.setPointersPositions(t);const p=f.getPointerPosition();let m={x:p.x-this._anchorDragOffset.x,y:p.y-this._anchorDragOffset.y};const S=c.getAbsolutePosition();this.anchorDragBoundFunc()&&(m=this.anchorDragBoundFunc()(S,m,t)),c.setAbsolutePosition(m);const b=c.getAbsolutePosition();if(S.x===b.x&&S.y===b.y)return;if(this._movingAnchorName==="rotater"){const U=this._getNodeRect();i=c.x()-U.width/2,s=-c.y()+U.height/2;let j=Math.atan2(-s,i)+Math.PI/2;U.height<0&&(j-=Math.PI);const J=Ot.getAngle(this.rotation())+j,W=Ot.getAngle(this.rotationSnapTolerance()),I=u_(this.rotationSnaps(),J,W)-U.rotation,et=o_(U,I);this._fitNodesInto(et,t);return}const _=this.shiftBehavior();let x;_==="inverted"?x=this.keepRatio()&&!t.shiftKey:_==="none"?x=this.keepRatio():x=this.keepRatio()||t.shiftKey;let D=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(x){const U=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};u=Math.sqrt(Math.pow(U.x-c.x(),2)+Math.pow(U.y-c.y(),2));const j=this.findOne(".top-left").x()>U.x?-1:1,V=this.findOne(".top-left").y()>U.y?-1:1;i=u*this.cos*j,s=u*this.sin*V,this.findOne(".top-left").x(U.x-i),this.findOne(".top-left").y(U.y-s)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(c.y());else if(this._movingAnchorName==="top-right"){if(x){const U=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};u=Math.sqrt(Math.pow(c.x()-U.x,2)+Math.pow(U.y-c.y(),2));const j=this.findOne(".top-right").x()<U.x?-1:1,V=this.findOne(".top-right").y()>U.y?-1:1;i=u*this.cos*j,s=u*this.sin*V,this.findOne(".top-right").x(U.x+i),this.findOne(".top-right").y(U.y-s)}var A=c.position();this.findOne(".top-left").y(A.y),this.findOne(".bottom-right").x(A.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(c.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(c.x());else if(this._movingAnchorName==="bottom-left"){if(x){const U=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};u=Math.sqrt(Math.pow(U.x-c.x(),2)+Math.pow(c.y()-U.y,2));const j=U.x<c.x()?-1:1,V=c.y()<U.y?-1:1;i=u*this.cos*j,s=u*this.sin*V,c.x(U.x-i),c.y(U.y+s)}A=c.position(),this.findOne(".top-left").x(A.x),this.findOne(".bottom-right").y(A.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(c.y());else if(this._movingAnchorName==="bottom-right"){if(x){const U=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};u=Math.sqrt(Math.pow(c.x()-U.x,2)+Math.pow(c.y()-U.y,2));const j=this.findOne(".bottom-right").x()<U.x?-1:1,V=this.findOne(".bottom-right").y()<U.y?-1:1;i=u*this.cos*j,s=u*this.sin*V,this.findOne(".bottom-right").x(U.x+i),this.findOne(".bottom-right").y(U.y+s)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(D=this.centeredScaling()||t.altKey,D){const U=this.findOne(".top-left"),j=this.findOne(".bottom-right"),V=U.x(),J=U.y(),W=this.getWidth()-j.x(),st=this.getHeight()-j.y();j.move({x:-V,y:-J}),U.move({x:W,y:st})}const N=this.findOne(".top-left").getAbsolutePosition();i=N.x,s=N.y;const R=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),O=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:i,y:s,width:R,height:O,rotation:Ot.getAngle(this.rotation())},t)}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){var i;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const s=this.getNode();Y2--,this._fire("transformend",{evt:t,target:s}),(i=this.getLayer())===null||i===void 0||i.batchDraw(),s&&this._nodes.forEach(u=>{var c;u._fire("transformend",{evt:t,target:u}),(c=u.getLayer())===null||c===void 0||c.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(t,i){const s=this._getNodeRect(),u=1;if(k._inRange(t.width,-this.padding()*2-u,u)){this.update();return}if(k._inRange(t.height,-this.padding()*2-u,u)){this.update();return}const c=new Qi;if(c.rotate(Ot.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const x=c.point({x:-this.padding()*2,y:0});t.x+=x.x,t.y+=x.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=x.x,this._anchorDragOffset.y-=x.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const x=c.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=x.x,this._anchorDragOffset.y-=x.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const x=c.point({x:0,y:-this.padding()*2});t.x+=x.x,t.y+=x.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=x.x,this._anchorDragOffset.y-=x.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const x=c.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=x.x,this._anchorDragOffset.y-=x.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const x=this.boundBoxFunc()(s,t);x?t=x:k.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const f=1e7,p=new Qi;p.translate(s.x,s.y),p.rotate(s.rotation),p.scale(s.width/f,s.height/f);const m=new Qi,S=t.width/f,b=t.height/f;this.flipEnabled()===!1?(m.translate(t.x,t.y),m.rotate(t.rotation),m.translate(t.width<0?t.width:0,t.height<0?t.height:0),m.scale(Math.abs(S),Math.abs(b))):(m.translate(t.x,t.y),m.rotate(t.rotation),m.scale(S,b));const _=m.multiply(p.invert());this._nodes.forEach(x=>{var D;if(!x.getStage())return;const A=x.getParent().getAbsoluteTransform(),N=x.getTransform().copy();N.translate(x.offsetX(),x.offsetY());const R=new Qi;R.multiply(A.copy().invert()).multiply(_).multiply(A).multiply(N);const O=R.decompose();x.setAttrs(O),(D=x.getLayer())===null||D===void 0||D.batchDraw()}),this.rotation(k._getRotation(t.rotation)),this._nodes.forEach(x=>{this._fire("transform",{evt:i,target:x}),x._fire("transform",{evt:i,target:x})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,i){this.findOne(t).setAttrs(i)}update(){var t;const i=this._getNodeRect();this.rotation(k._getRotation(i.rotation));const s=i.width,u=i.height,c=this.enabledAnchors(),f=this.resizeEnabled(),p=this.padding(),m=this.anchorSize(),S=this.find("._anchor");S.forEach(_=>{_.setAttrs({width:m,height:m,offsetX:m/2,offsetY:m/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:m/2+p,offsetY:m/2+p,visible:f&&c.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:s/2,y:0,offsetY:m/2+p,visible:f&&c.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:s,y:0,offsetX:m/2-p,offsetY:m/2+p,visible:f&&c.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:u/2,offsetX:m/2+p,visible:f&&c.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:s,y:u/2,offsetX:m/2-p,visible:f&&c.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:u,offsetX:m/2+p,offsetY:m/2-p,visible:f&&c.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:s/2,y:u,offsetY:m/2-p,visible:f&&c.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:s,y:u,offsetX:m/2-p,offsetY:m/2-p,visible:f&&c.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:s/2,y:-this.rotateAnchorOffset()*k._sign(u)-p,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:s,height:u,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(_=>_.draggable()),x:0,y:0});const b=this.anchorStyleFunc();b&&S.forEach(_=>{b(_)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Wf.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Nt.prototype.toObject.call(this)}clone(t){return Nt.prototype.clone.call(this,t)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}ve.isTransforming=()=>Y2>0;function c_(n){return n instanceof Array||k.warn("enabledAnchors value should be an array"),n instanceof Array&&n.forEach(function(t){B1.indexOf(t)===-1&&k.warn("Unknown anchor name: "+t+". Available names are: "+B1.join(", "))}),n||[]}ve.prototype.className="Transformer",En(ve),G.addGetterSetter(ve,"enabledAnchors",B1,c_),G.addGetterSetter(ve,"flipEnabled",!0,sl()),G.addGetterSetter(ve,"resizeEnabled",!0),G.addGetterSetter(ve,"anchorSize",10,Dt()),G.addGetterSetter(ve,"rotateEnabled",!0),G.addGetterSetter(ve,"rotateLineVisible",!0),G.addGetterSetter(ve,"rotationSnaps",[]),G.addGetterSetter(ve,"rotateAnchorOffset",50,Dt()),G.addGetterSetter(ve,"rotateAnchorCursor","crosshair"),G.addGetterSetter(ve,"rotationSnapTolerance",5,Dt()),G.addGetterSetter(ve,"borderEnabled",!0),G.addGetterSetter(ve,"anchorStroke","rgb(0, 161, 255)"),G.addGetterSetter(ve,"anchorStrokeWidth",1,Dt()),G.addGetterSetter(ve,"anchorFill","white"),G.addGetterSetter(ve,"anchorCornerRadius",0,Dt()),G.addGetterSetter(ve,"borderStroke","rgb(0, 161, 255)"),G.addGetterSetter(ve,"borderStrokeWidth",1,Dt()),G.addGetterSetter(ve,"borderDash"),G.addGetterSetter(ve,"keepRatio",!0),G.addGetterSetter(ve,"shiftBehavior","default"),G.addGetterSetter(ve,"centeredScaling",!1),G.addGetterSetter(ve,"ignoreStroke",!1),G.addGetterSetter(ve,"padding",0,Dt()),G.addGetterSetter(ve,"nodes"),G.addGetterSetter(ve,"node"),G.addGetterSetter(ve,"boundBoxFunc"),G.addGetterSetter(ve,"anchorDragBoundFunc"),G.addGetterSetter(ve,"anchorStyleFunc"),G.addGetterSetter(ve,"shouldOverdrawWholeArea",!1),G.addGetterSetter(ve,"useSingleNodeRotation",!0),G.backCompat(ve,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Rr extends Ct{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,Ot.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Rr.prototype.className="Wedge",Rr.prototype._centroid=!0,Rr.prototype._attrsAffectingSize=["radius"],En(Rr),G.addGetterSetter(Rr,"radius",0,Dt()),G.addGetterSetter(Rr,"angle",0,Dt()),G.addGetterSetter(Rr,"clockwise",!1),G.backCompat(Rr,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function f4(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const f_=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],h_=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function d_(n,t){const i=n.data,s=n.width,u=n.height;let c,f,p,m,S,b,_,x,D,A,N,R,O,U,j,V,J,W,st,I;const et=t+t+1,nt=s-1,bt=u-1,rt=t+1,dt=rt*(rt+1)/2,pt=new f4,tt=f_[t],w=h_[t];let F=null,K=pt,at=null,St=null;for(let $=1;$<et;$++)K=K.next=new f4,$===rt&&(F=K);K.next=pt,p=f=0;for(let $=0;$<u;$++){R=O=U=j=m=S=b=_=0,x=rt*(V=i[f]),D=rt*(J=i[f+1]),A=rt*(W=i[f+2]),N=rt*(st=i[f+3]),m+=dt*V,S+=dt*J,b+=dt*W,_+=dt*st,K=pt;for(let gt=0;gt<rt;gt++)K.r=V,K.g=J,K.b=W,K.a=st,K=K.next;for(let gt=1;gt<rt;gt++)c=f+((nt<gt?nt:gt)<<2),m+=(K.r=V=i[c])*(I=rt-gt),S+=(K.g=J=i[c+1])*I,b+=(K.b=W=i[c+2])*I,_+=(K.a=st=i[c+3])*I,R+=V,O+=J,U+=W,j+=st,K=K.next;at=pt,St=F;for(let gt=0;gt<s;gt++)i[f+3]=st=_*tt>>w,st!==0?(st=255/st,i[f]=(m*tt>>w)*st,i[f+1]=(S*tt>>w)*st,i[f+2]=(b*tt>>w)*st):i[f]=i[f+1]=i[f+2]=0,m-=x,S-=D,b-=A,_-=N,x-=at.r,D-=at.g,A-=at.b,N-=at.a,c=p+((c=gt+t+1)<nt?c:nt)<<2,R+=at.r=i[c],O+=at.g=i[c+1],U+=at.b=i[c+2],j+=at.a=i[c+3],m+=R,S+=O,b+=U,_+=j,at=at.next,x+=V=St.r,D+=J=St.g,A+=W=St.b,N+=st=St.a,R-=V,O-=J,U-=W,j-=st,St=St.next,f+=4;p+=s}for(let $=0;$<s;$++){O=U=j=R=S=b=_=m=0,f=$<<2,x=rt*(V=i[f]),D=rt*(J=i[f+1]),A=rt*(W=i[f+2]),N=rt*(st=i[f+3]),m+=dt*V,S+=dt*J,b+=dt*W,_+=dt*st,K=pt;for(let Tt=0;Tt<rt;Tt++)K.r=V,K.g=J,K.b=W,K.a=st,K=K.next;let gt=s;for(let Tt=1;Tt<=t;Tt++)f=gt+$<<2,m+=(K.r=V=i[f])*(I=rt-Tt),S+=(K.g=J=i[f+1])*I,b+=(K.b=W=i[f+2])*I,_+=(K.a=st=i[f+3])*I,R+=V,O+=J,U+=W,j+=st,K=K.next,Tt<bt&&(gt+=s);f=$,at=pt,St=F;for(let Tt=0;Tt<u;Tt++)c=f<<2,i[c+3]=st=_*tt>>w,st>0?(st=255/st,i[c]=(m*tt>>w)*st,i[c+1]=(S*tt>>w)*st,i[c+2]=(b*tt>>w)*st):i[c]=i[c+1]=i[c+2]=0,m-=x,S-=D,b-=A,_-=N,x-=at.r,D-=at.g,A-=at.b,N-=at.a,c=$+((c=Tt+rt)<bt?c:bt)*s<<2,m+=R+=at.r=i[c],S+=O+=at.g=i[c+1],b+=U+=at.b=i[c+2],_+=j+=at.a=i[c+3],at=at.next,x+=V=St.r,D+=J=St.g,A+=W=St.b,N+=st=St.a,R-=V,O-=J,U-=W,j-=st,St=St.next,f+=s}}const p_=function(t){const i=Math.round(this.blurRadius());i>0&&d_(t,i)};G.addGetterSetter(Nt,"blurRadius",0,Dt(),G.afterSetFilter);const m_=function(n){const t=this.brightness()*255,i=n.data,s=i.length;for(let u=0;u<s;u+=4)i[u]+=t,i[u+1]+=t,i[u+2]+=t};G.addGetterSetter(Nt,"brightness",0,Dt(),G.afterSetFilter);const g_=function(n){const t=this.brightness(),i=n.data,s=i.length;for(let u=0;u<s;u+=4)i[u]=Math.min(255,i[u]*t),i[u+1]=Math.min(255,i[u+1]*t),i[u+2]=Math.min(255,i[u+2]*t)},y_=function(n){const t=Math.pow((this.contrast()+100)/100,2),i=n.data,s=i.length;let u=150,c=150,f=150;for(let p=0;p<s;p+=4)u=i[p],c=i[p+1],f=i[p+2],u/=255,u-=.5,u*=t,u+=.5,u*=255,c/=255,c-=.5,c*=t,c+=.5,c*=255,f/=255,f-=.5,f*=t,f+=.5,f*=255,u=u<0?0:u>255?255:u,c=c<0?0:c>255?255:c,f=f<0?0:f>255?255:f,i[p]=u,i[p+1]=c,i[p+2]=f};G.addGetterSetter(Nt,"contrast",0,Dt(),G.afterSetFilter);const v_=function(n){var t,i,s,u,c,f,p,m,S;const b=n.data,_=n.width,x=n.height,D=Math.min(1,Math.max(0,(i=(t=this.embossStrength)===null||t===void 0?void 0:t.call(this))!==null&&i!==void 0?i:.5)),A=Math.min(1,Math.max(0,(u=(s=this.embossWhiteLevel)===null||s===void 0?void 0:s.call(this))!==null&&u!==void 0?u:.5)),R=(p={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(f=(c=this.embossDirection)===null||c===void 0?void 0:c.call(this))!==null&&f!==void 0?f:"top-left"])!==null&&p!==void 0?p:315,O=!!((S=(m=this.embossBlend)===null||m===void 0?void 0:m.call(this))!==null&&S!==void 0&&S),U=D*10,j=A*255,V=R*Math.PI/180,J=Math.cos(V),W=Math.sin(V),st=128/1020*U,I=new Uint8ClampedArray(b),et=new Float32Array(_*x);for(let pt=0,tt=0;tt<b.length;tt+=4,pt++)et[pt]=.2126*I[tt]+.7152*I[tt+1]+.0722*I[tt+2];const nt=[-1,0,1,-2,0,2,-1,0,1],bt=[-1,-2,-1,0,0,0,1,2,1],rt=[-_-1,-_,-_+1,-1,0,1,_-1,_,_+1],dt=pt=>pt<0?0:pt>255?255:pt;for(let pt=1;pt<x-1;pt++)for(let tt=1;tt<_-1;tt++){const w=pt*_+tt;let F=0,K=0;F+=et[w+rt[0]]*nt[0],K+=et[w+rt[0]]*bt[0],F+=et[w+rt[1]]*nt[1],K+=et[w+rt[1]]*bt[1],F+=et[w+rt[2]]*nt[2],K+=et[w+rt[2]]*bt[2],F+=et[w+rt[3]]*nt[3],K+=et[w+rt[3]]*bt[3],F+=et[w+rt[5]]*nt[5],K+=et[w+rt[5]]*bt[5],F+=et[w+rt[6]]*nt[6],K+=et[w+rt[6]]*bt[6],F+=et[w+rt[7]]*nt[7],K+=et[w+rt[7]]*bt[7],F+=et[w+rt[8]]*nt[8],K+=et[w+rt[8]]*bt[8];const at=J*F+W*K,St=dt(j+at*st),$=w*4;if(O){const gt=St-j;b[$]=dt(I[$]+gt),b[$+1]=dt(I[$+1]+gt),b[$+2]=dt(I[$+2]+gt),b[$+3]=I[$+3]}else b[$]=b[$+1]=b[$+2]=St,b[$+3]=I[$+3]}for(let pt=0;pt<_;pt++){let tt=pt*4,w=((x-1)*_+pt)*4;b[tt]=I[tt],b[tt+1]=I[tt+1],b[tt+2]=I[tt+2],b[tt+3]=I[tt+3],b[w]=I[w],b[w+1]=I[w+1],b[w+2]=I[w+2],b[w+3]=I[w+3]}for(let pt=1;pt<x-1;pt++){let tt=pt*_*4,w=(pt*_+(_-1))*4;b[tt]=I[tt],b[tt+1]=I[tt+1],b[tt+2]=I[tt+2],b[tt+3]=I[tt+3],b[w]=I[w],b[w+1]=I[w+1],b[w+2]=I[w+2],b[w+3]=I[w+3]}return n};G.addGetterSetter(Nt,"embossStrength",.5,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"embossWhiteLevel",.5,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"embossDirection","top-left",void 0,G.afterSetFilter),G.addGetterSetter(Nt,"embossBlend",!1,void 0,G.afterSetFilter);function q2(n,t,i,s,u){const c=i-t,f=u-s;if(c===0)return s+f/2;if(f===0)return s;let p=(n-t)/c;return p=f*p+s,p}const S_=function(n){const t=n.data,i=t.length;let s=t[0],u=s,c,f=t[1],p=f,m,S=t[2],b=S,_;const x=this.enhance();if(x===0)return;for(let j=0;j<i;j+=4)c=t[j+0],c<s?s=c:c>u&&(u=c),m=t[j+1],m<f?f=m:m>p&&(p=m),_=t[j+2],_<S?S=_:_>b&&(b=_);u===s&&(u=255,s=0),p===f&&(p=255,f=0),b===S&&(b=255,S=0);let D,A,N,R,O,U;if(x>0)D=u+x*(255-u),A=s-x*(s-0),N=p+x*(255-p),R=f-x*(f-0),O=b+x*(255-b),U=S-x*(S-0);else{const j=(u+s)*.5;D=u+x*(u-j),A=s+x*(s-j);const V=(p+f)*.5;N=p+x*(p-V),R=f+x*(f-V);const J=(b+S)*.5;O=b+x*(b-J),U=S+x*(S-J)}for(let j=0;j<i;j+=4)t[j+0]=q2(t[j+0],s,u,A,D),t[j+1]=q2(t[j+1],f,p,R,N),t[j+2]=q2(t[j+2],S,b,U,O)};G.addGetterSetter(Nt,"enhance",0,Dt(),G.afterSetFilter);const b_=function(n){const t=n.data,i=t.length;for(let s=0;s<i;s+=4){const u=.34*t[s]+.5*t[s+1]+.16*t[s+2];t[s]=u,t[s+1]=u,t[s+2]=u}};G.addGetterSetter(Nt,"hue",0,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"saturation",0,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"luminance",0,Dt(),G.afterSetFilter);const E_=function(n){const t=n.data,i=t.length,s=1,u=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,f=this.luminance()*127,p=s*u*Math.cos(c*Math.PI/180),m=s*u*Math.sin(c*Math.PI/180),S=.299*s+.701*p+.167*m,b=.587*s-.587*p+.33*m,_=.114*s-.114*p-.497*m,x=.299*s-.299*p-.328*m,D=.587*s+.413*p+.035*m,A=.114*s-.114*p+.293*m,N=.299*s-.3*p+1.25*m,R=.587*s-.586*p-1.05*m,O=.114*s+.886*p-.2*m;let U,j,V,J;for(let W=0;W<i;W+=4)U=t[W+0],j=t[W+1],V=t[W+2],J=t[W+3],t[W+0]=S*U+b*j+_*V+f,t[W+1]=x*U+D*j+A*V+f,t[W+2]=N*U+R*j+O*V+f,t[W+3]=J},T_=function(n){const t=n.data,i=t.length,s=Math.pow(2,this.value()),u=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,f=s*u*Math.cos(c*Math.PI/180),p=s*u*Math.sin(c*Math.PI/180),m=.299*s+.701*f+.167*p,S=.587*s-.587*f+.33*p,b=.114*s-.114*f-.497*p,_=.299*s-.299*f-.328*p,x=.587*s+.413*f+.035*p,D=.114*s-.114*f+.293*p,A=.299*s-.3*f+1.25*p,N=.587*s-.586*f-1.05*p,R=.114*s+.886*f-.2*p;for(let O=0;O<i;O+=4){const U=t[O+0],j=t[O+1],V=t[O+2],J=t[O+3];t[O+0]=m*U+S*j+b*V,t[O+1]=_*U+x*j+D*V,t[O+2]=A*U+N*j+R*V,t[O+3]=J}};G.addGetterSetter(Nt,"hue",0,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"saturation",0,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"value",0,Dt(),G.afterSetFilter);const C_=function(n){const t=n.data,i=t.length;for(let s=0;s<i;s+=4)t[s]=255-t[s],t[s+1]=255-t[s+1],t[s+2]=255-t[s+2]},__=function(n,t,i){const s=n.data,u=t.data,c=n.width,f=n.height,p=i.polarCenterX||c/2,m=i.polarCenterY||f/2;let S=Math.sqrt(p*p+m*m),b=c-p,_=f-m;const x=Math.sqrt(b*b+_*_);S=x>S?x:S;const D=f,A=c,N=360/A*Math.PI/180;for(let R=0;R<A;R+=1){const O=Math.sin(R*N),U=Math.cos(R*N);for(let j=0;j<D;j+=1){b=Math.floor(p+S*j/D*U),_=Math.floor(m+S*j/D*O);let V=(_*c+b)*4;const J=s[V+0],W=s[V+1],st=s[V+2],I=s[V+3];V=(R+j*c)*4,u[V+0]=J,u[V+1]=W,u[V+2]=st,u[V+3]=I}}},x_=function(n,t,i){const s=n.data,u=t.data,c=n.width,f=n.height,p=i.polarCenterX||c/2,m=i.polarCenterY||f/2;let S=Math.sqrt(p*p+m*m),b=c-p,_=f-m;const x=Math.sqrt(b*b+_*_);S=x>S?x:S;const D=f,A=c,N=0;let R,O;for(b=0;b<c;b+=1)for(_=0;_<f;_+=1){const U=b-p,j=_-m,V=Math.sqrt(U*U+j*j)*D/S;let J=(Math.atan2(j,U)*180/Math.PI+360+N)%360;J=J*A/360,R=Math.floor(J),O=Math.floor(V);let W=(O*c+R)*4;const st=s[W+0],I=s[W+1],et=s[W+2],nt=s[W+3];W=(_*c+b)*4,u[W+0]=st,u[W+1]=I,u[W+2]=et,u[W+3]=nt}},D_=function(n){const t=n.width,i=n.height;let s,u,c,f,p,m,S,b,_,x,D=Math.round(this.kaleidoscopePower());const A=Math.round(this.kaleidoscopeAngle()),N=Math.floor(t*(A%360)/360);if(D<1)return;const R=k.createCanvasElement();R.width=t,R.height=i;const O=R.getContext("2d").getImageData(0,0,t,i);k.releaseCanvas(R),__(n,O,{polarCenterX:t/2,polarCenterY:i/2});let U=t/Math.pow(2,D);for(;U<=8;)U=U*2,D-=1;U=Math.ceil(U);let j=U,V=0,J=j,W=1;for(N+U>t&&(V=j,J=0,W=-1),u=0;u<i;u+=1)for(s=V;s!==J;s+=W)c=Math.round(s+N)%t,_=(t*u+c)*4,p=O.data[_+0],m=O.data[_+1],S=O.data[_+2],b=O.data[_+3],x=(t*u+s)*4,O.data[x+0]=p,O.data[x+1]=m,O.data[x+2]=S,O.data[x+3]=b;for(u=0;u<i;u+=1)for(j=Math.floor(U),f=0;f<D;f+=1){for(s=0;s<j+1;s+=1)_=(t*u+s)*4,p=O.data[_+0],m=O.data[_+1],S=O.data[_+2],b=O.data[_+3],x=(t*u+j*2-s-1)*4,O.data[x+0]=p,O.data[x+1]=m,O.data[x+2]=S,O.data[x+3]=b;j*=2}x_(O,n,{})};G.addGetterSetter(Nt,"kaleidoscopePower",2,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"kaleidoscopeAngle",0,Dt(),G.afterSetFilter);function V1(n,t,i){let s=(i*n.width+t)*4;const u=[];return u.push(n.data[s++],n.data[s++],n.data[s++],n.data[s++]),u}function Fp(n,t){return Math.sqrt(Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2)+Math.pow(n[2]-t[2],2))}function A_(n){const t=[0,0,0];for(let i=0;i<n.length;i++)t[0]+=n[i][0],t[1]+=n[i][1],t[2]+=n[i][2];return t[0]/=n.length,t[1]/=n.length,t[2]/=n.length,t}function M_(n,t){const i=V1(n,0,0),s=V1(n,n.width-1,0),u=V1(n,0,n.height-1),c=V1(n,n.width-1,n.height-1),f=t||10;if(Fp(i,s)<f&&Fp(s,c)<f&&Fp(c,u)<f&&Fp(u,i)<f){const p=A_([s,i,c,u]),m=[];for(let S=0;S<n.width*n.height;S++){const b=Fp(p,[n.data[S*4],n.data[S*4+1],n.data[S*4+2]]);m[S]=b<f?0:255}return m}}function N_(n,t){for(let i=0;i<n.width*n.height;i++)n.data[4*i+3]=t[i]}function O_(n,t,i){const s=[1,1,1,1,0,1,1,1,1],u=Math.round(Math.sqrt(s.length)),c=Math.floor(u/2),f=[];for(let p=0;p<i;p++)for(let m=0;m<t;m++){const S=p*t+m;let b=0;for(let _=0;_<u;_++)for(let x=0;x<u;x++){const D=p+_-c,A=m+x-c;if(D>=0&&D<i&&A>=0&&A<t){const N=D*t+A,R=s[_*u+x];b+=n[N]*R}}f[S]=b===2040?255:0}return f}function R_(n,t,i){const s=[1,1,1,1,1,1,1,1,1],u=Math.round(Math.sqrt(s.length)),c=Math.floor(u/2),f=[];for(let p=0;p<i;p++)for(let m=0;m<t;m++){const S=p*t+m;let b=0;for(let _=0;_<u;_++)for(let x=0;x<u;x++){const D=p+_-c,A=m+x-c;if(D>=0&&D<i&&A>=0&&A<t){const N=D*t+A,R=s[_*u+x];b+=n[N]*R}}f[S]=b>=1020?255:0}return f}function z_(n,t,i){const s=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],u=Math.round(Math.sqrt(s.length)),c=Math.floor(u/2),f=[];for(let p=0;p<i;p++)for(let m=0;m<t;m++){const S=p*t+m;let b=0;for(let _=0;_<u;_++)for(let x=0;x<u;x++){const D=p+_-c,A=m+x-c;if(D>=0&&D<i&&A>=0&&A<t){const N=D*t+A,R=s[_*u+x];b+=n[N]*R}}f[S]=b}return f}const H_=function(n){const t=this.threshold();let i=M_(n,t);return i&&(i=O_(i,n.width,n.height),i=R_(i,n.width,n.height),i=z_(i,n.width,n.height),N_(n,i)),n};G.addGetterSetter(Nt,"threshold",0,Dt(),G.afterSetFilter);const w_=function(n){const t=this.noise()*255,i=n.data,s=i.length,u=t/2;for(let c=0;c<s;c+=4)i[c+0]+=u-2*u*Math.random(),i[c+1]+=u-2*u*Math.random(),i[c+2]+=u-2*u*Math.random()};G.addGetterSetter(Nt,"noise",.2,Dt(),G.afterSetFilter);const U_=function(n){let t=Math.ceil(this.pixelSize()),i=n.width,s=n.height,u=Math.ceil(i/t),c=Math.ceil(s/t),f=n.data;if(t<=0){k.error("pixelSize value can not be <= 0");return}for(let p=0;p<u;p+=1)for(let m=0;m<c;m+=1){let S=0,b=0,_=0,x=0;const D=p*t,A=D+t,N=m*t,R=N+t;let O=0;for(let U=D;U<A;U+=1)if(!(U>=i))for(let j=N;j<R;j+=1){if(j>=s)continue;const V=(i*j+U)*4;S+=f[V+0],b+=f[V+1],_+=f[V+2],x+=f[V+3],O+=1}S=S/O,b=b/O,_=_/O,x=x/O;for(let U=D;U<A;U+=1)if(!(U>=i))for(let j=N;j<R;j+=1){if(j>=s)continue;const V=(i*j+U)*4;f[V+0]=S,f[V+1]=b,f[V+2]=_,f[V+3]=x}}};G.addGetterSetter(Nt,"pixelSize",8,Dt(),G.afterSetFilter);const B_=function(n){const t=Math.round(this.levels()*254)+1,i=n.data,s=i.length,u=255/t;for(let c=0;c<s;c+=1)i[c]=Math.floor(i[c]/u)*u};G.addGetterSetter(Nt,"levels",.5,Dt(),G.afterSetFilter);const V_=function(n){const t=n.data,i=t.length,s=this.red(),u=this.green(),c=this.blue();for(let f=0;f<i;f+=4){const p=(.34*t[f]+.5*t[f+1]+.16*t[f+2])/255;t[f]=p*s,t[f+1]=p*u,t[f+2]=p*c,t[f+3]=t[f+3]}};G.addGetterSetter(Nt,"red",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),G.addGetterSetter(Nt,"green",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),G.addGetterSetter(Nt,"blue",0,m5,G.afterSetFilter);const G_=function(n){const t=n.data,i=t.length,s=this.red(),u=this.green(),c=this.blue(),f=this.alpha();for(let p=0;p<i;p+=4){const m=1-f;t[p]=s*f+t[p]*m,t[p+1]=u*f+t[p+1]*m,t[p+2]=c*f+t[p+2]*m}};G.addGetterSetter(Nt,"red",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),G.addGetterSetter(Nt,"green",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),G.addGetterSetter(Nt,"blue",0,m5,G.afterSetFilter),G.addGetterSetter(Nt,"alpha",1,function(n){return this._filterUpToDate=!1,n>1?1:n<0?0:n});const j_=function(n){const t=n.data,i=t.length;for(let s=0;s<i;s+=4){const u=t[s+0],c=t[s+1],f=t[s+2];t[s+0]=Math.min(255,u*.393+c*.769+f*.189),t[s+1]=Math.min(255,u*.349+c*.686+f*.168),t[s+2]=Math.min(255,u*.272+c*.534+f*.131)}},L_=function(n){const i=n.data;for(let s=0;s<i.length;s+=4){const u=i[s],c=i[s+1],f=i[s+2];.2126*u+.7152*c+.0722*f>=128&&(i[s]=255-u,i[s+1]=255-c,i[s+2]=255-f)}return n},P_=function(n){const t=this.threshold()*255,i=n.data,s=i.length;for(let u=0;u<s;u+=1)i[u]=i[u]<t?0:255};G.addGetterSetter(Nt,"threshold",.5,Dt(),G.afterSetFilter),$f.Util._assign($f,{Arc:Nr,Arrow:fc,Circle:th,Ellipse:Lo,Image:ll,Label:j2,Tag:hc,Line:Or,Path:bs,Rect:Zp,RegularPolygon:Po,Ring:dc,Sprite:Kl,Star:Yo,Text:an,TextPath:ca,Transformer:ve,Wedge:Rr,Filters:{Blur:p_,Brightness:g_,Brighten:m_,Contrast:y_,Emboss:v_,Enhance:S_,Grayscale:b_,HSL:E_,HSV:T_,Invert:C_,Kaleidoscope:D_,Mask:H_,Noise:w_,Pixelate:U_,Posterize:B_,RGB:V_,RGBA:G_,Sepia:j_,Solarize:L_,Threshold:P_}});function X2(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var G1={exports:{}},K2={exports:{}},j1={exports:{}},Q2={};var h4;function Y_(){return h4||(h4=1,(function(n){function t(w,F){var K=w.length;w.push(F);t:for(;0<K;){var at=K-1>>>1,St=w[at];if(0<u(St,F))w[at]=F,w[K]=St,K=at;else break t}}function i(w){return w.length===0?null:w[0]}function s(w){if(w.length===0)return null;var F=w[0],K=w.pop();if(K!==F){w[0]=K;t:for(var at=0,St=w.length,$=St>>>1;at<$;){var gt=2*(at+1)-1,Tt=w[gt],Pt=gt+1,le=w[Pt];if(0>u(Tt,K))Pt<St&&0>u(le,Tt)?(w[at]=le,w[Pt]=K,at=Pt):(w[at]=Tt,w[gt]=K,at=gt);else if(Pt<St&&0>u(le,K))w[at]=le,w[Pt]=K,at=Pt;else break t}}return F}function u(w,F){var K=w.sortIndex-F.sortIndex;return K!==0?K:w.id-F.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var m=[],S=[],b=1,_=null,x=3,D=!1,A=!1,N=!1,R=!1,O=typeof setTimeout=="function"?setTimeout:null,U=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function V(w){for(var F=i(S);F!==null;){if(F.callback===null)s(S);else if(F.startTime<=w)s(S),F.sortIndex=F.expirationTime,t(m,F);else break;F=i(S)}}function J(w){if(N=!1,V(w),!A)if(i(m)!==null)A=!0,W||(W=!0,rt());else{var F=i(S);F!==null&&tt(J,F.startTime-w)}}var W=!1,st=-1,I=5,et=-1;function nt(){return R?!0:!(n.unstable_now()-et<I)}function bt(){if(R=!1,W){var w=n.unstable_now();et=w;var F=!0;try{t:{A=!1,N&&(N=!1,U(st),st=-1),D=!0;var K=x;try{e:{for(V(w),_=i(m);_!==null&&!(_.expirationTime>w&&nt());){var at=_.callback;if(typeof at=="function"){_.callback=null,x=_.priorityLevel;var St=at(_.expirationTime<=w);if(w=n.unstable_now(),typeof St=="function"){_.callback=St,V(w),F=!0;break e}_===i(m)&&s(m),V(w)}else s(m);_=i(m)}if(_!==null)F=!0;else{var $=i(S);$!==null&&tt(J,$.startTime-w),F=!1}}break t}finally{_=null,x=K,D=!1}F=void 0}}finally{F?rt():W=!1}}}var rt;if(typeof j=="function")rt=function(){j(bt)};else if(typeof MessageChannel<"u"){var dt=new MessageChannel,pt=dt.port2;dt.port1.onmessage=bt,rt=function(){pt.postMessage(null)}}else rt=function(){O(bt,0)};function tt(w,F){st=O(function(){w(n.unstable_now())},F)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(w){w.callback=null},n.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<w?Math.floor(1e3/w):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(w){switch(x){case 1:case 2:case 3:var F=3;break;default:F=x}var K=x;x=F;try{return w()}finally{x=K}},n.unstable_requestPaint=function(){R=!0},n.unstable_runWithPriority=function(w,F){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var K=x;x=w;try{return F()}finally{x=K}},n.unstable_scheduleCallback=function(w,F,K){var at=n.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?at+K:at):K=at,w){case 1:var St=-1;break;case 2:St=250;break;case 5:St=1073741823;break;case 4:St=1e4;break;default:St=5e3}return St=K+St,w={id:b++,callback:F,priorityLevel:w,startTime:K,expirationTime:St,sortIndex:-1},K>at?(w.sortIndex=K,t(S,w),i(m)===null&&w===i(S)&&(N?(U(st),st=-1):N=!0,tt(J,K-at))):(w.sortIndex=St,t(m,w),A||D||(A=!0,W||(W=!0,rt()))),w},n.unstable_shouldYield=nt,n.unstable_wrapCallback=function(w){var F=x;return function(){var K=x;x=F;try{return w.apply(this,arguments)}finally{x=K}}}})(Q2)),Q2}var Z2={};var d4;function q_(){return d4||(d4=1,(function(n){process.env.NODE_ENV!=="production"&&(function(){function t(){if(J=!1,et){var w=n.unstable_now();rt=w;var F=!0;try{t:{j=!1,V&&(V=!1,st(nt),nt=-1),U=!0;var K=O;try{e:{for(f(w),R=s(D);R!==null&&!(R.expirationTime>w&&m());){var at=R.callback;if(typeof at=="function"){R.callback=null,O=R.priorityLevel;var St=at(R.expirationTime<=w);if(w=n.unstable_now(),typeof St=="function"){R.callback=St,f(w),F=!0;break e}R===s(D)&&u(D),f(w)}else u(D);R=s(D)}if(R!==null)F=!0;else{var $=s(A);$!==null&&S(p,$.startTime-w),F=!1}}break t}finally{R=null,O=K,U=!1}F=void 0}}finally{F?dt():et=!1}}}function i(w,F){var K=w.length;w.push(F);t:for(;0<K;){var at=K-1>>>1,St=w[at];if(0<c(St,F))w[at]=F,w[K]=St,K=at;else break t}}function s(w){return w.length===0?null:w[0]}function u(w){if(w.length===0)return null;var F=w[0],K=w.pop();if(K!==F){w[0]=K;t:for(var at=0,St=w.length,$=St>>>1;at<$;){var gt=2*(at+1)-1,Tt=w[gt],Pt=gt+1,le=w[Pt];if(0>c(Tt,K))Pt<St&&0>c(le,Tt)?(w[at]=le,w[Pt]=K,at=Pt):(w[at]=Tt,w[gt]=K,at=gt);else if(Pt<St&&0>c(le,K))w[at]=le,w[Pt]=K,at=Pt;else break t}}return F}function c(w,F){var K=w.sortIndex-F.sortIndex;return K!==0?K:w.id-F.id}function f(w){for(var F=s(A);F!==null;){if(F.callback===null)u(A);else if(F.startTime<=w)u(A),F.sortIndex=F.expirationTime,i(D,F);else break;F=s(A)}}function p(w){if(V=!1,f(w),!j)if(s(D)!==null)j=!0,et||(et=!0,dt());else{var F=s(A);F!==null&&S(p,F.startTime-w)}}function m(){return J?!0:!(n.unstable_now()-rt<bt)}function S(w,F){nt=W(function(){w(n.unstable_now())},F)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var b=performance;n.unstable_now=function(){return b.now()}}else{var _=Date,x=_.now();n.unstable_now=function(){return _.now()-x}}var D=[],A=[],N=1,R=null,O=3,U=!1,j=!1,V=!1,J=!1,W=typeof setTimeout=="function"?setTimeout:null,st=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null,et=!1,nt=-1,bt=5,rt=-1;if(typeof I=="function")var dt=function(){I(t)};else if(typeof MessageChannel<"u"){var pt=new MessageChannel,tt=pt.port2;pt.port1.onmessage=t,dt=function(){tt.postMessage(null)}}else dt=function(){W(t,0)};n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(w){w.callback=null},n.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):bt=0<w?Math.floor(1e3/w):5},n.unstable_getCurrentPriorityLevel=function(){return O},n.unstable_next=function(w){switch(O){case 1:case 2:case 3:var F=3;break;default:F=O}var K=O;O=F;try{return w()}finally{O=K}},n.unstable_requestPaint=function(){J=!0},n.unstable_runWithPriority=function(w,F){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var K=O;O=w;try{return F()}finally{O=K}},n.unstable_scheduleCallback=function(w,F,K){var at=n.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?at+K:at):K=at,w){case 1:var St=-1;break;case 2:St=250;break;case 5:St=1073741823;break;case 4:St=1e4;break;default:St=5e3}return St=K+St,w={id:N++,callback:F,priorityLevel:w,startTime:K,expirationTime:St,sortIndex:-1},K>at?(w.sortIndex=K,i(A,w),s(D)===null&&w===s(A)&&(V?(st(nt),nt=-1):V=!0,S(p,K-at))):(w.sortIndex=St,i(D,w),j||U||(j=!0,et||(et=!0,dt()))),w},n.unstable_shouldYield=m,n.unstable_wrapCallback=function(w){var F=O;return function(){var K=O;O=F;try{return w.apply(this,arguments)}finally{O=K}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})(Z2)),Z2}var p4;function J2(){return p4||(p4=1,process.env.NODE_ENV==="production"?j1.exports=Y_():j1.exports=q_()),j1.exports}var m4;function X_(){return m4||(m4=1,(function(n){n.exports=function(t){function i(l,r,h,g){return new md(l,r,h,g)}function s(){}function u(l){var r="https://react.dev/errors/"+l;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)r+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+l+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(l){var r=l,h=l;if(l.alternate)for(;r.return;)r=r.return;else{l=r;do r=l,(r.flags&4098)!==0&&(h=r.return),l=r.return;while(l)}return r.tag===3?h:null}function f(l){if(c(l)!==l)throw Error(u(188))}function p(l){var r=l.alternate;if(!r){if(r=c(l),r===null)throw Error(u(188));return r!==l?null:l}for(var h=l,g=r;;){var E=h.return;if(E===null)break;var T=E.alternate;if(T===null){if(g=E.return,g!==null){h=g;continue}break}if(E.child===T.child){for(T=E.child;T;){if(T===h)return f(E),l;if(T===g)return f(E),r;T=T.sibling}throw Error(u(188))}if(h.return!==g.return)h=E,g=T;else{for(var z=!1,L=E.child;L;){if(L===h){z=!0,h=E,g=T;break}if(L===g){z=!0,g=E,h=T;break}L=L.sibling}if(!z){for(L=T.child;L;){if(L===h){z=!0,h=T,g=E;break}if(L===g){z=!0,g=T,h=E;break}L=L.sibling}if(!z)throw Error(u(189))}}if(h.alternate!==g)throw Error(u(190))}if(h.tag!==3)throw Error(u(188));return h.stateNode.current===h?l:r}function m(l){var r=l.tag;if(r===5||r===26||r===27||r===6)return l;for(l=l.child;l!==null;){if(r=m(l),r!==null)return r;l=l.sibling}return null}function S(l){var r=l.tag;if(r===5||r===26||r===27||r===6)return l;for(l=l.child;l!==null;){if(l.tag!==4&&(r=S(l),r!==null))return r;l=l.sibling}return null}function b(l){return l===null||typeof l!="object"?null:(l=ym&&l[ym]||l["@@iterator"],typeof l=="function"?l:null)}function _(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===vm?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case io:return"Fragment";case ff:return"Profiler";case mm:return"StrictMode";case so:return"Suspense";case ze:return"SuspenseList";case Td:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case or:return"Portal";case Al:return l.displayName||"Context";case Ed:return(l._context.displayName||"Context")+".Consumer";case Cu:var r=l.render;return l=l.displayName,l||(l=r.displayName||r.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case gm:return r=l.displayName||null,r!==null?r:_(l.type)||"Memo";case ur:r=l._payload,l=l._init;try{return _(l(r))}catch{}}return null}function x(l){return{current:l}}function D(l){0>Nu||(l.current=bf[Nu],bf[Nu]=null,Nu--)}function A(l,r){Nu++,bf[Nu]=l.current,l.current=r}function N(l){return l>>>=0,l===0?32:31-(My(l)/Ny|0)|0}function R(l){var r=l&42;if(r!==0)return r;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function O(l,r,h){var g=l.pendingLanes;if(g===0)return 0;var E=0,T=l.suspendedLanes,z=l.pingedLanes;l=l.warmLanes;var L=g&134217727;return L!==0?(g=L&~T,g!==0?E=R(g):(z&=L,z!==0?E=R(z):h||(h=L&~l,h!==0&&(E=R(h))))):(L=g&~T,L!==0?E=R(L):z!==0?E=R(z):h||(h=g&~l,h!==0&&(E=R(h)))),E===0?0:r!==0&&r!==E&&(r&T)===0&&(T=E&-E,h=r&-r,T>=h||T===32&&(h&4194048)!==0)?r:E}function U(l,r){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&r)===0}function j(l,r){switch(l){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function V(){var l=Ou;return Ou<<=1,(Ou&62914560)===0&&(Ou=4194304),l}function J(l){for(var r=[],h=0;31>h;h++)r.push(l);return r}function W(l,r){l.pendingLanes|=r,r!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function st(l,r,h,g,E,T){var z=l.pendingLanes;l.pendingLanes=h,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=h,l.entangledLanes&=h,l.errorRecoveryDisabledLanes&=h,l.shellSuspendCounter=0;var L=l.entanglements,ft=l.expirationTimes,vt=l.hiddenUpdates;for(h=z&~h;0<h;){var Mt=31-ii(h),xt=1<<Mt;L[Mt]=0,ft[Mt]=-1;var Rt=vt[Mt];if(Rt!==null)for(vt[Mt]=null,Mt=0;Mt<Rt.length;Mt++){var Yt=Rt[Mt];Yt!==null&&(Yt.lane&=-536870913)}h&=~xt}g!==0&&I(l,g,0),T!==0&&E===0&&l.tag!==0&&(l.suspendedLanes|=T&~(z&~r))}function I(l,r,h){l.pendingLanes|=r,l.suspendedLanes&=~r;var g=31-ii(r);l.entangledLanes|=r,l.entanglements[g]=l.entanglements[g]|1073741824|h&261930}function et(l,r){var h=l.entangledLanes|=r;for(l=l.entanglements;h;){var g=31-ii(h),E=1<<g;E&r|l[g]&r&&(l[g]|=r),h&=~E}}function nt(l,r){var h=r&-r;return h=(h&42)!==0?1:bt(h),(h&(l.suspendedLanes|r))!==0?0:h}function bt(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function rt(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function dt(l){if(typeof Gd=="function"&&wm(l),Rn&&typeof Rn.setStrictMode=="function")try{Rn.setStrictMode(po,l)}catch{}}function pt(l,r){return l===r&&(l!==0||1/l===1/r)||l!==l&&r!==r}function tt(l){if(zu===void 0)try{throw Error()}catch(h){var r=h.stack.trim().match(/\n( *(at )?)/);zu=r&&r[1]||"",li=-1<h.stack.indexOf(`
|
|
14
|
+
`,c5=()=>{if(typeof document>"u")throw new Error(TT)};class Qi{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new Qi(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){const i=this.m;return{x:i[0]*t.x+i[2]*t.y+i[4],y:i[1]*t.x+i[3]*t.y+i[5]}}translate(t,i){return this.m[4]+=this.m[0]*t+this.m[2]*i,this.m[5]+=this.m[1]*t+this.m[3]*i,this}scale(t,i){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=i,this.m[3]*=i,this}rotate(t){const i=Math.cos(t),s=Math.sin(t),u=this.m[0]*i+this.m[2]*s,c=this.m[1]*i+this.m[3]*s,f=this.m[0]*-s+this.m[2]*i,p=this.m[1]*-s+this.m[3]*i;return this.m[0]=u,this.m[1]=c,this.m[2]=f,this.m[3]=p,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,i){const s=this.m[0]+this.m[2]*i,u=this.m[1]+this.m[3]*i,c=this.m[2]+this.m[0]*t,f=this.m[3]+this.m[1]*t;return this.m[0]=s,this.m[1]=u,this.m[2]=c,this.m[3]=f,this}multiply(t){const i=this.m[0]*t.m[0]+this.m[2]*t.m[1],s=this.m[1]*t.m[0]+this.m[3]*t.m[1],u=this.m[0]*t.m[2]+this.m[2]*t.m[3],c=this.m[1]*t.m[2]+this.m[3]*t.m[3],f=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],p=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=i,this.m[1]=s,this.m[2]=u,this.m[3]=c,this.m[4]=f,this.m[5]=p,this}invert(){const t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),i=this.m[3]*t,s=-this.m[1]*t,u=-this.m[2]*t,c=this.m[0]*t,f=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),p=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=i,this.m[1]=s,this.m[2]=u,this.m[3]=c,this.m[4]=f,this.m[5]=p,this}getMatrix(){return this.m}decompose(){const t=this.m[0],i=this.m[1],s=this.m[2],u=this.m[3],c=this.m[4],f=this.m[5],p=t*u-i*s,m={x:c,y:f,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||i!=0){const S=Math.sqrt(t*t+i*i);m.rotation=i>0?Math.acos(t/S):-Math.acos(t/S),m.scaleX=S,m.scaleY=p/S,m.skewX=(t*s+i*u)/p,m.skewY=0}else if(s!=0||u!=0){const S=Math.sqrt(s*s+u*u);m.rotation=Math.PI/2-(u>0?Math.acos(-s/S):-Math.acos(s/S)),m.scaleX=p/S,m.scaleY=S,m.skewX=0,m.skewY=(t*s+i*u)/p}return m.rotation=k._getRotation(m.rotation),m}}const CT="[object Array]",_T="[object Number]",xT="[object String]",DT="[object Boolean]",AT=Math.PI/180,MT=180/Math.PI,Hp="#",NT="",OT="0",RT="Konva warning: ",f5="Konva error: ",zT="rgb(",S2={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},HT=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let E1=[],wp=null;const wT=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(n){setTimeout(n,60)},k={_isElement(n){return!!(n&&n.nodeType==1)},_isFunction(n){return!!(n&&n.constructor&&n.call&&n.apply)},_isPlainObject(n){return!!n&&n.constructor===Object},_isArray(n){return Object.prototype.toString.call(n)===CT},_isNumber(n){return Object.prototype.toString.call(n)===_T&&!isNaN(n)&&isFinite(n)},_isString(n){return Object.prototype.toString.call(n)===xT},_isBoolean(n){return Object.prototype.toString.call(n)===DT},isObject(n){return n instanceof Object},isValidSelector(n){if(typeof n!="string")return!1;const t=n[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(n){return n===0||n>0?1:-1},requestAnimFrame(n){E1.push(n),E1.length===1&&wT(function(){const t=E1;E1=[],t.forEach(function(i){i()})})},createCanvasElement(){c5();const n=document.createElement("canvas");try{n.style=n.style||{}}catch{}return n},createImageElement(){return c5(),document.createElement("img")},_isInDocument(n){for(;n=n.parentNode;)if(n==document)return!0;return!1},_urlToImage(n,t){const i=k.createImageElement();i.onload=function(){t(i)},i.src=n},_rgbToHex(n,t,i){return((1<<24)+(n<<16)+(t<<8)+i).toString(16).slice(1)},_hexToRgb(n){n=n.replace(Hp,NT);const t=parseInt(n,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){let n=(Math.random()*16777215<<0).toString(16);for(;n.length<6;)n=OT+n;return Hp+n},isCanvasFarblingActive(){if(wp!==null)return wp;if(typeof document>"u")return wp=!1,!1;const n=this.createCanvasElement();n.width=10,n.height=10;const t=n.getContext("2d",{willReadFrequently:!0});t.clearRect(0,0,10,10),t.fillStyle="#282828",t.fillRect(0,0,10,10);const i=t.getImageData(0,0,10,10).data;let s=!1;for(let u=0;u<100;u++)if(i[u*4]!==40||i[u*4+1]!==40||i[u*4+2]!==40||i[u*4+3]!==255){s=!0;break}return wp=s,this.releaseCanvas(n),wp},getHitColor(){const n=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(n):n},getHitColorKey(n,t,i){return this.isCanvasFarblingActive()&&(n=Math.round(n/5)*5,t=Math.round(t/5)*5,i=Math.round(i/5)*5),Hp+this._rgbToHex(n,t,i)},getSnappedHexColor(n){const t=this._hexToRgb(n);return Hp+this._rgbToHex(Math.round(t.r/5)*5,Math.round(t.g/5)*5,Math.round(t.b/5)*5)},getRGB(n){let t;return n in S2?(t=S2[n],{r:t[0],g:t[1],b:t[2]}):n[0]===Hp?this._hexToRgb(n.substring(1)):n.substr(0,4)===zT?(t=HT.exec(n.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(n){return n=n||"black",k._namedColorToRBA(n)||k._hex3ColorToRGBA(n)||k._hex4ColorToRGBA(n)||k._hex6ColorToRGBA(n)||k._hex8ColorToRGBA(n)||k._rgbColorToRGBA(n)||k._rgbaColorToRGBA(n)||k._hslColorToRGBA(n)},_namedColorToRBA(n){const t=S2[n.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(n){if(n.indexOf("rgb(")===0){n=n.match(/rgb\(([^)]+)\)/)[1];const t=n.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(n){if(n.indexOf("rgba(")===0){n=n.match(/rgba\(([^)]+)\)/)[1];const t=n.split(/ *, */).map((i,s)=>i.slice(-1)==="%"?s===3?parseInt(i)/100:parseInt(i)/100*255:Number(i));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(n){if(n[0]==="#"&&n.length===9)return{r:parseInt(n.slice(1,3),16),g:parseInt(n.slice(3,5),16),b:parseInt(n.slice(5,7),16),a:parseInt(n.slice(7,9),16)/255}},_hex6ColorToRGBA(n){if(n[0]==="#"&&n.length===7)return{r:parseInt(n.slice(1,3),16),g:parseInt(n.slice(3,5),16),b:parseInt(n.slice(5,7),16),a:1}},_hex4ColorToRGBA(n){if(n[0]==="#"&&n.length===5)return{r:parseInt(n[1]+n[1],16),g:parseInt(n[2]+n[2],16),b:parseInt(n[3]+n[3],16),a:parseInt(n[4]+n[4],16)/255}},_hex3ColorToRGBA(n){if(n[0]==="#"&&n.length===4)return{r:parseInt(n[1]+n[1],16),g:parseInt(n[2]+n[2],16),b:parseInt(n[3]+n[3],16),a:1}},_hslColorToRGBA(n){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(n)){const[t,...i]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(n),s=Number(i[0])/360,u=Number(i[1])/100,c=Number(i[2])/100;let f,p,m;if(u===0)return m=c*255,{r:Math.round(m),g:Math.round(m),b:Math.round(m),a:1};c<.5?f=c*(1+u):f=c+u-c*u;const S=2*c-f,b=[0,0,0];for(let _=0;_<3;_++)p=s+1/3*-(_-1),p<0&&p++,p>1&&p--,6*p<1?m=S+(f-S)*6*p:2*p<1?m=f:3*p<2?m=S+(f-S)*(2/3-p)*6:m=S,b[_]=m*255;return{r:Math.round(b[0]),g:Math.round(b[1]),b:Math.round(b[2]),a:1}}},haveIntersection(n,t){return!(t.x>n.x+n.width||t.x+t.width<n.x||t.y>n.y+n.height||t.y+t.height<n.y)},cloneObject(n){const t={};for(const i in n)this._isPlainObject(n[i])?t[i]=this.cloneObject(n[i]):this._isArray(n[i])?t[i]=this.cloneArray(n[i]):t[i]=n[i];return t},cloneArray(n){return n.slice(0)},degToRad(n){return n*AT},radToDeg(n){return n*MT},_degToRad(n){return k.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),k.degToRad(n)},_radToDeg(n){return k.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),k.radToDeg(n)},_getRotation(n){return Ot.angleDeg?k.radToDeg(n):n},_capitalize(n){return n.charAt(0).toUpperCase()+n.slice(1)},throw(n){throw new Error(f5+n)},error(n){console.error(f5+n)},warn(n){Ot.showWarnings&&console.warn(RT+n)},each(n,t){for(const i in n)t(i,n[i])},_inRange(n,t,i){return t<=n&&n<i},_getProjectionToSegment(n,t,i,s,u,c){let f,p,m;const S=(n-i)*(n-i)+(t-s)*(t-s);if(S==0)f=n,p=t,m=(u-i)*(u-i)+(c-s)*(c-s);else{const b=((u-n)*(i-n)+(c-t)*(s-t))/S;b<0?(f=n,p=t,m=(n-u)*(n-u)+(t-c)*(t-c)):b>1?(f=i,p=s,m=(i-u)*(i-u)+(s-c)*(s-c)):(f=n+b*(i-n),p=t+b*(s-t),m=(f-u)*(f-u)+(p-c)*(p-c))}return[f,p,m]},_getProjectionToLine(n,t,i){const s=k.cloneObject(n);let u=Number.MAX_VALUE;return t.forEach(function(c,f){if(!i&&f===t.length-1)return;const p=t[(f+1)%t.length],m=k._getProjectionToSegment(c.x,c.y,p.x,p.y,n.x,n.y),S=m[0],b=m[1],_=m[2];_<u&&(s.x=S,s.y=b,u=_)}),s},_prepareArrayForTween(n,t,i){const s=[],u=[];if(n.length>t.length){const f=t;t=n,n=f}for(let f=0;f<n.length;f+=2)s.push({x:n[f],y:n[f+1]});for(let f=0;f<t.length;f+=2)u.push({x:t[f],y:t[f+1]});const c=[];return u.forEach(function(f){const p=k._getProjectionToLine(f,s,i);c.push(p.x),c.push(p.y)}),c},_prepareToStringify(n){let t;n.visitedByCircularReferenceRemoval=!0;for(const i in n)if(n.hasOwnProperty(i)&&n[i]&&typeof n[i]=="object"){if(t=Object.getOwnPropertyDescriptor(n,i),n[i].visitedByCircularReferenceRemoval||k._isElement(n[i]))if(t.configurable)delete n[i];else return null;else if(k._prepareToStringify(n[i])===null)if(t.configurable)delete n[i];else return null}return delete n.visitedByCircularReferenceRemoval,n},_assign(n,t){for(const i in t)n[i]=t[i];return n},_getFirstPointerId(n){return n.touches?n.changedTouches[0].identifier:n.pointerId||999},releaseCanvas(...n){Ot.releaseCanvasOnDestroy&&n.forEach(t=>{t.width=0,t.height=0})},drawRoundedRectPath(n,t,i,s){let u=t<0?t:0,c=i<0?i:0;t=Math.abs(t),i=Math.abs(i);let f=0,p=0,m=0,S=0;typeof s=="number"?f=p=m=S=Math.min(s,t/2,i/2):(f=Math.min(s[0]||0,t/2,i/2),p=Math.min(s[1]||0,t/2,i/2),S=Math.min(s[2]||0,t/2,i/2),m=Math.min(s[3]||0,t/2,i/2)),n.moveTo(u+f,c),n.lineTo(u+t-p,c),n.arc(u+t-p,c+p,p,Math.PI*3/2,0,!1),n.lineTo(u+t,c+i-S),n.arc(u+t-S,c+i-S,S,0,Math.PI/2,!1),n.lineTo(u+m,c+i),n.arc(u+m,c+i-m,m,Math.PI/2,Math.PI,!1),n.lineTo(u,c+f),n.arc(u+f,c+f,f,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(n,t,i,s,u){s=Math.abs(s);for(let c=0;c<i;c++){const f=t[(c-1+i)%i],p=t[c],m=t[(c+1)%i],S={x:p.x-f.x,y:p.y-f.y},b={x:m.x-p.x,y:m.y-p.y},_=Math.hypot(S.x,S.y),x=Math.hypot(b.x,b.y);let D;typeof u=="number"?D=u:D=c<u.length?u[c]:0,D=s*Math.cos(Math.PI/i)*Math.min(1,D/s*2);const N={x:S.x/_,y:S.y/_},R={x:b.x/x,y:b.y/x},O={x:p.x-N.x*D,y:p.y-N.y*D},U={x:p.x+R.x*D,y:p.y+R.y*D};c===0?n.moveTo(O.x,O.y):n.lineTo(O.x,O.y),n.arcTo(p.x,p.y,U.x,U.y,D)}}};function UT(n){const t=[],i=n.length,s=k;for(let u=0;u<i;u++){let c=n[u];s._isNumber(c)?c=Math.round(c*1e3)/1e3:s._isString(c)||(c=c+""),t.push(c)}return t}const h5=",",BT="(",VT=")",GT="([",jT="])",LT=";",PT="()",YT="=",d5=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],qT=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],XT=100;let T1=null;function p5(){if(T1!==null)return T1;try{const t=k.createCanvasElement().getContext("2d");return t?!!t&&"filter"in t:(T1=!1,!1)}catch{return T1=!1,!1}}class C1{constructor(t){this.canvas=t,Ot.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,i){let s=this.traceArr,u=s.length,c="",f,p,m,S;for(f=0;f<u;f++)p=s[f],m=p.method,m?(S=p.args,c+=m,t?c+=PT:k._isArray(S[0])?c+=GT+S.join(h5)+jT:(i&&(S=S.map(b=>typeof b=="number"?Math.floor(b):b)),c+=BT+S.join(h5)+VT)):(c+=p.property,t||(c+=YT+p.val)),c+=LT;return c}clearTrace(){this.traceArr=[]}_trace(t){let i=this.traceArr,s;i.push(t),s=i.length,s>=XT&&i.shift()}reset(){const t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){const i=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,i.getWidth()/i.pixelRatio,i.getHeight()/i.pixelRatio)}_applyLineCap(t){const i=t.attrs.lineCap;i&&this.setAttr("lineCap",i)}_applyOpacity(t){const i=t.getAbsoluteOpacity();i!==1&&this.setAttr("globalAlpha",i)}_applyLineJoin(t){const i=t.attrs.lineJoin;i&&this.setAttr("lineJoin",i)}_applyMiterLimit(t){const i=t.attrs.miterLimit;i!=null&&this.setAttr("miterLimit",i)}setAttr(t,i){this._context[t]=i}arc(t,i,s,u,c,f){this._context.arc(t,i,s,u,c,f)}arcTo(t,i,s,u,c){this._context.arcTo(t,i,s,u,c)}beginPath(){this._context.beginPath()}bezierCurveTo(t,i,s,u,c,f){this._context.bezierCurveTo(t,i,s,u,c,f)}clearRect(t,i,s,u){this._context.clearRect(t,i,s,u)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,i){const s=arguments;if(s.length===2)return this._context.createImageData(t,i);if(s.length===1)return this._context.createImageData(t)}createLinearGradient(t,i,s,u){return this._context.createLinearGradient(t,i,s,u)}createPattern(t,i){return this._context.createPattern(t,i)}createRadialGradient(t,i,s,u,c,f){return this._context.createRadialGradient(t,i,s,u,c,f)}drawImage(t,i,s,u,c,f,p,m,S){const b=arguments,_=this._context;b.length===3?_.drawImage(t,i,s):b.length===5?_.drawImage(t,i,s,u,c):b.length===9&&_.drawImage(t,i,s,u,c,f,p,m,S)}ellipse(t,i,s,u,c,f,p,m){this._context.ellipse(t,i,s,u,c,f,p,m)}isPointInPath(t,i,s,u){return s?this._context.isPointInPath(s,t,i,u):this._context.isPointInPath(t,i,u)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,i,s,u){this._context.fillRect(t,i,s,u)}strokeRect(t,i,s,u){this._context.strokeRect(t,i,s,u)}fillText(t,i,s,u){u?this._context.fillText(t,i,s,u):this._context.fillText(t,i,s)}measureText(t){return this._context.measureText(t)}getImageData(t,i,s,u){return this._context.getImageData(t,i,s,u)}lineTo(t,i){this._context.lineTo(t,i)}moveTo(t,i){this._context.moveTo(t,i)}rect(t,i,s,u){this._context.rect(t,i,s,u)}roundRect(t,i,s,u,c){this._context.roundRect(t,i,s,u,c)}putImageData(t,i,s){this._context.putImageData(t,i,s)}quadraticCurveTo(t,i,s,u){this._context.quadraticCurveTo(t,i,s,u)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,i){this._context.scale(t,i)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,i,s,u,c,f){this._context.setTransform(t,i,s,u,c,f)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,i,s,u){this._context.strokeText(t,i,s,u)}transform(t,i,s,u,c,f){this._context.transform(t,i,s,u,c,f)}translate(t,i){this._context.translate(t,i)}_enableTrace(){let t=this,i=d5.length,s=this.setAttr,u,c;const f=function(p){let m=t[p],S;t[p]=function(){return c=UT(Array.prototype.slice.call(arguments,0)),S=m.apply(t,arguments),t._trace({method:p,args:c}),S}};for(u=0;u<i;u++)f(d5[u]);t.setAttr=function(){s.apply(t,arguments);const p=arguments[0];let m=arguments[1];(p==="shadowOffsetX"||p==="shadowOffsetY"||p==="shadowBlur")&&(m=m/this.canvas.getPixelRatio()),t._trace({property:p,val:m})}}_applyGlobalCompositeOperation(t){const i=t.attrs.globalCompositeOperation;!i||i==="source-over"||this.setAttr("globalCompositeOperation",i)}}qT.forEach(function(n){Object.defineProperty(C1.prototype,n,{get(){return this._context[n]},set(t){this._context[n]=t}})});class KT extends C1{constructor(t,{willReadFrequently:i=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:i})}_fillColor(t){const i=t.fill();this.setAttr("fillStyle",i),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){const i=t._getLinearGradient();i&&(this.setAttr("fillStyle",i),t._fillFunc(this))}_fillRadialGradient(t){const i=t._getRadialGradient();i&&(this.setAttr("fillStyle",i),t._fillFunc(this))}_fill(t){const i=t.fill(),s=t.getFillPriority();if(i&&s==="color"){this._fillColor(t);return}const u=t.getFillPatternImage();if(u&&s==="pattern"){this._fillPattern(t);return}const c=t.getFillLinearGradientColorStops();if(c&&s==="linear-gradient"){this._fillLinearGradient(t);return}const f=t.getFillRadialGradientColorStops();if(f&&s==="radial-gradient"){this._fillRadialGradient(t);return}i?this._fillColor(t):u?this._fillPattern(t):c?this._fillLinearGradient(t):f&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const i=t.getStrokeLinearGradientStartPoint(),s=t.getStrokeLinearGradientEndPoint(),u=t.getStrokeLinearGradientColorStops(),c=this.createLinearGradient(i.x,i.y,s.x,s.y);if(u){for(let f=0;f<u.length;f+=2)c.addColorStop(u[f],u[f+1]);this.setAttr("strokeStyle",c)}}_stroke(t){const i=t.dash(),s=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!s){this.save();const c=this.getCanvas().getPixelRatio();this.setTransform(c,0,0,c,0,0)}this._applyLineCap(t),i&&t.dashEnabled()&&(this.setLineDash(i),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),t.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),s||this.restore()}}_applyShadow(t){var i,s,u;const c=(i=t.getShadowRGBA())!==null&&i!==void 0?i:"black",f=(s=t.getShadowBlur())!==null&&s!==void 0?s:5,p=(u=t.getShadowOffset())!==null&&u!==void 0?u:{x:0,y:0},m=t.getAbsoluteScale(),S=this.canvas.getPixelRatio(),b=m.x*S,_=m.y*S;this.setAttr("shadowColor",c),this.setAttr("shadowBlur",f*Math.min(Math.abs(b),Math.abs(_))),this.setAttr("shadowOffsetX",p.x*b),this.setAttr("shadowOffsetY",p.y*_)}}class QT extends C1{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const i=t.getStrokeScaleEnabled();if(!i){this.save();const c=this.getCanvas().getPixelRatio();this.setTransform(c,0,0,c,0,0)}this._applyLineCap(t);const s=t.hitStrokeWidth(),u=s==="auto"?t.strokeWidth():s;this.setAttr("lineWidth",u),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),i||this.restore()}}}let _1;function ZT(){if(_1)return _1;const n=k.createCanvasElement(),t=n.getContext("2d");return _1=(function(){const i=Ot._global.devicePixelRatio||1,s=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/s})(),k.releaseCanvas(n),_1}class b2{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const s=(t||{}).pixelRatio||Ot.pixelRatio||ZT();this.pixelRatio=s,this._canvas=k.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){const i=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/i,this.getHeight()/i)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";const i=this.pixelRatio;this.getContext()._context.scale(i,i)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";const i=this.pixelRatio;this.getContext()._context.scale(i,i)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,i){this.setWidth(t||0),this.setHeight(i||0)}toDataURL(t,i){try{return this._canvas.toDataURL(t,i)}catch{try{return this._canvas.toDataURL()}catch(u){return k.error("Unable to get data URL. "+u.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class Vo extends b2{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new KT(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}class E2 extends b2{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new QT(this),this.setSize(t.width,t.height)}}const Ne={get isDragging(){let n=!1;return Ne._dragElements.forEach(t=>{t.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){let n;return Ne._dragElements.forEach(t=>{n=t.node}),n},_dragElements:new Map,_drag(n){const t=[];Ne._dragElements.forEach((i,s)=>{const{node:u}=i,c=u.getStage();c.setPointersPositions(n),i.pointerId===void 0&&(i.pointerId=k._getFirstPointerId(n));const f=c._changedPointerPositions.find(p=>p.id===i.pointerId);if(f){if(i.dragStatus!=="dragging"){const p=u.dragDistance();if(Math.max(Math.abs(f.x-i.startPointerPos.x),Math.abs(f.y-i.startPointerPos.y))<p||(u.startDrag({evt:n}),!u.isDragging()))return}u._setDragPosition(n,i),t.push(u)}}),t.forEach(i=>{i.fire("dragmove",{type:"dragmove",target:i,evt:n},!0)})},_endDragBefore(n){const t=[];Ne._dragElements.forEach(i=>{const{node:s}=i,u=s.getStage();if(n&&u.setPointersPositions(n),!u._changedPointerPositions.find(p=>p.id===i.pointerId))return;(i.dragStatus==="dragging"||i.dragStatus==="stopped")&&(Ne.justDragged=!0,Ot._mouseListenClick=!1,Ot._touchListenClick=!1,Ot._pointerListenClick=!1,i.dragStatus="stopped");const f=i.node.getLayer()||i.node instanceof Ot.Stage&&i.node;f&&t.indexOf(f)===-1&&t.push(f)}),t.forEach(i=>{i.draw()})},_endDragAfter(n){Ne._dragElements.forEach((t,i)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:n},!0),t.dragStatus!=="dragging"&&Ne._dragElements.delete(i)})}};Ot.isBrowser&&(window.addEventListener("mouseup",Ne._endDragBefore,!0),window.addEventListener("touchend",Ne._endDragBefore,!0),window.addEventListener("touchcancel",Ne._endDragBefore,!0),window.addEventListener("mousemove",Ne._drag),window.addEventListener("touchmove",Ne._drag),window.addEventListener("mouseup",Ne._endDragAfter,!1),window.addEventListener("touchend",Ne._endDragAfter,!1),window.addEventListener("touchcancel",Ne._endDragAfter,!1));function Go(n){return k._isString(n)?'"'+n+'"':Object.prototype.toString.call(n)==="[object Number]"||k._isBoolean(n)?n:Object.prototype.toString.call(n)}function m5(n){return n>255?255:n<0?0:Math.round(n)}function Dt(){if(Ot.isUnminified)return function(n,t){return k._isNumber(n)||k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),n}}function x1(n){if(Ot.isUnminified)return function(t,i){let s=k._isNumber(t),u=k._isArray(t)&&t.length==n;return!s&&!u&&k.warn(Go(t)+' is a not valid value for "'+i+'" attribute. The value should be a number or Array<number>('+n+")"),t}}function T2(){if(Ot.isUnminified)return function(n,t){return k._isNumber(n)||n==="auto"||k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),n}}function oc(){if(Ot.isUnminified)return function(n,t){return k._isString(n)||k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),n}}function g5(){if(Ot.isUnminified)return function(n,t){const i=k._isString(n),s=Object.prototype.toString.call(n)==="[object CanvasGradient]"||n&&n.addColorStop;return i||s||k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),n}}function JT(){if(Ot.isUnminified)return function(n,t){const i=Int8Array?Object.getPrototypeOf(Int8Array):null;return i&&n instanceof i||(k._isArray(n)?n.forEach(function(s){k._isNumber(s)||k.warn('"'+t+'" attribute has non numeric element '+s+". Make sure that all elements are numbers.")}):k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),n}}function sl(){if(Ot.isUnminified)return function(n,t){return n===!0||n===!1||k.warn(Go(n)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),n}}function FT(n){if(Ot.isUnminified)return function(t,i){return t==null||k.isObject(t)||k.warn(Go(t)+' is a not valid value for "'+i+'" attribute. The value should be an object with properties '+n),t}}const Up="get",Bp="set",G={addGetterSetter(n,t,i,s,u){G.addGetter(n,t,i),G.addSetter(n,t,s,u),G.addOverloadedGetterSetter(n,t)},addGetter(n,t,i){const s=Up+k._capitalize(t);n.prototype[s]=n.prototype[s]||function(){const u=this.attrs[t];return u===void 0?i:u}},addSetter(n,t,i,s){const u=Bp+k._capitalize(t);n.prototype[u]||G.overWriteSetter(n,t,i,s)},overWriteSetter(n,t,i,s){const u=Bp+k._capitalize(t);n.prototype[u]=function(c){return i&&c!==void 0&&c!==null&&(c=i.call(this,c,t)),this._setAttr(t,c),s&&s.call(this),this}},addComponentsGetterSetter(n,t,i,s,u){const c=i.length,f=k._capitalize,p=Up+f(t),m=Bp+f(t);n.prototype[p]=function(){const b={};for(let _=0;_<c;_++){const x=i[_];b[x]=this.getAttr(t+f(x))}return b};const S=FT(i);n.prototype[m]=function(b){const _=this.attrs[t];s&&(b=s.call(this,b,t)),S&&S.call(this,b,t);for(const x in b)b.hasOwnProperty(x)&&this._setAttr(t+f(x),b[x]);return b||i.forEach(x=>{this._setAttr(t+f(x),void 0)}),this._fireChangeEvent(t,_,b),u&&u.call(this),this},G.addOverloadedGetterSetter(n,t)},addOverloadedGetterSetter(n,t){const i=k._capitalize(t),s=Bp+i,u=Up+i;n.prototype[t]=function(){return arguments.length?(this[s](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(n,t,i,s){k.error("Adding deprecated "+t);const u=Up+k._capitalize(t),c=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";n.prototype[u]=function(){k.error(c);const f=this.attrs[t];return f===void 0?i:f},G.addSetter(n,t,s,function(){k.error(c)}),G.addOverloadedGetterSetter(n,t)},backCompat(n,t){k.each(t,function(i,s){const u=n.prototype[s],c=Up+k._capitalize(i),f=Bp+k._capitalize(i);function p(){u.apply(this,arguments),k.error('"'+i+'" method is deprecated and will be removed soon. Use ""'+s+'" instead.')}n.prototype[i]=p,n.prototype[c]=p,n.prototype[f]=p})},afterSetFilter(){this._filterUpToDate=!1}};function kT(n){const t=/(\w+)\(([^)]+)\)/g;let i;for(;(i=t.exec(n))!==null;){const[,s,u]=i;switch(s){case"blur":{const c=parseFloat(u.replace("px",""));return function(f){this.blurRadius(c*.5);const p=Ot.Filters;p&&p.Blur&&p.Blur.call(this,f)}}case"brightness":{const c=u.includes("%")?parseFloat(u)/100:parseFloat(u);return function(f){this.brightness(c);const p=Ot.Filters;p&&p.Brightness&&p.Brightness.call(this,f)}}case"contrast":{const c=parseFloat(u);return function(f){const p=100*(Math.sqrt(c)-1);this.contrast(p);const m=Ot.Filters;m&&m.Contrast&&m.Contrast.call(this,f)}}case"grayscale":return function(c){const f=Ot.Filters;f&&f.Grayscale&&f.Grayscale.call(this,c)};case"sepia":return function(c){const f=Ot.Filters;f&&f.Sepia&&f.Sepia.call(this,c)};case"invert":return function(c){const f=Ot.Filters;f&&f.Invert&&f.Invert.call(this,c)};default:k.warn(`CSS filter "${s}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const D1="absoluteOpacity",A1="allEventListeners",Mr="absoluteTransform",y5="absoluteScale",uc="canvas",IT="Change",WT="children",$T="konva",C2="listening",tC="mouseenter",eC="mouseleave",nC="pointerenter",aC="pointerleave",iC="touchenter",sC="touchleave",v5="set",S5="Shape",M1=" ",b5="stage",jo="transform",lC="Stage",_2="visible",rC=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(M1);let oC=1,Nt=class u5{constructor(t){this._id=oC++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===jo||t===Mr)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,i){let s=this._cache.get(t);return(s===void 0||(t===jo||t===Mr)&&s.dirty===!0)&&(s=i.call(this),this._cache.set(t,s)),s}_calculate(t,i,s){if(!this._attachedDepsListeners.get(t)){const u=i.map(c=>c+"Change.konva").join(M1);this.on(u,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,s)}_getCanvasCache(){return this._cache.get(uc)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Mr&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(uc)){const{scene:t,filter:i,hit:s,buffer:u}=this._cache.get(uc);k.releaseCanvas(t,i,s,u),this._cache.delete(uc)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){const i=t||{};let s={};(i.x===void 0||i.y===void 0||i.width===void 0||i.height===void 0)&&(s=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let u=Math.ceil(i.width||s.width),c=Math.ceil(i.height||s.height),f=i.pixelRatio,p=i.x===void 0?Math.floor(s.x):i.x,m=i.y===void 0?Math.floor(s.y):i.y,S=i.offset||0,b=i.drawBorder||!1,_=i.hitCanvasPixelRatio||1;if(!u||!c){k.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const x=Math.abs(Math.round(s.x)-p)>.5?1:0,D=Math.abs(Math.round(s.y)-m)>.5?1:0;u+=S*2+x,c+=S*2+D,p-=S,m-=S;const A=new Vo({pixelRatio:f,width:u,height:c}),N=new Vo({pixelRatio:f,width:0,height:0,willReadFrequently:!0}),R=new E2({pixelRatio:_,width:u,height:c}),O=A.getContext(),U=R.getContext(),j=new Vo({width:A.width/A.pixelRatio+Math.abs(p),height:A.height/A.pixelRatio+Math.abs(m),pixelRatio:A.pixelRatio}),V=j.getContext();return R.isCache=!0,A.isCache=!0,this._cache.delete(uc),this._filterUpToDate=!1,i.imageSmoothingEnabled===!1&&(A.getContext()._context.imageSmoothingEnabled=!1,N.getContext()._context.imageSmoothingEnabled=!1),O.save(),U.save(),V.save(),O.translate(-p,-m),U.translate(-p,-m),V.translate(-p,-m),j.x=p,j.y=m,this._isUnderCache=!0,this._clearSelfAndDescendantCache(D1),this._clearSelfAndDescendantCache(y5),this.drawScene(A,this,j),this.drawHit(R,this),this._isUnderCache=!1,O.restore(),U.restore(),b&&(O.save(),O.beginPath(),O.rect(0,0,u,c),O.closePath(),O.setAttr("strokeStyle","red"),O.setAttr("lineWidth",5),O.stroke(),O.restore()),this._cache.set(uc,{scene:A,filter:N,hit:R,buffer:j,x:p,y:m}),this._requestDraw(),this}isCached(){return this._cache.has(uc)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,i){const s=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}];let u=1/0,c=1/0,f=-1/0,p=-1/0;const m=this.getAbsoluteTransform(i);return s.forEach(function(S){const b=m.point(S);u===void 0&&(u=f=b.x,c=p=b.y),u=Math.min(u,b.x),c=Math.min(c,b.y),f=Math.max(f,b.x),p=Math.max(p,b.y)}),{x:u,y:c,width:f-u,height:p-c}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const i=this._getCanvasCache();t.translate(i.x,i.y);const s=this._getCachedSceneCanvas(),u=s.pixelRatio;t.drawImage(s._canvas,0,0,s.width/u,s.height/u),t.restore()}_drawCachedHitCanvas(t){const i=this._getCanvasCache(),s=i.hit;t.save(),t.translate(i.x,i.y),t.drawImage(s._canvas,0,0,s.width/s.pixelRatio,s.height/s.pixelRatio),t.restore()}_getCachedSceneCanvas(){let t=this.filters(),i=this._getCanvasCache(),s=i.scene,u=i.filter,c=u.getContext(),f,p,m,S;if(!t||t.length===0)return s;if(this._filterUpToDate)return u;let b=!0;for(let x=0;x<t.length;x++)if(typeof t[x]=="string"&&p5(),typeof t[x]!="string"||!p5()){b=!1;break}const _=s.pixelRatio;if(u.setSize(s.width/s.pixelRatio,s.height/s.pixelRatio),b){const x=t.join(" ");return c.save(),c.setAttr("filter",x),c.drawImage(s._canvas,0,0,s.getWidth()/_,s.getHeight()/_),c.restore(),this._filterUpToDate=!0,u}try{for(f=t.length,c.clear(),c.drawImage(s._canvas,0,0,s.getWidth()/_,s.getHeight()/_),p=c.getImageData(0,0,u.getWidth(),u.getHeight()),m=0;m<f;m++)S=t[m],typeof S=="string"&&(S=kT(S)),S.call(this,p),c.putImageData(p,0,0)}catch(x){k.error("Unable to apply filter. "+x.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,u}on(t,i){if(this._cache&&this._cache.delete(A1),arguments.length===3)return this._delegate.apply(this,arguments);const s=t.split(M1);for(let u=0;u<s.length;u++){const f=s[u].split("."),p=f[0],m=f[1]||"";this.eventListeners[p]||(this.eventListeners[p]=[]),this.eventListeners[p].push({name:m,handler:i})}return this}off(t,i){let s=(t||"").split(M1),u=s.length,c,f,p,m,S,b;if(this._cache&&this._cache.delete(A1),!t)for(f in this.eventListeners)this._off(f);for(c=0;c<u;c++)if(p=s[c],m=p.split("."),S=m[0],b=m[1],S)this.eventListeners[S]&&this._off(S,b,i);else for(f in this.eventListeners)this._off(f,b,i);return this}dispatchEvent(t){const i={target:this,type:t.type,evt:t};return this.fire(t.type,i),this}addEventListener(t,i){return this.on(t,function(s){i.call(this,s.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,i,s){const u=this;this.on(t,function(c){const f=c.target.findAncestors(i,!0,u);for(let p=0;p<f.length;p++)c=k.cloneObject(c),c.currentTarget=f[p],s.call(f[p],c)})}remove(){return this.isDragging()&&this.stopDrag(),Ne._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Mr),this._clearSelfAndDescendantCache(D1),this._clearSelfAndDescendantCache(y5),this._clearSelfAndDescendantCache(b5),this._clearSelfAndDescendantCache(_2),this._clearSelfAndDescendantCache(C2)}_remove(){this._clearCaches();const t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){const i="get"+k._capitalize(t);return k._isFunction(this[i])?this[i]():this.attrs[t]}getAncestors(){let t=this.getParent(),i=[];for(;t;)i.push(t),t=t.getParent();return i}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{let i,s;if(!t)return this;for(i in t)i!==WT&&(s=v5+k._capitalize(i),k._isFunction(this[s])?this[s](t[i]):this._setAttr(i,t[i]))}),this}isListening(){return this._getCache(C2,this._isListening)}_isListening(t){if(!this.listening())return!1;const s=this.getParent();return s&&s!==t&&this!==t?s._isListening(t):!0}isVisible(){return this._getCache(_2,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const s=this.getParent();return s&&s!==t&&this!==t?s._isVisible(t):!0}shouldDrawHit(t,i=!1){if(t)return this._isVisible(t)&&this._isListening(t);const s=this.getLayer();let u=!1;Ne._dragElements.forEach(f=>{f.dragStatus==="dragging"&&(f.node.nodeType==="Stage"||f.node.getLayer()===s)&&(u=!0)});const c=!i&&!Ot.hitOnDragEnabled&&(u||Ot.isTransforming());return this.isListening()&&this.isVisible()&&!c}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let t=this.getDepth(),i=this,s=0,u,c,f,p;function m(b){for(u=[],c=b.length,f=0;f<c;f++)p=b[f],s++,p.nodeType!==S5&&(u=u.concat(p.getChildren().slice())),p._id===i._id&&(f=c);u.length>0&&u[0].getDepth()<=t&&m(u)}const S=this.getStage();return i.nodeType!==lC&&S&&m(S.getChildren()),s}getDepth(){let t=0,i=this.parent;for(;i;)t++,i=i.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(jo),this._clearSelfAndDescendantCache(Mr)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;const i=t.getPointerPosition();if(!i)return null;const s=this.getAbsoluteTransform().copy();return s.invert(),s.point(i)}getAbsolutePosition(t){let i=!1,s=this.parent;for(;s;){if(s.isCached()){i=!0;break}s=s.parent}i&&!t&&(t=!0);const u=this.getAbsoluteTransform(t).getMatrix(),c=new Qi,f=this.offset();return c.m=u.slice(),c.translate(f.x,f.y),c.getTranslation()}setAbsolutePosition(t){const{x:i,y:s,...u}=this._clearTransform();this.attrs.x=i,this.attrs.y=s,this._clearCache(jo);const c=this._getAbsoluteTransform().copy();return c.invert(),c.translate(t.x,t.y),t={x:this.attrs.x+c.getTranslation().x,y:this.attrs.y+c.getTranslation().y},this._setTransform(u),this.setPosition({x:t.x,y:t.y}),this._clearCache(jo),this._clearSelfAndDescendantCache(Mr),this}_setTransform(t){let i;for(i in t)this.attrs[i]=t[i]}_clearTransform(){const t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){let i=t.x,s=t.y,u=this.x(),c=this.y();return i!==void 0&&(u+=i),s!==void 0&&(c+=s),this.setPosition({x:u,y:c}),this}_eachAncestorReverse(t,i){let s=[],u=this.getParent(),c,f;if(!(i&&i._id===this._id)){for(s.unshift(this);u&&(!i||u._id!==i._id);)s.unshift(u),u=u.parent;for(c=s.length,f=0;f<c;f++)t(s[f])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return k.warn("Node has no parent. moveToTop function is ignored."),!1;const t=this.index,i=this.parent.getChildren().length;return t<i-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return k.warn("Node has no parent. moveUp function is ignored."),!1;const t=this.index,i=this.parent.getChildren().length;return t<i-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return k.warn("Node has no parent. moveDown function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return k.warn("Node has no parent. moveToBottom function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return k.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&k.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const i=this.index;return this.parent.children.splice(i,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(D1,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let t=this.opacity();const i=this.getParent();return i&&!i._isUnderCache&&(t*=i.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){let t=this.getAttrs(),i,s,u,c,f;const p={attrs:{},className:this.getClassName()};for(i in t)s=t[i],f=k.isObject(s)&&!k._isPlainObject(s)&&!k._isArray(s),!f&&(u=typeof this[i]=="function"&&this[i],delete t[i],c=u?u.call(this):null,t[i]=s,c!==s&&(p.attrs[i]=s));return k._prepareToStringify(p)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,i,s){const u=[];i&&this._isMatch(t)&&u.push(this);let c=this.parent;for(;c;){if(c===s)return u;c._isMatch(t)&&u.push(c),c=c.parent}return u}isAncestorOf(t){return!1}findAncestor(t,i,s){return this.findAncestors(t,i,s)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);let i=t.replace(/ /g,"").split(","),s=i.length,u,c;for(u=0;u<s;u++)if(c=i[u],k.isValidSelector(c)||(k.warn('Selector "'+c+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),k.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),k.warn("Konva is awesome, right?")),c.charAt(0)==="#"){if(this.id()===c.slice(1))return!0}else if(c.charAt(0)==="."){if(this.hasName(c.slice(1)))return!0}else if(this.className===c||this.nodeType===c)return!0;return!1}getLayer(){const t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(b5,this._getStage)}_getStage(){const t=this.getParent();return t?t.getStage():null}fire(t,i={},s){return i.target=i.target||this,s?this._fireAndBubble(t,i):this._fire(t,i),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(Mr,this._getAbsoluteTransform)}_getAbsoluteTransform(t){let i;if(t)return i=new Qi,this._eachAncestorReverse(function(s){const u=s.transformsEnabled();u==="all"?i.multiply(s.getTransform()):u==="position"&&i.translate(s.x()-s.offsetX(),s.y()-s.offsetY())},t),i;{i=this._cache.get(Mr)||new Qi,this.parent?this.parent.getAbsoluteTransform().copyInto(i):i.reset();const s=this.transformsEnabled();if(s==="all")i.multiply(this.getTransform());else if(s==="position"){const u=this.attrs.x||0,c=this.attrs.y||0,f=this.attrs.offsetX||0,p=this.attrs.offsetY||0;i.translate(u-f,c-p)}return i.dirty=!1,i}}getAbsoluteScale(t){let i=this;for(;i;)i._isUnderCache&&(t=i),i=i.getParent();const u=this.getAbsoluteTransform(t).decompose();return{x:u.scaleX,y:u.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(jo,this._getTransform)}_getTransform(){var t,i;const s=this._cache.get(jo)||new Qi;s.reset();const u=this.x(),c=this.y(),f=Ot.getAngle(this.rotation()),p=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,m=(i=this.attrs.scaleY)!==null&&i!==void 0?i:1,S=this.attrs.skewX||0,b=this.attrs.skewY||0,_=this.attrs.offsetX||0,x=this.attrs.offsetY||0;return(u!==0||c!==0)&&s.translate(u,c),f!==0&&s.rotate(f),(S!==0||b!==0)&&s.skew(S,b),(p!==1||m!==1)&&s.scale(p,m),(_!==0||x!==0)&&s.translate(-1*_,-1*x),s.dirty=!1,s}clone(t){let i=k.cloneObject(this.attrs),s,u,c,f,p;for(s in t)i[s]=t[s];const m=new this.constructor(i);for(s in this.eventListeners)for(u=this.eventListeners[s],c=u.length,f=0;f<c;f++)p=u[f],p.name.indexOf($T)<0&&(m.eventListeners[s]||(m.eventListeners[s]=[]),m.eventListeners[s].push(p));return m}_toKonvaCanvas(t){t=t||{};const i=this.getClientRect(),s=this.getStage(),u=t.x!==void 0?t.x:Math.floor(i.x),c=t.y!==void 0?t.y:Math.floor(i.y),f=t.pixelRatio||1,p=new Vo({width:t.width||Math.ceil(i.width)||(s?s.width():0),height:t.height||Math.ceil(i.height)||(s?s.height():0),pixelRatio:f}),m=p.getContext(),S=new Vo({width:p.width/p.pixelRatio+Math.abs(u),height:p.height/p.pixelRatio+Math.abs(c),pixelRatio:p.pixelRatio});return t.imageSmoothingEnabled===!1&&(m._context.imageSmoothingEnabled=!1),m.save(),(u||c)&&m.translate(-1*u,-1*c),this.drawScene(p,void 0,S),m.restore(),p}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};const i=t.mimeType||null,s=t.quality||null,u=this._toKonvaCanvas(t).toDataURL(i,s);return t.callback&&t.callback(u),u}toImage(t){return new Promise((i,s)=>{try{const u=t?.callback;u&&delete t.callback,k._urlToImage(this.toDataURL(t),function(c){i(c),u?.(c)})}catch(u){s(u)}})}toBlob(t){return new Promise((i,s)=>{try{const u=t?.callback;u&&delete t.callback,this.toCanvas(t).toBlob(c=>{i(c),u?.(c)},t?.mimeType,t?.quality)}catch(u){s(u)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Ot.dragDistance}_off(t,i,s){let u=this.eventListeners[t],c,f,p;for(c=0;c<u.length;c++)if(f=u[c].name,p=u[c].handler,(f!=="konva"||i==="konva")&&(!i||f===i)&&(!s||s===p)){if(u.splice(c,1),u.length===0){delete this.eventListeners[t];break}c--}}_fireChangeEvent(t,i,s){this._fire(t+IT,{oldVal:i,newVal:s})}addName(t){if(!this.hasName(t)){const i=this.name(),s=i?i+" "+t:t;this.name(s)}return this}hasName(t){if(!t)return!1;const i=this.name();return i?(i||"").split(/\s/g).indexOf(t)!==-1:!1}removeName(t){const i=(this.name()||"").split(/\s/g),s=i.indexOf(t);return s!==-1&&(i.splice(s,1),this.name(i.join(" "))),this}setAttr(t,i){const s=this[v5+k._capitalize(t)];return k._isFunction(s)?s.call(this,i):this._setAttr(t,i),this}_requestDraw(){if(Ot.autoDrawEnabled){const t=this.getLayer()||this.getStage();t?.batchDraw()}}_setAttr(t,i){const s=this.attrs[t];s===i&&!k.isObject(i)||(i==null?delete this.attrs[t]:this.attrs[t]=i,this._shouldFireChangeEvents&&this._fireChangeEvent(t,s,i),this._requestDraw())}_setComponentAttr(t,i,s){let u;s!==void 0&&(u=this.attrs[t],u||(this.attrs[t]=this.getAttr(t)),this.attrs[t][i]=s,this._fireChangeEvent(t,u,s))}_fireAndBubble(t,i,s){i&&this.nodeType===S5&&(i.target=this);const u=[tC,eC,nC,aC,iC,sC];if(!(u.indexOf(t)!==-1&&(s&&(this===s||this.isAncestorOf&&this.isAncestorOf(s))||this.nodeType==="Stage"&&!s))){this._fire(t,i);const f=u.indexOf(t)!==-1&&s&&s.isAncestorOf&&s.isAncestorOf(this)&&!s.isAncestorOf(this.parent);(i&&!i.cancelBubble||!i)&&this.parent&&this.parent.isListening()&&!f&&(s&&s.parent?this._fireAndBubble.call(this.parent,t,i,s):this._fireAndBubble.call(this.parent,t,i))}}_getProtoListeners(t){var i,s,u;const c=(i=this._cache.get(A1))!==null&&i!==void 0?i:{};let f=c?.[t];if(f===void 0){f=[];let p=Object.getPrototypeOf(this);for(;p;){const m=(u=(s=p.eventListeners)===null||s===void 0?void 0:s[t])!==null&&u!==void 0?u:[];f.push(...m),p=Object.getPrototypeOf(p)}c[t]=f,this._cache.set(A1,c)}return f}_fire(t,i){i=i||{},i.currentTarget=this,i.type=t;const s=this._getProtoListeners(t);if(s)for(let c=0;c<s.length;c++)s[c].handler.call(this,i);const u=this.eventListeners[t];if(u)for(let c=0;c<u.length;c++)u[c].handler.call(this,i)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){const i=t?t.pointerId:void 0,s=this.getStage(),u=this.getAbsolutePosition();if(!s)return;const c=s._getPointerById(i)||s._changedPointerPositions[0]||u;Ne._dragElements.set(this._id,{node:this,startPointerPos:c,offset:{x:c.x-u.x,y:c.y-u.y},dragStatus:"ready",pointerId:i})}startDrag(t,i=!0){Ne._dragElements.has(this._id)||this._createDragElement(t);const s=Ne._dragElements.get(this._id);s.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},i)}_setDragPosition(t,i){const s=this.getStage()._getPointerById(i.pointerId);if(!s)return;let u={x:s.x-i.offset.x,y:s.y-i.offset.y};const c=this.dragBoundFunc();if(c!==void 0){const f=c.call(this,u,t);f?u=f:k.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==u.x||this._lastPos.y!==u.y)&&(this.setAbsolutePosition(u),this._requestDraw()),this._lastPos=u}stopDrag(t){const i=Ne._dragElements.get(this._id);i&&(i.dragStatus="stopped"),Ne._endDragBefore(t),Ne._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Ne._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){if(!(!(t.evt.button!==void 0)||Ot.dragButtons.indexOf(t.evt.button)>=0)||this.isDragging())return;let u=!1;Ne._dragElements.forEach(c=>{this.isAncestorOf(c.node)&&(u=!0)}),u||this._createDragElement(t)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const i=Ne._dragElements.get(this._id),s=i&&i.dragStatus==="dragging",u=i&&i.dragStatus==="ready";s?this.stopDrag():u&&Ne._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const i=this.getStage();if(!i)return!1;const s={x:-t.x,y:-t.y,width:i.width()+2*t.x,height:i.height()+2*t.y};return k.haveIntersection(s,this.getClientRect())}static create(t,i){return k._isString(t)&&(t=JSON.parse(t)),this._createNode(t,i)}static _createNode(t,i){let s=u5.prototype.getClassName.call(t),u=t.children,c,f,p;i&&(t.attrs.container=i),Ot[s]||(k.warn('Can not find a node with class name "'+s+'". Fallback to "Shape".'),s="Shape");const m=Ot[s];if(c=new m(t.attrs),u)for(f=u.length,p=0;p<f;p++)c.add(u5._createNode(u[p]));return c}};Nt.prototype.nodeType="Node",Nt.prototype._attrsAffectingSize=[],Nt.prototype.eventListeners={},Nt.prototype.on.call(Nt.prototype,rC,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(jo),this._clearSelfAndDescendantCache(Mr)}),Nt.prototype.on.call(Nt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(_2)}),Nt.prototype.on.call(Nt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(C2)}),Nt.prototype.on.call(Nt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(D1)});const Ke=G.addGetterSetter;Ke(Nt,"zIndex"),Ke(Nt,"absolutePosition"),Ke(Nt,"position"),Ke(Nt,"x",0,Dt()),Ke(Nt,"y",0,Dt()),Ke(Nt,"globalCompositeOperation","source-over",oc()),Ke(Nt,"opacity",1,Dt()),Ke(Nt,"name","",oc()),Ke(Nt,"id","",oc()),Ke(Nt,"rotation",0,Dt()),G.addComponentsGetterSetter(Nt,"scale",["x","y"]),Ke(Nt,"scaleX",1,Dt()),Ke(Nt,"scaleY",1,Dt()),G.addComponentsGetterSetter(Nt,"skew",["x","y"]),Ke(Nt,"skewX",0,Dt()),Ke(Nt,"skewY",0,Dt()),G.addComponentsGetterSetter(Nt,"offset",["x","y"]),Ke(Nt,"offsetX",0,Dt()),Ke(Nt,"offsetY",0,Dt()),Ke(Nt,"dragDistance",void 0,Dt()),Ke(Nt,"width",0,Dt()),Ke(Nt,"height",0,Dt()),Ke(Nt,"listening",!0,sl()),Ke(Nt,"preventDefault",!0,sl()),Ke(Nt,"filters",void 0,function(n){return this._filterUpToDate=!1,n}),Ke(Nt,"visible",!0,sl()),Ke(Nt,"transformsEnabled","all",oc()),Ke(Nt,"size"),Ke(Nt,"dragBoundFunc"),Ke(Nt,"draggable",!1,sl()),G.backCompat(Nt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class Zi extends Nt{constructor(){super(...arguments),this.children=[]}getChildren(t){const i=this.children||[];return t?i.filter(t):i}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(let s=0;s<t.length;s++)this.add(t[s]);return this}const i=t[0];return i.getParent()?(i.moveTo(this),this):(this._validateAdd(i),i.index=this.getChildren().length,i.parent=this,i._clearCaches(),this.getChildren().push(i),this._fire("add",{child:i}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){const i=this._generalFind(t,!0);return i.length>0?i[0]:void 0}_generalFind(t,i){const s=[];return this._descendants(u=>{const c=u._isMatch(t);return c&&s.push(u),!!(c&&i)}),s}_descendants(t){let i=!1;const s=this.getChildren();for(const u of s){if(i=t(u),i)return!0;if(u.hasChildren()&&(i=u._descendants(t),i))return!0}return!1}toObject(){const t=Nt.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(i=>{t.children.push(i.toObject())}),t}isAncestorOf(t){let i=t.getParent();for(;i;){if(i._id===this._id)return!0;i=i.getParent()}return!1}clone(t){const i=Nt.prototype.clone.call(this,t);return this.getChildren().forEach(function(s){i.add(s.clone())}),i}getAllIntersections(t){const i=[];return this.find("Shape").forEach(s=>{s.isVisible()&&s.intersects(t)&&i.push(s)}),i}_clearSelfAndDescendantCache(t){var i;super._clearSelfAndDescendantCache(t),!this.isCached()&&((i=this.children)===null||i===void 0||i.forEach(function(s){s._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(i,s){i.index=s}),this._requestDraw()}drawScene(t,i,s){const u=this.getLayer(),c=t||u&&u.getCanvas(),f=c&&c.getContext(),p=this._getCanvasCache(),m=p&&p.scene,S=c&&c.isCache;if(!this.isVisible()&&!S)return this;if(m){f.save();const b=this.getAbsoluteTransform(i).getMatrix();f.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(f),f.restore()}else this._drawChildren("drawScene",c,i,s);return this}drawHit(t,i){if(!this.shouldDrawHit(i))return this;const s=this.getLayer(),u=t||s&&s.hitCanvas,c=u&&u.getContext(),f=this._getCanvasCache();if(f&&f.hit){c.save();const m=this.getAbsoluteTransform(i).getMatrix();c.transform(m[0],m[1],m[2],m[3],m[4],m[5]),this._drawCachedHitCanvas(c),c.restore()}else this._drawChildren("drawHit",u,i);return this}_drawChildren(t,i,s,u){var c;const f=i&&i.getContext(),p=this.clipWidth(),m=this.clipHeight(),S=this.clipFunc(),b=typeof p=="number"&&typeof m=="number"||S,_=s===this;if(b){f.save();const D=this.getAbsoluteTransform(s);let A=D.getMatrix();f.transform(A[0],A[1],A[2],A[3],A[4],A[5]),f.beginPath();let N;if(S)N=S.call(this,f,this);else{const R=this.clipX(),O=this.clipY();f.rect(R||0,O||0,p,m)}f.clip.apply(f,N),A=D.copy().invert().getMatrix(),f.transform(A[0],A[1],A[2],A[3],A[4],A[5])}const x=!_&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";x&&(f.save(),f._applyGlobalCompositeOperation(this)),(c=this.children)===null||c===void 0||c.forEach(function(D){D[t](i,s,u)}),x&&f.restore(),b&&f.restore()}getClientRect(t={}){var i;const s=t.skipTransform,u=t.relativeTo;let c,f,p,m,S={x:1/0,y:1/0,width:0,height:0};const b=this;(i=this.children)===null||i===void 0||i.forEach(function(D){if(!D.visible())return;const A=D.getClientRect({relativeTo:b,skipShadow:t.skipShadow,skipStroke:t.skipStroke});A.width===0&&A.height===0||(c===void 0?(c=A.x,f=A.y,p=A.x+A.width,m=A.y+A.height):(c=Math.min(c,A.x),f=Math.min(f,A.y),p=Math.max(p,A.x+A.width),m=Math.max(m,A.y+A.height)))});const _=this.find("Shape");let x=!1;for(let D=0;D<_.length;D++)if(_[D]._isVisible(this)){x=!0;break}return x&&c!==void 0?S={x:c,y:f,width:p-c,height:m-f}:S={x:0,y:0,width:0,height:0},s?S:this._transformedRect(S,u)}}G.addComponentsGetterSetter(Zi,"clip",["x","y","width","height"]),G.addGetterSetter(Zi,"clipX",void 0,Dt()),G.addGetterSetter(Zi,"clipY",void 0,Dt()),G.addGetterSetter(Zi,"clipWidth",void 0,Dt()),G.addGetterSetter(Zi,"clipHeight",void 0,Dt()),G.addGetterSetter(Zi,"clipFunc");const Vp=new Map,E5=Ot._global.PointerEvent!==void 0;function x2(n){return Vp.get(n)}function D2(n){return{evt:n,pointerId:n.pointerId}}function T5(n,t){return Vp.get(n)===t}function C5(n,t){Gp(n),t.getStage()&&(Vp.set(n,t),E5&&t._fire("gotpointercapture",D2(new PointerEvent("gotpointercapture"))))}function Gp(n,t){const i=Vp.get(n);if(!i)return;const s=i.getStage();s&&s.content,Vp.delete(n),E5&&i._fire("lostpointercapture",D2(new PointerEvent("lostpointercapture")))}const uC="Stage",cC="string",_5="px",fC="mouseout",x5="mouseleave",D5="mouseover",A5="mouseenter",M5="mousemove",N5="mousedown",O5="mouseup",jp="pointermove",Lp="pointerdown",kf="pointerup",Pp="pointercancel",hC="lostpointercapture",N1="pointerout",Yp="pointerleave",O1="pointerover",R1="pointerenter",A2="contextmenu",R5="touchstart",z5="touchend",H5="touchmove",w5="touchcancel",M2="wheel",dC=5,pC=[[A5,"_pointerenter"],[N5,"_pointerdown"],[M5,"_pointermove"],[O5,"_pointerup"],[x5,"_pointerleave"],[R5,"_pointerdown"],[H5,"_pointermove"],[z5,"_pointerup"],[w5,"_pointercancel"],[D5,"_pointerover"],[M2,"_wheel"],[A2,"_contextmenu"],[Lp,"_pointerdown"],[jp,"_pointermove"],[kf,"_pointerup"],[Pp,"_pointercancel"],[Yp,"_pointerleave"],[hC,"_lostpointercapture"]],N2={mouse:{[N1]:fC,[Yp]:x5,[O1]:D5,[R1]:A5,[jp]:M5,[Lp]:N5,[kf]:O5,[Pp]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[N1]:"touchout",[Yp]:"touchleave",[O1]:"touchover",[R1]:"touchenter",[jp]:H5,[Lp]:R5,[kf]:z5,[Pp]:w5,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[N1]:N1,[Yp]:Yp,[O1]:O1,[R1]:R1,[jp]:jp,[Lp]:Lp,[kf]:kf,[Pp]:Pp,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},qp=n=>n.indexOf("pointer")>=0?"pointer":n.indexOf("touch")>=0?"touch":"mouse",If=n=>{const t=qp(n);if(t==="pointer")return Ot.pointerEventsEnabled&&N2.pointer;if(t==="touch")return N2.touch;if(t==="mouse")return N2.mouse};function U5(n={}){return(n.clipFunc||n.clipWidth||n.clipHeight)&&k.warn("Stage does not support clipping. Please use clip for Layers or Groups."),n}const mC="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",Xp=[];let z1=class extends Zi{constructor(t){super(U5(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Xp.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{U5(this.attrs)}),this._checkVisibility()}_validateAdd(t){const i=t.getType()==="Layer",s=t.getType()==="FastLayer";i||s||k.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===cC){let i;if(t.charAt(0)==="."){const s=t.slice(1);t=document.getElementsByClassName(s)[0]}else t.charAt(0)!=="#"?i=t:i=t.slice(1),t=document.getElementById(i);if(!t)throw"Can not find container in document with id "+i}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const t=this.children,i=t.length;for(let s=0;s<i;s++)t[s].clear();return this}clone(t){return t||(t={}),t.container=typeof document<"u"&&document.createElement("div"),Zi.prototype.clone.call(this,t)}destroy(){super.destroy();const t=this.content;t&&k._isInDocument(t)&&this.container().removeChild(t);const i=Xp.indexOf(this);return i>-1&&Xp.splice(i,1),k.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(k.warn(mC),null)}_getPointerById(t){return this._pointerPositions.find(i=>i.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t={...t},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();const i=new Vo({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),s=i.getContext()._context,u=this.children;return(t.x||t.y)&&s.translate(-1*t.x,-1*t.y),u.forEach(function(c){if(!c.isVisible())return;const f=c._toKonvaCanvas(t);s.drawImage(f._canvas,t.x,t.y,f.getWidth()/f.getPixelRatio(),f.getHeight()/f.getPixelRatio())}),i}getIntersection(t){if(!t)return null;const i=this.children,s=i.length,u=s-1;for(let c=u;c>=0;c--){const f=i[c].getIntersection(t);if(f)return f}return null}_resizeDOM(){const t=this.width(),i=this.height();this.content&&(this.content.style.width=t+_5,this.content.style.height=i+_5),this.bufferCanvas.setSize(t,i),this.bufferHitCanvas.setSize(t,i),this.children.forEach(s=>{s.setSize({width:t,height:i}),s.draw()})}add(t,...i){if(arguments.length>1){for(let u=0;u<arguments.length;u++)this.add(arguments[u]);return this}super.add(t);const s=this.children.length;return s>dC&&k.warn("The stage has "+s+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),Ot.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return T5(t,this)}setPointerCapture(t){C5(t,this)}releaseCapture(t){Gp(t)}getLayers(){return this.children}_bindContentEvents(){Ot.isBrowser&&pC.forEach(([t,i])=>{this.content.addEventListener(t,s=>{this[i](s)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const i=If(t.type);i&&this._fire(i.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const i=If(t.type);i&&this._fire(i.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let i=this[t+"targetShape"];return i&&!i.getStage()&&(i=null),i}_pointerleave(t){const i=If(t.type),s=qp(t.type);if(!i)return;this.setPointersPositions(t);const u=this._getTargetShape(s),c=!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled;u&&c?(u._fireAndBubble(i.pointerout,{evt:t}),u._fireAndBubble(i.pointerleave,{evt:t}),this._fire(i.pointerleave,{evt:t,target:this,currentTarget:this}),this[s+"targetShape"]=null):c&&(this._fire(i.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(i.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(t){const i=If(t.type),s=qp(t.type);if(!i)return;this.setPointersPositions(t);let u=!1;this._changedPointerPositions.forEach(c=>{const f=this.getIntersection(c);if(Ne.justDragged=!1,Ot["_"+s+"ListenClick"]=!0,!f||!f.isListening()){this[s+"ClickStartShape"]=void 0;return}Ot.capturePointerEventsEnabled&&f.setPointerCapture(c.id),this[s+"ClickStartShape"]=f,f._fireAndBubble(i.pointerdown,{evt:t,pointerId:c.id}),u=!0;const p=t.type.indexOf("touch")>=0;f.preventDefault()&&t.cancelable&&p&&t.preventDefault()}),u||this._fire(i.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(t){const i=If(t.type),s=qp(t.type);if(!i)return;const u=t.type.indexOf("touch")>=0||t.pointerType==="touch";if(Ot.isDragging()&&Ne.node.preventDefault()&&t.cancelable&&u&&t.preventDefault(),this.setPointersPositions(t),!(!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled))return;const f={};let p=!1;const m=this._getTargetShape(s);this._changedPointerPositions.forEach(S=>{const b=x2(S.id)||this.getIntersection(S),_=S.id,x={evt:t,pointerId:_},D=m!==b;if(D&&m&&(m._fireAndBubble(i.pointerout,{...x},b),m._fireAndBubble(i.pointerleave,{...x},b)),b){if(f[b._id])return;f[b._id]=!0}b&&b.isListening()?(p=!0,D&&(b._fireAndBubble(i.pointerover,{...x},m),b._fireAndBubble(i.pointerenter,{...x},m),this[s+"targetShape"]=b),b._fireAndBubble(i.pointermove,{...x})):m&&(this._fire(i.pointerover,{evt:t,target:this,currentTarget:this,pointerId:_}),this[s+"targetShape"]=null)}),p||this._fire(i.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const i=If(t.type),s=qp(t.type);if(!i)return;this.setPointersPositions(t);const u=this[s+"ClickStartShape"],c=this[s+"ClickEndShape"],f={};let p=!1;this._changedPointerPositions.forEach(m=>{const S=x2(m.id)||this.getIntersection(m);if(S){if(S.releaseCapture(m.id),f[S._id])return;f[S._id]=!0}const b=m.id,_={evt:t,pointerId:b};let x=!1;Ot["_"+s+"InDblClickWindow"]?(x=!0,clearTimeout(this[s+"DblTimeout"])):Ne.justDragged||(Ot["_"+s+"InDblClickWindow"]=!0,clearTimeout(this[s+"DblTimeout"])),this[s+"DblTimeout"]=setTimeout(function(){Ot["_"+s+"InDblClickWindow"]=!1},Ot.dblClickWindow),S&&S.isListening()?(p=!0,this[s+"ClickEndShape"]=S,S._fireAndBubble(i.pointerup,{..._}),Ot["_"+s+"ListenClick"]&&u&&u===S&&(S._fireAndBubble(i.pointerclick,{..._}),x&&c&&c===S&&S._fireAndBubble(i.pointerdblclick,{..._}))):(this[s+"ClickEndShape"]=null,p||(this._fire(i.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),p=!0),Ot["_"+s+"ListenClick"]&&this._fire(i.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:b}),x&&this._fire(i.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:b}))}),p||this._fire(i.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Ot["_"+s+"ListenClick"]=!1,t.cancelable&&s!=="touch"&&s!=="pointer"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);const i=this.getIntersection(this.getPointerPosition());i&&i.isListening()?i._fireAndBubble(A2,{evt:t}):this._fire(A2,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);const i=this.getIntersection(this.getPointerPosition());i&&i.isListening()?i._fireAndBubble(M2,{evt:t}):this._fire(M2,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const i=x2(t.pointerId)||this.getIntersection(this.getPointerPosition());i&&i._fireAndBubble(kf,D2(t)),Gp(t.pointerId)}_lostpointercapture(t){Gp(t.pointerId)}setPointersPositions(t){const i=this._getContentPosition();let s=null,u=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,c=>{this._pointerPositions.push({id:c.identifier,x:(c.clientX-i.left)/i.scaleX,y:(c.clientY-i.top)/i.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,c=>{this._changedPointerPositions.push({id:c.identifier,x:(c.clientX-i.left)/i.scaleX,y:(c.clientY-i.top)/i.scaleY})})):(s=(t.clientX-i.left)/i.scaleX,u=(t.clientY-i.top)/i.scaleY,this.pointerPos={x:s,y:u},this._pointerPositions=[{x:s,y:u,id:k._getFirstPointerId(t)}],this._changedPointerPositions=[{x:s,y:u,id:k._getFirstPointerId(t)}])}_setPointerPosition(t){k.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Vo({width:this.width(),height:this.height()}),this.bufferHitCanvas=new E2({pixelRatio:1,width:this.width(),height:this.height()}),!Ot.isBrowser)return;const t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}cache(){return k.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}};z1.prototype.nodeType=uC,En(z1),G.addGetterSetter(z1,"container"),Ot.isBrowser&&document.addEventListener("visibilitychange",()=>{Xp.forEach(n=>{n.batchDraw()})});const B5="hasShadow",V5="shadowRGBA",G5="patternImage",j5="linearGradient",L5="radialGradient";let H1;function O2(){return H1||(H1=k.createCanvasElement().getContext("2d"),H1)}const Kp={};function gC(n){const t=this.attrs.fillRule;t?n.fill(t):n.fill()}function yC(n){n.stroke()}function vC(n){const t=this.attrs.fillRule;t?n.fill(t):n.fill()}function SC(n){n.stroke()}function bC(){this._clearCache(B5)}function EC(){this._clearCache(V5)}function TC(){this._clearCache(G5)}function CC(){this._clearCache(j5)}function _C(){this._clearCache(L5)}class Ct extends Nt{constructor(t){super(t);let i,s=0;for(;i=k.getHitColor(),!(i&&!(i in Kp));)if(s++,s>=1e4){k.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),i=k.getRandomColor();break}this.colorKey=i,Kp[i]=this}getContext(){return k.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return k.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(B5,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(G5,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const i=O2().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(i&&i.setTransform){const s=new Qi;s.translate(this.fillPatternX(),this.fillPatternY()),s.rotate(Ot.getAngle(this.fillPatternRotation())),s.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),s.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const u=s.getMatrix(),c=typeof DOMMatrix>"u"?{a:u[0],b:u[1],c:u[2],d:u[3],e:u[4],f:u[5]}:new DOMMatrix(u);i.setTransform(c)}return i}}_getLinearGradient(){return this._getCache(j5,this.__getLinearGradient)}__getLinearGradient(){const t=this.fillLinearGradientColorStops();if(t){const i=O2(),s=this.fillLinearGradientStartPoint(),u=this.fillLinearGradientEndPoint(),c=i.createLinearGradient(s.x,s.y,u.x,u.y);for(let f=0;f<t.length;f+=2)c.addColorStop(t[f],t[f+1]);return c}}_getRadialGradient(){return this._getCache(L5,this.__getRadialGradient)}__getRadialGradient(){const t=this.fillRadialGradientColorStops();if(t){const i=O2(),s=this.fillRadialGradientStartPoint(),u=this.fillRadialGradientEndPoint(),c=i.createRadialGradient(s.x,s.y,this.fillRadialGradientStartRadius(),u.x,u.y,this.fillRadialGradientEndRadius());for(let f=0;f<t.length;f+=2)c.addColorStop(t[f],t[f+1]);return c}}getShadowRGBA(){return this._getCache(V5,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const t=k.colorToRGBA(this.shadowColor());if(t)return"rgba("+t.r+","+t.g+","+t.b+","+t.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){const i=this.getStage();if(!i)return!1;const s=i.bufferHitCanvas;return s.getContext().clear(),this.drawHit(s,void 0,!0),s.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data[3]>0}destroy(){return Nt.prototype.destroy.call(this),delete Kp[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var i;if(!((i=this.attrs.perfectDrawEnabled)!==null&&i!==void 0?i:!0))return!1;const u=t||this.hasFill(),c=this.hasStroke(),f=this.getAbsoluteOpacity()!==1;if(u&&c&&f)return!0;const p=this.hasShadow(),m=this.shadowForStrokeEnabled();return!!(u&&c&&p&&m)}setStrokeHitEnabled(t){k.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){let i=!1,s=this.getParent();for(;s;){if(s.isCached()){i=!0;break}s=s.getParent()}const u=t.skipTransform,c=t.relativeTo||i&&this.getStage()||void 0,f=this.getSelfRect(),m=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,S=f.width+m,b=f.height+m,_=!t.skipShadow&&this.hasShadow(),x=_?this.shadowOffsetX():0,D=_?this.shadowOffsetY():0,A=S+Math.abs(x),N=b+Math.abs(D),R=_&&this.shadowBlur()||0,O=A+R*2,U=N+R*2,j={width:O,height:U,x:-(m/2+R)+Math.min(x,0)+f.x,y:-(m/2+R)+Math.min(D,0)+f.y};return u?j:this._transformedRect(j,c)}drawScene(t,i,s){const u=this.getLayer(),c=t||u.getCanvas(),f=c.getContext(),p=this._getCanvasCache(),m=this.getSceneFunc(),S=this.hasShadow();let b;const _=i===this;if(!this.isVisible()&&!_)return this;if(p){f.save();const x=this.getAbsoluteTransform(i).getMatrix();return f.transform(x[0],x[1],x[2],x[3],x[4],x[5]),this._drawCachedSceneCanvas(f),f.restore(),this}if(!m)return this;if(f.save(),this._useBufferCanvas()){b=this.getStage();const x=s||b.bufferCanvas,D=x.getContext();D.clear(),D.save(),D._applyLineJoin(this),D._applyMiterLimit(this);const A=this.getAbsoluteTransform(i).getMatrix();D.transform(A[0],A[1],A[2],A[3],A[4],A[5]),m.call(this,D,this),D.restore();const N=x.pixelRatio;S&&f._applyShadow(this),_||(f._applyOpacity(this),f._applyGlobalCompositeOperation(this)),f.drawImage(x._canvas,x.x||0,x.y||0,x.width/N,x.height/N)}else{if(f._applyLineJoin(this),f._applyMiterLimit(this),!_){const x=this.getAbsoluteTransform(i).getMatrix();f.transform(x[0],x[1],x[2],x[3],x[4],x[5]),f._applyOpacity(this),f._applyGlobalCompositeOperation(this)}S&&f._applyShadow(this),m.call(this,f,this)}return f.restore(),this}drawHit(t,i,s=!1){if(!this.shouldDrawHit(i,s))return this;const u=this.getLayer(),c=t||u.hitCanvas,f=c&&c.getContext(),p=this.hitFunc()||this.sceneFunc(),m=this._getCanvasCache(),S=m&&m.hit;if(this.colorKey||k.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),S){f.save();const _=this.getAbsoluteTransform(i).getMatrix();return f.transform(_[0],_[1],_[2],_[3],_[4],_[5]),this._drawCachedHitCanvas(f),f.restore(),this}if(!p)return this;if(f.save(),f._applyLineJoin(this),f._applyMiterLimit(this),!(this===i)){const _=this.getAbsoluteTransform(i).getMatrix();f.transform(_[0],_[1],_[2],_[3],_[4],_[5])}return p.call(this,f,this),f.restore(),this}drawHitFromCache(t=0){const i=this._getCanvasCache(),s=this._getCachedSceneCanvas(),u=i.hit,c=u.getContext(),f=u.getWidth(),p=u.getHeight();c.clear(),c.drawImage(s._canvas,0,0,f,p);try{const m=c.getImageData(0,0,f,p),S=m.data,b=S.length,_=k._hexToRgb(this.colorKey);for(let x=0;x<b;x+=4)S[x+3]>t?(S[x]=_.r,S[x+1]=_.g,S[x+2]=_.b,S[x+3]=255):S[x+3]=0;c.putImageData(m,0,0)}catch(m){k.error("Unable to draw hit graph from cached scene canvas. "+m.message)}return this}hasPointerCapture(t){return T5(t,this)}setPointerCapture(t){C5(t,this)}releaseCapture(t){Gp(t)}}Ct.prototype._fillFunc=gC,Ct.prototype._strokeFunc=yC,Ct.prototype._fillFuncHit=vC,Ct.prototype._strokeFuncHit=SC,Ct.prototype._centroid=!1,Ct.prototype.nodeType="Shape",En(Ct),Ct.prototype.eventListeners={},Ct.prototype.on.call(Ct.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",bC),Ct.prototype.on.call(Ct.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",EC),Ct.prototype.on.call(Ct.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",TC),Ct.prototype.on.call(Ct.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",CC),Ct.prototype.on.call(Ct.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",_C),G.addGetterSetter(Ct,"stroke",void 0,g5()),G.addGetterSetter(Ct,"strokeWidth",2,Dt()),G.addGetterSetter(Ct,"fillAfterStrokeEnabled",!1),G.addGetterSetter(Ct,"hitStrokeWidth","auto",T2()),G.addGetterSetter(Ct,"strokeHitEnabled",!0,sl()),G.addGetterSetter(Ct,"perfectDrawEnabled",!0,sl()),G.addGetterSetter(Ct,"shadowForStrokeEnabled",!0,sl()),G.addGetterSetter(Ct,"lineJoin"),G.addGetterSetter(Ct,"lineCap"),G.addGetterSetter(Ct,"miterLimit"),G.addGetterSetter(Ct,"sceneFunc"),G.addGetterSetter(Ct,"hitFunc"),G.addGetterSetter(Ct,"dash"),G.addGetterSetter(Ct,"dashOffset",0,Dt()),G.addGetterSetter(Ct,"shadowColor",void 0,oc()),G.addGetterSetter(Ct,"shadowBlur",0,Dt()),G.addGetterSetter(Ct,"shadowOpacity",1,Dt()),G.addComponentsGetterSetter(Ct,"shadowOffset",["x","y"]),G.addGetterSetter(Ct,"shadowOffsetX",0,Dt()),G.addGetterSetter(Ct,"shadowOffsetY",0,Dt()),G.addGetterSetter(Ct,"fillPatternImage"),G.addGetterSetter(Ct,"fill",void 0,g5()),G.addGetterSetter(Ct,"fillPatternX",0,Dt()),G.addGetterSetter(Ct,"fillPatternY",0,Dt()),G.addGetterSetter(Ct,"fillLinearGradientColorStops"),G.addGetterSetter(Ct,"strokeLinearGradientColorStops"),G.addGetterSetter(Ct,"fillRadialGradientStartRadius",0),G.addGetterSetter(Ct,"fillRadialGradientEndRadius",0),G.addGetterSetter(Ct,"fillRadialGradientColorStops"),G.addGetterSetter(Ct,"fillPatternRepeat","repeat"),G.addGetterSetter(Ct,"fillEnabled",!0),G.addGetterSetter(Ct,"strokeEnabled",!0),G.addGetterSetter(Ct,"shadowEnabled",!0),G.addGetterSetter(Ct,"dashEnabled",!0),G.addGetterSetter(Ct,"strokeScaleEnabled",!0),G.addGetterSetter(Ct,"fillPriority","color"),G.addComponentsGetterSetter(Ct,"fillPatternOffset",["x","y"]),G.addGetterSetter(Ct,"fillPatternOffsetX",0,Dt()),G.addGetterSetter(Ct,"fillPatternOffsetY",0,Dt()),G.addComponentsGetterSetter(Ct,"fillPatternScale",["x","y"]),G.addGetterSetter(Ct,"fillPatternScaleX",1,Dt()),G.addGetterSetter(Ct,"fillPatternScaleY",1,Dt()),G.addComponentsGetterSetter(Ct,"fillLinearGradientStartPoint",["x","y"]),G.addComponentsGetterSetter(Ct,"strokeLinearGradientStartPoint",["x","y"]),G.addGetterSetter(Ct,"fillLinearGradientStartPointX",0),G.addGetterSetter(Ct,"strokeLinearGradientStartPointX",0),G.addGetterSetter(Ct,"fillLinearGradientStartPointY",0),G.addGetterSetter(Ct,"strokeLinearGradientStartPointY",0),G.addComponentsGetterSetter(Ct,"fillLinearGradientEndPoint",["x","y"]),G.addComponentsGetterSetter(Ct,"strokeLinearGradientEndPoint",["x","y"]),G.addGetterSetter(Ct,"fillLinearGradientEndPointX",0),G.addGetterSetter(Ct,"strokeLinearGradientEndPointX",0),G.addGetterSetter(Ct,"fillLinearGradientEndPointY",0),G.addGetterSetter(Ct,"strokeLinearGradientEndPointY",0),G.addComponentsGetterSetter(Ct,"fillRadialGradientStartPoint",["x","y"]),G.addGetterSetter(Ct,"fillRadialGradientStartPointX",0),G.addGetterSetter(Ct,"fillRadialGradientStartPointY",0),G.addComponentsGetterSetter(Ct,"fillRadialGradientEndPoint",["x","y"]),G.addGetterSetter(Ct,"fillRadialGradientEndPointX",0),G.addGetterSetter(Ct,"fillRadialGradientEndPointY",0),G.addGetterSetter(Ct,"fillPatternRotation",0),G.addGetterSetter(Ct,"fillRule",void 0,oc()),G.backCompat(Ct,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const xC="beforeDraw",DC="draw",P5=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],AC=P5.length;let cc=class extends Zi{constructor(t){super(t),this.canvas=new Vo,this.hitCanvas=new E2({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);const i=this.getStage();return i&&i.content&&(i.content.removeChild(this.getNativeCanvasElement()),t<i.children.length-1?i.content.insertBefore(this.getNativeCanvasElement(),i.children[t+1].getCanvas()._canvas):i.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Nt.prototype.moveToTop.call(this);const t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!Nt.prototype.moveUp.call(this))return!1;const i=this.getStage();return!i||!i.content?!1:(i.content.removeChild(this.getNativeCanvasElement()),this.index<i.children.length-1?i.content.insertBefore(this.getNativeCanvasElement(),i.children[this.index+1].getCanvas()._canvas):i.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Nt.prototype.moveDown.call(this)){const t=this.getStage();if(t){const i=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),i[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Nt.prototype.moveToBottom.call(this)){const t=this.getStage();if(t){const i=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),i[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const t=this.getNativeCanvasElement();return Nt.prototype.remove.call(this),t&&t.parentNode&&k._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:i}){return this.canvas.setSize(t,i),this.hitCanvas.setSize(t,i),this._setSmoothEnabled(),this}_validateAdd(t){const i=t.getType();i!=="Group"&&i!=="Shape"&&k.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t={...t},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),Nt.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){k.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){k.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,k.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;let i=1,s=!1;for(;;){for(let u=0;u<AC;u++){const c=P5[u],f=this._getIntersection({x:t.x+c.x*i,y:t.y+c.y*i}),p=f.shape;if(p)return p;if(s=!!f.antialiased,!f.antialiased)break}if(s)i+=1;else return null}}_getIntersection(t){const i=this.hitCanvas.pixelRatio,s=this.hitCanvas.context.getImageData(Math.round(t.x*i),Math.round(t.y*i),1,1).data,u=s[3];if(u===255){const c=k.getHitColorKey(s[0],s[1],s[2]),f=Kp[c];return f?{shape:f}:{antialiased:!0}}else if(u>0)return{antialiased:!0};return{}}drawScene(t,i,s){const u=this.getLayer(),c=t||u&&u.getCanvas();return this._fire(xC,{node:this}),this.clearBeforeDraw()&&c.getContext().clear(),Zi.prototype.drawScene.call(this,c,i,s),this._fire(DC,{node:this}),this}drawHit(t,i){const s=this.getLayer(),u=t||s&&s.hitCanvas;return s&&s.clearBeforeDraw()&&s.getHitCanvas().getContext().clear(),Zi.prototype.drawHit.call(this,u,i),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){k.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return k.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const t=this.parent;!!this.hitCanvas._canvas.parentNode?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}destroy(){return k.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};cc.prototype.nodeType="Layer",En(cc),G.addGetterSetter(cc,"imageSmoothingEnabled",!0),G.addGetterSetter(cc,"clearBeforeDraw",!0),G.addGetterSetter(cc,"hitGraphEnabled",!0,sl());class R2 extends cc{constructor(t){super(t),this.listening(!1),k.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}R2.prototype.nodeType="FastLayer",En(R2);let Wf=class extends Zi{_validateAdd(t){const i=t.getType();i!=="Group"&&i!=="Shape"&&k.throw("You may only add groups and shapes to groups.")}};Wf.prototype.nodeType="Group",En(Wf);const z2=(function(){return rc.performance&&rc.performance.now?function(){return rc.performance.now()}:function(){return new Date().getTime()}})();class Ss{constructor(t,i){this.id=Ss.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:z2(),frameRate:0},this.func=t,this.setLayers(i)}setLayers(t){let i=[];return t&&(i=Array.isArray(t)?t:[t]),this.layers=i,this}getLayers(){return this.layers}addLayer(t){const i=this.layers,s=i.length;for(let u=0;u<s;u++)if(i[u]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const i=Ss.animations,s=i.length;for(let u=0;u<s;u++)if(i[u].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=z2(),Ss._addAnimation(this),this}stop(){return Ss._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const i=t.id,s=this.animations,u=s.length;for(let c=0;c<u;c++)if(s[c].id===i){this.animations.splice(c,1);break}}static _runFrames(){const t={},i=this.animations;for(let s=0;s<i.length;s++){const u=i[s],c=u.layers,f=u.func;u._updateFrameObject(z2());const p=c.length;let m;if(f?m=f.call(u,u.frame)!==!1:m=!0,!!m)for(let S=0;S<p;S++){const b=c[S];b._id!==void 0&&(t[b._id]=b)}}for(const s in t)t.hasOwnProperty(s)&&t[s].batchDraw()}static _animationLoop(){const t=Ss;t.animations.length?(t._runFrames(),k.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,k.requestAnimFrame(this._animationLoop))}}Ss.animations=[],Ss.animIdCounter=0,Ss.animRunning=!1;const MC={node:1,duration:1,easing:1,onFinish:1,yoyo:1},NC=1,Y5=2,q5=3,X5=["fill","stroke","shadowColor"];let OC=0;class RC{constructor(t,i,s,u,c,f,p){this.prop=t,this.propFunc=i,this.begin=u,this._pos=u,this.duration=f,this._change=0,this.prevPos=0,this.yoyo=p,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=s,this._change=c-this.begin,this.pause()}fire(t){const i=this[t];i&&i()}setTime(t){t>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=Y5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=q5,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const t=this.getTimer()-this._startTime;this.state===Y5?this.setTime(t):this.state===q5&&this.setTime(this.duration-t)}pause(){this.state=NC,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Ze{constructor(t){const i=this,s=t.node,u=s._id,c=t.easing||Qp.Linear,f=!!t.yoyo;let p,m;typeof t.duration>"u"?p=.3:t.duration===0?p=.001:p=t.duration,this.node=s,this._id=OC++;const S=s.getLayer()||(s instanceof Ot.Stage?s.getLayers():null);S||k.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Ss(function(){i.tween.onEnterFrame()},S),this.tween=new RC(m,function(b){i._tweenFunc(b)},c,0,1,p*1e3,f),this._addListeners(),Ze.attrs[u]||(Ze.attrs[u]={}),Ze.attrs[u][this._id]||(Ze.attrs[u][this._id]={}),Ze.tweens[u]||(Ze.tweens[u]={});for(m in t)MC[m]===void 0&&this._addAttr(m,t[m]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,i){const s=this.node,u=s._id;let c,f,p,m,S;const b=Ze.tweens[u][t];b&&delete Ze.attrs[u][b][t];let _=s.getAttr(t);if(k._isArray(i))if(c=[],f=Math.max(i.length,_.length),t==="points"&&i.length!==_.length&&(i.length>_.length?(m=_,_=k._prepareArrayForTween(_,i,s.closed())):(p=i,i=k._prepareArrayForTween(i,_,s.closed()))),t.indexOf("fill")===0)for(let x=0;x<f;x++)if(x%2===0)c.push(i[x]-_[x]);else{const D=k.colorToRGBA(_[x]);S=k.colorToRGBA(i[x]),_[x]=D,c.push({r:S.r-D.r,g:S.g-D.g,b:S.b-D.b,a:S.a-D.a})}else for(let x=0;x<f;x++)c.push(i[x]-_[x]);else X5.indexOf(t)!==-1?(_=k.colorToRGBA(_),S=k.colorToRGBA(i),c={r:S.r-_.r,g:S.g-_.g,b:S.b-_.b,a:S.a-_.a}):c=i-_;Ze.attrs[u][this._id][t]={start:_,diff:c,end:i,trueEnd:p,trueStart:m},Ze.tweens[u][t]=this._id}_tweenFunc(t){const i=this.node,s=Ze.attrs[i._id][this._id];let u,c,f,p,m,S,b,_;for(u in s){if(c=s[u],f=c.start,p=c.diff,_=c.end,k._isArray(f))if(m=[],b=Math.max(f.length,_.length),u.indexOf("fill")===0)for(S=0;S<b;S++)S%2===0?m.push((f[S]||0)+p[S]*t):m.push("rgba("+Math.round(f[S].r+p[S].r*t)+","+Math.round(f[S].g+p[S].g*t)+","+Math.round(f[S].b+p[S].b*t)+","+(f[S].a+p[S].a*t)+")");else for(S=0;S<b;S++)m.push((f[S]||0)+p[S]*t);else X5.indexOf(u)!==-1?m="rgba("+Math.round(f.r+p.r*t)+","+Math.round(f.g+p.g*t)+","+Math.round(f.b+p.b*t)+","+(f.a+p.a*t)+")":m=f+p*t;i.setAttr(u,m)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const t=this.node,i=Ze.attrs[t._id][this._id];i.points&&i.points.trueEnd&&t.setAttr("points",i.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const t=this.node,i=Ze.attrs[t._id][this._id];i.points&&i.points.trueStart&&t.points(i.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const t=this.node._id,i=this._id,s=Ze.tweens[t];this.pause(),this.anim&&this.anim.stop();for(const u in s)delete Ze.tweens[t][u];delete Ze.attrs[t][i],Ze.tweens[t]&&(Object.keys(Ze.tweens[t]).length===0&&delete Ze.tweens[t],Object.keys(Ze.attrs[t]).length===0&&delete Ze.attrs[t])}}Ze.attrs={},Ze.tweens={},Nt.prototype.to=function(n){const t=n.onFinish;n.node=this,n.onFinish=function(){this.destroy(),t&&t()},new Ze(n).play()};const Qp={BackEaseIn(n,t,i,s){return i*(n/=s)*n*((1.70158+1)*n-1.70158)+t},BackEaseOut(n,t,i,s){return i*((n=n/s-1)*n*((1.70158+1)*n+1.70158)+1)+t},BackEaseInOut(n,t,i,s){let u=1.70158;return(n/=s/2)<1?i/2*(n*n*(((u*=1.525)+1)*n-u))+t:i/2*((n-=2)*n*(((u*=1.525)+1)*n+u)+2)+t},ElasticEaseIn(n,t,i,s,u,c){let f=0;return n===0?t:(n/=s)===1?t+i:(c||(c=s*.3),!u||u<Math.abs(i)?(u=i,f=c/4):f=c/(2*Math.PI)*Math.asin(i/u),-(u*Math.pow(2,10*(n-=1))*Math.sin((n*s-f)*(2*Math.PI)/c))+t)},ElasticEaseOut(n,t,i,s,u,c){let f=0;return n===0?t:(n/=s)===1?t+i:(c||(c=s*.3),!u||u<Math.abs(i)?(u=i,f=c/4):f=c/(2*Math.PI)*Math.asin(i/u),u*Math.pow(2,-10*n)*Math.sin((n*s-f)*(2*Math.PI)/c)+i+t)},ElasticEaseInOut(n,t,i,s,u,c){let f=0;return n===0?t:(n/=s/2)===2?t+i:(c||(c=s*(.3*1.5)),!u||u<Math.abs(i)?(u=i,f=c/4):f=c/(2*Math.PI)*Math.asin(i/u),n<1?-.5*(u*Math.pow(2,10*(n-=1))*Math.sin((n*s-f)*(2*Math.PI)/c))+t:u*Math.pow(2,-10*(n-=1))*Math.sin((n*s-f)*(2*Math.PI)/c)*.5+i+t)},BounceEaseOut(n,t,i,s){return(n/=s)<1/2.75?i*(7.5625*n*n)+t:n<2/2.75?i*(7.5625*(n-=1.5/2.75)*n+.75)+t:n<2.5/2.75?i*(7.5625*(n-=2.25/2.75)*n+.9375)+t:i*(7.5625*(n-=2.625/2.75)*n+.984375)+t},BounceEaseIn(n,t,i,s){return i-Qp.BounceEaseOut(s-n,0,i,s)+t},BounceEaseInOut(n,t,i,s){return n<s/2?Qp.BounceEaseIn(n*2,0,i,s)*.5+t:Qp.BounceEaseOut(n*2-s,0,i,s)*.5+i*.5+t},EaseIn(n,t,i,s){return i*(n/=s)*n+t},EaseOut(n,t,i,s){return-i*(n/=s)*(n-2)+t},EaseInOut(n,t,i,s){return(n/=s/2)<1?i/2*n*n+t:-i/2*(--n*(n-2)-1)+t},StrongEaseIn(n,t,i,s){return i*(n/=s)*n*n*n*n+t},StrongEaseOut(n,t,i,s){return i*((n=n/s-1)*n*n*n*n+1)+t},StrongEaseInOut(n,t,i,s){return(n/=s/2)<1?i/2*n*n*n*n*n+t:i/2*((n-=2)*n*n*n*n+2)+t},Linear(n,t,i,s){return i*n/s+t}},$f=k._assign(Ot,{Util:k,Transform:Qi,Node:Nt,Container:Zi,Stage:z1,stages:Xp,Layer:cc,FastLayer:R2,Group:Wf,DD:Ne,Shape:Ct,shapes:Kp,Animation:Ss,Tween:Ze,Easings:Qp,Context:C1,Canvas:b2});class Nr extends Ct{_sceneFunc(t){const i=Ot.getAngle(this.angle()),s=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,i,s),t.arc(0,0,this.innerRadius(),i,0,!s),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),i=this.outerRadius(),s=this.clockwise(),u=Ot.getAngle(s?360-this.angle():this.angle()),c=Math.cos(Math.min(u,Math.PI)),f=1,p=Math.sin(Math.min(Math.max(Math.PI,u),3*Math.PI/2)),m=Math.sin(Math.min(u,Math.PI/2)),S=c*(c>0?t:i),b=f*i,_=p*(p>0?t:i),x=m*(m>0?i:t);return{x:S,y:s?-1*x:_,width:b-S,height:x-_}}}Nr.prototype._centroid=!0,Nr.prototype.className="Arc",Nr.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],En(Nr),G.addGetterSetter(Nr,"innerRadius",0,Dt()),G.addGetterSetter(Nr,"outerRadius",0,Dt()),G.addGetterSetter(Nr,"angle",0,Dt()),G.addGetterSetter(Nr,"clockwise",!1,sl());function H2(n,t,i,s,u,c,f){const p=Math.sqrt(Math.pow(i-n,2)+Math.pow(s-t,2)),m=Math.sqrt(Math.pow(u-i,2)+Math.pow(c-s,2)),S=f*p/(p+m),b=f*m/(p+m),_=i-S*(u-n),x=s-S*(c-t),D=i+b*(u-n),A=s+b*(c-t);return[_,x,D,A]}function K5(n,t){const i=n.length,s=[];for(let u=2;u<i-2;u+=2){const c=H2(n[u-2],n[u-1],n[u],n[u+1],n[u+2],n[u+3],t);isNaN(c[0])||(s.push(c[0]),s.push(c[1]),s.push(n[u]),s.push(n[u+1]),s.push(c[2]),s.push(c[3]))}return s}let Or=class extends Ct{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){const i=this.points(),s=i.length,u=this.tension(),c=this.closed(),f=this.bezier();if(!s)return;let p=0;if(t.beginPath(),t.moveTo(i[0],i[1]),u!==0&&s>4){const m=this.getTensionPoints(),S=m.length;for(p=c?0:4,c||t.quadraticCurveTo(m[0],m[1],m[2],m[3]);p<S-2;)t.bezierCurveTo(m[p++],m[p++],m[p++],m[p++],m[p++],m[p++]);c||t.quadraticCurveTo(m[S-2],m[S-1],i[s-2],i[s-1])}else if(f)for(p=2;p<s;)t.bezierCurveTo(i[p++],i[p++],i[p++],i[p++],i[p++],i[p++]);else for(p=2;p<s;p+=2)t.lineTo(i[p],i[p+1]);c?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():K5(this.points(),this.tension())}_getTensionPointsClosed(){const t=this.points(),i=t.length,s=this.tension(),u=H2(t[i-2],t[i-1],t[0],t[1],t[2],t[3],s),c=H2(t[i-4],t[i-3],t[i-2],t[i-1],t[0],t[1],s),f=K5(t,s);return[u[2],u[3]].concat(f).concat([c[0],c[1],t[i-2],t[i-1],c[2],c[3],u[0],u[1],t[0],t[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();let i=t[0],s=t[0],u=t[1],c=t[1],f,p;for(let m=0;m<t.length/2;m++)f=t[m*2],p=t[m*2+1],i=Math.min(i,f),s=Math.max(s,f),u=Math.min(u,p),c=Math.max(c,p);return{x:i,y:u,width:s-i,height:c-u}}};Or.prototype.className="Line",Or.prototype._attrsAffectingSize=["points","bezier","tension"],En(Or),G.addGetterSetter(Or,"closed",!1),G.addGetterSetter(Or,"bezier",!1),G.addGetterSetter(Or,"tension",0,Dt()),G.addGetterSetter(Or,"points",[],JT());const zC=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],HC=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],wC=[[1],[1,1],[1,2,1],[1,3,3,1]],Q5=(n,t,i)=>{let s,u;const f=i/2;s=0;for(let p=0;p<20;p++)u=f*zC[20][p]+f,s+=HC[20][p]*UC(n,t,u);return f*s},Z5=(n,t,i)=>{i===void 0&&(i=1);const s=n[0]-2*n[1]+n[2],u=t[0]-2*t[1]+t[2],c=2*n[1]-2*n[0],f=2*t[1]-2*t[0],p=4*(s*s+u*u),m=4*(s*c+u*f),S=c*c+f*f;if(p===0)return i*Math.sqrt(Math.pow(n[2]-n[0],2)+Math.pow(t[2]-t[0],2));const b=m/(2*p),_=S/p,x=i+b,D=_-b*b,A=x*x+D>0?Math.sqrt(x*x+D):0,N=b*b+D>0?Math.sqrt(b*b+D):0,R=b+Math.sqrt(b*b+D)!==0?D*Math.log(Math.abs((x+A)/(b+N))):0;return Math.sqrt(p)/2*(x*A-b*N+R)};function UC(n,t,i){const s=w2(1,i,n),u=w2(1,i,t),c=s*s+u*u;return Math.sqrt(c)}const w2=(n,t,i)=>{const s=i.length-1;let u,c;if(s===0)return 0;if(n===0){c=0;for(let f=0;f<=s;f++)c+=wC[s][f]*Math.pow(1-t,s-f)*Math.pow(t,f)*i[f];return c}else{u=new Array(s);for(let f=0;f<s;f++)u[f]=s*(i[f+1]-i[f]);return w2(n-1,t,u)}},J5=(n,t,i)=>{let s=1,u=n/t,c=(n-i(u))/t,f=0;for(;s>.001;){const p=i(u+c),m=Math.abs(n-p)/t;if(m<s)s=m,u+=c;else{const S=i(u-c),b=Math.abs(n-S)/t;b<s?(s=b,u-=c):c/=2}if(f++,f>500)break}return u};let bs=class Ki extends Ct{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Ki.parsePathData(this.data()),this.pathLength=Ki.getPathLength(this.dataArray)}_sceneFunc(t){const i=this.dataArray;t.beginPath();let s=!1;for(let u=0;u<i.length;u++){const c=i[u].command,f=i[u].points;switch(c){case"L":t.lineTo(f[0],f[1]);break;case"M":t.moveTo(f[0],f[1]);break;case"C":t.bezierCurveTo(f[0],f[1],f[2],f[3],f[4],f[5]);break;case"Q":t.quadraticCurveTo(f[0],f[1],f[2],f[3]);break;case"A":const p=f[0],m=f[1],S=f[2],b=f[3],_=f[4],x=f[5],D=f[6],A=f[7],N=S>b?S:b,R=S>b?1:S/b,O=S>b?b/S:1;t.translate(p,m),t.rotate(D),t.scale(R,O),t.arc(0,0,N,_,_+x,1-A),t.scale(1/R,1/O),t.rotate(-D),t.translate(-p,-m);break;case"z":s=!0,t.closePath();break}}!s&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){let t=[];this.dataArray.forEach(function(m){if(m.command==="A"){const S=m.points[4],b=m.points[5],_=m.points[4]+b;let x=Math.PI/180;if(Math.abs(S-_)<x&&(x=Math.abs(S-_)),b<0)for(let D=S-x;D>_;D-=x){const A=Ki.getPointOnEllipticalArc(m.points[0],m.points[1],m.points[2],m.points[3],D,0);t.push(A.x,A.y)}else for(let D=S+x;D<_;D+=x){const A=Ki.getPointOnEllipticalArc(m.points[0],m.points[1],m.points[2],m.points[3],D,0);t.push(A.x,A.y)}}else if(m.command==="C")for(let S=0;S<=1;S+=.01){const b=Ki.getPointOnCubicBezier(S,m.start.x,m.start.y,m.points[0],m.points[1],m.points[2],m.points[3],m.points[4],m.points[5]);t.push(b.x,b.y)}else t=t.concat(m.points)});let i=t[0],s=t[0],u=t[1],c=t[1],f,p;for(let m=0;m<t.length/2;m++)f=t[m*2],p=t[m*2+1],isNaN(f)||(i=Math.min(i,f),s=Math.max(s,f)),isNaN(p)||(u=Math.min(u,p),c=Math.max(c,p));return{x:i,y:u,width:s-i,height:c-u}}getLength(){return this.pathLength}getPointAtLength(t){return Ki.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,i,s,u){return Math.sqrt((s-t)*(s-t)+(u-i)*(u-i))}static getPathLength(t){let i=0;for(let s=0;s<t.length;++s)i+=t[s].pathLength;return i}static getPointAtLengthOfDataArray(t,i){let s,u=0,c=i.length;if(!c)return null;for(;u<c&&t>i[u].pathLength;)t-=i[u].pathLength,++u;if(u===c)return s=i[u-1].points.slice(-2),{x:s[0],y:s[1]};if(t<.01)return i[u].command==="M"?(s=i[u].points.slice(0,2),{x:s[0],y:s[1]}):{x:i[u].start.x,y:i[u].start.y};const f=i[u],p=f.points;switch(f.command){case"L":return Ki.getPointOnLine(t,f.start.x,f.start.y,p[0],p[1]);case"C":return Ki.getPointOnCubicBezier(J5(t,Ki.getPathLength(i),N=>Q5([f.start.x,p[0],p[2],p[4]],[f.start.y,p[1],p[3],p[5]],N)),f.start.x,f.start.y,p[0],p[1],p[2],p[3],p[4],p[5]);case"Q":return Ki.getPointOnQuadraticBezier(J5(t,Ki.getPathLength(i),N=>Z5([f.start.x,p[0],p[2]],[f.start.y,p[1],p[3]],N)),f.start.x,f.start.y,p[0],p[1],p[2],p[3]);case"A":const m=p[0],S=p[1],b=p[2],_=p[3],x=p[5],D=p[6];let A=p[4];return A+=x*t/f.pathLength,Ki.getPointOnEllipticalArc(m,S,b,_,A,D)}return null}static getPointOnLine(t,i,s,u,c,f,p){f=f??i,p=p??s;const m=this.getLineLength(i,s,u,c);if(m<1e-10)return{x:i,y:s};if(u===i)return{x:f,y:p+(c>s?t:-t)};const S=(c-s)/(u-i),b=Math.sqrt(t*t/(1+S*S))*(u<i?-1:1),_=S*b;if(Math.abs(p-s-S*(f-i))<1e-10)return{x:f+b,y:p+_};const x=((f-i)*(u-i)+(p-s)*(c-s))/(m*m),D=i+x*(u-i),A=s+x*(c-s),N=this.getLineLength(f,p,D,A),R=Math.sqrt(t*t-N*N),O=Math.sqrt(R*R/(1+S*S))*(u<i?-1:1),U=S*O;return{x:D+O,y:A+U}}static getPointOnCubicBezier(t,i,s,u,c,f,p,m,S){function b(R){return R*R*R}function _(R){return 3*R*R*(1-R)}function x(R){return 3*R*(1-R)*(1-R)}function D(R){return(1-R)*(1-R)*(1-R)}const A=m*b(t)+f*_(t)+u*x(t)+i*D(t),N=S*b(t)+p*_(t)+c*x(t)+s*D(t);return{x:A,y:N}}static getPointOnQuadraticBezier(t,i,s,u,c,f,p){function m(D){return D*D}function S(D){return 2*D*(1-D)}function b(D){return(1-D)*(1-D)}const _=f*m(t)+u*S(t)+i*b(t),x=p*m(t)+c*S(t)+s*b(t);return{x:_,y:x}}static getPointOnEllipticalArc(t,i,s,u,c,f){const p=Math.cos(f),m=Math.sin(f),S={x:s*Math.cos(c),y:u*Math.sin(c)};return{x:t+(S.x*p-S.y*m),y:i+(S.x*m+S.y*p)}}static parsePathData(t){if(!t)return[];let i=t;const s=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];i=i.replace(new RegExp(" ","g"),",");for(let _=0;_<s.length;_++)i=i.replace(new RegExp(s[_],"g"),"|"+s[_]);const u=i.split("|"),c=[],f=[];let p=0,m=0;const S=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let b;for(let _=1;_<u.length;_++){let x=u[_],D=x.charAt(0);for(x=x.slice(1),f.length=0;b=S.exec(x);)f.push(b[0]);let A=[],N=D==="A"||D==="a"?0:-1;for(let R=0,O=f.length;R<O;R++){const U=f[R];if(U==="00"){A.push(0,0),N>=0&&(N+=2,N>=7&&(N-=7));continue}if(N>=0){if(N===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(U)){A.push(parseInt(U[0],10)),A.push(parseInt(U[1],10)),A.push(parseFloat(U.slice(2))),N+=3,N>=7&&(N-=7);continue}if(U==="11"||U==="10"||U==="01"){A.push(parseInt(U[0],10)),A.push(parseInt(U[1],10)),N+=2,N>=7&&(N-=7);continue}if(U==="0"||U==="1"){A.push(parseInt(U,10)),N+=1,N>=7&&(N-=7);continue}}else if(N===4){if(/^[01]\d+(?:\.\d+)?$/.test(U)){A.push(parseInt(U[0],10)),A.push(parseFloat(U.slice(1))),N+=2,N>=7&&(N-=7);continue}if(U==="0"||U==="1"){A.push(parseInt(U,10)),N+=1,N>=7&&(N-=7);continue}}const j=parseFloat(U);isNaN(j)?A.push(0):A.push(j),N+=1,N>=7&&(N-=7)}else{const j=parseFloat(U);isNaN(j)?A.push(0):A.push(j)}}for(;A.length>0&&!isNaN(A[0]);){let R="",O=[];const U=p,j=m;let V,J,$,st,I,et,nt,bt,rt,dt;switch(D){case"l":p+=A.shift(),m+=A.shift(),R="L",O.push(p,m);break;case"L":p=A.shift(),m=A.shift(),O.push(p,m);break;case"m":const pt=A.shift(),tt=A.shift();if(p+=pt,m+=tt,R="M",c.length>2&&c[c.length-1].command==="z"){for(let w=c.length-2;w>=0;w--)if(c[w].command==="M"){p=c[w].points[0]+pt,m=c[w].points[1]+tt;break}}O.push(p,m),D="l";break;case"M":p=A.shift(),m=A.shift(),R="M",O.push(p,m),D="L";break;case"h":p+=A.shift(),R="L",O.push(p,m);break;case"H":p=A.shift(),R="L",O.push(p,m);break;case"v":m+=A.shift(),R="L",O.push(p,m);break;case"V":m=A.shift(),R="L",O.push(p,m);break;case"C":O.push(A.shift(),A.shift(),A.shift(),A.shift()),p=A.shift(),m=A.shift(),O.push(p,m);break;case"c":O.push(p+A.shift(),m+A.shift(),p+A.shift(),m+A.shift()),p+=A.shift(),m+=A.shift(),R="C",O.push(p,m);break;case"S":J=p,$=m,V=c[c.length-1],V.command==="C"&&(J=p+(p-V.points[2]),$=m+(m-V.points[3])),O.push(J,$,A.shift(),A.shift()),p=A.shift(),m=A.shift(),R="C",O.push(p,m);break;case"s":J=p,$=m,V=c[c.length-1],V.command==="C"&&(J=p+(p-V.points[2]),$=m+(m-V.points[3])),O.push(J,$,p+A.shift(),m+A.shift()),p+=A.shift(),m+=A.shift(),R="C",O.push(p,m);break;case"Q":O.push(A.shift(),A.shift()),p=A.shift(),m=A.shift(),O.push(p,m);break;case"q":O.push(p+A.shift(),m+A.shift()),p+=A.shift(),m+=A.shift(),R="Q",O.push(p,m);break;case"T":J=p,$=m,V=c[c.length-1],V.command==="Q"&&(J=p+(p-V.points[0]),$=m+(m-V.points[1])),p=A.shift(),m=A.shift(),R="Q",O.push(J,$,p,m);break;case"t":J=p,$=m,V=c[c.length-1],V.command==="Q"&&(J=p+(p-V.points[0]),$=m+(m-V.points[1])),p+=A.shift(),m+=A.shift(),R="Q",O.push(J,$,p,m);break;case"A":st=A.shift(),I=A.shift(),et=A.shift(),nt=A.shift(),bt=A.shift(),rt=p,dt=m,p=A.shift(),m=A.shift(),R="A",O=this.convertEndpointToCenterParameterization(rt,dt,p,m,nt,bt,st,I,et);break;case"a":st=A.shift(),I=A.shift(),et=A.shift(),nt=A.shift(),bt=A.shift(),rt=p,dt=m,p+=A.shift(),m+=A.shift(),R="A",O=this.convertEndpointToCenterParameterization(rt,dt,p,m,nt,bt,st,I,et);break}c.push({command:R||D,points:O,start:{x:U,y:j},pathLength:this.calcLength(U,j,R||D,O)})}(D==="z"||D==="Z")&&c.push({command:"z",points:[],start:void 0,pathLength:0})}return c}static calcLength(t,i,s,u){let c,f,p,m;const S=Ki;switch(s){case"L":return S.getLineLength(t,i,u[0],u[1]);case"C":return Q5([t,u[0],u[2],u[4]],[i,u[1],u[3],u[5]],1);case"Q":return Z5([t,u[0],u[2]],[i,u[1],u[3]],1);case"A":c=0;const b=u[4],_=u[5],x=u[4]+_;let D=Math.PI/180;if(Math.abs(b-x)<D&&(D=Math.abs(b-x)),f=S.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],b,0),_<0)for(m=b-D;m>x;m-=D)p=S.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],m,0),c+=S.getLineLength(f.x,f.y,p.x,p.y),f=p;else for(m=b+D;m<x;m+=D)p=S.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],m,0),c+=S.getLineLength(f.x,f.y,p.x,p.y),f=p;return p=S.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],x,0),c+=S.getLineLength(f.x,f.y,p.x,p.y),c}return 0}static convertEndpointToCenterParameterization(t,i,s,u,c,f,p,m,S){const b=S*(Math.PI/180),_=Math.cos(b)*(t-s)/2+Math.sin(b)*(i-u)/2,x=-1*Math.sin(b)*(t-s)/2+Math.cos(b)*(i-u)/2,D=_*_/(p*p)+x*x/(m*m);D>1&&(p*=Math.sqrt(D),m*=Math.sqrt(D));let A=Math.sqrt((p*p*(m*m)-p*p*(x*x)-m*m*(_*_))/(p*p*(x*x)+m*m*(_*_)));c===f&&(A*=-1),isNaN(A)&&(A=0);const N=A*p*x/m,R=A*-m*_/p,O=(t+s)/2+Math.cos(b)*N-Math.sin(b)*R,U=(i+u)/2+Math.sin(b)*N+Math.cos(b)*R,j=function(nt){return Math.sqrt(nt[0]*nt[0]+nt[1]*nt[1])},V=function(nt,bt){return(nt[0]*bt[0]+nt[1]*bt[1])/(j(nt)*j(bt))},J=function(nt,bt){return(nt[0]*bt[1]<nt[1]*bt[0]?-1:1)*Math.acos(V(nt,bt))},$=J([1,0],[(_-N)/p,(x-R)/m]),st=[(_-N)/p,(x-R)/m],I=[(-1*_-N)/p,(-1*x-R)/m];let et=J(st,I);return V(st,I)<=-1&&(et=Math.PI),V(st,I)>=1&&(et=0),f===0&&et>0&&(et=et-2*Math.PI),f===1&&et<0&&(et=et+2*Math.PI),[O,U,p,m,$,et,b,f]}};bs.prototype.className="Path",bs.prototype._attrsAffectingSize=["data"],En(bs),G.addGetterSetter(bs,"data");class fc extends Or{_sceneFunc(t){super._sceneFunc(t);const i=Math.PI*2,s=this.points();let u=s;const c=this.tension()!==0&&s.length>4;c&&(u=this.getTensionPoints());const f=this.pointerLength(),p=s.length;let m,S;if(c){const x=[u[u.length-4],u[u.length-3],u[u.length-2],u[u.length-1],s[p-2],s[p-1]],D=bs.calcLength(u[u.length-4],u[u.length-3],"C",x),A=bs.getPointOnQuadraticBezier(Math.min(1,1-f/D),x[0],x[1],x[2],x[3],x[4],x[5]);m=s[p-2]-A.x,S=s[p-1]-A.y}else m=s[p-2]-s[p-4],S=s[p-1]-s[p-3];const b=(Math.atan2(S,m)+i)%i,_=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(s[p-2],s[p-1]),t.rotate(b),t.moveTo(0,0),t.lineTo(-f,_/2),t.lineTo(-f,-_/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(s[0],s[1]),c?(m=(u[0]+u[2])/2-s[0],S=(u[1]+u[3])/2-s[1]):(m=s[2]-s[0],S=s[3]-s[1]),t.rotate((Math.atan2(-S,-m)+i)%i),t.moveTo(0,0),t.lineTo(-f,_/2),t.lineTo(-f,-_/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){const i=this.dashEnabled();i&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),i&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),i=this.pointerWidth()/2;return{x:t.x,y:t.y-i,width:t.width,height:t.height+i*2}}}fc.prototype.className="Arrow",En(fc),G.addGetterSetter(fc,"pointerLength",10,Dt()),G.addGetterSetter(fc,"pointerWidth",10,Dt()),G.addGetterSetter(fc,"pointerAtBeginning",!1),G.addGetterSetter(fc,"pointerAtEnding",!0);let th=class extends Ct{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};th.prototype._centroid=!0,th.prototype.className="Circle",th.prototype._attrsAffectingSize=["radius"],En(th),G.addGetterSetter(th,"radius",0,Dt());class Lo extends Ct{_sceneFunc(t){const i=this.radiusX(),s=this.radiusY();t.beginPath(),t.save(),i!==s&&t.scale(1,s/i),t.arc(0,0,i,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}Lo.prototype.className="Ellipse",Lo.prototype._centroid=!0,Lo.prototype._attrsAffectingSize=["radiusX","radiusY"],En(Lo),G.addComponentsGetterSetter(Lo,"radius",["x","y"]),G.addGetterSetter(Lo,"radiusX",0,Dt()),G.addGetterSetter(Lo,"radiusY",0,Dt());let ll=class gT extends Ct{constructor(t){super(t),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",i=>{this._removeImageLoad(i.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",this._loadListener)}_removeImageLoad(t){t&&t.removeEventListener&&t.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const t=!!this.cornerRadius(),i=this.hasShadow();return t&&i?!0:super._useBufferCanvas(!0)}_sceneFunc(t){const i=this.getWidth(),s=this.getHeight(),u=this.cornerRadius(),c=this.attrs.image;let f;if(c){const p=this.attrs.cropWidth,m=this.attrs.cropHeight;p&&m?f=[c,this.cropX(),this.cropY(),p,m,0,0,i,s]:f=[c,0,0,i,s]}(this.hasFill()||this.hasStroke()||u)&&(t.beginPath(),u?k.drawRoundedRectPath(t,i,s,u):t.rect(0,0,i,s),t.closePath(),t.fillStrokeShape(this)),c&&(u&&t.clip(),t.drawImage.apply(t,f))}_hitFunc(t){const i=this.width(),s=this.height(),u=this.cornerRadius();t.beginPath(),u?k.drawRoundedRectPath(t,i,s,u):t.rect(0,0,i,s),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,i,s;return(s=(t=this.attrs.width)!==null&&t!==void 0?t:(i=this.image())===null||i===void 0?void 0:i.width)!==null&&s!==void 0?s:0}getHeight(){var t,i,s;return(s=(t=this.attrs.height)!==null&&t!==void 0?t:(i=this.image())===null||i===void 0?void 0:i.height)!==null&&s!==void 0?s:0}static fromURL(t,i,s=null){const u=k.createImageElement();u.onload=function(){const c=new gT({image:u});i(c)},u.onerror=s,u.crossOrigin="Anonymous",u.src=t}};ll.prototype.className="Image",ll.prototype._attrsAffectingSize=["image"],En(ll),G.addGetterSetter(ll,"cornerRadius",0,x1(4)),G.addGetterSetter(ll,"image"),G.addComponentsGetterSetter(ll,"crop",["x","y","width","height"]),G.addGetterSetter(ll,"cropX",0,Dt()),G.addGetterSetter(ll,"cropY",0,Dt()),G.addGetterSetter(ll,"cropWidth",0,Dt()),G.addGetterSetter(ll,"cropHeight",0,Dt());const F5=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],BC="Change.konva",VC="none",U2="up",B2="right",V2="down",G2="left",GC=F5.length;let j2=class extends Wf{constructor(t){super(t),this.on("add.konva",function(i){this._addListeners(i.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){let i=this,s;const u=function(){i._sync()};for(s=0;s<GC;s++)t.on(F5[s]+BC,u)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let t=this.getText(),i=this.getTag(),s,u,c,f,p,m,S;if(t&&i){switch(s=t.width(),u=t.height(),c=i.pointerDirection(),f=i.pointerWidth(),S=i.pointerHeight(),p=0,m=0,c){case U2:p=s/2,m=-1*S;break;case B2:p=s+f,m=u/2;break;case V2:p=s/2,m=u+S;break;case G2:p=-1*f,m=u/2;break}i.setAttrs({x:-1*p,y:-1*m,width:s,height:u}),t.setAttrs({x:-1*p,y:-1*m})}}};j2.prototype.className="Label",En(j2);class hc extends Ct{_sceneFunc(t){const i=this.width(),s=this.height(),u=this.pointerDirection(),c=this.pointerWidth(),f=this.pointerHeight(),p=this.cornerRadius();let m=0,S=0,b=0,_=0;typeof p=="number"?m=S=b=_=Math.min(p,i/2,s/2):(m=Math.min(p[0]||0,i/2,s/2),S=Math.min(p[1]||0,i/2,s/2),_=Math.min(p[2]||0,i/2,s/2),b=Math.min(p[3]||0,i/2,s/2)),t.beginPath(),t.moveTo(m,0),u===U2&&(t.lineTo((i-c)/2,0),t.lineTo(i/2,-1*f),t.lineTo((i+c)/2,0)),t.lineTo(i-S,0),t.arc(i-S,S,S,Math.PI*3/2,0,!1),u===B2&&(t.lineTo(i,(s-f)/2),t.lineTo(i+c,s/2),t.lineTo(i,(s+f)/2)),t.lineTo(i,s-_),t.arc(i-_,s-_,_,0,Math.PI/2,!1),u===V2&&(t.lineTo((i+c)/2,s),t.lineTo(i/2,s+f),t.lineTo((i-c)/2,s)),t.lineTo(b,s),t.arc(b,s-b,b,Math.PI/2,Math.PI,!1),u===G2&&(t.lineTo(0,(s+f)/2),t.lineTo(-1*c,s/2),t.lineTo(0,(s-f)/2)),t.lineTo(0,m),t.arc(m,m,m,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){let t=0,i=0,s=this.pointerWidth(),u=this.pointerHeight(),c=this.pointerDirection(),f=this.width(),p=this.height();return c===U2?(i-=u,p+=u):c===V2?p+=u:c===G2?(t-=s*1.5,f+=s):c===B2&&(f+=s*1.5),{x:t,y:i,width:f,height:p}}}hc.prototype.className="Tag",En(hc),G.addGetterSetter(hc,"pointerDirection",VC),G.addGetterSetter(hc,"pointerWidth",0,Dt()),G.addGetterSetter(hc,"pointerHeight",0,Dt()),G.addGetterSetter(hc,"cornerRadius",0,x1(4));let Zp=class extends Ct{_sceneFunc(t){const i=this.cornerRadius(),s=this.width(),u=this.height();t.beginPath(),i?k.drawRoundedRectPath(t,s,u,i):t.rect(0,0,s,u),t.closePath(),t.fillStrokeShape(this)}};Zp.prototype.className="Rect",En(Zp),G.addGetterSetter(Zp,"cornerRadius",0,x1(4));class Po extends Ct{_sceneFunc(t){const i=this._getPoints(),s=this.radius(),u=this.sides(),c=this.cornerRadius();if(t.beginPath(),c)k.drawRoundedPolygonPath(t,i,u,s,c);else{t.moveTo(i[0].x,i[0].y);for(let f=1;f<i.length;f++)t.lineTo(i[f].x,i[f].y)}t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,i=this.attrs.radius||0,s=[];for(let u=0;u<t;u++)s.push({x:i*Math.sin(u*2*Math.PI/t),y:-1*i*Math.cos(u*2*Math.PI/t)});return s}getSelfRect(){const t=this._getPoints();let i=t[0].x,s=t[0].x,u=t[0].y,c=t[0].y;return t.forEach(f=>{i=Math.min(i,f.x),s=Math.max(s,f.x),u=Math.min(u,f.y),c=Math.max(c,f.y)}),{x:i,y:u,width:s-i,height:c-u}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Po.prototype.className="RegularPolygon",Po.prototype._centroid=!0,Po.prototype._attrsAffectingSize=["radius"],En(Po),G.addGetterSetter(Po,"radius",0,Dt()),G.addGetterSetter(Po,"sides",0,Dt()),G.addGetterSetter(Po,"cornerRadius",0,x1(4));const k5=Math.PI*2;class dc extends Ct{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,k5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),k5,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}dc.prototype.className="Ring",dc.prototype._centroid=!0,dc.prototype._attrsAffectingSize=["innerRadius","outerRadius"],En(dc),G.addGetterSetter(dc,"innerRadius",0,Dt()),G.addGetterSetter(dc,"outerRadius",0,Dt());class Kl extends Ct{constructor(t){super(t),this._updated=!0,this.anim=new Ss(()=>{const i=this._updated;return this._updated=!1,i}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){const i=this.animation(),s=this.frameIndex(),u=s*4,c=this.animations()[i],f=this.frameOffsets(),p=c[u+0],m=c[u+1],S=c[u+2],b=c[u+3],_=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,S,b),t.closePath(),t.fillStrokeShape(this)),_)if(f){const x=f[i],D=s*2;t.drawImage(_,p,m,S,b,x[D+0],x[D+1],S,b)}else t.drawImage(_,p,m,S,b,0,0,S,b)}_hitFunc(t){const i=this.animation(),s=this.frameIndex(),u=s*4,c=this.animations()[i],f=this.frameOffsets(),p=c[u+2],m=c[u+3];if(t.beginPath(),f){const S=f[i],b=s*2;t.rect(S[b+0],S[b+1],p,m)}else t.rect(0,0,p,m);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const t=this.frameIndex(),i=this.animation(),s=this.animations(),u=s[i],c=u.length/4;t<c-1?this.frameIndex(t+1):this.frameIndex(0)}}Kl.prototype.className="Sprite",En(Kl),G.addGetterSetter(Kl,"animation"),G.addGetterSetter(Kl,"animations"),G.addGetterSetter(Kl,"frameOffsets"),G.addGetterSetter(Kl,"image"),G.addGetterSetter(Kl,"frameIndex",0,Dt()),G.addGetterSetter(Kl,"frameRate",17,Dt()),G.backCompat(Kl,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Yo extends Ct{_sceneFunc(t){const i=this.innerRadius(),s=this.outerRadius(),u=this.numPoints();t.beginPath(),t.moveTo(0,0-s);for(let c=1;c<u*2;c++){const f=c%2===0?s:i,p=f*Math.sin(c*Math.PI/u),m=-1*f*Math.cos(c*Math.PI/u);t.lineTo(p,m)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Yo.prototype.className="Star",Yo.prototype._centroid=!0,Yo.prototype._attrsAffectingSize=["innerRadius","outerRadius"],En(Yo),G.addGetterSetter(Yo,"numPoints",5,Dt()),G.addGetterSetter(Yo,"innerRadius",0,Dt()),G.addGetterSetter(Yo,"outerRadius",0,Dt());function qo(n){return[...n].reduce((t,i,s,u)=>{if(new RegExp("\\p{Emoji}","u").test(i)){const c=u[s+1];c&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(c)?(t.push(i+c),u[s+1]=""):t.push(i)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(i+(u[s+1]||""))?t.push(i+u[s+1]):s>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(i)?t[t.length-1]+=i:i&&t.push(i);return t},[])}const eh="auto",jC="center",I5="inherit",Jp="justify",LC="Change.konva",PC="2d",W5="-",$5="left",YC="text",qC="Text",XC="top",KC="bottom",t4="middle",e4="normal",QC="px ",w1=" ",ZC="right",n4="rtl",JC="word",FC="char",a4="none",L2="…",i4=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],kC=i4.length;function IC(n){return n.split(",").map(t=>{t=t.trim();const i=t.indexOf(" ")>=0,s=t.indexOf('"')>=0||t.indexOf("'")>=0;return i&&!s&&(t=`"${t}"`),t}).join(", ")}let U1;function P2(){return U1||(U1=k.createCanvasElement().getContext(PC),U1)}function WC(n){n.fillText(this._partialText,this._partialTextX,this._partialTextY)}function $C(n){n.setAttr("miterLimit",2),n.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function t_(n){return n=n||{},!n.fillLinearGradientColorStops&&!n.fillRadialGradientColorStops&&!n.fillPatternImage&&(n.fill=n.fill||"black"),n}class an extends Ct{constructor(t){super(t_(t)),this._partialTextX=0,this._partialTextY=0;for(let i=0;i<kC;i++)this.on(i4[i]+LC,this._setTextData);this._setTextData()}_sceneFunc(t){var i,s;const u=this.textArr,c=u.length;if(!this.text())return;let f=this.padding(),p=this.fontSize(),m=this.lineHeight()*p,S=this.verticalAlign(),b=this.direction(),_=0,x=this.align(),D=this.getWidth(),A=this.letterSpacing(),N=this.charRenderFunc(),R=this.fill(),O=this.textDecoration(),U=O.indexOf("underline")!==-1,j=O.indexOf("line-through")!==-1,V;b=b===I5?t.direction:b;let J=m/2,$=t4;if(!Ot.legacyTextRendering){const st=this.measureSize("M");$="alphabetic";const I=(i=st.fontBoundingBoxAscent)!==null&&i!==void 0?i:st.actualBoundingBoxAscent,et=(s=st.fontBoundingBoxDescent)!==null&&s!==void 0?s:st.actualBoundingBoxDescent;J=(I-et)/2+m/2}for(b===n4&&t.setAttr("direction",b),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",$),t.setAttr("textAlign",$5),S===t4?_=(this.getHeight()-c*m-f*2)/2:S===KC&&(_=this.getHeight()-c*m-f*2),t.translate(f,_+f),V=0;V<c;V++){let st=0,I=0;const et=u[V],nt=et.text,bt=et.width,rt=et.lastInParagraph;if(t.save(),x===ZC?st+=D-bt-f*2:x===jC&&(st+=(D-bt-f*2)/2),U){t.save(),t.beginPath();const pt=Ot.legacyTextRendering?Math.round(p/2):Math.round(p/4),tt=st,w=J+I+pt;t.moveTo(tt,w);const F=x===Jp&&!rt?D-f*2:bt;t.lineTo(tt+Math.round(F),w),t.lineWidth=p/15;const K=this._getLinearGradient();t.strokeStyle=K||R,t.stroke(),t.restore()}const dt=st;if(b!==n4&&(A!==0||x===Jp||N)){const pt=nt.split(" ").length-1,tt=qo(nt);for(let w=0;w<tt.length;w++){const F=tt[w];if(F===" "&&!rt&&x===Jp&&(st+=(D-f*2-bt)/pt),this._partialTextX=st,this._partialTextY=J+I,this._partialText=F,N){t.save();const at=u.slice(0,V).reduce((W,gt)=>W+qo(gt.text).length,0),St=w+at;N({char:F,index:St,x:st,y:J+I,lineIndex:V,column:w,isLastInLine:rt,width:this.measureSize(F).width,context:t})}t.fillStrokeShape(this),N&&t.restore(),st+=this.measureSize(F).width+A}}else A!==0&&t.setAttr("letterSpacing",`${A}px`),this._partialTextX=st,this._partialTextY=J+I,this._partialText=nt,t.fillStrokeShape(this);if(j){t.save(),t.beginPath();const pt=Ot.legacyTextRendering?0:-Math.round(p/4),tt=dt;t.moveTo(tt,J+I+pt);const w=x===Jp&&!rt?D-f*2:bt;t.lineTo(tt+Math.round(w),J+I+pt),t.lineWidth=p/15;const F=this._getLinearGradient();t.strokeStyle=F||R,t.stroke(),t.restore()}t.restore(),c>1&&(J+=m)}}_hitFunc(t){const i=this.getWidth(),s=this.getHeight();t.beginPath(),t.rect(0,0,i,s),t.closePath(),t.fillStrokeShape(this)}setText(t){const i=k._isString(t)?t:t==null?"":t+"";return this._setAttr(YC,i),this}getWidth(){return this.attrs.width===eh||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===eh||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return k.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var i,s,u,c,f,p,m,S,b,_,x;let D=P2(),A=this.fontSize(),N;D.save(),D.font=this._getContextFont(),N=D.measureText(t),D.restore();const R=A/100;return{actualBoundingBoxAscent:(i=N.actualBoundingBoxAscent)!==null&&i!==void 0?i:71.58203125*R,actualBoundingBoxDescent:(s=N.actualBoundingBoxDescent)!==null&&s!==void 0?s:0,actualBoundingBoxLeft:(u=N.actualBoundingBoxLeft)!==null&&u!==void 0?u:-7.421875*R,actualBoundingBoxRight:(c=N.actualBoundingBoxRight)!==null&&c!==void 0?c:75.732421875*R,alphabeticBaseline:(f=N.alphabeticBaseline)!==null&&f!==void 0?f:0,emHeightAscent:(p=N.emHeightAscent)!==null&&p!==void 0?p:100*R,emHeightDescent:(m=N.emHeightDescent)!==null&&m!==void 0?m:-20*R,fontBoundingBoxAscent:(S=N.fontBoundingBoxAscent)!==null&&S!==void 0?S:91*R,fontBoundingBoxDescent:(b=N.fontBoundingBoxDescent)!==null&&b!==void 0?b:21*R,hangingBaseline:(_=N.hangingBaseline)!==null&&_!==void 0?_:72.80000305175781*R,ideographicBaseline:(x=N.ideographicBaseline)!==null&&x!==void 0?x:-21*R,width:N.width,height:A}}_getContextFont(){return this.fontStyle()+w1+this.fontVariant()+w1+(this.fontSize()+QC)+IC(this.fontFamily())}_addTextLine(t){this.align()===Jp&&(t=t.trim());const s=this._getTextWidth(t);return this.textArr.push({text:t,width:s,lastInParagraph:!1})}_getTextWidth(t){const i=this.letterSpacing(),s=t.length;return P2().measureText(t).width+i*s}_setTextData(){let t=this.text().split(`
|
|
15
|
+
`),i=+this.fontSize(),s=0,u=this.lineHeight()*i,c=this.attrs.width,f=this.attrs.height,p=c!==eh&&c!==void 0,m=f!==eh&&f!==void 0,S=this.padding(),b=c-S*2,_=f-S*2,x=0,D=this.wrap(),A=D!==a4,N=D!==FC&&A,R=this.ellipsis();this.textArr=[],P2().font=this._getContextFont();const O=R?this._getTextWidth(L2):0;for(let U=0,j=t.length;U<j;++U){let V=t[U],J=this._getTextWidth(V);if(p&&J>b)for(;V.length>0;){let $=0,st=qo(V).length,I="",et=0;for(;$<st;){const nt=$+st>>>1,bt=qo(V),rt=bt.slice(0,nt+1).join(""),dt=this._getTextWidth(rt);(R&&m&&x+u>_?dt+O:dt)<=b?($=nt+1,I=rt,et=dt):st=nt}if(I){if(N){const rt=qo(V),dt=qo(I),pt=rt[dt.length],tt=pt===w1||pt===W5;let w;if(tt&&et<=b)w=dt.length;else{const F=dt.lastIndexOf(w1),K=dt.lastIndexOf(W5);w=Math.max(F,K)+1}w>0&&($=w,I=rt.slice(0,$).join(""),et=this._getTextWidth(I))}if(I=I.trimRight(),this._addTextLine(I),s=Math.max(s,et),x+=u,this._shouldHandleEllipsis(x)){this._tryToAddEllipsisToLastLine();break}if(V=qo(V).slice($).join("").trimLeft(),V.length>0&&(J=this._getTextWidth(V),J<=b)){this._addTextLine(V),x+=u,s=Math.max(s,J);break}}else break}else this._addTextLine(V),x+=u,s=Math.max(s,J),this._shouldHandleEllipsis(x)&&U<j-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),m&&x+u>_)break}this.textHeight=i,this.textWidth=s}_shouldHandleEllipsis(t){const i=+this.fontSize(),s=this.lineHeight()*i,u=this.attrs.height,c=u!==eh&&u!==void 0,f=this.padding(),p=u-f*2;return!(this.wrap()!==a4)||c&&t+s>p}_tryToAddEllipsisToLastLine(){const t=this.attrs.width,i=t!==eh&&t!==void 0,s=this.padding(),u=t-s*2,c=this.ellipsis(),f=this.textArr[this.textArr.length-1];!f||!c||(i&&(this._getTextWidth(f.text+L2)<u||(f.text=f.text.slice(0,f.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(f.text+L2))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,i=this.hasShadow();return t&&i?!0:super._useBufferCanvas()}}an.prototype._fillFunc=WC,an.prototype._strokeFunc=$C,an.prototype.className=qC,an.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],En(an),G.overWriteSetter(an,"width",T2()),G.overWriteSetter(an,"height",T2()),G.addGetterSetter(an,"direction",I5),G.addGetterSetter(an,"fontFamily","Arial"),G.addGetterSetter(an,"fontSize",12,Dt()),G.addGetterSetter(an,"fontStyle",e4),G.addGetterSetter(an,"fontVariant",e4),G.addGetterSetter(an,"padding",0,Dt()),G.addGetterSetter(an,"align",$5),G.addGetterSetter(an,"verticalAlign",XC),G.addGetterSetter(an,"lineHeight",1,Dt()),G.addGetterSetter(an,"wrap",JC),G.addGetterSetter(an,"ellipsis",!1,sl()),G.addGetterSetter(an,"letterSpacing",0,Dt()),G.addGetterSetter(an,"text","",oc()),G.addGetterSetter(an,"textDecoration",""),G.addGetterSetter(an,"charRenderFunc",void 0);const e_="",s4="normal";function l4(n){n.fillText(this.partialText,0,0)}function r4(n){n.strokeText(this.partialText,0,0)}class ca extends Ct{constructor(t){super(t),this.dummyCanvas=k.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return bs.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const i=this.pathLength;return t>i?null:bs.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=bs.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();const i=this.textDecoration(),s=this.fill(),u=this.fontSize(),c=this.glyphInfo,f=i.indexOf("underline")!==-1,p=i.indexOf("line-through")!==-1;f&&t.beginPath();for(let m=0;m<c.length;m++){t.save();const S=c[m].p0;t.translate(S.x,S.y),t.rotate(c[m].rotation),this.partialText=c[m].text,t.fillStrokeShape(this),f&&(m===0&&t.moveTo(0,u/2+1),t.lineTo(c[m].width,u/2+1)),t.restore()}if(f&&(t.strokeStyle=s,t.lineWidth=u/20,t.stroke()),p){t.beginPath();for(let m=0;m<c.length;m++){t.save();const S=c[m].p0;t.translate(S.x,S.y),t.rotate(c[m].rotation),m===0&&t.moveTo(0,0),t.lineTo(c[m].width,0),t.restore()}t.strokeStyle=s,t.lineWidth=u/20,t.stroke()}t.restore()}_hitFunc(t){t.beginPath();const i=this.glyphInfo;if(i.length>=1){const s=i[0].p0;t.moveTo(s.x,s.y)}for(let s=0;s<i.length;s++){const u=i[s].p1;t.lineTo(u.x,u.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return k.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return an.prototype.setText.call(this,t)}_getContextFont(){return an.prototype._getContextFont.call(this)}_getTextSize(t){const s=this.dummyCanvas.getContext("2d");s.save(),s.font=this._getContextFont();const u=s.measureText(t);return s.restore(),{width:u.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const t=qo(this.text()),i=[];let s=0;for(let _=0;_<t.length;_++)i.push({char:t[_],width:this._getTextSize(t[_]).width}),s+=i[_].width;const{height:u}=this._getTextSize(this.attrs.text);if(this.textWidth=s,this.textHeight=u,this.glyphInfo=[],!this.attrs.data)return null;const c=this.letterSpacing(),f=this.align(),p=this.kerningFunc(),m=Math.max(this.textWidth+((this.attrs.text||"").length-1)*c,0);let S=0;f==="center"&&(S=Math.max(0,this.pathLength/2-m/2)),f==="right"&&(S=Math.max(0,this.pathLength-m));let b=S;for(let _=0;_<i.length;_++){const x=this._getPointAtLength(b);if(!x)return;const D=i[_].char;let A=i[_].width+c;if(D===" "&&f==="justify"){const V=this.text().split(" ").length-1;A+=(this.pathLength-m)/V}const N=this._getPointAtLength(b+A);if(!N)return;const R=bs.getLineLength(x.x,x.y,N.x,N.y);let O=0;if(p)try{O=p(i[_-1].char,D)*this.fontSize()}catch{O=0}x.x+=O,N.x+=O,this.textWidth+=O;const U=bs.getPointOnLine(O+R/2,x.x,x.y,N.x,N.y),j=Math.atan2(N.y-x.y,N.x-x.x);this.glyphInfo.push({transposeX:U.x,transposeY:U.y,text:t[_],rotation:j,p0:x,p1:N,width:R}),b+=A}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const t=[];this.glyphInfo.forEach(function(S){t.push(S.p0.x),t.push(S.p0.y),t.push(S.p1.x),t.push(S.p1.y)});let i=t[0]||0,s=t[0]||0,u=t[1]||0,c=t[1]||0,f,p;for(let S=0;S<t.length/2;S++)f=t[S*2],p=t[S*2+1],i=Math.min(i,f),s=Math.max(s,f),u=Math.min(u,p),c=Math.max(c,p);const m=this.fontSize();return{x:i-m/2,y:u-m/2,width:s-i+m,height:c-u+m}}destroy(){return k.releaseCanvas(this.dummyCanvas),super.destroy()}}ca.prototype._fillFunc=l4,ca.prototype._strokeFunc=r4,ca.prototype._fillFuncHit=l4,ca.prototype._strokeFuncHit=r4,ca.prototype.className="TextPath",ca.prototype._attrsAffectingSize=["text","fontSize","data"],En(ca),G.addGetterSetter(ca,"data"),G.addGetterSetter(ca,"fontFamily","Arial"),G.addGetterSetter(ca,"fontSize",12,Dt()),G.addGetterSetter(ca,"fontStyle",s4),G.addGetterSetter(ca,"align","left"),G.addGetterSetter(ca,"letterSpacing",0,Dt()),G.addGetterSetter(ca,"textBaseline","middle"),G.addGetterSetter(ca,"fontVariant",s4),G.addGetterSetter(ca,"text",e_),G.addGetterSetter(ca,"textDecoration",""),G.addGetterSetter(ca,"kerningFunc",void 0);const o4="tr-konva",n_=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(n=>n+`.${o4}`).join(" "),u4="nodesRect",a_=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],i_={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},s_="ontouchstart"in Ot._global;function l_(n,t,i){if(n==="rotater")return i;t+=k.degToRad(i_[n]||0);const s=(k.radToDeg(t)%360+360)%360;return k._inRange(s,315+22.5,360)||k._inRange(s,0,22.5)?"ns-resize":k._inRange(s,45-22.5,45+22.5)?"nesw-resize":k._inRange(s,90-22.5,90+22.5)?"ew-resize":k._inRange(s,135-22.5,135+22.5)?"nwse-resize":k._inRange(s,180-22.5,180+22.5)?"ns-resize":k._inRange(s,225-22.5,225+22.5)?"nesw-resize":k._inRange(s,270-22.5,270+22.5)?"ew-resize":k._inRange(s,315-22.5,315+22.5)?"nwse-resize":(k.error("Transformer has unknown angle for cursor detection: "+s),"pointer")}const B1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function r_(n){return{x:n.x+n.width/2*Math.cos(n.rotation)+n.height/2*Math.sin(-n.rotation),y:n.y+n.height/2*Math.cos(n.rotation)+n.width/2*Math.sin(n.rotation)}}function c4(n,t,i){const s=i.x+(n.x-i.x)*Math.cos(t)-(n.y-i.y)*Math.sin(t),u=i.y+(n.x-i.x)*Math.sin(t)+(n.y-i.y)*Math.cos(t);return{...n,rotation:n.rotation+t,x:s,y:u}}function o_(n,t){const i=r_(n);return c4(n,t,i)}function u_(n,t,i){let s=t;for(let u=0;u<n.length;u++){const c=Ot.getAngle(n[u]),f=Math.abs(c-t)%(Math.PI*2);Math.min(f,Math.PI*2-f)<i&&(s=c)}return s}let Y2=0;class ve extends Wf{constructor(t){super(t),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(n_,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return k.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return o4+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const i=t.filter(u=>u.isAncestorOf(this)?(k.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=t=i,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(u=>{const c=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(u._attrsAffectingSize.length){const f=u._attrsAffectingSize.map(p=>p+"Change."+this._getEventNamespace()).join(" ");u.on(f,c)}u.on(a_.map(f=>f+`.${this._getEventNamespace()}`).join(" "),c),u.on(`absoluteTransformChange.${this._getEventNamespace()}`,c),this._proxyDrag(u)}),this._resetTransformCache(),this.findOne(".top-left")&&this.update(),this}_proxyDrag(t){let i;t.on(`dragstart.${this._getEventNamespace()}`,s=>{i=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(s,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,s=>{if(!i)return;const u=t.getAbsolutePosition(),c=u.x-i.x,f=u.y-i.y;this.nodes().forEach(p=>{if(p===t||p.isDragging())return;const m=p.getAbsolutePosition();p.setAbsolutePosition({x:m.x+c,y:m.y+f}),p.startDrag(s)}),i=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(u4),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(u4,this.__getNodeRect)}__getNodeShape(t,i=this.rotation(),s){const u=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),c=t.getAbsoluteScale(s),f=t.getAbsolutePosition(s),p=u.x*c.x-t.offsetX()*c.x,m=u.y*c.y-t.offsetY()*c.y,S=(Ot.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),b={x:f.x+p*Math.cos(S)+m*Math.sin(-S),y:f.y+m*Math.cos(S)+p*Math.sin(S),width:u.width*c.x,height:u.height*c.y,rotation:S};return c4(b,-Ot.getAngle(i),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const i=[];this.nodes().map(S=>{const b=S.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),_=[{x:b.x,y:b.y},{x:b.x+b.width,y:b.y},{x:b.x+b.width,y:b.y+b.height},{x:b.x,y:b.y+b.height}],x=S.getAbsoluteTransform();_.forEach(function(D){const A=x.point(D);i.push(A)})});const s=new Qi;s.rotate(-Ot.getAngle(this.rotation()));let u=1/0,c=1/0,f=-1/0,p=-1/0;i.forEach(function(S){const b=s.point(S);u===void 0&&(u=f=b.x,c=p=b.y),u=Math.min(u,b.x),c=Math.min(c,b.y),f=Math.max(f,b.x),p=Math.max(p,b.y)}),s.invert();const m=s.point({x:u,y:c});return{x:m.x,y:m.y,width:f-u,height:p-c,rotation:Ot.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),B1.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){const i=new Zp({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:s_?10:"auto"}),s=this;i.on("mousedown touchstart",function(u){s._handleMouseDown(u)}),i.on("dragstart",u=>{i.stopDrag(),u.cancelBubble=!0}),i.on("dragend",u=>{u.cancelBubble=!0}),i.on("mouseenter",()=>{const u=Ot.getAngle(this.rotation()),c=this.rotateAnchorCursor(),f=l_(t,u,c);i.getStage().content&&(i.getStage().content.style.cursor=f),this._cursorChange=!0}),i.on("mouseout",()=>{i.getStage().content&&(i.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(i)}_createBack(){const t=new Ct({name:"back",width:0,height:0,sceneFunc(i,s){const u=s.getParent(),c=u.padding();i.beginPath(),i.rect(-c,-c,s.width()+c*2,s.height()+c*2),i.moveTo(s.width()/2,-c),u.rotateEnabled()&&u.rotateLineVisible()&&i.lineTo(s.width()/2,-u.rotateAnchorOffset()*k._sign(s.height())-c),i.fillStrokeShape(s)},hitFunc:(i,s)=>{if(!this.shouldOverdrawWholeArea())return;const u=this.padding();i.beginPath(),i.rect(-u,-u,s.width()+u*2,s.height()+u*2),i.fillStrokeShape(s)}});this.add(t),this._proxyDrag(t),t.on("dragstart",i=>{i.cancelBubble=!0}),t.on("dragmove",i=>{i.cancelBubble=!0}),t.on("dragend",i=>{i.cancelBubble=!0}),this.on("dragmove",i=>{this.update()})}_handleMouseDown(t){if(this._transforming)return;this._movingAnchorName=t.target.name().split(" ")[0];const i=this._getNodeRect(),s=i.width,u=i.height,c=Math.sqrt(Math.pow(s,2)+Math.pow(u,2));this.sin=Math.abs(u/c),this.cos=Math.abs(s/c),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const f=t.target.getAbsolutePosition(),p=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:p.x-f.x,y:p.y-f.y},Y2++,this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(m=>{m._fire("transformstart",{evt:t.evt,target:m})})}_handleMouseMove(t){let i,s,u;const c=this.findOne("."+this._movingAnchorName),f=c.getStage();f.setPointersPositions(t);const p=f.getPointerPosition();let m={x:p.x-this._anchorDragOffset.x,y:p.y-this._anchorDragOffset.y};const S=c.getAbsolutePosition();this.anchorDragBoundFunc()&&(m=this.anchorDragBoundFunc()(S,m,t)),c.setAbsolutePosition(m);const b=c.getAbsolutePosition();if(S.x===b.x&&S.y===b.y)return;if(this._movingAnchorName==="rotater"){const U=this._getNodeRect();i=c.x()-U.width/2,s=-c.y()+U.height/2;let j=Math.atan2(-s,i)+Math.PI/2;U.height<0&&(j-=Math.PI);const J=Ot.getAngle(this.rotation())+j,$=Ot.getAngle(this.rotationSnapTolerance()),I=u_(this.rotationSnaps(),J,$)-U.rotation,et=o_(U,I);this._fitNodesInto(et,t);return}const _=this.shiftBehavior();let x;_==="inverted"?x=this.keepRatio()&&!t.shiftKey:_==="none"?x=this.keepRatio():x=this.keepRatio()||t.shiftKey;let D=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(x){const U=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};u=Math.sqrt(Math.pow(U.x-c.x(),2)+Math.pow(U.y-c.y(),2));const j=this.findOne(".top-left").x()>U.x?-1:1,V=this.findOne(".top-left").y()>U.y?-1:1;i=u*this.cos*j,s=u*this.sin*V,this.findOne(".top-left").x(U.x-i),this.findOne(".top-left").y(U.y-s)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(c.y());else if(this._movingAnchorName==="top-right"){if(x){const U=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};u=Math.sqrt(Math.pow(c.x()-U.x,2)+Math.pow(U.y-c.y(),2));const j=this.findOne(".top-right").x()<U.x?-1:1,V=this.findOne(".top-right").y()>U.y?-1:1;i=u*this.cos*j,s=u*this.sin*V,this.findOne(".top-right").x(U.x+i),this.findOne(".top-right").y(U.y-s)}var A=c.position();this.findOne(".top-left").y(A.y),this.findOne(".bottom-right").x(A.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(c.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(c.x());else if(this._movingAnchorName==="bottom-left"){if(x){const U=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};u=Math.sqrt(Math.pow(U.x-c.x(),2)+Math.pow(c.y()-U.y,2));const j=U.x<c.x()?-1:1,V=c.y()<U.y?-1:1;i=u*this.cos*j,s=u*this.sin*V,c.x(U.x-i),c.y(U.y+s)}A=c.position(),this.findOne(".top-left").x(A.x),this.findOne(".bottom-right").y(A.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(c.y());else if(this._movingAnchorName==="bottom-right"){if(x){const U=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};u=Math.sqrt(Math.pow(c.x()-U.x,2)+Math.pow(c.y()-U.y,2));const j=this.findOne(".bottom-right").x()<U.x?-1:1,V=this.findOne(".bottom-right").y()<U.y?-1:1;i=u*this.cos*j,s=u*this.sin*V,this.findOne(".bottom-right").x(U.x+i),this.findOne(".bottom-right").y(U.y+s)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(D=this.centeredScaling()||t.altKey,D){const U=this.findOne(".top-left"),j=this.findOne(".bottom-right"),V=U.x(),J=U.y(),$=this.getWidth()-j.x(),st=this.getHeight()-j.y();j.move({x:-V,y:-J}),U.move({x:$,y:st})}const N=this.findOne(".top-left").getAbsolutePosition();i=N.x,s=N.y;const R=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),O=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:i,y:s,width:R,height:O,rotation:Ot.getAngle(this.rotation())},t)}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){var i;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const s=this.getNode();Y2--,this._fire("transformend",{evt:t,target:s}),(i=this.getLayer())===null||i===void 0||i.batchDraw(),s&&this._nodes.forEach(u=>{var c;u._fire("transformend",{evt:t,target:u}),(c=u.getLayer())===null||c===void 0||c.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(t,i){const s=this._getNodeRect(),u=1;if(k._inRange(t.width,-this.padding()*2-u,u)){this.update();return}if(k._inRange(t.height,-this.padding()*2-u,u)){this.update();return}const c=new Qi;if(c.rotate(Ot.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const x=c.point({x:-this.padding()*2,y:0});t.x+=x.x,t.y+=x.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=x.x,this._anchorDragOffset.y-=x.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const x=c.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=x.x,this._anchorDragOffset.y-=x.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const x=c.point({x:0,y:-this.padding()*2});t.x+=x.x,t.y+=x.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=x.x,this._anchorDragOffset.y-=x.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const x=c.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=x.x,this._anchorDragOffset.y-=x.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const x=this.boundBoxFunc()(s,t);x?t=x:k.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const f=1e7,p=new Qi;p.translate(s.x,s.y),p.rotate(s.rotation),p.scale(s.width/f,s.height/f);const m=new Qi,S=t.width/f,b=t.height/f;this.flipEnabled()===!1?(m.translate(t.x,t.y),m.rotate(t.rotation),m.translate(t.width<0?t.width:0,t.height<0?t.height:0),m.scale(Math.abs(S),Math.abs(b))):(m.translate(t.x,t.y),m.rotate(t.rotation),m.scale(S,b));const _=m.multiply(p.invert());this._nodes.forEach(x=>{var D;if(!x.getStage())return;const A=x.getParent().getAbsoluteTransform(),N=x.getTransform().copy();N.translate(x.offsetX(),x.offsetY());const R=new Qi;R.multiply(A.copy().invert()).multiply(_).multiply(A).multiply(N);const O=R.decompose();x.setAttrs(O),(D=x.getLayer())===null||D===void 0||D.batchDraw()}),this.rotation(k._getRotation(t.rotation)),this._nodes.forEach(x=>{this._fire("transform",{evt:i,target:x}),x._fire("transform",{evt:i,target:x})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,i){this.findOne(t).setAttrs(i)}update(){var t;const i=this._getNodeRect();this.rotation(k._getRotation(i.rotation));const s=i.width,u=i.height,c=this.enabledAnchors(),f=this.resizeEnabled(),p=this.padding(),m=this.anchorSize(),S=this.find("._anchor");S.forEach(_=>{_.setAttrs({width:m,height:m,offsetX:m/2,offsetY:m/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:m/2+p,offsetY:m/2+p,visible:f&&c.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:s/2,y:0,offsetY:m/2+p,visible:f&&c.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:s,y:0,offsetX:m/2-p,offsetY:m/2+p,visible:f&&c.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:u/2,offsetX:m/2+p,visible:f&&c.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:s,y:u/2,offsetX:m/2-p,visible:f&&c.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:u,offsetX:m/2+p,offsetY:m/2-p,visible:f&&c.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:s/2,y:u,offsetY:m/2-p,visible:f&&c.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:s,y:u,offsetX:m/2-p,offsetY:m/2-p,visible:f&&c.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:s/2,y:-this.rotateAnchorOffset()*k._sign(u)-p,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:s,height:u,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(_=>_.draggable()),x:0,y:0});const b=this.anchorStyleFunc();b&&S.forEach(_=>{b(_)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Wf.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Nt.prototype.toObject.call(this)}clone(t){return Nt.prototype.clone.call(this,t)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}ve.isTransforming=()=>Y2>0;function c_(n){return n instanceof Array||k.warn("enabledAnchors value should be an array"),n instanceof Array&&n.forEach(function(t){B1.indexOf(t)===-1&&k.warn("Unknown anchor name: "+t+". Available names are: "+B1.join(", "))}),n||[]}ve.prototype.className="Transformer",En(ve),G.addGetterSetter(ve,"enabledAnchors",B1,c_),G.addGetterSetter(ve,"flipEnabled",!0,sl()),G.addGetterSetter(ve,"resizeEnabled",!0),G.addGetterSetter(ve,"anchorSize",10,Dt()),G.addGetterSetter(ve,"rotateEnabled",!0),G.addGetterSetter(ve,"rotateLineVisible",!0),G.addGetterSetter(ve,"rotationSnaps",[]),G.addGetterSetter(ve,"rotateAnchorOffset",50,Dt()),G.addGetterSetter(ve,"rotateAnchorCursor","crosshair"),G.addGetterSetter(ve,"rotationSnapTolerance",5,Dt()),G.addGetterSetter(ve,"borderEnabled",!0),G.addGetterSetter(ve,"anchorStroke","rgb(0, 161, 255)"),G.addGetterSetter(ve,"anchorStrokeWidth",1,Dt()),G.addGetterSetter(ve,"anchorFill","white"),G.addGetterSetter(ve,"anchorCornerRadius",0,Dt()),G.addGetterSetter(ve,"borderStroke","rgb(0, 161, 255)"),G.addGetterSetter(ve,"borderStrokeWidth",1,Dt()),G.addGetterSetter(ve,"borderDash"),G.addGetterSetter(ve,"keepRatio",!0),G.addGetterSetter(ve,"shiftBehavior","default"),G.addGetterSetter(ve,"centeredScaling",!1),G.addGetterSetter(ve,"ignoreStroke",!1),G.addGetterSetter(ve,"padding",0,Dt()),G.addGetterSetter(ve,"nodes"),G.addGetterSetter(ve,"node"),G.addGetterSetter(ve,"boundBoxFunc"),G.addGetterSetter(ve,"anchorDragBoundFunc"),G.addGetterSetter(ve,"anchorStyleFunc"),G.addGetterSetter(ve,"shouldOverdrawWholeArea",!1),G.addGetterSetter(ve,"useSingleNodeRotation",!0),G.backCompat(ve,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Rr extends Ct{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,Ot.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Rr.prototype.className="Wedge",Rr.prototype._centroid=!0,Rr.prototype._attrsAffectingSize=["radius"],En(Rr),G.addGetterSetter(Rr,"radius",0,Dt()),G.addGetterSetter(Rr,"angle",0,Dt()),G.addGetterSetter(Rr,"clockwise",!1),G.backCompat(Rr,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function f4(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const f_=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],h_=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function d_(n,t){const i=n.data,s=n.width,u=n.height;let c,f,p,m,S,b,_,x,D,A,N,R,O,U,j,V,J,$,st,I;const et=t+t+1,nt=s-1,bt=u-1,rt=t+1,dt=rt*(rt+1)/2,pt=new f4,tt=f_[t],w=h_[t];let F=null,K=pt,at=null,St=null;for(let W=1;W<et;W++)K=K.next=new f4,W===rt&&(F=K);K.next=pt,p=f=0;for(let W=0;W<u;W++){R=O=U=j=m=S=b=_=0,x=rt*(V=i[f]),D=rt*(J=i[f+1]),A=rt*($=i[f+2]),N=rt*(st=i[f+3]),m+=dt*V,S+=dt*J,b+=dt*$,_+=dt*st,K=pt;for(let gt=0;gt<rt;gt++)K.r=V,K.g=J,K.b=$,K.a=st,K=K.next;for(let gt=1;gt<rt;gt++)c=f+((nt<gt?nt:gt)<<2),m+=(K.r=V=i[c])*(I=rt-gt),S+=(K.g=J=i[c+1])*I,b+=(K.b=$=i[c+2])*I,_+=(K.a=st=i[c+3])*I,R+=V,O+=J,U+=$,j+=st,K=K.next;at=pt,St=F;for(let gt=0;gt<s;gt++)i[f+3]=st=_*tt>>w,st!==0?(st=255/st,i[f]=(m*tt>>w)*st,i[f+1]=(S*tt>>w)*st,i[f+2]=(b*tt>>w)*st):i[f]=i[f+1]=i[f+2]=0,m-=x,S-=D,b-=A,_-=N,x-=at.r,D-=at.g,A-=at.b,N-=at.a,c=p+((c=gt+t+1)<nt?c:nt)<<2,R+=at.r=i[c],O+=at.g=i[c+1],U+=at.b=i[c+2],j+=at.a=i[c+3],m+=R,S+=O,b+=U,_+=j,at=at.next,x+=V=St.r,D+=J=St.g,A+=$=St.b,N+=st=St.a,R-=V,O-=J,U-=$,j-=st,St=St.next,f+=4;p+=s}for(let W=0;W<s;W++){O=U=j=R=S=b=_=m=0,f=W<<2,x=rt*(V=i[f]),D=rt*(J=i[f+1]),A=rt*($=i[f+2]),N=rt*(st=i[f+3]),m+=dt*V,S+=dt*J,b+=dt*$,_+=dt*st,K=pt;for(let Tt=0;Tt<rt;Tt++)K.r=V,K.g=J,K.b=$,K.a=st,K=K.next;let gt=s;for(let Tt=1;Tt<=t;Tt++)f=gt+W<<2,m+=(K.r=V=i[f])*(I=rt-Tt),S+=(K.g=J=i[f+1])*I,b+=(K.b=$=i[f+2])*I,_+=(K.a=st=i[f+3])*I,R+=V,O+=J,U+=$,j+=st,K=K.next,Tt<bt&&(gt+=s);f=W,at=pt,St=F;for(let Tt=0;Tt<u;Tt++)c=f<<2,i[c+3]=st=_*tt>>w,st>0?(st=255/st,i[c]=(m*tt>>w)*st,i[c+1]=(S*tt>>w)*st,i[c+2]=(b*tt>>w)*st):i[c]=i[c+1]=i[c+2]=0,m-=x,S-=D,b-=A,_-=N,x-=at.r,D-=at.g,A-=at.b,N-=at.a,c=W+((c=Tt+rt)<bt?c:bt)*s<<2,m+=R+=at.r=i[c],S+=O+=at.g=i[c+1],b+=U+=at.b=i[c+2],_+=j+=at.a=i[c+3],at=at.next,x+=V=St.r,D+=J=St.g,A+=$=St.b,N+=st=St.a,R-=V,O-=J,U-=$,j-=st,St=St.next,f+=s}}const p_=function(t){const i=Math.round(this.blurRadius());i>0&&d_(t,i)};G.addGetterSetter(Nt,"blurRadius",0,Dt(),G.afterSetFilter);const m_=function(n){const t=this.brightness()*255,i=n.data,s=i.length;for(let u=0;u<s;u+=4)i[u]+=t,i[u+1]+=t,i[u+2]+=t};G.addGetterSetter(Nt,"brightness",0,Dt(),G.afterSetFilter);const g_=function(n){const t=this.brightness(),i=n.data,s=i.length;for(let u=0;u<s;u+=4)i[u]=Math.min(255,i[u]*t),i[u+1]=Math.min(255,i[u+1]*t),i[u+2]=Math.min(255,i[u+2]*t)},y_=function(n){const t=Math.pow((this.contrast()+100)/100,2),i=n.data,s=i.length;let u=150,c=150,f=150;for(let p=0;p<s;p+=4)u=i[p],c=i[p+1],f=i[p+2],u/=255,u-=.5,u*=t,u+=.5,u*=255,c/=255,c-=.5,c*=t,c+=.5,c*=255,f/=255,f-=.5,f*=t,f+=.5,f*=255,u=u<0?0:u>255?255:u,c=c<0?0:c>255?255:c,f=f<0?0:f>255?255:f,i[p]=u,i[p+1]=c,i[p+2]=f};G.addGetterSetter(Nt,"contrast",0,Dt(),G.afterSetFilter);const v_=function(n){var t,i,s,u,c,f,p,m,S;const b=n.data,_=n.width,x=n.height,D=Math.min(1,Math.max(0,(i=(t=this.embossStrength)===null||t===void 0?void 0:t.call(this))!==null&&i!==void 0?i:.5)),A=Math.min(1,Math.max(0,(u=(s=this.embossWhiteLevel)===null||s===void 0?void 0:s.call(this))!==null&&u!==void 0?u:.5)),R=(p={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(f=(c=this.embossDirection)===null||c===void 0?void 0:c.call(this))!==null&&f!==void 0?f:"top-left"])!==null&&p!==void 0?p:315,O=!!((S=(m=this.embossBlend)===null||m===void 0?void 0:m.call(this))!==null&&S!==void 0&&S),U=D*10,j=A*255,V=R*Math.PI/180,J=Math.cos(V),$=Math.sin(V),st=128/1020*U,I=new Uint8ClampedArray(b),et=new Float32Array(_*x);for(let pt=0,tt=0;tt<b.length;tt+=4,pt++)et[pt]=.2126*I[tt]+.7152*I[tt+1]+.0722*I[tt+2];const nt=[-1,0,1,-2,0,2,-1,0,1],bt=[-1,-2,-1,0,0,0,1,2,1],rt=[-_-1,-_,-_+1,-1,0,1,_-1,_,_+1],dt=pt=>pt<0?0:pt>255?255:pt;for(let pt=1;pt<x-1;pt++)for(let tt=1;tt<_-1;tt++){const w=pt*_+tt;let F=0,K=0;F+=et[w+rt[0]]*nt[0],K+=et[w+rt[0]]*bt[0],F+=et[w+rt[1]]*nt[1],K+=et[w+rt[1]]*bt[1],F+=et[w+rt[2]]*nt[2],K+=et[w+rt[2]]*bt[2],F+=et[w+rt[3]]*nt[3],K+=et[w+rt[3]]*bt[3],F+=et[w+rt[5]]*nt[5],K+=et[w+rt[5]]*bt[5],F+=et[w+rt[6]]*nt[6],K+=et[w+rt[6]]*bt[6],F+=et[w+rt[7]]*nt[7],K+=et[w+rt[7]]*bt[7],F+=et[w+rt[8]]*nt[8],K+=et[w+rt[8]]*bt[8];const at=J*F+$*K,St=dt(j+at*st),W=w*4;if(O){const gt=St-j;b[W]=dt(I[W]+gt),b[W+1]=dt(I[W+1]+gt),b[W+2]=dt(I[W+2]+gt),b[W+3]=I[W+3]}else b[W]=b[W+1]=b[W+2]=St,b[W+3]=I[W+3]}for(let pt=0;pt<_;pt++){let tt=pt*4,w=((x-1)*_+pt)*4;b[tt]=I[tt],b[tt+1]=I[tt+1],b[tt+2]=I[tt+2],b[tt+3]=I[tt+3],b[w]=I[w],b[w+1]=I[w+1],b[w+2]=I[w+2],b[w+3]=I[w+3]}for(let pt=1;pt<x-1;pt++){let tt=pt*_*4,w=(pt*_+(_-1))*4;b[tt]=I[tt],b[tt+1]=I[tt+1],b[tt+2]=I[tt+2],b[tt+3]=I[tt+3],b[w]=I[w],b[w+1]=I[w+1],b[w+2]=I[w+2],b[w+3]=I[w+3]}return n};G.addGetterSetter(Nt,"embossStrength",.5,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"embossWhiteLevel",.5,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"embossDirection","top-left",void 0,G.afterSetFilter),G.addGetterSetter(Nt,"embossBlend",!1,void 0,G.afterSetFilter);function q2(n,t,i,s,u){const c=i-t,f=u-s;if(c===0)return s+f/2;if(f===0)return s;let p=(n-t)/c;return p=f*p+s,p}const S_=function(n){const t=n.data,i=t.length;let s=t[0],u=s,c,f=t[1],p=f,m,S=t[2],b=S,_;const x=this.enhance();if(x===0)return;for(let j=0;j<i;j+=4)c=t[j+0],c<s?s=c:c>u&&(u=c),m=t[j+1],m<f?f=m:m>p&&(p=m),_=t[j+2],_<S?S=_:_>b&&(b=_);u===s&&(u=255,s=0),p===f&&(p=255,f=0),b===S&&(b=255,S=0);let D,A,N,R,O,U;if(x>0)D=u+x*(255-u),A=s-x*(s-0),N=p+x*(255-p),R=f-x*(f-0),O=b+x*(255-b),U=S-x*(S-0);else{const j=(u+s)*.5;D=u+x*(u-j),A=s+x*(s-j);const V=(p+f)*.5;N=p+x*(p-V),R=f+x*(f-V);const J=(b+S)*.5;O=b+x*(b-J),U=S+x*(S-J)}for(let j=0;j<i;j+=4)t[j+0]=q2(t[j+0],s,u,A,D),t[j+1]=q2(t[j+1],f,p,R,N),t[j+2]=q2(t[j+2],S,b,U,O)};G.addGetterSetter(Nt,"enhance",0,Dt(),G.afterSetFilter);const b_=function(n){const t=n.data,i=t.length;for(let s=0;s<i;s+=4){const u=.34*t[s]+.5*t[s+1]+.16*t[s+2];t[s]=u,t[s+1]=u,t[s+2]=u}};G.addGetterSetter(Nt,"hue",0,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"saturation",0,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"luminance",0,Dt(),G.afterSetFilter);const E_=function(n){const t=n.data,i=t.length,s=1,u=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,f=this.luminance()*127,p=s*u*Math.cos(c*Math.PI/180),m=s*u*Math.sin(c*Math.PI/180),S=.299*s+.701*p+.167*m,b=.587*s-.587*p+.33*m,_=.114*s-.114*p-.497*m,x=.299*s-.299*p-.328*m,D=.587*s+.413*p+.035*m,A=.114*s-.114*p+.293*m,N=.299*s-.3*p+1.25*m,R=.587*s-.586*p-1.05*m,O=.114*s+.886*p-.2*m;let U,j,V,J;for(let $=0;$<i;$+=4)U=t[$+0],j=t[$+1],V=t[$+2],J=t[$+3],t[$+0]=S*U+b*j+_*V+f,t[$+1]=x*U+D*j+A*V+f,t[$+2]=N*U+R*j+O*V+f,t[$+3]=J},T_=function(n){const t=n.data,i=t.length,s=Math.pow(2,this.value()),u=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,f=s*u*Math.cos(c*Math.PI/180),p=s*u*Math.sin(c*Math.PI/180),m=.299*s+.701*f+.167*p,S=.587*s-.587*f+.33*p,b=.114*s-.114*f-.497*p,_=.299*s-.299*f-.328*p,x=.587*s+.413*f+.035*p,D=.114*s-.114*f+.293*p,A=.299*s-.3*f+1.25*p,N=.587*s-.586*f-1.05*p,R=.114*s+.886*f-.2*p;for(let O=0;O<i;O+=4){const U=t[O+0],j=t[O+1],V=t[O+2],J=t[O+3];t[O+0]=m*U+S*j+b*V,t[O+1]=_*U+x*j+D*V,t[O+2]=A*U+N*j+R*V,t[O+3]=J}};G.addGetterSetter(Nt,"hue",0,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"saturation",0,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"value",0,Dt(),G.afterSetFilter);const C_=function(n){const t=n.data,i=t.length;for(let s=0;s<i;s+=4)t[s]=255-t[s],t[s+1]=255-t[s+1],t[s+2]=255-t[s+2]},__=function(n,t,i){const s=n.data,u=t.data,c=n.width,f=n.height,p=i.polarCenterX||c/2,m=i.polarCenterY||f/2;let S=Math.sqrt(p*p+m*m),b=c-p,_=f-m;const x=Math.sqrt(b*b+_*_);S=x>S?x:S;const D=f,A=c,N=360/A*Math.PI/180;for(let R=0;R<A;R+=1){const O=Math.sin(R*N),U=Math.cos(R*N);for(let j=0;j<D;j+=1){b=Math.floor(p+S*j/D*U),_=Math.floor(m+S*j/D*O);let V=(_*c+b)*4;const J=s[V+0],$=s[V+1],st=s[V+2],I=s[V+3];V=(R+j*c)*4,u[V+0]=J,u[V+1]=$,u[V+2]=st,u[V+3]=I}}},x_=function(n,t,i){const s=n.data,u=t.data,c=n.width,f=n.height,p=i.polarCenterX||c/2,m=i.polarCenterY||f/2;let S=Math.sqrt(p*p+m*m),b=c-p,_=f-m;const x=Math.sqrt(b*b+_*_);S=x>S?x:S;const D=f,A=c,N=0;let R,O;for(b=0;b<c;b+=1)for(_=0;_<f;_+=1){const U=b-p,j=_-m,V=Math.sqrt(U*U+j*j)*D/S;let J=(Math.atan2(j,U)*180/Math.PI+360+N)%360;J=J*A/360,R=Math.floor(J),O=Math.floor(V);let $=(O*c+R)*4;const st=s[$+0],I=s[$+1],et=s[$+2],nt=s[$+3];$=(_*c+b)*4,u[$+0]=st,u[$+1]=I,u[$+2]=et,u[$+3]=nt}},D_=function(n){const t=n.width,i=n.height;let s,u,c,f,p,m,S,b,_,x,D=Math.round(this.kaleidoscopePower());const A=Math.round(this.kaleidoscopeAngle()),N=Math.floor(t*(A%360)/360);if(D<1)return;const R=k.createCanvasElement();R.width=t,R.height=i;const O=R.getContext("2d").getImageData(0,0,t,i);k.releaseCanvas(R),__(n,O,{polarCenterX:t/2,polarCenterY:i/2});let U=t/Math.pow(2,D);for(;U<=8;)U=U*2,D-=1;U=Math.ceil(U);let j=U,V=0,J=j,$=1;for(N+U>t&&(V=j,J=0,$=-1),u=0;u<i;u+=1)for(s=V;s!==J;s+=$)c=Math.round(s+N)%t,_=(t*u+c)*4,p=O.data[_+0],m=O.data[_+1],S=O.data[_+2],b=O.data[_+3],x=(t*u+s)*4,O.data[x+0]=p,O.data[x+1]=m,O.data[x+2]=S,O.data[x+3]=b;for(u=0;u<i;u+=1)for(j=Math.floor(U),f=0;f<D;f+=1){for(s=0;s<j+1;s+=1)_=(t*u+s)*4,p=O.data[_+0],m=O.data[_+1],S=O.data[_+2],b=O.data[_+3],x=(t*u+j*2-s-1)*4,O.data[x+0]=p,O.data[x+1]=m,O.data[x+2]=S,O.data[x+3]=b;j*=2}x_(O,n,{})};G.addGetterSetter(Nt,"kaleidoscopePower",2,Dt(),G.afterSetFilter),G.addGetterSetter(Nt,"kaleidoscopeAngle",0,Dt(),G.afterSetFilter);function V1(n,t,i){let s=(i*n.width+t)*4;const u=[];return u.push(n.data[s++],n.data[s++],n.data[s++],n.data[s++]),u}function Fp(n,t){return Math.sqrt(Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2)+Math.pow(n[2]-t[2],2))}function A_(n){const t=[0,0,0];for(let i=0;i<n.length;i++)t[0]+=n[i][0],t[1]+=n[i][1],t[2]+=n[i][2];return t[0]/=n.length,t[1]/=n.length,t[2]/=n.length,t}function M_(n,t){const i=V1(n,0,0),s=V1(n,n.width-1,0),u=V1(n,0,n.height-1),c=V1(n,n.width-1,n.height-1),f=t||10;if(Fp(i,s)<f&&Fp(s,c)<f&&Fp(c,u)<f&&Fp(u,i)<f){const p=A_([s,i,c,u]),m=[];for(let S=0;S<n.width*n.height;S++){const b=Fp(p,[n.data[S*4],n.data[S*4+1],n.data[S*4+2]]);m[S]=b<f?0:255}return m}}function N_(n,t){for(let i=0;i<n.width*n.height;i++)n.data[4*i+3]=t[i]}function O_(n,t,i){const s=[1,1,1,1,0,1,1,1,1],u=Math.round(Math.sqrt(s.length)),c=Math.floor(u/2),f=[];for(let p=0;p<i;p++)for(let m=0;m<t;m++){const S=p*t+m;let b=0;for(let _=0;_<u;_++)for(let x=0;x<u;x++){const D=p+_-c,A=m+x-c;if(D>=0&&D<i&&A>=0&&A<t){const N=D*t+A,R=s[_*u+x];b+=n[N]*R}}f[S]=b===2040?255:0}return f}function R_(n,t,i){const s=[1,1,1,1,1,1,1,1,1],u=Math.round(Math.sqrt(s.length)),c=Math.floor(u/2),f=[];for(let p=0;p<i;p++)for(let m=0;m<t;m++){const S=p*t+m;let b=0;for(let _=0;_<u;_++)for(let x=0;x<u;x++){const D=p+_-c,A=m+x-c;if(D>=0&&D<i&&A>=0&&A<t){const N=D*t+A,R=s[_*u+x];b+=n[N]*R}}f[S]=b>=1020?255:0}return f}function z_(n,t,i){const s=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],u=Math.round(Math.sqrt(s.length)),c=Math.floor(u/2),f=[];for(let p=0;p<i;p++)for(let m=0;m<t;m++){const S=p*t+m;let b=0;for(let _=0;_<u;_++)for(let x=0;x<u;x++){const D=p+_-c,A=m+x-c;if(D>=0&&D<i&&A>=0&&A<t){const N=D*t+A,R=s[_*u+x];b+=n[N]*R}}f[S]=b}return f}const H_=function(n){const t=this.threshold();let i=M_(n,t);return i&&(i=O_(i,n.width,n.height),i=R_(i,n.width,n.height),i=z_(i,n.width,n.height),N_(n,i)),n};G.addGetterSetter(Nt,"threshold",0,Dt(),G.afterSetFilter);const w_=function(n){const t=this.noise()*255,i=n.data,s=i.length,u=t/2;for(let c=0;c<s;c+=4)i[c+0]+=u-2*u*Math.random(),i[c+1]+=u-2*u*Math.random(),i[c+2]+=u-2*u*Math.random()};G.addGetterSetter(Nt,"noise",.2,Dt(),G.afterSetFilter);const U_=function(n){let t=Math.ceil(this.pixelSize()),i=n.width,s=n.height,u=Math.ceil(i/t),c=Math.ceil(s/t),f=n.data;if(t<=0){k.error("pixelSize value can not be <= 0");return}for(let p=0;p<u;p+=1)for(let m=0;m<c;m+=1){let S=0,b=0,_=0,x=0;const D=p*t,A=D+t,N=m*t,R=N+t;let O=0;for(let U=D;U<A;U+=1)if(!(U>=i))for(let j=N;j<R;j+=1){if(j>=s)continue;const V=(i*j+U)*4;S+=f[V+0],b+=f[V+1],_+=f[V+2],x+=f[V+3],O+=1}S=S/O,b=b/O,_=_/O,x=x/O;for(let U=D;U<A;U+=1)if(!(U>=i))for(let j=N;j<R;j+=1){if(j>=s)continue;const V=(i*j+U)*4;f[V+0]=S,f[V+1]=b,f[V+2]=_,f[V+3]=x}}};G.addGetterSetter(Nt,"pixelSize",8,Dt(),G.afterSetFilter);const B_=function(n){const t=Math.round(this.levels()*254)+1,i=n.data,s=i.length,u=255/t;for(let c=0;c<s;c+=1)i[c]=Math.floor(i[c]/u)*u};G.addGetterSetter(Nt,"levels",.5,Dt(),G.afterSetFilter);const V_=function(n){const t=n.data,i=t.length,s=this.red(),u=this.green(),c=this.blue();for(let f=0;f<i;f+=4){const p=(.34*t[f]+.5*t[f+1]+.16*t[f+2])/255;t[f]=p*s,t[f+1]=p*u,t[f+2]=p*c,t[f+3]=t[f+3]}};G.addGetterSetter(Nt,"red",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),G.addGetterSetter(Nt,"green",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),G.addGetterSetter(Nt,"blue",0,m5,G.afterSetFilter);const G_=function(n){const t=n.data,i=t.length,s=this.red(),u=this.green(),c=this.blue(),f=this.alpha();for(let p=0;p<i;p+=4){const m=1-f;t[p]=s*f+t[p]*m,t[p+1]=u*f+t[p+1]*m,t[p+2]=c*f+t[p+2]*m}};G.addGetterSetter(Nt,"red",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),G.addGetterSetter(Nt,"green",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),G.addGetterSetter(Nt,"blue",0,m5,G.afterSetFilter),G.addGetterSetter(Nt,"alpha",1,function(n){return this._filterUpToDate=!1,n>1?1:n<0?0:n});const j_=function(n){const t=n.data,i=t.length;for(let s=0;s<i;s+=4){const u=t[s+0],c=t[s+1],f=t[s+2];t[s+0]=Math.min(255,u*.393+c*.769+f*.189),t[s+1]=Math.min(255,u*.349+c*.686+f*.168),t[s+2]=Math.min(255,u*.272+c*.534+f*.131)}},L_=function(n){const i=n.data;for(let s=0;s<i.length;s+=4){const u=i[s],c=i[s+1],f=i[s+2];.2126*u+.7152*c+.0722*f>=128&&(i[s]=255-u,i[s+1]=255-c,i[s+2]=255-f)}return n},P_=function(n){const t=this.threshold()*255,i=n.data,s=i.length;for(let u=0;u<s;u+=1)i[u]=i[u]<t?0:255};G.addGetterSetter(Nt,"threshold",.5,Dt(),G.afterSetFilter),$f.Util._assign($f,{Arc:Nr,Arrow:fc,Circle:th,Ellipse:Lo,Image:ll,Label:j2,Tag:hc,Line:Or,Path:bs,Rect:Zp,RegularPolygon:Po,Ring:dc,Sprite:Kl,Star:Yo,Text:an,TextPath:ca,Transformer:ve,Wedge:Rr,Filters:{Blur:p_,Brightness:g_,Brighten:m_,Contrast:y_,Emboss:v_,Enhance:S_,Grayscale:b_,HSL:E_,HSV:T_,Invert:C_,Kaleidoscope:D_,Mask:H_,Noise:w_,Pixelate:U_,Posterize:B_,RGB:V_,RGBA:G_,Sepia:j_,Solarize:L_,Threshold:P_}});function X2(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var G1={exports:{}},K2={exports:{}},j1={exports:{}},Q2={};var h4;function Y_(){return h4||(h4=1,(function(n){function t(w,F){var K=w.length;w.push(F);t:for(;0<K;){var at=K-1>>>1,St=w[at];if(0<u(St,F))w[at]=F,w[K]=St,K=at;else break t}}function i(w){return w.length===0?null:w[0]}function s(w){if(w.length===0)return null;var F=w[0],K=w.pop();if(K!==F){w[0]=K;t:for(var at=0,St=w.length,W=St>>>1;at<W;){var gt=2*(at+1)-1,Tt=w[gt],Pt=gt+1,le=w[Pt];if(0>u(Tt,K))Pt<St&&0>u(le,Tt)?(w[at]=le,w[Pt]=K,at=Pt):(w[at]=Tt,w[gt]=K,at=gt);else if(Pt<St&&0>u(le,K))w[at]=le,w[Pt]=K,at=Pt;else break t}}return F}function u(w,F){var K=w.sortIndex-F.sortIndex;return K!==0?K:w.id-F.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var m=[],S=[],b=1,_=null,x=3,D=!1,A=!1,N=!1,R=!1,O=typeof setTimeout=="function"?setTimeout:null,U=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function V(w){for(var F=i(S);F!==null;){if(F.callback===null)s(S);else if(F.startTime<=w)s(S),F.sortIndex=F.expirationTime,t(m,F);else break;F=i(S)}}function J(w){if(N=!1,V(w),!A)if(i(m)!==null)A=!0,$||($=!0,rt());else{var F=i(S);F!==null&&tt(J,F.startTime-w)}}var $=!1,st=-1,I=5,et=-1;function nt(){return R?!0:!(n.unstable_now()-et<I)}function bt(){if(R=!1,$){var w=n.unstable_now();et=w;var F=!0;try{t:{A=!1,N&&(N=!1,U(st),st=-1),D=!0;var K=x;try{e:{for(V(w),_=i(m);_!==null&&!(_.expirationTime>w&&nt());){var at=_.callback;if(typeof at=="function"){_.callback=null,x=_.priorityLevel;var St=at(_.expirationTime<=w);if(w=n.unstable_now(),typeof St=="function"){_.callback=St,V(w),F=!0;break e}_===i(m)&&s(m),V(w)}else s(m);_=i(m)}if(_!==null)F=!0;else{var W=i(S);W!==null&&tt(J,W.startTime-w),F=!1}}break t}finally{_=null,x=K,D=!1}F=void 0}}finally{F?rt():$=!1}}}var rt;if(typeof j=="function")rt=function(){j(bt)};else if(typeof MessageChannel<"u"){var dt=new MessageChannel,pt=dt.port2;dt.port1.onmessage=bt,rt=function(){pt.postMessage(null)}}else rt=function(){O(bt,0)};function tt(w,F){st=O(function(){w(n.unstable_now())},F)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(w){w.callback=null},n.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<w?Math.floor(1e3/w):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(w){switch(x){case 1:case 2:case 3:var F=3;break;default:F=x}var K=x;x=F;try{return w()}finally{x=K}},n.unstable_requestPaint=function(){R=!0},n.unstable_runWithPriority=function(w,F){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var K=x;x=w;try{return F()}finally{x=K}},n.unstable_scheduleCallback=function(w,F,K){var at=n.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?at+K:at):K=at,w){case 1:var St=-1;break;case 2:St=250;break;case 5:St=1073741823;break;case 4:St=1e4;break;default:St=5e3}return St=K+St,w={id:b++,callback:F,priorityLevel:w,startTime:K,expirationTime:St,sortIndex:-1},K>at?(w.sortIndex=K,t(S,w),i(m)===null&&w===i(S)&&(N?(U(st),st=-1):N=!0,tt(J,K-at))):(w.sortIndex=St,t(m,w),A||D||(A=!0,$||($=!0,rt()))),w},n.unstable_shouldYield=nt,n.unstable_wrapCallback=function(w){var F=x;return function(){var K=x;x=F;try{return w.apply(this,arguments)}finally{x=K}}}})(Q2)),Q2}var Z2={};var d4;function q_(){return d4||(d4=1,(function(n){process.env.NODE_ENV!=="production"&&(function(){function t(){if(J=!1,et){var w=n.unstable_now();rt=w;var F=!0;try{t:{j=!1,V&&(V=!1,st(nt),nt=-1),U=!0;var K=O;try{e:{for(f(w),R=s(D);R!==null&&!(R.expirationTime>w&&m());){var at=R.callback;if(typeof at=="function"){R.callback=null,O=R.priorityLevel;var St=at(R.expirationTime<=w);if(w=n.unstable_now(),typeof St=="function"){R.callback=St,f(w),F=!0;break e}R===s(D)&&u(D),f(w)}else u(D);R=s(D)}if(R!==null)F=!0;else{var W=s(A);W!==null&&S(p,W.startTime-w),F=!1}}break t}finally{R=null,O=K,U=!1}F=void 0}}finally{F?dt():et=!1}}}function i(w,F){var K=w.length;w.push(F);t:for(;0<K;){var at=K-1>>>1,St=w[at];if(0<c(St,F))w[at]=F,w[K]=St,K=at;else break t}}function s(w){return w.length===0?null:w[0]}function u(w){if(w.length===0)return null;var F=w[0],K=w.pop();if(K!==F){w[0]=K;t:for(var at=0,St=w.length,W=St>>>1;at<W;){var gt=2*(at+1)-1,Tt=w[gt],Pt=gt+1,le=w[Pt];if(0>c(Tt,K))Pt<St&&0>c(le,Tt)?(w[at]=le,w[Pt]=K,at=Pt):(w[at]=Tt,w[gt]=K,at=gt);else if(Pt<St&&0>c(le,K))w[at]=le,w[Pt]=K,at=Pt;else break t}}return F}function c(w,F){var K=w.sortIndex-F.sortIndex;return K!==0?K:w.id-F.id}function f(w){for(var F=s(A);F!==null;){if(F.callback===null)u(A);else if(F.startTime<=w)u(A),F.sortIndex=F.expirationTime,i(D,F);else break;F=s(A)}}function p(w){if(V=!1,f(w),!j)if(s(D)!==null)j=!0,et||(et=!0,dt());else{var F=s(A);F!==null&&S(p,F.startTime-w)}}function m(){return J?!0:!(n.unstable_now()-rt<bt)}function S(w,F){nt=$(function(){w(n.unstable_now())},F)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var b=performance;n.unstable_now=function(){return b.now()}}else{var _=Date,x=_.now();n.unstable_now=function(){return _.now()-x}}var D=[],A=[],N=1,R=null,O=3,U=!1,j=!1,V=!1,J=!1,$=typeof setTimeout=="function"?setTimeout:null,st=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null,et=!1,nt=-1,bt=5,rt=-1;if(typeof I=="function")var dt=function(){I(t)};else if(typeof MessageChannel<"u"){var pt=new MessageChannel,tt=pt.port2;pt.port1.onmessage=t,dt=function(){tt.postMessage(null)}}else dt=function(){$(t,0)};n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(w){w.callback=null},n.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):bt=0<w?Math.floor(1e3/w):5},n.unstable_getCurrentPriorityLevel=function(){return O},n.unstable_next=function(w){switch(O){case 1:case 2:case 3:var F=3;break;default:F=O}var K=O;O=F;try{return w()}finally{O=K}},n.unstable_requestPaint=function(){J=!0},n.unstable_runWithPriority=function(w,F){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var K=O;O=w;try{return F()}finally{O=K}},n.unstable_scheduleCallback=function(w,F,K){var at=n.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?at+K:at):K=at,w){case 1:var St=-1;break;case 2:St=250;break;case 5:St=1073741823;break;case 4:St=1e4;break;default:St=5e3}return St=K+St,w={id:N++,callback:F,priorityLevel:w,startTime:K,expirationTime:St,sortIndex:-1},K>at?(w.sortIndex=K,i(A,w),s(D)===null&&w===s(A)&&(V?(st(nt),nt=-1):V=!0,S(p,K-at))):(w.sortIndex=St,i(D,w),j||U||(j=!0,et||(et=!0,dt()))),w},n.unstable_shouldYield=m,n.unstable_wrapCallback=function(w){var F=O;return function(){var K=O;O=F;try{return w.apply(this,arguments)}finally{O=K}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})(Z2)),Z2}var p4;function J2(){return p4||(p4=1,process.env.NODE_ENV==="production"?j1.exports=Y_():j1.exports=q_()),j1.exports}var m4;function X_(){return m4||(m4=1,(function(n){n.exports=function(t){function i(l,r,h,g){return new md(l,r,h,g)}function s(){}function u(l){var r="https://react.dev/errors/"+l;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)r+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+l+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(l){var r=l,h=l;if(l.alternate)for(;r.return;)r=r.return;else{l=r;do r=l,(r.flags&4098)!==0&&(h=r.return),l=r.return;while(l)}return r.tag===3?h:null}function f(l){if(c(l)!==l)throw Error(u(188))}function p(l){var r=l.alternate;if(!r){if(r=c(l),r===null)throw Error(u(188));return r!==l?null:l}for(var h=l,g=r;;){var E=h.return;if(E===null)break;var T=E.alternate;if(T===null){if(g=E.return,g!==null){h=g;continue}break}if(E.child===T.child){for(T=E.child;T;){if(T===h)return f(E),l;if(T===g)return f(E),r;T=T.sibling}throw Error(u(188))}if(h.return!==g.return)h=E,g=T;else{for(var z=!1,L=E.child;L;){if(L===h){z=!0,h=E,g=T;break}if(L===g){z=!0,g=E,h=T;break}L=L.sibling}if(!z){for(L=T.child;L;){if(L===h){z=!0,h=T,g=E;break}if(L===g){z=!0,g=T,h=E;break}L=L.sibling}if(!z)throw Error(u(189))}}if(h.alternate!==g)throw Error(u(190))}if(h.tag!==3)throw Error(u(188));return h.stateNode.current===h?l:r}function m(l){var r=l.tag;if(r===5||r===26||r===27||r===6)return l;for(l=l.child;l!==null;){if(r=m(l),r!==null)return r;l=l.sibling}return null}function S(l){var r=l.tag;if(r===5||r===26||r===27||r===6)return l;for(l=l.child;l!==null;){if(l.tag!==4&&(r=S(l),r!==null))return r;l=l.sibling}return null}function b(l){return l===null||typeof l!="object"?null:(l=ym&&l[ym]||l["@@iterator"],typeof l=="function"?l:null)}function _(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===vm?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case io:return"Fragment";case ff:return"Profiler";case mm:return"StrictMode";case so:return"Suspense";case ze:return"SuspenseList";case Td:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case or:return"Portal";case Al:return l.displayName||"Context";case Ed:return(l._context.displayName||"Context")+".Consumer";case Cu:var r=l.render;return l=l.displayName,l||(l=r.displayName||r.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case gm:return r=l.displayName||null,r!==null?r:_(l.type)||"Memo";case ur:r=l._payload,l=l._init;try{return _(l(r))}catch{}}return null}function x(l){return{current:l}}function D(l){0>Nu||(l.current=bf[Nu],bf[Nu]=null,Nu--)}function A(l,r){Nu++,bf[Nu]=l.current,l.current=r}function N(l){return l>>>=0,l===0?32:31-(My(l)/Ny|0)|0}function R(l){var r=l&42;if(r!==0)return r;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function O(l,r,h){var g=l.pendingLanes;if(g===0)return 0;var E=0,T=l.suspendedLanes,z=l.pingedLanes;l=l.warmLanes;var L=g&134217727;return L!==0?(g=L&~T,g!==0?E=R(g):(z&=L,z!==0?E=R(z):h||(h=L&~l,h!==0&&(E=R(h))))):(L=g&~T,L!==0?E=R(L):z!==0?E=R(z):h||(h=g&~l,h!==0&&(E=R(h)))),E===0?0:r!==0&&r!==E&&(r&T)===0&&(T=E&-E,h=r&-r,T>=h||T===32&&(h&4194048)!==0)?r:E}function U(l,r){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&r)===0}function j(l,r){switch(l){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function V(){var l=Ou;return Ou<<=1,(Ou&62914560)===0&&(Ou=4194304),l}function J(l){for(var r=[],h=0;31>h;h++)r.push(l);return r}function $(l,r){l.pendingLanes|=r,r!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function st(l,r,h,g,E,T){var z=l.pendingLanes;l.pendingLanes=h,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=h,l.entangledLanes&=h,l.errorRecoveryDisabledLanes&=h,l.shellSuspendCounter=0;var L=l.entanglements,ft=l.expirationTimes,vt=l.hiddenUpdates;for(h=z&~h;0<h;){var Mt=31-ii(h),xt=1<<Mt;L[Mt]=0,ft[Mt]=-1;var Rt=vt[Mt];if(Rt!==null)for(vt[Mt]=null,Mt=0;Mt<Rt.length;Mt++){var Yt=Rt[Mt];Yt!==null&&(Yt.lane&=-536870913)}h&=~xt}g!==0&&I(l,g,0),T!==0&&E===0&&l.tag!==0&&(l.suspendedLanes|=T&~(z&~r))}function I(l,r,h){l.pendingLanes|=r,l.suspendedLanes&=~r;var g=31-ii(r);l.entangledLanes|=r,l.entanglements[g]=l.entanglements[g]|1073741824|h&261930}function et(l,r){var h=l.entangledLanes|=r;for(l=l.entanglements;h;){var g=31-ii(h),E=1<<g;E&r|l[g]&r&&(l[g]|=r),h&=~E}}function nt(l,r){var h=r&-r;return h=(h&42)!==0?1:bt(h),(h&(l.suspendedLanes|r))!==0?0:h}function bt(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function rt(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function dt(l){if(typeof Gd=="function"&&wm(l),Rn&&typeof Rn.setStrictMode=="function")try{Rn.setStrictMode(po,l)}catch{}}function pt(l,r){return l===r&&(l!==0||1/l===1/r)||l!==l&&r!==r}function tt(l){if(zu===void 0)try{throw Error()}catch(h){var r=h.stack.trim().match(/\n( *(at )?)/);zu=r&&r[1]||"",li=-1<h.stack.indexOf(`
|
|
16
16
|
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
17
17
|
`+zu+l+li}function w(l,r){if(!l||Cf)return"";Cf=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(r){var xt=function(){throw Error()};if(Object.defineProperty(xt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xt,[])}catch(Yt){var Rt=Yt}Reflect.construct(l,[],xt)}else{try{xt.call()}catch(Yt){Rt=Yt}l.call(xt.prototype)}}else{try{throw Error()}catch(Yt){Rt=Yt}(xt=l())&&typeof xt.catch=="function"&&xt.catch(function(){})}}catch(Yt){if(Yt&&Rt&&typeof Yt.stack=="string")return[Yt.stack,Rt.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=g.DetermineComponentFrameRoot(),z=T[0],L=T[1];if(z&&L){var ft=z.split(`
|
|
18
18
|
`),vt=L.split(`
|
|
19
19
|
`);for(E=g=0;g<ft.length&&!ft[g].includes("DetermineComponentFrameRoot");)g++;for(;E<vt.length&&!vt[E].includes("DetermineComponentFrameRoot");)E++;if(g===ft.length||E===vt.length)for(g=ft.length-1,E=vt.length-1;1<=g&&0<=E&&ft[g]!==vt[E];)E--;for(;1<=g&&0<=E;g--,E--)if(ft[g]!==vt[E]){if(g!==1||E!==1)do if(g--,E--,0>E||ft[g]!==vt[E]){var Mt=`
|
|
20
20
|
`+ft[g].replace(" at new "," at ");return l.displayName&&Mt.includes("<anonymous>")&&(Mt=Mt.replace("<anonymous>",l.displayName)),Mt}while(1<=g&&0<=E);break}}}finally{Cf=!1,Error.prepareStackTrace=h}return(h=l?l.displayName||l.name:"")?tt(h):""}function F(l,r){switch(l.tag){case 26:case 27:case 5:return tt(l.type);case 16:return tt("Lazy");case 13:return l.child!==r&&r!==null?tt("Suspense Fallback"):tt("Suspense");case 19:return tt("SuspenseList");case 0:case 15:return w(l.type,!1);case 11:return w(l.type.render,!1);case 1:return w(l.type,!0);case 31:return tt("Activity");default:return""}}function K(l){try{var r="",h=null;do r+=F(l,h),h=l,l=l.return;while(l);return r}catch(g){return`
|
|
21
21
|
Error generating stack: `+g.message+`
|
|
22
|
-
`+g.stack}}function at(l,r){if(typeof l=="object"&&l!==null){var h=Ry.get(l);return h!==void 0?h:(r={value:l,source:r,stack:K(r)},Ry.set(l,r),r)}return{value:l,source:r,stack:K(r)}}function St(l,r){mo[Hu++]=lt,mo[Hu++]=Pn,Pn=l,lt=r}function $(l,r,h){Ui[Bi++]=Xa,Ui[Bi++]=qs,Ui[Bi++]=Hl,Hl=l;var g=Xa;l=qs;var E=32-ii(g)-1;g&=~(1<<E),h+=1;var T=32-ii(r)+E;if(30<T){var z=E-E%5;T=(g&(1<<z)-1).toString(32),g>>=z,E-=z,Xa=1<<32-ii(r)+E|h<<E|g,qs=T+l}else Xa=1<<T|h<<E|g,qs=l}function gt(l){l.return!==null&&(St(l,1),$(l,1,0))}function Tt(l){for(;l===Pn;)Pn=mo[--Hu],mo[Hu]=null,lt=mo[--Hu],mo[Hu]=null;for(;l===Hl;)Hl=Ui[--Bi],Ui[Bi]=null,qs=Ui[--Bi],Ui[Bi]=null,Xa=Ui[--Bi],Ui[Bi]=null}function Pt(l,r){Ui[Bi++]=Xa,Ui[Bi++]=qs,Ui[Bi++]=Hl,Xa=r.id,qs=r.overflow,Hl=l}function le(l,r){A(dr,r),A(_f,l),A(ba,null),l=n3(r),D(ba),A(ba,l)}function xn(){D(ba),D(_f),D(dr)}function xe(l){l.memoizedState!==null&&A(Ld,l);var r=ba.current,h=Yg(r,l.type);r!==h&&(A(_f,l),A(ba,h))}function Dn(l){_f.current===l&&(D(ba),D(_f)),Ld.current===l&&(D(Ld),Hi?fr._currentValue=qa:fr._currentValue2=qa)}function ln(l){var r=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw An(at(r,l)),Bm}function Be(l,r){if(!ya)throw Error(u(175));Du(l.stateNode,l.type,l.memoizedProps,r,l)||ln(l,!0)}function At(l){for(Fn=l.return;Fn;)switch(Fn.tag){case 5:case 31:case 13:Vi=!1;return;case 27:case 3:Vi=!0;return;default:Fn=Fn.return}}function ue(l){if(!ya||l!==Fn)return!1;if(!se)return At(l),se=!0,!1;var r=l.tag;if(Ln?r!==3&&r!==27&&(r!==5||Cy(l.type)&&!pf(l.type,l.memoizedProps))&&We&&ln(l):r!==3&&(r!==5||Cy(l.type)&&!pf(l.type,l.memoizedProps))&&We&&ln(l),At(l),r===13){if(!ya)throw Error(u(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(u(317));We=yy(l)}else if(r===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(u(317));We=gy(l)}else We=Ln&&r===27?fy(l.type,We):Fn?Am(l.stateNode):null;return!0}function ta(){ya&&(We=Fn=null,se=!1)}function ea(){var l=wl;return l!==null&&(ui===null?ui=l:ui.push.apply(ui,l),wl=null),l}function An(l){wl===null?wl=[l]:wl.push(l)}function Ba(l,r,h){Hi?(A(Xs,r._currentValue),r._currentValue=h):(A(Xs,r._currentValue2),r._currentValue2=h)}function pn(l){var r=Xs.current;Hi?l._currentValue=r:l._currentValue2=r,D(Xs)}function ha(l,r,h){for(;l!==null;){var g=l.alternate;if((l.childLanes&r)!==r?(l.childLanes|=r,g!==null&&(g.childLanes|=r)):g!==null&&(g.childLanes&r)!==r&&(g.childLanes|=r),l===h)break;l=l.return}}function Ji(l,r,h,g){var E=l.child;for(E!==null&&(E.return=l);E!==null;){var T=E.dependencies;if(T!==null){var z=E.child;T=T.firstContext;t:for(;T!==null;){var L=T;T=E;for(var ft=0;ft<r.length;ft++)if(L.context===r[ft]){T.lanes|=h,L=T.alternate,L!==null&&(L.lanes|=h),ha(T.return,h,l),g||(z=null);break t}T=L.next}}else if(E.tag===18){if(z=E.return,z===null)throw Error(u(341));z.lanes|=h,T=z.alternate,T!==null&&(T.lanes|=h),ha(z,h,l),z=null}else z=E.child;if(z!==null)z.return=E;else for(z=E;z!==null;){if(z===l){z=null;break}if(E=z.sibling,E!==null){E.return=z.return,z=E;break}z=z.return}E=z}}function di(l,r,h,g){l=null;for(var E=r,T=!1;E!==null;){if(!T){if((E.flags&524288)!==0)T=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var z=E.alternate;if(z===null)throw Error(u(387));if(z=z.memoizedProps,z!==null){var L=E.type;Sa(E.pendingProps.value,z.value)||(l!==null?l.push(L):l=[L])}}else if(E===Ld.current){if(z=E.alternate,z===null)throw Error(u(387));z.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(l!==null?l.push(fr):l=[fr])}E=E.return}l!==null&&Ji(r,l,h,g),r.flags|=262144}function Fi(l){for(l=l.firstContext;l!==null;){var r=l.context;if(!Sa(Hi?r._currentValue:r._currentValue2,l.memoizedValue))return!0;l=l.next}return!1}function Mn(l){Ka=l,$e=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function rn(l){return Ut(Ka,l)}function Mi(l,r){return Ka===null&&Mn(l),Ut(l,r)}function Ut(l,r){var h=Hi?r._currentValue:r._currentValue2;if(r={context:r,memoizedValue:h,next:null},$e===null){if(l===null)throw Error(u(308));$e=r,l.dependencies={lanes:0,firstContext:r},l.flags|=524288}else $e=$e.next=r;return h}function Ae(){return{controller:new Ks,data:new Map,refCount:0}}function jn(l){l.refCount--,l.refCount===0&&Na(m3,function(){l.controller.abort()})}function Va(){}function ke(l){l!==ri&&l.next===null&&(ri===null?zn=ri=l:ri=ri.next=l),wu=!0,Vm||(Vm=!0,Cg())}function mn(l,r){if(!go&&wu){go=!0;do for(var h=!1,g=zn;g!==null;){if(l!==0){var E=g.pendingLanes;if(E===0)var T=0;else{var z=g.suspendedLanes,L=g.pingedLanes;T=(1<<31-ii(42|l)+1)-1,T&=E&~(z&~L),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(h=!0,Pr(g,T))}else T=ce,T=O(g,g===Le?T:0,g.cancelPendingCommit!==null||g.timeoutHandle!==Ml),(T&3)===0||U(g,T)||(h=!0,Pr(g,T));g=g.next}while(h);go=!1}}function eu(){Lr()}function Lr(){wu=Vm=!1;var l=0;hs!==0&&Tm()&&(l=hs);for(var r=Me(),h=null,g=zn;g!==null;){var E=g.next,T=nu(g,r);T===0?(g.next=null,h===null?zn=E:h.next=E,E===null&&(ri=h)):(h=g,(l!==0||(T&3)!==0)&&(wu=!0)),g=E}we!==0&&we!==5||mn(l),hs!==0&&(hs=0)}function nu(l,r){for(var h=l.suspendedLanes,g=l.pingedLanes,E=l.expirationTimes,T=l.pendingLanes&-62914561;0<T;){var z=31-ii(T),L=1<<z,ft=E[z];ft===-1?((L&h)===0||(L&g)!==0)&&(E[z]=j(L,r)):ft<=r&&(l.expiredLanes|=L),T&=~L}if(r=Le,h=ce,h=O(l,l===r?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==Ml),g=l.callbackNode,h===0||l===r&&(He===2||He===9)||l.cancelPendingCommit!==null)return g!==null&&g!==null&&ae(g),l.callbackNode=null,l.callbackPriority=0;if((h&3)===0||U(l,h)){if(r=h&-h,r===l.callbackPriority)return r;switch(g!==null&&ae(g),rt(h)){case 2:case 8:h=Rl;break;case 32:h=zl;break;case 268435456:h=Ru;break;default:h=zl}return g=da.bind(null,l),h=Vd(h,g),l.callbackPriority=r,l.callbackNode=h,r}return g!==null&&g!==null&&ae(g),l.callbackPriority=2,l.callbackNode=null,2}function da(l,r){if(we!==0&&we!==5)return l.callbackNode=null,l.callbackPriority=0,null;var h=l.callbackNode;if(On()&&l.callbackNode!==h)return null;var g=ce;return g=O(l,l===Le?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==Ml),g===0?null:(am(l,g,r),nu(l,Me()),l.callbackNode!=null&&l.callbackNode===h?da.bind(null,l):null)}function Pr(l,r){if(On())return null;am(l,r,!0)}function Cg(){kg?Ps(function(){(re&6)!==0?Vd(Oy,eu):Lr()}):Vd(Oy,eu)}function Yr(){if(hs===0){var l=Uu;l===0&&(l=Ef,Ef<<=1,(Ef&261888)===0&&(Ef=256)),hs=l}return hs}function au(l,r){if(xf===null){var h=xf=[];Gm=0,Uu=Yr(),Bu={status:"pending",value:void 0,then:function(g){h.push(g)}}}return Gm++,r.then(Ht,Ht),r}function Ht(){if(--Gm===0&&xf!==null){Bu!==null&&(Bu.status="fulfilled");var l=xf;xf=null,Uu=0,Bu=null;for(var r=0;r<l.length;r++)(0,l[r])()}}function ge(l,r){var h=[],g={status:"pending",value:null,reason:null,then:function(E){h.push(E)}};return l.then(function(){g.status="fulfilled",g.value=r;for(var E=0;E<h.length;E++)(0,h[E])(r)},function(E){for(g.status="rejected",g.reason=E,E=0;E<h.length;E++)(0,h[E])(void 0)}),g}function qr(){var l=pr.current;return l!==null?l:Le.pooledCache}function Wl(l,r){r===null?A(pr,pr.current):A(pr,r.pool)}function Nh(){var l=qr();return l===null?null:{parent:Hi?un._currentValue:un._currentValue2,pool:l}}function _c(l,r){if(Sa(l,r))return!0;if(typeof l!="object"||l===null||typeof r!="object"||r===null)return!1;var h=Object.keys(l),g=Object.keys(r);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var E=h[g];if(!Um.call(r,E)||!Sa(l[E],r[E]))return!1}return!0}function O0(l){return l=l.status,l==="fulfilled"||l==="rejected"}function fl(l,r,h){switch(h=l[h],h===void 0?l.push(r):h!==r&&(r.then(Va,Va),r=h),r.status){case"fulfilled":return r.value;case"rejected":throw l=r.reason,Xr(l),l;default:if(typeof r.status=="string")r.then(Va,Va);else{if(l=Le,l!==null&&100<l.shellSuspendCounter)throw Error(u(482));l=r,l.status="pending",l.then(function(g){if(r.status==="pending"){var E=r;E.status="fulfilled",E.value=g}},function(g){if(r.status==="pending"){var E=r;E.status="rejected",E.reason=g}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw l=r.reason,Xr(l),l}throw Gi=r,Vu}}function Wa(l){try{var r=l._init;return r(l._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Gi=h,Vu):h}}function xc(){if(Gi===null)throw Error(u(459));var l=Gi;return Gi=null,l}function Xr(l){if(l===Vu||l===qd)throw Error(u(483))}function pi(l){var r=Df;return Df+=1,ji===null&&(ji=[]),fl(ji,l,r)}function Kr(l,r){r=r.props.ref,l.ref=r!==void 0?r:null}function Qr(l,r){throw r.$$typeof===bd?Error(u(525)):(l=Object.prototype.toString.call(r),Error(u(31,l==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":l)))}function R0(l){function r(it,Z){if(l){var ut=it.deletions;ut===null?(it.deletions=[Z],it.flags|=16):ut.push(Z)}}function h(it,Z){if(!l)return null;for(;Z!==null;)r(it,Z),Z=Z.sibling;return null}function g(it){for(var Z=new Map;it!==null;)it.key!==null?Z.set(it.key,it):Z.set(it.index,it),it=it.sibling;return Z}function E(it,Z){return it=Vs(it,Z),it.index=0,it.sibling=null,it}function T(it,Z,ut){return it.index=ut,l?(ut=it.alternate,ut!==null?(ut=ut.index,ut<Z?(it.flags|=67108866,Z):ut):(it.flags|=67108866,Z)):(it.flags|=1048576,Z)}function z(it){return l&&it.alternate===null&&(it.flags|=67108866),it}function L(it,Z,ut,_t){return Z===null||Z.tag!==6?(Z=of(ut,it.mode,_t),Z.return=it,Z):(Z=E(Z,ut),Z.return=it,Z)}function ft(it,Z,ut,_t){var jt=ut.type;return jt===io?Mt(it,Z,ut.props.children,_t,ut.key):Z!==null&&(Z.elementType===jt||typeof jt=="object"&&jt!==null&&jt.$$typeof===ur&&Wa(jt)===Z.type)?(Z=E(Z,ut.props),Kr(Z,ut),Z.return=it,Z):(Z=rf(ut.type,ut.key,ut.props,null,it.mode,_t),Kr(Z,ut),Z.return=it,Z)}function vt(it,Z,ut,_t){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ut.containerInfo||Z.stateNode.implementation!==ut.implementation?(Z=yd(ut,it.mode,_t),Z.return=it,Z):(Z=E(Z,ut.children||[]),Z.return=it,Z)}function Mt(it,Z,ut,_t,jt){return Z===null||Z.tag!==7?(Z=Dl(ut,it.mode,_t,jt),Z.return=it,Z):(Z=E(Z,ut),Z.return=it,Z)}function xt(it,Z,ut){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=of(""+Z,it.mode,ut),Z.return=it,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case cf:return ut=rf(Z.type,Z.key,Z.props,null,it.mode,ut),Kr(ut,Z),ut.return=it,ut;case or:return Z=yd(Z,it.mode,ut),Z.return=it,Z;case ur:return Z=Wa(Z),xt(it,Z,ut)}if(cr(Z)||b(Z))return Z=Dl(Z,it.mode,ut,null),Z.return=it,Z;if(typeof Z.then=="function")return xt(it,pi(Z),ut);if(Z.$$typeof===Al)return xt(it,Mi(it,Z),ut);Qr(it,Z)}return null}function Rt(it,Z,ut,_t){var jt=Z!==null?Z.key:null;if(typeof ut=="string"&&ut!==""||typeof ut=="number"||typeof ut=="bigint")return jt!==null?null:L(it,Z,""+ut,_t);if(typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case cf:return ut.key===jt?ft(it,Z,ut,_t):null;case or:return ut.key===jt?vt(it,Z,ut,_t):null;case ur:return ut=Wa(ut),Rt(it,Z,ut,_t)}if(cr(ut)||b(ut))return jt!==null?null:Mt(it,Z,ut,_t,null);if(typeof ut.then=="function")return Rt(it,Z,pi(ut),_t);if(ut.$$typeof===Al)return Rt(it,Z,Mi(it,ut),_t);Qr(it,ut)}return null}function Yt(it,Z,ut,_t,jt){if(typeof _t=="string"&&_t!==""||typeof _t=="number"||typeof _t=="bigint")return it=it.get(ut)||null,L(Z,it,""+_t,jt);if(typeof _t=="object"&&_t!==null){switch(_t.$$typeof){case cf:return it=it.get(_t.key===null?ut:_t.key)||null,ft(Z,it,_t,jt);case or:return it=it.get(_t.key===null?ut:_t.key)||null,vt(Z,it,_t,jt);case ur:return _t=Wa(_t),Yt(it,Z,ut,_t,jt)}if(cr(_t)||b(_t))return it=it.get(ut)||null,Mt(Z,it,_t,jt,null);if(typeof _t.then=="function")return Yt(it,Z,ut,pi(_t),jt);if(_t.$$typeof===Al)return Yt(it,Z,ut,Mi(Z,_t),jt);Qr(Z,_t)}return null}function tn(it,Z,ut,_t){for(var jt=null,cn=null,Xt=Z,_e=Z=0,fe=null;Xt!==null&&_e<ut.length;_e++){Xt.index>_e?(fe=Xt,Xt=null):fe=Xt.sibling;var ye=Rt(it,Xt,ut[_e],_t);if(ye===null){Xt===null&&(Xt=fe);break}l&&Xt&&ye.alternate===null&&r(it,Xt),Z=T(ye,Z,_e),cn===null?jt=ye:cn.sibling=ye,cn=ye,Xt=fe}if(_e===ut.length)return h(it,Xt),se&&St(it,_e),jt;if(Xt===null){for(;_e<ut.length;_e++)Xt=xt(it,ut[_e],_t),Xt!==null&&(Z=T(Xt,Z,_e),cn===null?jt=Xt:cn.sibling=Xt,cn=Xt);return se&&St(it,_e),jt}for(Xt=g(Xt);_e<ut.length;_e++)fe=Yt(Xt,it,_e,ut[_e],_t),fe!==null&&(l&&fe.alternate!==null&&Xt.delete(fe.key===null?_e:fe.key),Z=T(fe,Z,_e),cn===null?jt=fe:cn.sibling=fe,cn=fe);return l&&Xt.forEach(function(Gl){return r(it,Gl)}),se&&St(it,_e),jt}function kn(it,Z,ut,_t){if(ut==null)throw Error(u(151));for(var jt=null,cn=null,Xt=Z,_e=Z=0,fe=null,ye=ut.next();Xt!==null&&!ye.done;_e++,ye=ut.next()){Xt.index>_e?(fe=Xt,Xt=null):fe=Xt.sibling;var Gl=Rt(it,Xt,ye.value,_t);if(Gl===null){Xt===null&&(Xt=fe);break}l&&Xt&&Gl.alternate===null&&r(it,Xt),Z=T(Gl,Z,_e),cn===null?jt=Gl:cn.sibling=Gl,cn=Gl,Xt=fe}if(ye.done)return h(it,Xt),se&&St(it,_e),jt;if(Xt===null){for(;!ye.done;_e++,ye=ut.next())ye=xt(it,ye.value,_t),ye!==null&&(Z=T(ye,Z,_e),cn===null?jt=ye:cn.sibling=ye,cn=ye);return se&&St(it,_e),jt}for(Xt=g(Xt);!ye.done;_e++,ye=ut.next())ye=Yt(Xt,it,_e,ye.value,_t),ye!==null&&(l&&ye.alternate!==null&&Xt.delete(ye.key===null?_e:ye.key),Z=T(ye,Z,_e),cn===null?jt=ye:cn.sibling=ye,cn=ye);return l&&Xt.forEach(function(zf){return r(it,zf)}),se&&St(it,_e),jt}function Eo(it,Z,ut,_t){if(typeof ut=="object"&&ut!==null&&ut.type===io&&ut.key===null&&(ut=ut.props.children),typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case cf:t:{for(var jt=ut.key;Z!==null;){if(Z.key===jt){if(jt=ut.type,jt===io){if(Z.tag===7){h(it,Z.sibling),_t=E(Z,ut.props.children),_t.return=it,it=_t;break t}}else if(Z.elementType===jt||typeof jt=="object"&&jt!==null&&jt.$$typeof===ur&&Wa(jt)===Z.type){h(it,Z.sibling),_t=E(Z,ut.props),Kr(_t,ut),_t.return=it,it=_t;break t}h(it,Z);break}else r(it,Z);Z=Z.sibling}ut.type===io?(_t=Dl(ut.props.children,it.mode,_t,ut.key),_t.return=it,it=_t):(_t=rf(ut.type,ut.key,ut.props,null,it.mode,_t),Kr(_t,ut),_t.return=it,it=_t)}return z(it);case or:t:{for(jt=ut.key;Z!==null;){if(Z.key===jt)if(Z.tag===4&&Z.stateNode.containerInfo===ut.containerInfo&&Z.stateNode.implementation===ut.implementation){h(it,Z.sibling),_t=E(Z,ut.children||[]),_t.return=it,it=_t;break t}else{h(it,Z);break}else r(it,Z);Z=Z.sibling}_t=yd(ut,it.mode,_t),_t.return=it,it=_t}return z(it);case ur:return ut=Wa(ut),Eo(it,Z,ut,_t)}if(cr(ut))return tn(it,Z,ut,_t);if(b(ut)){if(jt=b(ut),typeof jt!="function")throw Error(u(150));return ut=jt.call(ut),kn(it,Z,ut,_t)}if(typeof ut.then=="function")return Eo(it,Z,pi(ut),_t);if(ut.$$typeof===Al)return Eo(it,Z,Mi(it,ut),_t);Qr(it,ut)}return typeof ut=="string"&&ut!==""||typeof ut=="number"||typeof ut=="bigint"?(ut=""+ut,Z!==null&&Z.tag===6?(h(it,Z.sibling),_t=E(Z,ut),_t.return=it,it=_t):(h(it,Z),_t=of(ut,it.mode,_t),_t.return=it,it=_t),z(it)):h(it,Z)}return function(it,Z,ut,_t){try{Df=0;var jt=Eo(it,Z,ut,_t);return ji=null,jt}catch(Xt){if(Xt===Vu||Xt===qd)throw Xt;var cn=i(29,Xt,null,it.mode);return cn.lanes=_t,cn.return=it,cn}}}function Ca(){for(var l=ds,r=jm=ds=0;r<l;){var h=Li[r];Li[r++]=null;var g=Li[r];Li[r++]=null;var E=Li[r];Li[r++]=null;var T=Li[r];if(Li[r++]=null,g!==null&&E!==null){var z=g.pending;z===null?E.next=E:(E.next=z.next,z.next=E),g.pending=E}T!==0&&iu(h,E,T)}}function hl(l,r,h,g){Li[ds++]=l,Li[ds++]=r,Li[ds++]=h,Li[ds++]=g,jm|=g,l.lanes|=g,l=l.alternate,l!==null&&(l.lanes|=g)}function dl(l,r,h,g){return hl(l,r,h,g),Zr(l)}function $l(l,r){return hl(l,null,null,r),Zr(l)}function iu(l,r,h){l.lanes|=h;var g=l.alternate;g!==null&&(g.lanes|=h);for(var E=!1,T=l.return;T!==null;)T.childLanes|=h,g=T.alternate,g!==null&&(g.childLanes|=h),T.tag===22&&(l=T.stateNode,l===null||l._visibility&1||(E=!0)),l=T,T=T.return;return l.tag===3?(T=l.stateNode,E&&r!==null&&(E=31-ii(h),l=T.hiddenUpdates,g=l[E],g===null?l[E]=[r]:g.push(r),r.lane=h|536870912),T):null}function Zr(l){if(50<qu)throw qu=0,rp=null,Error(u(185));for(var r=l.return;r!==null;)l=r,r=l.return;return l.tag===3?l.stateNode:null}function Dc(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jr(l,r){l=l.updateQueue,r.updateQueue===l&&(r.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function mi(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function Ds(l,r,h){var g=l.updateQueue;if(g===null)return null;if(g=g.shared,(re&2)!==0){var E=g.pending;return E===null?r.next=r:(r.next=E.next,E.next=r),g.pending=r,r=Zr(l),iu(l,null,h),r}return hl(l,g,r,h),Zr(l)}function Ac(l,r,h){if(r=r.updateQueue,r!==null&&(r=r.shared,(h&4194048)!==0)){var g=r.lanes;g&=l.pendingLanes,h|=g,r.lanes=h,et(l,h)}}function z0(l,r){var h=l.updateQueue,g=l.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var E=null,T=null;if(h=h.firstBaseUpdate,h!==null){do{var z={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};T===null?E=T=z:T=T.next=z,h=h.next}while(h!==null);T===null?E=T=r:T=T.next=r}else E=T=r;h={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:T,shared:g.shared,callbacks:g.callbacks},l.updateQueue=h;return}l=h.lastBaseUpdate,l===null?h.firstBaseUpdate=r:l.next=r,h.lastBaseUpdate=r}function su(){if(Lm){var l=Bu;if(l!==null)throw l}}function Fr(l,r,h,g){Lm=!1;var E=l.updateQueue;mr=!1;var T=E.firstBaseUpdate,z=E.lastBaseUpdate,L=E.shared.pending;if(L!==null){E.shared.pending=null;var ft=L,vt=ft.next;ft.next=null,z===null?T=vt:z.next=vt,z=ft;var Mt=l.alternate;Mt!==null&&(Mt=Mt.updateQueue,L=Mt.lastBaseUpdate,L!==z&&(L===null?Mt.firstBaseUpdate=vt:L.next=vt,Mt.lastBaseUpdate=ft))}if(T!==null){var xt=E.baseState;z=0,Mt=vt=ft=null,L=T;do{var Rt=L.lane&-536870913,Yt=Rt!==L.lane;if(Yt?(ce&Rt)===Rt:(g&Rt)===Rt){Rt!==0&&Rt===Uu&&(Lm=!0),Mt!==null&&(Mt=Mt.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});t:{var tn=l,kn=L;Rt=r;var Eo=h;switch(kn.tag){case 1:if(tn=kn.payload,typeof tn=="function"){xt=tn.call(Eo,xt,Rt);break t}xt=tn;break t;case 3:tn.flags=tn.flags&-65537|128;case 0:if(tn=kn.payload,Rt=typeof tn=="function"?tn.call(Eo,xt,Rt):tn,Rt==null)break t;xt=yi({},xt,Rt);break t;case 2:mr=!0}}Rt=L.callback,Rt!==null&&(l.flags|=64,Yt&&(l.flags|=8192),Yt=E.callbacks,Yt===null?E.callbacks=[Rt]:Yt.push(Rt))}else Yt={lane:Rt,tag:L.tag,payload:L.payload,callback:L.callback,next:null},Mt===null?(vt=Mt=Yt,ft=xt):Mt=Mt.next=Yt,z|=Rt;if(L=L.next,L===null){if(L=E.shared.pending,L===null)break;Yt=L,L=Yt.next,Yt.next=null,E.lastBaseUpdate=Yt,E.shared.pending=null}}while(!0);Mt===null&&(ft=xt),E.baseState=ft,E.firstBaseUpdate=vt,E.lastBaseUpdate=Mt,T===null&&(E.shared.lanes=0),vr|=z,l.lanes=z,l.memoizedState=xt}}function H0(l,r){if(typeof l!="function")throw Error(u(191,l));l.call(r)}function _g(l,r){var h=l.callbacks;if(h!==null)for(l.callbacks=null,l=0;l<h.length;l++)H0(h[l],r)}function Bt(l,r){l=Bl,A(Kd,l),A(Qs,r),Bl=l|r.baseLanes}function Mc(){A(Kd,Bl),A(Qs,Qs.current)}function pl(){Bl=Kd.current,D(Qs),D(Kd)}function ml(l){var r=l.alternate;A(Hn,Hn.current&1),A(Si,l),Pi===null&&(r===null||Qs.current!==null||r.memoizedState!==null)&&(Pi=l)}function lu(l){A(Hn,Hn.current),A(Si,l),Pi===null&&(Pi=l)}function As(l){l.tag===22?(A(Hn,Hn.current),A(Si,l),Pi===null&&(Pi=l)):gl()}function gl(){A(Hn,Hn.current),A(Si,Si.current)}function $a(l){D(Si),Pi===l&&(Pi=null),D(Hn)}function yl(l){for(var r=l;r!==null;){if(r.tag===13){var h=r.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||vf(h)||Sf(h)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===l)break;for(;r.sibling===null;){if(r.return===null||r.return===l)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function on(){throw Error(u(321))}function vl(l,r){if(r===null)return!1;for(var h=0;h<r.length&&h<l.length;h++)if(!Sa(l[h],r[h]))return!1;return!0}function Nc(l,r,h,g,E,T){return Ul=T,kt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Gt.H=l===null||l.memoizedState===null?Hy:Pm,vo=!1,T=h(g,E),vo=!1,Gu&&(T=Oh(r,h,g,E)),ru(l),T}function ru(l){Gt.H=Af;var r=Ge!==null&&Ge.next!==null;if(Ul=0,Yn=Ge=kt=null,Qd=!1,ju=0,Lu=null,r)throw Error(u(300));l===null||qn||(l=l.dependencies,l!==null&&Fi(l)&&(qn=!0))}function Oh(l,r,h,g){kt=l;var E=0;do{if(Gu&&(Lu=null),ju=0,Gu=!1,25<=E)throw Error(u(301));if(E+=1,Yn=Ge=null,l.updateQueue!=null){var T=l.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}Gt.H=wy,T=r(h,g)}while(Gu);return T}function Rh(){var l=Gt.H,r=l.useState()[0];return r=typeof r.then=="function"?Ii(r):r,l=l.useState()[0],(Ge!==null?Ge.memoizedState:null)!==l&&(kt.flags|=1024),r}function Ms(){var l=Zd!==0;return Zd=0,l}function ki(l,r,h){r.updateQueue=l.updateQueue,r.flags&=-2053,l.lanes&=~h}function Oc(l){if(Qd){for(l=l.memoizedState;l!==null;){var r=l.queue;r!==null&&(r.pending=null),l=l.next}Qd=!1}Ul=0,Yn=Ge=kt=null,Gu=!1,ju=Zd=0,Lu=null}function pa(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yn===null?kt.memoizedState=Yn=l:Yn=Yn.next=l,Yn}function Ye(){if(Ge===null){var l=kt.alternate;l=l!==null?l.memoizedState:null}else l=Ge.next;var r=Yn===null?kt.memoizedState:Yn.next;if(r!==null)Yn=r,Ge=l;else{if(l===null)throw kt.alternate===null?Error(u(467)):Error(u(310));Ge=l,l={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},Yn===null?kt.memoizedState=Yn=l:Yn=Yn.next=l}return Yn}function kr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ii(l){var r=ju;return ju+=1,Lu===null&&(Lu=[]),l=fl(Lu,l,r),r=kt,(Yn===null?r.memoizedState:Yn.next)===null&&(r=r.alternate,Gt.H=r===null||r.memoizedState===null?Hy:Pm),l}function Ve(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return Ii(l);if(l.$$typeof===Al)return rn(l)}throw Error(u(438,String(l)))}function ou(l){var r=null,h=kt.updateQueue;if(h!==null&&(r=h.memoCache),r==null){var g=kt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(r={data:g.data.map(function(E){return E.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),h===null&&(h=kr(),kt.updateQueue=h),h.memoCache=r,h=r.data[r.index],h===void 0)for(h=r.data[r.index]=Array(l),g=0;g<l;g++)h[g]=Gs;return r.index++,h}function Ns(l,r){return typeof r=="function"?r(l):r}function uu(l){var r=Ye();return Sl(r,Ge,l)}function Sl(l,r,h){var g=l.queue;if(g===null)throw Error(u(311));g.lastRenderedReducer=h;var E=l.baseQueue,T=g.pending;if(T!==null){if(E!==null){var z=E.next;E.next=T.next,T.next=z}r.baseQueue=E=T,g.pending=null}if(T=l.baseState,E===null)l.memoizedState=T;else{r=E.next;var L=z=null,ft=null,vt=r,Mt=!1;do{var xt=vt.lane&-536870913;if(xt!==vt.lane?(ce&xt)===xt:(Ul&xt)===xt){var Rt=vt.revertLane;if(Rt===0)ft!==null&&(ft=ft.next={lane:0,revertLane:0,gesture:null,action:vt.action,hasEagerState:vt.hasEagerState,eagerState:vt.eagerState,next:null}),xt===Uu&&(Mt=!0);else if((Ul&Rt)===Rt){vt=vt.next,Rt===Uu&&(Mt=!0);continue}else xt={lane:0,revertLane:vt.revertLane,gesture:null,action:vt.action,hasEagerState:vt.hasEagerState,eagerState:vt.eagerState,next:null},ft===null?(L=ft=xt,z=T):ft=ft.next=xt,kt.lanes|=Rt,vr|=Rt;xt=vt.action,vo&&h(T,xt),T=vt.hasEagerState?vt.eagerState:h(T,xt)}else Rt={lane:xt,revertLane:vt.revertLane,gesture:vt.gesture,action:vt.action,hasEagerState:vt.hasEagerState,eagerState:vt.eagerState,next:null},ft===null?(L=ft=Rt,z=T):ft=ft.next=Rt,kt.lanes|=xt,vr|=xt;vt=vt.next}while(vt!==null&&vt!==r);if(ft===null?z=T:ft.next=L,!Sa(T,l.memoizedState)&&(qn=!0,Mt&&(h=Bu,h!==null)))throw h;l.memoizedState=T,l.baseState=z,l.baseQueue=ft,g.lastRenderedState=T}return E===null&&(g.lanes=0),[l.memoizedState,g.dispatch]}function Ir(l){var r=Ye(),h=r.queue;if(h===null)throw Error(u(311));h.lastRenderedReducer=l;var g=h.dispatch,E=h.pending,T=r.memoizedState;if(E!==null){h.pending=null;var z=E=E.next;do T=l(T,z.action),z=z.next;while(z!==E);Sa(T,r.memoizedState)||(qn=!0),r.memoizedState=T,r.baseQueue===null&&(r.baseState=T),h.lastRenderedState=T}return[T,g]}function Wi(l,r,h){var g=kt,E=Ye(),T=se;if(T){if(h===void 0)throw Error(u(407));h=h()}else h=r();var z=!Sa((Ge||E).memoizedState,h);if(z&&(E.memoizedState=h,qn=!0),E=E.queue,Hh(Rc.bind(null,g,E,l),[l]),E.getSnapshot!==r||z||Yn!==null&&Yn.memoizedState.tag&1){if(g.flags|=2048,ja(9,{destroy:void 0},Os.bind(null,g,E,h,r),null),Le===null)throw Error(u(349));T||(Ul&127)!==0||xg(g,r,h)}return h}function xg(l,r,h){l.flags|=16384,l={getSnapshot:r,value:h},r=kt.updateQueue,r===null?(r=kr(),kt.updateQueue=r,r.stores=[l]):(h=r.stores,h===null?r.stores=[l]:h.push(l))}function Os(l,r,h,g){r.value=h,r.getSnapshot=g,cu(r)&&zc(l)}function Rc(l,r,h){return h(function(){cu(r)&&zc(l)})}function cu(l){var r=l.getSnapshot;l=l.value;try{var h=r();return!Sa(l,h)}catch{return!0}}function zc(l){var r=$l(l,2);r!==null&&Pa(r,l,2)}function Ga(l){var r=pa();if(typeof l=="function"){var h=l;if(l=h(),vo){dt(!0);try{h()}finally{dt(!1)}}}return r.memoizedState=r.baseState=l,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:l},r}function ti(l,r,h,g){return l.baseState=h,Sl(l,Ge,typeof g=="function"?g:Ns)}function Rs(l,r,h,g,E){if(er(l))throw Error(u(485));if(l=r.action,l!==null){var T={payload:E,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(z){T.listeners.push(z)}};Gt.T!==null?h(!0):T.isTransition=!1,g(T),h=r.pending,h===null?(T.next=r.pending=T,$i(r,T)):(T.next=h.next,r.pending=h.next=T)}}function $i(l,r){var h=r.action,g=r.payload,E=l.state;if(r.isTransition){var T=Gt.T,z={};Gt.T=z;try{var L=h(E,g),ft=Gt.S;ft!==null&&ft(z,L),ts(l,r,L)}catch(vt){Hc(l,r,vt)}finally{T!==null&&z.types!==null&&(T.types=z.types),Gt.T=T}}else try{T=h(E,g),ts(l,r,T)}catch(vt){Hc(l,r,vt)}}function ts(l,r,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){es(l,r,g)},function(g){return Hc(l,r,g)}):es(l,r,h)}function es(l,r,h){r.status="fulfilled",r.value=h,zh(r),l.state=h,r=l.pending,r!==null&&(h=r.next,h===r?l.pending=null:(h=h.next,r.next=h,$i(l,h)))}function Hc(l,r,h){var g=l.pending;if(l.pending=null,g!==null){g=g.next;do r.status="rejected",r.reason=h,zh(r),r=r.next;while(r!==g)}l.action=null}function zh(l){l=l.listeners;for(var r=0;r<l.length;r++)(0,l[r])()}function w0(l,r){return r}function ns(l,r){if(se){var h=Le.formState;if(h!==null){t:{var g=kt;if(se){if(We){var E=uy(We,Vi);if(E){We=Am(E),g=cy(E);break t}}ln(g)}g=!1}g&&(r=h[0])}}h=pa(),h.memoizedState=h.baseState=r,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:w0,lastRenderedState:r},h.queue=g,h=jh.bind(null,kt,g),g.dispatch=h,g=Ga(!1);var T=hu.bind(null,kt,!1,g.queue);return g=pa(),E={state:r,dispatch:null,action:l,pending:null},g.queue=E,h=Rs.bind(null,kt,E,T,h),E.dispatch=h,g.memoizedState=l,[r,h,!1]}function U0(l){var r=Ye();return as(r,Ge,l)}function as(l,r,h){if(r=Sl(l,r,w0)[0],l=uu(Ns)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var g=Ii(r)}catch(z){throw z===Vu?qd:z}else g=r;r=Ye();var E=r.queue,T=E.dispatch;return h!==r.memoizedState&&(kt.flags|=2048,ja(9,{destroy:void 0},wc.bind(null,E,h),null)),[g,T,l]}function wc(l,r){l.action=r}function Uc(l){var r=Ye(),h=Ge;if(h!==null)return as(r,h,l);Ye(),r=r.memoizedState,h=Ye();var g=h.queue.dispatch;return h.memoizedState=l,[r,g,!1]}function ja(l,r,h,g){return l={tag:l,create:h,deps:g,inst:r,next:null},r=kt.updateQueue,r===null&&(r=kr(),kt.updateQueue=r),h=r.lastEffect,h===null?r.lastEffect=l.next=l:(g=h.next,h.next=l,l.next=g,r.lastEffect=l),l}function Wr(){return Ye().memoizedState}function Bc(l,r,h,g){var E=pa();kt.flags|=l,E.memoizedState=ja(1|r,{destroy:void 0},h,g===void 0?null:g)}function fu(l,r,h,g){var E=Ye();g=g===void 0?null:g;var T=E.memoizedState.inst;Ge!==null&&g!==null&&vl(g,Ge.memoizedState.deps)?E.memoizedState=ja(r,T,h,g):(kt.flags|=l,E.memoizedState=ja(1|r,T,h,g))}function B0(l,r){Bc(8390656,8,l,r)}function Hh(l,r){fu(2048,8,l,r)}function Dg(l){kt.flags|=4;var r=kt.updateQueue;if(r===null)r=kr(),kt.updateQueue=r,r.events=[l];else{var h=r.events;h===null?r.events=[l]:h.push(l)}}function wh(l){var r=Ye().memoizedState;return Dg({ref:r,nextImpl:l}),function(){if((re&2)!==0)throw Error(u(440));return r.impl.apply(void 0,arguments)}}function V0(l,r){return fu(4,2,l,r)}function Uh(l,r){return fu(4,4,l,r)}function Ag(l,r){if(typeof r=="function"){l=l();var h=r(l);return function(){typeof h=="function"?h():r(null)}}if(r!=null)return l=l(),r.current=l,function(){r.current=null}}function G0(l,r,h){h=h!=null?h.concat([l]):null,fu(4,4,Ag.bind(null,r,l),h)}function j0(){}function Bh(l,r){var h=Ye();r=r===void 0?null:r;var g=h.memoizedState;return r!==null&&vl(r,g[1])?g[0]:(h.memoizedState=[l,r],l)}function Vc(l,r){var h=Ye();r=r===void 0?null:r;var g=h.memoizedState;if(r!==null&&vl(r,g[1]))return g[0];if(g=l(),vo){dt(!0);try{l()}finally{dt(!1)}}return h.memoizedState=[g,r],g}function Vh(l,r,h){return h===void 0||(Ul&1073741824)!==0&&(ce&261930)===0?l.memoizedState=r:(l.memoizedState=h,l=ef(),kt.lanes|=l,vr|=l,h)}function Gc(l,r,h,g){return Sa(h,r)?h:Qs.current!==null?(l=Vh(l,h,g),Sa(l,r)||(qn=!0),l):(Ul&42)===0||(Ul&1073741824)!==0&&(ce&261930)===0?(qn=!0,l.memoizedState=h):(l=ef(),kt.lanes|=l,vr|=l,r)}function L0(l,r,h,g,E){var T=Ls();Jn(T!==0&&8>T?T:8);var z=Gt.T,L={};Gt.T=L,hu(l,!1,r,h);try{var ft=E(),vt=Gt.S;if(vt!==null&&vt(L,ft),ft!==null&&typeof ft=="object"&&typeof ft.then=="function"){var Mt=ge(ft,g);tr(l,r,Mt,ai(l))}else tr(l,r,g,ai(l))}catch(xt){tr(l,r,{then:function(){},status:"rejected",reason:xt},ai())}finally{Jn(T),z!==null&&L.types!==null&&(z.types=L.types),Gt.T=z}}function P0(l){var r=l.memoizedState;if(r!==null)return r;r={memoizedState:qa,baseState:qa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:qa},next:null};var h={};return r.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:h},next:null},l.memoizedState=r,l=l.alternate,l!==null&&(l.memoizedState=r),r}function Gh(){return rn(fr)}function bl(){return Ye().memoizedState}function Y0(){return Ye().memoizedState}function Mg(l){for(var r=l.return;r!==null;){switch(r.tag){case 24:case 3:var h=ai();l=mi(h);var g=Ds(r,l,h);g!==null&&(Pa(g,r,h),Ac(g,r,h)),r={cache:Ae()},l.payload=r;return}r=r.return}}function ma(l,r,h){var g=ai();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},er(l)?q0(r,h):(h=dl(l,r,h,g),h!==null&&(Pa(h,l,g),jc(h,r,g)))}function jh(l,r,h){var g=ai();tr(l,r,h,g)}function tr(l,r,h,g){var E={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(er(l))q0(r,E);else{var T=l.alternate;if(l.lanes===0&&(T===null||T.lanes===0)&&(T=r.lastRenderedReducer,T!==null))try{var z=r.lastRenderedState,L=T(z,h);if(E.hasEagerState=!0,E.eagerState=L,Sa(L,z))return hl(l,r,E,0),Le===null&&Ca(),!1}catch{}if(h=dl(l,r,E,g),h!==null)return Pa(h,l,g),jc(h,r,g),!0}return!1}function hu(l,r,h,g){if(g={lane:2,revertLane:Yr(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},er(l)){if(r)throw Error(u(479))}else r=dl(l,h,g,2),r!==null&&Pa(r,l,2)}function er(l){var r=l.alternate;return l===kt||r!==null&&r===kt}function q0(l,r){Gu=Qd=!0;var h=l.pending;h===null?r.next=r:(r.next=h.next,h.next=r),l.pending=r}function jc(l,r,h){if((h&4194048)!==0){var g=r.lanes;g&=l.pendingLanes,h|=g,r.lanes=h,et(l,h)}}function Lh(l,r,h,g){r=l.memoizedState,h=h(g,r),h=h==null?r:yi({},r,h),l.memoizedState=h,l.lanes===0&&(l.updateQueue.baseState=h)}function Lc(l,r,h,g,E,T,z){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(g,T,z):r.prototype&&r.prototype.isPureReactComponent?!_c(h,g)||!_c(E,T):!0}function X0(l,r,h,g){l=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(h,g),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(h,g),r.state!==l&&Jd.enqueueReplaceState(r,r.state,null)}function zs(l,r){var h=r;if("ref"in r){h={};for(var g in r)g!=="ref"&&(h[g]=r[g])}if(l=l.defaultProps){h===r&&(h=yi({},h));for(var E in l)h[E]===void 0&&(h[E]=l[E])}return h}function Pc(l,r){try{var h=l.onUncaughtError;h(r.value,{componentStack:r.stack})}catch(g){setTimeout(function(){throw g})}}function K0(l,r,h){try{var g=l.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function du(l,r,h){return h=mi(h),h.tag=3,h.payload={element:null},h.callback=function(){Pc(l,r)},h}function Yc(l){return l=mi(l),l.tag=3,l}function Ph(l,r,h,g){var E=h.type.getDerivedStateFromError;if(typeof E=="function"){var T=g.value;l.payload=function(){return E(T)},l.callback=function(){K0(r,h,g)}}var z=h.stateNode;z!==null&&typeof z.componentDidCatch=="function"&&(l.callback=function(){K0(r,h,g),typeof E!="function"&&(Sr===null?Sr=new Set([this]):Sr.add(this));var L=g.stack;this.componentDidCatch(g.value,{componentStack:L!==null?L:""})})}function _a(l,r,h,g,E){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(r=h.alternate,r!==null&&di(r,h,E,!0),h=Si.current,h!==null){switch(h.tag){case 31:case 13:return Pi===null?Eu():h.alternate===null&&yn===0&&(yn=3),h.flags&=-257,h.flags|=65536,h.lanes=E,g===Xd?h.flags|=16384:(r=h.updateQueue,r===null?h.updateQueue=new Set([g]):r.add(g),dd(l,g,E)),!1;case 22:return h.flags|=65536,g===Xd?h.flags|=16384:(r=h.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=r):(h=r.retryQueue,h===null?r.retryQueue=new Set([g]):h.add(g)),dd(l,g,E)),!1}throw Error(u(435,h.tag))}return dd(l,g,E),Eu(),!1}if(se)return r=Si.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=E,g!==Bm&&(l=Error(u(422),{cause:g}),An(at(l,h)))):(g!==Bm&&(r=Error(u(423),{cause:g}),An(at(r,h))),l=l.current.alternate,l.flags|=65536,E&=-E,l.lanes|=E,g=at(g,h),E=du(l.stateNode,g,E),z0(l,E),yn!==4&&(yn=2)),!1;var T=Error(u(520),{cause:g});if(T=at(T,h),Of===null?Of=[T]:Of.push(T),yn!==4&&(yn=2),r===null)return!0;g=at(g,h),h=r;do{switch(h.tag){case 3:return h.flags|=65536,l=E&-E,h.lanes|=l,l=du(h.stateNode,g,l),z0(h,l),!1;case 1:if(r=h.type,T=h.stateNode,(h.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Sr===null||!Sr.has(T))))return h.flags|=65536,E&=-E,h.lanes|=E,E=Yc(E),Ph(E,l,h,g),z0(h,E),!1}h=h.return}while(h!==null);return!1}function na(l,r,h,g){r.child=l===null?zy(r,null,h,g):yo(r,l.child,h,g)}function qc(l,r,h,g,E){h=h.render;var T=r.ref;if("ref"in g){var z={};for(var L in g)L!=="ref"&&(z[L]=g[L])}else z=g;return Mn(r),g=Nc(l,r,h,z,T,E),L=Ms(),l!==null&&!qn?(ki(l,r,E),ei(l,r,E)):(se&&L&>(r),r.flags|=1,na(l,r,g,E),r.child)}function Yh(l,r,h,g,E){if(l===null){var T=h.type;return typeof T=="function"&&!lf(T)&&T.defaultProps===void 0&&h.compare===null?(r.tag=15,r.type=T,qh(l,r,T,g,E)):(l=rf(h.type,null,g,r,r.mode,E),l.ref=r.ref,l.return=r,r.child=l)}if(T=l.child,!gu(l,E)){var z=T.memoizedProps;if(h=h.compare,h=h!==null?h:_c,h(z,g)&&l.ref===r.ref)return ei(l,r,E)}return r.flags|=1,l=Vs(T,g),l.ref=r.ref,l.return=r,r.child=l}function qh(l,r,h,g,E){if(l!==null){var T=l.memoizedProps;if(_c(T,g)&&l.ref===r.ref)if(qn=!1,r.pendingProps=g=T,gu(l,E))(l.flags&131072)!==0&&(qn=!0);else return r.lanes=l.lanes,ei(l,r,E)}return Q0(l,r,h,g,E)}function El(l,r,h,g){var E=g.children,T=l!==null?l.memoizedState:null;if(l===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((r.flags&128)!==0){if(T=T!==null?T.baseLanes|h:h,l!==null){for(g=r.child=l.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~T}else g=0,r.child=null;return pu(l,r,T,h,g)}if((h&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},l!==null&&Wl(r,T!==null?T.cachePool:null),T!==null?Bt(r,T):Mc(),As(r);else return g=r.lanes=536870912,pu(l,r,T!==null?T.baseLanes|h:h,h,g)}else T!==null?(Wl(r,T.cachePool),Bt(r,T),gl(),r.memoizedState=null):(l!==null&&Wl(r,null),Mc(),gl());return na(l,r,E,h),r.child}function Ni(l,r){return l!==null&&l.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function pu(l,r,h,g,E){var T=qr();return T=T===null?null:{parent:Hi?un._currentValue:un._currentValue2,pool:T},r.memoizedState={baseLanes:h,cachePool:T},l!==null&&Wl(r,null),Mc(),As(r),l!==null&&di(l,r,g,!0),r.childLanes=E,null}function $r(l,r){return r=is({mode:r.mode,children:r.children},l.mode),r.ref=l.ref,l.child=r,r.return=l,r}function mu(l,r,h){return yo(r,l.child,null,h),l=$r(r,r.pendingProps),l.flags|=2,$a(r),r.memoizedState=null,l}function Xc(l,r,h){var g=r.pendingProps,E=(r.flags&128)!==0;if(r.flags&=-129,l===null){if(se){if(g.mode==="hidden")return l=$r(r,g),r.lanes=536870912,Ni(null,l);if(lu(r),(l=We)?(l=py(l,Vi),l!==null&&(r.memoizedState={dehydrated:l,treeContext:Hl!==null?{id:Xa,overflow:qs}:null,retryLane:536870912,hydrationErrors:null},h=gd(l),h.return=r,r.child=h,Fn=r,We=null)):l=null,l===null)throw ln(r);return r.lanes=536870912,null}return $r(r,g)}var T=l.memoizedState;if(T!==null){var z=T.dehydrated;if(lu(r),E)if(r.flags&256)r.flags&=-257,r=mu(l,r,h);else if(r.memoizedState!==null)r.child=l.child,r.flags|=128,r=null;else throw Error(u(558));else if(qn||di(l,r,h,!1),E=(h&l.childLanes)!==0,qn||E){if(g=Le,g!==null&&(z=nt(g,h),z!==0&&z!==T.retryLane))throw T.retryLane=z,$l(l,z),Pa(g,l,z),Fd;Eu(),r=mu(l,r,h)}else l=T.treeContext,ya&&(We=Mm(z),Fn=r,se=!0,wl=null,Vi=!1,l!==null&&Pt(r,l)),r=$r(r,g),r.flags|=4096;return r}return l=Vs(l.child,{mode:g.mode,children:g.children}),l.ref=r.ref,r.child=l,l.return=r,l}function Kc(l,r){var h=r.ref;if(h===null)l!==null&&l.ref!==null&&(r.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(u(284));(l===null||l.ref!==h)&&(r.flags|=4194816)}}function Q0(l,r,h,g,E){return Mn(r),h=Nc(l,r,h,g,void 0,E),g=Ms(),l!==null&&!qn?(ki(l,r,E),ei(l,r,E)):(se&&g&>(r),r.flags|=1,na(l,r,h,E),r.child)}function Z0(l,r,h,g,E,T){return Mn(r),r.updateQueue=null,h=Oh(r,g,h,E),ru(l),g=Ms(),l!==null&&!qn?(ki(l,r,T),ei(l,r,T)):(se&&g&>(r),r.flags|=1,na(l,r,h,T),r.child)}function J0(l,r,h,g,E){if(Mn(r),r.stateNode===null){var T=ho,z=h.contextType;typeof z=="object"&&z!==null&&(T=rn(z)),T=new h(g,T),r.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=Jd,r.stateNode=T,T._reactInternals=r,T=r.stateNode,T.props=g,T.state=r.memoizedState,T.refs={},Dc(r),z=h.contextType,T.context=typeof z=="object"&&z!==null?rn(z):ho,T.state=r.memoizedState,z=h.getDerivedStateFromProps,typeof z=="function"&&(Lh(r,h,z,g),T.state=r.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(z=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),z!==T.state&&Jd.enqueueReplaceState(T,T.state,null),Fr(r,g,T,E),su(),T.state=r.memoizedState),typeof T.componentDidMount=="function"&&(r.flags|=4194308),g=!0}else if(l===null){T=r.stateNode;var L=r.memoizedProps,ft=zs(h,L);T.props=ft;var vt=T.context,Mt=h.contextType;z=ho,typeof Mt=="object"&&Mt!==null&&(z=rn(Mt));var xt=h.getDerivedStateFromProps;Mt=typeof xt=="function"||typeof T.getSnapshotBeforeUpdate=="function",L=r.pendingProps!==L,Mt||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(L||vt!==z)&&X0(r,T,g,z),mr=!1;var Rt=r.memoizedState;T.state=Rt,Fr(r,g,T,E),su(),vt=r.memoizedState,L||Rt!==vt||mr?(typeof xt=="function"&&(Lh(r,h,xt,g),vt=r.memoizedState),(ft=mr||Lc(r,h,ft,g,Rt,vt,z))?(Mt||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(r.flags|=4194308)):(typeof T.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=g,r.memoizedState=vt),T.props=g,T.state=vt,T.context=z,g=ft):(typeof T.componentDidMount=="function"&&(r.flags|=4194308),g=!1)}else{T=r.stateNode,Jr(l,r),z=r.memoizedProps,Mt=zs(h,z),T.props=Mt,xt=r.pendingProps,Rt=T.context,vt=h.contextType,ft=ho,typeof vt=="object"&&vt!==null&&(ft=rn(vt)),L=h.getDerivedStateFromProps,(vt=typeof L=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(z!==xt||Rt!==ft)&&X0(r,T,g,ft),mr=!1,Rt=r.memoizedState,T.state=Rt,Fr(r,g,T,E),su();var Yt=r.memoizedState;z!==xt||Rt!==Yt||mr||l!==null&&l.dependencies!==null&&Fi(l.dependencies)?(typeof L=="function"&&(Lh(r,h,L,g),Yt=r.memoizedState),(Mt=mr||Lc(r,h,Mt,g,Rt,Yt,ft)||l!==null&&l.dependencies!==null&&Fi(l.dependencies))?(vt||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(g,Yt,ft),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(g,Yt,ft)),typeof T.componentDidUpdate=="function"&&(r.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof T.componentDidUpdate!="function"||z===l.memoizedProps&&Rt===l.memoizedState||(r.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||z===l.memoizedProps&&Rt===l.memoizedState||(r.flags|=1024),r.memoizedProps=g,r.memoizedState=Yt),T.props=g,T.state=Yt,T.context=ft,g=Mt):(typeof T.componentDidUpdate!="function"||z===l.memoizedProps&&Rt===l.memoizedState||(r.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||z===l.memoizedProps&&Rt===l.memoizedState||(r.flags|=1024),g=!1)}return T=g,Kc(l,r),g=(r.flags&128)!==0,T||g?(T=r.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:T.render(),r.flags|=1,l!==null&&g?(r.child=yo(r,l.child,null,E),r.child=yo(r,null,h,E)):na(l,r,h,E),r.memoizedState=T.state,l=r.child):l=ei(l,r,E),l}function Xh(l,r,h,g){return ta(),r.flags|=256,na(l,r,h,g),r.child}function Qc(l){return{baseLanes:l,cachePool:Nh()}}function Hs(l,r,h){return l=l!==null?l.childLanes&~h:0,r&&(l|=Ei),l}function Kh(l,r,h){var g=r.pendingProps,E=!1,T=(r.flags&128)!==0,z;if((z=T)||(z=l!==null&&l.memoizedState===null?!1:(Hn.current&2)!==0),z&&(E=!0,r.flags&=-129),z=(r.flags&32)!==0,r.flags&=-33,l===null){if(se){if(E?ml(r):gl(),(l=We)?(l=u3(l,Vi),l!==null&&(r.memoizedState={dehydrated:l,treeContext:Hl!==null?{id:Xa,overflow:qs}:null,retryLane:536870912,hydrationErrors:null},h=gd(l),h.return=r,r.child=h,Fn=r,We=null)):l=null,l===null)throw ln(r);return Sf(l)?r.lanes=32:r.lanes=536870912,null}var L=g.children;return g=g.fallback,E?(gl(),E=r.mode,L=is({mode:"hidden",children:L},E),g=Dl(g,E,h,null),L.return=r,g.return=r,L.sibling=g,r.child=L,g=r.child,g.memoizedState=Qc(h),g.childLanes=Hs(l,z,h),r.memoizedState=kd,Ni(null,g)):(ml(r),Qh(r,L))}var ft=l.memoizedState;if(ft!==null&&(L=ft.dehydrated,L!==null)){if(T)r.flags&256?(ml(r),r.flags&=-257,r=La(l,r,h)):r.memoizedState!==null?(gl(),r.child=l.child,r.flags|=128,r=null):(gl(),L=g.fallback,E=r.mode,g=is({mode:"visible",children:g.children},E),L=Dl(L,E,h,null),L.flags|=2,g.return=r,L.return=r,g.sibling=L,r.child=g,yo(r,l.child,null,h),g=r.child,g.memoizedState=Qc(h),g.childLanes=Hs(l,z,h),r.memoizedState=kd,r=Ni(null,g));else if(ml(r),Sf(L))z=uo(L).digest,g=Error(u(419)),g.stack="",g.digest=z,An({value:g,source:null,stack:null}),r=La(l,r,h);else if(qn||di(l,r,h,!1),z=(h&l.childLanes)!==0,qn||z){if(z=Le,z!==null&&(g=nt(z,h),g!==0&&g!==ft.retryLane))throw ft.retryLane=g,$l(l,g),Pa(z,l,g),Fd;vf(L)||Eu(),r=La(l,r,h)}else vf(L)?(r.flags|=192,r.child=l.child,r=null):(l=ft.treeContext,ya&&(We=hy(L),Fn=r,se=!0,wl=null,Vi=!1,l!==null&&Pt(r,l)),r=Qh(r,g.children),r.flags|=4096);return r}return E?(gl(),L=g.fallback,E=r.mode,ft=l.child,T=ft.sibling,g=Vs(ft,{mode:"hidden",children:g.children}),g.subtreeFlags=ft.subtreeFlags&65011712,T!==null?L=Vs(T,L):(L=Dl(L,E,h,null),L.flags|=2),L.return=r,g.return=r,g.sibling=L,r.child=g,Ni(null,g),g=r.child,L=l.child.memoizedState,L===null?L=Qc(h):(E=L.cachePool,E!==null?(ft=Hi?un._currentValue:un._currentValue2,E=E.parent!==ft?{parent:ft,pool:ft}:E):E=Nh(),L={baseLanes:L.baseLanes|h,cachePool:E}),g.memoizedState=L,g.childLanes=Hs(l,z,h),r.memoizedState=kd,Ni(l.child,g)):(ml(r),h=l.child,l=h.sibling,h=Vs(h,{mode:"visible",children:g.children}),h.return=r,h.sibling=null,l!==null&&(z=r.deletions,z===null?(r.deletions=[l],r.flags|=16):z.push(l)),r.child=h,r.memoizedState=null,h)}function Qh(l,r){return r=is({mode:"visible",children:r},l.mode),r.return=l,l.child=r}function is(l,r){return l=i(22,l,null,r),l.lanes=0,l}function La(l,r,h){return yo(r,l.child,null,h),l=Qh(r,r.pendingProps.children),l.flags|=2,r.memoizedState=null,l}function Zc(l,r,h){l.lanes|=r;var g=l.alternate;g!==null&&(g.lanes|=r),ha(l.return,r,h)}function Ft(l,r,h,g,E,T){var z=l.memoizedState;z===null?l.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:E,treeForkCount:T}:(z.isBackwards=r,z.rendering=null,z.renderingStartTime=0,z.last=g,z.tail=h,z.tailMode=E,z.treeForkCount=T)}function Et(l,r,h){var g=r.pendingProps,E=g.revealOrder,T=g.tail;g=g.children;var z=Hn.current,L=(z&2)!==0;if(L?(z=z&1|2,r.flags|=128):z&=1,A(Hn,z),na(l,r,g,h),g=se?lt:0,!L&&l!==null&&(l.flags&128)!==0)t:for(l=r.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Zc(l,h,r);else if(l.tag===19)Zc(l,h,r);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break t;for(;l.sibling===null;){if(l.return===null||l.return===r)break t;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(E){case"forwards":for(h=r.child,E=null;h!==null;)l=h.alternate,l!==null&&yl(l)===null&&(E=h),h=h.sibling;h=E,h===null?(E=r.child,r.child=null):(E=h.sibling,h.sibling=null),Ft(r,!1,E,h,T,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,E=r.child,r.child=null;E!==null;){if(l=E.alternate,l!==null&&yl(l)===null){r.child=E;break}l=E.sibling,E.sibling=h,h=E,E=l}Ft(r,!0,h,null,T,g);break;case"together":Ft(r,!1,null,null,void 0,g);break;default:r.memoizedState=null}return r.child}function ei(l,r,h){if(l!==null&&(r.dependencies=l.dependencies),vr|=r.lanes,(h&r.childLanes)===0)if(l!==null){if(di(l,r,h,!1),(h&r.childLanes)===0)return null}else return null;if(l!==null&&r.child!==l.child)throw Error(u(153));if(r.child!==null){for(l=r.child,h=Vs(l,l.pendingProps),r.child=h,h.return=r;l.sibling!==null;)l=l.sibling,h=h.sibling=Vs(l,l.pendingProps),h.return=r;h.sibling=null}return r.child}function gu(l,r){return(l.lanes&r)!==0?!0:(l=l.dependencies,!!(l!==null&&Fi(l)))}function gn(l,r,h){switch(r.tag){case 3:le(r,r.stateNode.containerInfo),Ba(r,un,l.memoizedState.cache),ta();break;case 27:case 5:xe(r);break;case 4:le(r,r.stateNode.containerInfo);break;case 10:Ba(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,lu(r),null;break;case 13:var g=r.memoizedState;if(g!==null)return g.dehydrated!==null?(ml(r),r.flags|=128,null):(h&r.child.childLanes)!==0?Kh(l,r,h):(ml(r),l=ei(l,r,h),l!==null?l.sibling:null);ml(r);break;case 19:var E=(l.flags&128)!==0;if(g=(h&r.childLanes)!==0,g||(di(l,r,h,!1),g=(h&r.childLanes)!==0),E){if(g)return Et(l,r,h);r.flags|=128}if(E=r.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),A(Hn,Hn.current),g)break;return null;case 22:return r.lanes=0,El(l,r,h,r.pendingProps);case 24:Ba(r,un,l.memoizedState.cache)}return ei(l,r,h)}function Zh(l,r,h){if(l!==null)if(l.memoizedProps!==r.pendingProps)qn=!0;else{if(!gu(l,h)&&(r.flags&128)===0)return qn=!1,gn(l,r,h);qn=(l.flags&131072)!==0}else qn=!1,se&&(r.flags&1048576)!==0&&$(r,lt,r.index);switch(r.lanes=0,r.tag){case 16:t:{var g=r.pendingProps;if(l=Wa(r.elementType),r.type=l,typeof l=="function")lf(l)?(g=zs(l,g),r.tag=1,r=J0(null,r,l,g,h)):(r.tag=0,r=Q0(null,r,l,g,h));else{if(l!=null){var E=l.$$typeof;if(E===Cu){r.tag=11,r=qc(null,r,l,g,h);break t}else if(E===gm){r.tag=14,r=Yh(null,r,l,g,h);break t}}throw r=_(l)||l,Error(u(306,r,""))}}return r;case 0:return Q0(l,r,r.type,r.pendingProps,h);case 1:return g=r.type,E=zs(g,r.pendingProps),J0(l,r,g,E,h);case 3:t:{if(le(r,r.stateNode.containerInfo),l===null)throw Error(u(387));var T=r.pendingProps;E=r.memoizedState,g=E.element,Jr(l,r),Fr(r,T,null,h);var z=r.memoizedState;if(T=z.cache,Ba(r,un,T),T!==E.cache&&Ji(r,[un],h,!0),su(),T=z.element,ya&&E.isDehydrated)if(E={element:T,isDehydrated:!1,cache:z.cache},r.updateQueue.baseState=E,r.memoizedState=E,r.flags&256){r=Xh(l,r,T,h);break t}else if(T!==g){g=at(Error(u(424)),r),An(g),r=Xh(l,r,T,h);break t}else for(ya&&(We=Nd(r.stateNode.containerInfo),Fn=r,se=!0,wl=null,Vi=!0),h=zy(r,null,T,h),r.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(ta(),T===g){r=ei(l,r,h);break t}na(l,r,T,h)}r=r.child}return r;case 26:if(wi)return Kc(l,r),l===null?(h=Mu(r.type,null,r.pendingProps,null))?r.memoizedState=h:se||(r.stateNode=Dy(r.type,r.pendingProps,dr.current,r)):r.memoizedState=Mu(r.type,l.memoizedProps,r.pendingProps,l.memoizedState),null;case 27:if(Ln)return xe(r),l===null&&Ln&&se&&(g=r.stateNode=wd(r.type,r.pendingProps,dr.current,ba.current,!1),Fn=r,Vi=!0,We=r3(r.type,g,We)),na(l,r,r.pendingProps.children,h),Kc(l,r),l===null&&(r.flags|=4194304),r.child;case 5:return l===null&&se&&(h3(r.type,r.pendingProps,ba.current),(E=g=We)&&(g=o3(g,r.type,r.pendingProps,Vi),g!==null?(r.stateNode=g,Fn=r,We=Md(g),Vi=!1,E=!0):E=!1),E||ln(r)),xe(r),E=r.type,T=r.pendingProps,z=l!==null?l.memoizedProps:null,g=T.children,pf(E,T)?g=null:z!==null&&pf(E,z)&&(r.flags|=32),r.memoizedState!==null&&(E=Nc(l,r,Rh,null,null,h),Hi?fr._currentValue=E:fr._currentValue2=E),Kc(l,r),na(l,r,g,h),r.child;case 6:return l===null&&se&&(Rm(r.pendingProps,ba.current),(l=h=We)&&(h=dy(h,r.pendingProps,Vi),h!==null?(r.stateNode=h,Fn=r,We=null,l=!0):l=!1),l||ln(r)),null;case 13:return Kh(l,r,h);case 4:return le(r,r.stateNode.containerInfo),g=r.pendingProps,l===null?r.child=yo(r,null,g,h):na(l,r,g,h),r.child;case 11:return qc(l,r,r.type,r.pendingProps,h);case 7:return na(l,r,r.pendingProps,h),r.child;case 8:return na(l,r,r.pendingProps.children,h),r.child;case 12:return na(l,r,r.pendingProps.children,h),r.child;case 10:return g=r.pendingProps,Ba(r,r.type,g.value),na(l,r,g.children,h),r.child;case 9:return E=r.type._context,g=r.pendingProps.children,Mn(r),E=rn(E),g=g(E),r.flags|=1,na(l,r,g,h),r.child;case 14:return Yh(l,r,r.type,r.pendingProps,h);case 15:return qh(l,r,r.type,r.pendingProps,h);case 19:return Et(l,r,h);case 31:return Xc(l,r,h);case 22:return El(l,r,h,r.pendingProps);case 24:return Mn(r),g=rn(un),l===null?(E=qr(),E===null&&(E=Le,T=Ae(),E.pooledCache=T,T.refCount++,T!==null&&(E.pooledCacheLanes|=h),E=T),r.memoizedState={parent:g,cache:E},Dc(r),Ba(r,un,E)):((l.lanes&h)!==0&&(Jr(l,r),Fr(r,null,null,h),su()),E=l.memoizedState,T=r.memoizedState,E.parent!==g?(E={parent:g,cache:g},r.memoizedState=E,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=E),Ba(r,un,g)):(g=T.cache,Ba(r,un,g),g!==E.cache&&Ji(r,[un],h,!0))),na(l,r,r.pendingProps.children,h),r.child;case 29:throw r.pendingProps}throw Error(u(156,r.tag))}function gi(l){l.flags|=4}function Jc(l){us&&(l.flags|=8)}function Jh(l,r){if(l!==null&&l.child===r.child)return!1;if((r.flags&16)!==0)return!0;for(l=r.child;l!==null;){if((l.flags&8218)!==0||(l.subtreeFlags&8218)!==0)return!0;l=l.sibling}return!1}function F0(l,r,h,g){if(Aa)for(h=r.child;h!==null;){if(h.tag===5||h.tag===6)Cd(l,h.stateNode);else if(!(h.tag===4||Ln&&h.tag===27)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===r)break;for(;h.sibling===null;){if(h.return===null||h.return===r)return;h=h.return}h.sibling.return=h.return,h=h.sibling}else if(us)for(var E=r.child;E!==null;){if(E.tag===5){var T=E.stateNode;h&&g&&(T=Nl(T,E.type,E.memoizedProps)),Cd(l,T)}else if(E.tag===6)T=E.stateNode,h&&g&&(T=yf(T,E.memoizedProps)),Cd(l,T);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)T=E.child,T!==null&&(T.return=E),F0(l,E,!0,!0);else if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===r)break;for(;E.sibling===null;){if(E.return===null||E.return===r)return;E=E.return}E.sibling.return=E.return,E=E.sibling}}function Fh(l,r,h,g){var E=!1;if(us)for(var T=r.child;T!==null;){if(T.tag===5){var z=T.stateNode;h&&g&&(z=Nl(z,T.type,T.memoizedProps)),Dm(l,z)}else if(T.tag===6)z=T.stateNode,h&&g&&(z=yf(z,T.memoizedProps)),Dm(l,z);else if(T.tag!==4){if(T.tag===22&&T.memoizedState!==null)E=T.child,E!==null&&(E.return=T),Fh(l,T,!0,!0),E=!0;else if(T.child!==null){T.child.return=T,T=T.child;continue}}if(T===r)break;for(;T.sibling===null;){if(T.return===null||T.return===r)return E;T=T.return}T.sibling.return=T.return,T=T.sibling}return E}function kh(l,r){if(us&&Jh(l,r)){l=r.stateNode;var h=l.containerInfo,g=Ie();Fh(g,r,!1,!1),l.pendingChildren=g,gi(r),ry(h,g)}}function Fc(l,r,h,g){if(Aa)l.memoizedProps!==g&&gi(r);else if(us){var E=l.stateNode,T=l.memoizedProps;if((l=Jh(l,r))||T!==g){var z=ba.current;T=ly(E,h,T,g,!l,null),T===E?r.stateNode=E:(Jc(r),qg(T,h,g,z)&&gi(r),r.stateNode=T,l&&F0(T,r,!1,!1))}else r.stateNode=E}}function ga(l,r,h,g,E){if((l.mode&32)!==0&&(h===null?Zg(r,g):s3(r,h,g))){if(l.flags|=16777216,(E&335544128)===E||_u(r,g))if(va(l.stateNode,r,g))l.flags|=8192;else if(Bg())l.flags|=8192;else throw Gi=Xd,Yd}else l.flags&=-16777217}function De(l,r){if(d3(r)){if(l.flags|=16777216,!Hd(r))if(Bg())l.flags|=8192;else throw Gi=Xd,Yd}else l.flags&=-16777217}function to(l,r){r!==null&&(l.flags|=4),l.flags&16384&&(r=l.tag!==22?V():536870912,l.lanes|=r,Pu|=r)}function Tl(l,r){if(!se)switch(l.tailMode){case"hidden":r=l.tail;for(var h=null;r!==null;)r.alternate!==null&&(h=r),r=r.sibling;h===null?l.tail=null:h.sibling=null;break;case"collapsed":h=l.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?r||l.tail===null?l.tail=null:l.tail.sibling=null:g.sibling=null}}function Ce(l){var r=l.alternate!==null&&l.alternate.child===l.child,h=0,g=0;if(r)for(var E=l.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=l,E=E.sibling;else for(E=l.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=l,E=E.sibling;return l.subtreeFlags|=g,l.childLanes=h,r}function eo(l,r,h){var g=r.pendingProps;switch(Tt(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ce(r),null;case 1:return Ce(r),null;case 3:return h=r.stateNode,g=null,l!==null&&(g=l.memoizedState.cache),r.memoizedState.cache!==g&&(r.flags|=2048),pn(un),xn(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(l===null||l.child===null)&&(ue(r)?gi(r):l===null||l.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,ea())),kh(l,r),Ce(r),null;case 26:if(wi){var E=r.type,T=r.memoizedState;return l===null?(gi(r),T!==null?(Ce(r),De(r,T)):(Ce(r),ga(r,E,null,g,h))):T?T!==l.memoizedState?(gi(r),Ce(r),De(r,T)):(Ce(r),r.flags&=-16777217):(T=l.memoizedProps,Aa?T!==g&&gi(r):Fc(l,r,E,g),Ce(r),ga(r,E,T,g,h)),null}case 27:if(Ln){if(Dn(r),h=dr.current,E=r.type,l!==null&&r.stateNode!=null)Aa?l.memoizedProps!==g&&gi(r):Fc(l,r,E,g);else{if(!g){if(r.stateNode===null)throw Error(u(166));return Ce(r),null}l=ba.current,ue(r)?Be(r,l):(l=wd(E,g,h,l,!0),r.stateNode=l,gi(r))}return Ce(r),null}case 5:if(Dn(r),E=r.type,l!==null&&r.stateNode!=null)Fc(l,r,E,g);else{if(!g){if(r.stateNode===null)throw Error(u(166));return Ce(r),null}if(T=ba.current,ue(r))Be(r,T),by(r.stateNode,E,g,T)&&(r.flags|=64);else{var z=js(E,g,dr.current,T,r);Jc(r),F0(z,r,!1,!1),r.stateNode=z,qg(z,E,g,T)&&gi(r)}}return Ce(r),ga(r,r.type,l===null?null:l.memoizedProps,r.pendingProps,h),null;case 6:if(l&&r.stateNode!=null)h=l.memoizedProps,Aa?h!==g&&gi(r):us&&(h!==g?(l=dr.current,h=ba.current,Jc(r),r.stateNode=_d(g,l,h,r)):r.stateNode=l.stateNode);else{if(typeof g!="string"&&r.stateNode===null)throw Error(u(166));if(l=dr.current,h=ba.current,ue(r)){if(!ya)throw Error(u(176));if(l=r.stateNode,h=r.memoizedProps,g=null,E=Fn,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}Od(l,h,r,g)||ln(r,!0)}else Jc(r),r.stateNode=_d(g,l,h,r)}return Ce(r),null;case 31:if(h=r.memoizedState,l===null||l.memoizedState!==null){if(g=ue(r),h!==null){if(l===null){if(!g)throw Error(u(318));if(!ya)throw Error(u(556));if(l=r.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(u(557));my(l,r)}else ta(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Ce(r),l=!1}else h=ea(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=h),l=!0;if(!l)return r.flags&256?($a(r),r):($a(r),null);if((r.flags&128)!==0)throw Error(u(558))}return Ce(r),null;case 13:if(g=r.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(E=ue(r),g!==null&&g.dehydrated!==null){if(l===null){if(!E)throw Error(u(318));if(!ya)throw Error(u(344));if(E=r.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(u(317));Nm(E,r)}else ta(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Ce(r),E=!1}else E=ea(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=E),E=!0;if(!E)return r.flags&256?($a(r),r):($a(r),null)}return $a(r),(r.flags&128)!==0?(r.lanes=h,r):(h=g!==null,l=l!==null&&l.memoizedState!==null,h&&(g=r.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),T=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(T=g.memoizedState.cachePool.pool),T!==E&&(g.flags|=2048)),h!==l&&h&&(r.child.flags|=8192),to(r,r.updateQueue),Ce(r),null);case 4:return xn(),kh(l,r),l===null&&i3(r.stateNode.containerInfo),Ce(r),null;case 10:return pn(r.type),Ce(r),null;case 19:if(D(Hn),g=r.memoizedState,g===null)return Ce(r),null;if(E=(r.flags&128)!==0,T=g.rendering,T===null)if(E)Tl(g,!1);else{if(yn!==0||l!==null&&(l.flags&128)!==0)for(l=r.child;l!==null;){if(T=yl(l),T!==null){for(r.flags|=128,Tl(g,!1),l=T.updateQueue,r.updateQueue=l,to(r,l),r.subtreeFlags=0,l=h,h=r.child;h!==null;)fm(h,l),h=h.sibling;return A(Hn,Hn.current&1|2),se&&St(r,g.treeForkCount),r.child}l=l.sibling}g.tail!==null&&Me()>Yu&&(r.flags|=128,E=!0,Tl(g,!1),r.lanes=4194304)}else{if(!E)if(l=yl(T),l!==null){if(r.flags|=128,E=!0,l=l.updateQueue,r.updateQueue=l,to(r,l),Tl(g,!0),g.tail===null&&g.tailMode==="hidden"&&!T.alternate&&!se)return Ce(r),null}else 2*Me()-g.renderingStartTime>Yu&&h!==536870912&&(r.flags|=128,E=!0,Tl(g,!1),r.lanes=4194304);g.isBackwards?(T.sibling=r.child,r.child=T):(l=g.last,l!==null?l.sibling=T:r.child=T,g.last=T)}return g.tail!==null?(l=g.tail,g.rendering=l,g.tail=l.sibling,g.renderingStartTime=Me(),l.sibling=null,h=Hn.current,A(Hn,E?h&1|2:h&1),se&&St(r,g.treeForkCount),l):(Ce(r),null);case 22:case 23:return $a(r),pl(),g=r.memoizedState!==null,l!==null?l.memoizedState!==null!==g&&(r.flags|=8192):g&&(r.flags|=8192),g?(h&536870912)!==0&&(r.flags&128)===0&&(Ce(r),r.subtreeFlags&6&&(r.flags|=8192)):Ce(r),h=r.updateQueue,h!==null&&to(r,h.retryQueue),h=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),g=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(g=r.memoizedState.cachePool.pool),g!==h&&(r.flags|=2048),l!==null&&D(pr),null;case 24:return h=null,l!==null&&(h=l.memoizedState.cache),r.memoizedState.cache!==h&&(r.flags|=2048),pn(un),Ce(r),null;case 25:return null;case 30:return null}throw Error(u(156,r.tag))}function ss(l,r){switch(Tt(r),r.tag){case 1:return l=r.flags,l&65536?(r.flags=l&-65537|128,r):null;case 3:return pn(un),xn(),l=r.flags,(l&65536)!==0&&(l&128)===0?(r.flags=l&-65537|128,r):null;case 26:case 27:case 5:return Dn(r),null;case 31:if(r.memoizedState!==null){if($a(r),r.alternate===null)throw Error(u(340));ta()}return l=r.flags,l&65536?(r.flags=l&-65537|128,r):null;case 13:if($a(r),l=r.memoizedState,l!==null&&l.dehydrated!==null){if(r.alternate===null)throw Error(u(340));ta()}return l=r.flags,l&65536?(r.flags=l&-65537|128,r):null;case 19:return D(Hn),null;case 4:return xn(),null;case 10:return pn(r.type),null;case 22:case 23:return $a(r),pl(),l!==null&&D(pr),l=r.flags,l&65536?(r.flags=l&-65537|128,r):null;case 24:return pn(un),null;case 25:return null;default:return null}}function Ih(l,r){switch(Tt(r),r.tag){case 3:pn(un),xn();break;case 26:case 27:case 5:Dn(r);break;case 4:xn();break;case 31:r.memoizedState!==null&&$a(r);break;case 13:$a(r);break;case 19:D(Hn);break;case 10:pn(r.type);break;case 22:case 23:$a(r),pl(),l!==null&&D(pr);break;case 24:pn(un)}}function ws(l,r){try{var h=r.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var E=g.next;h=E;do{if((h.tag&l)===l){g=void 0;var T=h.create,z=h.inst;g=T(),z.destroy=g}h=h.next}while(h!==E)}}catch(L){be(r,r.return,L)}}function Us(l,r,h){try{var g=r.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var T=E.next;g=T;do{if((g.tag&l)===l){var z=g.inst,L=z.destroy;if(L!==void 0){z.destroy=void 0,E=r;var ft=h,vt=L;try{vt()}catch(Mt){be(E,ft,Mt)}}}g=g.next}while(g!==T)}}catch(Mt){be(r,r.return,Mt)}}function yu(l){var r=l.updateQueue;if(r!==null){var h=l.stateNode;try{_g(r,h)}catch(g){be(l,l.return,g)}}}function Wh(l,r,h){h.props=zs(l.type,l.memoizedProps),h.state=l.memoizedState;try{h.componentWillUnmount()}catch(g){be(l,r,g)}}function nr(l,r){try{var h=l.ref;if(h!==null){switch(l.tag){case 26:case 27:case 5:var g=hf(l.stateNode);break;case 30:g=l.stateNode;break;default:g=l.stateNode}typeof h=="function"?l.refCleanup=h(g):h.current=g}}catch(E){be(l,r,E)}}function ls(l,r){var h=l.ref,g=l.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(E){be(l,r,E)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(E){be(l,r,E)}else h.current=null}function k0(l){var r=l.type,h=l.memoizedProps,g=l.stateNode;try{ey(g,r,h,l)}catch(E){be(l,l.return,E)}}function $h(l,r,h){try{xd(l.stateNode,l.type,h,r,l)}catch(g){be(l,l.return,g)}}function I0(l){return l.tag===5||l.tag===3||(wi?l.tag===26:!1)||(Ln?l.tag===27&&fo(l.type):!1)||l.tag===4}function td(l){t:for(;;){for(;l.sibling===null;){if(l.return===null||I0(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(Ln&&l.tag===27&&fo(l.type)||l.flags&2||l.child===null||l.tag===4)continue t;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function kc(l,r,h){var g=l.tag;if(g===5||g===6)l=l.stateNode,r?ay(h,l,r):ty(h,l);else if(g!==4&&(Ln&&g===27&&fo(l.type)&&(h=l.stateNode,r=null),l=l.child,l!==null))for(kc(l,r,h),l=l.sibling;l!==null;)kc(l,r,h),l=l.sibling}function vu(l,r,h){var g=l.tag;if(g===5||g===6)l=l.stateNode,r?ny(h,l,r):$g(h,l);else if(g!==4&&(Ln&&g===27&&fo(l.type)&&(h=l.stateNode),l=l.child,l!==null))for(vu(l,r,h),l=l.sibling;l!==null;)vu(l,r,h),l=l.sibling}function ed(l,r,h){l=l.containerInfo;try{oy(l,h)}catch(g){be(r,r.return,g)}}function W0(l){var r=l.stateNode,h=l.memoizedProps;try{Ud(l.type,h,r,l)}catch(g){be(l,l.return,g)}}function Ng(l,r){for(a3(l.containerInfo),aa=r;aa!==null;)if(l=aa,r=l.child,(l.subtreeFlags&1028)!==0&&r!==null)r.return=l,aa=r;else for(;aa!==null;){l=aa;var h=l.alternate;switch(r=l.flags,l.tag){case 0:if((r&4)!==0&&(r=l.updateQueue,r=r!==null?r.events:null,r!==null))for(var g=0;g<r.length;g++){var E=r[g];E.ref.impl=E.nextImpl}break;case 11:case 15:break;case 1:if((r&1024)!==0&&h!==null){r=void 0,g=l,E=h.memoizedProps,h=h.memoizedState;var T=g.stateNode;try{var z=zs(g.type,E);r=T.getSnapshotBeforeUpdate(z,h),T.__reactInternalSnapshotBeforeUpdate=r}catch(L){be(g,g.return,L)}}break;case 3:(r&1024)!==0&&Aa&&vi(l.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(u(163))}if(r=l.sibling,r!==null){r.return=l.return,aa=r;break}aa=l.return}}function $0(l,r,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Ri(l,h),g&4&&ws(5,h);break;case 1:if(Ri(l,h),g&4)if(l=h.stateNode,r===null)try{l.componentDidMount()}catch(z){be(h,h.return,z)}else{var E=zs(h.type,r.memoizedProps);r=r.memoizedState;try{l.componentDidUpdate(E,r,l.__reactInternalSnapshotBeforeUpdate)}catch(z){be(h,h.return,z)}}g&64&&yu(h),g&512&&nr(h,h.return);break;case 3:if(Ri(l,h),g&64&&(g=h.updateQueue,g!==null)){if(l=null,h.child!==null)switch(h.child.tag){case 27:case 5:l=hf(h.child.stateNode);break;case 1:l=h.child.stateNode}try{_g(g,l)}catch(z){be(h,h.return,z)}}break;case 27:Ln&&r===null&&g&4&&W0(h);case 26:case 5:if(Ri(l,h),r===null){if(g&4)k0(h);else if(g&64){l=h.type,r=h.memoizedProps,E=h.stateNode;try{vy(E,l,r,h)}catch(z){be(h,h.return,z)}}}g&512&&nr(h,h.return);break;case 12:Ri(l,h);break;case 31:Ri(l,h),g&4&&tm(l,h);break;case 13:Ri(l,h),g&4&&ad(l,h),g&64&&(g=h.memoizedState,g!==null&&(g=g.dehydrated,g!==null&&(h=pd.bind(null,h),xu(g,h))));break;case 22:if(g=h.memoizedState!==null||Zs,!g){r=r!==null&&r.memoizedState!==null||wn,E=Zs;var T=wn;Zs=g,(wn=r)&&!T?rs(l,h,(h.subtreeFlags&8772)!==0):Ri(l,h),Zs=E,wn=T}break;case 30:break;default:Ri(l,h)}}function Og(l){var r=l.alternate;r!==null&&(l.alternate=null,Og(r)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(r=l.stateNode,r!==null&&Qg(r)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Oi(l,r,h){for(h=h.child;h!==null;)nd(l,r,h),h=h.sibling}function nd(l,r,h){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(po,h)}catch{}switch(h.tag){case 26:if(wi){wn||ls(h,r),Oi(l,r,h),h.memoizedState?xy(h.memoizedState):h.stateNode&&Hm(h.stateNode);break}case 27:if(Ln){wn||ls(h,r);var g=Xn,E=oi;fo(h.type)&&(Xn=h.stateNode,oi=!1),Oi(l,r,h),hr(h.stateNode),Xn=g,oi=E;break}case 5:wn||ls(h,r);case 6:if(Aa){if(g=Xn,E=oi,Xn=null,Oi(l,r,h),Xn=g,oi=E,Xn!==null)if(oi)try{xm(Xn,h.stateNode)}catch(T){be(h,r,T)}else try{_m(Xn,h.stateNode)}catch(T){be(h,r,T)}}else Oi(l,r,h);break;case 18:Aa&&Xn!==null&&(oi?Om(Xn,h.stateNode):Ee(Xn,h.stateNode));break;case 4:Aa?(g=Xn,E=oi,Xn=h.stateNode.containerInfo,oi=!0,Oi(l,r,h),Xn=g,oi=E):(us&&ed(h.stateNode,h,Ie()),Oi(l,r,h));break;case 0:case 11:case 14:case 15:Us(2,h,r),wn||Us(4,h,r),Oi(l,r,h);break;case 1:wn||(ls(h,r),g=h.stateNode,typeof g.componentWillUnmount=="function"&&Wh(h,r,g)),Oi(l,r,h);break;case 21:Oi(l,r,h);break;case 22:wn=(g=wn)||h.memoizedState!==null,Oi(l,r,h),wn=g;break;default:Oi(l,r,h)}}function tm(l,r){if(ya&&r.memoizedState===null&&(l=r.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{Sy(l)}catch(h){be(r,r.return,h)}}}function ad(l,r){if(ya&&r.memoizedState===null&&(l=r.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{Au(l)}catch(h){be(r,r.return,h)}}function Rg(l){switch(l.tag){case 31:case 13:case 19:var r=l.stateNode;return r===null&&(r=l.stateNode=new Id),r;case 22:return l=l.stateNode,r=l._retryCache,r===null&&(r=l._retryCache=new Id),r;default:throw Error(u(435,l.tag))}}function Ic(l,r){var h=Rg(l);r.forEach(function(g){if(!h.has(g)){h.add(g);var E=Lg.bind(null,l,g);g.then(E,E)}})}function Nn(l,r){var h=r.deletions;if(h!==null)for(var g=0;g<h.length;g++){var E=h[g],T=l,z=r;if(Aa){var L=z;t:for(;L!==null;){switch(L.tag){case 27:if(Ln){if(fo(L.type)){Xn=L.stateNode,oi=!1;break t}break}case 5:Xn=L.stateNode,oi=!1;break t;case 3:case 4:Xn=L.stateNode.containerInfo,oi=!0;break t}L=L.return}if(Xn===null)throw Error(u(160));nd(T,z,E),Xn=null,oi=!1}else nd(T,z,E);T=E.alternate,T!==null&&(T.return=null),E.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Wc(r,l),r=r.sibling}function Wc(l,r){var h=l.alternate,g=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:Nn(r,l),xa(l),g&4&&(Us(3,l,l.return),ws(3,l),Us(5,l,l.return));break;case 1:Nn(r,l),xa(l),g&512&&(wn||h===null||ls(h,h.return)),g&64&&Zs&&(l=l.updateQueue,l!==null&&(g=l.callbacks,g!==null&&(h=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:if(wi){var E=ps;if(Nn(r,l),xa(l),g&512&&(wn||h===null||ls(h,h.return)),g&4){g=h!==null?h.memoizedState:null;var T=l.memoizedState;h===null?T===null?l.stateNode===null?l.stateNode=co(E,l.type,l.memoizedProps,l):zd(E,l.type,l.stateNode):l.stateNode=_y(E,T,l.memoizedProps):g!==T?(g===null?h.stateNode!==null&&Hm(h.stateNode):xy(g),T===null?zd(E,l.type,l.stateNode):_y(E,T,l.memoizedProps)):T===null&&l.stateNode!==null&&$h(l,l.memoizedProps,h.memoizedProps)}break}case 27:if(Ln){Nn(r,l),xa(l),g&512&&(wn||h===null||ls(h,h.return)),h!==null&&g&4&&$h(l,l.memoizedProps,h.memoizedProps);break}case 5:if(Nn(r,l),xa(l),g&512&&(wn||h===null||ls(h,h.return)),Aa){if(l.flags&32){E=l.stateNode;try{Dd(E)}catch(xt){be(l,l.return,xt)}}g&4&&l.stateNode!=null&&(E=l.memoizedProps,$h(l,E,h!==null?h.memoizedProps:E)),g&1024&&(Mf=!0)}else us&&l.alternate!==null&&(l.alternate.stateNode=l.stateNode);break;case 6:if(Nn(r,l),xa(l),g&4&&Aa){if(l.stateNode===null)throw Error(u(162));g=l.memoizedProps,h=h!==null?h.memoizedProps:g,E=l.stateNode;try{gf(E,h,g)}catch(xt){be(l,l.return,xt)}}break;case 3:if(wi?(Ay(),E=ps,ps=Rd(r.containerInfo),Nn(r,l),ps=E):Nn(r,l),xa(l),g&4){if(Aa&&ya&&h!==null&&h.memoizedState.isDehydrated)try{c3(r.containerInfo)}catch(xt){be(l,l.return,xt)}if(us){g=r.containerInfo,h=r.pendingChildren;try{oy(g,h)}catch(xt){be(l,l.return,xt)}}}Mf&&(Mf=!1,zg(l));break;case 4:wi?(h=ps,ps=Rd(l.stateNode.containerInfo),Nn(r,l),xa(l),ps=h):(Nn(r,l),xa(l)),g&4&&us&&ed(l.stateNode,l,l.stateNode.pendingChildren);break;case 12:Nn(r,l),xa(l);break;case 31:Nn(r,l),xa(l),g&4&&(g=l.updateQueue,g!==null&&(l.updateQueue=null,Ic(l,g)));break;case 13:Nn(r,l),xa(l),l.child.flags&8192&&l.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(Rf=Me()),g&4&&(g=l.updateQueue,g!==null&&(l.updateQueue=null,Ic(l,g)));break;case 22:E=l.memoizedState!==null;var z=h!==null&&h.memoizedState!==null,L=Zs,ft=wn;if(Zs=L||E,wn=ft||z,Nn(r,l),wn=ft,Zs=L,xa(l),g&8192&&(r=l.stateNode,r._visibility=E?r._visibility&-2:r._visibility|1,E&&(h===null||z||Zs||wn||zi(l)),Aa)){t:if(h=null,Aa)for(r=l;;){if(r.tag===5||wi&&r.tag===26){if(h===null){z=h=r;try{T=z.stateNode,E?iy(T):l3(z.stateNode,z.memoizedProps)}catch(xt){be(z,z.return,xt)}}}else if(r.tag===6){if(h===null){z=r;try{var vt=z.stateNode;E?Ad(vt):sy(vt,z.memoizedProps)}catch(xt){be(z,z.return,xt)}}}else if(r.tag===18){if(h===null){z=r;try{var Mt=z.stateNode;E?f3(Mt):Ty(z.stateNode)}catch(xt){be(z,z.return,xt)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===l)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===l)break t;for(;r.sibling===null;){if(r.return===null||r.return===l)break t;h===r&&(h=null),r=r.return}h===r&&(h=null),r.sibling.return=r.return,r=r.sibling}}g&4&&(g=l.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,Ic(l,h))));break;case 19:Nn(r,l),xa(l),g&4&&(g=l.updateQueue,g!==null&&(l.updateQueue=null,Ic(l,g)));break;case 30:break;case 21:break;default:Nn(r,l),xa(l)}}function xa(l){var r=l.flags;if(r&2){try{for(var h,g=l.return;g!==null;){if(I0(g)){h=g;break}g=g.return}if(Aa){if(h==null)throw Error(u(160));switch(h.tag){case 27:if(Ln){var E=h.stateNode,T=td(l);vu(l,T,E);break}case 5:var z=h.stateNode;h.flags&32&&(Dd(z),h.flags&=-33);var L=td(l);vu(l,L,z);break;case 3:case 4:var ft=h.stateNode.containerInfo,vt=td(l);kc(l,vt,ft);break;default:throw Error(u(161))}}}catch(Mt){be(l,l.return,Mt)}l.flags&=-3}r&4096&&(l.flags&=-4097)}function zg(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var r=l;zg(r),r.tag===5&&r.flags&1024&&lo(r.stateNode),l=l.sibling}}function Ri(l,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)$0(l,r.alternate,r),r=r.sibling}function zi(l){for(l=l.child;l!==null;){var r=l;switch(r.tag){case 0:case 11:case 14:case 15:Us(4,r,r.return),zi(r);break;case 1:ls(r,r.return);var h=r.stateNode;typeof h.componentWillUnmount=="function"&&Wh(r,r.return,h),zi(r);break;case 27:Ln&&hr(r.stateNode);case 26:case 5:ls(r,r.return),zi(r);break;case 22:r.memoizedState===null&&zi(r);break;case 30:zi(r);break;default:zi(r)}l=l.sibling}}function rs(l,r,h){for(h=h&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var g=r.alternate,E=l,T=r,z=T.flags;switch(T.tag){case 0:case 11:case 15:rs(E,T,h),ws(4,T);break;case 1:if(rs(E,T,h),g=T,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(vt){be(g,g.return,vt)}if(g=T,E=g.updateQueue,E!==null){var L=g.stateNode;try{var ft=E.shared.hiddenCallbacks;if(ft!==null)for(E.shared.hiddenCallbacks=null,E=0;E<ft.length;E++)H0(ft[E],L)}catch(vt){be(g,g.return,vt)}}h&&z&64&&yu(T),nr(T,T.return);break;case 27:Ln&&W0(T);case 26:case 5:rs(E,T,h),h&&g===null&&z&4&&k0(T),nr(T,T.return);break;case 12:rs(E,T,h);break;case 31:rs(E,T,h),h&&z&4&&tm(E,T);break;case 13:rs(E,T,h),h&&z&4&&ad(E,T);break;case 22:T.memoizedState===null&&rs(E,T,h),nr(T,T.return);break;case 30:break;default:rs(E,T,h)}r=r.sibling}}function Cl(l,r){var h=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==h&&(l!=null&&l.refCount++,h!=null&&jn(h))}function Da(l,r){l=null,r.alternate!==null&&(l=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==l&&(r.refCount++,l!=null&&jn(l))}function ni(l,r,h,g){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Hg(l,r,h,g),r=r.sibling}function Hg(l,r,h,g){var E=r.flags;switch(r.tag){case 0:case 11:case 15:ni(l,r,h,g),E&2048&&ws(9,r);break;case 1:ni(l,r,h,g);break;case 3:ni(l,r,h,g),E&2048&&(l=null,r.alternate!==null&&(l=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==l&&(r.refCount++,l!=null&&jn(l)));break;case 12:if(E&2048){ni(l,r,h,g),l=r.stateNode;try{var T=r.memoizedProps,z=T.id,L=T.onPostCommit;typeof L=="function"&&L(z,r.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(ft){be(r,r.return,ft)}}else ni(l,r,h,g);break;case 31:ni(l,r,h,g);break;case 13:ni(l,r,h,g);break;case 23:break;case 22:T=r.stateNode,z=r.alternate,r.memoizedState!==null?T._visibility&2?ni(l,r,h,g):ir(l,r):T._visibility&2?ni(l,r,h,g):(T._visibility|=2,ar(l,r,h,g,(r.subtreeFlags&10256)!==0||!1)),E&2048&&Cl(z,r);break;case 24:ni(l,r,h,g),E&2048&&Da(r.alternate,r);break;default:ni(l,r,h,g)}}function ar(l,r,h,g,E){for(E=E&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var T=l,z=r,L=h,ft=g,vt=z.flags;switch(z.tag){case 0:case 11:case 15:ar(T,z,L,ft,E),ws(8,z);break;case 23:break;case 22:var Mt=z.stateNode;z.memoizedState!==null?Mt._visibility&2?ar(T,z,L,ft,E):ir(T,z):(Mt._visibility|=2,ar(T,z,L,ft,E)),E&&vt&2048&&Cl(z.alternate,z);break;case 24:ar(T,z,L,ft,E),E&&vt&2048&&Da(z.alternate,z);break;default:ar(T,z,L,ft,E)}r=r.sibling}}function ir(l,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var h=l,g=r,E=g.flags;switch(g.tag){case 22:ir(h,g),E&2048&&Cl(g.alternate,g);break;case 24:ir(h,g),E&2048&&Da(g.alternate,g);break;default:ir(h,g)}r=r.sibling}}function _l(l,r,h){if(l.subtreeFlags&gr)for(l=l.child;l!==null;)em(l,r,h),l=l.sibling}function em(l,r,h){switch(l.tag){case 26:if(_l(l,r,h),l.flags&gr)if(l.memoizedState!==null)Ol(h,ps,l.memoizedState,l.memoizedProps);else{var g=l.stateNode,E=l.type;l=l.memoizedProps,((r&335544128)===r||_u(E,l))&&Ma(h,g,E,l)}break;case 5:_l(l,r,h),l.flags&gr&&(g=l.stateNode,E=l.type,l=l.memoizedProps,((r&335544128)===r||_u(E,l))&&Ma(h,g,E,l));break;case 3:case 4:wi?(g=ps,ps=Rd(l.stateNode.containerInfo),_l(l,r,h),ps=g):_l(l,r,h);break;case 22:l.memoizedState===null&&(g=l.alternate,g!==null&&g.memoizedState!==null?(g=gr,gr=16777216,_l(l,r,h),gr=g):_l(l,r,h));break;default:_l(l,r,h)}}function id(l){var r=l.alternate;if(r!==null&&(l=r.child,l!==null)){r.child=null;do r=l.sibling,l.sibling=null,l=r;while(l!==null)}}function sr(l){var r=l.deletions;if((l.flags&16)!==0){if(r!==null)for(var h=0;h<r.length;h++){var g=r[h];aa=g,ld(g,l)}id(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)sd(l),l=l.sibling}function sd(l){switch(l.tag){case 0:case 11:case 15:sr(l),l.flags&2048&&Us(9,l,l.return);break;case 3:sr(l);break;case 12:sr(l);break;case 22:var r=l.stateNode;l.memoizedState!==null&&r._visibility&2&&(l.return===null||l.return.tag!==13)?(r._visibility&=-3,no(l)):sr(l);break;default:sr(l)}}function no(l){var r=l.deletions;if((l.flags&16)!==0){if(r!==null)for(var h=0;h<r.length;h++){var g=r[h];aa=g,ld(g,l)}id(l)}for(l=l.child;l!==null;){switch(r=l,r.tag){case 0:case 11:case 15:Us(8,r,r.return),no(r);break;case 22:h=r.stateNode,h._visibility&2&&(h._visibility&=-3,no(r));break;default:no(r)}l=l.sibling}}function ld(l,r){for(;aa!==null;){var h=aa;switch(h.tag){case 0:case 11:case 15:Us(8,h,r);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:jn(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,aa=g;else t:for(h=l;aa!==null;){g=aa;var E=g.sibling,T=g.return;if(Og(g),g===h){aa=null;break t}if(E!==null){E.return=T,aa=E;break t}aa=T}}}function Su(l){var r=Kg(l);if(r!=null){if(typeof r.memoizedProps["data-testname"]!="string")throw Error(u(364));return r}if(l=Cm(l),l===null)throw Error(u(362));return l.stateNode.current}function $c(l,r){var h=l.tag;switch(r.$$typeof){case Wd:if(l.type===r.value)return!0;break;case $d:t:{for(r=r.value,l=[l,0],h=0;h<l.length;){var g=l[h++],E=g.tag,T=l[h++],z=r[T];if(E!==5&&E!==26&&E!==27||!Ys(g)){for(;z!=null&&$c(g,z);)T++,z=r[T];if(T===r.length){r=!0;break t}else for(g=g.child;g!==null;)l.push(g,T),g=g.sibling}}r=!1}return r;case tp:if((h===5||h===26||h===27)&&Wg(l.stateNode,r.value))return!0;break;case np:if((h===5||h===6||h===26||h===27)&&(l=Ig(l),l!==null&&0<=l.indexOf(r.value)))return!0;break;case ep:if((h===5||h===26||h===27)&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===r.value.toLowerCase()))return!0;break;default:throw Error(u(365))}return!1}function rd(l){switch(l.$$typeof){case Wd:return"<"+(_(l.value)||"Unknown")+">";case $d:return":has("+(rd(l)||"")+")";case tp:return'[role="'+l.value+'"]';case np:return'"'+l.value+'"';case ep:return'[data-testname="'+l.value+'"]';default:throw Error(u(365))}}function nm(l,r){var h=[];l=[l,0];for(var g=0;g<l.length;){var E=l[g++],T=E.tag,z=l[g++],L=r[z];if(T!==5&&T!==26&&T!==27||!Ys(E)){for(;L!=null&&$c(E,L);)z++,L=r[z];if(z===r.length)h.push(E);else for(E=E.child;E!==null;)l.push(E,z),E=E.sibling}}return h}function tf(l,r){if(!ro)throw Error(u(363));l=Su(l),l=nm(l,r),r=[],l=Array.from(l);for(var h=0;h<l.length;){var g=l[h++],E=g.tag;if(E===5||E===26||E===27)Ys(g)||r.push(g.stateNode);else for(g=g.child;g!==null;)l.push(g),g=g.sibling}return r}function ai(){return(re&2)!==0&&ce!==0?ce&-ce:Gt.T!==null?Yr():cs()}function ef(){if(Ei===0)if((ce&536870912)===0||se){var l=Tf;Tf<<=1,(Tf&3932160)===0&&(Tf=262144),Ei=l}else Ei=536870912;return l=Si.current,l!==null&&(l.flags|=32),Ei}function Pa(l,r,h){(l===Le&&(He===2||He===9)||l.cancelPendingCommit!==null)&&(rr(l,0),xl(l,ce,Ei,!1)),W(l,h),((re&2)===0||l!==Le)&&(l===Le&&((re&2)===0&&(bo|=h),yn===4&&xl(l,ce,Ei,!1)),ke(l))}function am(l,r,h){if((re&6)!==0)throw Error(u(327));var g=!h&&(r&127)===0&&(r&l.expiredLanes)===0||U(l,r),E=g?Gg(l,r):Tu(l,r,!0),T=g;do{if(E===0){So&&!g&&xl(l,r,0,!1);break}else{if(h=l.current.alternate,T&&!wg(h)){E=Tu(l,r,!1),T=!1;continue}if(E===2){if(T=r,l.errorRecoveryDisabledLanes&T)var z=0;else z=l.pendingLanes&-536870913,z=z!==0?z:z&536870912?536870912:0;if(z!==0){r=z;t:{var L=l;E=Of;var ft=ya&&L.current.memoizedState.isDehydrated;if(ft&&(rr(L,z).flags|=256),z=Tu(L,z,!1),z!==2){if(Ym&&!ft){L.errorRecoveryDisabledLanes|=T,bo|=T,E=4;break t}T=ui,ui=E,T!==null&&(ui===null?ui=T:ui.push.apply(ui,T))}E=z}if(T=!1,E!==2)continue}}if(E===1){rr(l,0),xl(l,r,0,!0);break}t:{switch(g=l,T=E,T){case 0:case 1:throw Error(u(345));case 4:if((r&4194048)!==r)break;case 6:xl(g,r,Ei,!yr);break t;case 2:ui=null;break;case 3:case 5:break;default:throw Error(u(329))}if((r&62914560)===r&&(E=Rf+300-Me(),10<E)){if(xl(g,r,Ei,!yr),O(g,0,!0)!==0)break t;Js=r,g.timeoutHandle=Xg(od.bind(null,g,h,ui,ip,ap,r,Ei,bo,Pu,yr,T,"Throttled",-0,0),E);break t}od(g,h,ui,ip,ap,r,Ei,bo,Pu,yr,T,null,-0,0)}}break}while(!0);ke(l)}function od(l,r,h,g,E,T,z,L,ft,vt,Mt,xt,Rt,Yt){if(l.timeoutHandle=Ml,xt=r.subtreeFlags,xt&8192||(xt&16785408)===16785408){xt=Jg(),em(r,T,xt);var tn=(T&62914560)===T?Rf-Me():(T&4194048)===T?Xm-Me():0;if(tn=Fg(xt,tn),tn!==null){Js=T,l.cancelPendingCommit=tn(rm.bind(null,l,r,T,h,g,E,z,L,ft,Mt,xt,null,Rt,Yt)),xl(l,T,z,!vt);return}}rm(l,r,T,h,g,E,z,L,ft)}function wg(l){for(var r=l;;){var h=r.tag;if((h===0||h===11||h===15)&&r.flags&16384&&(h=r.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var E=h[g],T=E.getSnapshot;E=E.value;try{if(!Sa(T(),E))return!1}catch{return!1}}if(h=r.child,r.subtreeFlags&16384&&h!==null)h.return=r,r=h;else{if(r===l)break;for(;r.sibling===null;){if(r.return===null||r.return===l)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function xl(l,r,h,g){r&=~qm,r&=~bo,l.suspendedLanes|=r,l.pingedLanes&=~r,g&&(l.warmLanes|=r),g=l.expirationTimes;for(var E=r;0<E;){var T=31-ii(E),z=1<<T;g[T]=-1,E&=~z}h!==0&&I(l,h,r)}function lr(){return(re&6)===0?(mn(0),!1):!0}function nf(){if(oe!==null){if(He===0)var l=oe.return;else l=oe,$e=Ka=null,Oc(l),ji=null,Df=0,l=oe;for(;l!==null;)Ih(l.alternate,l),l=l.return;oe=null}}function rr(l,r){var h=l.timeoutHandle;h!==Ml&&(l.timeoutHandle=Ml,Em(h)),h=l.cancelPendingCommit,h!==null&&(l.cancelPendingCommit=null,h()),Js=0,nf(),Le=l,oe=h=Vs(l.current,null),ce=r,He=0,bi=null,yr=!1,So=U(l,r),Ym=!1,Pu=Ei=qm=bo=vr=yn=0,ui=Of=null,ap=!1,(r&8)!==0&&(r|=r&32);var g=l.entangledLanes;if(g!==0)for(l=l.entanglements,g&=r;0<g;){var E=31-ii(g),T=1<<E;r|=l[E],g&=~T}return Bl=r,Ca(),h}function Ug(l,r){kt=null,Gt.H=Af,r===Vu||r===qd?(r=xc(),He=3):r===Yd?(r=xc(),He=4):He=r===Fd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,bi=r,oe===null&&(yn=1,Pc(l,at(r,l.current)))}function Bg(){var l=Si.current;return l===null?!0:(ce&4194048)===ce?Pi===null:(ce&62914560)===ce||(ce&536870912)!==0?l===Pi:!1}function im(){var l=Gt.H;return Gt.H=Af,l===null?Af:l}function bu(){var l=Gt.A;return Gt.A=y3,l}function Eu(){yn=4,yr||(ce&4194048)!==ce&&Si.current!==null||(So=!0),(vr&134217727)===0&&(bo&134217727)===0||Le===null||xl(Le,ce,Ei,!1)}function Tu(l,r,h){var g=re;re|=2;var E=im(),T=bu();(Le!==l||ce!==r)&&(ip=null,rr(l,r)),r=!1;var z=yn;t:do try{if(He!==0&&oe!==null){var L=oe,ft=bi;switch(He){case 8:nf(),z=6;break t;case 3:case 2:case 9:case 6:Si.current===null&&(r=!0);var vt=He;if(He=0,bi=null,ao(l,L,ft,vt),h&&So){z=0;break t}break;default:vt=He,He=0,bi=null,ao(l,L,ft,vt)}}Vg(),z=yn;break}catch(Mt){Ug(l,Mt)}while(!0);return r&&l.shellSuspendCounter++,$e=Ka=null,re=g,Gt.H=E,Gt.A=T,oe===null&&(Le=null,ce=0,Ca()),z}function Vg(){for(;oe!==null;)ud(oe)}function Gg(l,r){var h=re;re|=2;var g=im(),E=bu();Le!==l||ce!==r?(ip=null,Yu=Me()+500,rr(l,r)):So=U(l,r);t:do try{if(He!==0&&oe!==null){r=oe;var T=bi;e:switch(He){case 1:He=0,bi=null,ao(l,r,T,1);break;case 2:case 9:if(O0(T)){He=0,bi=null,lm(r);break}r=function(){He!==2&&He!==9||Le!==l||(He=7),ke(l)},T.then(r,r);break t;case 3:He=7;break t;case 4:He=5;break t;case 7:O0(T)?(He=0,bi=null,lm(r)):(He=0,bi=null,ao(l,r,T,7));break;case 5:var z=null;switch(oe.tag){case 26:z=oe.memoizedState;case 5:case 27:var L=oe,ft=L.type,vt=L.pendingProps;if(z?Hd(z):va(L.stateNode,ft,vt)){He=0,bi=null;var Mt=L.sibling;if(Mt!==null)oe=Mt;else{var xt=L.return;xt!==null?(oe=xt,Bs(xt)):oe=null}break e}}He=0,bi=null,ao(l,r,T,5);break;case 6:He=0,bi=null,ao(l,r,T,6);break;case 8:nf(),yn=6;break t;default:throw Error(u(462))}}sm();break}catch(Rt){Ug(l,Rt)}while(!0);return $e=Ka=null,Gt.H=g,Gt.A=E,re=h,oe!==null?0:(Le=null,ce=0,Ca(),yn)}function sm(){for(;oe!==null&&!p3();)ud(oe)}function ud(l){var r=Zh(l.alternate,l,Bl);l.memoizedProps=l.pendingProps,r===null?Bs(l):oe=r}function lm(l){var r=l,h=r.alternate;switch(r.tag){case 15:case 0:r=Z0(h,r,r.pendingProps,r.type,void 0,ce);break;case 11:r=Z0(h,r,r.pendingProps,r.type.render,r.ref,ce);break;case 5:Oc(r);default:Ih(h,r),r=oe=fm(r,Bl),r=Zh(h,r,Bl)}l.memoizedProps=l.pendingProps,r===null?Bs(l):oe=r}function ao(l,r,h,g){$e=Ka=null,Oc(r),ji=null,Df=0;var E=r.return;try{if(_a(l,E,r,h,ce)){yn=1,Pc(l,at(h,l.current)),oe=null;return}}catch(T){if(E!==null)throw oe=E,T;yn=1,Pc(l,at(h,l.current)),oe=null;return}r.flags&32768?(se||g===1?l=!0:So||(ce&536870912)!==0?l=!1:(yr=l=!0,(g===2||g===9||g===3||g===6)&&(g=Si.current,g!==null&&g.tag===13&&(g.flags|=16384))),af(r,l)):Bs(r)}function Bs(l){var r=l;do{if((r.flags&32768)!==0){af(r,yr);return}l=r.return;var h=eo(r.alternate,r,Bl);if(h!==null){oe=h;return}if(r=r.sibling,r!==null){oe=r;return}oe=r=l}while(r!==null);yn===0&&(yn=5)}function af(l,r){do{var h=ss(l.alternate,l);if(h!==null){h.flags&=32767,oe=h;return}if(h=l.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!r&&(l=l.sibling,l!==null)){oe=l;return}oe=l=h}while(l!==null);yn=6,oe=null}function rm(l,r,h,g,E,T,z,L,ft){l.cancelPendingCommit=null;do On();while(we!==0);if((re&6)!==0)throw Error(u(327));if(r!==null){if(r===l.current)throw Error(u(177));if(T=r.lanes|r.childLanes,T|=jm,st(l,h,T,z,L,ft),l===Le&&(oe=Le=null,ce=0),br=r,Vl=l,Js=h,sp=T,lp=E,Uy=g,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,t3(zl,function(){return om(),null})):(l.callbackNode=null,l.callbackPriority=0),g=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||g){g=Gt.T,Gt.T=null,E=Ls(),Jn(2),z=re,re|=4;try{Ng(l,r,h)}finally{re=z,Jn(E),Gt.T=g}}we=1,cd(),fd(),hd()}}function cd(){if(we===1){we=0;var l=Vl,r=br,h=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||h){h=Gt.T,Gt.T=null;var g=Ls();Jn(2);var E=re;re|=4;try{Wc(r,l),df(l.containerInfo)}finally{re=E,Jn(g),Gt.T=h}}l.current=r,we=2}}function fd(){if(we===2){we=0;var l=Vl,r=br,h=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||h){h=Gt.T,Gt.T=null;var g=Ls();Jn(2);var E=re;re|=4;try{$0(l,r.alternate,r)}finally{re=E,Jn(g),Gt.T=h}}we=3}}function hd(){if(we===4||we===3){we=0,si();var l=Vl,r=br,h=Js,g=Uy;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?we=5:(we=0,br=Vl=null,jg(l,l.pendingLanes));var E=l.pendingLanes;if(E===0&&(Sr=null),rt(h),r=r.stateNode,Rn&&typeof Rn.onCommitFiberRoot=="function")try{Rn.onCommitFiberRoot(po,r,void 0,(r.current.flags&128)===128)}catch{}if(g!==null){r=Gt.T,E=Ls(),Jn(2),Gt.T=null;try{for(var T=l.onRecoverableError,z=0;z<g.length;z++){var L=g[z];T(L.value,{componentStack:L.stack})}}finally{Gt.T=r,Jn(E)}}(Js&3)!==0&&On(),ke(l),E=l.pendingLanes,(h&261930)!==0&&(E&42)!==0?l===rp?qu++:(qu=0,rp=l):qu=0,ya&&Ey(),mn(0)}}function jg(l,r){(l.pooledCacheLanes&=r)===0&&(r=l.pooledCache,r!=null&&(l.pooledCache=null,jn(r)))}function On(){return cd(),fd(),hd(),om()}function om(){if(we!==5)return!1;var l=Vl,r=sp;sp=0;var h=rt(Js),g=32>h?32:h;h=Gt.T;var E=Ls();try{Jn(g),Gt.T=null,g=lp,lp=null;var T=Vl,z=Js;if(we=0,br=Vl=null,Js=0,(re&6)!==0)throw Error(u(331));var L=re;if(re|=4,sd(T.current),Hg(T,T.current,z,g),re=L,mn(0,!1),Rn&&typeof Rn.onPostCommitFiberRoot=="function")try{Rn.onPostCommitFiberRoot(po,T)}catch{}return!0}finally{Jn(E),Gt.T=h,jg(l,r)}}function um(l,r,h){r=at(h,r),r=du(l.stateNode,r,2),l=Ds(l,r,2),l!==null&&(W(l,2),ke(l))}function be(l,r,h){if(l.tag===3)um(l,l,h);else for(;r!==null;){if(r.tag===3){um(r,l,h);break}else if(r.tag===1){var g=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Sr===null||!Sr.has(g))){l=at(h,l),h=Yc(2),g=Ds(r,h,2),g!==null&&(Ph(h,g,r,l),W(g,2),ke(g));break}}r=r.return}}function dd(l,r,h){var g=l.pingCache;if(g===null){g=l.pingCache=new v3;var E=new Set;g.set(r,E)}else E=g.get(r),E===void 0&&(E=new Set,g.set(r,E));E.has(h)||(Ym=!0,E.add(h),l=sf.bind(null,l,r,h),r.then(l,l))}function sf(l,r,h){var g=l.pingCache;g!==null&&g.delete(r),l.pingedLanes|=l.suspendedLanes&h,l.warmLanes&=~h,Le===l&&(ce&h)===h&&(yn===4||yn===3&&(ce&62914560)===ce&&300>Me()-Rf?(re&2)===0&&rr(l,0):qm|=h,Pu===ce&&(Pu=0)),ke(l)}function cm(l,r){r===0&&(r=V()),l=$l(l,r),l!==null&&(W(l,r),ke(l))}function pd(l){var r=l.memoizedState,h=0;r!==null&&(h=r.retryLane),cm(l,h)}function Lg(l,r){var h=0;switch(l.tag){case 31:case 13:var g=l.stateNode,E=l.memoizedState;E!==null&&(h=E.retryLane);break;case 19:g=l.stateNode;break;case 22:g=l.stateNode._retryCache;break;default:throw Error(u(314))}g!==null&&g.delete(r),cm(l,h)}function t3(l,r){return Vd(l,r)}function md(l,r,h,g){this.tag=l,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lf(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Vs(l,r){var h=l.alternate;return h===null?(h=i(l.tag,r,l.key,l.mode),h.elementType=l.elementType,h.type=l.type,h.stateNode=l.stateNode,h.alternate=l,l.alternate=h):(h.pendingProps=r,h.type=l.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=l.flags&65011712,h.childLanes=l.childLanes,h.lanes=l.lanes,h.child=l.child,h.memoizedProps=l.memoizedProps,h.memoizedState=l.memoizedState,h.updateQueue=l.updateQueue,r=l.dependencies,h.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},h.sibling=l.sibling,h.index=l.index,h.ref=l.ref,h.refCleanup=l.refCleanup,h}function fm(l,r){l.flags&=65011714;var h=l.alternate;return h===null?(l.childLanes=0,l.lanes=r,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=h.childLanes,l.lanes=h.lanes,l.child=h.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=h.memoizedProps,l.memoizedState=h.memoizedState,l.updateQueue=h.updateQueue,l.type=h.type,r=h.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),l}function rf(l,r,h,g,E,T){var z=0;if(g=l,typeof l=="function")lf(l)&&(z=1);else if(typeof l=="string")z=wi&&Ln?zm(l,h,ba.current)?26:Bd(l)?27:5:wi?zm(l,h,ba.current)?26:5:Ln&&Bd(l)?27:5;else t:switch(l){case Td:return l=i(31,h,r,E),l.elementType=Td,l.lanes=T,l;case io:return Dl(h.children,E,T,r);case mm:z=8,E|=24;break;case ff:return l=i(12,h,r,E|2),l.elementType=ff,l.lanes=T,l;case so:return l=i(13,h,r,E),l.elementType=so,l.lanes=T,l;case ze:return l=i(19,h,r,E),l.elementType=ze,l.lanes=T,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Al:z=10;break t;case Ed:z=9;break t;case Cu:z=11;break t;case gm:z=14;break t;case ur:z=16,g=null;break t}z=29,h=Error(u(130,l===null?"null":typeof l,"")),g=null}return r=i(z,h,r,E),r.elementType=l,r.type=g,r.lanes=T,r}function Dl(l,r,h,g){return l=i(7,l,g,r),l.lanes=h,l}function of(l,r,h){return l=i(6,l,null,r),l.lanes=h,l}function gd(l){var r=i(18,null,null,0);return r.stateNode=l,r}function yd(l,r,h){return r=i(4,l.children!==null?l.children:[],l.key,r),r.lanes=h,r.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},r}function hm(l,r,h,g,E,T,z,L,ft){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Ml,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=J(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=J(0),this.hiddenUpdates=J(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=T,this.onRecoverableError=z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ft,this.incompleteTransitions=new Map}function uf(l,r,h,g,E,T,z,L,ft,vt,Mt,xt){return l=new hm(l,r,h,z,ft,vt,Mt,xt,L),r=1,T===!0&&(r|=24),T=i(3,null,null,r),l.current=T,T.stateNode=l,r=Ae(),r.refCount++,l.pooledCache=r,r.refCount++,T.memoizedState={element:g,isDehydrated:h,cache:r},Dc(T),l}function vd(l){return l?(l=ho,l):ho}function dm(l){var r=l._reactInternals;if(r===void 0)throw typeof l.render=="function"?Error(u(188)):(l=Object.keys(l).join(","),Error(u(268,l)));return l=p(r),l=l!==null?m(l):null,l===null?null:hf(l.stateNode)}function Sd(l,r,h,g,E,T){E=vd(E),g.context===null?g.context=E:g.pendingContext=E,g=mi(r),g.payload={element:h},T=T===void 0?null:T,T!==null&&(g.callback=T),h=Ds(l,g,r),h!==null&&(Pa(h,l,r),Ac(h,l,r))}function pm(l,r){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var h=l.retryLane;l.retryLane=h!==0&&h<r?h:r}}function os(l,r){pm(l,r),(l=l.alternate)&&pm(l,r)}var ne={},e3=H,Ya=J2(),yi=Object.assign,bd=Symbol.for("react.element"),cf=Symbol.for("react.transitional.element"),or=Symbol.for("react.portal"),io=Symbol.for("react.fragment"),mm=Symbol.for("react.strict_mode"),ff=Symbol.for("react.profiler"),Ed=Symbol.for("react.consumer"),Al=Symbol.for("react.context"),Cu=Symbol.for("react.forward_ref"),so=Symbol.for("react.suspense"),ze=Symbol.for("react.suspense_list"),gm=Symbol.for("react.memo"),ur=Symbol.for("react.lazy"),Td=Symbol.for("react.activity"),Gs=Symbol.for("react.memo_cache_sentinel"),ym=Symbol.iterator,vm=Symbol.for("react.client.reference"),cr=Array.isArray,Gt=e3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pg=t.rendererVersion,Sm=t.rendererPackageName,bm=t.extraDevToolsConfig,hf=t.getPublicInstance,n3=t.getRootHostContext,Yg=t.getChildHostContext,a3=t.prepareForCommit,df=t.resetAfterCommit,js=t.createInstance;t.cloneMutableInstance;var Cd=t.appendInitialChild,qg=t.finalizeInitialChildren,pf=t.shouldSetTextContent,_d=t.createTextInstance;t.cloneMutableTextInstance;var Xg=t.scheduleTimeout,Em=t.cancelTimeout,Ml=t.noTimeout,Hi=t.isPrimaryRenderer;t.warnsIfNotActing;var Aa=t.supportsMutation,us=t.supportsPersistence,ya=t.supportsHydration,Kg=t.getInstanceFromNode;t.beforeActiveInstanceBlur;var i3=t.preparePortalMount;t.prepareScopeUpdate,t.getInstanceFromScope;var Jn=t.setCurrentUpdatePriority,Ls=t.getCurrentUpdatePriority,cs=t.resolveUpdatePriority;t.trackSchedulerEvent,t.resolveEventType,t.resolveEventTimeStamp;var Tm=t.shouldAttemptEagerTransition,Qg=t.detachDeletedInstance;t.requestPostPaintCallback;var Zg=t.maySuspendCommit,s3=t.maySuspendCommitOnUpdate,_u=t.maySuspendCommitInSyncRender,va=t.preloadInstance,Jg=t.startSuspendingCommit,Ma=t.suspendInstance;t.suspendOnActiveViewTransition;var Fg=t.waitForCommitToBeReady;t.getSuspendedCommitReason;var qa=t.NotPendingTransition,fr=t.HostTransitionContext,lo=t.resetFormInstance;t.bindToConsole;var kg=t.supportsMicrotasks,Ps=t.scheduleMicrotask,ro=t.supportsTestSelectors,Cm=t.findFiberRoot,fs=t.getBoundingRect,Ig=t.getTextContent,Ys=t.isHiddenSubtree,Wg=t.matchAccessibilityRole,mf=t.setFocusIfFocusable,oo=t.setupIntersectionObserver,$g=t.appendChild,ty=t.appendChildToContainer,gf=t.commitTextUpdate,ey=t.commitMount,xd=t.commitUpdate,ny=t.insertBefore,ay=t.insertInContainerBefore,_m=t.removeChild,xm=t.removeChildFromContainer,Dd=t.resetTextContent,iy=t.hideInstance,Ad=t.hideTextInstance,l3=t.unhideInstance,sy=t.unhideTextInstance;t.cancelViewTransitionName,t.cancelRootViewTransitionName,t.restoreRootViewTransitionName,t.cloneRootViewTransitionContainer,t.removeRootViewTransitionClone,t.measureClonedInstance,t.hasInstanceChanged,t.hasInstanceAffectedParent,t.startViewTransition,t.startGestureTransition,t.stopViewTransition,t.getCurrentGestureOffset,t.createViewTransitionInstance;var vi=t.clearContainer;t.createFragmentInstance,t.updateFragmentInstanceFiber,t.commitNewChildToFragmentInstance,t.deleteChildFromFragmentInstance;var ly=t.cloneInstance,Ie=t.createContainerChildSet,Dm=t.appendChildToContainerChildSet,ry=t.finalizeContainerChildren,oy=t.replaceContainerChildren,Nl=t.cloneHiddenInstance,yf=t.cloneHiddenTextInstance,vf=t.isSuspenseInstancePending,Sf=t.isSuspenseInstanceFallback,uo=t.getSuspenseInstanceFallbackErrorDetails,xu=t.registerSuspenseInstanceRetry,uy=t.canHydrateFormStateMarker,cy=t.isFormStateMarkerMatching,Am=t.getNextHydratableSibling,fy=t.getNextHydratableSiblingAfterSingleton,Md=t.getFirstHydratableChild,Nd=t.getFirstHydratableChildWithinContainer,Mm=t.getFirstHydratableChildWithinActivityInstance,hy=t.getFirstHydratableChildWithinSuspenseInstance,r3=t.getFirstHydratableChildWithinSingleton,o3=t.canHydrateInstance,dy=t.canHydrateTextInstance,py=t.canHydrateActivityInstance,u3=t.canHydrateSuspenseInstance,Du=t.hydrateInstance,Od=t.hydrateTextInstance,my=t.hydrateActivityInstance,Nm=t.hydrateSuspenseInstance,gy=t.getNextHydratableInstanceAfterActivityInstance,yy=t.getNextHydratableInstanceAfterSuspenseInstance,vy=t.commitHydratedInstance,c3=t.commitHydratedContainer,Sy=t.commitHydratedActivityInstance,Au=t.commitHydratedSuspenseInstance,by=t.finalizeHydratedChildren,Ey=t.flushHydrationEvents;t.clearActivityBoundary;var Ee=t.clearSuspenseBoundary;t.clearActivityBoundaryFromContainer;var Om=t.clearSuspenseBoundaryFromContainer,f3=t.hideDehydratedBoundary,Ty=t.unhideDehydratedBoundary,Cy=t.shouldDeleteUnhydratedTailInstances;t.diffHydratedPropsForDevWarnings,t.diffHydratedTextForDevWarnings,t.describeHydratableInstanceForDevWarnings;var h3=t.validateHydratableInstance,Rm=t.validateHydratableTextInstance,wi=t.supportsResources,zm=t.isHostHoistableType,Rd=t.getHoistableRoot,Mu=t.getResource,_y=t.acquireResource,xy=t.releaseResource,co=t.hydrateHoistable,zd=t.mountHoistable,Hm=t.unmountHoistable,Dy=t.createHoistableInstance,Ay=t.prepareToCommitHoistables,d3=t.mayResourceSuspendCommit,Hd=t.preloadResource,Ol=t.suspendResource,Ln=t.supportsSingletons,wd=t.resolveSingletonInstance,Ud=t.acquireSingletonInstance,hr=t.releaseSingletonInstance,Bd=t.isHostSingletonType,fo=t.isSingletonScope,bf=[],Nu=-1,ho={},ii=Math.clz32?Math.clz32:N,My=Math.log,Ny=Math.LN2,Ef=256,Tf=262144,Ou=4194304,Vd=Ya.unstable_scheduleCallback,ae=Ya.unstable_cancelCallback,p3=Ya.unstable_shouldYield,si=Ya.unstable_requestPaint,Me=Ya.unstable_now,Oy=Ya.unstable_ImmediatePriority,Rl=Ya.unstable_UserBlockingPriority,zl=Ya.unstable_NormalPriority,Ru=Ya.unstable_IdlePriority,Gd=Ya.log,wm=Ya.unstable_setDisableYieldValue,po=null,Rn=null,Sa=typeof Object.is=="function"?Object.is:pt,jd=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},Um=Object.prototype.hasOwnProperty,zu,li,Cf=!1,Ry=new WeakMap,mo=[],Hu=0,Pn=null,lt=0,Ui=[],Bi=0,Hl=null,Xa=1,qs="",ba=x(null),_f=x(null),dr=x(null),Ld=x(null),Fn=null,We=null,se=!1,wl=null,Vi=!1,Bm=Error(u(519)),Xs=x(null),Ka=null,$e=null,Ks=typeof AbortController<"u"?AbortController:function(){var l=[],r=this.signal={aborted:!1,addEventListener:function(h,g){l.push(g)}};this.abort=function(){r.aborted=!0,l.forEach(function(h){return h()})}},Na=Ya.unstable_scheduleCallback,m3=Ya.unstable_NormalPriority,un={$$typeof:Al,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},zn=null,ri=null,Vm=!1,wu=!1,go=!1,hs=0,xf=null,Gm=0,Uu=0,Bu=null,Pd=Gt.S;Gt.S=function(l,r){Xm=Me(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&au(l,r),Pd!==null&&Pd(l,r)};var pr=x(null),Vu=Error(u(460)),Yd=Error(u(474)),qd=Error(u(542)),Xd={then:function(){}},Gi=null,ji=null,Df=0,yo=R0(!0),zy=R0(!1),Li=[],ds=0,jm=0,mr=!1,Lm=!1,Qs=x(null),Kd=x(0),Si=x(null),Pi=null,Hn=x(0),Ul=0,kt=null,Ge=null,Yn=null,Qd=!1,Gu=!1,vo=!1,Zd=0,ju=0,Lu=null,g3=0,Af={readContext:rn,use:Ve,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useLayoutEffect:on,useInsertionEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useSyncExternalStore:on,useId:on,useHostTransitionStatus:on,useFormState:on,useActionState:on,useOptimistic:on,useMemoCache:on,useCacheRefresh:on};Af.useEffectEvent=on;var Hy={readContext:rn,use:Ve,useCallback:function(l,r){return pa().memoizedState=[l,r===void 0?null:r],l},useContext:rn,useEffect:B0,useImperativeHandle:function(l,r,h){h=h!=null?h.concat([l]):null,Bc(4194308,4,Ag.bind(null,r,l),h)},useLayoutEffect:function(l,r){return Bc(4194308,4,l,r)},useInsertionEffect:function(l,r){Bc(4,2,l,r)},useMemo:function(l,r){var h=pa();r=r===void 0?null:r;var g=l();if(vo){dt(!0);try{l()}finally{dt(!1)}}return h.memoizedState=[g,r],g},useReducer:function(l,r,h){var g=pa();if(h!==void 0){var E=h(r);if(vo){dt(!0);try{h(r)}finally{dt(!1)}}}else E=r;return g.memoizedState=g.baseState=E,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:E},g.queue=l,l=l.dispatch=ma.bind(null,kt,l),[g.memoizedState,l]},useRef:function(l){var r=pa();return l={current:l},r.memoizedState=l},useState:function(l){l=Ga(l);var r=l.queue,h=jh.bind(null,kt,r);return r.dispatch=h,[l.memoizedState,h]},useDebugValue:j0,useDeferredValue:function(l,r){var h=pa();return Vh(h,l,r)},useTransition:function(){var l=Ga(!1);return l=L0.bind(null,kt,l.queue,!0,!1),pa().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,r,h){var g=kt,E=pa();if(se){if(h===void 0)throw Error(u(407));h=h()}else{if(h=r(),Le===null)throw Error(u(349));(ce&127)!==0||xg(g,r,h)}E.memoizedState=h;var T={value:h,getSnapshot:r};return E.queue=T,B0(Rc.bind(null,g,T,l),[l]),g.flags|=2048,ja(9,{destroy:void 0},Os.bind(null,g,T,h,r),null),h},useId:function(){var l=pa(),r=Le.identifierPrefix;if(se){var h=qs,g=Xa;h=(g&~(1<<32-ii(g)-1)).toString(32)+h,r="_"+r+"R_"+h,h=Zd++,0<h&&(r+="H"+h.toString(32)),r+="_"}else h=g3++,r="_"+r+"r_"+h.toString(32)+"_";return l.memoizedState=r},useHostTransitionStatus:Gh,useFormState:ns,useActionState:ns,useOptimistic:function(l){var r=pa();r.memoizedState=r.baseState=l;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=h,r=hu.bind(null,kt,!0,h),h.dispatch=r,[l,r]},useMemoCache:ou,useCacheRefresh:function(){return pa().memoizedState=Mg.bind(null,kt)},useEffectEvent:function(l){var r=pa(),h={impl:l};return r.memoizedState=h,function(){if((re&2)!==0)throw Error(u(440));return h.impl.apply(void 0,arguments)}}},Pm={readContext:rn,use:Ve,useCallback:Bh,useContext:rn,useEffect:Hh,useImperativeHandle:G0,useInsertionEffect:V0,useLayoutEffect:Uh,useMemo:Vc,useReducer:uu,useRef:Wr,useState:function(){return uu(Ns)},useDebugValue:j0,useDeferredValue:function(l,r){var h=Ye();return Gc(h,Ge.memoizedState,l,r)},useTransition:function(){var l=uu(Ns)[0],r=Ye().memoizedState;return[typeof l=="boolean"?l:Ii(l),r]},useSyncExternalStore:Wi,useId:bl,useHostTransitionStatus:Gh,useFormState:U0,useActionState:U0,useOptimistic:function(l,r){var h=Ye();return ti(h,Ge,l,r)},useMemoCache:ou,useCacheRefresh:Y0};Pm.useEffectEvent=wh;var wy={readContext:rn,use:Ve,useCallback:Bh,useContext:rn,useEffect:Hh,useImperativeHandle:G0,useInsertionEffect:V0,useLayoutEffect:Uh,useMemo:Vc,useReducer:Ir,useRef:Wr,useState:function(){return Ir(Ns)},useDebugValue:j0,useDeferredValue:function(l,r){var h=Ye();return Ge===null?Vh(h,l,r):Gc(h,Ge.memoizedState,l,r)},useTransition:function(){var l=Ir(Ns)[0],r=Ye().memoizedState;return[typeof l=="boolean"?l:Ii(l),r]},useSyncExternalStore:Wi,useId:bl,useHostTransitionStatus:Gh,useFormState:Uc,useActionState:Uc,useOptimistic:function(l,r){var h=Ye();return Ge!==null?ti(h,Ge,l,r):(h.baseState=l,[l,h.queue.dispatch])},useMemoCache:ou,useCacheRefresh:Y0};wy.useEffectEvent=wh;var Jd={enqueueSetState:function(l,r,h){l=l._reactInternals;var g=ai(),E=mi(g);E.payload=r,h!=null&&(E.callback=h),r=Ds(l,E,g),r!==null&&(Pa(r,l,g),Ac(r,l,g))},enqueueReplaceState:function(l,r,h){l=l._reactInternals;var g=ai(),E=mi(g);E.tag=1,E.payload=r,h!=null&&(E.callback=h),r=Ds(l,E,g),r!==null&&(Pa(r,l,g),Ac(r,l,g))},enqueueForceUpdate:function(l,r){l=l._reactInternals;var h=ai(),g=mi(h);g.tag=2,r!=null&&(g.callback=r),r=Ds(l,g,h),r!==null&&(Pa(r,l,h),Ac(r,l,h))}},Fd=Error(u(461)),qn=!1,kd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},Zs=!1,wn=!1,Mf=!1,Id=typeof WeakSet=="function"?WeakSet:Set,aa=null,Xn=null,oi=!1,ps=null,gr=8192,y3={getCacheForType:function(l){var r=rn(un),h=r.data.get(l);return h===void 0&&(h=l(),r.data.set(l,h)),h},cacheSignal:function(){return rn(un).controller.signal}},Wd=0,$d=1,tp=2,ep=3,np=4;if(typeof Symbol=="function"&&Symbol.for){var Nf=Symbol.for;Wd=Nf("selector.component"),$d=Nf("selector.has_pseudo_class"),tp=Nf("selector.role"),ep=Nf("selector.test_id"),np=Nf("selector.text")}var v3=typeof WeakMap=="function"?WeakMap:Map,re=0,Le=null,oe=null,ce=0,He=0,bi=null,yr=!1,So=!1,Ym=!1,Bl=0,yn=0,vr=0,bo=0,qm=0,Ei=0,Pu=0,Of=null,ui=null,ap=!1,Rf=0,Xm=0,Yu=1/0,ip=null,Sr=null,we=0,Vl=null,br=null,Js=0,sp=0,lp=null,Uy=null,qu=0,rp=null;return ne.attemptContinuousHydration=function(l){if(l.tag===13||l.tag===31){var r=$l(l,67108864);r!==null&&Pa(r,l,67108864),os(l,67108864)}},ne.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13||l.tag===31){var r=ai();r=bt(r);var h=$l(l,r);h!==null&&Pa(h,l,r),os(l,r)}},ne.attemptSynchronousHydration=function(l){switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var r=R(l.pendingLanes);if(r!==0){for(l.pendingLanes|=2,l.entangledLanes|=2;r;){var h=1<<31-ii(r);l.entanglements[1]|=h,r&=~h}ke(l),(re&6)===0&&(Yu=Me()+500,mn(0))}}break;case 31:case 13:r=$l(l,2),r!==null&&Pa(r,l,2),lr(),os(l,2)}},ne.batchedUpdates=function(l,r){return l(r)},ne.createComponentSelector=function(l){return{$$typeof:Wd,value:l}},ne.createContainer=function(l,r,h,g,E,T,z,L,ft,vt){return uf(l,r,!1,null,h,g,T,null,z,L,ft,vt)},ne.createHasPseudoClassSelector=function(l){return{$$typeof:$d,value:l}},ne.createHydrationContainer=function(l,r,h,g,E,T,z,L,ft,vt,Mt,xt,Rt,Yt){return l=uf(h,g,!0,l,E,T,L,Yt,ft,vt,Mt,xt),l.context=vd(null),h=l.current,g=ai(),g=bt(g),E=mi(g),E.callback=r??null,Ds(h,E,g),r=g,l.current.lanes=r,W(l,r),ke(l),l},ne.createPortal=function(l,r,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:or,key:g==null?null:""+g,children:l,containerInfo:r,implementation:h}},ne.createRoleSelector=function(l){return{$$typeof:tp,value:l}},ne.createTestNameSelector=function(l){return{$$typeof:ep,value:l}},ne.createTextSelector=function(l){return{$$typeof:np,value:l}},ne.defaultOnCaughtError=function(l){console.error(l)},ne.defaultOnRecoverableError=function(l){jd(l)},ne.defaultOnUncaughtError=function(l){jd(l)},ne.deferredUpdates=function(l){var r=Gt.T,h=Ls();try{return Jn(32),Gt.T=null,l()}finally{Jn(h),Gt.T=r}},ne.discreteUpdates=function(l,r,h,g,E){var T=Gt.T,z=Ls();try{return Jn(2),Gt.T=null,l(r,h,g,E)}finally{Jn(z),Gt.T=T,re===0&&(Yu=Me()+500)}},ne.findAllNodes=tf,ne.findBoundingRects=function(l,r){if(!ro)throw Error(u(363));r=tf(l,r),l=[];for(var h=0;h<r.length;h++)l.push(fs(r[h]));for(r=l.length-1;0<r;r--){h=l[r];for(var g=h.x,E=g+h.width,T=h.y,z=T+h.height,L=r-1;0<=L;L--)if(r!==L){var ft=l[L],vt=ft.x,Mt=vt+ft.width,xt=ft.y,Rt=xt+ft.height;if(g>=vt&&T>=xt&&E<=Mt&&z<=Rt){l.splice(r,1);break}else if(g!==vt||h.width!==ft.width||Rt<T||xt>z){if(!(T!==xt||h.height!==ft.height||Mt<g||vt>E)){vt>g&&(ft.width+=vt-g,ft.x=g),Mt<E&&(ft.width=E-vt),l.splice(r,1);break}}else{xt>T&&(ft.height+=xt-T,ft.y=T),Rt<z&&(ft.height=z-xt),l.splice(r,1);break}}}return l},ne.findHostInstance=dm,ne.findHostInstanceWithNoPortals=function(l){return l=p(l),l=l!==null?S(l):null,l===null?null:hf(l.stateNode)},ne.findHostInstanceWithWarning=function(l){return dm(l)},ne.flushPassiveEffects=On,ne.flushSyncFromReconciler=function(l){var r=re;re|=1;var h=Gt.T,g=Ls();try{if(Jn(2),Gt.T=null,l)return l()}finally{Jn(g),Gt.T=h,re=r,(re&6)===0&&mn(0)}},ne.flushSyncWork=lr,ne.focusWithin=function(l,r){if(!ro)throw Error(u(363));for(l=Su(l),r=nm(l,r),r=Array.from(r),l=0;l<r.length;){var h=r[l++],g=h.tag;if(!Ys(h)){if((g===5||g===26||g===27)&&mf(h.stateNode))return!0;for(h=h.child;h!==null;)r.push(h),h=h.sibling}}return!1},ne.getFindAllNodesFailureDescription=function(l,r){if(!ro)throw Error(u(363));var h=0,g=[];l=[Su(l),0];for(var E=0;E<l.length;){var T=l[E++],z=T.tag,L=l[E++],ft=r[L];if((z!==5&&z!==26&&z!==27||!Ys(T))&&($c(T,ft)&&(g.push(rd(ft)),L++,L>h&&(h=L)),L<r.length))for(T=T.child;T!==null;)l.push(T,L),T=T.sibling}if(h<r.length){for(l=[];h<r.length;h++)l.push(rd(r[h]));return`findAllNodes was able to match part of the selector:
|
|
22
|
+
`+g.stack}}function at(l,r){if(typeof l=="object"&&l!==null){var h=Ry.get(l);return h!==void 0?h:(r={value:l,source:r,stack:K(r)},Ry.set(l,r),r)}return{value:l,source:r,stack:K(r)}}function St(l,r){mo[Hu++]=lt,mo[Hu++]=Pn,Pn=l,lt=r}function W(l,r,h){Ui[Bi++]=Xa,Ui[Bi++]=qs,Ui[Bi++]=Hl,Hl=l;var g=Xa;l=qs;var E=32-ii(g)-1;g&=~(1<<E),h+=1;var T=32-ii(r)+E;if(30<T){var z=E-E%5;T=(g&(1<<z)-1).toString(32),g>>=z,E-=z,Xa=1<<32-ii(r)+E|h<<E|g,qs=T+l}else Xa=1<<T|h<<E|g,qs=l}function gt(l){l.return!==null&&(St(l,1),W(l,1,0))}function Tt(l){for(;l===Pn;)Pn=mo[--Hu],mo[Hu]=null,lt=mo[--Hu],mo[Hu]=null;for(;l===Hl;)Hl=Ui[--Bi],Ui[Bi]=null,qs=Ui[--Bi],Ui[Bi]=null,Xa=Ui[--Bi],Ui[Bi]=null}function Pt(l,r){Ui[Bi++]=Xa,Ui[Bi++]=qs,Ui[Bi++]=Hl,Xa=r.id,qs=r.overflow,Hl=l}function le(l,r){A(dr,r),A(_f,l),A(ba,null),l=n3(r),D(ba),A(ba,l)}function xn(){D(ba),D(_f),D(dr)}function xe(l){l.memoizedState!==null&&A(Ld,l);var r=ba.current,h=Yg(r,l.type);r!==h&&(A(_f,l),A(ba,h))}function Dn(l){_f.current===l&&(D(ba),D(_f)),Ld.current===l&&(D(Ld),Hi?fr._currentValue=qa:fr._currentValue2=qa)}function ln(l){var r=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw An(at(r,l)),Bm}function Be(l,r){if(!ya)throw Error(u(175));Du(l.stateNode,l.type,l.memoizedProps,r,l)||ln(l,!0)}function At(l){for(Fn=l.return;Fn;)switch(Fn.tag){case 5:case 31:case 13:Vi=!1;return;case 27:case 3:Vi=!0;return;default:Fn=Fn.return}}function ue(l){if(!ya||l!==Fn)return!1;if(!se)return At(l),se=!0,!1;var r=l.tag;if(Ln?r!==3&&r!==27&&(r!==5||Cy(l.type)&&!pf(l.type,l.memoizedProps))&&We&&ln(l):r!==3&&(r!==5||Cy(l.type)&&!pf(l.type,l.memoizedProps))&&We&&ln(l),At(l),r===13){if(!ya)throw Error(u(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(u(317));We=yy(l)}else if(r===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(u(317));We=gy(l)}else We=Ln&&r===27?fy(l.type,We):Fn?Am(l.stateNode):null;return!0}function ta(){ya&&(We=Fn=null,se=!1)}function ea(){var l=wl;return l!==null&&(ui===null?ui=l:ui.push.apply(ui,l),wl=null),l}function An(l){wl===null?wl=[l]:wl.push(l)}function Ba(l,r,h){Hi?(A(Xs,r._currentValue),r._currentValue=h):(A(Xs,r._currentValue2),r._currentValue2=h)}function pn(l){var r=Xs.current;Hi?l._currentValue=r:l._currentValue2=r,D(Xs)}function ha(l,r,h){for(;l!==null;){var g=l.alternate;if((l.childLanes&r)!==r?(l.childLanes|=r,g!==null&&(g.childLanes|=r)):g!==null&&(g.childLanes&r)!==r&&(g.childLanes|=r),l===h)break;l=l.return}}function Ji(l,r,h,g){var E=l.child;for(E!==null&&(E.return=l);E!==null;){var T=E.dependencies;if(T!==null){var z=E.child;T=T.firstContext;t:for(;T!==null;){var L=T;T=E;for(var ft=0;ft<r.length;ft++)if(L.context===r[ft]){T.lanes|=h,L=T.alternate,L!==null&&(L.lanes|=h),ha(T.return,h,l),g||(z=null);break t}T=L.next}}else if(E.tag===18){if(z=E.return,z===null)throw Error(u(341));z.lanes|=h,T=z.alternate,T!==null&&(T.lanes|=h),ha(z,h,l),z=null}else z=E.child;if(z!==null)z.return=E;else for(z=E;z!==null;){if(z===l){z=null;break}if(E=z.sibling,E!==null){E.return=z.return,z=E;break}z=z.return}E=z}}function di(l,r,h,g){l=null;for(var E=r,T=!1;E!==null;){if(!T){if((E.flags&524288)!==0)T=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var z=E.alternate;if(z===null)throw Error(u(387));if(z=z.memoizedProps,z!==null){var L=E.type;Sa(E.pendingProps.value,z.value)||(l!==null?l.push(L):l=[L])}}else if(E===Ld.current){if(z=E.alternate,z===null)throw Error(u(387));z.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(l!==null?l.push(fr):l=[fr])}E=E.return}l!==null&&Ji(r,l,h,g),r.flags|=262144}function Fi(l){for(l=l.firstContext;l!==null;){var r=l.context;if(!Sa(Hi?r._currentValue:r._currentValue2,l.memoizedValue))return!0;l=l.next}return!1}function Mn(l){Ka=l,$e=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function rn(l){return Ut(Ka,l)}function Mi(l,r){return Ka===null&&Mn(l),Ut(l,r)}function Ut(l,r){var h=Hi?r._currentValue:r._currentValue2;if(r={context:r,memoizedValue:h,next:null},$e===null){if(l===null)throw Error(u(308));$e=r,l.dependencies={lanes:0,firstContext:r},l.flags|=524288}else $e=$e.next=r;return h}function Ae(){return{controller:new Ks,data:new Map,refCount:0}}function jn(l){l.refCount--,l.refCount===0&&Na(m3,function(){l.controller.abort()})}function Va(){}function ke(l){l!==ri&&l.next===null&&(ri===null?zn=ri=l:ri=ri.next=l),wu=!0,Vm||(Vm=!0,Cg())}function mn(l,r){if(!go&&wu){go=!0;do for(var h=!1,g=zn;g!==null;){if(l!==0){var E=g.pendingLanes;if(E===0)var T=0;else{var z=g.suspendedLanes,L=g.pingedLanes;T=(1<<31-ii(42|l)+1)-1,T&=E&~(z&~L),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(h=!0,Pr(g,T))}else T=ce,T=O(g,g===Le?T:0,g.cancelPendingCommit!==null||g.timeoutHandle!==Ml),(T&3)===0||U(g,T)||(h=!0,Pr(g,T));g=g.next}while(h);go=!1}}function eu(){Lr()}function Lr(){wu=Vm=!1;var l=0;hs!==0&&Tm()&&(l=hs);for(var r=Me(),h=null,g=zn;g!==null;){var E=g.next,T=nu(g,r);T===0?(g.next=null,h===null?zn=E:h.next=E,E===null&&(ri=h)):(h=g,(l!==0||(T&3)!==0)&&(wu=!0)),g=E}we!==0&&we!==5||mn(l),hs!==0&&(hs=0)}function nu(l,r){for(var h=l.suspendedLanes,g=l.pingedLanes,E=l.expirationTimes,T=l.pendingLanes&-62914561;0<T;){var z=31-ii(T),L=1<<z,ft=E[z];ft===-1?((L&h)===0||(L&g)!==0)&&(E[z]=j(L,r)):ft<=r&&(l.expiredLanes|=L),T&=~L}if(r=Le,h=ce,h=O(l,l===r?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==Ml),g=l.callbackNode,h===0||l===r&&(He===2||He===9)||l.cancelPendingCommit!==null)return g!==null&&g!==null&&ae(g),l.callbackNode=null,l.callbackPriority=0;if((h&3)===0||U(l,h)){if(r=h&-h,r===l.callbackPriority)return r;switch(g!==null&&ae(g),rt(h)){case 2:case 8:h=Rl;break;case 32:h=zl;break;case 268435456:h=Ru;break;default:h=zl}return g=da.bind(null,l),h=Vd(h,g),l.callbackPriority=r,l.callbackNode=h,r}return g!==null&&g!==null&&ae(g),l.callbackPriority=2,l.callbackNode=null,2}function da(l,r){if(we!==0&&we!==5)return l.callbackNode=null,l.callbackPriority=0,null;var h=l.callbackNode;if(On()&&l.callbackNode!==h)return null;var g=ce;return g=O(l,l===Le?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==Ml),g===0?null:(am(l,g,r),nu(l,Me()),l.callbackNode!=null&&l.callbackNode===h?da.bind(null,l):null)}function Pr(l,r){if(On())return null;am(l,r,!0)}function Cg(){kg?Ps(function(){(re&6)!==0?Vd(Oy,eu):Lr()}):Vd(Oy,eu)}function Yr(){if(hs===0){var l=Uu;l===0&&(l=Ef,Ef<<=1,(Ef&261888)===0&&(Ef=256)),hs=l}return hs}function au(l,r){if(xf===null){var h=xf=[];Gm=0,Uu=Yr(),Bu={status:"pending",value:void 0,then:function(g){h.push(g)}}}return Gm++,r.then(Ht,Ht),r}function Ht(){if(--Gm===0&&xf!==null){Bu!==null&&(Bu.status="fulfilled");var l=xf;xf=null,Uu=0,Bu=null;for(var r=0;r<l.length;r++)(0,l[r])()}}function ge(l,r){var h=[],g={status:"pending",value:null,reason:null,then:function(E){h.push(E)}};return l.then(function(){g.status="fulfilled",g.value=r;for(var E=0;E<h.length;E++)(0,h[E])(r)},function(E){for(g.status="rejected",g.reason=E,E=0;E<h.length;E++)(0,h[E])(void 0)}),g}function qr(){var l=pr.current;return l!==null?l:Le.pooledCache}function Wl(l,r){r===null?A(pr,pr.current):A(pr,r.pool)}function Nh(){var l=qr();return l===null?null:{parent:Hi?un._currentValue:un._currentValue2,pool:l}}function _c(l,r){if(Sa(l,r))return!0;if(typeof l!="object"||l===null||typeof r!="object"||r===null)return!1;var h=Object.keys(l),g=Object.keys(r);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var E=h[g];if(!Um.call(r,E)||!Sa(l[E],r[E]))return!1}return!0}function O0(l){return l=l.status,l==="fulfilled"||l==="rejected"}function fl(l,r,h){switch(h=l[h],h===void 0?l.push(r):h!==r&&(r.then(Va,Va),r=h),r.status){case"fulfilled":return r.value;case"rejected":throw l=r.reason,Xr(l),l;default:if(typeof r.status=="string")r.then(Va,Va);else{if(l=Le,l!==null&&100<l.shellSuspendCounter)throw Error(u(482));l=r,l.status="pending",l.then(function(g){if(r.status==="pending"){var E=r;E.status="fulfilled",E.value=g}},function(g){if(r.status==="pending"){var E=r;E.status="rejected",E.reason=g}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw l=r.reason,Xr(l),l}throw Gi=r,Vu}}function Wa(l){try{var r=l._init;return r(l._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Gi=h,Vu):h}}function xc(){if(Gi===null)throw Error(u(459));var l=Gi;return Gi=null,l}function Xr(l){if(l===Vu||l===qd)throw Error(u(483))}function pi(l){var r=Df;return Df+=1,ji===null&&(ji=[]),fl(ji,l,r)}function Kr(l,r){r=r.props.ref,l.ref=r!==void 0?r:null}function Qr(l,r){throw r.$$typeof===bd?Error(u(525)):(l=Object.prototype.toString.call(r),Error(u(31,l==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":l)))}function R0(l){function r(it,Z){if(l){var ut=it.deletions;ut===null?(it.deletions=[Z],it.flags|=16):ut.push(Z)}}function h(it,Z){if(!l)return null;for(;Z!==null;)r(it,Z),Z=Z.sibling;return null}function g(it){for(var Z=new Map;it!==null;)it.key!==null?Z.set(it.key,it):Z.set(it.index,it),it=it.sibling;return Z}function E(it,Z){return it=Vs(it,Z),it.index=0,it.sibling=null,it}function T(it,Z,ut){return it.index=ut,l?(ut=it.alternate,ut!==null?(ut=ut.index,ut<Z?(it.flags|=67108866,Z):ut):(it.flags|=67108866,Z)):(it.flags|=1048576,Z)}function z(it){return l&&it.alternate===null&&(it.flags|=67108866),it}function L(it,Z,ut,_t){return Z===null||Z.tag!==6?(Z=of(ut,it.mode,_t),Z.return=it,Z):(Z=E(Z,ut),Z.return=it,Z)}function ft(it,Z,ut,_t){var jt=ut.type;return jt===io?Mt(it,Z,ut.props.children,_t,ut.key):Z!==null&&(Z.elementType===jt||typeof jt=="object"&&jt!==null&&jt.$$typeof===ur&&Wa(jt)===Z.type)?(Z=E(Z,ut.props),Kr(Z,ut),Z.return=it,Z):(Z=rf(ut.type,ut.key,ut.props,null,it.mode,_t),Kr(Z,ut),Z.return=it,Z)}function vt(it,Z,ut,_t){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ut.containerInfo||Z.stateNode.implementation!==ut.implementation?(Z=yd(ut,it.mode,_t),Z.return=it,Z):(Z=E(Z,ut.children||[]),Z.return=it,Z)}function Mt(it,Z,ut,_t,jt){return Z===null||Z.tag!==7?(Z=Dl(ut,it.mode,_t,jt),Z.return=it,Z):(Z=E(Z,ut),Z.return=it,Z)}function xt(it,Z,ut){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=of(""+Z,it.mode,ut),Z.return=it,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case cf:return ut=rf(Z.type,Z.key,Z.props,null,it.mode,ut),Kr(ut,Z),ut.return=it,ut;case or:return Z=yd(Z,it.mode,ut),Z.return=it,Z;case ur:return Z=Wa(Z),xt(it,Z,ut)}if(cr(Z)||b(Z))return Z=Dl(Z,it.mode,ut,null),Z.return=it,Z;if(typeof Z.then=="function")return xt(it,pi(Z),ut);if(Z.$$typeof===Al)return xt(it,Mi(it,Z),ut);Qr(it,Z)}return null}function Rt(it,Z,ut,_t){var jt=Z!==null?Z.key:null;if(typeof ut=="string"&&ut!==""||typeof ut=="number"||typeof ut=="bigint")return jt!==null?null:L(it,Z,""+ut,_t);if(typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case cf:return ut.key===jt?ft(it,Z,ut,_t):null;case or:return ut.key===jt?vt(it,Z,ut,_t):null;case ur:return ut=Wa(ut),Rt(it,Z,ut,_t)}if(cr(ut)||b(ut))return jt!==null?null:Mt(it,Z,ut,_t,null);if(typeof ut.then=="function")return Rt(it,Z,pi(ut),_t);if(ut.$$typeof===Al)return Rt(it,Z,Mi(it,ut),_t);Qr(it,ut)}return null}function Yt(it,Z,ut,_t,jt){if(typeof _t=="string"&&_t!==""||typeof _t=="number"||typeof _t=="bigint")return it=it.get(ut)||null,L(Z,it,""+_t,jt);if(typeof _t=="object"&&_t!==null){switch(_t.$$typeof){case cf:return it=it.get(_t.key===null?ut:_t.key)||null,ft(Z,it,_t,jt);case or:return it=it.get(_t.key===null?ut:_t.key)||null,vt(Z,it,_t,jt);case ur:return _t=Wa(_t),Yt(it,Z,ut,_t,jt)}if(cr(_t)||b(_t))return it=it.get(ut)||null,Mt(Z,it,_t,jt,null);if(typeof _t.then=="function")return Yt(it,Z,ut,pi(_t),jt);if(_t.$$typeof===Al)return Yt(it,Z,ut,Mi(Z,_t),jt);Qr(Z,_t)}return null}function tn(it,Z,ut,_t){for(var jt=null,cn=null,Xt=Z,_e=Z=0,fe=null;Xt!==null&&_e<ut.length;_e++){Xt.index>_e?(fe=Xt,Xt=null):fe=Xt.sibling;var ye=Rt(it,Xt,ut[_e],_t);if(ye===null){Xt===null&&(Xt=fe);break}l&&Xt&&ye.alternate===null&&r(it,Xt),Z=T(ye,Z,_e),cn===null?jt=ye:cn.sibling=ye,cn=ye,Xt=fe}if(_e===ut.length)return h(it,Xt),se&&St(it,_e),jt;if(Xt===null){for(;_e<ut.length;_e++)Xt=xt(it,ut[_e],_t),Xt!==null&&(Z=T(Xt,Z,_e),cn===null?jt=Xt:cn.sibling=Xt,cn=Xt);return se&&St(it,_e),jt}for(Xt=g(Xt);_e<ut.length;_e++)fe=Yt(Xt,it,_e,ut[_e],_t),fe!==null&&(l&&fe.alternate!==null&&Xt.delete(fe.key===null?_e:fe.key),Z=T(fe,Z,_e),cn===null?jt=fe:cn.sibling=fe,cn=fe);return l&&Xt.forEach(function(Gl){return r(it,Gl)}),se&&St(it,_e),jt}function kn(it,Z,ut,_t){if(ut==null)throw Error(u(151));for(var jt=null,cn=null,Xt=Z,_e=Z=0,fe=null,ye=ut.next();Xt!==null&&!ye.done;_e++,ye=ut.next()){Xt.index>_e?(fe=Xt,Xt=null):fe=Xt.sibling;var Gl=Rt(it,Xt,ye.value,_t);if(Gl===null){Xt===null&&(Xt=fe);break}l&&Xt&&Gl.alternate===null&&r(it,Xt),Z=T(Gl,Z,_e),cn===null?jt=Gl:cn.sibling=Gl,cn=Gl,Xt=fe}if(ye.done)return h(it,Xt),se&&St(it,_e),jt;if(Xt===null){for(;!ye.done;_e++,ye=ut.next())ye=xt(it,ye.value,_t),ye!==null&&(Z=T(ye,Z,_e),cn===null?jt=ye:cn.sibling=ye,cn=ye);return se&&St(it,_e),jt}for(Xt=g(Xt);!ye.done;_e++,ye=ut.next())ye=Yt(Xt,it,_e,ye.value,_t),ye!==null&&(l&&ye.alternate!==null&&Xt.delete(ye.key===null?_e:ye.key),Z=T(ye,Z,_e),cn===null?jt=ye:cn.sibling=ye,cn=ye);return l&&Xt.forEach(function(zf){return r(it,zf)}),se&&St(it,_e),jt}function Eo(it,Z,ut,_t){if(typeof ut=="object"&&ut!==null&&ut.type===io&&ut.key===null&&(ut=ut.props.children),typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case cf:t:{for(var jt=ut.key;Z!==null;){if(Z.key===jt){if(jt=ut.type,jt===io){if(Z.tag===7){h(it,Z.sibling),_t=E(Z,ut.props.children),_t.return=it,it=_t;break t}}else if(Z.elementType===jt||typeof jt=="object"&&jt!==null&&jt.$$typeof===ur&&Wa(jt)===Z.type){h(it,Z.sibling),_t=E(Z,ut.props),Kr(_t,ut),_t.return=it,it=_t;break t}h(it,Z);break}else r(it,Z);Z=Z.sibling}ut.type===io?(_t=Dl(ut.props.children,it.mode,_t,ut.key),_t.return=it,it=_t):(_t=rf(ut.type,ut.key,ut.props,null,it.mode,_t),Kr(_t,ut),_t.return=it,it=_t)}return z(it);case or:t:{for(jt=ut.key;Z!==null;){if(Z.key===jt)if(Z.tag===4&&Z.stateNode.containerInfo===ut.containerInfo&&Z.stateNode.implementation===ut.implementation){h(it,Z.sibling),_t=E(Z,ut.children||[]),_t.return=it,it=_t;break t}else{h(it,Z);break}else r(it,Z);Z=Z.sibling}_t=yd(ut,it.mode,_t),_t.return=it,it=_t}return z(it);case ur:return ut=Wa(ut),Eo(it,Z,ut,_t)}if(cr(ut))return tn(it,Z,ut,_t);if(b(ut)){if(jt=b(ut),typeof jt!="function")throw Error(u(150));return ut=jt.call(ut),kn(it,Z,ut,_t)}if(typeof ut.then=="function")return Eo(it,Z,pi(ut),_t);if(ut.$$typeof===Al)return Eo(it,Z,Mi(it,ut),_t);Qr(it,ut)}return typeof ut=="string"&&ut!==""||typeof ut=="number"||typeof ut=="bigint"?(ut=""+ut,Z!==null&&Z.tag===6?(h(it,Z.sibling),_t=E(Z,ut),_t.return=it,it=_t):(h(it,Z),_t=of(ut,it.mode,_t),_t.return=it,it=_t),z(it)):h(it,Z)}return function(it,Z,ut,_t){try{Df=0;var jt=Eo(it,Z,ut,_t);return ji=null,jt}catch(Xt){if(Xt===Vu||Xt===qd)throw Xt;var cn=i(29,Xt,null,it.mode);return cn.lanes=_t,cn.return=it,cn}}}function Ca(){for(var l=ds,r=jm=ds=0;r<l;){var h=Li[r];Li[r++]=null;var g=Li[r];Li[r++]=null;var E=Li[r];Li[r++]=null;var T=Li[r];if(Li[r++]=null,g!==null&&E!==null){var z=g.pending;z===null?E.next=E:(E.next=z.next,z.next=E),g.pending=E}T!==0&&iu(h,E,T)}}function hl(l,r,h,g){Li[ds++]=l,Li[ds++]=r,Li[ds++]=h,Li[ds++]=g,jm|=g,l.lanes|=g,l=l.alternate,l!==null&&(l.lanes|=g)}function dl(l,r,h,g){return hl(l,r,h,g),Zr(l)}function $l(l,r){return hl(l,null,null,r),Zr(l)}function iu(l,r,h){l.lanes|=h;var g=l.alternate;g!==null&&(g.lanes|=h);for(var E=!1,T=l.return;T!==null;)T.childLanes|=h,g=T.alternate,g!==null&&(g.childLanes|=h),T.tag===22&&(l=T.stateNode,l===null||l._visibility&1||(E=!0)),l=T,T=T.return;return l.tag===3?(T=l.stateNode,E&&r!==null&&(E=31-ii(h),l=T.hiddenUpdates,g=l[E],g===null?l[E]=[r]:g.push(r),r.lane=h|536870912),T):null}function Zr(l){if(50<qu)throw qu=0,rp=null,Error(u(185));for(var r=l.return;r!==null;)l=r,r=l.return;return l.tag===3?l.stateNode:null}function Dc(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jr(l,r){l=l.updateQueue,r.updateQueue===l&&(r.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function mi(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function Ds(l,r,h){var g=l.updateQueue;if(g===null)return null;if(g=g.shared,(re&2)!==0){var E=g.pending;return E===null?r.next=r:(r.next=E.next,E.next=r),g.pending=r,r=Zr(l),iu(l,null,h),r}return hl(l,g,r,h),Zr(l)}function Ac(l,r,h){if(r=r.updateQueue,r!==null&&(r=r.shared,(h&4194048)!==0)){var g=r.lanes;g&=l.pendingLanes,h|=g,r.lanes=h,et(l,h)}}function z0(l,r){var h=l.updateQueue,g=l.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var E=null,T=null;if(h=h.firstBaseUpdate,h!==null){do{var z={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};T===null?E=T=z:T=T.next=z,h=h.next}while(h!==null);T===null?E=T=r:T=T.next=r}else E=T=r;h={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:T,shared:g.shared,callbacks:g.callbacks},l.updateQueue=h;return}l=h.lastBaseUpdate,l===null?h.firstBaseUpdate=r:l.next=r,h.lastBaseUpdate=r}function su(){if(Lm){var l=Bu;if(l!==null)throw l}}function Fr(l,r,h,g){Lm=!1;var E=l.updateQueue;mr=!1;var T=E.firstBaseUpdate,z=E.lastBaseUpdate,L=E.shared.pending;if(L!==null){E.shared.pending=null;var ft=L,vt=ft.next;ft.next=null,z===null?T=vt:z.next=vt,z=ft;var Mt=l.alternate;Mt!==null&&(Mt=Mt.updateQueue,L=Mt.lastBaseUpdate,L!==z&&(L===null?Mt.firstBaseUpdate=vt:L.next=vt,Mt.lastBaseUpdate=ft))}if(T!==null){var xt=E.baseState;z=0,Mt=vt=ft=null,L=T;do{var Rt=L.lane&-536870913,Yt=Rt!==L.lane;if(Yt?(ce&Rt)===Rt:(g&Rt)===Rt){Rt!==0&&Rt===Uu&&(Lm=!0),Mt!==null&&(Mt=Mt.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});t:{var tn=l,kn=L;Rt=r;var Eo=h;switch(kn.tag){case 1:if(tn=kn.payload,typeof tn=="function"){xt=tn.call(Eo,xt,Rt);break t}xt=tn;break t;case 3:tn.flags=tn.flags&-65537|128;case 0:if(tn=kn.payload,Rt=typeof tn=="function"?tn.call(Eo,xt,Rt):tn,Rt==null)break t;xt=yi({},xt,Rt);break t;case 2:mr=!0}}Rt=L.callback,Rt!==null&&(l.flags|=64,Yt&&(l.flags|=8192),Yt=E.callbacks,Yt===null?E.callbacks=[Rt]:Yt.push(Rt))}else Yt={lane:Rt,tag:L.tag,payload:L.payload,callback:L.callback,next:null},Mt===null?(vt=Mt=Yt,ft=xt):Mt=Mt.next=Yt,z|=Rt;if(L=L.next,L===null){if(L=E.shared.pending,L===null)break;Yt=L,L=Yt.next,Yt.next=null,E.lastBaseUpdate=Yt,E.shared.pending=null}}while(!0);Mt===null&&(ft=xt),E.baseState=ft,E.firstBaseUpdate=vt,E.lastBaseUpdate=Mt,T===null&&(E.shared.lanes=0),vr|=z,l.lanes=z,l.memoizedState=xt}}function H0(l,r){if(typeof l!="function")throw Error(u(191,l));l.call(r)}function _g(l,r){var h=l.callbacks;if(h!==null)for(l.callbacks=null,l=0;l<h.length;l++)H0(h[l],r)}function Bt(l,r){l=Bl,A(Kd,l),A(Qs,r),Bl=l|r.baseLanes}function Mc(){A(Kd,Bl),A(Qs,Qs.current)}function pl(){Bl=Kd.current,D(Qs),D(Kd)}function ml(l){var r=l.alternate;A(Hn,Hn.current&1),A(Si,l),Pi===null&&(r===null||Qs.current!==null||r.memoizedState!==null)&&(Pi=l)}function lu(l){A(Hn,Hn.current),A(Si,l),Pi===null&&(Pi=l)}function As(l){l.tag===22?(A(Hn,Hn.current),A(Si,l),Pi===null&&(Pi=l)):gl()}function gl(){A(Hn,Hn.current),A(Si,Si.current)}function $a(l){D(Si),Pi===l&&(Pi=null),D(Hn)}function yl(l){for(var r=l;r!==null;){if(r.tag===13){var h=r.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||vf(h)||Sf(h)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===l)break;for(;r.sibling===null;){if(r.return===null||r.return===l)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function on(){throw Error(u(321))}function vl(l,r){if(r===null)return!1;for(var h=0;h<r.length&&h<l.length;h++)if(!Sa(l[h],r[h]))return!1;return!0}function Nc(l,r,h,g,E,T){return Ul=T,kt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Gt.H=l===null||l.memoizedState===null?Hy:Pm,vo=!1,T=h(g,E),vo=!1,Gu&&(T=Oh(r,h,g,E)),ru(l),T}function ru(l){Gt.H=Af;var r=Ge!==null&&Ge.next!==null;if(Ul=0,Yn=Ge=kt=null,Qd=!1,ju=0,Lu=null,r)throw Error(u(300));l===null||qn||(l=l.dependencies,l!==null&&Fi(l)&&(qn=!0))}function Oh(l,r,h,g){kt=l;var E=0;do{if(Gu&&(Lu=null),ju=0,Gu=!1,25<=E)throw Error(u(301));if(E+=1,Yn=Ge=null,l.updateQueue!=null){var T=l.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}Gt.H=wy,T=r(h,g)}while(Gu);return T}function Rh(){var l=Gt.H,r=l.useState()[0];return r=typeof r.then=="function"?Ii(r):r,l=l.useState()[0],(Ge!==null?Ge.memoizedState:null)!==l&&(kt.flags|=1024),r}function Ms(){var l=Zd!==0;return Zd=0,l}function ki(l,r,h){r.updateQueue=l.updateQueue,r.flags&=-2053,l.lanes&=~h}function Oc(l){if(Qd){for(l=l.memoizedState;l!==null;){var r=l.queue;r!==null&&(r.pending=null),l=l.next}Qd=!1}Ul=0,Yn=Ge=kt=null,Gu=!1,ju=Zd=0,Lu=null}function pa(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yn===null?kt.memoizedState=Yn=l:Yn=Yn.next=l,Yn}function Ye(){if(Ge===null){var l=kt.alternate;l=l!==null?l.memoizedState:null}else l=Ge.next;var r=Yn===null?kt.memoizedState:Yn.next;if(r!==null)Yn=r,Ge=l;else{if(l===null)throw kt.alternate===null?Error(u(467)):Error(u(310));Ge=l,l={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},Yn===null?kt.memoizedState=Yn=l:Yn=Yn.next=l}return Yn}function kr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ii(l){var r=ju;return ju+=1,Lu===null&&(Lu=[]),l=fl(Lu,l,r),r=kt,(Yn===null?r.memoizedState:Yn.next)===null&&(r=r.alternate,Gt.H=r===null||r.memoizedState===null?Hy:Pm),l}function Ve(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return Ii(l);if(l.$$typeof===Al)return rn(l)}throw Error(u(438,String(l)))}function ou(l){var r=null,h=kt.updateQueue;if(h!==null&&(r=h.memoCache),r==null){var g=kt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(r={data:g.data.map(function(E){return E.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),h===null&&(h=kr(),kt.updateQueue=h),h.memoCache=r,h=r.data[r.index],h===void 0)for(h=r.data[r.index]=Array(l),g=0;g<l;g++)h[g]=Gs;return r.index++,h}function Ns(l,r){return typeof r=="function"?r(l):r}function uu(l){var r=Ye();return Sl(r,Ge,l)}function Sl(l,r,h){var g=l.queue;if(g===null)throw Error(u(311));g.lastRenderedReducer=h;var E=l.baseQueue,T=g.pending;if(T!==null){if(E!==null){var z=E.next;E.next=T.next,T.next=z}r.baseQueue=E=T,g.pending=null}if(T=l.baseState,E===null)l.memoizedState=T;else{r=E.next;var L=z=null,ft=null,vt=r,Mt=!1;do{var xt=vt.lane&-536870913;if(xt!==vt.lane?(ce&xt)===xt:(Ul&xt)===xt){var Rt=vt.revertLane;if(Rt===0)ft!==null&&(ft=ft.next={lane:0,revertLane:0,gesture:null,action:vt.action,hasEagerState:vt.hasEagerState,eagerState:vt.eagerState,next:null}),xt===Uu&&(Mt=!0);else if((Ul&Rt)===Rt){vt=vt.next,Rt===Uu&&(Mt=!0);continue}else xt={lane:0,revertLane:vt.revertLane,gesture:null,action:vt.action,hasEagerState:vt.hasEagerState,eagerState:vt.eagerState,next:null},ft===null?(L=ft=xt,z=T):ft=ft.next=xt,kt.lanes|=Rt,vr|=Rt;xt=vt.action,vo&&h(T,xt),T=vt.hasEagerState?vt.eagerState:h(T,xt)}else Rt={lane:xt,revertLane:vt.revertLane,gesture:vt.gesture,action:vt.action,hasEagerState:vt.hasEagerState,eagerState:vt.eagerState,next:null},ft===null?(L=ft=Rt,z=T):ft=ft.next=Rt,kt.lanes|=xt,vr|=xt;vt=vt.next}while(vt!==null&&vt!==r);if(ft===null?z=T:ft.next=L,!Sa(T,l.memoizedState)&&(qn=!0,Mt&&(h=Bu,h!==null)))throw h;l.memoizedState=T,l.baseState=z,l.baseQueue=ft,g.lastRenderedState=T}return E===null&&(g.lanes=0),[l.memoizedState,g.dispatch]}function Ir(l){var r=Ye(),h=r.queue;if(h===null)throw Error(u(311));h.lastRenderedReducer=l;var g=h.dispatch,E=h.pending,T=r.memoizedState;if(E!==null){h.pending=null;var z=E=E.next;do T=l(T,z.action),z=z.next;while(z!==E);Sa(T,r.memoizedState)||(qn=!0),r.memoizedState=T,r.baseQueue===null&&(r.baseState=T),h.lastRenderedState=T}return[T,g]}function Wi(l,r,h){var g=kt,E=Ye(),T=se;if(T){if(h===void 0)throw Error(u(407));h=h()}else h=r();var z=!Sa((Ge||E).memoizedState,h);if(z&&(E.memoizedState=h,qn=!0),E=E.queue,Hh(Rc.bind(null,g,E,l),[l]),E.getSnapshot!==r||z||Yn!==null&&Yn.memoizedState.tag&1){if(g.flags|=2048,ja(9,{destroy:void 0},Os.bind(null,g,E,h,r),null),Le===null)throw Error(u(349));T||(Ul&127)!==0||xg(g,r,h)}return h}function xg(l,r,h){l.flags|=16384,l={getSnapshot:r,value:h},r=kt.updateQueue,r===null?(r=kr(),kt.updateQueue=r,r.stores=[l]):(h=r.stores,h===null?r.stores=[l]:h.push(l))}function Os(l,r,h,g){r.value=h,r.getSnapshot=g,cu(r)&&zc(l)}function Rc(l,r,h){return h(function(){cu(r)&&zc(l)})}function cu(l){var r=l.getSnapshot;l=l.value;try{var h=r();return!Sa(l,h)}catch{return!0}}function zc(l){var r=$l(l,2);r!==null&&Pa(r,l,2)}function Ga(l){var r=pa();if(typeof l=="function"){var h=l;if(l=h(),vo){dt(!0);try{h()}finally{dt(!1)}}}return r.memoizedState=r.baseState=l,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:l},r}function ti(l,r,h,g){return l.baseState=h,Sl(l,Ge,typeof g=="function"?g:Ns)}function Rs(l,r,h,g,E){if(er(l))throw Error(u(485));if(l=r.action,l!==null){var T={payload:E,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(z){T.listeners.push(z)}};Gt.T!==null?h(!0):T.isTransition=!1,g(T),h=r.pending,h===null?(T.next=r.pending=T,$i(r,T)):(T.next=h.next,r.pending=h.next=T)}}function $i(l,r){var h=r.action,g=r.payload,E=l.state;if(r.isTransition){var T=Gt.T,z={};Gt.T=z;try{var L=h(E,g),ft=Gt.S;ft!==null&&ft(z,L),ts(l,r,L)}catch(vt){Hc(l,r,vt)}finally{T!==null&&z.types!==null&&(T.types=z.types),Gt.T=T}}else try{T=h(E,g),ts(l,r,T)}catch(vt){Hc(l,r,vt)}}function ts(l,r,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){es(l,r,g)},function(g){return Hc(l,r,g)}):es(l,r,h)}function es(l,r,h){r.status="fulfilled",r.value=h,zh(r),l.state=h,r=l.pending,r!==null&&(h=r.next,h===r?l.pending=null:(h=h.next,r.next=h,$i(l,h)))}function Hc(l,r,h){var g=l.pending;if(l.pending=null,g!==null){g=g.next;do r.status="rejected",r.reason=h,zh(r),r=r.next;while(r!==g)}l.action=null}function zh(l){l=l.listeners;for(var r=0;r<l.length;r++)(0,l[r])()}function w0(l,r){return r}function ns(l,r){if(se){var h=Le.formState;if(h!==null){t:{var g=kt;if(se){if(We){var E=uy(We,Vi);if(E){We=Am(E),g=cy(E);break t}}ln(g)}g=!1}g&&(r=h[0])}}h=pa(),h.memoizedState=h.baseState=r,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:w0,lastRenderedState:r},h.queue=g,h=jh.bind(null,kt,g),g.dispatch=h,g=Ga(!1);var T=hu.bind(null,kt,!1,g.queue);return g=pa(),E={state:r,dispatch:null,action:l,pending:null},g.queue=E,h=Rs.bind(null,kt,E,T,h),E.dispatch=h,g.memoizedState=l,[r,h,!1]}function U0(l){var r=Ye();return as(r,Ge,l)}function as(l,r,h){if(r=Sl(l,r,w0)[0],l=uu(Ns)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var g=Ii(r)}catch(z){throw z===Vu?qd:z}else g=r;r=Ye();var E=r.queue,T=E.dispatch;return h!==r.memoizedState&&(kt.flags|=2048,ja(9,{destroy:void 0},wc.bind(null,E,h),null)),[g,T,l]}function wc(l,r){l.action=r}function Uc(l){var r=Ye(),h=Ge;if(h!==null)return as(r,h,l);Ye(),r=r.memoizedState,h=Ye();var g=h.queue.dispatch;return h.memoizedState=l,[r,g,!1]}function ja(l,r,h,g){return l={tag:l,create:h,deps:g,inst:r,next:null},r=kt.updateQueue,r===null&&(r=kr(),kt.updateQueue=r),h=r.lastEffect,h===null?r.lastEffect=l.next=l:(g=h.next,h.next=l,l.next=g,r.lastEffect=l),l}function Wr(){return Ye().memoizedState}function Bc(l,r,h,g){var E=pa();kt.flags|=l,E.memoizedState=ja(1|r,{destroy:void 0},h,g===void 0?null:g)}function fu(l,r,h,g){var E=Ye();g=g===void 0?null:g;var T=E.memoizedState.inst;Ge!==null&&g!==null&&vl(g,Ge.memoizedState.deps)?E.memoizedState=ja(r,T,h,g):(kt.flags|=l,E.memoizedState=ja(1|r,T,h,g))}function B0(l,r){Bc(8390656,8,l,r)}function Hh(l,r){fu(2048,8,l,r)}function Dg(l){kt.flags|=4;var r=kt.updateQueue;if(r===null)r=kr(),kt.updateQueue=r,r.events=[l];else{var h=r.events;h===null?r.events=[l]:h.push(l)}}function wh(l){var r=Ye().memoizedState;return Dg({ref:r,nextImpl:l}),function(){if((re&2)!==0)throw Error(u(440));return r.impl.apply(void 0,arguments)}}function V0(l,r){return fu(4,2,l,r)}function Uh(l,r){return fu(4,4,l,r)}function Ag(l,r){if(typeof r=="function"){l=l();var h=r(l);return function(){typeof h=="function"?h():r(null)}}if(r!=null)return l=l(),r.current=l,function(){r.current=null}}function G0(l,r,h){h=h!=null?h.concat([l]):null,fu(4,4,Ag.bind(null,r,l),h)}function j0(){}function Bh(l,r){var h=Ye();r=r===void 0?null:r;var g=h.memoizedState;return r!==null&&vl(r,g[1])?g[0]:(h.memoizedState=[l,r],l)}function Vc(l,r){var h=Ye();r=r===void 0?null:r;var g=h.memoizedState;if(r!==null&&vl(r,g[1]))return g[0];if(g=l(),vo){dt(!0);try{l()}finally{dt(!1)}}return h.memoizedState=[g,r],g}function Vh(l,r,h){return h===void 0||(Ul&1073741824)!==0&&(ce&261930)===0?l.memoizedState=r:(l.memoizedState=h,l=ef(),kt.lanes|=l,vr|=l,h)}function Gc(l,r,h,g){return Sa(h,r)?h:Qs.current!==null?(l=Vh(l,h,g),Sa(l,r)||(qn=!0),l):(Ul&42)===0||(Ul&1073741824)!==0&&(ce&261930)===0?(qn=!0,l.memoizedState=h):(l=ef(),kt.lanes|=l,vr|=l,r)}function L0(l,r,h,g,E){var T=Ls();Jn(T!==0&&8>T?T:8);var z=Gt.T,L={};Gt.T=L,hu(l,!1,r,h);try{var ft=E(),vt=Gt.S;if(vt!==null&&vt(L,ft),ft!==null&&typeof ft=="object"&&typeof ft.then=="function"){var Mt=ge(ft,g);tr(l,r,Mt,ai(l))}else tr(l,r,g,ai(l))}catch(xt){tr(l,r,{then:function(){},status:"rejected",reason:xt},ai())}finally{Jn(T),z!==null&&L.types!==null&&(z.types=L.types),Gt.T=z}}function P0(l){var r=l.memoizedState;if(r!==null)return r;r={memoizedState:qa,baseState:qa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:qa},next:null};var h={};return r.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:h},next:null},l.memoizedState=r,l=l.alternate,l!==null&&(l.memoizedState=r),r}function Gh(){return rn(fr)}function bl(){return Ye().memoizedState}function Y0(){return Ye().memoizedState}function Mg(l){for(var r=l.return;r!==null;){switch(r.tag){case 24:case 3:var h=ai();l=mi(h);var g=Ds(r,l,h);g!==null&&(Pa(g,r,h),Ac(g,r,h)),r={cache:Ae()},l.payload=r;return}r=r.return}}function ma(l,r,h){var g=ai();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},er(l)?q0(r,h):(h=dl(l,r,h,g),h!==null&&(Pa(h,l,g),jc(h,r,g)))}function jh(l,r,h){var g=ai();tr(l,r,h,g)}function tr(l,r,h,g){var E={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(er(l))q0(r,E);else{var T=l.alternate;if(l.lanes===0&&(T===null||T.lanes===0)&&(T=r.lastRenderedReducer,T!==null))try{var z=r.lastRenderedState,L=T(z,h);if(E.hasEagerState=!0,E.eagerState=L,Sa(L,z))return hl(l,r,E,0),Le===null&&Ca(),!1}catch{}if(h=dl(l,r,E,g),h!==null)return Pa(h,l,g),jc(h,r,g),!0}return!1}function hu(l,r,h,g){if(g={lane:2,revertLane:Yr(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},er(l)){if(r)throw Error(u(479))}else r=dl(l,h,g,2),r!==null&&Pa(r,l,2)}function er(l){var r=l.alternate;return l===kt||r!==null&&r===kt}function q0(l,r){Gu=Qd=!0;var h=l.pending;h===null?r.next=r:(r.next=h.next,h.next=r),l.pending=r}function jc(l,r,h){if((h&4194048)!==0){var g=r.lanes;g&=l.pendingLanes,h|=g,r.lanes=h,et(l,h)}}function Lh(l,r,h,g){r=l.memoizedState,h=h(g,r),h=h==null?r:yi({},r,h),l.memoizedState=h,l.lanes===0&&(l.updateQueue.baseState=h)}function Lc(l,r,h,g,E,T,z){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(g,T,z):r.prototype&&r.prototype.isPureReactComponent?!_c(h,g)||!_c(E,T):!0}function X0(l,r,h,g){l=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(h,g),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(h,g),r.state!==l&&Jd.enqueueReplaceState(r,r.state,null)}function zs(l,r){var h=r;if("ref"in r){h={};for(var g in r)g!=="ref"&&(h[g]=r[g])}if(l=l.defaultProps){h===r&&(h=yi({},h));for(var E in l)h[E]===void 0&&(h[E]=l[E])}return h}function Pc(l,r){try{var h=l.onUncaughtError;h(r.value,{componentStack:r.stack})}catch(g){setTimeout(function(){throw g})}}function K0(l,r,h){try{var g=l.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function du(l,r,h){return h=mi(h),h.tag=3,h.payload={element:null},h.callback=function(){Pc(l,r)},h}function Yc(l){return l=mi(l),l.tag=3,l}function Ph(l,r,h,g){var E=h.type.getDerivedStateFromError;if(typeof E=="function"){var T=g.value;l.payload=function(){return E(T)},l.callback=function(){K0(r,h,g)}}var z=h.stateNode;z!==null&&typeof z.componentDidCatch=="function"&&(l.callback=function(){K0(r,h,g),typeof E!="function"&&(Sr===null?Sr=new Set([this]):Sr.add(this));var L=g.stack;this.componentDidCatch(g.value,{componentStack:L!==null?L:""})})}function _a(l,r,h,g,E){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(r=h.alternate,r!==null&&di(r,h,E,!0),h=Si.current,h!==null){switch(h.tag){case 31:case 13:return Pi===null?Eu():h.alternate===null&&yn===0&&(yn=3),h.flags&=-257,h.flags|=65536,h.lanes=E,g===Xd?h.flags|=16384:(r=h.updateQueue,r===null?h.updateQueue=new Set([g]):r.add(g),dd(l,g,E)),!1;case 22:return h.flags|=65536,g===Xd?h.flags|=16384:(r=h.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=r):(h=r.retryQueue,h===null?r.retryQueue=new Set([g]):h.add(g)),dd(l,g,E)),!1}throw Error(u(435,h.tag))}return dd(l,g,E),Eu(),!1}if(se)return r=Si.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=E,g!==Bm&&(l=Error(u(422),{cause:g}),An(at(l,h)))):(g!==Bm&&(r=Error(u(423),{cause:g}),An(at(r,h))),l=l.current.alternate,l.flags|=65536,E&=-E,l.lanes|=E,g=at(g,h),E=du(l.stateNode,g,E),z0(l,E),yn!==4&&(yn=2)),!1;var T=Error(u(520),{cause:g});if(T=at(T,h),Of===null?Of=[T]:Of.push(T),yn!==4&&(yn=2),r===null)return!0;g=at(g,h),h=r;do{switch(h.tag){case 3:return h.flags|=65536,l=E&-E,h.lanes|=l,l=du(h.stateNode,g,l),z0(h,l),!1;case 1:if(r=h.type,T=h.stateNode,(h.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Sr===null||!Sr.has(T))))return h.flags|=65536,E&=-E,h.lanes|=E,E=Yc(E),Ph(E,l,h,g),z0(h,E),!1}h=h.return}while(h!==null);return!1}function na(l,r,h,g){r.child=l===null?zy(r,null,h,g):yo(r,l.child,h,g)}function qc(l,r,h,g,E){h=h.render;var T=r.ref;if("ref"in g){var z={};for(var L in g)L!=="ref"&&(z[L]=g[L])}else z=g;return Mn(r),g=Nc(l,r,h,z,T,E),L=Ms(),l!==null&&!qn?(ki(l,r,E),ei(l,r,E)):(se&&L&>(r),r.flags|=1,na(l,r,g,E),r.child)}function Yh(l,r,h,g,E){if(l===null){var T=h.type;return typeof T=="function"&&!lf(T)&&T.defaultProps===void 0&&h.compare===null?(r.tag=15,r.type=T,qh(l,r,T,g,E)):(l=rf(h.type,null,g,r,r.mode,E),l.ref=r.ref,l.return=r,r.child=l)}if(T=l.child,!gu(l,E)){var z=T.memoizedProps;if(h=h.compare,h=h!==null?h:_c,h(z,g)&&l.ref===r.ref)return ei(l,r,E)}return r.flags|=1,l=Vs(T,g),l.ref=r.ref,l.return=r,r.child=l}function qh(l,r,h,g,E){if(l!==null){var T=l.memoizedProps;if(_c(T,g)&&l.ref===r.ref)if(qn=!1,r.pendingProps=g=T,gu(l,E))(l.flags&131072)!==0&&(qn=!0);else return r.lanes=l.lanes,ei(l,r,E)}return Q0(l,r,h,g,E)}function El(l,r,h,g){var E=g.children,T=l!==null?l.memoizedState:null;if(l===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((r.flags&128)!==0){if(T=T!==null?T.baseLanes|h:h,l!==null){for(g=r.child=l.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~T}else g=0,r.child=null;return pu(l,r,T,h,g)}if((h&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},l!==null&&Wl(r,T!==null?T.cachePool:null),T!==null?Bt(r,T):Mc(),As(r);else return g=r.lanes=536870912,pu(l,r,T!==null?T.baseLanes|h:h,h,g)}else T!==null?(Wl(r,T.cachePool),Bt(r,T),gl(),r.memoizedState=null):(l!==null&&Wl(r,null),Mc(),gl());return na(l,r,E,h),r.child}function Ni(l,r){return l!==null&&l.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function pu(l,r,h,g,E){var T=qr();return T=T===null?null:{parent:Hi?un._currentValue:un._currentValue2,pool:T},r.memoizedState={baseLanes:h,cachePool:T},l!==null&&Wl(r,null),Mc(),As(r),l!==null&&di(l,r,g,!0),r.childLanes=E,null}function $r(l,r){return r=is({mode:r.mode,children:r.children},l.mode),r.ref=l.ref,l.child=r,r.return=l,r}function mu(l,r,h){return yo(r,l.child,null,h),l=$r(r,r.pendingProps),l.flags|=2,$a(r),r.memoizedState=null,l}function Xc(l,r,h){var g=r.pendingProps,E=(r.flags&128)!==0;if(r.flags&=-129,l===null){if(se){if(g.mode==="hidden")return l=$r(r,g),r.lanes=536870912,Ni(null,l);if(lu(r),(l=We)?(l=py(l,Vi),l!==null&&(r.memoizedState={dehydrated:l,treeContext:Hl!==null?{id:Xa,overflow:qs}:null,retryLane:536870912,hydrationErrors:null},h=gd(l),h.return=r,r.child=h,Fn=r,We=null)):l=null,l===null)throw ln(r);return r.lanes=536870912,null}return $r(r,g)}var T=l.memoizedState;if(T!==null){var z=T.dehydrated;if(lu(r),E)if(r.flags&256)r.flags&=-257,r=mu(l,r,h);else if(r.memoizedState!==null)r.child=l.child,r.flags|=128,r=null;else throw Error(u(558));else if(qn||di(l,r,h,!1),E=(h&l.childLanes)!==0,qn||E){if(g=Le,g!==null&&(z=nt(g,h),z!==0&&z!==T.retryLane))throw T.retryLane=z,$l(l,z),Pa(g,l,z),Fd;Eu(),r=mu(l,r,h)}else l=T.treeContext,ya&&(We=Mm(z),Fn=r,se=!0,wl=null,Vi=!1,l!==null&&Pt(r,l)),r=$r(r,g),r.flags|=4096;return r}return l=Vs(l.child,{mode:g.mode,children:g.children}),l.ref=r.ref,r.child=l,l.return=r,l}function Kc(l,r){var h=r.ref;if(h===null)l!==null&&l.ref!==null&&(r.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(u(284));(l===null||l.ref!==h)&&(r.flags|=4194816)}}function Q0(l,r,h,g,E){return Mn(r),h=Nc(l,r,h,g,void 0,E),g=Ms(),l!==null&&!qn?(ki(l,r,E),ei(l,r,E)):(se&&g&>(r),r.flags|=1,na(l,r,h,E),r.child)}function Z0(l,r,h,g,E,T){return Mn(r),r.updateQueue=null,h=Oh(r,g,h,E),ru(l),g=Ms(),l!==null&&!qn?(ki(l,r,T),ei(l,r,T)):(se&&g&>(r),r.flags|=1,na(l,r,h,T),r.child)}function J0(l,r,h,g,E){if(Mn(r),r.stateNode===null){var T=ho,z=h.contextType;typeof z=="object"&&z!==null&&(T=rn(z)),T=new h(g,T),r.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=Jd,r.stateNode=T,T._reactInternals=r,T=r.stateNode,T.props=g,T.state=r.memoizedState,T.refs={},Dc(r),z=h.contextType,T.context=typeof z=="object"&&z!==null?rn(z):ho,T.state=r.memoizedState,z=h.getDerivedStateFromProps,typeof z=="function"&&(Lh(r,h,z,g),T.state=r.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(z=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),z!==T.state&&Jd.enqueueReplaceState(T,T.state,null),Fr(r,g,T,E),su(),T.state=r.memoizedState),typeof T.componentDidMount=="function"&&(r.flags|=4194308),g=!0}else if(l===null){T=r.stateNode;var L=r.memoizedProps,ft=zs(h,L);T.props=ft;var vt=T.context,Mt=h.contextType;z=ho,typeof Mt=="object"&&Mt!==null&&(z=rn(Mt));var xt=h.getDerivedStateFromProps;Mt=typeof xt=="function"||typeof T.getSnapshotBeforeUpdate=="function",L=r.pendingProps!==L,Mt||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(L||vt!==z)&&X0(r,T,g,z),mr=!1;var Rt=r.memoizedState;T.state=Rt,Fr(r,g,T,E),su(),vt=r.memoizedState,L||Rt!==vt||mr?(typeof xt=="function"&&(Lh(r,h,xt,g),vt=r.memoizedState),(ft=mr||Lc(r,h,ft,g,Rt,vt,z))?(Mt||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(r.flags|=4194308)):(typeof T.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=g,r.memoizedState=vt),T.props=g,T.state=vt,T.context=z,g=ft):(typeof T.componentDidMount=="function"&&(r.flags|=4194308),g=!1)}else{T=r.stateNode,Jr(l,r),z=r.memoizedProps,Mt=zs(h,z),T.props=Mt,xt=r.pendingProps,Rt=T.context,vt=h.contextType,ft=ho,typeof vt=="object"&&vt!==null&&(ft=rn(vt)),L=h.getDerivedStateFromProps,(vt=typeof L=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(z!==xt||Rt!==ft)&&X0(r,T,g,ft),mr=!1,Rt=r.memoizedState,T.state=Rt,Fr(r,g,T,E),su();var Yt=r.memoizedState;z!==xt||Rt!==Yt||mr||l!==null&&l.dependencies!==null&&Fi(l.dependencies)?(typeof L=="function"&&(Lh(r,h,L,g),Yt=r.memoizedState),(Mt=mr||Lc(r,h,Mt,g,Rt,Yt,ft)||l!==null&&l.dependencies!==null&&Fi(l.dependencies))?(vt||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(g,Yt,ft),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(g,Yt,ft)),typeof T.componentDidUpdate=="function"&&(r.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof T.componentDidUpdate!="function"||z===l.memoizedProps&&Rt===l.memoizedState||(r.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||z===l.memoizedProps&&Rt===l.memoizedState||(r.flags|=1024),r.memoizedProps=g,r.memoizedState=Yt),T.props=g,T.state=Yt,T.context=ft,g=Mt):(typeof T.componentDidUpdate!="function"||z===l.memoizedProps&&Rt===l.memoizedState||(r.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||z===l.memoizedProps&&Rt===l.memoizedState||(r.flags|=1024),g=!1)}return T=g,Kc(l,r),g=(r.flags&128)!==0,T||g?(T=r.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:T.render(),r.flags|=1,l!==null&&g?(r.child=yo(r,l.child,null,E),r.child=yo(r,null,h,E)):na(l,r,h,E),r.memoizedState=T.state,l=r.child):l=ei(l,r,E),l}function Xh(l,r,h,g){return ta(),r.flags|=256,na(l,r,h,g),r.child}function Qc(l){return{baseLanes:l,cachePool:Nh()}}function Hs(l,r,h){return l=l!==null?l.childLanes&~h:0,r&&(l|=Ei),l}function Kh(l,r,h){var g=r.pendingProps,E=!1,T=(r.flags&128)!==0,z;if((z=T)||(z=l!==null&&l.memoizedState===null?!1:(Hn.current&2)!==0),z&&(E=!0,r.flags&=-129),z=(r.flags&32)!==0,r.flags&=-33,l===null){if(se){if(E?ml(r):gl(),(l=We)?(l=u3(l,Vi),l!==null&&(r.memoizedState={dehydrated:l,treeContext:Hl!==null?{id:Xa,overflow:qs}:null,retryLane:536870912,hydrationErrors:null},h=gd(l),h.return=r,r.child=h,Fn=r,We=null)):l=null,l===null)throw ln(r);return Sf(l)?r.lanes=32:r.lanes=536870912,null}var L=g.children;return g=g.fallback,E?(gl(),E=r.mode,L=is({mode:"hidden",children:L},E),g=Dl(g,E,h,null),L.return=r,g.return=r,L.sibling=g,r.child=L,g=r.child,g.memoizedState=Qc(h),g.childLanes=Hs(l,z,h),r.memoizedState=kd,Ni(null,g)):(ml(r),Qh(r,L))}var ft=l.memoizedState;if(ft!==null&&(L=ft.dehydrated,L!==null)){if(T)r.flags&256?(ml(r),r.flags&=-257,r=La(l,r,h)):r.memoizedState!==null?(gl(),r.child=l.child,r.flags|=128,r=null):(gl(),L=g.fallback,E=r.mode,g=is({mode:"visible",children:g.children},E),L=Dl(L,E,h,null),L.flags|=2,g.return=r,L.return=r,g.sibling=L,r.child=g,yo(r,l.child,null,h),g=r.child,g.memoizedState=Qc(h),g.childLanes=Hs(l,z,h),r.memoizedState=kd,r=Ni(null,g));else if(ml(r),Sf(L))z=uo(L).digest,g=Error(u(419)),g.stack="",g.digest=z,An({value:g,source:null,stack:null}),r=La(l,r,h);else if(qn||di(l,r,h,!1),z=(h&l.childLanes)!==0,qn||z){if(z=Le,z!==null&&(g=nt(z,h),g!==0&&g!==ft.retryLane))throw ft.retryLane=g,$l(l,g),Pa(z,l,g),Fd;vf(L)||Eu(),r=La(l,r,h)}else vf(L)?(r.flags|=192,r.child=l.child,r=null):(l=ft.treeContext,ya&&(We=hy(L),Fn=r,se=!0,wl=null,Vi=!1,l!==null&&Pt(r,l)),r=Qh(r,g.children),r.flags|=4096);return r}return E?(gl(),L=g.fallback,E=r.mode,ft=l.child,T=ft.sibling,g=Vs(ft,{mode:"hidden",children:g.children}),g.subtreeFlags=ft.subtreeFlags&65011712,T!==null?L=Vs(T,L):(L=Dl(L,E,h,null),L.flags|=2),L.return=r,g.return=r,g.sibling=L,r.child=g,Ni(null,g),g=r.child,L=l.child.memoizedState,L===null?L=Qc(h):(E=L.cachePool,E!==null?(ft=Hi?un._currentValue:un._currentValue2,E=E.parent!==ft?{parent:ft,pool:ft}:E):E=Nh(),L={baseLanes:L.baseLanes|h,cachePool:E}),g.memoizedState=L,g.childLanes=Hs(l,z,h),r.memoizedState=kd,Ni(l.child,g)):(ml(r),h=l.child,l=h.sibling,h=Vs(h,{mode:"visible",children:g.children}),h.return=r,h.sibling=null,l!==null&&(z=r.deletions,z===null?(r.deletions=[l],r.flags|=16):z.push(l)),r.child=h,r.memoizedState=null,h)}function Qh(l,r){return r=is({mode:"visible",children:r},l.mode),r.return=l,l.child=r}function is(l,r){return l=i(22,l,null,r),l.lanes=0,l}function La(l,r,h){return yo(r,l.child,null,h),l=Qh(r,r.pendingProps.children),l.flags|=2,r.memoizedState=null,l}function Zc(l,r,h){l.lanes|=r;var g=l.alternate;g!==null&&(g.lanes|=r),ha(l.return,r,h)}function Ft(l,r,h,g,E,T){var z=l.memoizedState;z===null?l.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:E,treeForkCount:T}:(z.isBackwards=r,z.rendering=null,z.renderingStartTime=0,z.last=g,z.tail=h,z.tailMode=E,z.treeForkCount=T)}function Et(l,r,h){var g=r.pendingProps,E=g.revealOrder,T=g.tail;g=g.children;var z=Hn.current,L=(z&2)!==0;if(L?(z=z&1|2,r.flags|=128):z&=1,A(Hn,z),na(l,r,g,h),g=se?lt:0,!L&&l!==null&&(l.flags&128)!==0)t:for(l=r.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Zc(l,h,r);else if(l.tag===19)Zc(l,h,r);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break t;for(;l.sibling===null;){if(l.return===null||l.return===r)break t;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(E){case"forwards":for(h=r.child,E=null;h!==null;)l=h.alternate,l!==null&&yl(l)===null&&(E=h),h=h.sibling;h=E,h===null?(E=r.child,r.child=null):(E=h.sibling,h.sibling=null),Ft(r,!1,E,h,T,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,E=r.child,r.child=null;E!==null;){if(l=E.alternate,l!==null&&yl(l)===null){r.child=E;break}l=E.sibling,E.sibling=h,h=E,E=l}Ft(r,!0,h,null,T,g);break;case"together":Ft(r,!1,null,null,void 0,g);break;default:r.memoizedState=null}return r.child}function ei(l,r,h){if(l!==null&&(r.dependencies=l.dependencies),vr|=r.lanes,(h&r.childLanes)===0)if(l!==null){if(di(l,r,h,!1),(h&r.childLanes)===0)return null}else return null;if(l!==null&&r.child!==l.child)throw Error(u(153));if(r.child!==null){for(l=r.child,h=Vs(l,l.pendingProps),r.child=h,h.return=r;l.sibling!==null;)l=l.sibling,h=h.sibling=Vs(l,l.pendingProps),h.return=r;h.sibling=null}return r.child}function gu(l,r){return(l.lanes&r)!==0?!0:(l=l.dependencies,!!(l!==null&&Fi(l)))}function gn(l,r,h){switch(r.tag){case 3:le(r,r.stateNode.containerInfo),Ba(r,un,l.memoizedState.cache),ta();break;case 27:case 5:xe(r);break;case 4:le(r,r.stateNode.containerInfo);break;case 10:Ba(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,lu(r),null;break;case 13:var g=r.memoizedState;if(g!==null)return g.dehydrated!==null?(ml(r),r.flags|=128,null):(h&r.child.childLanes)!==0?Kh(l,r,h):(ml(r),l=ei(l,r,h),l!==null?l.sibling:null);ml(r);break;case 19:var E=(l.flags&128)!==0;if(g=(h&r.childLanes)!==0,g||(di(l,r,h,!1),g=(h&r.childLanes)!==0),E){if(g)return Et(l,r,h);r.flags|=128}if(E=r.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),A(Hn,Hn.current),g)break;return null;case 22:return r.lanes=0,El(l,r,h,r.pendingProps);case 24:Ba(r,un,l.memoizedState.cache)}return ei(l,r,h)}function Zh(l,r,h){if(l!==null)if(l.memoizedProps!==r.pendingProps)qn=!0;else{if(!gu(l,h)&&(r.flags&128)===0)return qn=!1,gn(l,r,h);qn=(l.flags&131072)!==0}else qn=!1,se&&(r.flags&1048576)!==0&&W(r,lt,r.index);switch(r.lanes=0,r.tag){case 16:t:{var g=r.pendingProps;if(l=Wa(r.elementType),r.type=l,typeof l=="function")lf(l)?(g=zs(l,g),r.tag=1,r=J0(null,r,l,g,h)):(r.tag=0,r=Q0(null,r,l,g,h));else{if(l!=null){var E=l.$$typeof;if(E===Cu){r.tag=11,r=qc(null,r,l,g,h);break t}else if(E===gm){r.tag=14,r=Yh(null,r,l,g,h);break t}}throw r=_(l)||l,Error(u(306,r,""))}}return r;case 0:return Q0(l,r,r.type,r.pendingProps,h);case 1:return g=r.type,E=zs(g,r.pendingProps),J0(l,r,g,E,h);case 3:t:{if(le(r,r.stateNode.containerInfo),l===null)throw Error(u(387));var T=r.pendingProps;E=r.memoizedState,g=E.element,Jr(l,r),Fr(r,T,null,h);var z=r.memoizedState;if(T=z.cache,Ba(r,un,T),T!==E.cache&&Ji(r,[un],h,!0),su(),T=z.element,ya&&E.isDehydrated)if(E={element:T,isDehydrated:!1,cache:z.cache},r.updateQueue.baseState=E,r.memoizedState=E,r.flags&256){r=Xh(l,r,T,h);break t}else if(T!==g){g=at(Error(u(424)),r),An(g),r=Xh(l,r,T,h);break t}else for(ya&&(We=Nd(r.stateNode.containerInfo),Fn=r,se=!0,wl=null,Vi=!0),h=zy(r,null,T,h),r.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(ta(),T===g){r=ei(l,r,h);break t}na(l,r,T,h)}r=r.child}return r;case 26:if(wi)return Kc(l,r),l===null?(h=Mu(r.type,null,r.pendingProps,null))?r.memoizedState=h:se||(r.stateNode=Dy(r.type,r.pendingProps,dr.current,r)):r.memoizedState=Mu(r.type,l.memoizedProps,r.pendingProps,l.memoizedState),null;case 27:if(Ln)return xe(r),l===null&&Ln&&se&&(g=r.stateNode=wd(r.type,r.pendingProps,dr.current,ba.current,!1),Fn=r,Vi=!0,We=r3(r.type,g,We)),na(l,r,r.pendingProps.children,h),Kc(l,r),l===null&&(r.flags|=4194304),r.child;case 5:return l===null&&se&&(h3(r.type,r.pendingProps,ba.current),(E=g=We)&&(g=o3(g,r.type,r.pendingProps,Vi),g!==null?(r.stateNode=g,Fn=r,We=Md(g),Vi=!1,E=!0):E=!1),E||ln(r)),xe(r),E=r.type,T=r.pendingProps,z=l!==null?l.memoizedProps:null,g=T.children,pf(E,T)?g=null:z!==null&&pf(E,z)&&(r.flags|=32),r.memoizedState!==null&&(E=Nc(l,r,Rh,null,null,h),Hi?fr._currentValue=E:fr._currentValue2=E),Kc(l,r),na(l,r,g,h),r.child;case 6:return l===null&&se&&(Rm(r.pendingProps,ba.current),(l=h=We)&&(h=dy(h,r.pendingProps,Vi),h!==null?(r.stateNode=h,Fn=r,We=null,l=!0):l=!1),l||ln(r)),null;case 13:return Kh(l,r,h);case 4:return le(r,r.stateNode.containerInfo),g=r.pendingProps,l===null?r.child=yo(r,null,g,h):na(l,r,g,h),r.child;case 11:return qc(l,r,r.type,r.pendingProps,h);case 7:return na(l,r,r.pendingProps,h),r.child;case 8:return na(l,r,r.pendingProps.children,h),r.child;case 12:return na(l,r,r.pendingProps.children,h),r.child;case 10:return g=r.pendingProps,Ba(r,r.type,g.value),na(l,r,g.children,h),r.child;case 9:return E=r.type._context,g=r.pendingProps.children,Mn(r),E=rn(E),g=g(E),r.flags|=1,na(l,r,g,h),r.child;case 14:return Yh(l,r,r.type,r.pendingProps,h);case 15:return qh(l,r,r.type,r.pendingProps,h);case 19:return Et(l,r,h);case 31:return Xc(l,r,h);case 22:return El(l,r,h,r.pendingProps);case 24:return Mn(r),g=rn(un),l===null?(E=qr(),E===null&&(E=Le,T=Ae(),E.pooledCache=T,T.refCount++,T!==null&&(E.pooledCacheLanes|=h),E=T),r.memoizedState={parent:g,cache:E},Dc(r),Ba(r,un,E)):((l.lanes&h)!==0&&(Jr(l,r),Fr(r,null,null,h),su()),E=l.memoizedState,T=r.memoizedState,E.parent!==g?(E={parent:g,cache:g},r.memoizedState=E,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=E),Ba(r,un,g)):(g=T.cache,Ba(r,un,g),g!==E.cache&&Ji(r,[un],h,!0))),na(l,r,r.pendingProps.children,h),r.child;case 29:throw r.pendingProps}throw Error(u(156,r.tag))}function gi(l){l.flags|=4}function Jc(l){us&&(l.flags|=8)}function Jh(l,r){if(l!==null&&l.child===r.child)return!1;if((r.flags&16)!==0)return!0;for(l=r.child;l!==null;){if((l.flags&8218)!==0||(l.subtreeFlags&8218)!==0)return!0;l=l.sibling}return!1}function F0(l,r,h,g){if(Aa)for(h=r.child;h!==null;){if(h.tag===5||h.tag===6)Cd(l,h.stateNode);else if(!(h.tag===4||Ln&&h.tag===27)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===r)break;for(;h.sibling===null;){if(h.return===null||h.return===r)return;h=h.return}h.sibling.return=h.return,h=h.sibling}else if(us)for(var E=r.child;E!==null;){if(E.tag===5){var T=E.stateNode;h&&g&&(T=Nl(T,E.type,E.memoizedProps)),Cd(l,T)}else if(E.tag===6)T=E.stateNode,h&&g&&(T=yf(T,E.memoizedProps)),Cd(l,T);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)T=E.child,T!==null&&(T.return=E),F0(l,E,!0,!0);else if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===r)break;for(;E.sibling===null;){if(E.return===null||E.return===r)return;E=E.return}E.sibling.return=E.return,E=E.sibling}}function Fh(l,r,h,g){var E=!1;if(us)for(var T=r.child;T!==null;){if(T.tag===5){var z=T.stateNode;h&&g&&(z=Nl(z,T.type,T.memoizedProps)),Dm(l,z)}else if(T.tag===6)z=T.stateNode,h&&g&&(z=yf(z,T.memoizedProps)),Dm(l,z);else if(T.tag!==4){if(T.tag===22&&T.memoizedState!==null)E=T.child,E!==null&&(E.return=T),Fh(l,T,!0,!0),E=!0;else if(T.child!==null){T.child.return=T,T=T.child;continue}}if(T===r)break;for(;T.sibling===null;){if(T.return===null||T.return===r)return E;T=T.return}T.sibling.return=T.return,T=T.sibling}return E}function kh(l,r){if(us&&Jh(l,r)){l=r.stateNode;var h=l.containerInfo,g=Ie();Fh(g,r,!1,!1),l.pendingChildren=g,gi(r),ry(h,g)}}function Fc(l,r,h,g){if(Aa)l.memoizedProps!==g&&gi(r);else if(us){var E=l.stateNode,T=l.memoizedProps;if((l=Jh(l,r))||T!==g){var z=ba.current;T=ly(E,h,T,g,!l,null),T===E?r.stateNode=E:(Jc(r),qg(T,h,g,z)&&gi(r),r.stateNode=T,l&&F0(T,r,!1,!1))}else r.stateNode=E}}function ga(l,r,h,g,E){if((l.mode&32)!==0&&(h===null?Zg(r,g):s3(r,h,g))){if(l.flags|=16777216,(E&335544128)===E||_u(r,g))if(va(l.stateNode,r,g))l.flags|=8192;else if(Bg())l.flags|=8192;else throw Gi=Xd,Yd}else l.flags&=-16777217}function De(l,r){if(d3(r)){if(l.flags|=16777216,!Hd(r))if(Bg())l.flags|=8192;else throw Gi=Xd,Yd}else l.flags&=-16777217}function to(l,r){r!==null&&(l.flags|=4),l.flags&16384&&(r=l.tag!==22?V():536870912,l.lanes|=r,Pu|=r)}function Tl(l,r){if(!se)switch(l.tailMode){case"hidden":r=l.tail;for(var h=null;r!==null;)r.alternate!==null&&(h=r),r=r.sibling;h===null?l.tail=null:h.sibling=null;break;case"collapsed":h=l.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?r||l.tail===null?l.tail=null:l.tail.sibling=null:g.sibling=null}}function Ce(l){var r=l.alternate!==null&&l.alternate.child===l.child,h=0,g=0;if(r)for(var E=l.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=l,E=E.sibling;else for(E=l.child;E!==null;)h|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=l,E=E.sibling;return l.subtreeFlags|=g,l.childLanes=h,r}function eo(l,r,h){var g=r.pendingProps;switch(Tt(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ce(r),null;case 1:return Ce(r),null;case 3:return h=r.stateNode,g=null,l!==null&&(g=l.memoizedState.cache),r.memoizedState.cache!==g&&(r.flags|=2048),pn(un),xn(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(l===null||l.child===null)&&(ue(r)?gi(r):l===null||l.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,ea())),kh(l,r),Ce(r),null;case 26:if(wi){var E=r.type,T=r.memoizedState;return l===null?(gi(r),T!==null?(Ce(r),De(r,T)):(Ce(r),ga(r,E,null,g,h))):T?T!==l.memoizedState?(gi(r),Ce(r),De(r,T)):(Ce(r),r.flags&=-16777217):(T=l.memoizedProps,Aa?T!==g&&gi(r):Fc(l,r,E,g),Ce(r),ga(r,E,T,g,h)),null}case 27:if(Ln){if(Dn(r),h=dr.current,E=r.type,l!==null&&r.stateNode!=null)Aa?l.memoizedProps!==g&&gi(r):Fc(l,r,E,g);else{if(!g){if(r.stateNode===null)throw Error(u(166));return Ce(r),null}l=ba.current,ue(r)?Be(r,l):(l=wd(E,g,h,l,!0),r.stateNode=l,gi(r))}return Ce(r),null}case 5:if(Dn(r),E=r.type,l!==null&&r.stateNode!=null)Fc(l,r,E,g);else{if(!g){if(r.stateNode===null)throw Error(u(166));return Ce(r),null}if(T=ba.current,ue(r))Be(r,T),by(r.stateNode,E,g,T)&&(r.flags|=64);else{var z=js(E,g,dr.current,T,r);Jc(r),F0(z,r,!1,!1),r.stateNode=z,qg(z,E,g,T)&&gi(r)}}return Ce(r),ga(r,r.type,l===null?null:l.memoizedProps,r.pendingProps,h),null;case 6:if(l&&r.stateNode!=null)h=l.memoizedProps,Aa?h!==g&&gi(r):us&&(h!==g?(l=dr.current,h=ba.current,Jc(r),r.stateNode=_d(g,l,h,r)):r.stateNode=l.stateNode);else{if(typeof g!="string"&&r.stateNode===null)throw Error(u(166));if(l=dr.current,h=ba.current,ue(r)){if(!ya)throw Error(u(176));if(l=r.stateNode,h=r.memoizedProps,g=null,E=Fn,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}Od(l,h,r,g)||ln(r,!0)}else Jc(r),r.stateNode=_d(g,l,h,r)}return Ce(r),null;case 31:if(h=r.memoizedState,l===null||l.memoizedState!==null){if(g=ue(r),h!==null){if(l===null){if(!g)throw Error(u(318));if(!ya)throw Error(u(556));if(l=r.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(u(557));my(l,r)}else ta(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Ce(r),l=!1}else h=ea(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=h),l=!0;if(!l)return r.flags&256?($a(r),r):($a(r),null);if((r.flags&128)!==0)throw Error(u(558))}return Ce(r),null;case 13:if(g=r.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(E=ue(r),g!==null&&g.dehydrated!==null){if(l===null){if(!E)throw Error(u(318));if(!ya)throw Error(u(344));if(E=r.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(u(317));Nm(E,r)}else ta(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Ce(r),E=!1}else E=ea(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=E),E=!0;if(!E)return r.flags&256?($a(r),r):($a(r),null)}return $a(r),(r.flags&128)!==0?(r.lanes=h,r):(h=g!==null,l=l!==null&&l.memoizedState!==null,h&&(g=r.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),T=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(T=g.memoizedState.cachePool.pool),T!==E&&(g.flags|=2048)),h!==l&&h&&(r.child.flags|=8192),to(r,r.updateQueue),Ce(r),null);case 4:return xn(),kh(l,r),l===null&&i3(r.stateNode.containerInfo),Ce(r),null;case 10:return pn(r.type),Ce(r),null;case 19:if(D(Hn),g=r.memoizedState,g===null)return Ce(r),null;if(E=(r.flags&128)!==0,T=g.rendering,T===null)if(E)Tl(g,!1);else{if(yn!==0||l!==null&&(l.flags&128)!==0)for(l=r.child;l!==null;){if(T=yl(l),T!==null){for(r.flags|=128,Tl(g,!1),l=T.updateQueue,r.updateQueue=l,to(r,l),r.subtreeFlags=0,l=h,h=r.child;h!==null;)fm(h,l),h=h.sibling;return A(Hn,Hn.current&1|2),se&&St(r,g.treeForkCount),r.child}l=l.sibling}g.tail!==null&&Me()>Yu&&(r.flags|=128,E=!0,Tl(g,!1),r.lanes=4194304)}else{if(!E)if(l=yl(T),l!==null){if(r.flags|=128,E=!0,l=l.updateQueue,r.updateQueue=l,to(r,l),Tl(g,!0),g.tail===null&&g.tailMode==="hidden"&&!T.alternate&&!se)return Ce(r),null}else 2*Me()-g.renderingStartTime>Yu&&h!==536870912&&(r.flags|=128,E=!0,Tl(g,!1),r.lanes=4194304);g.isBackwards?(T.sibling=r.child,r.child=T):(l=g.last,l!==null?l.sibling=T:r.child=T,g.last=T)}return g.tail!==null?(l=g.tail,g.rendering=l,g.tail=l.sibling,g.renderingStartTime=Me(),l.sibling=null,h=Hn.current,A(Hn,E?h&1|2:h&1),se&&St(r,g.treeForkCount),l):(Ce(r),null);case 22:case 23:return $a(r),pl(),g=r.memoizedState!==null,l!==null?l.memoizedState!==null!==g&&(r.flags|=8192):g&&(r.flags|=8192),g?(h&536870912)!==0&&(r.flags&128)===0&&(Ce(r),r.subtreeFlags&6&&(r.flags|=8192)):Ce(r),h=r.updateQueue,h!==null&&to(r,h.retryQueue),h=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),g=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(g=r.memoizedState.cachePool.pool),g!==h&&(r.flags|=2048),l!==null&&D(pr),null;case 24:return h=null,l!==null&&(h=l.memoizedState.cache),r.memoizedState.cache!==h&&(r.flags|=2048),pn(un),Ce(r),null;case 25:return null;case 30:return null}throw Error(u(156,r.tag))}function ss(l,r){switch(Tt(r),r.tag){case 1:return l=r.flags,l&65536?(r.flags=l&-65537|128,r):null;case 3:return pn(un),xn(),l=r.flags,(l&65536)!==0&&(l&128)===0?(r.flags=l&-65537|128,r):null;case 26:case 27:case 5:return Dn(r),null;case 31:if(r.memoizedState!==null){if($a(r),r.alternate===null)throw Error(u(340));ta()}return l=r.flags,l&65536?(r.flags=l&-65537|128,r):null;case 13:if($a(r),l=r.memoizedState,l!==null&&l.dehydrated!==null){if(r.alternate===null)throw Error(u(340));ta()}return l=r.flags,l&65536?(r.flags=l&-65537|128,r):null;case 19:return D(Hn),null;case 4:return xn(),null;case 10:return pn(r.type),null;case 22:case 23:return $a(r),pl(),l!==null&&D(pr),l=r.flags,l&65536?(r.flags=l&-65537|128,r):null;case 24:return pn(un),null;case 25:return null;default:return null}}function Ih(l,r){switch(Tt(r),r.tag){case 3:pn(un),xn();break;case 26:case 27:case 5:Dn(r);break;case 4:xn();break;case 31:r.memoizedState!==null&&$a(r);break;case 13:$a(r);break;case 19:D(Hn);break;case 10:pn(r.type);break;case 22:case 23:$a(r),pl(),l!==null&&D(pr);break;case 24:pn(un)}}function ws(l,r){try{var h=r.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var E=g.next;h=E;do{if((h.tag&l)===l){g=void 0;var T=h.create,z=h.inst;g=T(),z.destroy=g}h=h.next}while(h!==E)}}catch(L){be(r,r.return,L)}}function Us(l,r,h){try{var g=r.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var T=E.next;g=T;do{if((g.tag&l)===l){var z=g.inst,L=z.destroy;if(L!==void 0){z.destroy=void 0,E=r;var ft=h,vt=L;try{vt()}catch(Mt){be(E,ft,Mt)}}}g=g.next}while(g!==T)}}catch(Mt){be(r,r.return,Mt)}}function yu(l){var r=l.updateQueue;if(r!==null){var h=l.stateNode;try{_g(r,h)}catch(g){be(l,l.return,g)}}}function Wh(l,r,h){h.props=zs(l.type,l.memoizedProps),h.state=l.memoizedState;try{h.componentWillUnmount()}catch(g){be(l,r,g)}}function nr(l,r){try{var h=l.ref;if(h!==null){switch(l.tag){case 26:case 27:case 5:var g=hf(l.stateNode);break;case 30:g=l.stateNode;break;default:g=l.stateNode}typeof h=="function"?l.refCleanup=h(g):h.current=g}}catch(E){be(l,r,E)}}function ls(l,r){var h=l.ref,g=l.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(E){be(l,r,E)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(E){be(l,r,E)}else h.current=null}function k0(l){var r=l.type,h=l.memoizedProps,g=l.stateNode;try{ey(g,r,h,l)}catch(E){be(l,l.return,E)}}function $h(l,r,h){try{xd(l.stateNode,l.type,h,r,l)}catch(g){be(l,l.return,g)}}function I0(l){return l.tag===5||l.tag===3||(wi?l.tag===26:!1)||(Ln?l.tag===27&&fo(l.type):!1)||l.tag===4}function td(l){t:for(;;){for(;l.sibling===null;){if(l.return===null||I0(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(Ln&&l.tag===27&&fo(l.type)||l.flags&2||l.child===null||l.tag===4)continue t;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function kc(l,r,h){var g=l.tag;if(g===5||g===6)l=l.stateNode,r?ay(h,l,r):ty(h,l);else if(g!==4&&(Ln&&g===27&&fo(l.type)&&(h=l.stateNode,r=null),l=l.child,l!==null))for(kc(l,r,h),l=l.sibling;l!==null;)kc(l,r,h),l=l.sibling}function vu(l,r,h){var g=l.tag;if(g===5||g===6)l=l.stateNode,r?ny(h,l,r):$g(h,l);else if(g!==4&&(Ln&&g===27&&fo(l.type)&&(h=l.stateNode),l=l.child,l!==null))for(vu(l,r,h),l=l.sibling;l!==null;)vu(l,r,h),l=l.sibling}function ed(l,r,h){l=l.containerInfo;try{oy(l,h)}catch(g){be(r,r.return,g)}}function W0(l){var r=l.stateNode,h=l.memoizedProps;try{Ud(l.type,h,r,l)}catch(g){be(l,l.return,g)}}function Ng(l,r){for(a3(l.containerInfo),aa=r;aa!==null;)if(l=aa,r=l.child,(l.subtreeFlags&1028)!==0&&r!==null)r.return=l,aa=r;else for(;aa!==null;){l=aa;var h=l.alternate;switch(r=l.flags,l.tag){case 0:if((r&4)!==0&&(r=l.updateQueue,r=r!==null?r.events:null,r!==null))for(var g=0;g<r.length;g++){var E=r[g];E.ref.impl=E.nextImpl}break;case 11:case 15:break;case 1:if((r&1024)!==0&&h!==null){r=void 0,g=l,E=h.memoizedProps,h=h.memoizedState;var T=g.stateNode;try{var z=zs(g.type,E);r=T.getSnapshotBeforeUpdate(z,h),T.__reactInternalSnapshotBeforeUpdate=r}catch(L){be(g,g.return,L)}}break;case 3:(r&1024)!==0&&Aa&&vi(l.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(u(163))}if(r=l.sibling,r!==null){r.return=l.return,aa=r;break}aa=l.return}}function $0(l,r,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Ri(l,h),g&4&&ws(5,h);break;case 1:if(Ri(l,h),g&4)if(l=h.stateNode,r===null)try{l.componentDidMount()}catch(z){be(h,h.return,z)}else{var E=zs(h.type,r.memoizedProps);r=r.memoizedState;try{l.componentDidUpdate(E,r,l.__reactInternalSnapshotBeforeUpdate)}catch(z){be(h,h.return,z)}}g&64&&yu(h),g&512&&nr(h,h.return);break;case 3:if(Ri(l,h),g&64&&(g=h.updateQueue,g!==null)){if(l=null,h.child!==null)switch(h.child.tag){case 27:case 5:l=hf(h.child.stateNode);break;case 1:l=h.child.stateNode}try{_g(g,l)}catch(z){be(h,h.return,z)}}break;case 27:Ln&&r===null&&g&4&&W0(h);case 26:case 5:if(Ri(l,h),r===null){if(g&4)k0(h);else if(g&64){l=h.type,r=h.memoizedProps,E=h.stateNode;try{vy(E,l,r,h)}catch(z){be(h,h.return,z)}}}g&512&&nr(h,h.return);break;case 12:Ri(l,h);break;case 31:Ri(l,h),g&4&&tm(l,h);break;case 13:Ri(l,h),g&4&&ad(l,h),g&64&&(g=h.memoizedState,g!==null&&(g=g.dehydrated,g!==null&&(h=pd.bind(null,h),xu(g,h))));break;case 22:if(g=h.memoizedState!==null||Zs,!g){r=r!==null&&r.memoizedState!==null||wn,E=Zs;var T=wn;Zs=g,(wn=r)&&!T?rs(l,h,(h.subtreeFlags&8772)!==0):Ri(l,h),Zs=E,wn=T}break;case 30:break;default:Ri(l,h)}}function Og(l){var r=l.alternate;r!==null&&(l.alternate=null,Og(r)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(r=l.stateNode,r!==null&&Qg(r)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Oi(l,r,h){for(h=h.child;h!==null;)nd(l,r,h),h=h.sibling}function nd(l,r,h){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(po,h)}catch{}switch(h.tag){case 26:if(wi){wn||ls(h,r),Oi(l,r,h),h.memoizedState?xy(h.memoizedState):h.stateNode&&Hm(h.stateNode);break}case 27:if(Ln){wn||ls(h,r);var g=Xn,E=oi;fo(h.type)&&(Xn=h.stateNode,oi=!1),Oi(l,r,h),hr(h.stateNode),Xn=g,oi=E;break}case 5:wn||ls(h,r);case 6:if(Aa){if(g=Xn,E=oi,Xn=null,Oi(l,r,h),Xn=g,oi=E,Xn!==null)if(oi)try{xm(Xn,h.stateNode)}catch(T){be(h,r,T)}else try{_m(Xn,h.stateNode)}catch(T){be(h,r,T)}}else Oi(l,r,h);break;case 18:Aa&&Xn!==null&&(oi?Om(Xn,h.stateNode):Ee(Xn,h.stateNode));break;case 4:Aa?(g=Xn,E=oi,Xn=h.stateNode.containerInfo,oi=!0,Oi(l,r,h),Xn=g,oi=E):(us&&ed(h.stateNode,h,Ie()),Oi(l,r,h));break;case 0:case 11:case 14:case 15:Us(2,h,r),wn||Us(4,h,r),Oi(l,r,h);break;case 1:wn||(ls(h,r),g=h.stateNode,typeof g.componentWillUnmount=="function"&&Wh(h,r,g)),Oi(l,r,h);break;case 21:Oi(l,r,h);break;case 22:wn=(g=wn)||h.memoizedState!==null,Oi(l,r,h),wn=g;break;default:Oi(l,r,h)}}function tm(l,r){if(ya&&r.memoizedState===null&&(l=r.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{Sy(l)}catch(h){be(r,r.return,h)}}}function ad(l,r){if(ya&&r.memoizedState===null&&(l=r.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{Au(l)}catch(h){be(r,r.return,h)}}function Rg(l){switch(l.tag){case 31:case 13:case 19:var r=l.stateNode;return r===null&&(r=l.stateNode=new Id),r;case 22:return l=l.stateNode,r=l._retryCache,r===null&&(r=l._retryCache=new Id),r;default:throw Error(u(435,l.tag))}}function Ic(l,r){var h=Rg(l);r.forEach(function(g){if(!h.has(g)){h.add(g);var E=Lg.bind(null,l,g);g.then(E,E)}})}function Nn(l,r){var h=r.deletions;if(h!==null)for(var g=0;g<h.length;g++){var E=h[g],T=l,z=r;if(Aa){var L=z;t:for(;L!==null;){switch(L.tag){case 27:if(Ln){if(fo(L.type)){Xn=L.stateNode,oi=!1;break t}break}case 5:Xn=L.stateNode,oi=!1;break t;case 3:case 4:Xn=L.stateNode.containerInfo,oi=!0;break t}L=L.return}if(Xn===null)throw Error(u(160));nd(T,z,E),Xn=null,oi=!1}else nd(T,z,E);T=E.alternate,T!==null&&(T.return=null),E.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Wc(r,l),r=r.sibling}function Wc(l,r){var h=l.alternate,g=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:Nn(r,l),xa(l),g&4&&(Us(3,l,l.return),ws(3,l),Us(5,l,l.return));break;case 1:Nn(r,l),xa(l),g&512&&(wn||h===null||ls(h,h.return)),g&64&&Zs&&(l=l.updateQueue,l!==null&&(g=l.callbacks,g!==null&&(h=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:if(wi){var E=ps;if(Nn(r,l),xa(l),g&512&&(wn||h===null||ls(h,h.return)),g&4){g=h!==null?h.memoizedState:null;var T=l.memoizedState;h===null?T===null?l.stateNode===null?l.stateNode=co(E,l.type,l.memoizedProps,l):zd(E,l.type,l.stateNode):l.stateNode=_y(E,T,l.memoizedProps):g!==T?(g===null?h.stateNode!==null&&Hm(h.stateNode):xy(g),T===null?zd(E,l.type,l.stateNode):_y(E,T,l.memoizedProps)):T===null&&l.stateNode!==null&&$h(l,l.memoizedProps,h.memoizedProps)}break}case 27:if(Ln){Nn(r,l),xa(l),g&512&&(wn||h===null||ls(h,h.return)),h!==null&&g&4&&$h(l,l.memoizedProps,h.memoizedProps);break}case 5:if(Nn(r,l),xa(l),g&512&&(wn||h===null||ls(h,h.return)),Aa){if(l.flags&32){E=l.stateNode;try{Dd(E)}catch(xt){be(l,l.return,xt)}}g&4&&l.stateNode!=null&&(E=l.memoizedProps,$h(l,E,h!==null?h.memoizedProps:E)),g&1024&&(Mf=!0)}else us&&l.alternate!==null&&(l.alternate.stateNode=l.stateNode);break;case 6:if(Nn(r,l),xa(l),g&4&&Aa){if(l.stateNode===null)throw Error(u(162));g=l.memoizedProps,h=h!==null?h.memoizedProps:g,E=l.stateNode;try{gf(E,h,g)}catch(xt){be(l,l.return,xt)}}break;case 3:if(wi?(Ay(),E=ps,ps=Rd(r.containerInfo),Nn(r,l),ps=E):Nn(r,l),xa(l),g&4){if(Aa&&ya&&h!==null&&h.memoizedState.isDehydrated)try{c3(r.containerInfo)}catch(xt){be(l,l.return,xt)}if(us){g=r.containerInfo,h=r.pendingChildren;try{oy(g,h)}catch(xt){be(l,l.return,xt)}}}Mf&&(Mf=!1,zg(l));break;case 4:wi?(h=ps,ps=Rd(l.stateNode.containerInfo),Nn(r,l),xa(l),ps=h):(Nn(r,l),xa(l)),g&4&&us&&ed(l.stateNode,l,l.stateNode.pendingChildren);break;case 12:Nn(r,l),xa(l);break;case 31:Nn(r,l),xa(l),g&4&&(g=l.updateQueue,g!==null&&(l.updateQueue=null,Ic(l,g)));break;case 13:Nn(r,l),xa(l),l.child.flags&8192&&l.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(Rf=Me()),g&4&&(g=l.updateQueue,g!==null&&(l.updateQueue=null,Ic(l,g)));break;case 22:E=l.memoizedState!==null;var z=h!==null&&h.memoizedState!==null,L=Zs,ft=wn;if(Zs=L||E,wn=ft||z,Nn(r,l),wn=ft,Zs=L,xa(l),g&8192&&(r=l.stateNode,r._visibility=E?r._visibility&-2:r._visibility|1,E&&(h===null||z||Zs||wn||zi(l)),Aa)){t:if(h=null,Aa)for(r=l;;){if(r.tag===5||wi&&r.tag===26){if(h===null){z=h=r;try{T=z.stateNode,E?iy(T):l3(z.stateNode,z.memoizedProps)}catch(xt){be(z,z.return,xt)}}}else if(r.tag===6){if(h===null){z=r;try{var vt=z.stateNode;E?Ad(vt):sy(vt,z.memoizedProps)}catch(xt){be(z,z.return,xt)}}}else if(r.tag===18){if(h===null){z=r;try{var Mt=z.stateNode;E?f3(Mt):Ty(z.stateNode)}catch(xt){be(z,z.return,xt)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===l)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===l)break t;for(;r.sibling===null;){if(r.return===null||r.return===l)break t;h===r&&(h=null),r=r.return}h===r&&(h=null),r.sibling.return=r.return,r=r.sibling}}g&4&&(g=l.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,Ic(l,h))));break;case 19:Nn(r,l),xa(l),g&4&&(g=l.updateQueue,g!==null&&(l.updateQueue=null,Ic(l,g)));break;case 30:break;case 21:break;default:Nn(r,l),xa(l)}}function xa(l){var r=l.flags;if(r&2){try{for(var h,g=l.return;g!==null;){if(I0(g)){h=g;break}g=g.return}if(Aa){if(h==null)throw Error(u(160));switch(h.tag){case 27:if(Ln){var E=h.stateNode,T=td(l);vu(l,T,E);break}case 5:var z=h.stateNode;h.flags&32&&(Dd(z),h.flags&=-33);var L=td(l);vu(l,L,z);break;case 3:case 4:var ft=h.stateNode.containerInfo,vt=td(l);kc(l,vt,ft);break;default:throw Error(u(161))}}}catch(Mt){be(l,l.return,Mt)}l.flags&=-3}r&4096&&(l.flags&=-4097)}function zg(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var r=l;zg(r),r.tag===5&&r.flags&1024&&lo(r.stateNode),l=l.sibling}}function Ri(l,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)$0(l,r.alternate,r),r=r.sibling}function zi(l){for(l=l.child;l!==null;){var r=l;switch(r.tag){case 0:case 11:case 14:case 15:Us(4,r,r.return),zi(r);break;case 1:ls(r,r.return);var h=r.stateNode;typeof h.componentWillUnmount=="function"&&Wh(r,r.return,h),zi(r);break;case 27:Ln&&hr(r.stateNode);case 26:case 5:ls(r,r.return),zi(r);break;case 22:r.memoizedState===null&&zi(r);break;case 30:zi(r);break;default:zi(r)}l=l.sibling}}function rs(l,r,h){for(h=h&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var g=r.alternate,E=l,T=r,z=T.flags;switch(T.tag){case 0:case 11:case 15:rs(E,T,h),ws(4,T);break;case 1:if(rs(E,T,h),g=T,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(vt){be(g,g.return,vt)}if(g=T,E=g.updateQueue,E!==null){var L=g.stateNode;try{var ft=E.shared.hiddenCallbacks;if(ft!==null)for(E.shared.hiddenCallbacks=null,E=0;E<ft.length;E++)H0(ft[E],L)}catch(vt){be(g,g.return,vt)}}h&&z&64&&yu(T),nr(T,T.return);break;case 27:Ln&&W0(T);case 26:case 5:rs(E,T,h),h&&g===null&&z&4&&k0(T),nr(T,T.return);break;case 12:rs(E,T,h);break;case 31:rs(E,T,h),h&&z&4&&tm(E,T);break;case 13:rs(E,T,h),h&&z&4&&ad(E,T);break;case 22:T.memoizedState===null&&rs(E,T,h),nr(T,T.return);break;case 30:break;default:rs(E,T,h)}r=r.sibling}}function Cl(l,r){var h=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==h&&(l!=null&&l.refCount++,h!=null&&jn(h))}function Da(l,r){l=null,r.alternate!==null&&(l=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==l&&(r.refCount++,l!=null&&jn(l))}function ni(l,r,h,g){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Hg(l,r,h,g),r=r.sibling}function Hg(l,r,h,g){var E=r.flags;switch(r.tag){case 0:case 11:case 15:ni(l,r,h,g),E&2048&&ws(9,r);break;case 1:ni(l,r,h,g);break;case 3:ni(l,r,h,g),E&2048&&(l=null,r.alternate!==null&&(l=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==l&&(r.refCount++,l!=null&&jn(l)));break;case 12:if(E&2048){ni(l,r,h,g),l=r.stateNode;try{var T=r.memoizedProps,z=T.id,L=T.onPostCommit;typeof L=="function"&&L(z,r.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(ft){be(r,r.return,ft)}}else ni(l,r,h,g);break;case 31:ni(l,r,h,g);break;case 13:ni(l,r,h,g);break;case 23:break;case 22:T=r.stateNode,z=r.alternate,r.memoizedState!==null?T._visibility&2?ni(l,r,h,g):ir(l,r):T._visibility&2?ni(l,r,h,g):(T._visibility|=2,ar(l,r,h,g,(r.subtreeFlags&10256)!==0||!1)),E&2048&&Cl(z,r);break;case 24:ni(l,r,h,g),E&2048&&Da(r.alternate,r);break;default:ni(l,r,h,g)}}function ar(l,r,h,g,E){for(E=E&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var T=l,z=r,L=h,ft=g,vt=z.flags;switch(z.tag){case 0:case 11:case 15:ar(T,z,L,ft,E),ws(8,z);break;case 23:break;case 22:var Mt=z.stateNode;z.memoizedState!==null?Mt._visibility&2?ar(T,z,L,ft,E):ir(T,z):(Mt._visibility|=2,ar(T,z,L,ft,E)),E&&vt&2048&&Cl(z.alternate,z);break;case 24:ar(T,z,L,ft,E),E&&vt&2048&&Da(z.alternate,z);break;default:ar(T,z,L,ft,E)}r=r.sibling}}function ir(l,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var h=l,g=r,E=g.flags;switch(g.tag){case 22:ir(h,g),E&2048&&Cl(g.alternate,g);break;case 24:ir(h,g),E&2048&&Da(g.alternate,g);break;default:ir(h,g)}r=r.sibling}}function _l(l,r,h){if(l.subtreeFlags&gr)for(l=l.child;l!==null;)em(l,r,h),l=l.sibling}function em(l,r,h){switch(l.tag){case 26:if(_l(l,r,h),l.flags&gr)if(l.memoizedState!==null)Ol(h,ps,l.memoizedState,l.memoizedProps);else{var g=l.stateNode,E=l.type;l=l.memoizedProps,((r&335544128)===r||_u(E,l))&&Ma(h,g,E,l)}break;case 5:_l(l,r,h),l.flags&gr&&(g=l.stateNode,E=l.type,l=l.memoizedProps,((r&335544128)===r||_u(E,l))&&Ma(h,g,E,l));break;case 3:case 4:wi?(g=ps,ps=Rd(l.stateNode.containerInfo),_l(l,r,h),ps=g):_l(l,r,h);break;case 22:l.memoizedState===null&&(g=l.alternate,g!==null&&g.memoizedState!==null?(g=gr,gr=16777216,_l(l,r,h),gr=g):_l(l,r,h));break;default:_l(l,r,h)}}function id(l){var r=l.alternate;if(r!==null&&(l=r.child,l!==null)){r.child=null;do r=l.sibling,l.sibling=null,l=r;while(l!==null)}}function sr(l){var r=l.deletions;if((l.flags&16)!==0){if(r!==null)for(var h=0;h<r.length;h++){var g=r[h];aa=g,ld(g,l)}id(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)sd(l),l=l.sibling}function sd(l){switch(l.tag){case 0:case 11:case 15:sr(l),l.flags&2048&&Us(9,l,l.return);break;case 3:sr(l);break;case 12:sr(l);break;case 22:var r=l.stateNode;l.memoizedState!==null&&r._visibility&2&&(l.return===null||l.return.tag!==13)?(r._visibility&=-3,no(l)):sr(l);break;default:sr(l)}}function no(l){var r=l.deletions;if((l.flags&16)!==0){if(r!==null)for(var h=0;h<r.length;h++){var g=r[h];aa=g,ld(g,l)}id(l)}for(l=l.child;l!==null;){switch(r=l,r.tag){case 0:case 11:case 15:Us(8,r,r.return),no(r);break;case 22:h=r.stateNode,h._visibility&2&&(h._visibility&=-3,no(r));break;default:no(r)}l=l.sibling}}function ld(l,r){for(;aa!==null;){var h=aa;switch(h.tag){case 0:case 11:case 15:Us(8,h,r);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:jn(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,aa=g;else t:for(h=l;aa!==null;){g=aa;var E=g.sibling,T=g.return;if(Og(g),g===h){aa=null;break t}if(E!==null){E.return=T,aa=E;break t}aa=T}}}function Su(l){var r=Kg(l);if(r!=null){if(typeof r.memoizedProps["data-testname"]!="string")throw Error(u(364));return r}if(l=Cm(l),l===null)throw Error(u(362));return l.stateNode.current}function $c(l,r){var h=l.tag;switch(r.$$typeof){case Wd:if(l.type===r.value)return!0;break;case $d:t:{for(r=r.value,l=[l,0],h=0;h<l.length;){var g=l[h++],E=g.tag,T=l[h++],z=r[T];if(E!==5&&E!==26&&E!==27||!Ys(g)){for(;z!=null&&$c(g,z);)T++,z=r[T];if(T===r.length){r=!0;break t}else for(g=g.child;g!==null;)l.push(g,T),g=g.sibling}}r=!1}return r;case tp:if((h===5||h===26||h===27)&&Wg(l.stateNode,r.value))return!0;break;case np:if((h===5||h===6||h===26||h===27)&&(l=Ig(l),l!==null&&0<=l.indexOf(r.value)))return!0;break;case ep:if((h===5||h===26||h===27)&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===r.value.toLowerCase()))return!0;break;default:throw Error(u(365))}return!1}function rd(l){switch(l.$$typeof){case Wd:return"<"+(_(l.value)||"Unknown")+">";case $d:return":has("+(rd(l)||"")+")";case tp:return'[role="'+l.value+'"]';case np:return'"'+l.value+'"';case ep:return'[data-testname="'+l.value+'"]';default:throw Error(u(365))}}function nm(l,r){var h=[];l=[l,0];for(var g=0;g<l.length;){var E=l[g++],T=E.tag,z=l[g++],L=r[z];if(T!==5&&T!==26&&T!==27||!Ys(E)){for(;L!=null&&$c(E,L);)z++,L=r[z];if(z===r.length)h.push(E);else for(E=E.child;E!==null;)l.push(E,z),E=E.sibling}}return h}function tf(l,r){if(!ro)throw Error(u(363));l=Su(l),l=nm(l,r),r=[],l=Array.from(l);for(var h=0;h<l.length;){var g=l[h++],E=g.tag;if(E===5||E===26||E===27)Ys(g)||r.push(g.stateNode);else for(g=g.child;g!==null;)l.push(g),g=g.sibling}return r}function ai(){return(re&2)!==0&&ce!==0?ce&-ce:Gt.T!==null?Yr():cs()}function ef(){if(Ei===0)if((ce&536870912)===0||se){var l=Tf;Tf<<=1,(Tf&3932160)===0&&(Tf=262144),Ei=l}else Ei=536870912;return l=Si.current,l!==null&&(l.flags|=32),Ei}function Pa(l,r,h){(l===Le&&(He===2||He===9)||l.cancelPendingCommit!==null)&&(rr(l,0),xl(l,ce,Ei,!1)),$(l,h),((re&2)===0||l!==Le)&&(l===Le&&((re&2)===0&&(bo|=h),yn===4&&xl(l,ce,Ei,!1)),ke(l))}function am(l,r,h){if((re&6)!==0)throw Error(u(327));var g=!h&&(r&127)===0&&(r&l.expiredLanes)===0||U(l,r),E=g?Gg(l,r):Tu(l,r,!0),T=g;do{if(E===0){So&&!g&&xl(l,r,0,!1);break}else{if(h=l.current.alternate,T&&!wg(h)){E=Tu(l,r,!1),T=!1;continue}if(E===2){if(T=r,l.errorRecoveryDisabledLanes&T)var z=0;else z=l.pendingLanes&-536870913,z=z!==0?z:z&536870912?536870912:0;if(z!==0){r=z;t:{var L=l;E=Of;var ft=ya&&L.current.memoizedState.isDehydrated;if(ft&&(rr(L,z).flags|=256),z=Tu(L,z,!1),z!==2){if(Ym&&!ft){L.errorRecoveryDisabledLanes|=T,bo|=T,E=4;break t}T=ui,ui=E,T!==null&&(ui===null?ui=T:ui.push.apply(ui,T))}E=z}if(T=!1,E!==2)continue}}if(E===1){rr(l,0),xl(l,r,0,!0);break}t:{switch(g=l,T=E,T){case 0:case 1:throw Error(u(345));case 4:if((r&4194048)!==r)break;case 6:xl(g,r,Ei,!yr);break t;case 2:ui=null;break;case 3:case 5:break;default:throw Error(u(329))}if((r&62914560)===r&&(E=Rf+300-Me(),10<E)){if(xl(g,r,Ei,!yr),O(g,0,!0)!==0)break t;Js=r,g.timeoutHandle=Xg(od.bind(null,g,h,ui,ip,ap,r,Ei,bo,Pu,yr,T,"Throttled",-0,0),E);break t}od(g,h,ui,ip,ap,r,Ei,bo,Pu,yr,T,null,-0,0)}}break}while(!0);ke(l)}function od(l,r,h,g,E,T,z,L,ft,vt,Mt,xt,Rt,Yt){if(l.timeoutHandle=Ml,xt=r.subtreeFlags,xt&8192||(xt&16785408)===16785408){xt=Jg(),em(r,T,xt);var tn=(T&62914560)===T?Rf-Me():(T&4194048)===T?Xm-Me():0;if(tn=Fg(xt,tn),tn!==null){Js=T,l.cancelPendingCommit=tn(rm.bind(null,l,r,T,h,g,E,z,L,ft,Mt,xt,null,Rt,Yt)),xl(l,T,z,!vt);return}}rm(l,r,T,h,g,E,z,L,ft)}function wg(l){for(var r=l;;){var h=r.tag;if((h===0||h===11||h===15)&&r.flags&16384&&(h=r.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var E=h[g],T=E.getSnapshot;E=E.value;try{if(!Sa(T(),E))return!1}catch{return!1}}if(h=r.child,r.subtreeFlags&16384&&h!==null)h.return=r,r=h;else{if(r===l)break;for(;r.sibling===null;){if(r.return===null||r.return===l)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function xl(l,r,h,g){r&=~qm,r&=~bo,l.suspendedLanes|=r,l.pingedLanes&=~r,g&&(l.warmLanes|=r),g=l.expirationTimes;for(var E=r;0<E;){var T=31-ii(E),z=1<<T;g[T]=-1,E&=~z}h!==0&&I(l,h,r)}function lr(){return(re&6)===0?(mn(0),!1):!0}function nf(){if(oe!==null){if(He===0)var l=oe.return;else l=oe,$e=Ka=null,Oc(l),ji=null,Df=0,l=oe;for(;l!==null;)Ih(l.alternate,l),l=l.return;oe=null}}function rr(l,r){var h=l.timeoutHandle;h!==Ml&&(l.timeoutHandle=Ml,Em(h)),h=l.cancelPendingCommit,h!==null&&(l.cancelPendingCommit=null,h()),Js=0,nf(),Le=l,oe=h=Vs(l.current,null),ce=r,He=0,bi=null,yr=!1,So=U(l,r),Ym=!1,Pu=Ei=qm=bo=vr=yn=0,ui=Of=null,ap=!1,(r&8)!==0&&(r|=r&32);var g=l.entangledLanes;if(g!==0)for(l=l.entanglements,g&=r;0<g;){var E=31-ii(g),T=1<<E;r|=l[E],g&=~T}return Bl=r,Ca(),h}function Ug(l,r){kt=null,Gt.H=Af,r===Vu||r===qd?(r=xc(),He=3):r===Yd?(r=xc(),He=4):He=r===Fd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,bi=r,oe===null&&(yn=1,Pc(l,at(r,l.current)))}function Bg(){var l=Si.current;return l===null?!0:(ce&4194048)===ce?Pi===null:(ce&62914560)===ce||(ce&536870912)!==0?l===Pi:!1}function im(){var l=Gt.H;return Gt.H=Af,l===null?Af:l}function bu(){var l=Gt.A;return Gt.A=y3,l}function Eu(){yn=4,yr||(ce&4194048)!==ce&&Si.current!==null||(So=!0),(vr&134217727)===0&&(bo&134217727)===0||Le===null||xl(Le,ce,Ei,!1)}function Tu(l,r,h){var g=re;re|=2;var E=im(),T=bu();(Le!==l||ce!==r)&&(ip=null,rr(l,r)),r=!1;var z=yn;t:do try{if(He!==0&&oe!==null){var L=oe,ft=bi;switch(He){case 8:nf(),z=6;break t;case 3:case 2:case 9:case 6:Si.current===null&&(r=!0);var vt=He;if(He=0,bi=null,ao(l,L,ft,vt),h&&So){z=0;break t}break;default:vt=He,He=0,bi=null,ao(l,L,ft,vt)}}Vg(),z=yn;break}catch(Mt){Ug(l,Mt)}while(!0);return r&&l.shellSuspendCounter++,$e=Ka=null,re=g,Gt.H=E,Gt.A=T,oe===null&&(Le=null,ce=0,Ca()),z}function Vg(){for(;oe!==null;)ud(oe)}function Gg(l,r){var h=re;re|=2;var g=im(),E=bu();Le!==l||ce!==r?(ip=null,Yu=Me()+500,rr(l,r)):So=U(l,r);t:do try{if(He!==0&&oe!==null){r=oe;var T=bi;e:switch(He){case 1:He=0,bi=null,ao(l,r,T,1);break;case 2:case 9:if(O0(T)){He=0,bi=null,lm(r);break}r=function(){He!==2&&He!==9||Le!==l||(He=7),ke(l)},T.then(r,r);break t;case 3:He=7;break t;case 4:He=5;break t;case 7:O0(T)?(He=0,bi=null,lm(r)):(He=0,bi=null,ao(l,r,T,7));break;case 5:var z=null;switch(oe.tag){case 26:z=oe.memoizedState;case 5:case 27:var L=oe,ft=L.type,vt=L.pendingProps;if(z?Hd(z):va(L.stateNode,ft,vt)){He=0,bi=null;var Mt=L.sibling;if(Mt!==null)oe=Mt;else{var xt=L.return;xt!==null?(oe=xt,Bs(xt)):oe=null}break e}}He=0,bi=null,ao(l,r,T,5);break;case 6:He=0,bi=null,ao(l,r,T,6);break;case 8:nf(),yn=6;break t;default:throw Error(u(462))}}sm();break}catch(Rt){Ug(l,Rt)}while(!0);return $e=Ka=null,Gt.H=g,Gt.A=E,re=h,oe!==null?0:(Le=null,ce=0,Ca(),yn)}function sm(){for(;oe!==null&&!p3();)ud(oe)}function ud(l){var r=Zh(l.alternate,l,Bl);l.memoizedProps=l.pendingProps,r===null?Bs(l):oe=r}function lm(l){var r=l,h=r.alternate;switch(r.tag){case 15:case 0:r=Z0(h,r,r.pendingProps,r.type,void 0,ce);break;case 11:r=Z0(h,r,r.pendingProps,r.type.render,r.ref,ce);break;case 5:Oc(r);default:Ih(h,r),r=oe=fm(r,Bl),r=Zh(h,r,Bl)}l.memoizedProps=l.pendingProps,r===null?Bs(l):oe=r}function ao(l,r,h,g){$e=Ka=null,Oc(r),ji=null,Df=0;var E=r.return;try{if(_a(l,E,r,h,ce)){yn=1,Pc(l,at(h,l.current)),oe=null;return}}catch(T){if(E!==null)throw oe=E,T;yn=1,Pc(l,at(h,l.current)),oe=null;return}r.flags&32768?(se||g===1?l=!0:So||(ce&536870912)!==0?l=!1:(yr=l=!0,(g===2||g===9||g===3||g===6)&&(g=Si.current,g!==null&&g.tag===13&&(g.flags|=16384))),af(r,l)):Bs(r)}function Bs(l){var r=l;do{if((r.flags&32768)!==0){af(r,yr);return}l=r.return;var h=eo(r.alternate,r,Bl);if(h!==null){oe=h;return}if(r=r.sibling,r!==null){oe=r;return}oe=r=l}while(r!==null);yn===0&&(yn=5)}function af(l,r){do{var h=ss(l.alternate,l);if(h!==null){h.flags&=32767,oe=h;return}if(h=l.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!r&&(l=l.sibling,l!==null)){oe=l;return}oe=l=h}while(l!==null);yn=6,oe=null}function rm(l,r,h,g,E,T,z,L,ft){l.cancelPendingCommit=null;do On();while(we!==0);if((re&6)!==0)throw Error(u(327));if(r!==null){if(r===l.current)throw Error(u(177));if(T=r.lanes|r.childLanes,T|=jm,st(l,h,T,z,L,ft),l===Le&&(oe=Le=null,ce=0),br=r,Vl=l,Js=h,sp=T,lp=E,Uy=g,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,t3(zl,function(){return om(),null})):(l.callbackNode=null,l.callbackPriority=0),g=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||g){g=Gt.T,Gt.T=null,E=Ls(),Jn(2),z=re,re|=4;try{Ng(l,r,h)}finally{re=z,Jn(E),Gt.T=g}}we=1,cd(),fd(),hd()}}function cd(){if(we===1){we=0;var l=Vl,r=br,h=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||h){h=Gt.T,Gt.T=null;var g=Ls();Jn(2);var E=re;re|=4;try{Wc(r,l),df(l.containerInfo)}finally{re=E,Jn(g),Gt.T=h}}l.current=r,we=2}}function fd(){if(we===2){we=0;var l=Vl,r=br,h=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||h){h=Gt.T,Gt.T=null;var g=Ls();Jn(2);var E=re;re|=4;try{$0(l,r.alternate,r)}finally{re=E,Jn(g),Gt.T=h}}we=3}}function hd(){if(we===4||we===3){we=0,si();var l=Vl,r=br,h=Js,g=Uy;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?we=5:(we=0,br=Vl=null,jg(l,l.pendingLanes));var E=l.pendingLanes;if(E===0&&(Sr=null),rt(h),r=r.stateNode,Rn&&typeof Rn.onCommitFiberRoot=="function")try{Rn.onCommitFiberRoot(po,r,void 0,(r.current.flags&128)===128)}catch{}if(g!==null){r=Gt.T,E=Ls(),Jn(2),Gt.T=null;try{for(var T=l.onRecoverableError,z=0;z<g.length;z++){var L=g[z];T(L.value,{componentStack:L.stack})}}finally{Gt.T=r,Jn(E)}}(Js&3)!==0&&On(),ke(l),E=l.pendingLanes,(h&261930)!==0&&(E&42)!==0?l===rp?qu++:(qu=0,rp=l):qu=0,ya&&Ey(),mn(0)}}function jg(l,r){(l.pooledCacheLanes&=r)===0&&(r=l.pooledCache,r!=null&&(l.pooledCache=null,jn(r)))}function On(){return cd(),fd(),hd(),om()}function om(){if(we!==5)return!1;var l=Vl,r=sp;sp=0;var h=rt(Js),g=32>h?32:h;h=Gt.T;var E=Ls();try{Jn(g),Gt.T=null,g=lp,lp=null;var T=Vl,z=Js;if(we=0,br=Vl=null,Js=0,(re&6)!==0)throw Error(u(331));var L=re;if(re|=4,sd(T.current),Hg(T,T.current,z,g),re=L,mn(0,!1),Rn&&typeof Rn.onPostCommitFiberRoot=="function")try{Rn.onPostCommitFiberRoot(po,T)}catch{}return!0}finally{Jn(E),Gt.T=h,jg(l,r)}}function um(l,r,h){r=at(h,r),r=du(l.stateNode,r,2),l=Ds(l,r,2),l!==null&&($(l,2),ke(l))}function be(l,r,h){if(l.tag===3)um(l,l,h);else for(;r!==null;){if(r.tag===3){um(r,l,h);break}else if(r.tag===1){var g=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Sr===null||!Sr.has(g))){l=at(h,l),h=Yc(2),g=Ds(r,h,2),g!==null&&(Ph(h,g,r,l),$(g,2),ke(g));break}}r=r.return}}function dd(l,r,h){var g=l.pingCache;if(g===null){g=l.pingCache=new v3;var E=new Set;g.set(r,E)}else E=g.get(r),E===void 0&&(E=new Set,g.set(r,E));E.has(h)||(Ym=!0,E.add(h),l=sf.bind(null,l,r,h),r.then(l,l))}function sf(l,r,h){var g=l.pingCache;g!==null&&g.delete(r),l.pingedLanes|=l.suspendedLanes&h,l.warmLanes&=~h,Le===l&&(ce&h)===h&&(yn===4||yn===3&&(ce&62914560)===ce&&300>Me()-Rf?(re&2)===0&&rr(l,0):qm|=h,Pu===ce&&(Pu=0)),ke(l)}function cm(l,r){r===0&&(r=V()),l=$l(l,r),l!==null&&($(l,r),ke(l))}function pd(l){var r=l.memoizedState,h=0;r!==null&&(h=r.retryLane),cm(l,h)}function Lg(l,r){var h=0;switch(l.tag){case 31:case 13:var g=l.stateNode,E=l.memoizedState;E!==null&&(h=E.retryLane);break;case 19:g=l.stateNode;break;case 22:g=l.stateNode._retryCache;break;default:throw Error(u(314))}g!==null&&g.delete(r),cm(l,h)}function t3(l,r){return Vd(l,r)}function md(l,r,h,g){this.tag=l,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lf(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Vs(l,r){var h=l.alternate;return h===null?(h=i(l.tag,r,l.key,l.mode),h.elementType=l.elementType,h.type=l.type,h.stateNode=l.stateNode,h.alternate=l,l.alternate=h):(h.pendingProps=r,h.type=l.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=l.flags&65011712,h.childLanes=l.childLanes,h.lanes=l.lanes,h.child=l.child,h.memoizedProps=l.memoizedProps,h.memoizedState=l.memoizedState,h.updateQueue=l.updateQueue,r=l.dependencies,h.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},h.sibling=l.sibling,h.index=l.index,h.ref=l.ref,h.refCleanup=l.refCleanup,h}function fm(l,r){l.flags&=65011714;var h=l.alternate;return h===null?(l.childLanes=0,l.lanes=r,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=h.childLanes,l.lanes=h.lanes,l.child=h.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=h.memoizedProps,l.memoizedState=h.memoizedState,l.updateQueue=h.updateQueue,l.type=h.type,r=h.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),l}function rf(l,r,h,g,E,T){var z=0;if(g=l,typeof l=="function")lf(l)&&(z=1);else if(typeof l=="string")z=wi&&Ln?zm(l,h,ba.current)?26:Bd(l)?27:5:wi?zm(l,h,ba.current)?26:5:Ln&&Bd(l)?27:5;else t:switch(l){case Td:return l=i(31,h,r,E),l.elementType=Td,l.lanes=T,l;case io:return Dl(h.children,E,T,r);case mm:z=8,E|=24;break;case ff:return l=i(12,h,r,E|2),l.elementType=ff,l.lanes=T,l;case so:return l=i(13,h,r,E),l.elementType=so,l.lanes=T,l;case ze:return l=i(19,h,r,E),l.elementType=ze,l.lanes=T,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Al:z=10;break t;case Ed:z=9;break t;case Cu:z=11;break t;case gm:z=14;break t;case ur:z=16,g=null;break t}z=29,h=Error(u(130,l===null?"null":typeof l,"")),g=null}return r=i(z,h,r,E),r.elementType=l,r.type=g,r.lanes=T,r}function Dl(l,r,h,g){return l=i(7,l,g,r),l.lanes=h,l}function of(l,r,h){return l=i(6,l,null,r),l.lanes=h,l}function gd(l){var r=i(18,null,null,0);return r.stateNode=l,r}function yd(l,r,h){return r=i(4,l.children!==null?l.children:[],l.key,r),r.lanes=h,r.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},r}function hm(l,r,h,g,E,T,z,L,ft){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Ml,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=J(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=J(0),this.hiddenUpdates=J(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=T,this.onRecoverableError=z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ft,this.incompleteTransitions=new Map}function uf(l,r,h,g,E,T,z,L,ft,vt,Mt,xt){return l=new hm(l,r,h,z,ft,vt,Mt,xt,L),r=1,T===!0&&(r|=24),T=i(3,null,null,r),l.current=T,T.stateNode=l,r=Ae(),r.refCount++,l.pooledCache=r,r.refCount++,T.memoizedState={element:g,isDehydrated:h,cache:r},Dc(T),l}function vd(l){return l?(l=ho,l):ho}function dm(l){var r=l._reactInternals;if(r===void 0)throw typeof l.render=="function"?Error(u(188)):(l=Object.keys(l).join(","),Error(u(268,l)));return l=p(r),l=l!==null?m(l):null,l===null?null:hf(l.stateNode)}function Sd(l,r,h,g,E,T){E=vd(E),g.context===null?g.context=E:g.pendingContext=E,g=mi(r),g.payload={element:h},T=T===void 0?null:T,T!==null&&(g.callback=T),h=Ds(l,g,r),h!==null&&(Pa(h,l,r),Ac(h,l,r))}function pm(l,r){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var h=l.retryLane;l.retryLane=h!==0&&h<r?h:r}}function os(l,r){pm(l,r),(l=l.alternate)&&pm(l,r)}var ne={},e3=H,Ya=J2(),yi=Object.assign,bd=Symbol.for("react.element"),cf=Symbol.for("react.transitional.element"),or=Symbol.for("react.portal"),io=Symbol.for("react.fragment"),mm=Symbol.for("react.strict_mode"),ff=Symbol.for("react.profiler"),Ed=Symbol.for("react.consumer"),Al=Symbol.for("react.context"),Cu=Symbol.for("react.forward_ref"),so=Symbol.for("react.suspense"),ze=Symbol.for("react.suspense_list"),gm=Symbol.for("react.memo"),ur=Symbol.for("react.lazy"),Td=Symbol.for("react.activity"),Gs=Symbol.for("react.memo_cache_sentinel"),ym=Symbol.iterator,vm=Symbol.for("react.client.reference"),cr=Array.isArray,Gt=e3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pg=t.rendererVersion,Sm=t.rendererPackageName,bm=t.extraDevToolsConfig,hf=t.getPublicInstance,n3=t.getRootHostContext,Yg=t.getChildHostContext,a3=t.prepareForCommit,df=t.resetAfterCommit,js=t.createInstance;t.cloneMutableInstance;var Cd=t.appendInitialChild,qg=t.finalizeInitialChildren,pf=t.shouldSetTextContent,_d=t.createTextInstance;t.cloneMutableTextInstance;var Xg=t.scheduleTimeout,Em=t.cancelTimeout,Ml=t.noTimeout,Hi=t.isPrimaryRenderer;t.warnsIfNotActing;var Aa=t.supportsMutation,us=t.supportsPersistence,ya=t.supportsHydration,Kg=t.getInstanceFromNode;t.beforeActiveInstanceBlur;var i3=t.preparePortalMount;t.prepareScopeUpdate,t.getInstanceFromScope;var Jn=t.setCurrentUpdatePriority,Ls=t.getCurrentUpdatePriority,cs=t.resolveUpdatePriority;t.trackSchedulerEvent,t.resolveEventType,t.resolveEventTimeStamp;var Tm=t.shouldAttemptEagerTransition,Qg=t.detachDeletedInstance;t.requestPostPaintCallback;var Zg=t.maySuspendCommit,s3=t.maySuspendCommitOnUpdate,_u=t.maySuspendCommitInSyncRender,va=t.preloadInstance,Jg=t.startSuspendingCommit,Ma=t.suspendInstance;t.suspendOnActiveViewTransition;var Fg=t.waitForCommitToBeReady;t.getSuspendedCommitReason;var qa=t.NotPendingTransition,fr=t.HostTransitionContext,lo=t.resetFormInstance;t.bindToConsole;var kg=t.supportsMicrotasks,Ps=t.scheduleMicrotask,ro=t.supportsTestSelectors,Cm=t.findFiberRoot,fs=t.getBoundingRect,Ig=t.getTextContent,Ys=t.isHiddenSubtree,Wg=t.matchAccessibilityRole,mf=t.setFocusIfFocusable,oo=t.setupIntersectionObserver,$g=t.appendChild,ty=t.appendChildToContainer,gf=t.commitTextUpdate,ey=t.commitMount,xd=t.commitUpdate,ny=t.insertBefore,ay=t.insertInContainerBefore,_m=t.removeChild,xm=t.removeChildFromContainer,Dd=t.resetTextContent,iy=t.hideInstance,Ad=t.hideTextInstance,l3=t.unhideInstance,sy=t.unhideTextInstance;t.cancelViewTransitionName,t.cancelRootViewTransitionName,t.restoreRootViewTransitionName,t.cloneRootViewTransitionContainer,t.removeRootViewTransitionClone,t.measureClonedInstance,t.hasInstanceChanged,t.hasInstanceAffectedParent,t.startViewTransition,t.startGestureTransition,t.stopViewTransition,t.getCurrentGestureOffset,t.createViewTransitionInstance;var vi=t.clearContainer;t.createFragmentInstance,t.updateFragmentInstanceFiber,t.commitNewChildToFragmentInstance,t.deleteChildFromFragmentInstance;var ly=t.cloneInstance,Ie=t.createContainerChildSet,Dm=t.appendChildToContainerChildSet,ry=t.finalizeContainerChildren,oy=t.replaceContainerChildren,Nl=t.cloneHiddenInstance,yf=t.cloneHiddenTextInstance,vf=t.isSuspenseInstancePending,Sf=t.isSuspenseInstanceFallback,uo=t.getSuspenseInstanceFallbackErrorDetails,xu=t.registerSuspenseInstanceRetry,uy=t.canHydrateFormStateMarker,cy=t.isFormStateMarkerMatching,Am=t.getNextHydratableSibling,fy=t.getNextHydratableSiblingAfterSingleton,Md=t.getFirstHydratableChild,Nd=t.getFirstHydratableChildWithinContainer,Mm=t.getFirstHydratableChildWithinActivityInstance,hy=t.getFirstHydratableChildWithinSuspenseInstance,r3=t.getFirstHydratableChildWithinSingleton,o3=t.canHydrateInstance,dy=t.canHydrateTextInstance,py=t.canHydrateActivityInstance,u3=t.canHydrateSuspenseInstance,Du=t.hydrateInstance,Od=t.hydrateTextInstance,my=t.hydrateActivityInstance,Nm=t.hydrateSuspenseInstance,gy=t.getNextHydratableInstanceAfterActivityInstance,yy=t.getNextHydratableInstanceAfterSuspenseInstance,vy=t.commitHydratedInstance,c3=t.commitHydratedContainer,Sy=t.commitHydratedActivityInstance,Au=t.commitHydratedSuspenseInstance,by=t.finalizeHydratedChildren,Ey=t.flushHydrationEvents;t.clearActivityBoundary;var Ee=t.clearSuspenseBoundary;t.clearActivityBoundaryFromContainer;var Om=t.clearSuspenseBoundaryFromContainer,f3=t.hideDehydratedBoundary,Ty=t.unhideDehydratedBoundary,Cy=t.shouldDeleteUnhydratedTailInstances;t.diffHydratedPropsForDevWarnings,t.diffHydratedTextForDevWarnings,t.describeHydratableInstanceForDevWarnings;var h3=t.validateHydratableInstance,Rm=t.validateHydratableTextInstance,wi=t.supportsResources,zm=t.isHostHoistableType,Rd=t.getHoistableRoot,Mu=t.getResource,_y=t.acquireResource,xy=t.releaseResource,co=t.hydrateHoistable,zd=t.mountHoistable,Hm=t.unmountHoistable,Dy=t.createHoistableInstance,Ay=t.prepareToCommitHoistables,d3=t.mayResourceSuspendCommit,Hd=t.preloadResource,Ol=t.suspendResource,Ln=t.supportsSingletons,wd=t.resolveSingletonInstance,Ud=t.acquireSingletonInstance,hr=t.releaseSingletonInstance,Bd=t.isHostSingletonType,fo=t.isSingletonScope,bf=[],Nu=-1,ho={},ii=Math.clz32?Math.clz32:N,My=Math.log,Ny=Math.LN2,Ef=256,Tf=262144,Ou=4194304,Vd=Ya.unstable_scheduleCallback,ae=Ya.unstable_cancelCallback,p3=Ya.unstable_shouldYield,si=Ya.unstable_requestPaint,Me=Ya.unstable_now,Oy=Ya.unstable_ImmediatePriority,Rl=Ya.unstable_UserBlockingPriority,zl=Ya.unstable_NormalPriority,Ru=Ya.unstable_IdlePriority,Gd=Ya.log,wm=Ya.unstable_setDisableYieldValue,po=null,Rn=null,Sa=typeof Object.is=="function"?Object.is:pt,jd=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},Um=Object.prototype.hasOwnProperty,zu,li,Cf=!1,Ry=new WeakMap,mo=[],Hu=0,Pn=null,lt=0,Ui=[],Bi=0,Hl=null,Xa=1,qs="",ba=x(null),_f=x(null),dr=x(null),Ld=x(null),Fn=null,We=null,se=!1,wl=null,Vi=!1,Bm=Error(u(519)),Xs=x(null),Ka=null,$e=null,Ks=typeof AbortController<"u"?AbortController:function(){var l=[],r=this.signal={aborted:!1,addEventListener:function(h,g){l.push(g)}};this.abort=function(){r.aborted=!0,l.forEach(function(h){return h()})}},Na=Ya.unstable_scheduleCallback,m3=Ya.unstable_NormalPriority,un={$$typeof:Al,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},zn=null,ri=null,Vm=!1,wu=!1,go=!1,hs=0,xf=null,Gm=0,Uu=0,Bu=null,Pd=Gt.S;Gt.S=function(l,r){Xm=Me(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&au(l,r),Pd!==null&&Pd(l,r)};var pr=x(null),Vu=Error(u(460)),Yd=Error(u(474)),qd=Error(u(542)),Xd={then:function(){}},Gi=null,ji=null,Df=0,yo=R0(!0),zy=R0(!1),Li=[],ds=0,jm=0,mr=!1,Lm=!1,Qs=x(null),Kd=x(0),Si=x(null),Pi=null,Hn=x(0),Ul=0,kt=null,Ge=null,Yn=null,Qd=!1,Gu=!1,vo=!1,Zd=0,ju=0,Lu=null,g3=0,Af={readContext:rn,use:Ve,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useLayoutEffect:on,useInsertionEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useSyncExternalStore:on,useId:on,useHostTransitionStatus:on,useFormState:on,useActionState:on,useOptimistic:on,useMemoCache:on,useCacheRefresh:on};Af.useEffectEvent=on;var Hy={readContext:rn,use:Ve,useCallback:function(l,r){return pa().memoizedState=[l,r===void 0?null:r],l},useContext:rn,useEffect:B0,useImperativeHandle:function(l,r,h){h=h!=null?h.concat([l]):null,Bc(4194308,4,Ag.bind(null,r,l),h)},useLayoutEffect:function(l,r){return Bc(4194308,4,l,r)},useInsertionEffect:function(l,r){Bc(4,2,l,r)},useMemo:function(l,r){var h=pa();r=r===void 0?null:r;var g=l();if(vo){dt(!0);try{l()}finally{dt(!1)}}return h.memoizedState=[g,r],g},useReducer:function(l,r,h){var g=pa();if(h!==void 0){var E=h(r);if(vo){dt(!0);try{h(r)}finally{dt(!1)}}}else E=r;return g.memoizedState=g.baseState=E,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:E},g.queue=l,l=l.dispatch=ma.bind(null,kt,l),[g.memoizedState,l]},useRef:function(l){var r=pa();return l={current:l},r.memoizedState=l},useState:function(l){l=Ga(l);var r=l.queue,h=jh.bind(null,kt,r);return r.dispatch=h,[l.memoizedState,h]},useDebugValue:j0,useDeferredValue:function(l,r){var h=pa();return Vh(h,l,r)},useTransition:function(){var l=Ga(!1);return l=L0.bind(null,kt,l.queue,!0,!1),pa().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,r,h){var g=kt,E=pa();if(se){if(h===void 0)throw Error(u(407));h=h()}else{if(h=r(),Le===null)throw Error(u(349));(ce&127)!==0||xg(g,r,h)}E.memoizedState=h;var T={value:h,getSnapshot:r};return E.queue=T,B0(Rc.bind(null,g,T,l),[l]),g.flags|=2048,ja(9,{destroy:void 0},Os.bind(null,g,T,h,r),null),h},useId:function(){var l=pa(),r=Le.identifierPrefix;if(se){var h=qs,g=Xa;h=(g&~(1<<32-ii(g)-1)).toString(32)+h,r="_"+r+"R_"+h,h=Zd++,0<h&&(r+="H"+h.toString(32)),r+="_"}else h=g3++,r="_"+r+"r_"+h.toString(32)+"_";return l.memoizedState=r},useHostTransitionStatus:Gh,useFormState:ns,useActionState:ns,useOptimistic:function(l){var r=pa();r.memoizedState=r.baseState=l;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=h,r=hu.bind(null,kt,!0,h),h.dispatch=r,[l,r]},useMemoCache:ou,useCacheRefresh:function(){return pa().memoizedState=Mg.bind(null,kt)},useEffectEvent:function(l){var r=pa(),h={impl:l};return r.memoizedState=h,function(){if((re&2)!==0)throw Error(u(440));return h.impl.apply(void 0,arguments)}}},Pm={readContext:rn,use:Ve,useCallback:Bh,useContext:rn,useEffect:Hh,useImperativeHandle:G0,useInsertionEffect:V0,useLayoutEffect:Uh,useMemo:Vc,useReducer:uu,useRef:Wr,useState:function(){return uu(Ns)},useDebugValue:j0,useDeferredValue:function(l,r){var h=Ye();return Gc(h,Ge.memoizedState,l,r)},useTransition:function(){var l=uu(Ns)[0],r=Ye().memoizedState;return[typeof l=="boolean"?l:Ii(l),r]},useSyncExternalStore:Wi,useId:bl,useHostTransitionStatus:Gh,useFormState:U0,useActionState:U0,useOptimistic:function(l,r){var h=Ye();return ti(h,Ge,l,r)},useMemoCache:ou,useCacheRefresh:Y0};Pm.useEffectEvent=wh;var wy={readContext:rn,use:Ve,useCallback:Bh,useContext:rn,useEffect:Hh,useImperativeHandle:G0,useInsertionEffect:V0,useLayoutEffect:Uh,useMemo:Vc,useReducer:Ir,useRef:Wr,useState:function(){return Ir(Ns)},useDebugValue:j0,useDeferredValue:function(l,r){var h=Ye();return Ge===null?Vh(h,l,r):Gc(h,Ge.memoizedState,l,r)},useTransition:function(){var l=Ir(Ns)[0],r=Ye().memoizedState;return[typeof l=="boolean"?l:Ii(l),r]},useSyncExternalStore:Wi,useId:bl,useHostTransitionStatus:Gh,useFormState:Uc,useActionState:Uc,useOptimistic:function(l,r){var h=Ye();return Ge!==null?ti(h,Ge,l,r):(h.baseState=l,[l,h.queue.dispatch])},useMemoCache:ou,useCacheRefresh:Y0};wy.useEffectEvent=wh;var Jd={enqueueSetState:function(l,r,h){l=l._reactInternals;var g=ai(),E=mi(g);E.payload=r,h!=null&&(E.callback=h),r=Ds(l,E,g),r!==null&&(Pa(r,l,g),Ac(r,l,g))},enqueueReplaceState:function(l,r,h){l=l._reactInternals;var g=ai(),E=mi(g);E.tag=1,E.payload=r,h!=null&&(E.callback=h),r=Ds(l,E,g),r!==null&&(Pa(r,l,g),Ac(r,l,g))},enqueueForceUpdate:function(l,r){l=l._reactInternals;var h=ai(),g=mi(h);g.tag=2,r!=null&&(g.callback=r),r=Ds(l,g,h),r!==null&&(Pa(r,l,h),Ac(r,l,h))}},Fd=Error(u(461)),qn=!1,kd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},Zs=!1,wn=!1,Mf=!1,Id=typeof WeakSet=="function"?WeakSet:Set,aa=null,Xn=null,oi=!1,ps=null,gr=8192,y3={getCacheForType:function(l){var r=rn(un),h=r.data.get(l);return h===void 0&&(h=l(),r.data.set(l,h)),h},cacheSignal:function(){return rn(un).controller.signal}},Wd=0,$d=1,tp=2,ep=3,np=4;if(typeof Symbol=="function"&&Symbol.for){var Nf=Symbol.for;Wd=Nf("selector.component"),$d=Nf("selector.has_pseudo_class"),tp=Nf("selector.role"),ep=Nf("selector.test_id"),np=Nf("selector.text")}var v3=typeof WeakMap=="function"?WeakMap:Map,re=0,Le=null,oe=null,ce=0,He=0,bi=null,yr=!1,So=!1,Ym=!1,Bl=0,yn=0,vr=0,bo=0,qm=0,Ei=0,Pu=0,Of=null,ui=null,ap=!1,Rf=0,Xm=0,Yu=1/0,ip=null,Sr=null,we=0,Vl=null,br=null,Js=0,sp=0,lp=null,Uy=null,qu=0,rp=null;return ne.attemptContinuousHydration=function(l){if(l.tag===13||l.tag===31){var r=$l(l,67108864);r!==null&&Pa(r,l,67108864),os(l,67108864)}},ne.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13||l.tag===31){var r=ai();r=bt(r);var h=$l(l,r);h!==null&&Pa(h,l,r),os(l,r)}},ne.attemptSynchronousHydration=function(l){switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var r=R(l.pendingLanes);if(r!==0){for(l.pendingLanes|=2,l.entangledLanes|=2;r;){var h=1<<31-ii(r);l.entanglements[1]|=h,r&=~h}ke(l),(re&6)===0&&(Yu=Me()+500,mn(0))}}break;case 31:case 13:r=$l(l,2),r!==null&&Pa(r,l,2),lr(),os(l,2)}},ne.batchedUpdates=function(l,r){return l(r)},ne.createComponentSelector=function(l){return{$$typeof:Wd,value:l}},ne.createContainer=function(l,r,h,g,E,T,z,L,ft,vt){return uf(l,r,!1,null,h,g,T,null,z,L,ft,vt)},ne.createHasPseudoClassSelector=function(l){return{$$typeof:$d,value:l}},ne.createHydrationContainer=function(l,r,h,g,E,T,z,L,ft,vt,Mt,xt,Rt,Yt){return l=uf(h,g,!0,l,E,T,L,Yt,ft,vt,Mt,xt),l.context=vd(null),h=l.current,g=ai(),g=bt(g),E=mi(g),E.callback=r??null,Ds(h,E,g),r=g,l.current.lanes=r,$(l,r),ke(l),l},ne.createPortal=function(l,r,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:or,key:g==null?null:""+g,children:l,containerInfo:r,implementation:h}},ne.createRoleSelector=function(l){return{$$typeof:tp,value:l}},ne.createTestNameSelector=function(l){return{$$typeof:ep,value:l}},ne.createTextSelector=function(l){return{$$typeof:np,value:l}},ne.defaultOnCaughtError=function(l){console.error(l)},ne.defaultOnRecoverableError=function(l){jd(l)},ne.defaultOnUncaughtError=function(l){jd(l)},ne.deferredUpdates=function(l){var r=Gt.T,h=Ls();try{return Jn(32),Gt.T=null,l()}finally{Jn(h),Gt.T=r}},ne.discreteUpdates=function(l,r,h,g,E){var T=Gt.T,z=Ls();try{return Jn(2),Gt.T=null,l(r,h,g,E)}finally{Jn(z),Gt.T=T,re===0&&(Yu=Me()+500)}},ne.findAllNodes=tf,ne.findBoundingRects=function(l,r){if(!ro)throw Error(u(363));r=tf(l,r),l=[];for(var h=0;h<r.length;h++)l.push(fs(r[h]));for(r=l.length-1;0<r;r--){h=l[r];for(var g=h.x,E=g+h.width,T=h.y,z=T+h.height,L=r-1;0<=L;L--)if(r!==L){var ft=l[L],vt=ft.x,Mt=vt+ft.width,xt=ft.y,Rt=xt+ft.height;if(g>=vt&&T>=xt&&E<=Mt&&z<=Rt){l.splice(r,1);break}else if(g!==vt||h.width!==ft.width||Rt<T||xt>z){if(!(T!==xt||h.height!==ft.height||Mt<g||vt>E)){vt>g&&(ft.width+=vt-g,ft.x=g),Mt<E&&(ft.width=E-vt),l.splice(r,1);break}}else{xt>T&&(ft.height+=xt-T,ft.y=T),Rt<z&&(ft.height=z-xt),l.splice(r,1);break}}}return l},ne.findHostInstance=dm,ne.findHostInstanceWithNoPortals=function(l){return l=p(l),l=l!==null?S(l):null,l===null?null:hf(l.stateNode)},ne.findHostInstanceWithWarning=function(l){return dm(l)},ne.flushPassiveEffects=On,ne.flushSyncFromReconciler=function(l){var r=re;re|=1;var h=Gt.T,g=Ls();try{if(Jn(2),Gt.T=null,l)return l()}finally{Jn(g),Gt.T=h,re=r,(re&6)===0&&mn(0)}},ne.flushSyncWork=lr,ne.focusWithin=function(l,r){if(!ro)throw Error(u(363));for(l=Su(l),r=nm(l,r),r=Array.from(r),l=0;l<r.length;){var h=r[l++],g=h.tag;if(!Ys(h)){if((g===5||g===26||g===27)&&mf(h.stateNode))return!0;for(h=h.child;h!==null;)r.push(h),h=h.sibling}}return!1},ne.getFindAllNodesFailureDescription=function(l,r){if(!ro)throw Error(u(363));var h=0,g=[];l=[Su(l),0];for(var E=0;E<l.length;){var T=l[E++],z=T.tag,L=l[E++],ft=r[L];if((z!==5&&z!==26&&z!==27||!Ys(T))&&($c(T,ft)&&(g.push(rd(ft)),L++,L>h&&(h=L)),L<r.length))for(T=T.child;T!==null;)l.push(T,L),T=T.sibling}if(h<r.length){for(l=[];h<r.length;h++)l.push(rd(r[h]));return`findAllNodes was able to match part of the selector:
|
|
23
23
|
`+(g.join(" > ")+`
|
|
24
24
|
|
|
25
25
|
No matching component was found for:
|
|
26
|
-
`)+l.join(" > ")}return null},ne.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 27:case 5:return hf(l.child.stateNode);default:return l.child.stateNode}},ne.injectIntoDevTools=function(){var l={bundleType:0,version:Pg,rendererPackageName:Sm,currentDispatcherRef:Gt,reconcilerVersion:"19.2.0"};if(bm!==null&&(l.rendererConfig=bm),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var r=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(r.isDisabled||!r.supportsFiber)l=!0;else{try{po=r.inject(l),Rn=r}catch{}l=!!r.checkDCE}}return l},ne.isAlreadyRendering=function(){return(re&6)!==0},ne.observeVisibleRects=function(l,r,h,g){if(!ro)throw Error(u(363));l=tf(l,r);var E=oo(l,h,g).disconnect;return{disconnect:function(){E()}}},ne.shouldError=function(){return null},ne.shouldSuspend=function(){return!1},ne.startHostTransition=function(l,r,h,g){if(l.tag!==5)throw Error(u(476));var E=P0(l).queue;L0(l,E,r,qa,h===null?s:function(){var T=P0(l);return T.next===null&&(T=l.alternate.memoizedState),tr(l,T.next.queue,{},ai()),h(g)})},ne.updateContainer=function(l,r,h,g){var E=r.current,T=ai();return Sd(E,T,l,r,h,g),T},ne.updateContainerSync=function(l,r,h,g){return Sd(r.current,2,l,r,h,g),2},ne},n.exports.default=n.exports,Object.defineProperty(n.exports,"__esModule",{value:!0})})(K2)),K2.exports}var F2={exports:{}};var g4;function K_(){return g4||(g4=1,(function(n){process.env.NODE_ENV!=="production"&&(n.exports=function(t){function i(e,a){for(e=e.memoizedState;e!==null&&0<a;)e=e.next,a--;return e}function s(e,a,o,d){if(o>=a.length)return d;var y=a[o],v=Pn(e)?e.slice():Me({},e);return v[y]=s(e[y],a,o+1,d),v}function u(e,a,o){if(a.length!==o.length)console.warn("copyWithRename() expects paths of the same length");else{for(var d=0;d<o.length-1;d++)if(a[d]!==o[d]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return c(e,a,o,0)}}function c(e,a,o,d){var y=a[d],v=Pn(e)?e.slice():Me({},e);return d+1===a.length?(v[o[d]]=v[y],Pn(v)?v.splice(y,1):delete v[y]):v[y]=c(e[y],a,o,d+1),v}function f(e,a,o){var d=a[o],y=Pn(e)?e.slice():Me({},e);return o+1===a.length?(Pn(y)?y.splice(d,1):delete y[d],y):(y[d]=f(e[d],a,o+1),y)}function p(){return!1}function m(){return null}function S(e,a,o,d){return new d3(e,a,o,d)}function b(e,a){e.context===tn&&(Ny(a,e,null,null),yf())}function _(e,a){if(il!==null){var o=a.staleFamilies;a=a.updatedFamilies,Au(),Ay(e.current,a,o),yf()}}function x(e){il=e}function D(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function A(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function N(){}function R(){}function O(e){var a=[];return e.forEach(function(o){a.push(o)}),a.sort().join(", ")}function U(e){var a=e,o=e;if(e.alternate)for(;a.return;)a=a.return;else{e=a;do a=e,(a.flags&4098)!==0&&(o=a.return),e=a.return;while(e)}return a.tag===3?o:null}function j(e){if(U(e)!==e)throw Error("Unable to find node on an unmounted component.")}function V(e){var a=e.alternate;if(!a){if(a=U(e),a===null)throw Error("Unable to find node on an unmounted component.");return a!==e?null:e}for(var o=e,d=a;;){var y=o.return;if(y===null)break;var v=y.alternate;if(v===null){if(d=y.return,d!==null){o=d;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===o)return j(y),e;if(v===d)return j(y),a;v=v.sibling}throw Error("Unable to find node on an unmounted component.")}if(o.return!==d.return)o=y,d=v;else{for(var C=!1,M=y.child;M;){if(M===o){C=!0,o=y,d=v;break}if(M===d){C=!0,d=y,o=v;break}M=M.sibling}if(!C){for(M=v.child;M;){if(M===o){C=!0,o=v,d=y;break}if(M===d){C=!0,d=v,o=y;break}M=M.sibling}if(!C)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(o.alternate!==d)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(o.tag!==3)throw Error("Unable to find node on an unmounted component.");return o.stateNode.current===o?e:a}function J(e){return e=V(e),e!==null?W(e):null}function W(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e;for(e=e.child;e!==null;){if(a=W(e),a!==null)return a;e=e.sibling}return null}function st(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e;for(e=e.child;e!==null;){if(e.tag!==4&&(a=st(e),a!==null))return a;e=e.sibling}return null}function I(e){return e===null||typeof e!="object"?null:(e=mo&&e[mo]||e["@@iterator"],typeof e=="function"?e:null)}function et(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Hu?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ru:return"Fragment";case wm:return"Profiler";case Gd:return"StrictMode";case jd:return"Suspense";case Um:return"SuspenseList";case Cf:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case zl:return"Portal";case Rn:return e.displayName||"Context";case po:return(e._context.displayName||"Context")+".Consumer";case Sa:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case zu:return a=e.displayName||null,a!==null?a:et(e.type)||"Memo";case li:a=e._payload,e=e._init;try{return et(e(a))}catch{}}return null}function nt(e){var a=e.type;switch(e.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(a._context.displayName||"Context")+".Consumer";case 10:return a.displayName||"Context";case 18:return"DehydratedFragment";case 11:return e=a.render,e=e.displayName||e.name||"",a.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return et(a);case 8:return a===Gd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;break;case 29:if(a=e._debugInfo,a!=null){for(var o=a.length-1;0<=o;o--)if(typeof a[o].name=="string")return a[o].name}if(e.return!==null)return nt(e.return)}return null}function bt(e){return{current:e}}function rt(e,a){0>Yt?console.error("Unexpected pop."):(a!==Rt[Yt]&&console.error("Unexpected Fiber popped."),e.current=xt[Yt],xt[Yt]=null,Rt[Yt]=null,Yt--)}function dt(e,a,o){Yt++,xt[Yt]=e.current,Rt[Yt]=o,e.current=a}function pt(e){return e>>>=0,e===0?32:31-(Eo(e)/it|0)|0}function tt(e){var a=e&42;if(a!==0)return a;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),e}}function w(e,a,o){var d=e.pendingLanes;if(d===0)return 0;var y=0,v=e.suspendedLanes,C=e.pingedLanes;e=e.warmLanes;var M=d&134217727;return M!==0?(d=M&~v,d!==0?y=tt(d):(C&=M,C!==0?y=tt(C):o||(o=M&~e,o!==0&&(y=tt(o))))):(M=d&~v,M!==0?y=tt(M):C!==0?y=tt(C):o||(o=d&~e,o!==0&&(y=tt(o)))),y===0?0:a!==0&&a!==y&&(a&v)===0&&(v=y&-y,o=a&-a,v>=o||v===32&&(o&4194048)!==0)?a:y}function F(e,a){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&a)===0}function K(e,a){switch(e){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function at(){var e=_t;return _t<<=1,(_t&62914560)===0&&(_t=4194304),e}function St(e){for(var a=[],o=0;31>o;o++)a.push(e);return a}function $(e,a){e.pendingLanes|=a,a!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(e,a,o,d,y,v){var C=e.pendingLanes;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=o,e.entangledLanes&=o,e.errorRecoveryDisabledLanes&=o,e.shellSuspendCounter=0;var M=e.entanglements,B=e.expirationTimes,q=e.hiddenUpdates;for(o=C&~o;0<o;){var ct=31-kn(o),ht=1<<ct;M[ct]=0,B[ct]=-1;var yt=q[ct];if(yt!==null)for(q[ct]=null,ct=0;ct<yt.length;ct++){var Vt=yt[ct];Vt!==null&&(Vt.lane&=-536870913)}o&=~ht}d!==0&&Tt(e,d,0),v!==0&&y===0&&e.tag!==0&&(e.suspendedLanes|=v&~(C&~a))}function Tt(e,a,o){e.pendingLanes|=a,e.suspendedLanes&=~a;var d=31-kn(a);e.entangledLanes|=a,e.entanglements[d]=e.entanglements[d]|1073741824|o&261930}function Pt(e,a){var o=e.entangledLanes|=a;for(e=e.entanglements;o;){var d=31-kn(o),y=1<<d;y&a|e[d]&a&&(e[d]|=a),o&=~y}}function le(e,a){var o=a&-a;return o=(o&42)!==0?1:xn(o),(o&(e.suspendedLanes|a))!==0?0:o}function xn(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function xe(e,a,o){if(Tr)for(e=e.pendingUpdatersLaneMap;0<o;){var d=31-kn(o),y=1<<d;e[d].add(a),o&=~y}}function Dn(e,a){if(Tr)for(var o=e.pendingUpdatersLaneMap,d=e.memoizedUpdaters;0<a;){var y=31-kn(a);e=1<<y,y=o[y],0<y.size&&(y.forEach(function(v){var C=v.alternate;C!==null&&d.has(C)||d.add(v)}),y.clear()),a&=~e}}function ln(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Be(e){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled)return!0;if(!a.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{op=a.inject(e),ci=a}catch(o){console.error("React instrumentation encountered an error: %o.",o)}return!!a.checkDCE}function At(e){if(typeof IG=="function"&&WG(e),ci&&typeof ci.setStrictMode=="function")try{ci.setStrictMode(op,e)}catch(a){Er||(Er=!0,console.error("React instrumentation encountered an error: %o",a))}}function ue(e,a){return e===a&&(e!==0||1/e===1/a)||e!==e&&a!==a}function ta(e){for(var a=0,o=0;o<e.length;o++){var d=e[o];if(typeof d=="object"&&d!==null)if(Pn(d)&&d.length===2&&typeof d[0]=="string"){if(a!==0&&a!==3)return 1;a=3}else return 1;else{if(typeof d=="function"||typeof d=="string"&&50<d.length||a!==0&&a!==2)return 1;a=2}}return a}function ea(e,a,o,d){for(var y in e)S3.call(e,y)&&y[0]!=="_"&&An(y,e[y],a,o,d)}function An(e,a,o,d,y){switch(typeof a){case"object":if(a===null){a="null";break}else{if(a.$$typeof===Rl){var v=et(a.type)||"…",C=a.key;a=a.props;var M=Object.keys(a),B=M.length;if(C==null&&B===0){a="<"+v+" />";break}if(3>d||B===1&&M[0]==="children"&&C==null){a="<"+v+" … />";break}o.push([y+" ".repeat(d)+e,"<"+v]),C!==null&&An("key",C,o,d+1,y),e=!1;for(var q in a)q==="children"?a.children!=null&&(!Pn(a.children)||0<a.children.length)&&(e=!0):S3.call(a,q)&&q[0]!=="_"&&An(q,a[q],o,d+1,y);o.push(["",e?">…</"+v+">":"/>"]);return}if(v=Object.prototype.toString.call(a),v=v.slice(8,v.length-1),v==="Array"){if(q=ta(a),q===2||q===0){a=JSON.stringify(a);break}else if(q===3){for(o.push([y+" ".repeat(d)+e,""]),e=0;e<a.length;e++)v=a[e],An(v[0],v[1],o,d+1,y);return}}if(v==="Promise"){if(a.status==="fulfilled"){if(v=o.length,An(e,a.value,o,d,y),o.length>v){o=o[v],o[1]="Promise<"+(o[1]||"Object")+">";return}}else if(a.status==="rejected"&&(v=o.length,An(e,a.reason,o,d,y),o.length>v)){o=o[v],o[1]="Rejected Promise<"+o[1]+">";return}o.push([" ".repeat(d)+e,"Promise"]);return}v==="Object"&&(q=Object.getPrototypeOf(a))&&typeof q.constructor=="function"&&(v=q.constructor.name),o.push([y+" ".repeat(d)+e,v==="Object"?3>d?"":"…":v]),3>d&&ea(a,o,d+1,y);return}case"function":a=a.name===""?"() => {}":a.name+"() {}";break;case"string":a=a==="This object has been omitted by React in the console log to avoid sending too much data from the server. Try logging smaller or more specific objects."?"…":JSON.stringify(a);break;case"undefined":a="undefined";break;case"boolean":a=a?"true":"false";break;default:a=String(a)}o.push([y+" ".repeat(d)+e,a])}function Ba(e,a,o,d){var y=!0;for(C in e)C in a||(o.push(["– "+" ".repeat(d)+C,"…"]),y=!1);for(var v in a)if(v in e){var C=e[v],M=a[v];if(C!==M){if(d===0&&v==="children")y=" ".repeat(d)+v,o.push(["– "+y,"…"],["+ "+y,"…"]);else{if(!(3<=d)){if(typeof C=="object"&&typeof M=="object"&&C!==null&&M!==null&&C.$$typeof===M.$$typeof)if(M.$$typeof===Rl){if(C.type===M.type&&C.key===M.key){C=et(M.type)||"…",y=" ".repeat(d)+v,C="<"+C+" … />",o.push(["– "+y,C],["+ "+y,C]),y=!1;continue}}else{var B=Object.prototype.toString.call(C),q=Object.prototype.toString.call(M);if(B===q&&(q==="[object Object]"||q==="[object Array]")){B=[" "+" ".repeat(d)+v,q==="[object Array]"?"Array":""],o.push(B),q=o.length,Ba(C,M,o,d+1)?q===o.length&&(B[1]="Referentially unequal but deeply equal objects. Consider memoization."):y=!1;continue}}else if(typeof C=="function"&&typeof M=="function"&&C.name===M.name&&C.length===M.length&&(B=Function.prototype.toString.call(C),q=Function.prototype.toString.call(M),B===q)){C=M.name===""?"() => {}":M.name+"() {}",o.push([" "+" ".repeat(d)+v,C+" Referentially unequal function closure. Consider memoization."]);continue}}An(v,C,o,d,"– "),An(v,M,o,d,"+ ")}y=!1}}else o.push(["+ "+" ".repeat(d)+v,"…"]),y=!1;return y}function pn(e){me=e&63?"Blocking":e&64?"Gesture":e&4194176?"Transition":e&62914560?"Suspense":e&2080374784?"Idle":"Other"}function ha(e,a,o,d){en&&(Ku.start=a,Ku.end=o,To.color="warning",To.tooltipText=d,To.properties=null,(e=e._debugTask)?e.run(performance.measure.bind(performance,d,Ku)):performance.measure(d,Ku))}function Ji(e,a,o){ha(e,a,o,"Reconnect")}function di(e,a,o,d,y){var v=nt(e);if(v!==null&&en){var C=e.alternate,M=e.actualDuration;if(C===null||C.child!==e.child)for(var B=e.child;B!==null;B=B.sibling)M-=B.actualDuration;d=.5>M?d?"tertiary-light":"primary-light":10>M?d?"tertiary":"primary":100>M?d?"tertiary-dark":"primary-dark":"error";var q=e.memoizedProps;M=e._debugTask,q!==null&&C!==null&&C.memoizedProps!==q?(B=[ej],q=Ba(C.memoizedProps,q,B,0),1<B.length&&(q&&!Xu&&(C.lanes&y)===0&&100<e.actualDuration?(Xu=!0,B[0]=nj,To.color="warning",To.tooltipText="This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner."):(To.color=d,To.tooltipText=v),To.properties=B,Ku.start=a,Ku.end=o,M!=null?M.run(performance.measure.bind(performance,""+v,Ku)):performance.measure(""+v,Ku))):M!=null?M.run(console.timeStamp.bind(console,v,a,o,"Components ⚛",void 0,d)):console.timeStamp(v,a,o,"Components ⚛",void 0,d)}}function Fi(e,a,o,d){if(en){var y=nt(e);if(y!==null){for(var v=null,C=[],M=0;M<d.length;M++){var B=d[M];v==null&&B.source!==null&&(v=B.source._debugTask),B=B.value,C.push(["Error",typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B)])}e.key!==null&&An("key",e.key,C,0,""),e.memoizedProps!==null&&ea(e.memoizedProps,C,0,""),v==null&&(v=e._debugTask),e={start:a,end:o,detail:{devtools:{color:"error",track:"Components ⚛",tooltipText:e.tag===13?"Hydration failed":"Error boundary caught an error",properties:C}}},v?v.run(performance.measure.bind(performance,""+y,e)):performance.measure(""+y,e)}}}function Mn(e,a,o,d,y){if(y!==null){if(en){var v=nt(e);if(v!==null){d=[];for(var C=0;C<y.length;C++){var M=y[C].value;d.push(["Error",typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M)])}e.key!==null&&An("key",e.key,d,0,""),e.memoizedProps!==null&&ea(e.memoizedProps,d,0,""),a={start:a,end:o,detail:{devtools:{color:"error",track:"Components ⚛",tooltipText:"A lifecycle or effect errored",properties:d}}},(e=e._debugTask)?e.run(performance.measure.bind(performance,""+v,a)):performance.measure(""+v,a)}}}else v=nt(e),v!==null&&en&&(y=1>d?"secondary-light":100>d?"secondary":500>d?"secondary-dark":"error",(e=e._debugTask)?e.run(console.timeStamp.bind(console,v,a,o,"Components ⚛",void 0,y)):console.timeStamp(v,a,o,"Components ⚛",void 0,y))}function rn(e,a,o,d){if(en&&!(a<=e)){var y=(o&738197653)===o?"tertiary-dark":"primary-dark";o=(o&536870912)===o?"Prepared":(o&201326741)===o?"Hydrated":"Render",d?d.run(console.timeStamp.bind(console,o,e,a,me,"Scheduler ⚛",y)):console.timeStamp(o,e,a,me,"Scheduler ⚛",y)}}function Mi(e,a,o,d){!en||a<=e||(o=(o&738197653)===o?"tertiary-dark":"primary-dark",d?d.run(console.timeStamp.bind(console,"Prewarm",e,a,me,"Scheduler ⚛",o)):console.timeStamp("Prewarm",e,a,me,"Scheduler ⚛",o))}function Ut(e,a,o,d){!en||a<=e||(o=(o&738197653)===o?"tertiary-dark":"primary-dark",d?d.run(console.timeStamp.bind(console,"Suspended",e,a,me,"Scheduler ⚛",o)):console.timeStamp("Suspended",e,a,me,"Scheduler ⚛",o))}function Ae(e,a,o,d,y,v){if(en&&!(a<=e)){o=[];for(var C=0;C<d.length;C++){var M=d[C].value;o.push(["Recoverable Error",typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M)])}e={start:e,end:a,detail:{devtools:{color:"primary-dark",track:me,trackGroup:"Scheduler ⚛",tooltipText:y?"Hydration Failed":"Recovered after Error",properties:o}}},v?v.run(performance.measure.bind(performance,"Recovered",e)):performance.measure("Recovered",e)}}function jn(e,a,o,d){!en||a<=e||(d?d.run(console.timeStamp.bind(console,"Errored",e,a,me,"Scheduler ⚛","error")):console.timeStamp("Errored",e,a,me,"Scheduler ⚛","error"))}function Va(e,a,o,d){!en||a<=e||(d?d.run(console.timeStamp.bind(console,o,e,a,me,"Scheduler ⚛","secondary-light")):console.timeStamp(o,e,a,me,"Scheduler ⚛","secondary-light"))}function ke(e,a,o,d,y){if(en&&!(a<=e)){for(var v=[],C=0;C<o.length;C++){var M=o[C].value;v.push(["Error",typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M)])}e={start:e,end:a,detail:{devtools:{color:"error",track:me,trackGroup:"Scheduler ⚛",tooltipText:d?"Remaining Effects Errored":"Commit Errored",properties:v}}},y?y.run(performance.measure.bind(performance,"Errored",e)):performance.measure("Errored",e)}}function mn(){}function eu(){if(Km===0){B9=console.log,V9=console.info,G9=console.warn,j9=console.error,L9=console.group,P9=console.groupCollapsed,Y9=console.groupEnd;var e={configurable:!0,enumerable:!0,value:mn,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Km++}function Lr(){if(Km--,Km===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Me({},e,{value:B9}),info:Me({},e,{value:V9}),warn:Me({},e,{value:G9}),error:Me({},e,{value:j9}),group:Me({},e,{value:L9}),groupCollapsed:Me({},e,{value:P9}),groupEnd:Me({},e,{value:Y9})})}0>Km&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function nu(e){var a=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=a,e.startsWith(`Error: react-stack-top-frame
|
|
26
|
+
`)+l.join(" > ")}return null},ne.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 27:case 5:return hf(l.child.stateNode);default:return l.child.stateNode}},ne.injectIntoDevTools=function(){var l={bundleType:0,version:Pg,rendererPackageName:Sm,currentDispatcherRef:Gt,reconcilerVersion:"19.2.0"};if(bm!==null&&(l.rendererConfig=bm),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var r=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(r.isDisabled||!r.supportsFiber)l=!0;else{try{po=r.inject(l),Rn=r}catch{}l=!!r.checkDCE}}return l},ne.isAlreadyRendering=function(){return(re&6)!==0},ne.observeVisibleRects=function(l,r,h,g){if(!ro)throw Error(u(363));l=tf(l,r);var E=oo(l,h,g).disconnect;return{disconnect:function(){E()}}},ne.shouldError=function(){return null},ne.shouldSuspend=function(){return!1},ne.startHostTransition=function(l,r,h,g){if(l.tag!==5)throw Error(u(476));var E=P0(l).queue;L0(l,E,r,qa,h===null?s:function(){var T=P0(l);return T.next===null&&(T=l.alternate.memoizedState),tr(l,T.next.queue,{},ai()),h(g)})},ne.updateContainer=function(l,r,h,g){var E=r.current,T=ai();return Sd(E,T,l,r,h,g),T},ne.updateContainerSync=function(l,r,h,g){return Sd(r.current,2,l,r,h,g),2},ne},n.exports.default=n.exports,Object.defineProperty(n.exports,"__esModule",{value:!0})})(K2)),K2.exports}var F2={exports:{}};var g4;function K_(){return g4||(g4=1,(function(n){process.env.NODE_ENV!=="production"&&(n.exports=function(t){function i(e,a){for(e=e.memoizedState;e!==null&&0<a;)e=e.next,a--;return e}function s(e,a,o,d){if(o>=a.length)return d;var y=a[o],v=Pn(e)?e.slice():Me({},e);return v[y]=s(e[y],a,o+1,d),v}function u(e,a,o){if(a.length!==o.length)console.warn("copyWithRename() expects paths of the same length");else{for(var d=0;d<o.length-1;d++)if(a[d]!==o[d]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return c(e,a,o,0)}}function c(e,a,o,d){var y=a[d],v=Pn(e)?e.slice():Me({},e);return d+1===a.length?(v[o[d]]=v[y],Pn(v)?v.splice(y,1):delete v[y]):v[y]=c(e[y],a,o,d+1),v}function f(e,a,o){var d=a[o],y=Pn(e)?e.slice():Me({},e);return o+1===a.length?(Pn(y)?y.splice(d,1):delete y[d],y):(y[d]=f(e[d],a,o+1),y)}function p(){return!1}function m(){return null}function S(e,a,o,d){return new d3(e,a,o,d)}function b(e,a){e.context===tn&&(Ny(a,e,null,null),yf())}function _(e,a){if(il!==null){var o=a.staleFamilies;a=a.updatedFamilies,Au(),Ay(e.current,a,o),yf()}}function x(e){il=e}function D(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function A(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function N(){}function R(){}function O(e){var a=[];return e.forEach(function(o){a.push(o)}),a.sort().join(", ")}function U(e){var a=e,o=e;if(e.alternate)for(;a.return;)a=a.return;else{e=a;do a=e,(a.flags&4098)!==0&&(o=a.return),e=a.return;while(e)}return a.tag===3?o:null}function j(e){if(U(e)!==e)throw Error("Unable to find node on an unmounted component.")}function V(e){var a=e.alternate;if(!a){if(a=U(e),a===null)throw Error("Unable to find node on an unmounted component.");return a!==e?null:e}for(var o=e,d=a;;){var y=o.return;if(y===null)break;var v=y.alternate;if(v===null){if(d=y.return,d!==null){o=d;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===o)return j(y),e;if(v===d)return j(y),a;v=v.sibling}throw Error("Unable to find node on an unmounted component.")}if(o.return!==d.return)o=y,d=v;else{for(var C=!1,M=y.child;M;){if(M===o){C=!0,o=y,d=v;break}if(M===d){C=!0,d=y,o=v;break}M=M.sibling}if(!C){for(M=v.child;M;){if(M===o){C=!0,o=v,d=y;break}if(M===d){C=!0,d=v,o=y;break}M=M.sibling}if(!C)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(o.alternate!==d)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(o.tag!==3)throw Error("Unable to find node on an unmounted component.");return o.stateNode.current===o?e:a}function J(e){return e=V(e),e!==null?$(e):null}function $(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e;for(e=e.child;e!==null;){if(a=$(e),a!==null)return a;e=e.sibling}return null}function st(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e;for(e=e.child;e!==null;){if(e.tag!==4&&(a=st(e),a!==null))return a;e=e.sibling}return null}function I(e){return e===null||typeof e!="object"?null:(e=mo&&e[mo]||e["@@iterator"],typeof e=="function"?e:null)}function et(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Hu?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ru:return"Fragment";case wm:return"Profiler";case Gd:return"StrictMode";case jd:return"Suspense";case Um:return"SuspenseList";case Cf:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case zl:return"Portal";case Rn:return e.displayName||"Context";case po:return(e._context.displayName||"Context")+".Consumer";case Sa:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case zu:return a=e.displayName||null,a!==null?a:et(e.type)||"Memo";case li:a=e._payload,e=e._init;try{return et(e(a))}catch{}}return null}function nt(e){var a=e.type;switch(e.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(a._context.displayName||"Context")+".Consumer";case 10:return a.displayName||"Context";case 18:return"DehydratedFragment";case 11:return e=a.render,e=e.displayName||e.name||"",a.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return et(a);case 8:return a===Gd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;break;case 29:if(a=e._debugInfo,a!=null){for(var o=a.length-1;0<=o;o--)if(typeof a[o].name=="string")return a[o].name}if(e.return!==null)return nt(e.return)}return null}function bt(e){return{current:e}}function rt(e,a){0>Yt?console.error("Unexpected pop."):(a!==Rt[Yt]&&console.error("Unexpected Fiber popped."),e.current=xt[Yt],xt[Yt]=null,Rt[Yt]=null,Yt--)}function dt(e,a,o){Yt++,xt[Yt]=e.current,Rt[Yt]=o,e.current=a}function pt(e){return e>>>=0,e===0?32:31-(Eo(e)/it|0)|0}function tt(e){var a=e&42;if(a!==0)return a;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),e}}function w(e,a,o){var d=e.pendingLanes;if(d===0)return 0;var y=0,v=e.suspendedLanes,C=e.pingedLanes;e=e.warmLanes;var M=d&134217727;return M!==0?(d=M&~v,d!==0?y=tt(d):(C&=M,C!==0?y=tt(C):o||(o=M&~e,o!==0&&(y=tt(o))))):(M=d&~v,M!==0?y=tt(M):C!==0?y=tt(C):o||(o=d&~e,o!==0&&(y=tt(o)))),y===0?0:a!==0&&a!==y&&(a&v)===0&&(v=y&-y,o=a&-a,v>=o||v===32&&(o&4194048)!==0)?a:y}function F(e,a){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&a)===0}function K(e,a){switch(e){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function at(){var e=_t;return _t<<=1,(_t&62914560)===0&&(_t=4194304),e}function St(e){for(var a=[],o=0;31>o;o++)a.push(e);return a}function W(e,a){e.pendingLanes|=a,a!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(e,a,o,d,y,v){var C=e.pendingLanes;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=o,e.entangledLanes&=o,e.errorRecoveryDisabledLanes&=o,e.shellSuspendCounter=0;var M=e.entanglements,B=e.expirationTimes,q=e.hiddenUpdates;for(o=C&~o;0<o;){var ct=31-kn(o),ht=1<<ct;M[ct]=0,B[ct]=-1;var yt=q[ct];if(yt!==null)for(q[ct]=null,ct=0;ct<yt.length;ct++){var Vt=yt[ct];Vt!==null&&(Vt.lane&=-536870913)}o&=~ht}d!==0&&Tt(e,d,0),v!==0&&y===0&&e.tag!==0&&(e.suspendedLanes|=v&~(C&~a))}function Tt(e,a,o){e.pendingLanes|=a,e.suspendedLanes&=~a;var d=31-kn(a);e.entangledLanes|=a,e.entanglements[d]=e.entanglements[d]|1073741824|o&261930}function Pt(e,a){var o=e.entangledLanes|=a;for(e=e.entanglements;o;){var d=31-kn(o),y=1<<d;y&a|e[d]&a&&(e[d]|=a),o&=~y}}function le(e,a){var o=a&-a;return o=(o&42)!==0?1:xn(o),(o&(e.suspendedLanes|a))!==0?0:o}function xn(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function xe(e,a,o){if(Tr)for(e=e.pendingUpdatersLaneMap;0<o;){var d=31-kn(o),y=1<<d;e[d].add(a),o&=~y}}function Dn(e,a){if(Tr)for(var o=e.pendingUpdatersLaneMap,d=e.memoizedUpdaters;0<a;){var y=31-kn(a);e=1<<y,y=o[y],0<y.size&&(y.forEach(function(v){var C=v.alternate;C!==null&&d.has(C)||d.add(v)}),y.clear()),a&=~e}}function ln(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Be(e){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled)return!0;if(!a.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{op=a.inject(e),ci=a}catch(o){console.error("React instrumentation encountered an error: %o.",o)}return!!a.checkDCE}function At(e){if(typeof IG=="function"&&WG(e),ci&&typeof ci.setStrictMode=="function")try{ci.setStrictMode(op,e)}catch(a){Er||(Er=!0,console.error("React instrumentation encountered an error: %o",a))}}function ue(e,a){return e===a&&(e!==0||1/e===1/a)||e!==e&&a!==a}function ta(e){for(var a=0,o=0;o<e.length;o++){var d=e[o];if(typeof d=="object"&&d!==null)if(Pn(d)&&d.length===2&&typeof d[0]=="string"){if(a!==0&&a!==3)return 1;a=3}else return 1;else{if(typeof d=="function"||typeof d=="string"&&50<d.length||a!==0&&a!==2)return 1;a=2}}return a}function ea(e,a,o,d){for(var y in e)S3.call(e,y)&&y[0]!=="_"&&An(y,e[y],a,o,d)}function An(e,a,o,d,y){switch(typeof a){case"object":if(a===null){a="null";break}else{if(a.$$typeof===Rl){var v=et(a.type)||"…",C=a.key;a=a.props;var M=Object.keys(a),B=M.length;if(C==null&&B===0){a="<"+v+" />";break}if(3>d||B===1&&M[0]==="children"&&C==null){a="<"+v+" … />";break}o.push([y+" ".repeat(d)+e,"<"+v]),C!==null&&An("key",C,o,d+1,y),e=!1;for(var q in a)q==="children"?a.children!=null&&(!Pn(a.children)||0<a.children.length)&&(e=!0):S3.call(a,q)&&q[0]!=="_"&&An(q,a[q],o,d+1,y);o.push(["",e?">…</"+v+">":"/>"]);return}if(v=Object.prototype.toString.call(a),v=v.slice(8,v.length-1),v==="Array"){if(q=ta(a),q===2||q===0){a=JSON.stringify(a);break}else if(q===3){for(o.push([y+" ".repeat(d)+e,""]),e=0;e<a.length;e++)v=a[e],An(v[0],v[1],o,d+1,y);return}}if(v==="Promise"){if(a.status==="fulfilled"){if(v=o.length,An(e,a.value,o,d,y),o.length>v){o=o[v],o[1]="Promise<"+(o[1]||"Object")+">";return}}else if(a.status==="rejected"&&(v=o.length,An(e,a.reason,o,d,y),o.length>v)){o=o[v],o[1]="Rejected Promise<"+o[1]+">";return}o.push([" ".repeat(d)+e,"Promise"]);return}v==="Object"&&(q=Object.getPrototypeOf(a))&&typeof q.constructor=="function"&&(v=q.constructor.name),o.push([y+" ".repeat(d)+e,v==="Object"?3>d?"":"…":v]),3>d&&ea(a,o,d+1,y);return}case"function":a=a.name===""?"() => {}":a.name+"() {}";break;case"string":a=a==="This object has been omitted by React in the console log to avoid sending too much data from the server. Try logging smaller or more specific objects."?"…":JSON.stringify(a);break;case"undefined":a="undefined";break;case"boolean":a=a?"true":"false";break;default:a=String(a)}o.push([y+" ".repeat(d)+e,a])}function Ba(e,a,o,d){var y=!0;for(C in e)C in a||(o.push(["– "+" ".repeat(d)+C,"…"]),y=!1);for(var v in a)if(v in e){var C=e[v],M=a[v];if(C!==M){if(d===0&&v==="children")y=" ".repeat(d)+v,o.push(["– "+y,"…"],["+ "+y,"…"]);else{if(!(3<=d)){if(typeof C=="object"&&typeof M=="object"&&C!==null&&M!==null&&C.$$typeof===M.$$typeof)if(M.$$typeof===Rl){if(C.type===M.type&&C.key===M.key){C=et(M.type)||"…",y=" ".repeat(d)+v,C="<"+C+" … />",o.push(["– "+y,C],["+ "+y,C]),y=!1;continue}}else{var B=Object.prototype.toString.call(C),q=Object.prototype.toString.call(M);if(B===q&&(q==="[object Object]"||q==="[object Array]")){B=[" "+" ".repeat(d)+v,q==="[object Array]"?"Array":""],o.push(B),q=o.length,Ba(C,M,o,d+1)?q===o.length&&(B[1]="Referentially unequal but deeply equal objects. Consider memoization."):y=!1;continue}}else if(typeof C=="function"&&typeof M=="function"&&C.name===M.name&&C.length===M.length&&(B=Function.prototype.toString.call(C),q=Function.prototype.toString.call(M),B===q)){C=M.name===""?"() => {}":M.name+"() {}",o.push([" "+" ".repeat(d)+v,C+" Referentially unequal function closure. Consider memoization."]);continue}}An(v,C,o,d,"– "),An(v,M,o,d,"+ ")}y=!1}}else o.push(["+ "+" ".repeat(d)+v,"…"]),y=!1;return y}function pn(e){me=e&63?"Blocking":e&64?"Gesture":e&4194176?"Transition":e&62914560?"Suspense":e&2080374784?"Idle":"Other"}function ha(e,a,o,d){en&&(Ku.start=a,Ku.end=o,To.color="warning",To.tooltipText=d,To.properties=null,(e=e._debugTask)?e.run(performance.measure.bind(performance,d,Ku)):performance.measure(d,Ku))}function Ji(e,a,o){ha(e,a,o,"Reconnect")}function di(e,a,o,d,y){var v=nt(e);if(v!==null&&en){var C=e.alternate,M=e.actualDuration;if(C===null||C.child!==e.child)for(var B=e.child;B!==null;B=B.sibling)M-=B.actualDuration;d=.5>M?d?"tertiary-light":"primary-light":10>M?d?"tertiary":"primary":100>M?d?"tertiary-dark":"primary-dark":"error";var q=e.memoizedProps;M=e._debugTask,q!==null&&C!==null&&C.memoizedProps!==q?(B=[ej],q=Ba(C.memoizedProps,q,B,0),1<B.length&&(q&&!Xu&&(C.lanes&y)===0&&100<e.actualDuration?(Xu=!0,B[0]=nj,To.color="warning",To.tooltipText="This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner."):(To.color=d,To.tooltipText=v),To.properties=B,Ku.start=a,Ku.end=o,M!=null?M.run(performance.measure.bind(performance,""+v,Ku)):performance.measure(""+v,Ku))):M!=null?M.run(console.timeStamp.bind(console,v,a,o,"Components ⚛",void 0,d)):console.timeStamp(v,a,o,"Components ⚛",void 0,d)}}function Fi(e,a,o,d){if(en){var y=nt(e);if(y!==null){for(var v=null,C=[],M=0;M<d.length;M++){var B=d[M];v==null&&B.source!==null&&(v=B.source._debugTask),B=B.value,C.push(["Error",typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B)])}e.key!==null&&An("key",e.key,C,0,""),e.memoizedProps!==null&&ea(e.memoizedProps,C,0,""),v==null&&(v=e._debugTask),e={start:a,end:o,detail:{devtools:{color:"error",track:"Components ⚛",tooltipText:e.tag===13?"Hydration failed":"Error boundary caught an error",properties:C}}},v?v.run(performance.measure.bind(performance,""+y,e)):performance.measure(""+y,e)}}}function Mn(e,a,o,d,y){if(y!==null){if(en){var v=nt(e);if(v!==null){d=[];for(var C=0;C<y.length;C++){var M=y[C].value;d.push(["Error",typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M)])}e.key!==null&&An("key",e.key,d,0,""),e.memoizedProps!==null&&ea(e.memoizedProps,d,0,""),a={start:a,end:o,detail:{devtools:{color:"error",track:"Components ⚛",tooltipText:"A lifecycle or effect errored",properties:d}}},(e=e._debugTask)?e.run(performance.measure.bind(performance,""+v,a)):performance.measure(""+v,a)}}}else v=nt(e),v!==null&&en&&(y=1>d?"secondary-light":100>d?"secondary":500>d?"secondary-dark":"error",(e=e._debugTask)?e.run(console.timeStamp.bind(console,v,a,o,"Components ⚛",void 0,y)):console.timeStamp(v,a,o,"Components ⚛",void 0,y))}function rn(e,a,o,d){if(en&&!(a<=e)){var y=(o&738197653)===o?"tertiary-dark":"primary-dark";o=(o&536870912)===o?"Prepared":(o&201326741)===o?"Hydrated":"Render",d?d.run(console.timeStamp.bind(console,o,e,a,me,"Scheduler ⚛",y)):console.timeStamp(o,e,a,me,"Scheduler ⚛",y)}}function Mi(e,a,o,d){!en||a<=e||(o=(o&738197653)===o?"tertiary-dark":"primary-dark",d?d.run(console.timeStamp.bind(console,"Prewarm",e,a,me,"Scheduler ⚛",o)):console.timeStamp("Prewarm",e,a,me,"Scheduler ⚛",o))}function Ut(e,a,o,d){!en||a<=e||(o=(o&738197653)===o?"tertiary-dark":"primary-dark",d?d.run(console.timeStamp.bind(console,"Suspended",e,a,me,"Scheduler ⚛",o)):console.timeStamp("Suspended",e,a,me,"Scheduler ⚛",o))}function Ae(e,a,o,d,y,v){if(en&&!(a<=e)){o=[];for(var C=0;C<d.length;C++){var M=d[C].value;o.push(["Recoverable Error",typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M)])}e={start:e,end:a,detail:{devtools:{color:"primary-dark",track:me,trackGroup:"Scheduler ⚛",tooltipText:y?"Hydration Failed":"Recovered after Error",properties:o}}},v?v.run(performance.measure.bind(performance,"Recovered",e)):performance.measure("Recovered",e)}}function jn(e,a,o,d){!en||a<=e||(d?d.run(console.timeStamp.bind(console,"Errored",e,a,me,"Scheduler ⚛","error")):console.timeStamp("Errored",e,a,me,"Scheduler ⚛","error"))}function Va(e,a,o,d){!en||a<=e||(d?d.run(console.timeStamp.bind(console,o,e,a,me,"Scheduler ⚛","secondary-light")):console.timeStamp(o,e,a,me,"Scheduler ⚛","secondary-light"))}function ke(e,a,o,d,y){if(en&&!(a<=e)){for(var v=[],C=0;C<o.length;C++){var M=o[C].value;v.push(["Error",typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M)])}e={start:e,end:a,detail:{devtools:{color:"error",track:me,trackGroup:"Scheduler ⚛",tooltipText:d?"Remaining Effects Errored":"Commit Errored",properties:v}}},y?y.run(performance.measure.bind(performance,"Errored",e)):performance.measure("Errored",e)}}function mn(){}function eu(){if(Km===0){B9=console.log,V9=console.info,G9=console.warn,j9=console.error,L9=console.group,P9=console.groupCollapsed,Y9=console.groupEnd;var e={configurable:!0,enumerable:!0,value:mn,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Km++}function Lr(){if(Km--,Km===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Me({},e,{value:B9}),info:Me({},e,{value:V9}),warn:Me({},e,{value:G9}),error:Me({},e,{value:j9}),group:Me({},e,{value:L9}),groupCollapsed:Me({},e,{value:P9}),groupEnd:Me({},e,{value:Y9})})}0>Km&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function nu(e){var a=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=a,e.startsWith(`Error: react-stack-top-frame
|
|
27
27
|
`)&&(e=e.slice(29)),a=e.indexOf(`
|
|
28
28
|
`),a!==-1&&(e=e.slice(a+1)),a=e.indexOf("react_stack_bottom_frame"),a!==-1&&(a=e.lastIndexOf(`
|
|
29
29
|
`,a)),a!==-1)e=e.slice(0,a);else return"";return e}function da(e){if(b3===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);b3=a&&a[1]||"",q9=-1<o.stack.indexOf(`
|
|
@@ -136,7 +136,7 @@ It looks like you wrote `+v+`(async () => ...) or returned a Promise. Instead, w
|
|
|
136
136
|
fetchData();
|
|
137
137
|
}, [someId]); // Or [] if effect doesn't need props or state
|
|
138
138
|
|
|
139
|
-
Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`:" You returned: "+d,Bt(a,function(M,B){console.error("%s must not return anything besides a function, which is used for clean-up.%s",M,B)},v,C)}o=o.next}while(o!==y)}}catch(M){Ee(a,a.return,M)}}function Gt(e,a,o){try{var d=a.updateQueue,y=d!==null?d.lastEffect:null;if(y!==null){var v=y.next;d=v;do{if((d.tag&e)===e){var C=d.inst,M=C.destroy;M!==void 0&&(C.destroy=void 0,(e&_i)!==Wy&&(Op=!0),y=a,Bt(y,oj,y,o,M),(e&_i)!==Wy&&(Op=!1))}d=d.next}while(d!==v)}}catch(B){Ee(a,a.return,B)}}function Pg(e,a){Gs(e)?(as(),cr(a,e),ns()):cr(a,e)}function Sm(e,a,o){Gs(e)?(as(),Gt(o,e,a),ns()):Gt(o,e,a)}function bm(e){var a=e.updateQueue;if(a!==null){var o=e.stateNode;e.type.defaultProps||"ref"in e.memoizedProps||_p||(o.props!==e.memoizedProps&&console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",nt(e)||"instance"),o.state!==e.memoizedState&&console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",nt(e)||"instance"));try{Bt(e,Z0,a,o)}catch(d){Ee(e,e.return,d)}}}function hf(e,a,o){return e.getSnapshotBeforeUpdate(a,o)}function n3(e,a){var o=a.memoizedProps,d=a.memoizedState;a=e.stateNode,e.type.defaultProps||"ref"in e.memoizedProps||_p||(a.props!==e.memoizedProps&&console.error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",nt(e)||"instance"),a.state!==e.memoizedState&&console.error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",nt(e)||"instance"));try{var y=Bs(e.type,o),v=Bt(e,hf,a,y,d);o=LE,v!==void 0||o.has(e.type)||(o.add(e.type),Bt(e,function(){console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",nt(e))})),a.__reactInternalSnapshotBeforeUpdate=v}catch(C){Ee(e,e.return,C)}}function Yg(e,a,o){o.props=Bs(e.type,e.memoizedProps),o.state=e.memoizedState,Gs(e)?(as(),Bt(e,sE,e,a,o),ns()):Bt(e,sE,e,a,o)}function a3(e){var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var o=Xa(e.stateNode);break;case 30:o=e.stateNode;break;default:o=e.stateNode}if(typeof a=="function")if(Gs(e))try{as(),e.refCleanup=a(o)}finally{ns()}else e.refCleanup=a(o);else typeof a=="string"?console.error("String refs are no longer supported."):a.hasOwnProperty("current")||console.error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",nt(e)),a.current=o}}function df(e,a){try{Bt(e,a3,e)}catch(o){Ee(e,a,o)}}function js(e,a){var o=e.ref,d=e.refCleanup;if(o!==null)if(typeof d=="function")try{if(Gs(e))try{as(),Bt(e,d)}finally{ns(e)}else Bt(e,d)}catch(y){Ee(e,a,y)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof o=="function")try{if(Gs(e))try{as(),Bt(e,o,null)}finally{ns(e)}else Bt(e,o,null)}catch(y){Ee(e,a,y)}else o.current=null}function Cd(e,a,o,d){var y=e.memoizedProps,v=y.id,C=y.onCommit;y=y.onRender,a=a===null?"mount":"update",Xy&&(a="nested-update"),typeof y=="function"&&y(v,a,e.actualDuration,e.treeBaseDuration,e.actualStartTime,o),typeof C=="function"&&C(v,a,d,o)}function qg(e,a,o,d){var y=e.memoizedProps;e=y.id,y=y.onPostCommit,a=a===null?"mount":"update",Xy&&(a="nested-update"),typeof y=="function"&&y(e,a,d,o)}function pf(e){var a=e.type,o=e.memoizedProps,d=e.stateNode;try{Bt(e,Ge,d,a,o,e)}catch(y){Ee(e,e.return,y)}}function _d(e,a,o){try{Bt(e,Yn,e.stateNode,e.type,o,a,e)}catch(d){Ee(e,e.return,d)}}function Xg(e){return e.tag===5||e.tag===3||(we?e.tag===26:!1)||(T?e.tag===27&&Mt(e.type):!1)||e.tag===4}function Em(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||Xg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(T&&e.tag===27&&Mt(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ml(e,a,o){var d=e.tag;if(d===5||d===6)e=e.stateNode,a?Gu(o,e,a):Ul(o,e);else if(d!==4&&(T&&d===27&&Mt(e.type)&&(o=e.stateNode,a=null),e=e.child,e!==null))for(Ml(e,a,o),e=e.sibling;e!==null;)Ml(e,a,o),e=e.sibling}function Hi(e,a,o){var d=e.tag;if(d===5||d===6)e=e.stateNode,a?Qd(o,e,a):Hn(o,e);else if(d!==4&&(T&&d===27&&Mt(e.type)&&(o=e.stateNode),e=e.child,e!==null))for(Hi(e,a,o),e=e.sibling;e!==null;)Hi(e,a,o),e=e.sibling}function Aa(e){for(var a,o=e.return;o!==null;){if(Xg(o)){a=o;break}o=o.return}if($e){if(a==null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");switch(a.tag){case 27:if(T){a=a.stateNode,o=Em(e),Hi(e,o,a);break}case 5:o=a.stateNode,a.flags&32&&(ju(o),a.flags&=-33),a=Em(e),Hi(e,a,o);break;case 3:case 4:a=a.stateNode.containerInfo,o=Em(e),Ml(e,o,a);break;default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}}function us(e,a,o){e=e.containerInfo;try{Bt(a,kd,e,o)}catch(d){Ee(a,a.return,d)}}function ya(e){var a=e.stateNode,o=e.memoizedProps;try{Bt(e,L,e.type,o,a,e)}catch(d){Ee(e,e.return,d)}}function Kg(e,a){return a.tag===31?(a=a.memoizedState,e.memoizedState!==null&&a===null):a.tag===13?(e=e.memoizedState,a=a.memoizedState,e!==null&&e.dehydrated!==null&&(a===null||a.dehydrated===null)):a.tag===3?e.memoizedState.isDehydrated&&(a.flags&256)===0:!1}function i3(e,a){for(_f(e.containerInfo),Oa=a;Oa!==null;)if(e=Oa,a=e.child,(e.subtreeFlags&1028)!==0&&a!==null)a.return=e,Oa=a;else for(;Oa!==null;){a=e=Oa;var o=a.alternate,d=a.flags;switch(a.tag){case 0:if((d&4)!==0&&(a=a.updateQueue,a=a!==null?a.events:null,a!==null))for(o=0;o<a.length;o++)d=a[o],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:(d&1024)!==0&&o!==null&&n3(a,o);break;case 3:(d&1024)!==0&&$e&&Pm(a.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((d&1024)!==0)throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(a=e.sibling,a!==null){a.return=e.return,Oa=a;break}Oa=e.return}}function Jn(e,a,o){var d=Ga(),y=Rs(),v=ts(),C=es(),M=o.flags;switch(o.tag){case 0:case 11:case 15:qa(e,o),M&4&&ym(o,ys|el);break;case 1:if(qa(e,o),M&4)if(e=o.stateNode,a===null)o.type.defaultProps||"ref"in o.memoizedProps||_p||(e.props!==o.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",nt(o)||"instance"),e.state!==o.memoizedState&&console.error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",nt(o)||"instance")),Gs(o)?(as(),Bt(o,B3,o,e),ns()):Bt(o,B3,o,e);else{var B=Bs(o.type,a.memoizedProps);a=a.memoizedState,o.type.defaultProps||"ref"in o.memoizedProps||_p||(e.props!==o.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",nt(o)||"instance"),e.state!==o.memoizedState&&console.error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",nt(o)||"instance")),Gs(o)?(as(),Bt(o,nE,o,e,B,a,e.__reactInternalSnapshotBeforeUpdate),ns()):Bt(o,nE,o,e,B,a,e.__reactInternalSnapshotBeforeUpdate)}M&64&&bm(o),M&512&&df(o,o.return);break;case 3:if(a=Os(),qa(e,o),M&64&&(M=o.updateQueue,M!==null)){if(B=null,o.child!==null)switch(o.child.tag){case 27:case 5:B=Xa(o.child.stateNode);break;case 1:B=o.child.stateNode}try{Bt(o,Z0,M,B)}catch(ct){Ee(o,o.return,ct)}}e.effectDuration+=Rc(a);break;case 27:T&&a===null&&M&4&&ya(o);case 26:case 5:if(qa(e,o),a===null){if(M&4)pf(o);else if(M&64){e=o.type,a=o.memoizedProps,B=o.stateNode;try{Bt(o,Ym,B,e,a,o)}catch(ct){Ee(o,o.return,ct)}}}M&512&&df(o,o.return);break;case 12:if(M&4){M=Os(),qa(e,o),e=o.stateNode,e.effectDuration+=cu(M);try{Bt(o,Cd,o,a,Fu,e.effectDuration)}catch(ct){Ee(o,o.return,ct)}}else qa(e,o);break;case 31:qa(e,o),M&4&&Qg(e,o);break;case 13:qa(e,o),M&4&&Zg(e,o),M&64&&(e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(M=Cy.bind(null,o),Xn(e,M))));break;case 22:if(M=o.memoizedState!==null||wo,!M){a=a!==null&&a.memoizedState!==null||ra,B=wo;var q=ra;wo=M,(ra=a)&&!q?(Ps(e,o,(o.subtreeFlags&8772)!==0),(o.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&Ji(o,Lt,qt)):qa(e,o),wo=B,ra=q}break;case 30:break;default:qa(e,o)}(o.mode&2)!==Kt&&0<=Lt&&0<=qt&&((Bn||.05<Sn)&&Mn(o,Lt,qt,Sn,fn),o.alternate===null&&o.return!==null&&o.return.alternate!==null&&.05<qt-Lt&&(Kg(o.return.alternate,o.return)||ha(o,Lt,qt,"Mount"))),ti(d),$i(y),fn=v,Bn=C}function Ls(e){var a=e.alternate;a!==null&&(e.alternate=null,Ls(a)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(a=e.stateNode,a!==null&&Gm(a)),e.stateNode=null,e._debugOwner=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function cs(e,a,o){for(o=o.child;o!==null;)Tm(e,a,o),o=o.sibling}function Tm(e,a,o){if(ci&&typeof ci.onCommitFiberUnmount=="function")try{ci.onCommitFiberUnmount(op,o)}catch(q){Er||(Er=!0,console.error("React instrumentation encountered an error: %o",q))}var d=Ga(),y=Rs(),v=ts(),C=es();switch(o.tag){case 26:if(we){ra||js(o,a),cs(e,a,o),o.memoizedState?lp(o.memoizedState):o.stateNode&&rp(o.stateNode);break}case 27:if(T){ra||js(o,a);var M=oa,B=Yi;Mt(o.type)&&(oa=o.stateNode,Yi=!1),cs(e,a,o),Bt(o,ft,o.stateNode),oa=M,Yi=B;break}case 5:ra||js(o,a);case 6:if($e){if(M=oa,B=Yi,oa=null,cs(e,a,o),oa=M,Yi=B,oa!==null)if(Yi)try{Bt(o,Zd,oa,o.stateNode)}catch(q){Ee(o,a,q)}else try{Bt(o,vo,oa,o.stateNode)}catch(q){Ee(o,a,q)}}else cs(e,a,o);break;case 18:$e&&oa!==null&&(Yi?Pu(oa,o.stateNode):Ei(oa,o.stateNode));break;case 4:$e?(M=oa,B=Yi,oa=o.stateNode.containerInfo,Yi=!0,cs(e,a,o),oa=M,Yi=B):(Ks&&us(o.stateNode,o,Jd()),cs(e,a,o));break;case 0:case 11:case 14:case 15:Gt(_i,o,a),ra||vm(o,a,ys),cs(e,a,o);break;case 1:ra||(js(o,a),M=o.stateNode,typeof M.componentWillUnmount=="function"&&Yg(o,a,M)),cs(e,a,o);break;case 21:cs(e,a,o);break;case 22:ra=(M=ra)||o.memoizedState!==null,cs(e,a,o),ra=M;break;default:cs(e,a,o)}(o.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(o,Lt,qt,Sn,fn),ti(d),$i(y),fn=v,Bn=C}function Qg(e,a){if(Na&&a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Bt(a,yn,e)}catch(o){Ee(a,a.return,o)}}}function Zg(e,a){if(Na&&a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bt(a,vr,e)}catch(o){Ee(a,a.return,o)}}function s3(e){switch(e.tag){case 31:case 13:case 19:var a=e.stateNode;return a===null&&(a=e.stateNode=new PE),a;case 22:return e=e.stateNode,a=e._retryCache,a===null&&(a=e._retryCache=new PE),a;default:throw Error("Unexpected Suspense handler tag ("+e.tag+"). This is a bug in React.")}}function _u(e,a){var o=s3(e);a.forEach(function(d){if(!o.has(d)){if(o.add(d),Tr)if(xp!==null&&Dp!==null)Mu(Dp,xp);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");var y=h3.bind(null,e,d);d.then(y,y)}})}function va(e,a){var o=a.deletions;if(o!==null)for(var d=0;d<o.length;d++){var y=e,v=a,C=o[d],M=Ga();if($e){var B=v;t:for(;B!==null;){switch(B.tag){case 27:if(T){if(Mt(B.type)){oa=B.stateNode,Yi=!1;break t}break}case 5:oa=B.stateNode,Yi=!1;break t;case 3:case 4:oa=B.stateNode.containerInfo,Yi=!0;break t}B=B.return}if(oa===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");Tm(y,v,C),oa=null,Yi=!1}else Tm(y,v,C);(C.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&ha(C,Lt,qt,"Unmount"),ti(M),y=C,v=y.alternate,v!==null&&(v.return=null),y.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Jg(a,e),a=a.sibling}function Jg(e,a){var o=Ga(),d=Rs(),y=ts(),v=es(),C=e.alternate,M=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:va(a,e),Ma(e),M&4&&(Gt(_i|el,e,e.return),cr(_i|el,e),vm(e,e.return,ys|el));break;case 1:va(a,e),Ma(e),M&512&&(ra||C===null||js(C,C.return)),M&64&&wo&&(M=e.updateQueue,M!==null&&(C=M.callbacks,C!==null&&(a=M.shared.hiddenCallbacks,M.shared.hiddenCallbacks=a===null?C:a.concat(C))));break;case 26:if(we){var B=Pl;va(a,e),Ma(e),M&512&&(ra||C===null||js(C,C.return)),M&4&&(M=C!==null?C.memoizedState:null,a=e.memoizedState,C===null?a===null?e.stateNode===null?e.stateNode=Uy(B,e.type,e.memoizedProps,e):qu(B,e.type,e.stateNode):e.stateNode=sp(B,a,e.memoizedProps):M!==a?(M===null?C.stateNode!==null&&rp(C.stateNode):lp(M),a===null?qu(B,e.type,e.stateNode):sp(B,a,e.memoizedProps)):a===null&&e.stateNode!==null&&_d(e,e.memoizedProps,C.memoizedProps));break}case 27:if(T){va(a,e),Ma(e),M&512&&(ra||C===null||js(C,C.return)),C!==null&&M&4&&_d(e,e.memoizedProps,C.memoizedProps);break}case 5:if(va(a,e),Ma(e),M&512&&(ra||C===null||js(C,C.return)),$e){if(e.flags&32){a=e.stateNode;try{Bt(e,ju,a)}catch(Pe){Ee(e,e.return,Pe)}}M&4&&e.stateNode!=null&&(a=e.memoizedProps,_d(e,a,C!==null?C.memoizedProps:a)),M&1024&&(k3=!0,e.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."))}else Ks&&e.alternate!==null&&(e.alternate.stateNode=e.stateNode);break;case 6:if(va(a,e),Ma(e),M&4&&$e){if(e.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");M=e.memoizedProps,C=C!==null?C.memoizedProps:M,a=e.stateNode;try{Bt(e,kt,a,C,M)}catch(Pe){Ee(e,e.return,Pe)}}break;case 3:if(B=Os(),we){r();var q=Pl;Pl=br(a.containerInfo),va(a,e),Pl=q}else va(a,e);if(Ma(e),M&4){if($e&&Na&&C!==null&&C.memoizedState.isDehydrated)try{Bt(e,Bl,a.containerInfo)}catch(Pe){Ee(e,e.return,Pe)}if(Ks){M=a.containerInfo,C=a.pendingChildren;try{Bt(e,kd,M,C)}catch(Pe){Ee(e,e.return,Pe)}}}k3&&(k3=!1,Fg(e)),a.effectDuration+=Rc(B);break;case 4:we?(C=Pl,Pl=br(e.stateNode.containerInfo),va(a,e),Ma(e),Pl=C):(va(a,e),Ma(e)),M&4&&Ks&&us(e.stateNode,e,e.stateNode.pendingChildren);break;case 12:M=Os(),va(a,e),Ma(e),e.stateNode.effectDuration+=cu(M);break;case 31:va(a,e),Ma(e),M&4&&(M=e.updateQueue,M!==null&&(e.updateQueue=null,_u(e,M)));break;case 13:va(a,e),Ma(e),e.child.flags&8192&&e.memoizedState!==null!=(C!==null&&C.memoizedState!==null)&&(p2=fe()),M&4&&(M=e.updateQueue,M!==null&&(e.updateQueue=null,_u(e,M)));break;case 22:B=e.memoizedState!==null;var ct=C!==null&&C.memoizedState!==null,ht=wo,yt=ra;if(wo=ht||B,ra=yt||ct,va(a,e),ra=yt,wo=ht,ct&&!B&&!ht&&!yt&&(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&Ji(e,Lt,qt),Ma(e),M&8192&&(a=e.stateNode,a._visibility=B?a._visibility&~r1:a._visibility|r1,!B||C===null||ct||wo||ra||(lo(e),(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&ha(e,Lt,qt,"Disconnect")),$e)){t:if(C=null,$e)for(a=e;;){if(a.tag===5||we&&a.tag===26){if(C===null){ct=C=a;try{q=ct.stateNode,B?Bt(ct,Lu,q):Bt(ct,Af,ct.stateNode,ct.memoizedProps)}catch(Pe){Ee(ct,ct.return,Pe)}}}else if(a.tag===6){if(C===null){ct=a;try{var Vt=ct.stateNode;B?Bt(ct,g3,Vt):Bt(ct,Hy,Vt,ct.memoizedProps)}catch(Pe){Ee(ct,ct.return,Pe)}}}else if(a.tag===18){if(C===null){ct=a;try{var Jt=ct.stateNode;B?Bt(ct,Of,Jt):Bt(ct,ui,ct.stateNode)}catch(Pe){Ee(ct,ct.return,Pe)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===e)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break t;for(;a.sibling===null;){if(a.return===null||a.return===e)break t;C===a&&(C=null),a=a.return}C===a&&(C=null),a.sibling.return=a.return,a=a.sibling}}M&4&&(M=e.updateQueue,M!==null&&(C=M.retryQueue,C!==null&&(M.retryQueue=null,_u(e,C))));break;case 19:va(a,e),Ma(e),M&4&&(M=e.updateQueue,M!==null&&(e.updateQueue=null,_u(e,M)));break;case 30:break;case 21:break;default:va(a,e),Ma(e)}(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&((Bn||.05<Sn)&&Mn(e,Lt,qt,Sn,fn),e.alternate===null&&e.return!==null&&e.return.alternate!==null&&.05<qt-Lt&&(Kg(e.return.alternate,e.return)||ha(e,Lt,qt,"Mount"))),ti(o),$i(d),fn=y,Bn=v}function Ma(e){var a=e.flags;if(a&2){try{Bt(e,Aa,e)}catch(o){Ee(e,e.return,o)}e.flags&=-3}a&4096&&(e.flags&=-4097)}function Fg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var a=e;Fg(a),a.tag===5&&a.flags&1024&&Df(a.stateNode),e=e.sibling}}function qa(e,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Jn(e,a.alternate,a),a=a.sibling}function fr(e){var a=Ga(),o=Rs(),d=ts(),y=es();switch(e.tag){case 0:case 11:case 14:case 15:vm(e,e.return,ys),lo(e);break;case 1:js(e,e.return);var v=e.stateNode;typeof v.componentWillUnmount=="function"&&Yg(e,e.return,v),lo(e);break;case 27:T&&Bt(e,ft,e.stateNode);case 26:case 5:js(e,e.return),lo(e);break;case 22:e.memoizedState===null&&lo(e);break;case 30:lo(e);break;default:lo(e)}(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(e,Lt,qt,Sn,fn),ti(a),$i(o),fn=d,Bn=y}function lo(e){for(e=e.child;e!==null;)fr(e),e=e.sibling}function kg(e,a,o,d){var y=Ga(),v=Rs(),C=ts(),M=es(),B=o.flags;switch(o.tag){case 0:case 11:case 15:Ps(e,o,d),ym(o,ys);break;case 1:if(Ps(e,o,d),a=o.stateNode,typeof a.componentDidMount=="function"&&Bt(o,B3,o,a),a=o.updateQueue,a!==null){e=o.stateNode;try{Bt(o,Q0,a,e)}catch(q){Ee(o,o.return,q)}}d&&B&64&&bm(o),df(o,o.return);break;case 27:T&&ya(o);case 26:case 5:Ps(e,o,d),d&&a===null&&B&4&&pf(o),df(o,o.return);break;case 12:if(d&&B&4){B=Os(),Ps(e,o,d),d=o.stateNode,d.effectDuration+=cu(B);try{Bt(o,Cd,o,a,Fu,d.effectDuration)}catch(q){Ee(o,o.return,q)}}else Ps(e,o,d);break;case 31:Ps(e,o,d),d&&B&4&&Qg(e,o);break;case 13:Ps(e,o,d),d&&B&4&&Zg(e,o);break;case 22:o.memoizedState===null&&Ps(e,o,d),df(o,o.return);break;case 30:break;default:Ps(e,o,d)}(o.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(o,Lt,qt,Sn,fn),ti(y),$i(v),fn=C,Bn=M}function Ps(e,a,o){for(o=o&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;)kg(e,a.alternate,a,o),a=a.sibling}function ro(e,a){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(e=a.memoizedState.cachePool.pool),e!==o&&(e!=null&&Sl(e),o!=null&&Ir(o))}function Cm(e,a){e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(Sl(a),e!=null&&Ir(e))}function fs(e,a,o,d,y){if(a.subtreeFlags&10256||a.actualDuration!==0&&(a.alternate===null||a.alternate.child!==a.child))for(a=a.child;a!==null;){var v=a.sibling;Ig(e,a,o,d,v!==null?v.actualStartTime:y),a=v}}function Ig(e,a,o,d,y){var v=Ga(),C=Rs(),M=ts(),B=es(),q=Xu,ct=a.flags;switch(a.tag){case 0:case 11:case 15:(a.mode&2)!==Kt&&0<a.actualStartTime&&(a.flags&1)!==0&&di(a,a.actualStartTime,y,Ea,o),fs(e,a,o,d,y),ct&2048&&Pg(a,xi|el);break;case 1:(a.mode&2)!==Kt&&0<a.actualStartTime&&((a.flags&128)!==0?Fi(a,a.actualStartTime,y,[]):(a.flags&1)!==0&&di(a,a.actualStartTime,y,Ea,o)),fs(e,a,o,d,y);break;case 3:var ht=Os(),yt=Ea;Ea=a.alternate!==null&&a.alternate.memoizedState.isDehydrated&&(a.flags&256)===0,fs(e,a,o,d,y),Ea=yt,ct&2048&&(o=null,a.alternate!==null&&(o=a.alternate.memoizedState.cache),d=a.memoizedState.cache,d!==o&&(Sl(d),o!=null&&Ir(o))),e.passiveEffectDuration+=Rc(ht);break;case 12:if(ct&2048){ct=Os(),fs(e,a,o,d,y),e=a.stateNode,e.passiveEffectDuration+=cu(ct);try{Bt(a,qg,a,a.alternate,Fu,e.passiveEffectDuration)}catch(Vt){Ee(a,a.return,Vt)}}else fs(e,a,o,d,y);break;case 31:ct=Ea,ht=a.alternate!==null?a.alternate.memoizedState:null,yt=a.memoizedState,ht!==null&&yt===null?(yt=a.deletions,yt!==null&&0<yt.length&&yt[0].tag===18?(Ea=!1,ht=ht.hydrationErrors,ht!==null&&Fi(a,a.actualStartTime,y,ht)):Ea=!0):Ea=!1,fs(e,a,o,d,y),Ea=ct;break;case 13:ct=Ea,ht=a.alternate!==null?a.alternate.memoizedState:null,yt=a.memoizedState,ht===null||ht.dehydrated===null||yt!==null&&yt.dehydrated!==null?Ea=!1:(yt=a.deletions,yt!==null&&0<yt.length&&yt[0].tag===18?(Ea=!1,ht=ht.hydrationErrors,ht!==null&&Fi(a,a.actualStartTime,y,ht)):Ea=!0),fs(e,a,o,d,y),Ea=ct;break;case 23:break;case 22:yt=a.stateNode,ht=a.alternate,a.memoizedState!==null?yt._visibility&Oo?fs(e,a,o,d,y):mf(e,a,o,d,y):yt._visibility&Oo?fs(e,a,o,d,y):(yt._visibility|=Oo,Ys(e,a,o,d,(a.subtreeFlags&10256)!==0||a.actualDuration!==0&&(a.alternate===null||a.alternate.child!==a.child),y),(a.mode&2)===Kt||Ea||(e=a.actualStartTime,0<=e&&.05<y-e&&Ji(a,e,y),0<=Lt&&0<=qt&&.05<qt-Lt&&Ji(a,Lt,qt))),ct&2048&&ro(ht,a);break;case 24:fs(e,a,o,d,y),ct&2048&&Cm(a.alternate,a);break;default:fs(e,a,o,d,y)}(a.mode&2)!==Kt&&((e=!Ea&&a.alternate===null&&a.return!==null&&a.return.alternate!==null)&&(o=a.actualStartTime,0<=o&&.05<y-o&&ha(a,o,y,"Mount")),0<=Lt&&0<=qt&&((Bn||.05<Sn)&&Mn(a,Lt,qt,Sn,fn),e&&.05<qt-Lt&&ha(a,Lt,qt,"Mount"))),ti(v),$i(C),fn=M,Bn=B,Xu=q}function Ys(e,a,o,d,y,v){for(y=y&&((a.subtreeFlags&10256)!==0||a.actualDuration!==0&&(a.alternate===null||a.alternate.child!==a.child)),a=a.child;a!==null;){var C=a.sibling;Wg(e,a,o,d,y,C!==null?C.actualStartTime:v),a=C}}function Wg(e,a,o,d,y,v){var C=Ga(),M=Rs(),B=ts(),q=es(),ct=Xu;y&&(a.mode&2)!==Kt&&0<a.actualStartTime&&(a.flags&1)!==0&&di(a,a.actualStartTime,v,Ea,o);var ht=a.flags;switch(a.tag){case 0:case 11:case 15:Ys(e,a,o,d,y,v),Pg(a,xi);break;case 23:break;case 22:var yt=a.stateNode;a.memoizedState!==null?yt._visibility&Oo?Ys(e,a,o,d,y,v):mf(e,a,o,d,v):(yt._visibility|=Oo,Ys(e,a,o,d,y,v)),y&&ht&2048&&ro(a.alternate,a);break;case 24:Ys(e,a,o,d,y,v),y&&ht&2048&&Cm(a.alternate,a);break;default:Ys(e,a,o,d,y,v)}(a.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(a,Lt,qt,Sn,fn),ti(C),$i(M),fn=B,Bn=q,Xu=ct}function mf(e,a,o,d,y){if(a.subtreeFlags&10256||a.actualDuration!==0&&(a.alternate===null||a.alternate.child!==a.child))for(var v=a.child;v!==null;){a=v.sibling;var C=e,M=o,B=d,q=a!==null?a.actualStartTime:y,ct=Xu;(v.mode&2)!==Kt&&0<v.actualStartTime&&(v.flags&1)!==0&&di(v,v.actualStartTime,q,Ea,M);var ht=v.flags;switch(v.tag){case 22:mf(C,v,M,B,q),ht&2048&&ro(v.alternate,v);break;case 24:mf(C,v,M,B,q),ht&2048&&Cm(v.alternate,v);break;default:mf(C,v,M,B,q)}Xu=ct,v=a}}function oo(e,a,o){if(e.subtreeFlags&Ap)for(e=e.child;e!==null;)$g(e,a,o),e=e.sibling}function $g(e,a,o){switch(e.tag){case 26:if(oo(e,a,o),e.flags&Ap)if(e.memoizedState!==null)E(o,Pl,e.memoizedState,e.memoizedProps);else{var d=e.stateNode,y=e.type;e=e.memoizedProps,((a&335544128)===a||Pd(y,e))&&Yd(o,d,y,e)}break;case 5:oo(e,a,o),e.flags&Ap&&(d=e.stateNode,y=e.type,e=e.memoizedProps,((a&335544128)===a||Pd(y,e))&&Yd(o,d,y,e));break;case 3:case 4:we?(d=Pl,Pl=br(e.stateNode.containerInfo),oo(e,a,o),Pl=d):oo(e,a,o);break;case 22:e.memoizedState===null&&(d=e.alternate,d!==null&&d.memoizedState!==null?(d=Ap,Ap=16777216,oo(e,a,o),Ap=d):oo(e,a,o));break;default:oo(e,a,o)}}function ty(e){var a=e.alternate;if(a!==null&&(e=a.child,e!==null)){a.child=null;do a=e.sibling,e.sibling=null,e=a;while(e!==null)}}function gf(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var d=a[o],y=Ga();Oa=d,ay(d,e),(d.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&ha(d,Lt,qt,"Unmount"),ti(y)}ty(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ey(e),e=e.sibling}function ey(e){var a=Ga(),o=Rs(),d=ts(),y=es();switch(e.tag){case 0:case 11:case 15:gf(e),e.flags&2048&&Sm(e,e.return,xi|el);break;case 3:var v=Os();gf(e),e.stateNode.passiveEffectDuration+=Rc(v);break;case 12:v=Os(),gf(e),e.stateNode.passiveEffectDuration+=cu(v);break;case 22:v=e.stateNode,e.memoizedState!==null&&v._visibility&Oo&&(e.return===null||e.return.tag!==13)?(v._visibility&=~Oo,xd(e),(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&ha(e,Lt,qt,"Disconnect")):gf(e);break;default:gf(e)}(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(e,Lt,qt,Sn,fn),ti(a),$i(o),Bn=y,fn=d}function xd(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var d=a[o],y=Ga();Oa=d,ay(d,e),(d.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&ha(d,Lt,qt,"Unmount"),ti(y)}ty(e)}for(e=e.child;e!==null;)ny(e),e=e.sibling}function ny(e){var a=Ga(),o=Rs(),d=ts(),y=es();switch(e.tag){case 0:case 11:case 15:Sm(e,e.return,xi),xd(e);break;case 22:var v=e.stateNode;v._visibility&Oo&&(v._visibility&=~Oo,xd(e));break;default:xd(e)}(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(e,Lt,qt,Sn,fn),ti(a),$i(o),Bn=y,fn=d}function ay(e,a){for(;Oa!==null;){var o=Oa,d=o,y=a,v=Ga(),C=Rs(),M=ts(),B=es();switch(d.tag){case 0:case 11:case 15:Sm(d,y,xi);break;case 23:case 22:d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool,y!=null&&Sl(y));break;case 24:Ir(d.memoizedState.cache)}if((d.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(d,Lt,qt,Sn,fn),ti(v),$i(C),Bn=B,fn=M,d=o.child,d!==null)d.return=o,Oa=d;else t:for(o=e;Oa!==null;){if(d=Oa,v=d.sibling,C=d.return,Ls(d),d===o){Oa=null;break t}if(v!==null){v.return=C,Oa=v;break t}Oa=C}}}function _m(e){var a=m3(e);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");return a}if(e=jm(e),e===null)throw Error("Could not find React container within specified host subtree.");return e.stateNode.current}function xm(e,a){var o=e.tag;switch(a.$$typeof){case a2:if(e.type===a.value)return!0;break;case i2:t:{for(a=a.value,e=[e,0],o=0;o<e.length;){var d=e[o++],y=d.tag,v=e[o++],C=a[v];if(y!==5&&y!==26&&y!==27||!Qs(d)){for(;C!=null&&xm(d,C);)v++,C=a[v];if(v===a.length){a=!0;break t}else for(d=d.child;d!==null;)e.push(d,v),d=d.sibling}}a=!1}return a;case s2:if((o===5||o===26||o===27)&&Kd(e.stateNode,a.value))return!0;break;case r2:if((o===5||o===6||o===26||o===27)&&(e=Lm(e),e!==null&&0<=e.indexOf(a.value)))return!0;break;case l2:if((o===5||o===26||o===27)&&(e=e.memoizedProps["data-testname"],typeof e=="string"&&e.toLowerCase()===a.value.toLowerCase()))return!0;break;default:throw Error("Invalid selector type specified.")}return!1}function Dd(e){switch(e.$$typeof){case a2:return"<"+(et(e.value)||"Unknown")+">";case i2:return":has("+(Dd(e)||"")+")";case s2:return'[role="'+e.value+'"]';case r2:return'"'+e.value+'"';case l2:return'[data-testname="'+e.value+'"]';default:throw Error("Invalid selector type specified.")}}function iy(e,a){var o=[];e=[e,0];for(var d=0;d<e.length;){var y=e[d++],v=y.tag,C=e[d++],M=a[C];if(v!==5&&v!==26&&v!==27||!Qs(y)){for(;M!=null&&xm(y,M);)C++,M=a[C];if(C===a.length)o.push(y);else for(y=y.child;y!==null;)e.push(y,C),y=y.sibling}}return o}function Ad(e,a){if(!ds)throw Error("Test selector API is not supported by this renderer.");e=_m(e),e=iy(e,a),a=[],e=Array.from(e);for(var o=0;o<e.length;){var d=e[o++],y=d.tag;if(y===5||y===26||y===27)Qs(d)||a.push(d.stateNode);else for(d=d.child;d!==null;)e.push(d),d=d.sibling}return a}function l3(){ds&&o2.forEach(function(e){return e()})}function sy(){var e=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return e||lt.actQueue===null||console.error("The current testing environment is not configured to support act(...)"),e}function vi(e){if((de&za)!==Ra&&ee!==0)return ee&-ee;var a=lt.T;return a!==null?(a._updatedFibers||(a._updatedFibers=new Set),a._updatedFibers.add(e),Uh()):Vm()}function ly(){if(Xi===0)if((ee&536870912)===0||he){var e=ut;ut<<=1,(ut&3932160)===0&&(ut=262144),Xi=e}else Xi=536870912;return e=gs.current,e!==null&&(e.flags|=32),Xi}function Ie(e,a,o){if(Op&&console.error("useInsertionEffect must not schedule updates."),o5&&(y2=!0),(e===Xe&&(je===Qf||je===Zf)||e.cancelPendingCommit!==null)&&(xu(e,0),Nl(e,ee,Xi,!1)),$(e,o),(de&za)!==Ra&&e===Xe){if(Cr)switch(a.tag){case 0:case 11:case 15:e=ie&&nt(ie)||"Unknown",eT.has(e)||(eT.add(e),a=nt(a)||"Unknown",console.error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",a,e,e));break;case 1:tT||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),tT=!0)}}else Tr&&xe(e,a,o),xy(a),e===Xe&&((de&za)===Ra&&(ac|=o),bn===tc&&Nl(e,ee,Xi,!1)),ja(e)}function Dm(e,a,o){if((de&(za|al))!==Ra)throw Error("Should not already be working.");if(ee!==0&&ie!==null){var d=ie,y=fe();switch(J9){case p1:case Qf:var v=Im;en&&((d=d._debugTask)?d.run(console.timeStamp.bind(console,"Suspended",v,y,"Components ⚛",void 0,"primary-light")):console.timeStamp("Suspended",v,y,"Components ⚛",void 0,"primary-light"));break;case Zf:v=Im,en&&((d=d._debugTask)?d.run(console.timeStamp.bind(console,"Action",v,y,"Components ⚛",void 0,"primary-light")):console.timeStamp("Action",v,y,"Components ⚛",void 0,"primary-light"));break;default:en&&(d=y-Im,3>d||console.timeStamp("Blocked",Im,y,"Components ⚛",void 0,5>d?"primary-light":10>d?"primary":100>d?"primary-dark":"error"))}}v=(o=!o&&(a&127)===0&&(a&e.expiredLanes)===0||F(e,a))?r3(e,a):Mm(e,a,!0);var C=o;do{if(v===Uo){Mp&&!o&&Nl(e,a,0,!1),a=je,Im=ia(),J9=a;break}else{if(d=fe(),y=e.current.alternate,C&&!oy(y)){pn(a),y=fi,v=d,!en||v<=y||(Kn?Kn.run(console.timeStamp.bind(console,"Teared Render",y,v,me,"Scheduler ⚛","error")):console.timeStamp("Teared Render",y,v,me,"Scheduler ⚛","error")),uo(a,d),v=Mm(e,a,!1),C=!1;continue}if(v===Kf){if(C=a,e.errorRecoveryDisabledLanes&C)var M=0;else M=e.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){pn(a),jn(fi,d,a,Kn),uo(a,d),a=M;t:{d=e,v=C,C=g1;var B=Na&&d.current.memoizedState.isDehydrated;if(B&&(xu(d,M).flags|=256),M=Mm(d,M,!1),M!==Kf){if($3&&!B){d.errorRecoveryDisabledLanes|=v,ac|=v,v=tc;break t}d=Di,Di=C,d!==null&&(Di===null?Di=d:Di.push.apply(Di,d))}v=M}if(C=!1,v!==Kf)continue;d=fe()}}if(v===d1){pn(a),jn(fi,d,a,Kn),uo(a,d),xu(e,0),Nl(e,a,0,!0);break}t:{switch(o=e,v){case Uo:case d1:throw Error("Root did not complete. This is a bug in React.");case tc:if((a&4194048)!==a)break;case c2:pn(a),Mi(fi,d,a,Kn),uo(a,d),y=a,(y&127)!==0?Yy=d:(y&4194048)!==0&&(qy=d),Nl(o,a,Xi,!ec);break t;case Kf:Di=null;break;case u2:case YE:break;default:throw Error("Unknown root exit status.")}if(lt.actQueue!==null)Nm(o,y,a,Di,v1,d2,Xi,ac,Jf,v,null,null,fi,d);else{if((a&62914560)===a&&(C=p2+KE-fe(),10<C)){if(Nl(o,a,Xi,!ec),w(o,0,!0)!==0)break t;Yl=a,o.timeoutHandle=Vi(ry.bind(null,o,y,Di,v1,d2,a,Xi,ac,Jf,ec,v,"Throttled",fi,d),C);break t}ry(o,y,Di,v1,d2,a,Xi,ac,Jf,ec,v,null,fi,d)}}}break}while(!0);ja(e)}function ry(e,a,o,d,y,v,C,M,B,q,ct,ht,yt,Vt){e.timeoutHandle=Xs;var Jt=a.subtreeFlags,Pe=null;if((Jt&8192||(Jt&16785408)===16785408)&&(Pe=Vu(),$g(a,v,Pe),Jt=(v&62914560)===v?p2-fe():(v&4194048)===v?XE-fe():0,Jt=qd(Pe,Jt),Jt!==null)){Yl=v,e.cancelPendingCommit=Jt(Nm.bind(null,e,a,v,o,d,y,C,M,B,ct,Pe,Xd(Pe,e.containerInfo),yt,Vt)),Nl(e,v,C,!q);return}Nm(e,a,v,o,d,y,C,M,B,ct,Pe,ht,yt,Vt)}function oy(e){for(var a=e;;){var o=a.tag;if((o===0||o===11||o===15)&&a.flags&16384&&(o=a.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var d=0;d<o.length;d++){var y=o[d],v=y.getSnapshot;y=y.value;try{if(!Ti(v(),y))return!1}catch{return!1}}if(o=a.child,a.subtreeFlags&16384&&o!==null)o.return=a,a=o;else{if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Nl(e,a,o,d){a&=~t5,a&=~ac,e.suspendedLanes|=a,e.pingedLanes&=~a,d&&(e.warmLanes|=a),d=e.expirationTimes;for(var y=a;0<y;){var v=31-kn(y),C=1<<v;d[v]=-1,y&=~C}o!==0&&Tt(e,o,a)}function yf(){return(de&(za|al))===Ra?(Wr(0),!1):!0}function vf(){return(de&(za|al))!==Ra}function Sf(){if(ie!==null){if(je===qi)var e=ie.return;else e=ie,Rh(),Fc(e),yp=null,l1=0,e=ie;for(;e!==null;)Td(e.alternate,e),e=e.return;ie=null}}function uo(e,a){(e&127)!==0&&(Uf=a),(e&4194048)!==0&&(Mo=a)}function xu(e,a){en&&(console.timeStamp("Blocking Track",.003,.003,"Blocking","Scheduler ⚛","primary-light"),console.timeStamp("Transition Track",.003,.003,"Transition","Scheduler ⚛","primary-light"),console.timeStamp("Suspense Track",.003,.003,"Suspense","Scheduler ⚛","primary-light"),console.timeStamp("Idle Track",.003,.003,"Idle","Scheduler ⚛","primary-light"));var o=fi;if(fi=ia(),ee!==0&&0<o){if(pn(ee),bn===u2||bn===tc)Mi(o,fi,a,Kn);else{var d=fi,y=Kn;if(en&&!(d<=o)){var v=(a&738197653)===a?"tertiary-dark":"primary-dark",C=(a&536870912)===a?"Prewarm":(a&201326741)===a?"Interrupted Hydration":"Interrupted Render";y?y.run(console.timeStamp.bind(console,C,o,d,me,"Scheduler ⚛",v)):console.timeStamp(C,o,d,me,"Scheduler ⚛",v)}}uo(ee,fi)}if(o=Kn,Kn=null,(a&127)!==0){Kn=Jm,y=0<=xr&&xr<Uf?Uf:xr,d=0<=Bf&&Bf<Uf?Uf:Bf,v=0<=d?d:0<=y?y:fi,0<=Yy&&(pn(2),Ut(Yy,v,a,o)),o=y;var M=d,B=Fm,q=0<dp,ct=ku===1,ht=ku===2;if(y=fi,d=Jm,v=A3,C=M3,en){if(me="Blocking",0<o?o>y&&(o=y):o=y,0<M?M>o&&(M=o):M=o,B!==null&&o>M){var yt=q?"secondary-light":"warning";d?d.run(console.timeStamp.bind(console,q?"Consecutive":"Event: "+B,M,o,me,"Scheduler ⚛",yt)):console.timeStamp(q?"Consecutive":"Event: "+B,M,o,me,"Scheduler ⚛",yt)}y>o&&(M=ct?"error":(a&738197653)===a?"tertiary-light":"primary-light",ct=ht?"Promise Resolved":ct?"Cascading Update":5<y-o?"Update Blocked":"Update",ht=[],C!=null&&ht.push(["Component name",C]),v!=null&&ht.push(["Method name",v]),o={start:o,end:y,detail:{devtools:{properties:ht,track:me,trackGroup:"Scheduler ⚛",color:M}}},d?d.run(performance.measure.bind(performance,ct,o)):performance.measure(ct,o))}xr=-1.1,ku=0,M3=A3=null,Yy=-1.1,dp=Bf,Bf=-1.1,Uf=ia()}if((a&4194048)!==0&&(Kn=km,y=0<=No&&No<Mo?Mo:No,o=0<=Ws&&Ws<Mo?Mo:Ws,d=0<=Iu&&Iu<Mo?Mo:Iu,v=0<=d?d:0<=o?o:fi,0<=qy&&(pn(256),Ut(qy,v,a,Kn)),ht=d,M=Vf,B=0<Wu,q=N3===2,v=fi,d=km,C=K9,ct=Q9,en&&(me="Transition",0<o?o>v&&(o=v):o=v,0<y?y>o&&(y=o):y=o,0<ht?ht>y&&(ht=y):ht=y,y>ht&&M!==null&&(yt=B?"secondary-light":"warning",d?d.run(console.timeStamp.bind(console,B?"Consecutive":"Event: "+M,ht,y,me,"Scheduler ⚛",yt)):console.timeStamp(B?"Consecutive":"Event: "+M,ht,y,me,"Scheduler ⚛",yt)),o>y&&(d?d.run(console.timeStamp.bind(console,"Action",y,o,me,"Scheduler ⚛","primary-dark")):console.timeStamp("Action",y,o,me,"Scheduler ⚛","primary-dark")),v>o&&(y=q?"Promise Resolved":5<v-o?"Update Blocked":"Update",ht=[],ct!=null&&ht.push(["Component name",ct]),C!=null&&ht.push(["Method name",C]),o={start:o,end:v,detail:{devtools:{properties:ht,track:me,trackGroup:"Scheduler ⚛",color:"primary-light"}}},d?d.run(performance.measure.bind(performance,y,o)):performance.measure(y,o))),Ws=No=-1.1,N3=0,qy=-1.1,Wu=Iu,Iu=-1.1,Mo=ia()),o=e.timeoutHandle,o!==Xs&&(e.timeoutHandle=Xs,Bm(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),Yl=0,Sf(),Xe=e,ie=o=Ol(e.current,null),ee=a,je=qi,vs=null,ec=!1,Mp=F(e,a),$3=!1,bn=Uo,Jf=Xi=t5=ac=nc=0,Di=g1=null,d2=!1,(a&8)!==0&&(a|=a&32),d=e.entangledLanes,d!==0)for(e=e.entanglements,d&=a;0<d;)y=31-kn(d),v=1<<y,a|=e[y],d&=~v;return Ar=a,du(),e=w9(),1e3<e-H9&&(lt.recentlyCreatedOwnerStacks=0,H9=e),jl.discardPendingWarnings(),o}function uy(e,a){Qt=null,lt.H=f1,lt.getCurrentStack=null,Cr=!1,xo=null,a===gp||a===Fy?(a=Y0(),je=p1):a===V3?(a=Y0(),je=qE):je=a===J3?W3:a!==null&&typeof a=="object"&&typeof a.then=="function"?m1:f2,vs=a;var o=ie;o===null?(bn=d1,af(e,Ht(a,e.current))):o.mode&2&&zh(o)}function cy(){var e=gs.current;return e===null?!0:(ee&4194048)===ee?tl===null:(ee&62914560)===ee||(ee&536870912)!==0?e===tl:!1}function Am(){var e=lt.H;return lt.H=f1,e===null?f1:e}function fy(){var e=lt.A;return lt.A=hj,e}function Md(e){Kn===null&&(Kn=e._debugTask==null?null:e._debugTask)}function Nd(){bn=tc,ec||(ee&4194048)!==ee&&gs.current!==null||(Mp=!0),(nc&134217727)===0&&(ac&134217727)===0||Xe===null||Nl(Xe,ee,Xi,!1)}function Mm(e,a,o){var d=de;de|=za;var y=Am(),v=fy();if(Xe!==e||ee!==a){if(Tr){var C=e.memoizedUpdaters;0<C.size&&(Mu(e,ee),C.clear()),Dn(e,a)}v1=null,xu(e,a)}a=!1,C=bn;t:do try{if(je!==qi&&ie!==null){var M=ie,B=vs;switch(je){case W3:Sf(),C=c2;break t;case p1:case Qf:case Zf:case m1:gs.current===null&&(a=!0);var q=je;if(je=qi,vs=null,Du(e,M,B,q),o&&Mp){C=Uo;break t}break;default:q=je,je=qi,vs=null,Du(e,M,B,q)}}hy(),C=bn;break}catch(ct){uy(e,ct)}while(!0);return a&&e.shellSuspendCounter++,Rh(),de=d,lt.H=y,lt.A=v,ie===null&&(Xe=null,ee=0,du()),C}function hy(){for(;ie!==null;)dy(ie)}function r3(e,a){var o=de;de|=za;var d=Am(),y=fy();if(Xe!==e||ee!==a){if(Tr){var v=e.memoizedUpdaters;0<v.size&&(Mu(e,ee),v.clear()),Dn(e,a)}v1=null,y1=fe()+e5,xu(e,a)}else Mp=F(e,a);t:do try{if(je!==qi&&ie!==null)e:switch(a=ie,v=vs,je){case f2:je=qi,vs=null,Du(e,a,v,f2);break;case Qf:case Zf:if(P0(v)){je=qi,vs=null,py(a);break}a=function(){je!==Qf&&je!==Zf||Xe!==e||(je=h2),ja(e)},v.then(a,a);break t;case p1:je=h2;break t;case qE:je=I3;break t;case h2:P0(v)?(je=qi,vs=null,py(a)):(je=qi,vs=null,Du(e,a,v,h2));break;case I3:var C=null;switch(ie.tag){case 26:C=ie.memoizedState;case 5:case 27:var M=ie,B=M.type,q=M.pendingProps;if(C?g(C):pr(M.stateNode,B,q)){je=qi,vs=null;var ct=M.sibling;if(ct!==null)ie=ct;else{var ht=M.return;ht!==null?(ie=ht,Od(ht)):ie=null}break e}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}je=qi,vs=null,Du(e,a,v,I3);break;case m1:je=qi,vs=null,Du(e,a,v,m1);break;case W3:Sf(),bn=c2;break t;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}lt.actQueue!==null?hy():o3();break}catch(yt){uy(e,yt)}while(!0);return Rh(),lt.H=d,lt.A=y,de=o,ie!==null?Uo:(Xe=null,ee=0,du(),bn)}function o3(){for(;ie!==null&&!Xt();)dy(ie)}function dy(e){var a=e.alternate;(e.mode&2)!==Kt?(Hc(e),a=Bt(e,Ya,a,e,Ar),zh(e)):a=Bt(e,Ya,a,e,Ar),e.memoizedProps=e.pendingProps,a===null?Od(e):ie=a}function py(e){var a=Bt(e,u3,e);e.memoizedProps=e.pendingProps,a===null?Od(e):ie=a}function u3(e){var a=e.alternate,o=(e.mode&2)!==Kt;switch(o&&Hc(e),e.tag){case 15:case 0:a=Vs(a,e,e.pendingProps,e.type,void 0,ee);break;case 11:a=Vs(a,e,e.pendingProps,e.type.render,e.ref,ee);break;case 5:Fc(e);default:Td(a,e),e=ie=Ln(e,Ar),a=Ya(a,e,Ar)}return o&&zh(e),a}function Du(e,a,o,d){Rh(),Fc(a),yp=null,l1=0;var y=a.return;try{if(jg(e,y,a,o,ee)){bn=d1,af(e,Ht(o,e.current)),ie=null;return}}catch(v){if(y!==null)throw ie=y,v;bn=d1,af(e,Ht(o,e.current)),ie=null;return}a.flags&32768?(he||d===f2?e=!0:Mp||(ee&536870912)!==0?e=!1:(ec=e=!0,(d===Qf||d===Zf||d===p1||d===m1)&&(d=gs.current,d!==null&&d.tag===13&&(d.flags|=16384))),my(a,e)):Od(a)}function Od(e){var a=e;do{if((a.flags&32768)!==0){my(a,ec);return}var o=a.alternate;if(e=a.return,Hc(a),o=Bt(a,gm,o,a,Ar),(a.mode&2)!==Kt&&w0(a),o!==null){ie=o;return}if(a=a.sibling,a!==null){ie=a;return}ie=a=e}while(a!==null);bn===Uo&&(bn=YE)}function my(e,a){do{var o=ur(e.alternate,e);if(o!==null){o.flags&=32767,ie=o;return}if((e.mode&2)!==Kt){w0(e),o=e.actualDuration;for(var d=e.child;d!==null;)o+=d.actualDuration,d=d.sibling;e.actualDuration=o}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!a&&(e=e.sibling,e!==null)){ie=e;return}ie=e=o}while(e!==null);bn=c2,ie=null}function Nm(e,a,o,d,y,v,C,M,B,q,ct,ht,yt,Vt){e.cancelPendingCommit=null;do Au();while(ua!==sc);if(jl.flushLegacyContextWarning(),jl.flushPendingUnsafeLifecycleWarnings(),(de&(za|al))!==Ra)throw Error("Should not already be working.");if(pn(o),q===Kf?jn(yt,Vt,o,Kn):d!==null?Ae(yt,Vt,o,d,a!==null&&a.alternate!==null&&a.alternate.memoizedState.isDehydrated&&(a.flags&256)!==0,Kn):rn(yt,Vt,o,Kn),a!==null){if(o===0&&console.error("finishedLanes should not be empty during a commit. This is a bug in React."),a===e.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");if(v=a.lanes|a.childLanes,v|=j3,gt(e,o,v,C,M,B),e===Xe&&(ie=Xe=null,ee=0),Np=a,lc=e,Yl=o,i5=v,l5=y,IE=d,s5=Vt,WE=ht,ql=m2,$E=null,a.actualDuration!==0||(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,_y(zf,function(){return wu(),ql===m2&&(ql=a5),by(),null})):(e.callbackNode=null,e.callbackPriority=0),Ao=null,Fu=ia(),ht!==null&&Va(Vt,Fu,ht,Kn),d=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||d){d=lt.T,lt.T=null,y=ri(),zn(2),C=de,de|=al;try{i3(e,a,o)}finally{de=C,zn(y),lt.T=d}}ua=ZE,gy(),yy(),vy()}}function gy(){if(ua===ZE){ua=sc;var e=lc,a=Np,o=Yl,d=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||d){d=lt.T,lt.T=null;var y=ri();zn(2);var v=de;de|=al;try{xp=o,Dp=e,zc(),Jg(a,e),Dp=xp=null,dr(e.containerInfo)}finally{de=v,zn(y),lt.T=d}}e.current=a,ua=JE}}function yy(){if(ua===JE){ua=sc;var e=$E;if(e!==null){Fu=ia();var a=Do,o=Fu;!en||o<=a||console.timeStamp(e,a,o,me,"Scheduler ⚛","secondary-light")}e=lc,a=Np,o=Yl;var d=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||d){d=lt.T,lt.T=null;var y=ri();zn(2);var v=de;de|=al;try{xp=o,Dp=e,zc(),Jn(e,a.alternate,a),Dp=xp=null}finally{de=v,zn(y),lt.T=d}}e=s5,a=WE,Do=ia(),e=a===null?e:Fu,a=Do,o=ql===n5,d=Kn,Ao!==null?ke(e,a,Ao,!1,d):!en||a<=e||(d?d.run(console.timeStamp.bind(console,o?"Commit Interrupted View Transition":"Commit",e,a,me,"Scheduler ⚛",o?"error":"secondary-dark")):console.timeStamp(o?"Commit Interrupted View Transition":"Commit",e,a,me,"Scheduler ⚛",o?"error":"secondary-dark")),ua=FE}}function vy(){if(ua===kE||ua===FE){if(ua===kE){var e=Do;Do=ia();var a=Do,o=ql===n5;!en||a<=e||console.timeStamp(o?"Interrupted View Transition":"Starting Animation",e,a,me,"Scheduler ⚛",o?" error":"secondary-light"),ql!==n5&&(ql=QE)}ua=sc,_e(),e=lc;var d=Np;a=Yl,o=IE;var y=d.actualDuration!==0||(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0;y?ua=g2:(ua=sc,Np=lc=null,Sy(e,e.pendingLanes),Ff=0,b1=null);var v=e.pendingLanes;if(v===0&&(ic=null),y||zm(e),v=ln(a),d=d.stateNode,ci&&typeof ci.onCommitFiberRoot=="function")try{var C=(d.current.flags&128)===128;switch(v){case 2:var M=ye;break;case 8:M=Gl;break;case 32:M=zf;break;case 268435456:M=z9;break;default:M=zf}ci.onCommitFiberRoot(op,d,M,C)}catch(ht){Er||(Er=!0,console.error("React instrumentation encountered an error: %o",ht))}if(Tr&&e.memoizedUpdaters.clear(),l3(),o!==null){C=lt.T,M=ri(),zn(2),lt.T=null;try{var B=e.onRecoverableError;for(d=0;d<o.length;d++){var q=o[d],ct=c3(q.stack);Bt(q.source,B,q.value,ct)}}finally{lt.T=C,zn(M)}}(Yl&3)!==0&&Au(),ja(e),v=e.pendingLanes,(a&261930)!==0&&(v&42)!==0?(Ky=!0,e===r5?S1++:(S1=0,r5=e)):S1=0,y||uo(a,Do),Na&&qm(),Wr(0)}}function c3(e){return e={componentStack:e},Object.defineProperty(e,"digest",{get:function(){console.error('You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.')}}),e}function Sy(e,a){(e.pooledCacheLanes&=a)===0&&(a=e.pooledCache,a!=null&&(e.pooledCache=null,Ir(a)))}function Au(){return gy(),yy(),vy(),by()}function by(){if(ua!==g2)return!1;var e=lc,a=i5;i5=0;var o=ln(Yl),d=32>o?32:o;o=lt.T;var y=ri();try{zn(d),lt.T=null;var v=l5;l5=null,d=lc;var C=Yl;if(ua=sc,Np=lc=null,Yl=0,(de&(za|al))!==Ra)throw Error("Cannot flush passive effects while already rendering.");pn(C),o5=!0,y2=!1;var M=0;if(Ao=null,M=fe(),ql===QE){var B=Do,q=M;!en||q<=B||(Z9?Z9.run(console.timeStamp.bind(console,"Animating",B,q,me,"Scheduler ⚛","secondary-dark")):console.timeStamp("Animating",B,q,me,"Scheduler ⚛","secondary-dark"))}else{B=Do,q=M;var ct=ql===a5;!en||q<=B||(Kn?Kn.run(console.timeStamp.bind(console,ct?"Waiting for Paint":"Waiting",B,q,me,"Scheduler ⚛","secondary-light")):console.timeStamp(ct?"Waiting for Paint":"Waiting",B,q,me,"Scheduler ⚛","secondary-light"))}B=de,de|=al;var ht=d.current;zc(),ey(ht);var yt=d.current;ht=s5,zc(),Ig(d,yt,C,v,ht),zm(d),de=B;var Vt=fe();if(yt=M,ht=Kn,Ao!==null?ke(yt,Vt,Ao,!0,ht):!en||Vt<=yt||(ht?ht.run(console.timeStamp.bind(console,"Remaining Effects",yt,Vt,me,"Scheduler ⚛","secondary-dark")):console.timeStamp("Remaining Effects",yt,Vt,me,"Scheduler ⚛","secondary-dark")),uo(C,Vt),Wr(0,!1),y2?d===b1?Ff++:(Ff=0,b1=d):Ff=0,y2=o5=!1,ci&&typeof ci.onPostCommitFiberRoot=="function")try{ci.onPostCommitFiberRoot(op,d)}catch(Pe){Er||(Er=!0,console.error("React instrumentation encountered an error: %o",Pe))}var Jt=d.current.stateNode;return Jt.effectDuration=0,Jt.passiveEffectDuration=0,!0}finally{zn(y),lt.T=o,Sy(e,a)}}function Ey(e,a,o){a=Ht(o,a),U0(a),a=cd(e.stateNode,a,2),e=Ni(e,a,2),e!==null&&($(e,2),ja(e))}function Ee(e,a,o){if(Op=!1,e.tag===3)Ey(e,e,o);else{for(;a!==null;){if(a.tag===3){Ey(a,e,o);return}if(a.tag===1){var d=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ic===null||!ic.has(d))){e=Ht(o,e),U0(e),o=fd(2),d=Ni(a,o,2),d!==null&&(hd(o,d,a,e),$(d,2),ja(d));return}}a=a.return}console.error(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
|
|
139
|
+
Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`:" You returned: "+d,Bt(a,function(M,B){console.error("%s must not return anything besides a function, which is used for clean-up.%s",M,B)},v,C)}o=o.next}while(o!==y)}}catch(M){Ee(a,a.return,M)}}function Gt(e,a,o){try{var d=a.updateQueue,y=d!==null?d.lastEffect:null;if(y!==null){var v=y.next;d=v;do{if((d.tag&e)===e){var C=d.inst,M=C.destroy;M!==void 0&&(C.destroy=void 0,(e&_i)!==Wy&&(Op=!0),y=a,Bt(y,oj,y,o,M),(e&_i)!==Wy&&(Op=!1))}d=d.next}while(d!==v)}}catch(B){Ee(a,a.return,B)}}function Pg(e,a){Gs(e)?(as(),cr(a,e),ns()):cr(a,e)}function Sm(e,a,o){Gs(e)?(as(),Gt(o,e,a),ns()):Gt(o,e,a)}function bm(e){var a=e.updateQueue;if(a!==null){var o=e.stateNode;e.type.defaultProps||"ref"in e.memoizedProps||_p||(o.props!==e.memoizedProps&&console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",nt(e)||"instance"),o.state!==e.memoizedState&&console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",nt(e)||"instance"));try{Bt(e,Z0,a,o)}catch(d){Ee(e,e.return,d)}}}function hf(e,a,o){return e.getSnapshotBeforeUpdate(a,o)}function n3(e,a){var o=a.memoizedProps,d=a.memoizedState;a=e.stateNode,e.type.defaultProps||"ref"in e.memoizedProps||_p||(a.props!==e.memoizedProps&&console.error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",nt(e)||"instance"),a.state!==e.memoizedState&&console.error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",nt(e)||"instance"));try{var y=Bs(e.type,o),v=Bt(e,hf,a,y,d);o=LE,v!==void 0||o.has(e.type)||(o.add(e.type),Bt(e,function(){console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",nt(e))})),a.__reactInternalSnapshotBeforeUpdate=v}catch(C){Ee(e,e.return,C)}}function Yg(e,a,o){o.props=Bs(e.type,e.memoizedProps),o.state=e.memoizedState,Gs(e)?(as(),Bt(e,sE,e,a,o),ns()):Bt(e,sE,e,a,o)}function a3(e){var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var o=Xa(e.stateNode);break;case 30:o=e.stateNode;break;default:o=e.stateNode}if(typeof a=="function")if(Gs(e))try{as(),e.refCleanup=a(o)}finally{ns()}else e.refCleanup=a(o);else typeof a=="string"?console.error("String refs are no longer supported."):a.hasOwnProperty("current")||console.error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",nt(e)),a.current=o}}function df(e,a){try{Bt(e,a3,e)}catch(o){Ee(e,a,o)}}function js(e,a){var o=e.ref,d=e.refCleanup;if(o!==null)if(typeof d=="function")try{if(Gs(e))try{as(),Bt(e,d)}finally{ns(e)}else Bt(e,d)}catch(y){Ee(e,a,y)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof o=="function")try{if(Gs(e))try{as(),Bt(e,o,null)}finally{ns(e)}else Bt(e,o,null)}catch(y){Ee(e,a,y)}else o.current=null}function Cd(e,a,o,d){var y=e.memoizedProps,v=y.id,C=y.onCommit;y=y.onRender,a=a===null?"mount":"update",Xy&&(a="nested-update"),typeof y=="function"&&y(v,a,e.actualDuration,e.treeBaseDuration,e.actualStartTime,o),typeof C=="function"&&C(v,a,d,o)}function qg(e,a,o,d){var y=e.memoizedProps;e=y.id,y=y.onPostCommit,a=a===null?"mount":"update",Xy&&(a="nested-update"),typeof y=="function"&&y(e,a,d,o)}function pf(e){var a=e.type,o=e.memoizedProps,d=e.stateNode;try{Bt(e,Ge,d,a,o,e)}catch(y){Ee(e,e.return,y)}}function _d(e,a,o){try{Bt(e,Yn,e.stateNode,e.type,o,a,e)}catch(d){Ee(e,e.return,d)}}function Xg(e){return e.tag===5||e.tag===3||(we?e.tag===26:!1)||(T?e.tag===27&&Mt(e.type):!1)||e.tag===4}function Em(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||Xg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(T&&e.tag===27&&Mt(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ml(e,a,o){var d=e.tag;if(d===5||d===6)e=e.stateNode,a?Gu(o,e,a):Ul(o,e);else if(d!==4&&(T&&d===27&&Mt(e.type)&&(o=e.stateNode,a=null),e=e.child,e!==null))for(Ml(e,a,o),e=e.sibling;e!==null;)Ml(e,a,o),e=e.sibling}function Hi(e,a,o){var d=e.tag;if(d===5||d===6)e=e.stateNode,a?Qd(o,e,a):Hn(o,e);else if(d!==4&&(T&&d===27&&Mt(e.type)&&(o=e.stateNode),e=e.child,e!==null))for(Hi(e,a,o),e=e.sibling;e!==null;)Hi(e,a,o),e=e.sibling}function Aa(e){for(var a,o=e.return;o!==null;){if(Xg(o)){a=o;break}o=o.return}if($e){if(a==null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");switch(a.tag){case 27:if(T){a=a.stateNode,o=Em(e),Hi(e,o,a);break}case 5:o=a.stateNode,a.flags&32&&(ju(o),a.flags&=-33),a=Em(e),Hi(e,a,o);break;case 3:case 4:a=a.stateNode.containerInfo,o=Em(e),Ml(e,o,a);break;default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}}function us(e,a,o){e=e.containerInfo;try{Bt(a,kd,e,o)}catch(d){Ee(a,a.return,d)}}function ya(e){var a=e.stateNode,o=e.memoizedProps;try{Bt(e,L,e.type,o,a,e)}catch(d){Ee(e,e.return,d)}}function Kg(e,a){return a.tag===31?(a=a.memoizedState,e.memoizedState!==null&&a===null):a.tag===13?(e=e.memoizedState,a=a.memoizedState,e!==null&&e.dehydrated!==null&&(a===null||a.dehydrated===null)):a.tag===3?e.memoizedState.isDehydrated&&(a.flags&256)===0:!1}function i3(e,a){for(_f(e.containerInfo),Oa=a;Oa!==null;)if(e=Oa,a=e.child,(e.subtreeFlags&1028)!==0&&a!==null)a.return=e,Oa=a;else for(;Oa!==null;){a=e=Oa;var o=a.alternate,d=a.flags;switch(a.tag){case 0:if((d&4)!==0&&(a=a.updateQueue,a=a!==null?a.events:null,a!==null))for(o=0;o<a.length;o++)d=a[o],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:(d&1024)!==0&&o!==null&&n3(a,o);break;case 3:(d&1024)!==0&&$e&&Pm(a.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((d&1024)!==0)throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(a=e.sibling,a!==null){a.return=e.return,Oa=a;break}Oa=e.return}}function Jn(e,a,o){var d=Ga(),y=Rs(),v=ts(),C=es(),M=o.flags;switch(o.tag){case 0:case 11:case 15:qa(e,o),M&4&&ym(o,ys|el);break;case 1:if(qa(e,o),M&4)if(e=o.stateNode,a===null)o.type.defaultProps||"ref"in o.memoizedProps||_p||(e.props!==o.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",nt(o)||"instance"),e.state!==o.memoizedState&&console.error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",nt(o)||"instance")),Gs(o)?(as(),Bt(o,B3,o,e),ns()):Bt(o,B3,o,e);else{var B=Bs(o.type,a.memoizedProps);a=a.memoizedState,o.type.defaultProps||"ref"in o.memoizedProps||_p||(e.props!==o.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",nt(o)||"instance"),e.state!==o.memoizedState&&console.error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",nt(o)||"instance")),Gs(o)?(as(),Bt(o,nE,o,e,B,a,e.__reactInternalSnapshotBeforeUpdate),ns()):Bt(o,nE,o,e,B,a,e.__reactInternalSnapshotBeforeUpdate)}M&64&&bm(o),M&512&&df(o,o.return);break;case 3:if(a=Os(),qa(e,o),M&64&&(M=o.updateQueue,M!==null)){if(B=null,o.child!==null)switch(o.child.tag){case 27:case 5:B=Xa(o.child.stateNode);break;case 1:B=o.child.stateNode}try{Bt(o,Z0,M,B)}catch(ct){Ee(o,o.return,ct)}}e.effectDuration+=Rc(a);break;case 27:T&&a===null&&M&4&&ya(o);case 26:case 5:if(qa(e,o),a===null){if(M&4)pf(o);else if(M&64){e=o.type,a=o.memoizedProps,B=o.stateNode;try{Bt(o,Ym,B,e,a,o)}catch(ct){Ee(o,o.return,ct)}}}M&512&&df(o,o.return);break;case 12:if(M&4){M=Os(),qa(e,o),e=o.stateNode,e.effectDuration+=cu(M);try{Bt(o,Cd,o,a,Fu,e.effectDuration)}catch(ct){Ee(o,o.return,ct)}}else qa(e,o);break;case 31:qa(e,o),M&4&&Qg(e,o);break;case 13:qa(e,o),M&4&&Zg(e,o),M&64&&(e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(M=Cy.bind(null,o),Xn(e,M))));break;case 22:if(M=o.memoizedState!==null||wo,!M){a=a!==null&&a.memoizedState!==null||ra,B=wo;var q=ra;wo=M,(ra=a)&&!q?(Ps(e,o,(o.subtreeFlags&8772)!==0),(o.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&Ji(o,Lt,qt)):qa(e,o),wo=B,ra=q}break;case 30:break;default:qa(e,o)}(o.mode&2)!==Kt&&0<=Lt&&0<=qt&&((Bn||.05<Sn)&&Mn(o,Lt,qt,Sn,fn),o.alternate===null&&o.return!==null&&o.return.alternate!==null&&.05<qt-Lt&&(Kg(o.return.alternate,o.return)||ha(o,Lt,qt,"Mount"))),ti(d),$i(y),fn=v,Bn=C}function Ls(e){var a=e.alternate;a!==null&&(e.alternate=null,Ls(a)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(a=e.stateNode,a!==null&&Gm(a)),e.stateNode=null,e._debugOwner=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function cs(e,a,o){for(o=o.child;o!==null;)Tm(e,a,o),o=o.sibling}function Tm(e,a,o){if(ci&&typeof ci.onCommitFiberUnmount=="function")try{ci.onCommitFiberUnmount(op,o)}catch(q){Er||(Er=!0,console.error("React instrumentation encountered an error: %o",q))}var d=Ga(),y=Rs(),v=ts(),C=es();switch(o.tag){case 26:if(we){ra||js(o,a),cs(e,a,o),o.memoizedState?lp(o.memoizedState):o.stateNode&&rp(o.stateNode);break}case 27:if(T){ra||js(o,a);var M=oa,B=Yi;Mt(o.type)&&(oa=o.stateNode,Yi=!1),cs(e,a,o),Bt(o,ft,o.stateNode),oa=M,Yi=B;break}case 5:ra||js(o,a);case 6:if($e){if(M=oa,B=Yi,oa=null,cs(e,a,o),oa=M,Yi=B,oa!==null)if(Yi)try{Bt(o,Zd,oa,o.stateNode)}catch(q){Ee(o,a,q)}else try{Bt(o,vo,oa,o.stateNode)}catch(q){Ee(o,a,q)}}else cs(e,a,o);break;case 18:$e&&oa!==null&&(Yi?Pu(oa,o.stateNode):Ei(oa,o.stateNode));break;case 4:$e?(M=oa,B=Yi,oa=o.stateNode.containerInfo,Yi=!0,cs(e,a,o),oa=M,Yi=B):(Ks&&us(o.stateNode,o,Jd()),cs(e,a,o));break;case 0:case 11:case 14:case 15:Gt(_i,o,a),ra||vm(o,a,ys),cs(e,a,o);break;case 1:ra||(js(o,a),M=o.stateNode,typeof M.componentWillUnmount=="function"&&Yg(o,a,M)),cs(e,a,o);break;case 21:cs(e,a,o);break;case 22:ra=(M=ra)||o.memoizedState!==null,cs(e,a,o),ra=M;break;default:cs(e,a,o)}(o.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(o,Lt,qt,Sn,fn),ti(d),$i(y),fn=v,Bn=C}function Qg(e,a){if(Na&&a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Bt(a,yn,e)}catch(o){Ee(a,a.return,o)}}}function Zg(e,a){if(Na&&a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bt(a,vr,e)}catch(o){Ee(a,a.return,o)}}function s3(e){switch(e.tag){case 31:case 13:case 19:var a=e.stateNode;return a===null&&(a=e.stateNode=new PE),a;case 22:return e=e.stateNode,a=e._retryCache,a===null&&(a=e._retryCache=new PE),a;default:throw Error("Unexpected Suspense handler tag ("+e.tag+"). This is a bug in React.")}}function _u(e,a){var o=s3(e);a.forEach(function(d){if(!o.has(d)){if(o.add(d),Tr)if(xp!==null&&Dp!==null)Mu(Dp,xp);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");var y=h3.bind(null,e,d);d.then(y,y)}})}function va(e,a){var o=a.deletions;if(o!==null)for(var d=0;d<o.length;d++){var y=e,v=a,C=o[d],M=Ga();if($e){var B=v;t:for(;B!==null;){switch(B.tag){case 27:if(T){if(Mt(B.type)){oa=B.stateNode,Yi=!1;break t}break}case 5:oa=B.stateNode,Yi=!1;break t;case 3:case 4:oa=B.stateNode.containerInfo,Yi=!0;break t}B=B.return}if(oa===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");Tm(y,v,C),oa=null,Yi=!1}else Tm(y,v,C);(C.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&ha(C,Lt,qt,"Unmount"),ti(M),y=C,v=y.alternate,v!==null&&(v.return=null),y.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Jg(a,e),a=a.sibling}function Jg(e,a){var o=Ga(),d=Rs(),y=ts(),v=es(),C=e.alternate,M=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:va(a,e),Ma(e),M&4&&(Gt(_i|el,e,e.return),cr(_i|el,e),vm(e,e.return,ys|el));break;case 1:va(a,e),Ma(e),M&512&&(ra||C===null||js(C,C.return)),M&64&&wo&&(M=e.updateQueue,M!==null&&(C=M.callbacks,C!==null&&(a=M.shared.hiddenCallbacks,M.shared.hiddenCallbacks=a===null?C:a.concat(C))));break;case 26:if(we){var B=Pl;va(a,e),Ma(e),M&512&&(ra||C===null||js(C,C.return)),M&4&&(M=C!==null?C.memoizedState:null,a=e.memoizedState,C===null?a===null?e.stateNode===null?e.stateNode=Uy(B,e.type,e.memoizedProps,e):qu(B,e.type,e.stateNode):e.stateNode=sp(B,a,e.memoizedProps):M!==a?(M===null?C.stateNode!==null&&rp(C.stateNode):lp(M),a===null?qu(B,e.type,e.stateNode):sp(B,a,e.memoizedProps)):a===null&&e.stateNode!==null&&_d(e,e.memoizedProps,C.memoizedProps));break}case 27:if(T){va(a,e),Ma(e),M&512&&(ra||C===null||js(C,C.return)),C!==null&&M&4&&_d(e,e.memoizedProps,C.memoizedProps);break}case 5:if(va(a,e),Ma(e),M&512&&(ra||C===null||js(C,C.return)),$e){if(e.flags&32){a=e.stateNode;try{Bt(e,ju,a)}catch(Pe){Ee(e,e.return,Pe)}}M&4&&e.stateNode!=null&&(a=e.memoizedProps,_d(e,a,C!==null?C.memoizedProps:a)),M&1024&&(k3=!0,e.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."))}else Ks&&e.alternate!==null&&(e.alternate.stateNode=e.stateNode);break;case 6:if(va(a,e),Ma(e),M&4&&$e){if(e.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");M=e.memoizedProps,C=C!==null?C.memoizedProps:M,a=e.stateNode;try{Bt(e,kt,a,C,M)}catch(Pe){Ee(e,e.return,Pe)}}break;case 3:if(B=Os(),we){r();var q=Pl;Pl=br(a.containerInfo),va(a,e),Pl=q}else va(a,e);if(Ma(e),M&4){if($e&&Na&&C!==null&&C.memoizedState.isDehydrated)try{Bt(e,Bl,a.containerInfo)}catch(Pe){Ee(e,e.return,Pe)}if(Ks){M=a.containerInfo,C=a.pendingChildren;try{Bt(e,kd,M,C)}catch(Pe){Ee(e,e.return,Pe)}}}k3&&(k3=!1,Fg(e)),a.effectDuration+=Rc(B);break;case 4:we?(C=Pl,Pl=br(e.stateNode.containerInfo),va(a,e),Ma(e),Pl=C):(va(a,e),Ma(e)),M&4&&Ks&&us(e.stateNode,e,e.stateNode.pendingChildren);break;case 12:M=Os(),va(a,e),Ma(e),e.stateNode.effectDuration+=cu(M);break;case 31:va(a,e),Ma(e),M&4&&(M=e.updateQueue,M!==null&&(e.updateQueue=null,_u(e,M)));break;case 13:va(a,e),Ma(e),e.child.flags&8192&&e.memoizedState!==null!=(C!==null&&C.memoizedState!==null)&&(p2=fe()),M&4&&(M=e.updateQueue,M!==null&&(e.updateQueue=null,_u(e,M)));break;case 22:B=e.memoizedState!==null;var ct=C!==null&&C.memoizedState!==null,ht=wo,yt=ra;if(wo=ht||B,ra=yt||ct,va(a,e),ra=yt,wo=ht,ct&&!B&&!ht&&!yt&&(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&Ji(e,Lt,qt),Ma(e),M&8192&&(a=e.stateNode,a._visibility=B?a._visibility&~r1:a._visibility|r1,!B||C===null||ct||wo||ra||(lo(e),(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&ha(e,Lt,qt,"Disconnect")),$e)){t:if(C=null,$e)for(a=e;;){if(a.tag===5||we&&a.tag===26){if(C===null){ct=C=a;try{q=ct.stateNode,B?Bt(ct,Lu,q):Bt(ct,Af,ct.stateNode,ct.memoizedProps)}catch(Pe){Ee(ct,ct.return,Pe)}}}else if(a.tag===6){if(C===null){ct=a;try{var Vt=ct.stateNode;B?Bt(ct,g3,Vt):Bt(ct,Hy,Vt,ct.memoizedProps)}catch(Pe){Ee(ct,ct.return,Pe)}}}else if(a.tag===18){if(C===null){ct=a;try{var Jt=ct.stateNode;B?Bt(ct,Of,Jt):Bt(ct,ui,ct.stateNode)}catch(Pe){Ee(ct,ct.return,Pe)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===e)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break t;for(;a.sibling===null;){if(a.return===null||a.return===e)break t;C===a&&(C=null),a=a.return}C===a&&(C=null),a.sibling.return=a.return,a=a.sibling}}M&4&&(M=e.updateQueue,M!==null&&(C=M.retryQueue,C!==null&&(M.retryQueue=null,_u(e,C))));break;case 19:va(a,e),Ma(e),M&4&&(M=e.updateQueue,M!==null&&(e.updateQueue=null,_u(e,M)));break;case 30:break;case 21:break;default:va(a,e),Ma(e)}(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&((Bn||.05<Sn)&&Mn(e,Lt,qt,Sn,fn),e.alternate===null&&e.return!==null&&e.return.alternate!==null&&.05<qt-Lt&&(Kg(e.return.alternate,e.return)||ha(e,Lt,qt,"Mount"))),ti(o),$i(d),fn=y,Bn=v}function Ma(e){var a=e.flags;if(a&2){try{Bt(e,Aa,e)}catch(o){Ee(e,e.return,o)}e.flags&=-3}a&4096&&(e.flags&=-4097)}function Fg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var a=e;Fg(a),a.tag===5&&a.flags&1024&&Df(a.stateNode),e=e.sibling}}function qa(e,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Jn(e,a.alternate,a),a=a.sibling}function fr(e){var a=Ga(),o=Rs(),d=ts(),y=es();switch(e.tag){case 0:case 11:case 14:case 15:vm(e,e.return,ys),lo(e);break;case 1:js(e,e.return);var v=e.stateNode;typeof v.componentWillUnmount=="function"&&Yg(e,e.return,v),lo(e);break;case 27:T&&Bt(e,ft,e.stateNode);case 26:case 5:js(e,e.return),lo(e);break;case 22:e.memoizedState===null&&lo(e);break;case 30:lo(e);break;default:lo(e)}(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(e,Lt,qt,Sn,fn),ti(a),$i(o),fn=d,Bn=y}function lo(e){for(e=e.child;e!==null;)fr(e),e=e.sibling}function kg(e,a,o,d){var y=Ga(),v=Rs(),C=ts(),M=es(),B=o.flags;switch(o.tag){case 0:case 11:case 15:Ps(e,o,d),ym(o,ys);break;case 1:if(Ps(e,o,d),a=o.stateNode,typeof a.componentDidMount=="function"&&Bt(o,B3,o,a),a=o.updateQueue,a!==null){e=o.stateNode;try{Bt(o,Q0,a,e)}catch(q){Ee(o,o.return,q)}}d&&B&64&&bm(o),df(o,o.return);break;case 27:T&&ya(o);case 26:case 5:Ps(e,o,d),d&&a===null&&B&4&&pf(o),df(o,o.return);break;case 12:if(d&&B&4){B=Os(),Ps(e,o,d),d=o.stateNode,d.effectDuration+=cu(B);try{Bt(o,Cd,o,a,Fu,d.effectDuration)}catch(q){Ee(o,o.return,q)}}else Ps(e,o,d);break;case 31:Ps(e,o,d),d&&B&4&&Qg(e,o);break;case 13:Ps(e,o,d),d&&B&4&&Zg(e,o);break;case 22:o.memoizedState===null&&Ps(e,o,d),df(o,o.return);break;case 30:break;default:Ps(e,o,d)}(o.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(o,Lt,qt,Sn,fn),ti(y),$i(v),fn=C,Bn=M}function Ps(e,a,o){for(o=o&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;)kg(e,a.alternate,a,o),a=a.sibling}function ro(e,a){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(e=a.memoizedState.cachePool.pool),e!==o&&(e!=null&&Sl(e),o!=null&&Ir(o))}function Cm(e,a){e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(Sl(a),e!=null&&Ir(e))}function fs(e,a,o,d,y){if(a.subtreeFlags&10256||a.actualDuration!==0&&(a.alternate===null||a.alternate.child!==a.child))for(a=a.child;a!==null;){var v=a.sibling;Ig(e,a,o,d,v!==null?v.actualStartTime:y),a=v}}function Ig(e,a,o,d,y){var v=Ga(),C=Rs(),M=ts(),B=es(),q=Xu,ct=a.flags;switch(a.tag){case 0:case 11:case 15:(a.mode&2)!==Kt&&0<a.actualStartTime&&(a.flags&1)!==0&&di(a,a.actualStartTime,y,Ea,o),fs(e,a,o,d,y),ct&2048&&Pg(a,xi|el);break;case 1:(a.mode&2)!==Kt&&0<a.actualStartTime&&((a.flags&128)!==0?Fi(a,a.actualStartTime,y,[]):(a.flags&1)!==0&&di(a,a.actualStartTime,y,Ea,o)),fs(e,a,o,d,y);break;case 3:var ht=Os(),yt=Ea;Ea=a.alternate!==null&&a.alternate.memoizedState.isDehydrated&&(a.flags&256)===0,fs(e,a,o,d,y),Ea=yt,ct&2048&&(o=null,a.alternate!==null&&(o=a.alternate.memoizedState.cache),d=a.memoizedState.cache,d!==o&&(Sl(d),o!=null&&Ir(o))),e.passiveEffectDuration+=Rc(ht);break;case 12:if(ct&2048){ct=Os(),fs(e,a,o,d,y),e=a.stateNode,e.passiveEffectDuration+=cu(ct);try{Bt(a,qg,a,a.alternate,Fu,e.passiveEffectDuration)}catch(Vt){Ee(a,a.return,Vt)}}else fs(e,a,o,d,y);break;case 31:ct=Ea,ht=a.alternate!==null?a.alternate.memoizedState:null,yt=a.memoizedState,ht!==null&&yt===null?(yt=a.deletions,yt!==null&&0<yt.length&&yt[0].tag===18?(Ea=!1,ht=ht.hydrationErrors,ht!==null&&Fi(a,a.actualStartTime,y,ht)):Ea=!0):Ea=!1,fs(e,a,o,d,y),Ea=ct;break;case 13:ct=Ea,ht=a.alternate!==null?a.alternate.memoizedState:null,yt=a.memoizedState,ht===null||ht.dehydrated===null||yt!==null&&yt.dehydrated!==null?Ea=!1:(yt=a.deletions,yt!==null&&0<yt.length&&yt[0].tag===18?(Ea=!1,ht=ht.hydrationErrors,ht!==null&&Fi(a,a.actualStartTime,y,ht)):Ea=!0),fs(e,a,o,d,y),Ea=ct;break;case 23:break;case 22:yt=a.stateNode,ht=a.alternate,a.memoizedState!==null?yt._visibility&Oo?fs(e,a,o,d,y):mf(e,a,o,d,y):yt._visibility&Oo?fs(e,a,o,d,y):(yt._visibility|=Oo,Ys(e,a,o,d,(a.subtreeFlags&10256)!==0||a.actualDuration!==0&&(a.alternate===null||a.alternate.child!==a.child),y),(a.mode&2)===Kt||Ea||(e=a.actualStartTime,0<=e&&.05<y-e&&Ji(a,e,y),0<=Lt&&0<=qt&&.05<qt-Lt&&Ji(a,Lt,qt))),ct&2048&&ro(ht,a);break;case 24:fs(e,a,o,d,y),ct&2048&&Cm(a.alternate,a);break;default:fs(e,a,o,d,y)}(a.mode&2)!==Kt&&((e=!Ea&&a.alternate===null&&a.return!==null&&a.return.alternate!==null)&&(o=a.actualStartTime,0<=o&&.05<y-o&&ha(a,o,y,"Mount")),0<=Lt&&0<=qt&&((Bn||.05<Sn)&&Mn(a,Lt,qt,Sn,fn),e&&.05<qt-Lt&&ha(a,Lt,qt,"Mount"))),ti(v),$i(C),fn=M,Bn=B,Xu=q}function Ys(e,a,o,d,y,v){for(y=y&&((a.subtreeFlags&10256)!==0||a.actualDuration!==0&&(a.alternate===null||a.alternate.child!==a.child)),a=a.child;a!==null;){var C=a.sibling;Wg(e,a,o,d,y,C!==null?C.actualStartTime:v),a=C}}function Wg(e,a,o,d,y,v){var C=Ga(),M=Rs(),B=ts(),q=es(),ct=Xu;y&&(a.mode&2)!==Kt&&0<a.actualStartTime&&(a.flags&1)!==0&&di(a,a.actualStartTime,v,Ea,o);var ht=a.flags;switch(a.tag){case 0:case 11:case 15:Ys(e,a,o,d,y,v),Pg(a,xi);break;case 23:break;case 22:var yt=a.stateNode;a.memoizedState!==null?yt._visibility&Oo?Ys(e,a,o,d,y,v):mf(e,a,o,d,v):(yt._visibility|=Oo,Ys(e,a,o,d,y,v)),y&&ht&2048&&ro(a.alternate,a);break;case 24:Ys(e,a,o,d,y,v),y&&ht&2048&&Cm(a.alternate,a);break;default:Ys(e,a,o,d,y,v)}(a.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(a,Lt,qt,Sn,fn),ti(C),$i(M),fn=B,Bn=q,Xu=ct}function mf(e,a,o,d,y){if(a.subtreeFlags&10256||a.actualDuration!==0&&(a.alternate===null||a.alternate.child!==a.child))for(var v=a.child;v!==null;){a=v.sibling;var C=e,M=o,B=d,q=a!==null?a.actualStartTime:y,ct=Xu;(v.mode&2)!==Kt&&0<v.actualStartTime&&(v.flags&1)!==0&&di(v,v.actualStartTime,q,Ea,M);var ht=v.flags;switch(v.tag){case 22:mf(C,v,M,B,q),ht&2048&&ro(v.alternate,v);break;case 24:mf(C,v,M,B,q),ht&2048&&Cm(v.alternate,v);break;default:mf(C,v,M,B,q)}Xu=ct,v=a}}function oo(e,a,o){if(e.subtreeFlags&Ap)for(e=e.child;e!==null;)$g(e,a,o),e=e.sibling}function $g(e,a,o){switch(e.tag){case 26:if(oo(e,a,o),e.flags&Ap)if(e.memoizedState!==null)E(o,Pl,e.memoizedState,e.memoizedProps);else{var d=e.stateNode,y=e.type;e=e.memoizedProps,((a&335544128)===a||Pd(y,e))&&Yd(o,d,y,e)}break;case 5:oo(e,a,o),e.flags&Ap&&(d=e.stateNode,y=e.type,e=e.memoizedProps,((a&335544128)===a||Pd(y,e))&&Yd(o,d,y,e));break;case 3:case 4:we?(d=Pl,Pl=br(e.stateNode.containerInfo),oo(e,a,o),Pl=d):oo(e,a,o);break;case 22:e.memoizedState===null&&(d=e.alternate,d!==null&&d.memoizedState!==null?(d=Ap,Ap=16777216,oo(e,a,o),Ap=d):oo(e,a,o));break;default:oo(e,a,o)}}function ty(e){var a=e.alternate;if(a!==null&&(e=a.child,e!==null)){a.child=null;do a=e.sibling,e.sibling=null,e=a;while(e!==null)}}function gf(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var d=a[o],y=Ga();Oa=d,ay(d,e),(d.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&ha(d,Lt,qt,"Unmount"),ti(y)}ty(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ey(e),e=e.sibling}function ey(e){var a=Ga(),o=Rs(),d=ts(),y=es();switch(e.tag){case 0:case 11:case 15:gf(e),e.flags&2048&&Sm(e,e.return,xi|el);break;case 3:var v=Os();gf(e),e.stateNode.passiveEffectDuration+=Rc(v);break;case 12:v=Os(),gf(e),e.stateNode.passiveEffectDuration+=cu(v);break;case 22:v=e.stateNode,e.memoizedState!==null&&v._visibility&Oo&&(e.return===null||e.return.tag!==13)?(v._visibility&=~Oo,xd(e),(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&ha(e,Lt,qt,"Disconnect")):gf(e);break;default:gf(e)}(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(e,Lt,qt,Sn,fn),ti(a),$i(o),Bn=y,fn=d}function xd(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var d=a[o],y=Ga();Oa=d,ay(d,e),(d.mode&2)!==Kt&&0<=Lt&&0<=qt&&.05<qt-Lt&&ha(d,Lt,qt,"Unmount"),ti(y)}ty(e)}for(e=e.child;e!==null;)ny(e),e=e.sibling}function ny(e){var a=Ga(),o=Rs(),d=ts(),y=es();switch(e.tag){case 0:case 11:case 15:Sm(e,e.return,xi),xd(e);break;case 22:var v=e.stateNode;v._visibility&Oo&&(v._visibility&=~Oo,xd(e));break;default:xd(e)}(e.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(e,Lt,qt,Sn,fn),ti(a),$i(o),Bn=y,fn=d}function ay(e,a){for(;Oa!==null;){var o=Oa,d=o,y=a,v=Ga(),C=Rs(),M=ts(),B=es();switch(d.tag){case 0:case 11:case 15:Sm(d,y,xi);break;case 23:case 22:d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool,y!=null&&Sl(y));break;case 24:Ir(d.memoizedState.cache)}if((d.mode&2)!==Kt&&0<=Lt&&0<=qt&&(Bn||.05<Sn)&&Mn(d,Lt,qt,Sn,fn),ti(v),$i(C),Bn=B,fn=M,d=o.child,d!==null)d.return=o,Oa=d;else t:for(o=e;Oa!==null;){if(d=Oa,v=d.sibling,C=d.return,Ls(d),d===o){Oa=null;break t}if(v!==null){v.return=C,Oa=v;break t}Oa=C}}}function _m(e){var a=m3(e);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");return a}if(e=jm(e),e===null)throw Error("Could not find React container within specified host subtree.");return e.stateNode.current}function xm(e,a){var o=e.tag;switch(a.$$typeof){case a2:if(e.type===a.value)return!0;break;case i2:t:{for(a=a.value,e=[e,0],o=0;o<e.length;){var d=e[o++],y=d.tag,v=e[o++],C=a[v];if(y!==5&&y!==26&&y!==27||!Qs(d)){for(;C!=null&&xm(d,C);)v++,C=a[v];if(v===a.length){a=!0;break t}else for(d=d.child;d!==null;)e.push(d,v),d=d.sibling}}a=!1}return a;case s2:if((o===5||o===26||o===27)&&Kd(e.stateNode,a.value))return!0;break;case r2:if((o===5||o===6||o===26||o===27)&&(e=Lm(e),e!==null&&0<=e.indexOf(a.value)))return!0;break;case l2:if((o===5||o===26||o===27)&&(e=e.memoizedProps["data-testname"],typeof e=="string"&&e.toLowerCase()===a.value.toLowerCase()))return!0;break;default:throw Error("Invalid selector type specified.")}return!1}function Dd(e){switch(e.$$typeof){case a2:return"<"+(et(e.value)||"Unknown")+">";case i2:return":has("+(Dd(e)||"")+")";case s2:return'[role="'+e.value+'"]';case r2:return'"'+e.value+'"';case l2:return'[data-testname="'+e.value+'"]';default:throw Error("Invalid selector type specified.")}}function iy(e,a){var o=[];e=[e,0];for(var d=0;d<e.length;){var y=e[d++],v=y.tag,C=e[d++],M=a[C];if(v!==5&&v!==26&&v!==27||!Qs(y)){for(;M!=null&&xm(y,M);)C++,M=a[C];if(C===a.length)o.push(y);else for(y=y.child;y!==null;)e.push(y,C),y=y.sibling}}return o}function Ad(e,a){if(!ds)throw Error("Test selector API is not supported by this renderer.");e=_m(e),e=iy(e,a),a=[],e=Array.from(e);for(var o=0;o<e.length;){var d=e[o++],y=d.tag;if(y===5||y===26||y===27)Qs(d)||a.push(d.stateNode);else for(d=d.child;d!==null;)e.push(d),d=d.sibling}return a}function l3(){ds&&o2.forEach(function(e){return e()})}function sy(){var e=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return e||lt.actQueue===null||console.error("The current testing environment is not configured to support act(...)"),e}function vi(e){if((de&za)!==Ra&&ee!==0)return ee&-ee;var a=lt.T;return a!==null?(a._updatedFibers||(a._updatedFibers=new Set),a._updatedFibers.add(e),Uh()):Vm()}function ly(){if(Xi===0)if((ee&536870912)===0||he){var e=ut;ut<<=1,(ut&3932160)===0&&(ut=262144),Xi=e}else Xi=536870912;return e=gs.current,e!==null&&(e.flags|=32),Xi}function Ie(e,a,o){if(Op&&console.error("useInsertionEffect must not schedule updates."),o5&&(y2=!0),(e===Xe&&(je===Qf||je===Zf)||e.cancelPendingCommit!==null)&&(xu(e,0),Nl(e,ee,Xi,!1)),W(e,o),(de&za)!==Ra&&e===Xe){if(Cr)switch(a.tag){case 0:case 11:case 15:e=ie&&nt(ie)||"Unknown",eT.has(e)||(eT.add(e),a=nt(a)||"Unknown",console.error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",a,e,e));break;case 1:tT||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),tT=!0)}}else Tr&&xe(e,a,o),xy(a),e===Xe&&((de&za)===Ra&&(ac|=o),bn===tc&&Nl(e,ee,Xi,!1)),ja(e)}function Dm(e,a,o){if((de&(za|al))!==Ra)throw Error("Should not already be working.");if(ee!==0&&ie!==null){var d=ie,y=fe();switch(J9){case p1:case Qf:var v=Im;en&&((d=d._debugTask)?d.run(console.timeStamp.bind(console,"Suspended",v,y,"Components ⚛",void 0,"primary-light")):console.timeStamp("Suspended",v,y,"Components ⚛",void 0,"primary-light"));break;case Zf:v=Im,en&&((d=d._debugTask)?d.run(console.timeStamp.bind(console,"Action",v,y,"Components ⚛",void 0,"primary-light")):console.timeStamp("Action",v,y,"Components ⚛",void 0,"primary-light"));break;default:en&&(d=y-Im,3>d||console.timeStamp("Blocked",Im,y,"Components ⚛",void 0,5>d?"primary-light":10>d?"primary":100>d?"primary-dark":"error"))}}v=(o=!o&&(a&127)===0&&(a&e.expiredLanes)===0||F(e,a))?r3(e,a):Mm(e,a,!0);var C=o;do{if(v===Uo){Mp&&!o&&Nl(e,a,0,!1),a=je,Im=ia(),J9=a;break}else{if(d=fe(),y=e.current.alternate,C&&!oy(y)){pn(a),y=fi,v=d,!en||v<=y||(Kn?Kn.run(console.timeStamp.bind(console,"Teared Render",y,v,me,"Scheduler ⚛","error")):console.timeStamp("Teared Render",y,v,me,"Scheduler ⚛","error")),uo(a,d),v=Mm(e,a,!1),C=!1;continue}if(v===Kf){if(C=a,e.errorRecoveryDisabledLanes&C)var M=0;else M=e.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){pn(a),jn(fi,d,a,Kn),uo(a,d),a=M;t:{d=e,v=C,C=g1;var B=Na&&d.current.memoizedState.isDehydrated;if(B&&(xu(d,M).flags|=256),M=Mm(d,M,!1),M!==Kf){if($3&&!B){d.errorRecoveryDisabledLanes|=v,ac|=v,v=tc;break t}d=Di,Di=C,d!==null&&(Di===null?Di=d:Di.push.apply(Di,d))}v=M}if(C=!1,v!==Kf)continue;d=fe()}}if(v===d1){pn(a),jn(fi,d,a,Kn),uo(a,d),xu(e,0),Nl(e,a,0,!0);break}t:{switch(o=e,v){case Uo:case d1:throw Error("Root did not complete. This is a bug in React.");case tc:if((a&4194048)!==a)break;case c2:pn(a),Mi(fi,d,a,Kn),uo(a,d),y=a,(y&127)!==0?Yy=d:(y&4194048)!==0&&(qy=d),Nl(o,a,Xi,!ec);break t;case Kf:Di=null;break;case u2:case YE:break;default:throw Error("Unknown root exit status.")}if(lt.actQueue!==null)Nm(o,y,a,Di,v1,d2,Xi,ac,Jf,v,null,null,fi,d);else{if((a&62914560)===a&&(C=p2+KE-fe(),10<C)){if(Nl(o,a,Xi,!ec),w(o,0,!0)!==0)break t;Yl=a,o.timeoutHandle=Vi(ry.bind(null,o,y,Di,v1,d2,a,Xi,ac,Jf,ec,v,"Throttled",fi,d),C);break t}ry(o,y,Di,v1,d2,a,Xi,ac,Jf,ec,v,null,fi,d)}}}break}while(!0);ja(e)}function ry(e,a,o,d,y,v,C,M,B,q,ct,ht,yt,Vt){e.timeoutHandle=Xs;var Jt=a.subtreeFlags,Pe=null;if((Jt&8192||(Jt&16785408)===16785408)&&(Pe=Vu(),$g(a,v,Pe),Jt=(v&62914560)===v?p2-fe():(v&4194048)===v?XE-fe():0,Jt=qd(Pe,Jt),Jt!==null)){Yl=v,e.cancelPendingCommit=Jt(Nm.bind(null,e,a,v,o,d,y,C,M,B,ct,Pe,Xd(Pe,e.containerInfo),yt,Vt)),Nl(e,v,C,!q);return}Nm(e,a,v,o,d,y,C,M,B,ct,Pe,ht,yt,Vt)}function oy(e){for(var a=e;;){var o=a.tag;if((o===0||o===11||o===15)&&a.flags&16384&&(o=a.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var d=0;d<o.length;d++){var y=o[d],v=y.getSnapshot;y=y.value;try{if(!Ti(v(),y))return!1}catch{return!1}}if(o=a.child,a.subtreeFlags&16384&&o!==null)o.return=a,a=o;else{if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Nl(e,a,o,d){a&=~t5,a&=~ac,e.suspendedLanes|=a,e.pingedLanes&=~a,d&&(e.warmLanes|=a),d=e.expirationTimes;for(var y=a;0<y;){var v=31-kn(y),C=1<<v;d[v]=-1,y&=~C}o!==0&&Tt(e,o,a)}function yf(){return(de&(za|al))===Ra?(Wr(0),!1):!0}function vf(){return(de&(za|al))!==Ra}function Sf(){if(ie!==null){if(je===qi)var e=ie.return;else e=ie,Rh(),Fc(e),yp=null,l1=0,e=ie;for(;e!==null;)Td(e.alternate,e),e=e.return;ie=null}}function uo(e,a){(e&127)!==0&&(Uf=a),(e&4194048)!==0&&(Mo=a)}function xu(e,a){en&&(console.timeStamp("Blocking Track",.003,.003,"Blocking","Scheduler ⚛","primary-light"),console.timeStamp("Transition Track",.003,.003,"Transition","Scheduler ⚛","primary-light"),console.timeStamp("Suspense Track",.003,.003,"Suspense","Scheduler ⚛","primary-light"),console.timeStamp("Idle Track",.003,.003,"Idle","Scheduler ⚛","primary-light"));var o=fi;if(fi=ia(),ee!==0&&0<o){if(pn(ee),bn===u2||bn===tc)Mi(o,fi,a,Kn);else{var d=fi,y=Kn;if(en&&!(d<=o)){var v=(a&738197653)===a?"tertiary-dark":"primary-dark",C=(a&536870912)===a?"Prewarm":(a&201326741)===a?"Interrupted Hydration":"Interrupted Render";y?y.run(console.timeStamp.bind(console,C,o,d,me,"Scheduler ⚛",v)):console.timeStamp(C,o,d,me,"Scheduler ⚛",v)}}uo(ee,fi)}if(o=Kn,Kn=null,(a&127)!==0){Kn=Jm,y=0<=xr&&xr<Uf?Uf:xr,d=0<=Bf&&Bf<Uf?Uf:Bf,v=0<=d?d:0<=y?y:fi,0<=Yy&&(pn(2),Ut(Yy,v,a,o)),o=y;var M=d,B=Fm,q=0<dp,ct=ku===1,ht=ku===2;if(y=fi,d=Jm,v=A3,C=M3,en){if(me="Blocking",0<o?o>y&&(o=y):o=y,0<M?M>o&&(M=o):M=o,B!==null&&o>M){var yt=q?"secondary-light":"warning";d?d.run(console.timeStamp.bind(console,q?"Consecutive":"Event: "+B,M,o,me,"Scheduler ⚛",yt)):console.timeStamp(q?"Consecutive":"Event: "+B,M,o,me,"Scheduler ⚛",yt)}y>o&&(M=ct?"error":(a&738197653)===a?"tertiary-light":"primary-light",ct=ht?"Promise Resolved":ct?"Cascading Update":5<y-o?"Update Blocked":"Update",ht=[],C!=null&&ht.push(["Component name",C]),v!=null&&ht.push(["Method name",v]),o={start:o,end:y,detail:{devtools:{properties:ht,track:me,trackGroup:"Scheduler ⚛",color:M}}},d?d.run(performance.measure.bind(performance,ct,o)):performance.measure(ct,o))}xr=-1.1,ku=0,M3=A3=null,Yy=-1.1,dp=Bf,Bf=-1.1,Uf=ia()}if((a&4194048)!==0&&(Kn=km,y=0<=No&&No<Mo?Mo:No,o=0<=Ws&&Ws<Mo?Mo:Ws,d=0<=Iu&&Iu<Mo?Mo:Iu,v=0<=d?d:0<=o?o:fi,0<=qy&&(pn(256),Ut(qy,v,a,Kn)),ht=d,M=Vf,B=0<Wu,q=N3===2,v=fi,d=km,C=K9,ct=Q9,en&&(me="Transition",0<o?o>v&&(o=v):o=v,0<y?y>o&&(y=o):y=o,0<ht?ht>y&&(ht=y):ht=y,y>ht&&M!==null&&(yt=B?"secondary-light":"warning",d?d.run(console.timeStamp.bind(console,B?"Consecutive":"Event: "+M,ht,y,me,"Scheduler ⚛",yt)):console.timeStamp(B?"Consecutive":"Event: "+M,ht,y,me,"Scheduler ⚛",yt)),o>y&&(d?d.run(console.timeStamp.bind(console,"Action",y,o,me,"Scheduler ⚛","primary-dark")):console.timeStamp("Action",y,o,me,"Scheduler ⚛","primary-dark")),v>o&&(y=q?"Promise Resolved":5<v-o?"Update Blocked":"Update",ht=[],ct!=null&&ht.push(["Component name",ct]),C!=null&&ht.push(["Method name",C]),o={start:o,end:v,detail:{devtools:{properties:ht,track:me,trackGroup:"Scheduler ⚛",color:"primary-light"}}},d?d.run(performance.measure.bind(performance,y,o)):performance.measure(y,o))),Ws=No=-1.1,N3=0,qy=-1.1,Wu=Iu,Iu=-1.1,Mo=ia()),o=e.timeoutHandle,o!==Xs&&(e.timeoutHandle=Xs,Bm(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),Yl=0,Sf(),Xe=e,ie=o=Ol(e.current,null),ee=a,je=qi,vs=null,ec=!1,Mp=F(e,a),$3=!1,bn=Uo,Jf=Xi=t5=ac=nc=0,Di=g1=null,d2=!1,(a&8)!==0&&(a|=a&32),d=e.entangledLanes,d!==0)for(e=e.entanglements,d&=a;0<d;)y=31-kn(d),v=1<<y,a|=e[y],d&=~v;return Ar=a,du(),e=w9(),1e3<e-H9&&(lt.recentlyCreatedOwnerStacks=0,H9=e),jl.discardPendingWarnings(),o}function uy(e,a){Qt=null,lt.H=f1,lt.getCurrentStack=null,Cr=!1,xo=null,a===gp||a===Fy?(a=Y0(),je=p1):a===V3?(a=Y0(),je=qE):je=a===J3?W3:a!==null&&typeof a=="object"&&typeof a.then=="function"?m1:f2,vs=a;var o=ie;o===null?(bn=d1,af(e,Ht(a,e.current))):o.mode&2&&zh(o)}function cy(){var e=gs.current;return e===null?!0:(ee&4194048)===ee?tl===null:(ee&62914560)===ee||(ee&536870912)!==0?e===tl:!1}function Am(){var e=lt.H;return lt.H=f1,e===null?f1:e}function fy(){var e=lt.A;return lt.A=hj,e}function Md(e){Kn===null&&(Kn=e._debugTask==null?null:e._debugTask)}function Nd(){bn=tc,ec||(ee&4194048)!==ee&&gs.current!==null||(Mp=!0),(nc&134217727)===0&&(ac&134217727)===0||Xe===null||Nl(Xe,ee,Xi,!1)}function Mm(e,a,o){var d=de;de|=za;var y=Am(),v=fy();if(Xe!==e||ee!==a){if(Tr){var C=e.memoizedUpdaters;0<C.size&&(Mu(e,ee),C.clear()),Dn(e,a)}v1=null,xu(e,a)}a=!1,C=bn;t:do try{if(je!==qi&&ie!==null){var M=ie,B=vs;switch(je){case W3:Sf(),C=c2;break t;case p1:case Qf:case Zf:case m1:gs.current===null&&(a=!0);var q=je;if(je=qi,vs=null,Du(e,M,B,q),o&&Mp){C=Uo;break t}break;default:q=je,je=qi,vs=null,Du(e,M,B,q)}}hy(),C=bn;break}catch(ct){uy(e,ct)}while(!0);return a&&e.shellSuspendCounter++,Rh(),de=d,lt.H=y,lt.A=v,ie===null&&(Xe=null,ee=0,du()),C}function hy(){for(;ie!==null;)dy(ie)}function r3(e,a){var o=de;de|=za;var d=Am(),y=fy();if(Xe!==e||ee!==a){if(Tr){var v=e.memoizedUpdaters;0<v.size&&(Mu(e,ee),v.clear()),Dn(e,a)}v1=null,y1=fe()+e5,xu(e,a)}else Mp=F(e,a);t:do try{if(je!==qi&&ie!==null)e:switch(a=ie,v=vs,je){case f2:je=qi,vs=null,Du(e,a,v,f2);break;case Qf:case Zf:if(P0(v)){je=qi,vs=null,py(a);break}a=function(){je!==Qf&&je!==Zf||Xe!==e||(je=h2),ja(e)},v.then(a,a);break t;case p1:je=h2;break t;case qE:je=I3;break t;case h2:P0(v)?(je=qi,vs=null,py(a)):(je=qi,vs=null,Du(e,a,v,h2));break;case I3:var C=null;switch(ie.tag){case 26:C=ie.memoizedState;case 5:case 27:var M=ie,B=M.type,q=M.pendingProps;if(C?g(C):pr(M.stateNode,B,q)){je=qi,vs=null;var ct=M.sibling;if(ct!==null)ie=ct;else{var ht=M.return;ht!==null?(ie=ht,Od(ht)):ie=null}break e}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}je=qi,vs=null,Du(e,a,v,I3);break;case m1:je=qi,vs=null,Du(e,a,v,m1);break;case W3:Sf(),bn=c2;break t;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}lt.actQueue!==null?hy():o3();break}catch(yt){uy(e,yt)}while(!0);return Rh(),lt.H=d,lt.A=y,de=o,ie!==null?Uo:(Xe=null,ee=0,du(),bn)}function o3(){for(;ie!==null&&!Xt();)dy(ie)}function dy(e){var a=e.alternate;(e.mode&2)!==Kt?(Hc(e),a=Bt(e,Ya,a,e,Ar),zh(e)):a=Bt(e,Ya,a,e,Ar),e.memoizedProps=e.pendingProps,a===null?Od(e):ie=a}function py(e){var a=Bt(e,u3,e);e.memoizedProps=e.pendingProps,a===null?Od(e):ie=a}function u3(e){var a=e.alternate,o=(e.mode&2)!==Kt;switch(o&&Hc(e),e.tag){case 15:case 0:a=Vs(a,e,e.pendingProps,e.type,void 0,ee);break;case 11:a=Vs(a,e,e.pendingProps,e.type.render,e.ref,ee);break;case 5:Fc(e);default:Td(a,e),e=ie=Ln(e,Ar),a=Ya(a,e,Ar)}return o&&zh(e),a}function Du(e,a,o,d){Rh(),Fc(a),yp=null,l1=0;var y=a.return;try{if(jg(e,y,a,o,ee)){bn=d1,af(e,Ht(o,e.current)),ie=null;return}}catch(v){if(y!==null)throw ie=y,v;bn=d1,af(e,Ht(o,e.current)),ie=null;return}a.flags&32768?(he||d===f2?e=!0:Mp||(ee&536870912)!==0?e=!1:(ec=e=!0,(d===Qf||d===Zf||d===p1||d===m1)&&(d=gs.current,d!==null&&d.tag===13&&(d.flags|=16384))),my(a,e)):Od(a)}function Od(e){var a=e;do{if((a.flags&32768)!==0){my(a,ec);return}var o=a.alternate;if(e=a.return,Hc(a),o=Bt(a,gm,o,a,Ar),(a.mode&2)!==Kt&&w0(a),o!==null){ie=o;return}if(a=a.sibling,a!==null){ie=a;return}ie=a=e}while(a!==null);bn===Uo&&(bn=YE)}function my(e,a){do{var o=ur(e.alternate,e);if(o!==null){o.flags&=32767,ie=o;return}if((e.mode&2)!==Kt){w0(e),o=e.actualDuration;for(var d=e.child;d!==null;)o+=d.actualDuration,d=d.sibling;e.actualDuration=o}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!a&&(e=e.sibling,e!==null)){ie=e;return}ie=e=o}while(e!==null);bn=c2,ie=null}function Nm(e,a,o,d,y,v,C,M,B,q,ct,ht,yt,Vt){e.cancelPendingCommit=null;do Au();while(ua!==sc);if(jl.flushLegacyContextWarning(),jl.flushPendingUnsafeLifecycleWarnings(),(de&(za|al))!==Ra)throw Error("Should not already be working.");if(pn(o),q===Kf?jn(yt,Vt,o,Kn):d!==null?Ae(yt,Vt,o,d,a!==null&&a.alternate!==null&&a.alternate.memoizedState.isDehydrated&&(a.flags&256)!==0,Kn):rn(yt,Vt,o,Kn),a!==null){if(o===0&&console.error("finishedLanes should not be empty during a commit. This is a bug in React."),a===e.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");if(v=a.lanes|a.childLanes,v|=j3,gt(e,o,v,C,M,B),e===Xe&&(ie=Xe=null,ee=0),Np=a,lc=e,Yl=o,i5=v,l5=y,IE=d,s5=Vt,WE=ht,ql=m2,$E=null,a.actualDuration!==0||(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,_y(zf,function(){return wu(),ql===m2&&(ql=a5),by(),null})):(e.callbackNode=null,e.callbackPriority=0),Ao=null,Fu=ia(),ht!==null&&Va(Vt,Fu,ht,Kn),d=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||d){d=lt.T,lt.T=null,y=ri(),zn(2),C=de,de|=al;try{i3(e,a,o)}finally{de=C,zn(y),lt.T=d}}ua=ZE,gy(),yy(),vy()}}function gy(){if(ua===ZE){ua=sc;var e=lc,a=Np,o=Yl,d=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||d){d=lt.T,lt.T=null;var y=ri();zn(2);var v=de;de|=al;try{xp=o,Dp=e,zc(),Jg(a,e),Dp=xp=null,dr(e.containerInfo)}finally{de=v,zn(y),lt.T=d}}e.current=a,ua=JE}}function yy(){if(ua===JE){ua=sc;var e=$E;if(e!==null){Fu=ia();var a=Do,o=Fu;!en||o<=a||console.timeStamp(e,a,o,me,"Scheduler ⚛","secondary-light")}e=lc,a=Np,o=Yl;var d=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||d){d=lt.T,lt.T=null;var y=ri();zn(2);var v=de;de|=al;try{xp=o,Dp=e,zc(),Jn(e,a.alternate,a),Dp=xp=null}finally{de=v,zn(y),lt.T=d}}e=s5,a=WE,Do=ia(),e=a===null?e:Fu,a=Do,o=ql===n5,d=Kn,Ao!==null?ke(e,a,Ao,!1,d):!en||a<=e||(d?d.run(console.timeStamp.bind(console,o?"Commit Interrupted View Transition":"Commit",e,a,me,"Scheduler ⚛",o?"error":"secondary-dark")):console.timeStamp(o?"Commit Interrupted View Transition":"Commit",e,a,me,"Scheduler ⚛",o?"error":"secondary-dark")),ua=FE}}function vy(){if(ua===kE||ua===FE){if(ua===kE){var e=Do;Do=ia();var a=Do,o=ql===n5;!en||a<=e||console.timeStamp(o?"Interrupted View Transition":"Starting Animation",e,a,me,"Scheduler ⚛",o?" error":"secondary-light"),ql!==n5&&(ql=QE)}ua=sc,_e(),e=lc;var d=Np;a=Yl,o=IE;var y=d.actualDuration!==0||(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0;y?ua=g2:(ua=sc,Np=lc=null,Sy(e,e.pendingLanes),Ff=0,b1=null);var v=e.pendingLanes;if(v===0&&(ic=null),y||zm(e),v=ln(a),d=d.stateNode,ci&&typeof ci.onCommitFiberRoot=="function")try{var C=(d.current.flags&128)===128;switch(v){case 2:var M=ye;break;case 8:M=Gl;break;case 32:M=zf;break;case 268435456:M=z9;break;default:M=zf}ci.onCommitFiberRoot(op,d,M,C)}catch(ht){Er||(Er=!0,console.error("React instrumentation encountered an error: %o",ht))}if(Tr&&e.memoizedUpdaters.clear(),l3(),o!==null){C=lt.T,M=ri(),zn(2),lt.T=null;try{var B=e.onRecoverableError;for(d=0;d<o.length;d++){var q=o[d],ct=c3(q.stack);Bt(q.source,B,q.value,ct)}}finally{lt.T=C,zn(M)}}(Yl&3)!==0&&Au(),ja(e),v=e.pendingLanes,(a&261930)!==0&&(v&42)!==0?(Ky=!0,e===r5?S1++:(S1=0,r5=e)):S1=0,y||uo(a,Do),Na&&qm(),Wr(0)}}function c3(e){return e={componentStack:e},Object.defineProperty(e,"digest",{get:function(){console.error('You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.')}}),e}function Sy(e,a){(e.pooledCacheLanes&=a)===0&&(a=e.pooledCache,a!=null&&(e.pooledCache=null,Ir(a)))}function Au(){return gy(),yy(),vy(),by()}function by(){if(ua!==g2)return!1;var e=lc,a=i5;i5=0;var o=ln(Yl),d=32>o?32:o;o=lt.T;var y=ri();try{zn(d),lt.T=null;var v=l5;l5=null,d=lc;var C=Yl;if(ua=sc,Np=lc=null,Yl=0,(de&(za|al))!==Ra)throw Error("Cannot flush passive effects while already rendering.");pn(C),o5=!0,y2=!1;var M=0;if(Ao=null,M=fe(),ql===QE){var B=Do,q=M;!en||q<=B||(Z9?Z9.run(console.timeStamp.bind(console,"Animating",B,q,me,"Scheduler ⚛","secondary-dark")):console.timeStamp("Animating",B,q,me,"Scheduler ⚛","secondary-dark"))}else{B=Do,q=M;var ct=ql===a5;!en||q<=B||(Kn?Kn.run(console.timeStamp.bind(console,ct?"Waiting for Paint":"Waiting",B,q,me,"Scheduler ⚛","secondary-light")):console.timeStamp(ct?"Waiting for Paint":"Waiting",B,q,me,"Scheduler ⚛","secondary-light"))}B=de,de|=al;var ht=d.current;zc(),ey(ht);var yt=d.current;ht=s5,zc(),Ig(d,yt,C,v,ht),zm(d),de=B;var Vt=fe();if(yt=M,ht=Kn,Ao!==null?ke(yt,Vt,Ao,!0,ht):!en||Vt<=yt||(ht?ht.run(console.timeStamp.bind(console,"Remaining Effects",yt,Vt,me,"Scheduler ⚛","secondary-dark")):console.timeStamp("Remaining Effects",yt,Vt,me,"Scheduler ⚛","secondary-dark")),uo(C,Vt),Wr(0,!1),y2?d===b1?Ff++:(Ff=0,b1=d):Ff=0,y2=o5=!1,ci&&typeof ci.onPostCommitFiberRoot=="function")try{ci.onPostCommitFiberRoot(op,d)}catch(Pe){Er||(Er=!0,console.error("React instrumentation encountered an error: %o",Pe))}var Jt=d.current.stateNode;return Jt.effectDuration=0,Jt.passiveEffectDuration=0,!0}finally{zn(y),lt.T=o,Sy(e,a)}}function Ey(e,a,o){a=Ht(o,a),U0(a),a=cd(e.stateNode,a,2),e=Ni(e,a,2),e!==null&&(W(e,2),ja(e))}function Ee(e,a,o){if(Op=!1,e.tag===3)Ey(e,e,o);else{for(;a!==null;){if(a.tag===3){Ey(a,e,o);return}if(a.tag===1){var d=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ic===null||!ic.has(d))){e=Ht(o,e),U0(e),o=fd(2),d=Ni(a,o,2),d!==null&&(hd(o,d,a,e),W(d,2),ja(d));return}}a=a.return}console.error(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
|
|
140
140
|
|
|
141
141
|
Error message:
|
|
142
142
|
|
|
@@ -149,7 +149,7 @@ act(() => {
|
|
|
149
149
|
});
|
|
150
150
|
/* assert on the output */
|
|
151
151
|
|
|
152
|
-
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`),Xe===e&&(ee&o)===o&&(bn===tc||bn===u2&&(ee&62914560)===ee&&fe()-p2<KE?(de&za)===Ra&&xu(e,0):t5|=o,Jf===ee&&(Jf=0)),ja(e)}function Ty(e,a){a===0&&(a=at()),e=_a(e,a),e!==null&&(
|
|
152
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`),Xe===e&&(ee&o)===o&&(bn===tc||bn===u2&&(ee&62914560)===ee&&fe()-p2<KE?(de&za)===Ra&&xu(e,0):t5|=o,Jf===ee&&(Jf=0)),ja(e)}function Ty(e,a){a===0&&(a=at()),e=_a(e,a),e!==null&&(W(e,a),ja(e))}function Cy(e){var a=e.memoizedState,o=0;a!==null&&(o=a.retryLane),Ty(e,o)}function h3(e,a){var o=0;switch(e.tag){case 31:case 13:var d=e.stateNode,y=e.memoizedState;y!==null&&(o=y.retryLane);break;case 19:d=e.stateNode;break;case 22:d=e.stateNode._retryCache;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}d!==null&&d.delete(a),Ty(e,o)}function Rm(e,a,o){if((a.subtreeFlags&67117056)!==0)for(a=a.child;a!==null;){var d=e,y=a,v=y.type===Gd;v=o||v,y.tag!==22?y.flags&67108864?v&&Bt(y,wi,d,y):Rm(d,y,v):y.memoizedState===null&&(v&&y.flags&8192?Bt(y,wi,d,y):y.subtreeFlags&67108864&&Bt(y,Rm,d,y,v)),a=a.sibling}}function wi(e,a){At(!0);try{fr(a),ny(a),kg(e,a.alternate,a,!1),Wg(e,a,0,null,!1,0)}finally{At(!1)}}function zm(e){var a=!0;e.current.mode&24||(a=!1),Rm(e,e.current,a)}function Rd(e){if((de&za)===Ra){var a=e.tag;if(a===3||a===1||a===0||a===11||a===14||a===15){if(a=nt(e)||"ReactComponent",v2!==null){if(v2.has(a))return;v2.add(a)}else v2=new Set([a]);Bt(e,function(){console.error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously tries to update the component. Move this work to useEffect instead.")})}}}function Mu(e,a){Tr&&e.memoizedUpdaters.forEach(function(o){xe(e,o,a)})}function _y(e,a){var o=lt.actQueue;return o!==null?(o.push(a),gj):jt(e,a)}function xy(e){sy()&<.actQueue===null&&Bt(e,function(){console.error(`An update to %s inside a test was not wrapped in act(...).
|
|
153
153
|
|
|
154
154
|
When testing, code that causes React state updates should be wrapped into act(...):
|
|
155
155
|
|
|
@@ -201,7 +201,7 @@ Learn more about this warning here: https://react.dev/link/legacy-context`,d)})}
|
|
|
201
201
|
|
|
202
202
|
Check the render method of \``+y+"`."),v||d&&(v=`
|
|
203
203
|
|
|
204
|
-
Check the top-level render call using <`+d+">.");var C="";o!=null&&e!==o&&(d=null,typeof o.tag=="number"?d=nt(o):typeof o.name=="string"&&(d=o.name),d&&(C=" It was passed a child from "+d+".")),Bt(a,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',v,C)})}}};var qf=Pc(!0),dE=Pc(!1),r1=1,Oo=2,$s=[],vp=0,j3=0,pE=0,mE=1,gE=2,L3=3,$u=!1,yE=!1,P3=null,Y3=!1,Sp=bt(null),Iy=bt(0),gs=bt(null),tl=null,bp=1,o1=2,In=bt(0),Wy=0,el=1,_i=2,ys=4,xi=8,Ep,vE=new Set,SE=new Set,q3=new Set,bE=new Set,Ro=0,Qt=null,qe=null,sa=null,$y=!1,Tp=!1,Xf=!1,t2=0,u1=0,zo=null,cj=0,fj=25,ot=null,nl=null,Ho=-1,c1=!1,f1={readContext:Ve,use:Ce,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useLayoutEffect:gn,useInsertionEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useSyncExternalStore:gn,useId:gn,useHostTransitionStatus:gn,useFormState:gn,useActionState:gn,useOptimistic:gn,useMemoCache:gn,useCacheRefresh:gn};f1.useEffectEvent=gn;var X3=null,EE=null,K3=null,TE=null,Dr=null,Ll=null,e2=null;X3={readContext:function(e){return Ve(e)},use:Ce,useCallback:function(e,a){return ot="useCallback",Ft(),ei(a),sd(e,a)},useContext:function(e){return ot="useContext",Ft(),Ve(e)},useEffect:function(e,a){return ot="useEffect",Ft(),ei(a),ni(e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",Ft(),ei(o),id(e,a,o)},useInsertionEffect:function(e,a){ot="useInsertionEffect",Ft(),ei(a),Cl(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",Ft(),ei(a),_l(e,a)},useMemo:function(e,a){ot="useMemo",Ft(),ei(a);var o=lt.H;lt.H=Dr;try{return ld(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",Ft();var d=lt.H;lt.H=Dr;try{return Ih(e,a,o)}finally{lt.H=d}},useRef:function(e){return ot="useRef",Ft(),rs(e)},useState:function(e){ot="useState",Ft();var a=lt.H;lt.H=Dr;try{return vu(e)}finally{lt.H=a}},useDebugValue:function(){ot="useDebugValue",Ft()},useDeferredValue:function(e,a){return ot="useDeferredValue",Ft(),$c(e,a)},useTransition:function(){return ot="useTransition",Ft(),od()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",Ft(),Wh(e,a,o)},useId:function(){return ot="useId",Ft(),nf()},useFormState:function(e,a){return ot="useFormState",Ft(),gu(),Nn(e,a)},useActionState:function(e,a){return ot="useActionState",Ft(),Nn(e,a)},useOptimistic:function(e){return ot="useOptimistic",Ft(),ed(e)},useHostTransitionStatus:lr,useMemoCache:eo,useCacheRefresh:function(){return ot="useCacheRefresh",Ft(),rr()},useEffectEvent:function(e){return ot="useEffectEvent",Ft(),ar(e)}},EE={readContext:function(e){return Ve(e)},use:Ce,useCallback:function(e,a){return ot="useCallback",Et(),sd(e,a)},useContext:function(e){return ot="useContext",Et(),Ve(e)},useEffect:function(e,a){return ot="useEffect",Et(),ni(e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",Et(),id(e,a,o)},useInsertionEffect:function(e,a){ot="useInsertionEffect",Et(),Cl(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",Et(),_l(e,a)},useMemo:function(e,a){ot="useMemo",Et();var o=lt.H;lt.H=Dr;try{return ld(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",Et();var d=lt.H;lt.H=Dr;try{return Ih(e,a,o)}finally{lt.H=d}},useRef:function(e){return ot="useRef",Et(),rs(e)},useState:function(e){ot="useState",Et();var a=lt.H;lt.H=Dr;try{return vu(e)}finally{lt.H=a}},useDebugValue:function(){ot="useDebugValue",Et()},useDeferredValue:function(e,a){return ot="useDeferredValue",Et(),$c(e,a)},useTransition:function(){return ot="useTransition",Et(),od()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",Et(),Wh(e,a,o)},useId:function(){return ot="useId",Et(),nf()},useActionState:function(e,a){return ot="useActionState",Et(),Nn(e,a)},useFormState:function(e,a){return ot="useFormState",Et(),gu(),Nn(e,a)},useOptimistic:function(e){return ot="useOptimistic",Et(),ed(e)},useHostTransitionStatus:lr,useMemoCache:eo,useCacheRefresh:function(){return ot="useCacheRefresh",Et(),rr()},useEffectEvent:function(e){return ot="useEffectEvent",Et(),ar(e)}},K3={readContext:function(e){return Ve(e)},use:Ce,useCallback:function(e,a){return ot="useCallback",Et(),no(e,a)},useContext:function(e){return ot="useContext",Et(),Ve(e)},useEffect:function(e,a){ot="useEffect",Et(),Da(2048,xi,e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",Et(),sr(e,a,o)},useInsertionEffect:function(e,a){return ot="useInsertionEffect",Et(),Da(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",Et(),Da(4,ys,e,a)},useMemo:function(e,a){ot="useMemo",Et();var o=lt.H;lt.H=Ll;try{return Su(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",Et();var d=lt.H;lt.H=Ll;try{return ws(e,a,o)}finally{lt.H=d}},useRef:function(){return ot="useRef",Et(),De().memoizedState},useState:function(){ot="useState",Et();var e=lt.H;lt.H=Ll;try{return ws(ss)}finally{lt.H=e}},useDebugValue:function(){ot="useDebugValue",Et()},useDeferredValue:function(e,a){return ot="useDeferredValue",Et(),rd(e,a)},useTransition:function(){return ot="useTransition",Et(),wg()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",Et(),nr(e,a,o)},useId:function(){return ot="useId",Et(),De().memoizedState},useFormState:function(e){return ot="useFormState",Et(),gu(),Wc(e)},useActionState:function(e){return ot="useActionState",Et(),Wc(e)},useOptimistic:function(e,a){return ot="useOptimistic",Et(),W0(e,a)},useHostTransitionStatus:lr,useMemoCache:eo,useCacheRefresh:function(){return ot="useCacheRefresh",Et(),De().memoizedState},useEffectEvent:function(e){return ot="useEffectEvent",Et(),ir(e)}},TE={readContext:function(e){return Ve(e)},use:Ce,useCallback:function(e,a){return ot="useCallback",Et(),no(e,a)},useContext:function(e){return ot="useContext",Et(),Ve(e)},useEffect:function(e,a){ot="useEffect",Et(),Da(2048,xi,e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",Et(),sr(e,a,o)},useInsertionEffect:function(e,a){return ot="useInsertionEffect",Et(),Da(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",Et(),Da(4,ys,e,a)},useMemo:function(e,a){ot="useMemo",Et();var o=lt.H;lt.H=e2;try{return Su(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",Et();var d=lt.H;lt.H=e2;try{return yu(e,a,o)}finally{lt.H=d}},useRef:function(){return ot="useRef",Et(),De().memoizedState},useState:function(){ot="useState",Et();var e=lt.H;lt.H=e2;try{return yu(ss)}finally{lt.H=e}},useDebugValue:function(){ot="useDebugValue",Et()},useDeferredValue:function(e,a){return ot="useDeferredValue",Et(),nm(e,a)},useTransition:function(){return ot="useTransition",Et(),xl()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",Et(),nr(e,a,o)},useId:function(){return ot="useId",Et(),De().memoizedState},useFormState:function(e){return ot="useFormState",Et(),gu(),Ri(e)},useActionState:function(e){return ot="useActionState",Et(),Ri(e)},useOptimistic:function(e,a){return ot="useOptimistic",Et(),$0(e,a)},useHostTransitionStatus:lr,useMemoCache:eo,useCacheRefresh:function(){return ot="useCacheRefresh",Et(),De().memoizedState},useEffectEvent:function(e){return ot="useEffectEvent",Et(),ir(e)}},Dr={readContext:function(e){return A(),Ve(e)},use:function(e){return D(),Ce(e)},useCallback:function(e,a){return ot="useCallback",D(),Ft(),sd(e,a)},useContext:function(e){return ot="useContext",D(),Ft(),Ve(e)},useEffect:function(e,a){return ot="useEffect",D(),Ft(),ni(e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",D(),Ft(),id(e,a,o)},useInsertionEffect:function(e,a){ot="useInsertionEffect",D(),Ft(),Cl(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",D(),Ft(),_l(e,a)},useMemo:function(e,a){ot="useMemo",D(),Ft();var o=lt.H;lt.H=Dr;try{return ld(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",D(),Ft();var d=lt.H;lt.H=Dr;try{return Ih(e,a,o)}finally{lt.H=d}},useRef:function(e){return ot="useRef",D(),Ft(),rs(e)},useState:function(e){ot="useState",D(),Ft();var a=lt.H;lt.H=Dr;try{return vu(e)}finally{lt.H=a}},useDebugValue:function(){ot="useDebugValue",D(),Ft()},useDeferredValue:function(e,a){return ot="useDeferredValue",D(),Ft(),$c(e,a)},useTransition:function(){return ot="useTransition",D(),Ft(),od()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",D(),Ft(),Wh(e,a,o)},useId:function(){return ot="useId",D(),Ft(),nf()},useFormState:function(e,a){return ot="useFormState",D(),Ft(),Nn(e,a)},useActionState:function(e,a){return ot="useActionState",D(),Ft(),Nn(e,a)},useOptimistic:function(e){return ot="useOptimistic",D(),Ft(),ed(e)},useMemoCache:function(e){return D(),eo(e)},useHostTransitionStatus:lr,useCacheRefresh:function(){return ot="useCacheRefresh",Ft(),rr()},useEffectEvent:function(e){return ot="useEffectEvent",D(),Ft(),ar(e)}},Ll={readContext:function(e){return A(),Ve(e)},use:function(e){return D(),Ce(e)},useCallback:function(e,a){return ot="useCallback",D(),Et(),no(e,a)},useContext:function(e){return ot="useContext",D(),Et(),Ve(e)},useEffect:function(e,a){ot="useEffect",D(),Et(),Da(2048,xi,e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",D(),Et(),sr(e,a,o)},useInsertionEffect:function(e,a){return ot="useInsertionEffect",D(),Et(),Da(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",D(),Et(),Da(4,ys,e,a)},useMemo:function(e,a){ot="useMemo",D(),Et();var o=lt.H;lt.H=Ll;try{return Su(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",D(),Et();var d=lt.H;lt.H=Ll;try{return ws(e,a,o)}finally{lt.H=d}},useRef:function(){return ot="useRef",D(),Et(),De().memoizedState},useState:function(){ot="useState",D(),Et();var e=lt.H;lt.H=Ll;try{return ws(ss)}finally{lt.H=e}},useDebugValue:function(){ot="useDebugValue",D(),Et()},useDeferredValue:function(e,a){return ot="useDeferredValue",D(),Et(),rd(e,a)},useTransition:function(){return ot="useTransition",D(),Et(),wg()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",D(),Et(),nr(e,a,o)},useId:function(){return ot="useId",D(),Et(),De().memoizedState},useFormState:function(e){return ot="useFormState",D(),Et(),Wc(e)},useActionState:function(e){return ot="useActionState",D(),Et(),Wc(e)},useOptimistic:function(e,a){return ot="useOptimistic",D(),Et(),W0(e,a)},useMemoCache:function(e){return D(),eo(e)},useHostTransitionStatus:lr,useCacheRefresh:function(){return ot="useCacheRefresh",Et(),De().memoizedState},useEffectEvent:function(e){return ot="useEffectEvent",D(),Et(),ir(e)}},e2={readContext:function(e){return A(),Ve(e)},use:function(e){return D(),Ce(e)},useCallback:function(e,a){return ot="useCallback",D(),Et(),no(e,a)},useContext:function(e){return ot="useContext",D(),Et(),Ve(e)},useEffect:function(e,a){ot="useEffect",D(),Et(),Da(2048,xi,e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",D(),Et(),sr(e,a,o)},useInsertionEffect:function(e,a){return ot="useInsertionEffect",D(),Et(),Da(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",D(),Et(),Da(4,ys,e,a)},useMemo:function(e,a){ot="useMemo",D(),Et();var o=lt.H;lt.H=Ll;try{return Su(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",D(),Et();var d=lt.H;lt.H=Ll;try{return yu(e,a,o)}finally{lt.H=d}},useRef:function(){return ot="useRef",D(),Et(),De().memoizedState},useState:function(){ot="useState",D(),Et();var e=lt.H;lt.H=Ll;try{return yu(ss)}finally{lt.H=e}},useDebugValue:function(){ot="useDebugValue",D(),Et()},useDeferredValue:function(e,a){return ot="useDeferredValue",D(),Et(),nm(e,a)},useTransition:function(){return ot="useTransition",D(),Et(),xl()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",D(),Et(),nr(e,a,o)},useId:function(){return ot="useId",D(),Et(),De().memoizedState},useFormState:function(e){return ot="useFormState",D(),Et(),Ri(e)},useActionState:function(e){return ot="useActionState",D(),Et(),Ri(e)},useOptimistic:function(e,a){return ot="useOptimistic",D(),Et(),$0(e,a)},useMemoCache:function(e){return D(),eo(e)},useHostTransitionStatus:lr,useCacheRefresh:function(){return ot="useCacheRefresh",Et(),De().memoizedState},useEffectEvent:function(e){return ot="useEffectEvent",D(),Et(),ir(e)}};var CE={},_E=new Set,xE=new Set,DE=new Set,AE=new Set,ME=new Set,NE=new Set,OE=new Set,RE=new Set,zE=new Set,HE=new Set;Object.freeze(CE);var Q3={enqueueSetState:function(e,a,o){e=e._reactInternals;var d=vi(e),y=El(d);y.payload=a,o!=null&&(sm(o),y.callback=o),a=Ni(e,y,d),a!==null&&(Wi(d,"this.setState()",e),Ie(a,e,d),pu(a,e,d))},enqueueReplaceState:function(e,a,o){e=e._reactInternals;var d=vi(e),y=El(d);y.tag=mE,y.payload=a,o!=null&&(sm(o),y.callback=o),a=Ni(e,y,d),a!==null&&(Wi(d,"this.replaceState()",e),Ie(a,e,d),pu(a,e,d))},enqueueForceUpdate:function(e,a){e=e._reactInternals;var o=vi(e),d=El(o);d.tag=gE,a!=null&&(sm(a),d.callback=a),a=Ni(e,d,o),a!==null&&(Wi(o,"this.forceUpdate()",e),Ie(a,e,o),pu(a,e,o))}},Cp=null,Z3=null,J3=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),la=!1,wE={},UE={},BE={},VE={},_p=!1,GE={},n2={},F3={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},jE=!1,LE=null;LE=new Set;var wo=!1,ra=!1,k3=!1,PE=typeof WeakSet=="function"?WeakSet:Set,Oa=null,xp=null,Dp=null,oa=null,Yi=!1,Pl=null,Ea=!1,Ap=8192,hj={getCacheForType:function(e){var a=Ve(Un),o=a.data.get(e);return o===void 0&&(o=e(),a.data.set(e,o)),o},cacheSignal:function(){return Ve(Un).controller.signal},getOwner:function(){return xo}},a2=0,i2=1,s2=2,l2=3,r2=4;if(typeof Symbol=="function"&&Symbol.for){var h1=Symbol.for;a2=h1("selector.component"),i2=h1("selector.has_pseudo_class"),s2=h1("selector.role"),l2=h1("selector.test_id"),r2=h1("selector.text")}var o2=[],dj=typeof WeakMap=="function"?WeakMap:Map,Ra=0,za=2,al=4,Uo=0,d1=1,Kf=2,u2=3,tc=4,c2=6,YE=5,de=Ra,Xe=null,ie=null,ee=0,qi=0,f2=1,Qf=2,p1=3,qE=4,I3=5,m1=6,h2=7,W3=8,Zf=9,je=qi,vs=null,ec=!1,Mp=!1,$3=!1,Ar=0,bn=Uo,nc=0,ac=0,t5=0,Xi=0,Jf=0,g1=null,Di=null,d2=!1,p2=0,XE=0,KE=300,y1=1/0,e5=500,v1=null,Kn=null,ic=null,m2=0,n5=1,a5=2,QE=3,sc=0,ZE=1,JE=2,FE=3,kE=4,g2=5,ua=0,lc=null,Np=null,Yl=0,i5=0,s5=-0,l5=null,IE=null,WE=null,ql=m2,$E=null,pj=50,S1=0,r5=null,o5=!1,y2=!1,mj=50,Ff=0,b1=null,Op=!1,v2=null,tT=!1,eT=new Set,gj={},il=null,Rp=null,nT=!1;try{var aT=Object.preventExtensions({})}catch{nT=!0}var iT=!1,sT={},lT=null,rT=null,oT=null,uT=null,cT=null,fT=null,hT=null,dT=null,pT=null,mT=null;return lT=function(e,a,o,d){a=i(e,a),a!==null&&(o=s(a.memoizedState,o,0,d),a.memoizedState=o,a.baseState=o,e.memoizedProps=Me({},e.memoizedProps),o=_a(e,2),o!==null&&Ie(o,e,2))},rT=function(e,a,o){a=i(e,a),a!==null&&(o=f(a.memoizedState,o,0),a.memoizedState=o,a.baseState=o,e.memoizedProps=Me({},e.memoizedProps),o=_a(e,2),o!==null&&Ie(o,e,2))},oT=function(e,a,o,d){a=i(e,a),a!==null&&(o=u(a.memoizedState,o,d),a.memoizedState=o,a.baseState=o,e.memoizedProps=Me({},e.memoizedProps),o=_a(e,2),o!==null&&Ie(o,e,2))},uT=function(e,a,o){e.pendingProps=s(e.memoizedProps,a,0,o),e.alternate&&(e.alternate.pendingProps=e.pendingProps),a=_a(e,2),a!==null&&Ie(a,e,2)},cT=function(e,a){e.pendingProps=f(e.memoizedProps,a,0),e.alternate&&(e.alternate.pendingProps=e.pendingProps),a=_a(e,2),a!==null&&Ie(a,e,2)},fT=function(e,a,o){e.pendingProps=u(e.memoizedProps,a,o),e.alternate&&(e.alternate.pendingProps=e.pendingProps),a=_a(e,2),a!==null&&Ie(a,e,2)},hT=function(e){var a=_a(e,2);a!==null&&Ie(a,e,2)},dT=function(e){var a=at(),o=_a(e,a);o!==null&&Ie(o,e,a)},pT=function(e){m=e},mT=function(e){p=e},ae.attemptContinuousHydration=function(e){if(e.tag===13||e.tag===31){var a=_a(e,67108864);a!==null&&Ie(a,e,67108864),Ou(e,67108864)}},ae.attemptHydrationAtCurrentPriority=function(e){if(e.tag===13||e.tag===31){var a=vi(e);a=xn(a);var o=_a(e,a);o!==null&&Ie(o,e,a),Ou(e,a)}},ae.attemptSynchronousHydration=function(e){switch(e.tag){case 3:if(e=e.stateNode,e.current.memoizedState.isDehydrated){var a=tt(e.pendingLanes);if(a!==0){for(e.pendingLanes|=2,e.entangledLanes|=2;a;){var o=1<<31-kn(a);e.entanglements[1]|=o,a&=~o}ja(e),(de&(za|al))===Ra&&(y1=fe()+e5,Wr(0))}}break;case 31:case 13:a=_a(e,2),a!==null&&Ie(a,e,2),yf(),Ou(e,2)}},ae.batchedUpdates=function(e,a){return e(a)},ae.createComponentSelector=function(e){return{$$typeof:a2,value:e}},ae.createContainer=function(e,a,o,d,y,v,C,M,B,q){return ho(e,a,!1,null,o,d,v,null,C,M,B,q)},ae.createHasPseudoClassSelector=function(e){return{$$typeof:i2,value:e}},ae.createHydrationContainer=function(e,a,o,d,y,v,C,M,B,q,ct,ht,yt,Vt){return e=ho(o,d,!0,e,y,v,M,Vt,B,q,ct,ht),e.context=My(null),o=e.current,d=vi(o),d=xn(d),y=El(d),y.callback=a??null,Ni(o,y,d),Wi(d,"hydrateRoot()",null),a=d,e.current.lanes=a,$(e,a),ja(e),e},ae.createPortal=function(e,a,o){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{ii(d);var y=!1}catch{y=!0}return y&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object"),ii(d)),{$$typeof:zl,key:d==null?null:""+d,children:e,containerInfo:a,implementation:o}},ae.createRoleSelector=function(e){return{$$typeof:s2,value:e}},ae.createTestNameSelector=function(e){return{$$typeof:l2,value:e}},ae.createTextSelector=function(e){return{$$typeof:r2,value:e}},ae.defaultOnCaughtError=function(e){var a=Cp?"The above error occurred in the <"+Cp+"> component.":"The above error occurred in one of your React components.",o="React will try to recreate this component tree from scratch using the error boundary you provided, "+((Z3||"Anonymous")+".");typeof e=="object"&&e!==null&&typeof e.environmentName=="string"?yo("error",[`%o
|
|
204
|
+
Check the top-level render call using <`+d+">.");var C="";o!=null&&e!==o&&(d=null,typeof o.tag=="number"?d=nt(o):typeof o.name=="string"&&(d=o.name),d&&(C=" It was passed a child from "+d+".")),Bt(a,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',v,C)})}}};var qf=Pc(!0),dE=Pc(!1),r1=1,Oo=2,$s=[],vp=0,j3=0,pE=0,mE=1,gE=2,L3=3,$u=!1,yE=!1,P3=null,Y3=!1,Sp=bt(null),Iy=bt(0),gs=bt(null),tl=null,bp=1,o1=2,In=bt(0),Wy=0,el=1,_i=2,ys=4,xi=8,Ep,vE=new Set,SE=new Set,q3=new Set,bE=new Set,Ro=0,Qt=null,qe=null,sa=null,$y=!1,Tp=!1,Xf=!1,t2=0,u1=0,zo=null,cj=0,fj=25,ot=null,nl=null,Ho=-1,c1=!1,f1={readContext:Ve,use:Ce,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useLayoutEffect:gn,useInsertionEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useSyncExternalStore:gn,useId:gn,useHostTransitionStatus:gn,useFormState:gn,useActionState:gn,useOptimistic:gn,useMemoCache:gn,useCacheRefresh:gn};f1.useEffectEvent=gn;var X3=null,EE=null,K3=null,TE=null,Dr=null,Ll=null,e2=null;X3={readContext:function(e){return Ve(e)},use:Ce,useCallback:function(e,a){return ot="useCallback",Ft(),ei(a),sd(e,a)},useContext:function(e){return ot="useContext",Ft(),Ve(e)},useEffect:function(e,a){return ot="useEffect",Ft(),ei(a),ni(e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",Ft(),ei(o),id(e,a,o)},useInsertionEffect:function(e,a){ot="useInsertionEffect",Ft(),ei(a),Cl(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",Ft(),ei(a),_l(e,a)},useMemo:function(e,a){ot="useMemo",Ft(),ei(a);var o=lt.H;lt.H=Dr;try{return ld(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",Ft();var d=lt.H;lt.H=Dr;try{return Ih(e,a,o)}finally{lt.H=d}},useRef:function(e){return ot="useRef",Ft(),rs(e)},useState:function(e){ot="useState",Ft();var a=lt.H;lt.H=Dr;try{return vu(e)}finally{lt.H=a}},useDebugValue:function(){ot="useDebugValue",Ft()},useDeferredValue:function(e,a){return ot="useDeferredValue",Ft(),$c(e,a)},useTransition:function(){return ot="useTransition",Ft(),od()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",Ft(),Wh(e,a,o)},useId:function(){return ot="useId",Ft(),nf()},useFormState:function(e,a){return ot="useFormState",Ft(),gu(),Nn(e,a)},useActionState:function(e,a){return ot="useActionState",Ft(),Nn(e,a)},useOptimistic:function(e){return ot="useOptimistic",Ft(),ed(e)},useHostTransitionStatus:lr,useMemoCache:eo,useCacheRefresh:function(){return ot="useCacheRefresh",Ft(),rr()},useEffectEvent:function(e){return ot="useEffectEvent",Ft(),ar(e)}},EE={readContext:function(e){return Ve(e)},use:Ce,useCallback:function(e,a){return ot="useCallback",Et(),sd(e,a)},useContext:function(e){return ot="useContext",Et(),Ve(e)},useEffect:function(e,a){return ot="useEffect",Et(),ni(e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",Et(),id(e,a,o)},useInsertionEffect:function(e,a){ot="useInsertionEffect",Et(),Cl(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",Et(),_l(e,a)},useMemo:function(e,a){ot="useMemo",Et();var o=lt.H;lt.H=Dr;try{return ld(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",Et();var d=lt.H;lt.H=Dr;try{return Ih(e,a,o)}finally{lt.H=d}},useRef:function(e){return ot="useRef",Et(),rs(e)},useState:function(e){ot="useState",Et();var a=lt.H;lt.H=Dr;try{return vu(e)}finally{lt.H=a}},useDebugValue:function(){ot="useDebugValue",Et()},useDeferredValue:function(e,a){return ot="useDeferredValue",Et(),$c(e,a)},useTransition:function(){return ot="useTransition",Et(),od()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",Et(),Wh(e,a,o)},useId:function(){return ot="useId",Et(),nf()},useActionState:function(e,a){return ot="useActionState",Et(),Nn(e,a)},useFormState:function(e,a){return ot="useFormState",Et(),gu(),Nn(e,a)},useOptimistic:function(e){return ot="useOptimistic",Et(),ed(e)},useHostTransitionStatus:lr,useMemoCache:eo,useCacheRefresh:function(){return ot="useCacheRefresh",Et(),rr()},useEffectEvent:function(e){return ot="useEffectEvent",Et(),ar(e)}},K3={readContext:function(e){return Ve(e)},use:Ce,useCallback:function(e,a){return ot="useCallback",Et(),no(e,a)},useContext:function(e){return ot="useContext",Et(),Ve(e)},useEffect:function(e,a){ot="useEffect",Et(),Da(2048,xi,e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",Et(),sr(e,a,o)},useInsertionEffect:function(e,a){return ot="useInsertionEffect",Et(),Da(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",Et(),Da(4,ys,e,a)},useMemo:function(e,a){ot="useMemo",Et();var o=lt.H;lt.H=Ll;try{return Su(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",Et();var d=lt.H;lt.H=Ll;try{return ws(e,a,o)}finally{lt.H=d}},useRef:function(){return ot="useRef",Et(),De().memoizedState},useState:function(){ot="useState",Et();var e=lt.H;lt.H=Ll;try{return ws(ss)}finally{lt.H=e}},useDebugValue:function(){ot="useDebugValue",Et()},useDeferredValue:function(e,a){return ot="useDeferredValue",Et(),rd(e,a)},useTransition:function(){return ot="useTransition",Et(),wg()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",Et(),nr(e,a,o)},useId:function(){return ot="useId",Et(),De().memoizedState},useFormState:function(e){return ot="useFormState",Et(),gu(),Wc(e)},useActionState:function(e){return ot="useActionState",Et(),Wc(e)},useOptimistic:function(e,a){return ot="useOptimistic",Et(),W0(e,a)},useHostTransitionStatus:lr,useMemoCache:eo,useCacheRefresh:function(){return ot="useCacheRefresh",Et(),De().memoizedState},useEffectEvent:function(e){return ot="useEffectEvent",Et(),ir(e)}},TE={readContext:function(e){return Ve(e)},use:Ce,useCallback:function(e,a){return ot="useCallback",Et(),no(e,a)},useContext:function(e){return ot="useContext",Et(),Ve(e)},useEffect:function(e,a){ot="useEffect",Et(),Da(2048,xi,e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",Et(),sr(e,a,o)},useInsertionEffect:function(e,a){return ot="useInsertionEffect",Et(),Da(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",Et(),Da(4,ys,e,a)},useMemo:function(e,a){ot="useMemo",Et();var o=lt.H;lt.H=e2;try{return Su(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",Et();var d=lt.H;lt.H=e2;try{return yu(e,a,o)}finally{lt.H=d}},useRef:function(){return ot="useRef",Et(),De().memoizedState},useState:function(){ot="useState",Et();var e=lt.H;lt.H=e2;try{return yu(ss)}finally{lt.H=e}},useDebugValue:function(){ot="useDebugValue",Et()},useDeferredValue:function(e,a){return ot="useDeferredValue",Et(),nm(e,a)},useTransition:function(){return ot="useTransition",Et(),xl()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",Et(),nr(e,a,o)},useId:function(){return ot="useId",Et(),De().memoizedState},useFormState:function(e){return ot="useFormState",Et(),gu(),Ri(e)},useActionState:function(e){return ot="useActionState",Et(),Ri(e)},useOptimistic:function(e,a){return ot="useOptimistic",Et(),$0(e,a)},useHostTransitionStatus:lr,useMemoCache:eo,useCacheRefresh:function(){return ot="useCacheRefresh",Et(),De().memoizedState},useEffectEvent:function(e){return ot="useEffectEvent",Et(),ir(e)}},Dr={readContext:function(e){return A(),Ve(e)},use:function(e){return D(),Ce(e)},useCallback:function(e,a){return ot="useCallback",D(),Ft(),sd(e,a)},useContext:function(e){return ot="useContext",D(),Ft(),Ve(e)},useEffect:function(e,a){return ot="useEffect",D(),Ft(),ni(e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",D(),Ft(),id(e,a,o)},useInsertionEffect:function(e,a){ot="useInsertionEffect",D(),Ft(),Cl(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",D(),Ft(),_l(e,a)},useMemo:function(e,a){ot="useMemo",D(),Ft();var o=lt.H;lt.H=Dr;try{return ld(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",D(),Ft();var d=lt.H;lt.H=Dr;try{return Ih(e,a,o)}finally{lt.H=d}},useRef:function(e){return ot="useRef",D(),Ft(),rs(e)},useState:function(e){ot="useState",D(),Ft();var a=lt.H;lt.H=Dr;try{return vu(e)}finally{lt.H=a}},useDebugValue:function(){ot="useDebugValue",D(),Ft()},useDeferredValue:function(e,a){return ot="useDeferredValue",D(),Ft(),$c(e,a)},useTransition:function(){return ot="useTransition",D(),Ft(),od()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",D(),Ft(),Wh(e,a,o)},useId:function(){return ot="useId",D(),Ft(),nf()},useFormState:function(e,a){return ot="useFormState",D(),Ft(),Nn(e,a)},useActionState:function(e,a){return ot="useActionState",D(),Ft(),Nn(e,a)},useOptimistic:function(e){return ot="useOptimistic",D(),Ft(),ed(e)},useMemoCache:function(e){return D(),eo(e)},useHostTransitionStatus:lr,useCacheRefresh:function(){return ot="useCacheRefresh",Ft(),rr()},useEffectEvent:function(e){return ot="useEffectEvent",D(),Ft(),ar(e)}},Ll={readContext:function(e){return A(),Ve(e)},use:function(e){return D(),Ce(e)},useCallback:function(e,a){return ot="useCallback",D(),Et(),no(e,a)},useContext:function(e){return ot="useContext",D(),Et(),Ve(e)},useEffect:function(e,a){ot="useEffect",D(),Et(),Da(2048,xi,e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",D(),Et(),sr(e,a,o)},useInsertionEffect:function(e,a){return ot="useInsertionEffect",D(),Et(),Da(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",D(),Et(),Da(4,ys,e,a)},useMemo:function(e,a){ot="useMemo",D(),Et();var o=lt.H;lt.H=Ll;try{return Su(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",D(),Et();var d=lt.H;lt.H=Ll;try{return ws(e,a,o)}finally{lt.H=d}},useRef:function(){return ot="useRef",D(),Et(),De().memoizedState},useState:function(){ot="useState",D(),Et();var e=lt.H;lt.H=Ll;try{return ws(ss)}finally{lt.H=e}},useDebugValue:function(){ot="useDebugValue",D(),Et()},useDeferredValue:function(e,a){return ot="useDeferredValue",D(),Et(),rd(e,a)},useTransition:function(){return ot="useTransition",D(),Et(),wg()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",D(),Et(),nr(e,a,o)},useId:function(){return ot="useId",D(),Et(),De().memoizedState},useFormState:function(e){return ot="useFormState",D(),Et(),Wc(e)},useActionState:function(e){return ot="useActionState",D(),Et(),Wc(e)},useOptimistic:function(e,a){return ot="useOptimistic",D(),Et(),W0(e,a)},useMemoCache:function(e){return D(),eo(e)},useHostTransitionStatus:lr,useCacheRefresh:function(){return ot="useCacheRefresh",Et(),De().memoizedState},useEffectEvent:function(e){return ot="useEffectEvent",D(),Et(),ir(e)}},e2={readContext:function(e){return A(),Ve(e)},use:function(e){return D(),Ce(e)},useCallback:function(e,a){return ot="useCallback",D(),Et(),no(e,a)},useContext:function(e){return ot="useContext",D(),Et(),Ve(e)},useEffect:function(e,a){ot="useEffect",D(),Et(),Da(2048,xi,e,a)},useImperativeHandle:function(e,a,o){return ot="useImperativeHandle",D(),Et(),sr(e,a,o)},useInsertionEffect:function(e,a){return ot="useInsertionEffect",D(),Et(),Da(4,_i,e,a)},useLayoutEffect:function(e,a){return ot="useLayoutEffect",D(),Et(),Da(4,ys,e,a)},useMemo:function(e,a){ot="useMemo",D(),Et();var o=lt.H;lt.H=Ll;try{return Su(e,a)}finally{lt.H=o}},useReducer:function(e,a,o){ot="useReducer",D(),Et();var d=lt.H;lt.H=Ll;try{return yu(e,a,o)}finally{lt.H=d}},useRef:function(){return ot="useRef",D(),Et(),De().memoizedState},useState:function(){ot="useState",D(),Et();var e=lt.H;lt.H=Ll;try{return yu(ss)}finally{lt.H=e}},useDebugValue:function(){ot="useDebugValue",D(),Et()},useDeferredValue:function(e,a){return ot="useDeferredValue",D(),Et(),nm(e,a)},useTransition:function(){return ot="useTransition",D(),Et(),xl()},useSyncExternalStore:function(e,a,o){return ot="useSyncExternalStore",D(),Et(),nr(e,a,o)},useId:function(){return ot="useId",D(),Et(),De().memoizedState},useFormState:function(e){return ot="useFormState",D(),Et(),Ri(e)},useActionState:function(e){return ot="useActionState",D(),Et(),Ri(e)},useOptimistic:function(e,a){return ot="useOptimistic",D(),Et(),$0(e,a)},useMemoCache:function(e){return D(),eo(e)},useHostTransitionStatus:lr,useCacheRefresh:function(){return ot="useCacheRefresh",Et(),De().memoizedState},useEffectEvent:function(e){return ot="useEffectEvent",D(),Et(),ir(e)}};var CE={},_E=new Set,xE=new Set,DE=new Set,AE=new Set,ME=new Set,NE=new Set,OE=new Set,RE=new Set,zE=new Set,HE=new Set;Object.freeze(CE);var Q3={enqueueSetState:function(e,a,o){e=e._reactInternals;var d=vi(e),y=El(d);y.payload=a,o!=null&&(sm(o),y.callback=o),a=Ni(e,y,d),a!==null&&(Wi(d,"this.setState()",e),Ie(a,e,d),pu(a,e,d))},enqueueReplaceState:function(e,a,o){e=e._reactInternals;var d=vi(e),y=El(d);y.tag=mE,y.payload=a,o!=null&&(sm(o),y.callback=o),a=Ni(e,y,d),a!==null&&(Wi(d,"this.replaceState()",e),Ie(a,e,d),pu(a,e,d))},enqueueForceUpdate:function(e,a){e=e._reactInternals;var o=vi(e),d=El(o);d.tag=gE,a!=null&&(sm(a),d.callback=a),a=Ni(e,d,o),a!==null&&(Wi(o,"this.forceUpdate()",e),Ie(a,e,o),pu(a,e,o))}},Cp=null,Z3=null,J3=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),la=!1,wE={},UE={},BE={},VE={},_p=!1,GE={},n2={},F3={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},jE=!1,LE=null;LE=new Set;var wo=!1,ra=!1,k3=!1,PE=typeof WeakSet=="function"?WeakSet:Set,Oa=null,xp=null,Dp=null,oa=null,Yi=!1,Pl=null,Ea=!1,Ap=8192,hj={getCacheForType:function(e){var a=Ve(Un),o=a.data.get(e);return o===void 0&&(o=e(),a.data.set(e,o)),o},cacheSignal:function(){return Ve(Un).controller.signal},getOwner:function(){return xo}},a2=0,i2=1,s2=2,l2=3,r2=4;if(typeof Symbol=="function"&&Symbol.for){var h1=Symbol.for;a2=h1("selector.component"),i2=h1("selector.has_pseudo_class"),s2=h1("selector.role"),l2=h1("selector.test_id"),r2=h1("selector.text")}var o2=[],dj=typeof WeakMap=="function"?WeakMap:Map,Ra=0,za=2,al=4,Uo=0,d1=1,Kf=2,u2=3,tc=4,c2=6,YE=5,de=Ra,Xe=null,ie=null,ee=0,qi=0,f2=1,Qf=2,p1=3,qE=4,I3=5,m1=6,h2=7,W3=8,Zf=9,je=qi,vs=null,ec=!1,Mp=!1,$3=!1,Ar=0,bn=Uo,nc=0,ac=0,t5=0,Xi=0,Jf=0,g1=null,Di=null,d2=!1,p2=0,XE=0,KE=300,y1=1/0,e5=500,v1=null,Kn=null,ic=null,m2=0,n5=1,a5=2,QE=3,sc=0,ZE=1,JE=2,FE=3,kE=4,g2=5,ua=0,lc=null,Np=null,Yl=0,i5=0,s5=-0,l5=null,IE=null,WE=null,ql=m2,$E=null,pj=50,S1=0,r5=null,o5=!1,y2=!1,mj=50,Ff=0,b1=null,Op=!1,v2=null,tT=!1,eT=new Set,gj={},il=null,Rp=null,nT=!1;try{var aT=Object.preventExtensions({})}catch{nT=!0}var iT=!1,sT={},lT=null,rT=null,oT=null,uT=null,cT=null,fT=null,hT=null,dT=null,pT=null,mT=null;return lT=function(e,a,o,d){a=i(e,a),a!==null&&(o=s(a.memoizedState,o,0,d),a.memoizedState=o,a.baseState=o,e.memoizedProps=Me({},e.memoizedProps),o=_a(e,2),o!==null&&Ie(o,e,2))},rT=function(e,a,o){a=i(e,a),a!==null&&(o=f(a.memoizedState,o,0),a.memoizedState=o,a.baseState=o,e.memoizedProps=Me({},e.memoizedProps),o=_a(e,2),o!==null&&Ie(o,e,2))},oT=function(e,a,o,d){a=i(e,a),a!==null&&(o=u(a.memoizedState,o,d),a.memoizedState=o,a.baseState=o,e.memoizedProps=Me({},e.memoizedProps),o=_a(e,2),o!==null&&Ie(o,e,2))},uT=function(e,a,o){e.pendingProps=s(e.memoizedProps,a,0,o),e.alternate&&(e.alternate.pendingProps=e.pendingProps),a=_a(e,2),a!==null&&Ie(a,e,2)},cT=function(e,a){e.pendingProps=f(e.memoizedProps,a,0),e.alternate&&(e.alternate.pendingProps=e.pendingProps),a=_a(e,2),a!==null&&Ie(a,e,2)},fT=function(e,a,o){e.pendingProps=u(e.memoizedProps,a,o),e.alternate&&(e.alternate.pendingProps=e.pendingProps),a=_a(e,2),a!==null&&Ie(a,e,2)},hT=function(e){var a=_a(e,2);a!==null&&Ie(a,e,2)},dT=function(e){var a=at(),o=_a(e,a);o!==null&&Ie(o,e,a)},pT=function(e){m=e},mT=function(e){p=e},ae.attemptContinuousHydration=function(e){if(e.tag===13||e.tag===31){var a=_a(e,67108864);a!==null&&Ie(a,e,67108864),Ou(e,67108864)}},ae.attemptHydrationAtCurrentPriority=function(e){if(e.tag===13||e.tag===31){var a=vi(e);a=xn(a);var o=_a(e,a);o!==null&&Ie(o,e,a),Ou(e,a)}},ae.attemptSynchronousHydration=function(e){switch(e.tag){case 3:if(e=e.stateNode,e.current.memoizedState.isDehydrated){var a=tt(e.pendingLanes);if(a!==0){for(e.pendingLanes|=2,e.entangledLanes|=2;a;){var o=1<<31-kn(a);e.entanglements[1]|=o,a&=~o}ja(e),(de&(za|al))===Ra&&(y1=fe()+e5,Wr(0))}}break;case 31:case 13:a=_a(e,2),a!==null&&Ie(a,e,2),yf(),Ou(e,2)}},ae.batchedUpdates=function(e,a){return e(a)},ae.createComponentSelector=function(e){return{$$typeof:a2,value:e}},ae.createContainer=function(e,a,o,d,y,v,C,M,B,q){return ho(e,a,!1,null,o,d,v,null,C,M,B,q)},ae.createHasPseudoClassSelector=function(e){return{$$typeof:i2,value:e}},ae.createHydrationContainer=function(e,a,o,d,y,v,C,M,B,q,ct,ht,yt,Vt){return e=ho(o,d,!0,e,y,v,M,Vt,B,q,ct,ht),e.context=My(null),o=e.current,d=vi(o),d=xn(d),y=El(d),y.callback=a??null,Ni(o,y,d),Wi(d,"hydrateRoot()",null),a=d,e.current.lanes=a,W(e,a),ja(e),e},ae.createPortal=function(e,a,o){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{ii(d);var y=!1}catch{y=!0}return y&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object"),ii(d)),{$$typeof:zl,key:d==null?null:""+d,children:e,containerInfo:a,implementation:o}},ae.createRoleSelector=function(e){return{$$typeof:s2,value:e}},ae.createTestNameSelector=function(e){return{$$typeof:l2,value:e}},ae.createTextSelector=function(e){return{$$typeof:r2,value:e}},ae.defaultOnCaughtError=function(e){var a=Cp?"The above error occurred in the <"+Cp+"> component.":"The above error occurred in one of your React components.",o="React will try to recreate this component tree from scratch using the error boundary you provided, "+((Z3||"Anonymous")+".");typeof e=="object"&&e!==null&&typeof e.environmentName=="string"?yo("error",[`%o
|
|
205
205
|
|
|
206
206
|
%s
|
|
207
207
|
|
|
@@ -226,9 +226,9 @@ For more info see: https://github.com/konvajs/react-konva/issues/256
|
|
|
226
226
|
`,$_=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
|
227
227
|
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
|
228
228
|
For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
229
|
-
`,tx={};function q1(n,t,i=tx){if(!T4&&"zIndex"in t&&(console.warn($_),T4=!0),!C4&&t.draggable){var s=t.x!==void 0||t.y!==void 0,u=t.onDragEnd||t.onDragMove;s&&!u&&(console.warn(W_),C4=!0)}for(var c in i)if(!E4[c]){var f=c.slice(0,2)==="on",p=i[c]!==t[c];if(f&&p){var m=c.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),n.off(m,i[c])}var S=!t.hasOwnProperty(c);S&&n.setAttr(c,void 0)}var b=t._useStrictMode,_={},x=!1;const D={};for(var c in t)if(!E4[c]){var f=c.slice(0,2)==="on",A=i[c]!==t[c];if(f&&A){var m=c.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),t[c]&&(D[m]=t[c])}!f&&(t[c]!==i[c]||b&&t[c]!==n.getAttr(c))&&(x=!0,_[c]=t[c])}x&&(n.setAttrs(_),Xo(n));for(var m in D)n.off(m+Y1),n.on(m+Y1,D[m])}function Xo(n){if(!Ot.autoDrawEnabled){var t=n.getLayer()||n.getStage();t&&t.batchDraw()}}var k2=J2();const _4={},ex={};$f.Node.prototype._applyProps=q1;let x4=P1.DefaultEventPriority;function nx(n,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}n.add(t),Xo(n)}function ax(n,t,i){let s=$f[n];s||(console.error(`Konva has no node with the type ${n}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${n}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),s=$f.Group);const u={},c={};for(var f in t)if(f!=="ref"){var p=f.slice(0,2)==="on";p?c[f]=t[f]:u[f]=t[f]}const m=new s(u);return q1(m,c),m}function ix(n,t,i){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${n}"`)}function sx(n,t,i){return!1}function lx(n){return n}function rx(){return null}function ox(){return null}function ux(n,t,i,s){return ex}function cx(){}function fx(n){}function hx(n,t){return!1}function dx(){return _4}function px(){return _4}const mx=setTimeout,gx=clearTimeout,yx=!0,vx=n=>{n()},Sx=-1;function bx(n,t){return!1}const Ex=!1,Tx=!1,Cx=!0,_x=!1,xx=!1;function Dx(n,t){t.parent===n?t.moveToTop():n.add(t),Xo(n)}function Ax(n,t){t.parent===n?t.moveToTop():n.add(t),Xo(n)}function D4(n,t,i){t._remove(),n.add(t),t.setZIndex(i.getZIndex()),Xo(n)}function Mx(n,t,i){D4(n,t,i)}function Nx(n,t){t.destroy(),t.off(Y1),Xo(n)}function Ox(n,t){t.destroy(),t.off(Y1),Xo(n)}function Rx(n,t,i){console.error(`Text components are not yet supported in ReactKonva. You text is: "${i}"`)}function zx(n,t,i){}function Hx(n,t,i,s){q1(n,s,i)}function wx(n){n.hide(),Xo(n)}function Ux(n){}function Bx(n,t){(t.visible==null||t.visible)&&n.show()}function Vx(n,t){}function Gx(n){}function jx(){}function Lx(){return null}function Px(){}function Yx(){}function qx(){return P1.DefaultEventPriority}function Xx(){}function Kx(){return null}function Qx(n){x4=n}function Zx(){return x4}function Jx(){return P1.DiscreteEventPriority}function Fx(){return!1}function kx(){}function Ix(){return null}function Wx(){return-1.1}function $x(){}function tD(){return!1}function eD(){return!0}function nD(){}function aD(){}function iD(){return null}const sD=null,lD=H.createContext(null);function rD(){}const oD=Object.freeze(Object.defineProperty({__proto__:null,HostTransitionContext:lD,NotPendingTransition:sD,afterActiveInstanceBlur:Yx,appendChild:Dx,appendChildToContainer:Ax,appendInitialChild:nx,beforeActiveInstanceBlur:Px,cancelTimeout:gx,clearContainer:Gx,commitMount:zx,commitTextUpdate:Rx,commitUpdate:Hx,createInstance:ax,createTextInstance:ix,detachDeletedInstance:jx,finalizeInitialChildren:sx,getChildHostContext:px,getCurrentEventPriority:qx,getCurrentUpdatePriority:Zx,getInstanceFromNode:Lx,getInstanceFromScope:Kx,getPublicInstance:lx,getRootHostContext:dx,hideInstance:wx,hideTextInstance:Ux,idlePriority:k2.unstable_IdlePriority,insertBefore:D4,insertInContainerBefore:Mx,isPrimaryRenderer:Ex,maySuspendCommit:tD,noTimeout:Sx,now:k2.unstable_now,preloadInstance:eD,prepareForCommit:rx,preparePortalMount:ox,prepareScopeUpdate:Xx,prepareUpdate:ux,removeChild:Nx,removeChildFromContainer:Ox,requestPostPaintCallback:$x,resetAfterCommit:cx,resetFormInstance:rD,resetTextContent:fx,resolveEventTimeStamp:Wx,resolveEventType:Ix,resolveUpdatePriority:Jx,run:k2.unstable_runWithPriority,scheduleMicrotask:vx,scheduleTimeout:mx,setCurrentUpdatePriority:Qx,shouldAttemptEagerTransition:Fx,shouldDeprioritizeSubtree:hx,shouldSetTextContent:bx,startSuspendingCommit:nD,supportsHydration:xx,supportsMicrotasks:yx,supportsMutation:Cx,supportsPersistence:_x,suspendInstance:aD,trackSchedulerEvent:kx,unhideInstance:Bx,unhideTextInstance:Vx,waitForCommitToBeReady:iD,warnsIfNotActing:Tx},Symbol.toStringTag,{value:"Module"}));function A4(n,t,i){if(!n)return;if(i(n)===!0)return n;let s=n.child;for(;s;){const u=A4(s,t,i);if(u)return u;s=s.sibling}}function M4(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const I2=M4(Ha.createContext(null));class N4 extends Ha.Component{render(){return Ha.createElement(I2.Provider,{value:this._reactInternals},this.props.children)}}function uD(){const n=Ha.useContext(I2);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=Ha.useId();return Ha.useMemo(()=>{for(const i of[n,n?.alternate]){if(!i)continue;const s=A4(i,!1,u=>{let c=u.memoizedState;for(;c;){if(c.memoizedState===t)return!0;c=c.next}});if(s)return s}},[n,t])}const cD=Symbol.for("react.context"),fD=n=>n!==null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===cD;function hD(){const n=uD(),[t]=Ha.useState(()=>new Map);t.clear();let i=n;for(;i;){const s=i.type;fD(s)&&s!==I2&&!t.has(s)&&t.set(s,Ha.use(M4(s))),i=i.return}return t}function dD(){const n=hD();return Ha.useMemo(()=>Array.from(n.keys()).reduce((t,i)=>s=>Ha.createElement(t,null,Ha.createElement(i.Provider,{...s,value:n.get(i)})),t=>Ha.createElement(N4,{...t})),[n])}if(H.version.indexOf("19")===-1)throw new Error("react-konva version 19 is only compatible with React 19. Make sure to have the last version of react-konva and react or downgrade react-konva to version 18.");function pD(n){const t=H.useRef({});return H.useLayoutEffect(()=>{t.current=n}),H.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const mD=()=>{const n=H.useRef(0);return H.useMemo(()=>{n.current++},[]),n.current>1},gD=n=>{const t=H.useRef(null),i=H.useRef(null),s=H.useRef(null),u=pD(n),c=dD(),f=H.useRef(null),p=b=>{const{forwardedRef:_}=n;_&&(typeof _=="function"?_(b):_.current=b)},m=mD(),S=()=>{p(null),X1.updateContainer(null,s.current,null),i.current?.destroy(),i.current=null};return H.useLayoutEffect(()=>(f.current&&(clearTimeout(f.current),f.current=null),i.current?p(i.current):(i.current=new $f.Stage({width:n.width,height:n.height,container:t.current}),p(i.current),s.current=X1.createContainer(i.current,P1.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null),X1.updateContainer(H.createElement(c,{},n.children),s.current,null,()=>{})),()=>{m?f.current=setTimeout(S,0):S()}),[]),H.useLayoutEffect(()=>{p(i.current),q1(i.current,n,u),X1.updateContainer(H.createElement(c,{},n.children),s.current,null)}),H.createElement("div",{ref:t,id:n.id,accessKey:n.accessKey,className:n.className,role:n.role,style:n.style,tabIndex:n.tabIndex,title:n.title})},yD="Layer",vD="Group",O4="Rect",R4="Circle",z4="Line",SD="Image",bD="Path",X1=J_(oD),ED=H.forwardRef((n,t)=>H.createElement(N4,{},H.createElement(gD,{...n,forwardedRef:t}))),K1=n=>n==null?!1:typeof n=="object",H4=n=>n instanceof Date,w4=n=>typeof n=="function",U4=n=>{const t=typeof n;return t==="string"||t==="number"||t==="boolean"||t==="bigint"},W2=n=>{if(!K1(n))return n;const t={},i=Object.keys(n);for(let s=0,u=i.length;s<u;s++){const c=i[s],f=n[c];U4(f)||w4(f)?t[c]=f:H4(f)?t[c]=new Date(f.getTime()):Array.isArray(f)?t[c]=$2(f):K1(f)&&(t[c]=W2(f))}return t},$2=n=>{let t=n.length;const i=new Array(t);for(;t--!==0;){const s=n[t];U4(s)||w4(s)?i[t]=s:H4(s)?i[t]=new Date(s.getTime()):K1(s)&&!Array.isArray(s)?i[t]=W2(s):Array.isArray(s)?i[t]=$2(s):i[t]=s}return i},TD=n=>K1(n)?Array.isArray(n)?$2(n):W2(n):n;function CD(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var B4,V4;function _D(){return V4||(V4=1,B4=function n(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;var s,u,c;if(Array.isArray(t)){if(s=t.length,s!=i.length)return!1;for(u=s;u--!==0;)if(!n(t[u],i[u]))return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if(c=Object.keys(t),s=c.length,s!==Object.keys(i).length)return!1;for(u=s;u--!==0;)if(!Object.prototype.hasOwnProperty.call(i,c[u]))return!1;for(u=s;u--!==0;){var f=c[u];if(!n(t[f],i[f]))return!1}return!0}return t!==t&&i!==i}),B4}var xD=_D();const DD=CD(xD),AD=n=>new Promise((t,i)=>{const s=new FileReader;s.onload=()=>{const u=s.result?.toString()||void 0;t(u)},s.onerror=()=>{s.abort(),i(new Error("Error reading file."))},s.readAsDataURL(n)});function MD(n,t){for(let i=n.length;i--!==0;)if(!DD(n[i],t[i]))return!0;return!1}const tv=(n,t)=>{const i=H.useRef([]),s=i.current.length>0&&i.current[0]&&MD(i.current[0],t);return(i.current.length===0||s)&&(i.current=[TD(t),n()]),i.current[1]},ND=()=>{throw new Error("useEvent should not be called before the component is mounted")},Q1=n=>{const t=H.useRef(ND);H.useInsertionEffect(()=>{t.current=n},[n]);const i=H.useRef(null);return i.current||(i.current=function(){return t.current?.apply(this,arguments)}),i.current},OD=n=>{const[t,i]=H.useState(n),s=H.useRef(n);return s.current!==t&&(s.current=t),[t,i,s]},RD=({width:n,height:t,label:i="Click to Choose a File",source:s,showPreviewOnFileLoad:u=!0,cropRadius:c=30,cropColor:f="white",closeColor:p="white",shadingColor:m="grey",shadingOpacity:S=.4,onEdit:b,onRemove:_})=>{const[x,D]=H.useState(n||t||0),[A,N]=H.useState(t||n||0),[R,O]=H.useState(0),[U,j]=H.useState(1),[V,J]=H.useState(c),[W,st]=H.useState(!0),[I,et]=H.useState(),nt=H.useRef(void 0),bt=H.useRef(0),rt=H.useRef(0),dt=H.useRef(0),pt=H.useRef(void 0),tt=H.useRef(null),w=H.useRef(null),F=H.useRef(null),K=H.useRef(null),at=H.useRef(null),St=H.useId();H.useEffect(()=>{if(!n&&!t)throw new Error("Either width or height must be set to a value greater than zero.");if(n&&t)throw new Error("Both width and height cannot be set together, set one or the other.");O(t||n)},[n,t]),H.useEffect(()=>{s&&s!==nt.current&&$(s)},[s]),H.useEffect(()=>{!W&&u&&b?.(Mi())},[W]);const $=Ut=>{const Ae=new Image;Ae.crossOrigin="Anonymous",Ae.onload=()=>{Pt(Ae)},Ae.src=Ut,nt.current=Ut},gt=async Ut=>{if(Ut.target.files){const Ae=await AD(Ut.target.files[0]);Ae&&$(Ae)}},Tt=()=>{et(void 0),st(!0),J(c),j(1),_?.(),b?.()},Pt=Ut=>{const Ae=Ut.width,jn=Ut.height,Va=jn/Ae;let ke,mn;t&&!n?(ke=t||jn,mn=ke/Va):n?(mn=n,ke=mn*Va||jn):(ke=jn,mn=ke/Va),Ut.width=mn,Ut.height=ke;const eu=Math.max(c,Math.min(mn,ke)/3),Lr=ke/jn;rt.current=mn/2,dt.current=ke/2,pt.current={x:rt.current/Lr,y:rt.current/Lr},st(!1),J(eu),j(Lr),D(mn),N(ke),et(Ut)},le=(Ut=0)=>w.current?w.current.radius()-Ut:V-Ut,xn=Ut=>w.current?w.current.x()-le(Ut)<0:!1,xe=Ut=>w.current?w.current.y()-le(Ut)<0:!1,Dn=Ut=>w.current&&tt.current?w.current.x()+le(Ut)>tt.current.width():!1,ln=Ut=>w.current&&tt.current?w.current.y()+le(Ut)>tt.current.height():!1,Be=Ut=>!xn(Ut)&&!Dn(Ut)&&!ln(Ut)&&!xe(Ut),At=Ut=>w.current?le(Ut)>=c?Ut:w.current.radius()-c:le(Ut)>=c?Ut:V-c,ue=()=>w.current?w.current.radius()+1:V+1,ta=()=>w.current&&tt.current?tt.current.width()-w.current.radius()-1:x-V-1,ea=()=>w.current&&tt.current?tt.current.height()-w.current.radius()-1:A-V-1,An=Ut=>w.current?Ut+w.current.radius()*.86:Ut+V*.86,Ba=Ut=>w.current?Ut-w.current.radius()*.5:Ut-V*.5,pn=(Ut,Ae)=>{K.current&&at.current&&(K.current.x(An(Ut)-8),K.current.y(Ba(Ae)-8),at.current.x(An(Ut)-8),at.current.y(Ba(Ae)-10))},ha=()=>{if(w.current&&F.current){const Ut=xn()?ue():Dn()?ta():w.current.x(),Ae=xe()?ue():ln()?ea():w.current.y();pn(Ut,Ae),pt.current={x:Ut/U,y:Ae/U},w.current.fillPatternOffset(pt.current),w.current.x(Ut),F.current.x(Ut),w.current.y(Ae),F.current.y(Ae)}},Ji=Ut=>{if(F.current&&w.current&&K.current){const Ae=Ut>0||Be(Ut)?Ut:0;F.current.radius(F.current.radius()-At(Ae)),w.current.radius(w.current.radius()-At(Ae)),ha()}},di=Ut=>{tt.current&&(tt.current.container().style.cursor="nesw-resize"),bt.current=Ut.evt.y},Fi=Ut=>{const Ae=Ut.evt.y,jn=Ae?Ae-bt.current:void 0,Va=Ut.evt.movementY||jn||0;bt.current=Ae,Ji(Va),w.current&&pn(w.current.x(),w.current.y())},Mn=()=>{tt.current&&(tt.current.container().style.cursor="default"),b?.(Mi())},rn=()=>{b?.(Mi())},Mi=()=>{if(w.current){const Ut=w.current.radius()*2;return w.current.toDataURL({x:w.current.x()-w.current.radius(),y:w.current.y()-w.current.radius(),width:Ut,height:Ut,mimeType:"image/png",quality:1})}};return X.jsx("div",{children:W?X.jsx("div",{style:{width:R,height:R},className:"bsc:relative bsc:border-solid bsc:border-2",children:X.jsxs("div",{className:"bsc:absolute bsc:max-w-[80%] bsc:w-full bsc:top-1/2 bsc:left-1/2 bsc:-translate-1/2 bsc:text-center",children:[X.jsx("input",{type:"file",name:St,id:St,onChange:gt,className:"bsc:invisible bsc:absolute bsc:pointer-events-none"}),X.jsx("label",{htmlFor:St,className:"bsc:cursor-pointer",children:i})]})}):X.jsx(ED,{ref:tt,width:x,height:A,children:X.jsxs(yD,{children:[X.jsx(SD,{image:I}),X.jsx(O4,{x:0,y:0,width:x,height:A,fill:m,opacity:S}),X.jsxs(vD,{x:3,y:3,onClick:Tt,onMouseEnter:()=>{tt.current&&(tt.current.container().style.cursor="pointer")},onMouseLeave:()=>{tt.current&&(tt.current.container().style.cursor="default")},children:[X.jsx(z4,{points:[5,5,20,20],stroke:p,strokeWidth:4}),X.jsx(z4,{points:[5,20,20,5],stroke:p,strokeWidth:4})]}),X.jsx(R4,{ref:F,x:rt.current,y:dt.current,radius:V,stroke:f,strokeWidth:4,strokeScaleEnabled:!0,dashEnabled:!0,dash:[10,5]}),X.jsx(R4,{ref:w,x:rt.current,y:dt.current,radius:V,draggable:!0,fillPatternImage:I,fillPatternScale:{x:U,y:U},fillPatternOffset:pt.current,onDragMove:ha,onMouseEnter:()=>{tt.current&&(tt.current.container().style.cursor="move")},onMouseLeave:()=>{tt.current&&(tt.current.container().style.cursor="default")},onDragEnd:rn}),X.jsx(O4,{ref:K,x:rt.current+V*.86-8,y:dt.current+V*-.5-8,width:16,height:16,draggable:!0,onMouseEnter:()=>{tt.current&&(tt.current.container().style.cursor="nesw-resize")},onMouseLeave:()=>{tt.current&&(tt.current.container().style.cursor="default")},onDragStart:di,onDragMove:Fi,onDragEnd:Mn}),X.jsx(bD,{ref:at,x:rt.current+V*.86-8,y:dt.current+V*-.5-10,data:"M47.624,0.124l12.021,9.73L44.5,24.5l10,10l14.661-15.161l9.963,12.285v-31.5H47.624z M24.5,44.5 L9.847,59.653L0,47.5V79h31.5l-12.153-9.847L34.5,54.5L24.5,44.5z",fill:f,scale:{x:.2,y:.2}})]})})})},G4=H.createContext(void 0),j4=()=>H.useContext(G4),zD=({overlayKeepOnScreen:n=!0,useAnimations:t=!0,mobileMediaQuery:i,tabletMediaQuery:s,desktopMediaQuery:u,isValidScrollableElement:c,children:f})=>{const p={overlayKeepOnScreen:n,useAnimations:t,mobileMediaQuery:i,tabletMediaQuery:s,desktopMediaQuery:u,isValidScrollableElement:c};return X.jsx(G4.Provider,{value:p,children:f})};var Za=(n=>(n[n.Vertical=0]="Vertical",n[n.Horizontal=1]="Horizontal",n))(Za||{}),Es=(n=>(n[n.Right=0]="Right",n[n.Left=1]="Left",n))(Es||{}),ev={exports:{}};var L4;function HD(){return L4||(L4=1,(function(n){(function(){var t={}.hasOwnProperty;function i(){for(var c="",f=0;f<arguments.length;f++){var p=arguments[f];p&&(c=u(c,s(p)))}return c}function s(c){if(typeof c=="string"||typeof c=="number")return c;if(typeof c!="object")return"";if(Array.isArray(c))return i.apply(null,c);if(c.toString!==Object.prototype.toString&&!c.toString.toString().includes("[native code]"))return c.toString();var f="";for(var p in c)t.call(c,p)&&c[p]&&(f=u(f,p));return f}function u(c,f){return f?c?c+" "+f:c+f:c}n.exports?(i.default=i,n.exports=i):window.classNames=i})()})(ev)),ev.exports}var wD=HD();const Se=X2(wD);var nh=(n=>(n[n.Focus=0]="Focus",n[n.FocusWithin=1]="FocusWithin",n))(nh||{});const kp=(n=1)=>H.useMemo(()=>Se("bsc:dark:ring-mono-light-2 bsc:dark:ring-offset-mono-dark-1",{"bsc:focus-within:ring-3 bsc:focus-within:ring-primary-2 bsc:focus-within:ring-offset-2 focus-within:bsc-ring-opacity-50":n===1,"bsc:focus:ring-3 bsc:focus:ring-primary-2 bsc:focus:ring-offset-2 focus:bsc-ring-opacity-50":n===0}),[n]),UD=(n,t)=>{const i=H.useRef(null),{buttonType:s,buttonStyle:u="curved",type:c="button",disabled:f=!1,form:p,fullWidth:m=!1,onClick:S,className:b,children:_}=n,x=()=>{i.current?.click()};H.useImperativeHandle(t,()=>({click:x}));const D=kp(nh.Focus),A=Se("bc-button bsc:max-sm:p-4 bsc:md:p-2 bsc:dark:bg-mono-light-1 bsc:dark:hover:bg-mono-light-2 bsc:dark:text-mono-dark-1",D,{"bsc:w-full":m,"bc-disabled bsc:bg-gray-3 bsc:text-gray-2 bsc:pointer-events-none":f,"bsc:bg-primary-1 bsc:text-white bsc:hover:bg-primary-2 bsc:focus:ring-primary-1":s==="primary","bsc:bg-primary-2 bsc:text-white bsc:hover:bg-primary-3 bsc:focus:ring-primary-2":s==="secondary","bsc:bg-info bsc:text-white bsc:focus:ring-info":s==="info","bsc:bg-success bsc:text-white bsc:focus:ring-success":s==="success","bsc:bg-warning bsc:text-white bsc:focus:ring-warning":s==="warning","bsc:bg-error bsc:text-white bsc:focus:ring-error":s==="error","bsc:rounded-md":u==="curved","bsc:rounded-full bsc:px-4!":u==="round"},b);return X.jsx("button",{ref:i,type:c,onClick:S,disabled:f,form:p,className:A,children:_})},Ql=H.forwardRef(UD);var nv={exports:{}},Ip={},P4;function BD(){if(P4)return Ip;P4=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(s,u,c){var f=null;if(c!==void 0&&(f=""+c),u.key!==void 0&&(f=""+u.key),"key"in u){c={};for(var p in u)p!=="key"&&(c[p]=u[p])}else c=u;return u=c.ref,{$$typeof:n,type:s,key:f,ref:u!==void 0?u:null,props:c}}return Ip.Fragment=t,Ip.jsx=i,Ip.jsxs=i,Ip}var Z1={},Y4;function VD(){return Y4||(Y4=1,process.env.NODE_ENV!=="production"&&(function(){function n($){if($==null)return null;if(typeof $=="function")return $.$$typeof===bt?null:$.displayName||$.name||null;if(typeof $=="string")return $;switch($){case R:return"Fragment";case U:return"Profiler";case O:return"StrictMode";case W:return"Suspense";case st:return"SuspenseList";case nt:return"Activity"}if(typeof $=="object")switch(typeof $.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),$.$$typeof){case N:return"Portal";case V:return $.displayName||"Context";case j:return($._context.displayName||"Context")+".Consumer";case J:var gt=$.render;return $=$.displayName,$||($=gt.displayName||gt.name||"",$=$!==""?"ForwardRef("+$+")":"ForwardRef"),$;case I:return gt=$.displayName||null,gt!==null?gt:n($.type)||"Memo";case et:gt=$._payload,$=$._init;try{return n($(gt))}catch{}}return null}function t($){return""+$}function i($){try{t($);var gt=!1}catch{gt=!0}if(gt){gt=console;var Tt=gt.error,Pt=typeof Symbol=="function"&&Symbol.toStringTag&&$[Symbol.toStringTag]||$.constructor.name||"Object";return Tt.call(gt,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Pt),t($)}}function s($){if($===R)return"<>";if(typeof $=="object"&&$!==null&&$.$$typeof===et)return"<...>";try{var gt=n($);return gt?"<"+gt+">":"<...>"}catch{return"<...>"}}function u(){var $=rt.A;return $===null?null:$.getOwner()}function c(){return Error("react-stack-top-frame")}function f($){if(dt.call($,"key")){var gt=Object.getOwnPropertyDescriptor($,"key").get;if(gt&>.isReactWarning)return!1}return $.key!==void 0}function p($,gt){function Tt(){w||(w=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",gt))}Tt.isReactWarning=!0,Object.defineProperty($,"key",{get:Tt,configurable:!0})}function m(){var $=n(this.type);return F[$]||(F[$]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),$=this.props.ref,$!==void 0?$:null}function S($,gt,Tt,Pt,le,xn){var xe=Tt.ref;return $={$$typeof:A,type:$,key:gt,props:Tt,_owner:Pt},(xe!==void 0?xe:null)!==null?Object.defineProperty($,"ref",{enumerable:!1,get:m}):Object.defineProperty($,"ref",{enumerable:!1,value:null}),$._store={},Object.defineProperty($._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty($,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty($,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:le}),Object.defineProperty($,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:xn}),Object.freeze&&(Object.freeze($.props),Object.freeze($)),$}function b($,gt,Tt,Pt,le,xn){var xe=gt.children;if(xe!==void 0)if(Pt)if(pt(xe)){for(Pt=0;Pt<xe.length;Pt++)_(xe[Pt]);Object.freeze&&Object.freeze(xe)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(xe);if(dt.call(gt,"key")){xe=n($);var Dn=Object.keys(gt).filter(function(Be){return Be!=="key"});Pt=0<Dn.length?"{key: someKey, "+Dn.join(": ..., ")+": ...}":"{key: someKey}",St[xe+Pt]||(Dn=0<Dn.length?"{"+Dn.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
229
|
+
`,tx={};function q1(n,t,i=tx){if(!T4&&"zIndex"in t&&(console.warn($_),T4=!0),!C4&&t.draggable){var s=t.x!==void 0||t.y!==void 0,u=t.onDragEnd||t.onDragMove;s&&!u&&(console.warn(W_),C4=!0)}for(var c in i)if(!E4[c]){var f=c.slice(0,2)==="on",p=i[c]!==t[c];if(f&&p){var m=c.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),n.off(m,i[c])}var S=!t.hasOwnProperty(c);S&&n.setAttr(c,void 0)}var b=t._useStrictMode,_={},x=!1;const D={};for(var c in t)if(!E4[c]){var f=c.slice(0,2)==="on",A=i[c]!==t[c];if(f&&A){var m=c.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),t[c]&&(D[m]=t[c])}!f&&(t[c]!==i[c]||b&&t[c]!==n.getAttr(c))&&(x=!0,_[c]=t[c])}x&&(n.setAttrs(_),Xo(n));for(var m in D)n.off(m+Y1),n.on(m+Y1,D[m])}function Xo(n){if(!Ot.autoDrawEnabled){var t=n.getLayer()||n.getStage();t&&t.batchDraw()}}var k2=J2();const _4={},ex={};$f.Node.prototype._applyProps=q1;let x4=P1.DefaultEventPriority;function nx(n,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}n.add(t),Xo(n)}function ax(n,t,i){let s=$f[n];s||(console.error(`Konva has no node with the type ${n}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${n}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),s=$f.Group);const u={},c={};for(var f in t)if(f!=="ref"){var p=f.slice(0,2)==="on";p?c[f]=t[f]:u[f]=t[f]}const m=new s(u);return q1(m,c),m}function ix(n,t,i){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${n}"`)}function sx(n,t,i){return!1}function lx(n){return n}function rx(){return null}function ox(){return null}function ux(n,t,i,s){return ex}function cx(){}function fx(n){}function hx(n,t){return!1}function dx(){return _4}function px(){return _4}const mx=setTimeout,gx=clearTimeout,yx=!0,vx=n=>{n()},Sx=-1;function bx(n,t){return!1}const Ex=!1,Tx=!1,Cx=!0,_x=!1,xx=!1;function Dx(n,t){t.parent===n?t.moveToTop():n.add(t),Xo(n)}function Ax(n,t){t.parent===n?t.moveToTop():n.add(t),Xo(n)}function D4(n,t,i){t._remove(),n.add(t),t.setZIndex(i.getZIndex()),Xo(n)}function Mx(n,t,i){D4(n,t,i)}function Nx(n,t){t.destroy(),t.off(Y1),Xo(n)}function Ox(n,t){t.destroy(),t.off(Y1),Xo(n)}function Rx(n,t,i){console.error(`Text components are not yet supported in ReactKonva. You text is: "${i}"`)}function zx(n,t,i){}function Hx(n,t,i,s){q1(n,s,i)}function wx(n){n.hide(),Xo(n)}function Ux(n){}function Bx(n,t){(t.visible==null||t.visible)&&n.show()}function Vx(n,t){}function Gx(n){}function jx(){}function Lx(){return null}function Px(){}function Yx(){}function qx(){return P1.DefaultEventPriority}function Xx(){}function Kx(){return null}function Qx(n){x4=n}function Zx(){return x4}function Jx(){return P1.DiscreteEventPriority}function Fx(){return!1}function kx(){}function Ix(){return null}function Wx(){return-1.1}function $x(){}function tD(){return!1}function eD(){return!0}function nD(){}function aD(){}function iD(){return null}const sD=null,lD=H.createContext(null);function rD(){}const oD=Object.freeze(Object.defineProperty({__proto__:null,HostTransitionContext:lD,NotPendingTransition:sD,afterActiveInstanceBlur:Yx,appendChild:Dx,appendChildToContainer:Ax,appendInitialChild:nx,beforeActiveInstanceBlur:Px,cancelTimeout:gx,clearContainer:Gx,commitMount:zx,commitTextUpdate:Rx,commitUpdate:Hx,createInstance:ax,createTextInstance:ix,detachDeletedInstance:jx,finalizeInitialChildren:sx,getChildHostContext:px,getCurrentEventPriority:qx,getCurrentUpdatePriority:Zx,getInstanceFromNode:Lx,getInstanceFromScope:Kx,getPublicInstance:lx,getRootHostContext:dx,hideInstance:wx,hideTextInstance:Ux,idlePriority:k2.unstable_IdlePriority,insertBefore:D4,insertInContainerBefore:Mx,isPrimaryRenderer:Ex,maySuspendCommit:tD,noTimeout:Sx,now:k2.unstable_now,preloadInstance:eD,prepareForCommit:rx,preparePortalMount:ox,prepareScopeUpdate:Xx,prepareUpdate:ux,removeChild:Nx,removeChildFromContainer:Ox,requestPostPaintCallback:$x,resetAfterCommit:cx,resetFormInstance:rD,resetTextContent:fx,resolveEventTimeStamp:Wx,resolveEventType:Ix,resolveUpdatePriority:Jx,run:k2.unstable_runWithPriority,scheduleMicrotask:vx,scheduleTimeout:mx,setCurrentUpdatePriority:Qx,shouldAttemptEagerTransition:Fx,shouldDeprioritizeSubtree:hx,shouldSetTextContent:bx,startSuspendingCommit:nD,supportsHydration:xx,supportsMicrotasks:yx,supportsMutation:Cx,supportsPersistence:_x,suspendInstance:aD,trackSchedulerEvent:kx,unhideInstance:Bx,unhideTextInstance:Vx,waitForCommitToBeReady:iD,warnsIfNotActing:Tx},Symbol.toStringTag,{value:"Module"}));function A4(n,t,i){if(!n)return;if(i(n)===!0)return n;let s=n.child;for(;s;){const u=A4(s,t,i);if(u)return u;s=s.sibling}}function M4(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const I2=M4(Ha.createContext(null));class N4 extends Ha.Component{render(){return Ha.createElement(I2.Provider,{value:this._reactInternals},this.props.children)}}function uD(){const n=Ha.useContext(I2);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=Ha.useId();return Ha.useMemo(()=>{for(const i of[n,n?.alternate]){if(!i)continue;const s=A4(i,!1,u=>{let c=u.memoizedState;for(;c;){if(c.memoizedState===t)return!0;c=c.next}});if(s)return s}},[n,t])}const cD=Symbol.for("react.context"),fD=n=>n!==null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===cD;function hD(){const n=uD(),[t]=Ha.useState(()=>new Map);t.clear();let i=n;for(;i;){const s=i.type;fD(s)&&s!==I2&&!t.has(s)&&t.set(s,Ha.use(M4(s))),i=i.return}return t}function dD(){const n=hD();return Ha.useMemo(()=>Array.from(n.keys()).reduce((t,i)=>s=>Ha.createElement(t,null,Ha.createElement(i.Provider,{...s,value:n.get(i)})),t=>Ha.createElement(N4,{...t})),[n])}if(H.version.indexOf("19")===-1)throw new Error("react-konva version 19 is only compatible with React 19. Make sure to have the last version of react-konva and react or downgrade react-konva to version 18.");function pD(n){const t=H.useRef({});return H.useLayoutEffect(()=>{t.current=n}),H.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const mD=()=>{const n=H.useRef(0);return H.useMemo(()=>{n.current++},[]),n.current>1},gD=n=>{const t=H.useRef(null),i=H.useRef(null),s=H.useRef(null),u=pD(n),c=dD(),f=H.useRef(null),p=b=>{const{forwardedRef:_}=n;_&&(typeof _=="function"?_(b):_.current=b)},m=mD(),S=()=>{p(null),X1.updateContainer(null,s.current,null),i.current?.destroy(),i.current=null};return H.useLayoutEffect(()=>(f.current&&(clearTimeout(f.current),f.current=null),i.current?p(i.current):(i.current=new $f.Stage({width:n.width,height:n.height,container:t.current}),p(i.current),s.current=X1.createContainer(i.current,P1.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null),X1.updateContainer(H.createElement(c,{},n.children),s.current,null,()=>{})),()=>{m?f.current=setTimeout(S,0):S()}),[]),H.useLayoutEffect(()=>{p(i.current),q1(i.current,n,u),X1.updateContainer(H.createElement(c,{},n.children),s.current,null)}),H.createElement("div",{ref:t,id:n.id,accessKey:n.accessKey,className:n.className,role:n.role,style:n.style,tabIndex:n.tabIndex,title:n.title})},yD="Layer",vD="Group",O4="Rect",R4="Circle",z4="Line",SD="Image",bD="Path",X1=J_(oD),ED=H.forwardRef((n,t)=>H.createElement(N4,{},H.createElement(gD,{...n,forwardedRef:t}))),K1=n=>n==null?!1:typeof n=="object",H4=n=>n instanceof Date,w4=n=>typeof n=="function",U4=n=>{const t=typeof n;return t==="string"||t==="number"||t==="boolean"||t==="bigint"},W2=n=>{if(!K1(n))return n;const t={},i=Object.keys(n);for(let s=0,u=i.length;s<u;s++){const c=i[s],f=n[c];U4(f)||w4(f)?t[c]=f:H4(f)?t[c]=new Date(f.getTime()):Array.isArray(f)?t[c]=$2(f):K1(f)&&(t[c]=W2(f))}return t},$2=n=>{let t=n.length;const i=new Array(t);for(;t--!==0;){const s=n[t];U4(s)||w4(s)?i[t]=s:H4(s)?i[t]=new Date(s.getTime()):K1(s)&&!Array.isArray(s)?i[t]=W2(s):Array.isArray(s)?i[t]=$2(s):i[t]=s}return i},TD=n=>K1(n)?Array.isArray(n)?$2(n):W2(n):n;function CD(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var B4,V4;function _D(){return V4||(V4=1,B4=function n(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;var s,u,c;if(Array.isArray(t)){if(s=t.length,s!=i.length)return!1;for(u=s;u--!==0;)if(!n(t[u],i[u]))return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if(c=Object.keys(t),s=c.length,s!==Object.keys(i).length)return!1;for(u=s;u--!==0;)if(!Object.prototype.hasOwnProperty.call(i,c[u]))return!1;for(u=s;u--!==0;){var f=c[u];if(!n(t[f],i[f]))return!1}return!0}return t!==t&&i!==i}),B4}var xD=_D();const DD=CD(xD),AD=n=>new Promise((t,i)=>{const s=new FileReader;s.onload=()=>{const u=s.result?.toString()||void 0;t(u)},s.onerror=()=>{s.abort(),i(new Error("Error reading file."))},s.readAsDataURL(n)});function MD(n,t){for(let i=n.length;i--!==0;)if(!DD(n[i],t[i]))return!0;return!1}const tv=(n,t)=>{const i=H.useRef([]),s=i.current.length>0&&i.current[0]&&MD(i.current[0],t);return(i.current.length===0||s)&&(i.current=[TD(t),n()]),i.current[1]},ND=()=>{throw new Error("useEvent should not be called before the component is mounted")},Q1=n=>{const t=H.useRef(ND);H.useInsertionEffect(()=>{t.current=n},[n]);const i=H.useRef(null);return i.current||(i.current=function(){return t.current?.apply(this,arguments)}),i.current},OD=n=>{const[t,i]=H.useState(n),s=H.useRef(n);return s.current!==t&&(s.current=t),[t,i,s]},RD=({width:n,height:t,label:i="Click to Choose a File",source:s,showPreviewOnFileLoad:u=!0,cropRadius:c=30,cropColor:f="white",closeColor:p="white",shadingColor:m="grey",shadingOpacity:S=.4,onEdit:b,onRemove:_})=>{const[x,D]=H.useState(n||t||0),[A,N]=H.useState(t||n||0),[R,O]=H.useState(0),[U,j]=H.useState(1),[V,J]=H.useState(c),[$,st]=H.useState(!0),[I,et]=H.useState(),nt=H.useRef(void 0),bt=H.useRef(0),rt=H.useRef(0),dt=H.useRef(0),pt=H.useRef(void 0),tt=H.useRef(null),w=H.useRef(null),F=H.useRef(null),K=H.useRef(null),at=H.useRef(null),St=H.useId();H.useEffect(()=>{if(!n&&!t)throw new Error("Either width or height must be set to a value greater than zero.");if(n&&t)throw new Error("Both width and height cannot be set together, set one or the other.");O(t||n)},[n,t]),H.useEffect(()=>{s&&s!==nt.current&&W(s)},[s]);const W=Ut=>{const Ae=new Image;Ae.crossOrigin="Anonymous",Ae.onload=()=>{Pt(Ae)},Ae.src=Ut,nt.current=Ut},gt=async Ut=>{if(Ut.target.files){const Ae=await AD(Ut.target.files[0]);Ae&&W(Ae)}},Tt=()=>{et(void 0),st(!0),J(c),j(1),_?.(),b?.()},Pt=Ut=>{const Ae=Ut.width,jn=Ut.height,Va=jn/Ae;let ke,mn;t&&!n?(ke=t||jn,mn=ke/Va):n?(mn=n,ke=mn*Va||jn):(ke=jn,mn=ke/Va),Ut.width=mn,Ut.height=ke;const eu=Math.max(c,Math.min(mn,ke)/3),Lr=ke/jn;rt.current=mn/2,dt.current=ke/2,pt.current={x:rt.current/Lr,y:rt.current/Lr},st(!1),J(eu),j(Lr),D(mn),N(ke),et(Ut),u&&b?.(Mi())},le=(Ut=0)=>w.current?w.current.radius()-Ut:V-Ut,xn=Ut=>w.current?w.current.x()-le(Ut)<0:!1,xe=Ut=>w.current?w.current.y()-le(Ut)<0:!1,Dn=Ut=>w.current&&tt.current?w.current.x()+le(Ut)>tt.current.width():!1,ln=Ut=>w.current&&tt.current?w.current.y()+le(Ut)>tt.current.height():!1,Be=Ut=>!xn(Ut)&&!Dn(Ut)&&!ln(Ut)&&!xe(Ut),At=Ut=>w.current?le(Ut)>=c?Ut:w.current.radius()-c:le(Ut)>=c?Ut:V-c,ue=()=>w.current?w.current.radius()+1:V+1,ta=()=>w.current&&tt.current?tt.current.width()-w.current.radius()-1:x-V-1,ea=()=>w.current&&tt.current?tt.current.height()-w.current.radius()-1:A-V-1,An=Ut=>w.current?Ut+w.current.radius()*.86:Ut+V*.86,Ba=Ut=>w.current?Ut-w.current.radius()*.5:Ut-V*.5,pn=(Ut,Ae)=>{K.current&&at.current&&(K.current.x(An(Ut)-8),K.current.y(Ba(Ae)-8),at.current.x(An(Ut)-8),at.current.y(Ba(Ae)-10))},ha=()=>{if(w.current&&F.current){const Ut=xn()?ue():Dn()?ta():w.current.x(),Ae=xe()?ue():ln()?ea():w.current.y();pn(Ut,Ae),pt.current={x:Ut/U,y:Ae/U},w.current.fillPatternOffset(pt.current),w.current.x(Ut),F.current.x(Ut),w.current.y(Ae),F.current.y(Ae)}},Ji=Ut=>{if(F.current&&w.current&&K.current){const Ae=Ut>0||Be(Ut)?Ut:0;F.current.radius(F.current.radius()-At(Ae)),w.current.radius(w.current.radius()-At(Ae)),ha()}},di=Ut=>{tt.current&&(tt.current.container().style.cursor="nesw-resize"),bt.current=Ut.evt.y},Fi=Ut=>{const Ae=Ut.evt.y,jn=Ae?Ae-bt.current:void 0,Va=Ut.evt.movementY||jn||0;bt.current=Ae,Ji(Va),w.current&&pn(w.current.x(),w.current.y())},Mn=()=>{tt.current&&(tt.current.container().style.cursor="default"),b?.(Mi())},rn=()=>{b?.(Mi())},Mi=()=>{if(w.current){const Ut=w.current.radius()*2;return w.current.toDataURL({x:w.current.x()-w.current.radius(),y:w.current.y()-w.current.radius(),width:Ut,height:Ut,mimeType:"image/png",quality:1})}};return X.jsx("div",{children:$?X.jsx("div",{style:{width:R,height:R},className:"bsc:relative bsc:border-solid bsc:border-2",children:X.jsxs("div",{className:"bsc:absolute bsc:max-w-[80%] bsc:w-full bsc:top-1/2 bsc:left-1/2 bsc:-translate-1/2 bsc:text-center",children:[X.jsx("input",{type:"file",name:St,id:St,onChange:gt,className:"bsc:invisible bsc:absolute bsc:pointer-events-none"}),X.jsx("label",{htmlFor:St,className:"bsc:cursor-pointer",children:i})]})}):X.jsx(ED,{ref:tt,width:x,height:A,children:X.jsxs(yD,{children:[X.jsx(SD,{image:I}),X.jsx(O4,{x:0,y:0,width:x,height:A,fill:m,opacity:S}),X.jsxs(vD,{x:3,y:3,onClick:Tt,onMouseEnter:()=>{tt.current&&(tt.current.container().style.cursor="pointer")},onMouseLeave:()=>{tt.current&&(tt.current.container().style.cursor="default")},children:[X.jsx(z4,{points:[5,5,20,20],stroke:p,strokeWidth:4}),X.jsx(z4,{points:[5,20,20,5],stroke:p,strokeWidth:4})]}),X.jsx(R4,{ref:F,x:rt.current,y:dt.current,radius:V,stroke:f,strokeWidth:4,strokeScaleEnabled:!0,dashEnabled:!0,dash:[10,5]}),X.jsx(R4,{ref:w,x:rt.current,y:dt.current,radius:V,draggable:!0,fillPatternImage:I,fillPatternScale:{x:U,y:U},fillPatternOffset:pt.current,onDragMove:ha,onMouseEnter:()=>{tt.current&&(tt.current.container().style.cursor="move")},onMouseLeave:()=>{tt.current&&(tt.current.container().style.cursor="default")},onDragEnd:rn}),X.jsx(O4,{ref:K,x:rt.current+V*.86-8,y:dt.current+V*-.5-8,width:16,height:16,draggable:!0,onMouseEnter:()=>{tt.current&&(tt.current.container().style.cursor="nesw-resize")},onMouseLeave:()=>{tt.current&&(tt.current.container().style.cursor="default")},onDragStart:di,onDragMove:Fi,onDragEnd:Mn}),X.jsx(bD,{ref:at,x:rt.current+V*.86-8,y:dt.current+V*-.5-10,data:"M47.624,0.124l12.021,9.73L44.5,24.5l10,10l14.661-15.161l9.963,12.285v-31.5H47.624z M24.5,44.5 L9.847,59.653L0,47.5V79h31.5l-12.153-9.847L34.5,54.5L24.5,44.5z",fill:f,scale:{x:.2,y:.2}})]})})})},G4=H.createContext(void 0),j4=()=>H.useContext(G4),zD=({overlayKeepOnScreen:n=!0,useAnimations:t=!0,mobileMediaQuery:i,tabletMediaQuery:s,desktopMediaQuery:u,isValidScrollableElement:c,children:f})=>{const p={overlayKeepOnScreen:n,useAnimations:t,mobileMediaQuery:i,tabletMediaQuery:s,desktopMediaQuery:u,isValidScrollableElement:c};return X.jsx(G4.Provider,{value:p,children:f})};var Za=(n=>(n[n.Vertical=0]="Vertical",n[n.Horizontal=1]="Horizontal",n))(Za||{}),Es=(n=>(n[n.Right=0]="Right",n[n.Left=1]="Left",n))(Es||{}),ev={exports:{}};var L4;function HD(){return L4||(L4=1,(function(n){(function(){var t={}.hasOwnProperty;function i(){for(var c="",f=0;f<arguments.length;f++){var p=arguments[f];p&&(c=u(c,s(p)))}return c}function s(c){if(typeof c=="string"||typeof c=="number")return c;if(typeof c!="object")return"";if(Array.isArray(c))return i.apply(null,c);if(c.toString!==Object.prototype.toString&&!c.toString.toString().includes("[native code]"))return c.toString();var f="";for(var p in c)t.call(c,p)&&c[p]&&(f=u(f,p));return f}function u(c,f){return f?c?c+" "+f:c+f:c}n.exports?(i.default=i,n.exports=i):window.classNames=i})()})(ev)),ev.exports}var wD=HD();const Se=X2(wD);var nh=(n=>(n[n.Focus=0]="Focus",n[n.FocusWithin=1]="FocusWithin",n))(nh||{});const kp=(n=1)=>H.useMemo(()=>Se("bsc:dark:ring-mono-light-2 bsc:dark:ring-offset-mono-dark-1",{"bsc:focus-within:ring-3 bsc:focus-within:ring-primary-2 bsc:focus-within:ring-offset-2 focus-within:bsc-ring-opacity-50":n===1,"bsc:focus:ring-3 bsc:focus:ring-primary-2 bsc:focus:ring-offset-2 focus:bsc-ring-opacity-50":n===0}),[n]),UD=(n,t)=>{const i=H.useRef(null),{buttonType:s,buttonStyle:u="curved",type:c="button",disabled:f=!1,form:p,fullWidth:m=!1,onClick:S,className:b,children:_}=n,x=()=>{i.current?.click()};H.useImperativeHandle(t,()=>({click:x}));const D=kp(nh.Focus),A=Se("bc-button bsc:max-sm:p-4 bsc:md:p-2 bsc:dark:bg-mono-light-1 bsc:dark:hover:bg-mono-light-2 bsc:dark:text-mono-dark-1",D,{"bsc:w-full":m,"bc-disabled bsc:bg-gray-3 bsc:text-gray-2 bsc:pointer-events-none":f,"bsc:bg-primary-1 bsc:text-white bsc:hover:bg-primary-2 bsc:focus:ring-primary-1":s==="primary","bsc:bg-primary-2 bsc:text-white bsc:hover:bg-primary-3 bsc:focus:ring-primary-2":s==="secondary","bsc:bg-info bsc:text-white bsc:focus:ring-info":s==="info","bsc:bg-success bsc:text-white bsc:focus:ring-success":s==="success","bsc:bg-warning bsc:text-white bsc:focus:ring-warning":s==="warning","bsc:bg-error bsc:text-white bsc:focus:ring-error":s==="error","bsc:rounded-md":u==="curved","bsc:rounded-full bsc:px-4!":u==="round"},b);return X.jsx("button",{ref:i,type:c,onClick:S,disabled:f,form:p,className:A,children:_})},Ql=H.forwardRef(UD);var nv={exports:{}},Ip={},P4;function BD(){if(P4)return Ip;P4=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(s,u,c){var f=null;if(c!==void 0&&(f=""+c),u.key!==void 0&&(f=""+u.key),"key"in u){c={};for(var p in u)p!=="key"&&(c[p]=u[p])}else c=u;return u=c.ref,{$$typeof:n,type:s,key:f,ref:u!==void 0?u:null,props:c}}return Ip.Fragment=t,Ip.jsx=i,Ip.jsxs=i,Ip}var Z1={},Y4;function VD(){return Y4||(Y4=1,process.env.NODE_ENV!=="production"&&(function(){function n(W){if(W==null)return null;if(typeof W=="function")return W.$$typeof===bt?null:W.displayName||W.name||null;if(typeof W=="string")return W;switch(W){case R:return"Fragment";case U:return"Profiler";case O:return"StrictMode";case $:return"Suspense";case st:return"SuspenseList";case nt:return"Activity"}if(typeof W=="object")switch(typeof W.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),W.$$typeof){case N:return"Portal";case V:return W.displayName||"Context";case j:return(W._context.displayName||"Context")+".Consumer";case J:var gt=W.render;return W=W.displayName,W||(W=gt.displayName||gt.name||"",W=W!==""?"ForwardRef("+W+")":"ForwardRef"),W;case I:return gt=W.displayName||null,gt!==null?gt:n(W.type)||"Memo";case et:gt=W._payload,W=W._init;try{return n(W(gt))}catch{}}return null}function t(W){return""+W}function i(W){try{t(W);var gt=!1}catch{gt=!0}if(gt){gt=console;var Tt=gt.error,Pt=typeof Symbol=="function"&&Symbol.toStringTag&&W[Symbol.toStringTag]||W.constructor.name||"Object";return Tt.call(gt,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Pt),t(W)}}function s(W){if(W===R)return"<>";if(typeof W=="object"&&W!==null&&W.$$typeof===et)return"<...>";try{var gt=n(W);return gt?"<"+gt+">":"<...>"}catch{return"<...>"}}function u(){var W=rt.A;return W===null?null:W.getOwner()}function c(){return Error("react-stack-top-frame")}function f(W){if(dt.call(W,"key")){var gt=Object.getOwnPropertyDescriptor(W,"key").get;if(gt&>.isReactWarning)return!1}return W.key!==void 0}function p(W,gt){function Tt(){w||(w=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",gt))}Tt.isReactWarning=!0,Object.defineProperty(W,"key",{get:Tt,configurable:!0})}function m(){var W=n(this.type);return F[W]||(F[W]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),W=this.props.ref,W!==void 0?W:null}function S(W,gt,Tt,Pt,le,xn){var xe=Tt.ref;return W={$$typeof:A,type:W,key:gt,props:Tt,_owner:Pt},(xe!==void 0?xe:null)!==null?Object.defineProperty(W,"ref",{enumerable:!1,get:m}):Object.defineProperty(W,"ref",{enumerable:!1,value:null}),W._store={},Object.defineProperty(W._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(W,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(W,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:le}),Object.defineProperty(W,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:xn}),Object.freeze&&(Object.freeze(W.props),Object.freeze(W)),W}function b(W,gt,Tt,Pt,le,xn){var xe=gt.children;if(xe!==void 0)if(Pt)if(pt(xe)){for(Pt=0;Pt<xe.length;Pt++)_(xe[Pt]);Object.freeze&&Object.freeze(xe)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(xe);if(dt.call(gt,"key")){xe=n(W);var Dn=Object.keys(gt).filter(function(Be){return Be!=="key"});Pt=0<Dn.length?"{key: someKey, "+Dn.join(": ..., ")+": ...}":"{key: someKey}",St[xe+Pt]||(Dn=0<Dn.length?"{"+Dn.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
230
230
|
let props = %s;
|
|
231
231
|
<%s {...props} />
|
|
232
232
|
React keys must be passed directly to JSX without using spread:
|
|
233
233
|
let props = %s;
|
|
234
|
-
<%s key={someKey} {...props} />`,Pt,xe,Dn,xe),St[xe+Pt]=!0)}if(xe=null,Tt!==void 0&&(i(Tt),xe=""+Tt),f(gt)&&(i(gt.key),xe=""+gt.key),"key"in gt){Tt={};for(var ln in gt)ln!=="key"&&(Tt[ln]=gt[ln])}else Tt=gt;return xe&&p(Tt,typeof $=="function"?$.displayName||$.name||"Unknown":$),S($,xe,Tt,u(),le,xn)}function _($){x($)?$._store&&($._store.validated=1):typeof $=="object"&&$!==null&&$.$$typeof===et&&($._payload.status==="fulfilled"?x($._payload.value)&&$._payload.value._store&&($._payload.value._store.validated=1):$._store&&($._store.validated=1))}function x($){return typeof $=="object"&&$!==null&&$.$$typeof===A}var D=H,A=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),V=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),st=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),et=Symbol.for("react.lazy"),nt=Symbol.for("react.activity"),bt=Symbol.for("react.client.reference"),rt=D.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,dt=Object.prototype.hasOwnProperty,pt=Array.isArray,tt=console.createTask?console.createTask:function(){return null};D={react_stack_bottom_frame:function($){return $()}};var w,F={},K=D.react_stack_bottom_frame.bind(D,c)(),at=tt(s(c)),St={};Z1.Fragment=R,Z1.jsx=function($,gt,Tt){var Pt=1e4>rt.recentlyCreatedOwnerStacks++;return b($,gt,Tt,!1,Pt?Error("react-stack-top-frame"):K,Pt?tt(s($)):at)},Z1.jsxs=function($,gt,Tt){var Pt=1e4>rt.recentlyCreatedOwnerStacks++;return b($,gt,Tt,!0,Pt?Error("react-stack-top-frame"):K,Pt?tt(s($)):at)}})()),Z1}var q4;function GD(){return q4||(q4=1,process.env.NODE_ENV==="production"?nv.exports=BD():nv.exports=VD()),nv.exports}var Ja=GD();function jD(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var X4,K4;function LD(){return K4||(K4=1,X4=function n(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;var s,u,c;if(Array.isArray(t)){if(s=t.length,s!=i.length)return!1;for(u=s;u--!==0;)if(!n(t[u],i[u]))return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if(c=Object.keys(t),s=c.length,s!==Object.keys(i).length)return!1;for(u=s;u--!==0;)if(!Object.prototype.hasOwnProperty.call(i,c[u]))return!1;for(u=s;u--!==0;){var f=c[u];if(!n(t[f],i[f]))return!1}return!0}return t!==t&&i!==i}),X4}var PD=LD();const YD=jD(PD),qD=()=>{throw new Error("useEvent should not be called before the component is mounted")},Wp=n=>{const t=H.useRef(qD);H.useInsertionEffect(()=>{t.current=n},[n]);const i=H.useRef(null);return i.current||(i.current=function(){return t.current?.apply(this,arguments)}),i.current},Q4=n=>{const t=H.useRef(void 0);let i=!1;t.current!==void 0&&(i=!YD(t.current,n));const s={changed:i,previousValue:t.current};return t.current=n,s},XD=n=>typeof n=="function",KD=n=>{const[t,i]=H.useState({value:n,initial:!0}),s=H.useRef(n);return[t,u=>{if(!XD(u))i({value:u,initial:!1});else{const c=u(s.current);s.current=c,i({value:c,initial:!1})}}]},QD=n=>{const[t,i]=KD(n),s=H.useRef({value:n,initial:!0});return s.current!==t&&(s.current=t),[t,i,s]},Z4=H.createContext(void 0),J1=()=>H.useContext(Z4),av=({id:n,name:t,value:i,type:s,checked:u,readOnly:c,onChange:f})=>Ja.jsx("input",{id:n,name:t,value:i,type:s,checked:u,onChange:f,readOnly:c,disabled:c,className:"bsh:appearance-none! bsh:absolute! bsh:left-[-1000px]!"});function ZD(n){const t=Object.keys(n),i={};for(let s=0,u=t.length;s<u;s++){const c=t[s];if(c){const f=n[c],p=c.replace(/([A-Z])/g,m=>`-${m.toLowerCase()}`);typeof f=="boolean"?f&&(i[`data-${p}`]=!0):i[`data-${p}`]=n[c]}}return i}const $p=({wrapperElement:n,renderProps:t,elementProps:i,innerWrapperElement:s,className:u,children:c})=>{if(typeof c=="function")return s?Ja.jsxs(Ja.Fragment,{children:[s,c(t)]}):c(t);{const f=s?Ja.jsxs(Ja.Fragment,{children:[s,c]}):c;return H.createElement(n,Object.assign({},t?ZD(t):{},i,{className:u}),f)}};var JD=Symbol.for("preact-signals");function iv(){if(ah>1)ah--;else{for(var n,t=!1;t0!==void 0;){var i=t0;for(t0=void 0,sv++;i!==void 0;){var s=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&k4(i))try{i.c()}catch(u){t||(n=u,t=!0)}i=s}}if(sv=0,ah--,t)throw n}}var Ue=void 0;function J4(n){var t=Ue;Ue=void 0;try{return n()}finally{Ue=t}}var t0=void 0,ah=0,sv=0,F1=0;function F4(n){if(Ue!==void 0){var t=n.n;if(t===void 0||t.t!==Ue)return t={i:0,S:n,p:Ue.s,n:void 0,t:Ue,e:void 0,x:void 0,r:t},Ue.s!==void 0&&(Ue.s.n=t),Ue.s=t,n.n=t,32&Ue.f&&n.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ue.s,t.n=void 0,Ue.s.n=t,Ue.s=t),t}}function Fa(n,t){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Fa.prototype.brand=JD,Fa.prototype.h=function(){return!0},Fa.prototype.S=function(n){var t=this,i=this.t;i!==n&&n.e===void 0&&(n.x=i,this.t=n,i!==void 0?i.e=n:J4(function(){var s;(s=t.W)==null||s.call(t)}))},Fa.prototype.U=function(n){var t=this;if(this.t!==void 0){var i=n.e,s=n.x;i!==void 0&&(i.x=s,n.e=void 0),s!==void 0&&(s.e=i,n.x=void 0),n===this.t&&(this.t=s,s===void 0&&J4(function(){var u;(u=t.Z)==null||u.call(t)}))}},Fa.prototype.subscribe=function(n){var t=this;return rv(function(){var i=t.value,s=Ue;Ue=void 0;try{n(i)}finally{Ue=s}},{name:"sub"})},Fa.prototype.valueOf=function(){return this.value},Fa.prototype.toString=function(){return this.value+""},Fa.prototype.toJSON=function(){return this.value},Fa.prototype.peek=function(){var n=Ue;Ue=void 0;try{return this.value}finally{Ue=n}},Object.defineProperty(Fa.prototype,"value",{get:function(){var n=F4(this);return n!==void 0&&(n.i=this.i),this.v},set:function(n){if(n!==this.v){if(sv>100)throw new Error("Cycle detected");this.v=n,this.i++,F1++,ah++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{iv()}}}});function FD(n,t){return new Fa(n,t)}function k4(n){for(var t=n.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function I4(n){for(var t=n.s;t!==void 0;t=t.n){var i=t.S.n;if(i!==void 0&&(t.r=i),t.S.n=t,t.i=-1,t.n===void 0){n.s=t;break}}}function W4(n){for(var t=n.s,i=void 0;t!==void 0;){var s=t.p;t.i===-1?(t.S.U(t),s!==void 0&&(s.n=t.n),t.n!==void 0&&(t.n.p=s)):i=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=s}n.s=i}function ih(n,t){Fa.call(this,void 0),this.x=n,this.s=void 0,this.g=F1-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}ih.prototype=new Fa,ih.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===F1))return!0;if(this.g=F1,this.f|=1,this.i>0&&!k4(this))return this.f&=-2,!0;var n=Ue;try{I4(this),Ue=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return Ue=n,W4(this),this.f&=-2,!0},ih.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Fa.prototype.S.call(this,n)},ih.prototype.U=function(n){if(this.t!==void 0&&(Fa.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},ih.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(ih.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var n=F4(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}});function $4(n){var t=n.u;if(n.u=void 0,typeof t=="function"){ah++;var i=Ue;Ue=void 0;try{t()}catch(s){throw n.f&=-2,n.f|=8,lv(n),s}finally{Ue=i,iv()}}}function lv(n){for(var t=n.s;t!==void 0;t=t.n)t.S.U(t);n.x=void 0,n.s=void 0,$4(n)}function kD(n){if(Ue!==this)throw new Error("Out-of-order effect");W4(this),Ue=n,this.f&=-2,8&this.f&&lv(this),iv()}function sh(n,t){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}sh.prototype.c=function(){var n=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{n()}},sh.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,$4(this),I4(this),ah++;var n=Ue;return Ue=this,kD.bind(this,n)},sh.prototype.N=function(){2&this.f||(this.f|=2,this.o=t0,t0=this)},sh.prototype.d=function(){this.f|=8,1&this.f||lv(this)},sh.prototype.dispose=function(){this.d()};function rv(n,t){var i=new sh(n,t);try{i.c()}catch(u){throw i.d(),u}var s=i.d.bind(i);return s[Symbol.dispose]=s,s}var ov={exports:{}},uv={},t6;function ID(){if(t6)return uv;t6=1;var n=H;function t(_,x){return _===x&&(_!==0||1/_===1/x)||_!==_&&x!==x}var i=typeof Object.is=="function"?Object.is:t,s=n.useState,u=n.useEffect,c=n.useLayoutEffect,f=n.useDebugValue;function p(_,x){var D=x(),A=s({inst:{value:D,getSnapshot:x}}),N=A[0].inst,R=A[1];return c(function(){N.value=D,N.getSnapshot=x,m(N)&&R({inst:N})},[_,D,x]),u(function(){return m(N)&&R({inst:N}),_(function(){m(N)&&R({inst:N})})},[_]),f(D),D}function m(_){var x=_.getSnapshot;_=_.value;try{var D=x();return!i(_,D)}catch{return!0}}function S(_,x){return x()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?S:p;return uv.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:b,uv}var e6={},n6;function WD(){return n6||(n6=1,process.env.NODE_ENV!=="production"&&(function(){function n(D,A){return D===A&&(D!==0||1/D===1/A)||D!==D&&A!==A}function t(D,A){b||u.startTransition===void 0||(b=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var N=A();if(!_){var R=A();c(N,R)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),_=!0)}R=f({inst:{value:N,getSnapshot:A}});var O=R[0].inst,U=R[1];return m(function(){O.value=N,O.getSnapshot=A,i(O)&&U({inst:O})},[D,N,A]),p(function(){return i(O)&&U({inst:O}),D(function(){i(O)&&U({inst:O})})},[D]),S(N),N}function i(D){var A=D.getSnapshot;D=D.value;try{var N=A();return!c(D,N)}catch{return!0}}function s(D,A){return A()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var u=H,c=typeof Object.is=="function"?Object.is:n,f=u.useState,p=u.useEffect,m=u.useLayoutEffect,S=u.useDebugValue,b=!1,_=!1,x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;e6.useSyncExternalStore=u.useSyncExternalStore!==void 0?u.useSyncExternalStore:x,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),e6}var a6;function $D(){return a6||(a6=1,process.env.NODE_ENV==="production"?ov.exports=ID():ov.exports=WD()),ov.exports}var tA=$D(),eA=H.version.split(".").map(Number)[0],i6=[],nA=Symbol.for(eA>=19?"react.transitional.element":"react.element"),pc,s6=Symbol.dispose||Symbol.for("Symbol.dispose");function cv(n,t){var i=t.effect.S();return pc=t,aA.bind(t,n,i)}function aA(n,t){t(),pc=n}var l6,fv,r6=function(){},iA=((l6={o:0,effect:{s:void 0,c:function(){},S:function(){return r6},d:function(){}},subscribe:function(){return r6},getSnapshot:function(){return 0},S:function(){},f:function(){}})[s6]=function(){},l6),sA=Promise.prototype.then.bind(Promise.resolve());function lA(){fv||(fv=sA(rA))}function rA(){var n;fv=void 0,(n=pc)==null||n.f()}function oA(n){lA();var t=H.useRef();t.current==null&&(typeof window>"u"?t.current=iA:t.current=(function(s){var u,c,f,p,m=0,S=rv(function(){c=this});return c.c=function(){m=m+1|0,p&&p()},(u={o:s,effect:c,subscribe:function(b){return p=b,function(){m=m+1|0,p=void 0,S()}},getSnapshot:function(){return m},S:function(){if(pc!=null){var b=pc.o,_=this.o;b==0&&_==0||b==0&&_==1?(pc.f(),f=cv(void 0,this)):b==1&&_==0||b==2&&_==0||(f=cv(pc,this))}else f=cv(void 0,this)},f:function(){var b=f;f=void 0,b?.()}})[s6]=function(){this.f()},u})(n));var i=t.current;return tA.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot),i.S(),i}Object.defineProperties(Fa.prototype,{$$typeof:{configurable:!0,value:nA},type:{configurable:!0,value:function(n){var t=n.data,i=oA(1);try{return t.value}finally{i.f()}}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}});function Ko(n,t){return H.useMemo(function(){return FD(n,t)},i6)}function lh(n,t){var i=H.useRef(n);i.current=n,H.useEffect(function(){return rv(function(){return i.current()},t)},i6)}const o6=H.createContext(void 0),u6=()=>H.useContext(o6),uA=(n,t)=>{const{name:i,value:s,checked:u=!1,partial:c=!1,readOnly:f=!1,onChange:p,children:m,className:S}=n,[b,_]=H.useState(i),[x,D]=H.useState(f),A=H.useRef(void 0),N=H.useRef(void 0),R=H.useRef(void 0),O=H.useRef(void 0),U=H.useRef(void 0),j=H.useRef(void 0),V=u6(),J=J1(),W=H.useId(),st=H.useMemo(()=>J?.sharedId||n.id||W,[J?.sharedId,n.id,W]),[I,et,nt]=QD({checked:!1,partial:!1}),bt=Q4(u),rt=Q4(c);H.useEffect(()=>{if(I.initial)et({checked:c?!1:u,partial:c});else{const F=bt.changed?u:I.value.checked,K=rt.changed?c:I.value.partial;et({checked:K?!1:F,partial:K})}},[u,c]),H.useEffect(()=>{D(f)},[f]),H.useEffect(()=>{V&&(A.current=V.nameSignal,N.current=V.valueSignal,R.current=V.readOnlySignal,O.current=V.useComparator,U.current=V.compare,j.current=V.onCheckboxChange)},[V]),lh(()=>{if(N.current)if(O.current?.value&&U.current){const F=U.current,K=N.current.value?.some(at=>F(s,at))??!1;et(at=>({...at,checked:K}))}else{const F=N.current.value?.some(K=>s===K)??!1;et(K=>({...K,checked:F}))}}),lh(()=>{A.current&&_(A.current.value)}),lh(()=>{R.current&&D(R.current.value??!1)});const dt=Wp(F=>{const K=nt.current?.value.partial===!0?!0:F.target.checked;et({checked:K,partial:!1}),j.current?j.current({originalEvent:F,name:b,value:s,checked:K}):p?.({originalEvent:F,name:b,value:s,checked:K})}),pt=F=>{const K={checked:F?!1:nt.current?.value.checked??!1,partial:F};et(K)},tt=F=>{et({checked:F,partial:!1})};H.useImperativeHandle(t,()=>({setPartiallyChecked:pt,setChecked:tt}));const w=b&&Ja.jsx(av,{id:st,name:b,type:"checkbox",checked:I.value.checked,readOnly:x,onChange:dt});return $p({wrapperElement:"label",renderProps:{...I.value,readOnly:x},elementProps:{htmlFor:st},className:S,innerWrapperElement:w,children:m})},c6=H.memo(H.forwardRef(uA)),cA=(n,t)=>n&&t&&typeof n=="object"&&typeof t=="object"&&"value"in n&&"value"in t?n.value===t.value:n===t,f6=(n=cA)=>Wp((t,i)=>{if(typeof n=="string"){const s=n;return t?.[s]===i?.[s]}return n(t,i)}),h6=({props:n,children:t})=>Ja.jsx(o6.Provider,{value:n,children:t}),fA=({name:n,value:t,comparator:i,readOnly:s=!1,onChange:u,className:c,children:f})=>{const p=Ko(),m=Ko(),S=Ko(),b=Ko(),_=f6(i),x=Wp(A=>{if(A){const{checked:N}=A,R=A.value;if(m.value)if(i)if(N)m.value.findIndex(O=>_(R,O))===-1&&m.value.push(R);else{const O=m.value.filter(U=>!_(R,U));m.value=[...O]}else if(N)m.value.indexOf(R)===-1&&m.value.push(R);else{const O=m.value.filter(U=>U!==R);m.value=[...O]}else N&&(m.value=[R])}u?.({originalEvent:A?.originalEvent,name:n,value:m.value})}),D=H.useMemo(()=>({nameSignal:p,valueSignal:m,readOnlySignal:S,useComparator:b,compare:_,onCheckboxChange:x}),[]);return H.useEffect(()=>{p.value=n},[n]),H.useEffect(()=>{m.value=t},[t]),H.useEffect(()=>{S.value=s},[s]),H.useEffect(()=>{b.value=i!==void 0},[i]),Ja.jsx("div",{className:c,children:Ja.jsx(h6,{props:D,children:f})})},d6=H.memo(fA),rh=({className:n,children:t})=>{const i=H.useId(),s=H.useMemo(()=>({sharedId:i}),[i]),u=Ja.jsx(Z4.Provider,{value:s,children:t});return $p({wrapperElement:"div",className:n,children:u})},hA=({htmlFor:n,className:t,children:i})=>{const s=J1(),u=H.useMemo(()=>s?.sharedId||n,[s?.sharedId,n]);return $p({wrapperElement:"label",elementProps:{htmlFor:u},className:t,children:i})};var p6={exports:{}},m6;function dA(){return m6||(m6=1,(function(n){(function(){var t={}.hasOwnProperty;function i(){for(var c="",f=0;f<arguments.length;f++){var p=arguments[f];p&&(c=u(c,s(p)))}return c}function s(c){if(typeof c=="string"||typeof c=="number")return c;if(typeof c!="object")return"";if(Array.isArray(c))return i.apply(null,c);if(c.toString!==Object.prototype.toString&&!c.toString.toString().includes("[native code]"))return c.toString();var f="";for(var p in c)t.call(c,p)&&c[p]&&(f=u(f,p));return f}function u(c,f){return f?c?c+" "+f:c+f:c}n.exports?(i.default=i,n.exports=i):window.classNames=i})()})(p6)),p6.exports}dA();const pA=({intersectionObserver:n,resizeObserver:t,page:i,height:s,children:u})=>{const c=H.useRef(void 0);H.useEffect(()=>()=>{c.current&&(n?.unobserve(c.current),t?.unobserve(c.current))},[]),H.useEffect(()=>(c.current&&n?.observe(c.current),()=>{c.current&&n&&n.unobserve(c.current)}),[n]);const f=m=>{c.current&&(n?.unobserve(c.current),t?.unobserve(c.current)),n?.observe(m),t?.observe(m),c.current=m},p=s?{height:`${s}px`}:{};return Ja.jsx("div",{"data-page":i,"data-name":"page",style:p,ref:m=>{m&&f(m)},children:u})};H.memo(pA);const mA=({intersectionObserver:n,page:t})=>{const i=H.useRef(void 0);H.useEffect(()=>()=>{i.current&&n?.unobserve(i.current)},[]);const s=u=>{i.current&&n?.unobserve(i.current),n?.observe(u),i.current=u};return Ja.jsx("div",{"data-page":t,"data-name":"marker",ref:u=>{u&&s(u)}})};H.memo(mA);const gA=({name:n,value:t,comparator:i,readOnly:s=!1,onChange:u,className:c,children:f})=>{const p=Ko(),m=Ko(),S=Ko(),b=Ko(),_=f6(i),x=H.useMemo(()=>({nameSignal:p,valueSignal:m,readOnlySignal:S,useComparator:b,compare:_}),[]);H.useEffect(()=>{p.value=n},[n]),H.useEffect(()=>{m.value=t},[t]),H.useEffect(()=>{S.value=s},[s]),H.useEffect(()=>{b.value=i!==void 0},[i]);const D=Wp(A=>{u?.({originalEvent:A,name:n,value:m.value})});return Ja.jsx("div",{className:c,onChange:D,children:Ja.jsx(h6,{props:x,children:f})})},g6=H.memo(gA),yA=({value:n,className:t,children:i})=>{const[s,u]=H.useState(),[c,f]=H.useState(!1),[p,m]=H.useState(!1),S=H.useRef(void 0),b=H.useRef(void 0),_=H.useRef(void 0),x=H.useRef(void 0),D=H.useRef(void 0),A=u6(),N=J1(),R=H.useId(),O=H.useMemo(()=>N?.sharedId||R,[N?.sharedId,R]);H.useEffect(()=>{A&&(S.current=A.nameSignal,b.current=A.valueSignal,_.current=A.readOnlySignal,x.current=A.useComparator,D.current=A.compare)},[A]),lh(()=>{x&&b.current&&D.current?f(D.current(n,b.current.value)):f(n===b.current?.value)}),lh(()=>{u(S.current?.value)}),lh(()=>{m(_.current?.value??!1)});const U=Wp(j=>{j.target.checked&&b.current&&(b.current.value=n)});return $p({wrapperElement:"label",renderProps:{checked:c,readOnly:p},elementProps:{htmlFor:O},className:t,innerWrapperElement:s?Ja.jsx(av,{id:O,name:s,type:"radio",value:n,checked:c,readOnly:p,onChange:U}):null,children:i})},y6=H.memo(yA),vA=(n,t)=>{const{id:i,name:s,value:u,toggled:c=!1,readOnly:f,onChange:p,children:m,className:S}=n,[b,_]=H.useState(c),x=J1(),D=H.useId(),A=H.useMemo(()=>x?.sharedId||i||D,[x?.sharedId,i,D]);H.useEffect(()=>{_(c)},[c]);const N=O=>{_(O.target.checked),p?.({originalEvent:O,name:s,value:u,checked:O.target.checked})},R=O=>{_(O)};return H.useImperativeHandle(t,()=>({setToggled:R})),$p({wrapperElement:"label",renderProps:{toggled:b,readOnly:f},elementProps:{htmlFor:A},className:S,innerWrapperElement:Ja.jsx(av,{id:A,name:s,type:"checkbox",checked:b,readOnly:f,onChange:N}),children:m})},SA=H.memo(H.forwardRef(vA)),hv=n=>{const[t,i]=H.useState(!0),s=j4();return H.useEffect(()=>{s&&s.useAnimations!==void 0?i(s.useAnimations):n!==void 0&&i(n)},[s,n]),t},wr=({label:n,htmlFor:t,readOnly:i=!1,className:s})=>{const u=Se("bc-label",{"bsc:text-black bsc:dark:text-mono-light-1":!i,"bc-read-only bsc:text-gray-4 bsc:dark:text-mono-light-3 bsc:pointer-events-none":i},s);return X.jsx(hA,{htmlFor:t,className:u,children:n})},bA=(n,t)=>{const{name:i,label:s,value:u,readOnly:c=!1,checked:f=!1,partial:p=!1,labelLocation:m=Es.Right,className:S,useAnimation:b,onChange:_}=n,x=hv(b),D=Se("bc-checkbox-wrapper bsc:flex bsc:items-center bsc:group/wrapper bsc:*:cursor-pointer bsc:has-data-read-only:text-gray-4 bsc:dark:has-data-read-only:text-mono-light-3 bsc:has-data-read-only:pointer-events-none",S),A=Se("bc-checkbox-label bsc:peer-data-read-only:text-gray-4 bsc:dark:peer-data-read-only:text-mono-light-3",{"bsc:ml-2":m===Es.Right,"bsc:mr-2":m===Es.Left}),N=kp(nh.FocusWithin),R=Se("bc-checkbox-outer bsc:group/checkbox bsc:peer bsc:rounded bsc:*:block bsc:*:size-[21px]","bsc:inset-shadow-[0_0_0_1px] bsc:inset-shadow-gray-2 bsc:dark:inset-shadow-[0_0_0_1px] bsc:dark:inset-shadow-mono-light-2","bsc:group-hover/wrapper:not-data-checked:inset-shadow-[0_0_0_2px] bsc:group-hover/wrapper:not-data-checked:inset-shadow-gray-4","bsc:dark:group-hover/wrapper:not-data-checked:inset-shadow-[0_0_0_2px] bsc:[transition:box-shadow_0.3s]",N),O=Se("bc-checkbox-svg bsc:rounded bsc:stroke-mono-light-1 bsc:stroke-2 bsc:[stroke-linecap:round]","bsc:[stroke-linejoin:round] bsc:dark:stroke-mono-dark-3 bsc:[transform:scale(0)]","bsc:group-data-checked/checkbox:group-data-read-only/checkbox:bg-primary-4 bsc:group-data-checked/checkbox:group-data-read-only/checkbox:fill-primary-4 bsc:group-data-partial/checkbox:group-data-read-only/checkbox:bg-primary-4 bsc:group-data-partial/checkbox:group-data-read-only/checkbox:fill-primary-4 bsc:dark:group-data-checked/checkbox:group-data-read-only/checkbox:bg-mono-light-3 bsc:dark:group-data-checked/checkbox:group-data-read-only/checkbox:fill-mono-light-3 bsc:dark:group-data-partial/checkbox:group-data-read-only/checkbox:bg-mono-light-3 bsc:dark:group-data-partial/checkbox:group-data-read-only/checkbox:fill-mono-light-3","bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:bg-primary-1 bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:fill-primary-1 bsc:group-data-partial/checkbox:bg-primary-1 bsc:group-data-partial/checkbox:fill-primary-1 bsc:dark:group-data-checked/checkbox:bg-mono-light-1 bsc:dark:group-data-checked/checkbox:fill-mono-light-1 bsc:dark:group-data-partial/checkbox:bg-mono-light-1 bsc:dark:group-data-partial/checkbox:fill-mono-light-1",{"bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:animate-bounce bsc:group-data-partial/checkbox:group-not-data-read-only/checkbox:animate-bounce bsc:group-data-checked/checkbox:group-data-read-only/checkbox:[transform:scale(1)] bsc:group-data-partial/checkbox:group-data-read-only/checkbox:[transform:scale(1)]":x,"bsc:group-data-checked/checkbox:[transform:scale(1)] bsc:group-data-partial/checkbox:[transform:scale(1)]":!x});return X.jsxs(rh,{className:D,children:[s&&m===Es.Left&&X.jsx(wr,{label:s,readOnly:c,className:A}),X.jsx(c6,{ref:t,name:i,value:u,checked:f,partial:p,readOnly:c,className:R,onChange:_,children:X.jsxs("svg",{viewBox:"0 0 21 21",className:O,children:[X.jsx("polyline",{className:"bsc:[visibility:hidden] bsc:group-data-checked/checkbox:visible",points:"5 10.75 8.5 14.25 16 6"}),X.jsx("polyline",{className:"bsc:[visibility:hidden] bsc:group-data-partial/checkbox:visible",points:"6 10.5 16 10.5"})]})}),s&&m===Es.Right&&X.jsx(wr,{label:s,readOnly:c,className:A})]})},v6=H.memo(H.forwardRef(bA)),EA=({name:n,label:t,value:i,data:s,textField:u,valueField:c,readOnly:f=!1,orientation:p=Za.Vertical,className:m,onChange:S})=>{const[b,_]=H.useState([]),x=tv(()=>s,[s]);H.useEffect(()=>{_(i??[])},[i]);const D=U=>{if(U){const{value:j}=U;_(j??[]),S?.({name:n,value:j})}},A=(U,j)=>X.jsx(v6,{label:U[u],value:U[c],className:"bsc:mr-3"},`${n}_checkbox_${j}`),N=Se("bsc:flex bsc:flex-col bsc:gap-1",m),R=Se("bsc:flex bsc:gap-1",{"bsc:flex-col":p===Za.Vertical}),O=U=>X.jsx(d6,{name:n,value:b,readOnly:f,onChange:D,className:R,children:U.map(A)});return X.jsxs("div",{className:N,children:[t&&X.jsx(wr,{label:t,readOnly:f}),x&&O(x)]})},TA=H.memo(EA);var S6=typeof global=="object"&&global&&global.Object===Object&&global,CA=typeof self=="object"&&self&&self.Object===Object&&self,rl=S6||CA||Function("return this")(),oh=rl.Symbol,b6=Object.prototype,_A=b6.hasOwnProperty,xA=b6.toString,e0=oh?oh.toStringTag:void 0;function DA(n){var t=_A.call(n,e0),i=n[e0];try{n[e0]=void 0;var s=!0}catch{}var u=xA.call(n);return s&&(t?n[e0]=i:delete n[e0]),u}var AA=Object.prototype,MA=AA.toString;function NA(n){return MA.call(n)}var OA="[object Null]",RA="[object Undefined]",E6=oh?oh.toStringTag:void 0;function uh(n){return n==null?n===void 0?RA:OA:E6&&E6 in Object(n)?DA(n):NA(n)}function ch(n){return n!=null&&typeof n=="object"}var zA="[object Symbol]";function HA(n){return typeof n=="symbol"||ch(n)&&uh(n)==zA}var dv=Array.isArray,wA=/\s/;function UA(n){for(var t=n.length;t--&&wA.test(n.charAt(t)););return t}var BA=/^\s+/;function VA(n){return n&&n.slice(0,UA(n)+1).replace(BA,"")}function Qo(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}var T6=NaN,GA=/^[-+]0x[0-9a-f]+$/i,jA=/^0b[01]+$/i,LA=/^0o[0-7]+$/i,PA=parseInt;function C6(n){if(typeof n=="number")return n;if(HA(n))return T6;if(Qo(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=Qo(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=VA(n);var i=jA.test(n);return i||LA.test(n)?PA(n.slice(2),i?2:8):GA.test(n)?T6:+n}var YA="[object AsyncFunction]",qA="[object Function]",XA="[object GeneratorFunction]",KA="[object Proxy]";function _6(n){if(!Qo(n))return!1;var t=uh(n);return t==qA||t==XA||t==YA||t==KA}var pv=rl["__core-js_shared__"],x6=(function(){var n=/[^.]+$/.exec(pv&&pv.keys&&pv.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function QA(n){return!!x6&&x6 in n}var ZA=Function.prototype,JA=ZA.toString;function mc(n){if(n!=null){try{return JA.call(n)}catch{}try{return n+""}catch{}}return""}var FA=/[\\^$.*+?()[\]{}|]/g,kA=/^\[object .+?Constructor\]$/,IA=Function.prototype,WA=Object.prototype,$A=IA.toString,tM=WA.hasOwnProperty,eM=RegExp("^"+$A.call(tM).replace(FA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nM(n){if(!Qo(n)||QA(n))return!1;var t=_6(n)?eM:kA;return t.test(mc(n))}function aM(n,t){return n?.[t]}function gc(n,t){var i=aM(n,t);return nM(i)?i:void 0}var mv=gc(rl,"WeakMap"),D6=Object.create,iM=(function(){function n(){}return function(t){if(!Qo(t))return{};if(D6)return D6(t);n.prototype=t;var i=new n;return n.prototype=void 0,i}})(),A6=(function(){try{var n=gc(Object,"defineProperty");return n({},"",{}),n}catch{}})();function sM(n,t){for(var i=-1,s=n==null?0:n.length;++i<s&&t(n[i],i,n)!==!1;);return n}var lM=9007199254740991,rM=/^(?:0|[1-9]\d*)$/;function oM(n,t){var i=typeof n;return t=t??lM,!!t&&(i=="number"||i!="symbol"&&rM.test(n))&&n>-1&&n%1==0&&n<t}function uM(n,t,i){t=="__proto__"&&A6?A6(n,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[t]=i}function M6(n,t){return n===t||n!==n&&t!==t}var cM=Object.prototype,fM=cM.hasOwnProperty;function hM(n,t,i){var s=n[t];(!(fM.call(n,t)&&M6(s,i))||i===void 0&&!(t in n))&&uM(n,t,i)}var dM=9007199254740991;function N6(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=dM}function pM(n){return n!=null&&N6(n.length)&&!_6(n)}var mM=Object.prototype;function O6(n){var t=n&&n.constructor,i=typeof t=="function"&&t.prototype||mM;return n===i}function gM(n,t){for(var i=-1,s=Array(n);++i<n;)s[i]=t(i);return s}var yM="[object Arguments]";function R6(n){return ch(n)&&uh(n)==yM}var z6=Object.prototype,vM=z6.hasOwnProperty,SM=z6.propertyIsEnumerable,bM=R6((function(){return arguments})())?R6:function(n){return ch(n)&&vM.call(n,"callee")&&!SM.call(n,"callee")};function EM(){return!1}var H6=typeof $t=="object"&&$t&&!$t.nodeType&&$t,w6=H6&&typeof module=="object"&&module&&!module.nodeType&&module,TM=w6&&w6.exports===H6,U6=TM?rl.Buffer:void 0,CM=U6?U6.isBuffer:void 0,B6=CM||EM,_M="[object Arguments]",xM="[object Array]",DM="[object Boolean]",AM="[object Date]",MM="[object Error]",NM="[object Function]",OM="[object Map]",RM="[object Number]",zM="[object Object]",HM="[object RegExp]",wM="[object Set]",UM="[object String]",BM="[object WeakMap]",VM="[object ArrayBuffer]",GM="[object DataView]",jM="[object Float32Array]",LM="[object Float64Array]",PM="[object Int8Array]",YM="[object Int16Array]",qM="[object Int32Array]",XM="[object Uint8Array]",KM="[object Uint8ClampedArray]",QM="[object Uint16Array]",ZM="[object Uint32Array]",sn={};sn[jM]=sn[LM]=sn[PM]=sn[YM]=sn[qM]=sn[XM]=sn[KM]=sn[QM]=sn[ZM]=!0,sn[_M]=sn[xM]=sn[VM]=sn[DM]=sn[GM]=sn[AM]=sn[MM]=sn[NM]=sn[OM]=sn[RM]=sn[zM]=sn[HM]=sn[wM]=sn[UM]=sn[BM]=!1;function JM(n){return ch(n)&&N6(n.length)&&!!sn[uh(n)]}function gv(n){return function(t){return n(t)}}var V6=typeof $t=="object"&&$t&&!$t.nodeType&&$t,n0=V6&&typeof module=="object"&&module&&!module.nodeType&&module,FM=n0&&n0.exports===V6,yv=FM&&S6.process,fh=(function(){try{var n=n0&&n0.require&&n0.require("util").types;return n||yv&&yv.binding&&yv.binding("util")}catch{}})(),G6=fh&&fh.isTypedArray,kM=G6?gv(G6):JM,IM=Object.prototype,WM=IM.hasOwnProperty;function $M(n,t){var i=dv(n),s=!i&&bM(n),u=!i&&!s&&B6(n),c=!i&&!s&&!u&&kM(n),f=i||s||u||c,p=f?gM(n.length,String):[],m=p.length;for(var S in n)WM.call(n,S)&&!(f&&(S=="length"||u&&(S=="offset"||S=="parent")||c&&(S=="buffer"||S=="byteLength"||S=="byteOffset")||oM(S,m)))&&p.push(S);return p}function j6(n,t){return function(i){return n(t(i))}}var tN=j6(Object.keys,Object),eN=Object.prototype,nN=eN.hasOwnProperty;function aN(n){if(!O6(n))return tN(n);var t=[];for(var i in Object(n))nN.call(n,i)&&i!="constructor"&&t.push(i);return t}function iN(n){return pM(n)?$M(n):aN(n)}var a0=gc(Object,"create");function sN(){this.__data__=a0?a0(null):{},this.size=0}function lN(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}var rN="__lodash_hash_undefined__",oN=Object.prototype,uN=oN.hasOwnProperty;function cN(n){var t=this.__data__;if(a0){var i=t[n];return i===rN?void 0:i}return uN.call(t,n)?t[n]:void 0}var fN=Object.prototype,hN=fN.hasOwnProperty;function dN(n){var t=this.__data__;return a0?t[n]!==void 0:hN.call(t,n)}var pN="__lodash_hash_undefined__";function mN(n,t){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=a0&&t===void 0?pN:t,this}function yc(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}yc.prototype.clear=sN,yc.prototype.delete=lN,yc.prototype.get=cN,yc.prototype.has=dN,yc.prototype.set=mN;function gN(){this.__data__=[],this.size=0}function k1(n,t){for(var i=n.length;i--;)if(M6(n[i][0],t))return i;return-1}var yN=Array.prototype,vN=yN.splice;function SN(n){var t=this.__data__,i=k1(t,n);if(i<0)return!1;var s=t.length-1;return i==s?t.pop():vN.call(t,i,1),--this.size,!0}function bN(n){var t=this.__data__,i=k1(t,n);return i<0?void 0:t[i][1]}function EN(n){return k1(this.__data__,n)>-1}function TN(n,t){var i=this.__data__,s=k1(i,n);return s<0?(++this.size,i.push([n,t])):i[s][1]=t,this}function Ur(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}Ur.prototype.clear=gN,Ur.prototype.delete=SN,Ur.prototype.get=bN,Ur.prototype.has=EN,Ur.prototype.set=TN;var i0=gc(rl,"Map");function CN(){this.size=0,this.__data__={hash:new yc,map:new(i0||Ur),string:new yc}}function _N(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function I1(n,t){var i=n.__data__;return _N(t)?i[typeof t=="string"?"string":"hash"]:i.map}function xN(n){var t=I1(this,n).delete(n);return this.size-=t?1:0,t}function DN(n){return I1(this,n).get(n)}function AN(n){return I1(this,n).has(n)}function MN(n,t){var i=I1(this,n),s=i.size;return i.set(n,t),this.size+=i.size==s?0:1,this}function hh(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}hh.prototype.clear=CN,hh.prototype.delete=xN,hh.prototype.get=DN,hh.prototype.has=AN,hh.prototype.set=MN;function NN(n,t){for(var i=-1,s=t.length,u=n.length;++i<s;)n[u+i]=t[i];return n}var ON=j6(Object.getPrototypeOf,Object);function RN(){this.__data__=new Ur,this.size=0}function zN(n){var t=this.__data__,i=t.delete(n);return this.size=t.size,i}function HN(n){return this.__data__.get(n)}function wN(n){return this.__data__.has(n)}var UN=200;function BN(n,t){var i=this.__data__;if(i instanceof Ur){var s=i.__data__;if(!i0||s.length<UN-1)return s.push([n,t]),this.size=++i.size,this;i=this.__data__=new hh(s)}return i.set(n,t),this.size=i.size,this}function dh(n){var t=this.__data__=new Ur(n);this.size=t.size}dh.prototype.clear=RN,dh.prototype.delete=zN,dh.prototype.get=HN,dh.prototype.has=wN,dh.prototype.set=BN;var L6=typeof $t=="object"&&$t&&!$t.nodeType&&$t,P6=L6&&typeof module=="object"&&module&&!module.nodeType&&module,VN=P6&&P6.exports===L6,Y6=VN?rl.Buffer:void 0;Y6&&Y6.allocUnsafe;function GN(n,t){return n.slice()}function jN(n,t){for(var i=-1,s=n==null?0:n.length,u=0,c=[];++i<s;){var f=n[i];t(f,i,n)&&(c[u++]=f)}return c}function LN(){return[]}var PN=Object.prototype,YN=PN.propertyIsEnumerable,q6=Object.getOwnPropertySymbols,qN=q6?function(n){return n==null?[]:(n=Object(n),jN(q6(n),function(t){return YN.call(n,t)}))}:LN;function XN(n,t,i){var s=t(n);return dv(n)?s:NN(s,i(n))}function KN(n){return XN(n,iN,qN)}var vv=gc(rl,"DataView"),Sv=gc(rl,"Promise"),bv=gc(rl,"Set"),X6="[object Map]",QN="[object Object]",K6="[object Promise]",Q6="[object Set]",Z6="[object WeakMap]",J6="[object DataView]",ZN=mc(vv),JN=mc(i0),FN=mc(Sv),kN=mc(bv),IN=mc(mv),Br=uh;(vv&&Br(new vv(new ArrayBuffer(1)))!=J6||i0&&Br(new i0)!=X6||Sv&&Br(Sv.resolve())!=K6||bv&&Br(new bv)!=Q6||mv&&Br(new mv)!=Z6)&&(Br=function(n){var t=uh(n),i=t==QN?n.constructor:void 0,s=i?mc(i):"";if(s)switch(s){case ZN:return J6;case JN:return X6;case FN:return K6;case kN:return Q6;case IN:return Z6}return t});var WN=Object.prototype,$N=WN.hasOwnProperty;function tO(n){var t=n.length,i=new n.constructor(t);return t&&typeof n[0]=="string"&&$N.call(n,"index")&&(i.index=n.index,i.input=n.input),i}var F6=rl.Uint8Array;function Ev(n){var t=new n.constructor(n.byteLength);return new F6(t).set(new F6(n)),t}function eO(n,t){var i=Ev(n.buffer);return new n.constructor(i,n.byteOffset,n.byteLength)}var nO=/\w*$/;function aO(n){var t=new n.constructor(n.source,nO.exec(n));return t.lastIndex=n.lastIndex,t}var k6=oh?oh.prototype:void 0,I6=k6?k6.valueOf:void 0;function iO(n){return I6?Object(I6.call(n)):{}}function sO(n,t){var i=Ev(n.buffer);return new n.constructor(i,n.byteOffset,n.length)}var lO="[object Boolean]",rO="[object Date]",oO="[object Map]",uO="[object Number]",cO="[object RegExp]",fO="[object Set]",hO="[object String]",dO="[object Symbol]",pO="[object ArrayBuffer]",mO="[object DataView]",gO="[object Float32Array]",yO="[object Float64Array]",vO="[object Int8Array]",SO="[object Int16Array]",bO="[object Int32Array]",EO="[object Uint8Array]",TO="[object Uint8ClampedArray]",CO="[object Uint16Array]",_O="[object Uint32Array]";function xO(n,t,i){var s=n.constructor;switch(t){case pO:return Ev(n);case lO:case rO:return new s(+n);case mO:return eO(n);case gO:case yO:case vO:case SO:case bO:case EO:case TO:case CO:case _O:return sO(n);case oO:return new s;case uO:case hO:return new s(n);case cO:return aO(n);case fO:return new s;case dO:return iO(n)}}function DO(n){return typeof n.constructor=="function"&&!O6(n)?iM(ON(n)):{}}var AO="[object Map]";function MO(n){return ch(n)&&Br(n)==AO}var W6=fh&&fh.isMap,NO=W6?gv(W6):MO,OO="[object Set]";function RO(n){return ch(n)&&Br(n)==OO}var $6=fh&&fh.isSet,zO=$6?gv($6):RO,tb="[object Arguments]",HO="[object Array]",wO="[object Boolean]",UO="[object Date]",BO="[object Error]",eb="[object Function]",VO="[object GeneratorFunction]",GO="[object Map]",jO="[object Number]",nb="[object Object]",LO="[object RegExp]",PO="[object Set]",YO="[object String]",qO="[object Symbol]",XO="[object WeakMap]",KO="[object ArrayBuffer]",QO="[object DataView]",ZO="[object Float32Array]",JO="[object Float64Array]",FO="[object Int8Array]",kO="[object Int16Array]",IO="[object Int32Array]",WO="[object Uint8Array]",$O="[object Uint8ClampedArray]",tR="[object Uint16Array]",eR="[object Uint32Array]",Je={};Je[tb]=Je[HO]=Je[KO]=Je[QO]=Je[wO]=Je[UO]=Je[ZO]=Je[JO]=Je[FO]=Je[kO]=Je[IO]=Je[GO]=Je[jO]=Je[nb]=Je[LO]=Je[PO]=Je[YO]=Je[qO]=Je[WO]=Je[$O]=Je[tR]=Je[eR]=!0,Je[BO]=Je[eb]=Je[XO]=!1;function W1(n,t,i,s,u,c){var f;if(f!==void 0)return f;if(!Qo(n))return n;var p=dv(n);if(p)f=tO(n);else{var m=Br(n),S=m==eb||m==VO;if(B6(n))return GN(n);if(m==nb||m==tb||S&&!u)f=S?{}:DO(n);else{if(!Je[m])return u?n:{};f=xO(n,m)}}c||(c=new dh);var b=c.get(n);if(b)return b;c.set(n,f),zO(n)?n.forEach(function(D){f.add(W1(D,t,i,D,n,c))}):NO(n)&&n.forEach(function(D,A){f.set(A,W1(D,t,i,A,n,c))});var _=KN,x=p?void 0:_(n);return sM(x||n,function(D,A){x&&(A=D,D=n[A]),hM(f,A,W1(D,t,i,A,n,c))}),f}var nR=1,aR=4;function iR(n){return W1(n,nR|aR)}var Tv=function(){return rl.Date.now()},sR="Expected a function",lR=Math.max,rR=Math.min;function s0(n,t,i){var s,u,c,f,p,m,S=0,b=!1,_=!1,x=!0;if(typeof n!="function")throw new TypeError(sR);t=C6(t)||0,Qo(i)&&(b=!!i.leading,_="maxWait"in i,c=_?lR(C6(i.maxWait)||0,t):c,x="trailing"in i?!!i.trailing:x);function D(W){var st=s,I=u;return s=u=void 0,S=W,f=n.apply(I,st),f}function A(W){return S=W,p=setTimeout(O,t),b?D(W):f}function N(W){var st=W-m,I=W-S,et=t-st;return _?rR(et,c-I):et}function R(W){var st=W-m,I=W-S;return m===void 0||st>=t||st<0||_&&I>=c}function O(){var W=Tv();if(R(W))return U(W);p=setTimeout(O,N(W))}function U(W){return p=void 0,x&&s?D(W):(s=u=void 0,f)}function j(){p!==void 0&&clearTimeout(p),S=0,s=m=u=p=void 0}function V(){return p===void 0?f:U(Tv())}function J(){var W=Tv(),st=R(W);if(s=arguments,u=this,m=W,st){if(p===void 0)return A(m);if(_)return clearTimeout(p),p=setTimeout(O,t),D(m)}return p===void 0&&(p=setTimeout(O,t)),f}return J.cancel=j,J.flush=V,J}var oR="Expected a function";function uR(n,t,i){var s=!0,u=!0;if(typeof n!="function")throw new TypeError(oR);return Qo(i)&&(s="leading"in i?!0:s,u="trailing"in i?!!i.trailing:u),s0(n,t,{leading:s,maxWait:t,trailing:u})}const cR=(n,t)=>{const{value:i,readOnly:s=!1,debounceTime:u=800,fillContainer:c=!0,leftElement:f,rightElement:p,className:m,leftElementClassName:S,rightElementClassName:b,isSingleLine:_=!0,allowSingleLineScroll:x=!1,inputMode:D,placeholder:A,onFocus:N,onBlur:R,onInput:O,onInnerTextChange:U,onInnerHTMLChange:j,onElementCreate:V,onLeftElementClick:J,onRightElementClick:W}=n,st=H.useRef("bsc:grow bsc:focus:outline-hidden"),I=H.useRef("bsc:text-gray-4"),et=H.useRef(void 0),nt=H.useCallback(Tt=>{const Pt=Tt.target,le=Pt.innerHTML;Pt.className=`${st.current}`,A&&le===A&&(Pt.innerHTML=""),N?.(Tt)},[A,N]),bt=H.useCallback(Tt=>{const Pt=Tt.target.innerHTML;if(A&&Pt===""){const le=Tt.target;le.innerHTML=A,le.className=`${st.current} ${I.current}`}R?.(Tt)},[A,R]),rt=H.useCallback(Tt=>{et.current?.removeEventListener("focus",nt),et.current?.removeEventListener("blur",bt),A&&Tt&&Tt!==document.activeElement&&Tt.innerHTML===""&&(Tt.innerHTML=A,Tt.className=`${st.current} ${I.current}`),Tt.addEventListener("focus",nt),Tt.addEventListener("blur",bt),et.current=Tt},[A]),dt=H.useCallback(Tt=>{V?.(Tt)},[V]),pt=Tt=>{J?.(Tt)},tt=Tt=>{W?.(Tt)},w=s0(Tt=>{O?.(Tt),U?.(Tt.target.innerText),j?.(Tt.target.innerHTML)},u),F=H.useCallback(Tt=>{et.current&&(et.current.innerText=Tt)},[]),K=H.useCallback(Tt=>{et.current&&(et.current.innerHTML=Tt)},[]),at=H.useCallback(()=>{et.current?.focus()},[]);H.useImperativeHandle(t,()=>({inputElement:et.current,setInnerText:F,setInnerHTML:K,focus:at}));const St=Se({"bsc:w-full ":c},"bsc:flex bsc:flex-row bsc:items-center bsc:shadow-sm bsc:border bsc:border-solid bsc:border-gray-3 bsc:dark:border-white bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1 bsc:rounded-md bsc:p-2",{"bsc:overflow-x-auto bsc:overflow-y-hidden bsc:whitespace-pre":_&&x,"bsc:overflow-hidden bsc:whitespace-pre":_&&!x},m),$=Se("bsc:shrink",{"bsc:mr-2":f},S),gt=Se("bsc:shrink",{"bsc:ml-2":p},b);return X.jsxs("div",{className:St,ref:Tt=>{Tt&&dt(Tt)},children:[f&&X.jsx("div",{className:$,onClick:pt,children:f}),X.jsx("div",{ref:Tt=>{Tt&&rt(Tt)},className:st.current,contentEditable:!s,suppressContentEditableWarning:!0,inputMode:D,onInput:w,children:i}),p&&X.jsx("div",{className:gt,onClick:tt,children:p})]})},$1=H.forwardRef(cR);function Oe(n){const t=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&t==="[object Date]"?new n.constructor(+n):typeof n=="number"||t==="[object Number]"||typeof n=="string"||t==="[object String]"?new Date(n):new Date(NaN)}function Fe(n,t){return n instanceof Date?new n.constructor(t):new Date(t)}function ph(n,t){const i=Oe(n);return isNaN(t)?Fe(n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Zo(n,t){const i=Oe(n);if(isNaN(t))return Fe(n,NaN);if(!t)return i;const s=i.getDate(),u=Fe(n,i.getTime());u.setMonth(i.getMonth()+t+1,0);const c=u.getDate();return s>=c?u:(i.setFullYear(u.getFullYear(),u.getMonth(),s),i)}const ab=6048e5,Cv=6e4,_v=36e5,fR=1e3;let hR={};function l0(){return hR}function Jo(n,t){const i=l0(),s=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,u=Oe(n),c=u.getDay(),f=(c<s?7:0)+c-s;return u.setDate(u.getDate()-f),u.setHours(0,0,0,0),u}function mh(n){return Jo(n,{weekStartsOn:1})}function dR(n){const t=Oe(n),i=t.getFullYear(),s=Fe(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const u=mh(s),c=Fe(n,0);c.setFullYear(i,0,4),c.setHours(0,0,0,0);const f=mh(c);return t.getTime()>=u.getTime()?i+1:t.getTime()>=f.getTime()?i:i-1}function ib(n){const t=Oe(n);return t.setHours(0,0,0,0),t}function sb(n){const t=Oe(n),i=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return i.setUTCFullYear(t.getFullYear()),+n-+i}function pR(n){const t=dR(n),i=Fe(n,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),mh(i)}function r0(n,t){return Zo(n,t*12)}function lb(n,t){const i=ib(n),s=ib(t);return+i==+s}function mR(n){const t=Oe(n),i=t.getMonth();return t.setFullYear(t.getFullYear(),i+1,0),t.setHours(23,59,59,999),t}function gR(n,t){const i=Oe(n.start),s=Oe(n.end);let u=+i>+s;const c=u?+i:+s,f=u?s:i;f.setHours(0,0,0,0);let p=1;const m=[];for(;+f<=c;)m.push(Oe(f)),f.setDate(f.getDate()+p),f.setHours(0,0,0,0);return u?m.reverse():m}function rb(n){const t=Oe(n);return t.setDate(1),t.setHours(0,0,0,0),t}function yR(n,t){const i=Oe(n.start),s=Oe(n.end);let u=+i>+s;const c=u?+i:+s,f=u?s:i;f.setHours(0,0,0,0),f.setMonth(0,1);let p=1;const m=[];for(;+f<=c;)m.push(Oe(f)),f.setFullYear(f.getFullYear()+p);return u?m.reverse():m}const vR={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},SR=(n,t,i)=>{let s;const u=vR[n];return typeof u=="string"?s=u:t===1?s=u.one:s=u.other.replace("{{count}}",t.toString()),i?.addSuffix?i.comparison&&i.comparison>0?"in "+s:s+" ago":s};function xv(n){return(t={})=>{const i=t.width?String(t.width):n.defaultWidth;return n.formats[i]||n.formats[n.defaultWidth]}}const bR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ER={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},TR={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},CR={date:xv({formats:bR,defaultWidth:"full"}),time:xv({formats:ER,defaultWidth:"full"}),dateTime:xv({formats:TR,defaultWidth:"full"})},_R={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xR=(n,t,i,s)=>_R[n];function o0(n){return(t,i)=>{const s=i?.context?String(i.context):"standalone";let u;if(s==="formatting"&&n.formattingValues){const f=n.defaultFormattingWidth||n.defaultWidth,p=i?.width?String(i.width):f;u=n.formattingValues[p]||n.formattingValues[f]}else{const f=n.defaultWidth,p=i?.width?String(i.width):n.defaultWidth;u=n.values[p]||n.values[f]}const c=n.argumentCallback?n.argumentCallback(t):t;return u[c]}}const DR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},AR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},MR={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},NR={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},OR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},RR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},zR={ordinalNumber:(n,t)=>{const i=Number(n),s=i%100;if(s>20||s<10)switch(s%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:o0({values:DR,defaultWidth:"wide"}),quarter:o0({values:AR,defaultWidth:"wide",argumentCallback:n=>n-1}),month:o0({values:MR,defaultWidth:"wide"}),day:o0({values:NR,defaultWidth:"wide"}),dayPeriod:o0({values:OR,defaultWidth:"wide",formattingValues:RR,defaultFormattingWidth:"wide"})};function u0(n){return(t,i={})=>{const s=i.width,u=s&&n.matchPatterns[s]||n.matchPatterns[n.defaultMatchWidth],c=t.match(u);if(!c)return null;const f=c[0],p=s&&n.parsePatterns[s]||n.parsePatterns[n.defaultParseWidth],m=Array.isArray(p)?wR(p,_=>_.test(f)):HR(p,_=>_.test(f));let S;S=n.valueCallback?n.valueCallback(m):m,S=i.valueCallback?i.valueCallback(S):S;const b=t.slice(f.length);return{value:S,rest:b}}}function HR(n,t){for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&t(n[i]))return i}function wR(n,t){for(let i=0;i<n.length;i++)if(t(n[i]))return i}function UR(n){return(t,i={})=>{const s=t.match(n.matchPattern);if(!s)return null;const u=s[0],c=t.match(n.parsePattern);if(!c)return null;let f=n.valueCallback?n.valueCallback(c[0]):c[0];f=i.valueCallback?i.valueCallback(f):f;const p=t.slice(u.length);return{value:f,rest:p}}}const BR=/^(\d+)(th|st|nd|rd)?/i,VR=/\d+/i,GR={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jR={any:[/^b/i,/^(a|c)/i]},LR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},PR={any:[/1/i,/2/i,/3/i,/4/i]},YR={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},qR={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},XR={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},KR={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},QR={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ZR={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},JR={ordinalNumber:UR({matchPattern:BR,parsePattern:VR,valueCallback:n=>parseInt(n,10)}),era:u0({matchPatterns:GR,defaultMatchWidth:"wide",parsePatterns:jR,defaultParseWidth:"any"}),quarter:u0({matchPatterns:LR,defaultMatchWidth:"wide",parsePatterns:PR,defaultParseWidth:"any",valueCallback:n=>n+1}),month:u0({matchPatterns:YR,defaultMatchWidth:"wide",parsePatterns:qR,defaultParseWidth:"any"}),day:u0({matchPatterns:XR,defaultMatchWidth:"wide",parsePatterns:KR,defaultParseWidth:"any"}),dayPeriod:u0({matchPatterns:QR,defaultMatchWidth:"any",parsePatterns:ZR,defaultParseWidth:"any"})},FR={code:"en-US",formatDistance:SR,formatLong:CR,formatRelative:xR,localize:zR,match:JR,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kR(n){const t=Oe(n),i=+mh(t)-+pR(t);return Math.round(i/ab)+1}function ob(n,t){const i=Oe(n),s=i.getFullYear(),u=l0(),c=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??u.firstWeekContainsDate??u.locale?.options?.firstWeekContainsDate??1,f=Fe(n,0);f.setFullYear(s+1,0,c),f.setHours(0,0,0,0);const p=Jo(f,t),m=Fe(n,0);m.setFullYear(s,0,c),m.setHours(0,0,0,0);const S=Jo(m,t);return i.getTime()>=p.getTime()?s+1:i.getTime()>=S.getTime()?s:s-1}function IR(n,t){const i=l0(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,u=ob(n,t),c=Fe(n,0);return c.setFullYear(u,0,s),c.setHours(0,0,0,0),Jo(c,t)}function WR(n,t){const i=Oe(n),s=+Jo(i,t)-+IR(i,t);return Math.round(s/ab)+1}const ub=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},cb=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},fb={p:cb,P:(n,t)=>{const i=n.match(/(P+)(p+)?/)||[],s=i[1],u=i[2];if(!u)return ub(n,t);let c;switch(s){case"P":c=t.dateTime({width:"short"});break;case"PP":c=t.dateTime({width:"medium"});break;case"PPP":c=t.dateTime({width:"long"});break;default:c=t.dateTime({width:"full"});break}return c.replace("{{date}}",ub(s,t)).replace("{{time}}",cb(u,t))}},$R=/^D+$/,tz=/^Y+$/,ez=["D","DD","YY","YYYY"];function nz(n){return $R.test(n)}function az(n){return tz.test(n)}function hb(n,t,i){const s=iz(n,t,i);if(console.warn(s),ez.includes(n))throw new RangeError(s)}function iz(n,t,i){const s=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${s} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Dv(n){return Oe(n).getDay()}function db(n){const t=Oe(n),i=t.getFullYear(),s=t.getMonth(),u=Fe(n,0);return u.setFullYear(i,s+1,0),u.setHours(0,0,0,0),u.getDate()}function sz(){return Object.assign({},l0())}function lz(n){let i=Oe(n).getDay();return i===0&&(i=7),i}function rz(n){const t=Oe(n),i=t.getMonth();return t.setFullYear(t.getFullYear(),i+1,0),t.setHours(0,0,0,0),t}function oz(n,t){const i=Oe(n),s=Oe(t);return+i<+s}function uz(n,t){const i=t instanceof Date?Fe(t,0):new t(0);return i.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),i.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),i}const cz=10;class pb{subPriority=0;validate(t,i){return!0}}class fz extends pb{constructor(t,i,s,u,c){super(),this.value=t,this.validateValue=i,this.setValue=s,this.priority=u,c&&(this.subPriority=c)}validate(t,i){return this.validateValue(t,this.value,i)}set(t,i,s){return this.setValue(t,i,this.value,s)}}class hz extends pb{priority=cz;subPriority=-1;set(t,i){return i.timestampIsSet?t:Fe(t,uz(t,Date))}}class Re{run(t,i,s,u){const c=this.parse(t,i,s,u);return c?{setter:new fz(c.value,this.validate,this.set,this.priority,this.subPriority),rest:c.rest}:null}validate(t,i,s){return!0}}class dz extends Re{priority=140;parse(t,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"});case"GGGGG":return s.era(t,{width:"narrow"});default:return s.era(t,{width:"wide"})||s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"})}}set(t,i,s){return i.era=s,t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const Qn={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Zl={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Zn(n,t){return n&&{value:t(n.value),rest:n.rest}}function Tn(n,t){const i=t.match(n);return i?{value:parseInt(i[0],10),rest:t.slice(i[0].length)}:null}function Jl(n,t){const i=t.match(n);if(!i)return null;if(i[0]==="Z")return{value:0,rest:t.slice(1)};const s=i[1]==="+"?1:-1,u=i[2]?parseInt(i[2],10):0,c=i[3]?parseInt(i[3],10):0,f=i[5]?parseInt(i[5],10):0;return{value:s*(u*_v+c*Cv+f*fR),rest:t.slice(i[0].length)}}function mb(n){return Tn(Qn.anyDigitsSigned,n)}function Vn(n,t){switch(n){case 1:return Tn(Qn.singleDigit,t);case 2:return Tn(Qn.twoDigits,t);case 3:return Tn(Qn.threeDigits,t);case 4:return Tn(Qn.fourDigits,t);default:return Tn(new RegExp("^\\d{1,"+n+"}"),t)}}function tg(n,t){switch(n){case 1:return Tn(Qn.singleDigitSigned,t);case 2:return Tn(Qn.twoDigitsSigned,t);case 3:return Tn(Qn.threeDigitsSigned,t);case 4:return Tn(Qn.fourDigitsSigned,t);default:return Tn(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Av(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function gb(n,t){const i=t>0,s=i?t:1-t;let u;if(s<=50)u=n||100;else{const c=s+50,f=Math.trunc(c/100)*100,p=n>=c%100;u=n+f-(p?100:0)}return i?u:1-u}function yb(n){return n%400===0||n%4===0&&n%100!==0}class pz extends Re{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,i,s){const u=c=>({year:c,isTwoDigitYear:i==="yy"});switch(i){case"y":return Zn(Vn(4,t),u);case"yo":return Zn(s.ordinalNumber(t,{unit:"year"}),u);default:return Zn(Vn(i.length,t),u)}}validate(t,i){return i.isTwoDigitYear||i.year>0}set(t,i,s){const u=t.getFullYear();if(s.isTwoDigitYear){const f=gb(s.year,u);return t.setFullYear(f,0,1),t.setHours(0,0,0,0),t}const c=!("era"in i)||i.era===1?s.year:1-s.year;return t.setFullYear(c,0,1),t.setHours(0,0,0,0),t}}class mz extends Re{priority=130;parse(t,i,s){const u=c=>({year:c,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Zn(Vn(4,t),u);case"Yo":return Zn(s.ordinalNumber(t,{unit:"year"}),u);default:return Zn(Vn(i.length,t),u)}}validate(t,i){return i.isTwoDigitYear||i.year>0}set(t,i,s,u){const c=ob(t,u);if(s.isTwoDigitYear){const p=gb(s.year,c);return t.setFullYear(p,0,u.firstWeekContainsDate),t.setHours(0,0,0,0),Jo(t,u)}const f=!("era"in i)||i.era===1?s.year:1-s.year;return t.setFullYear(f,0,u.firstWeekContainsDate),t.setHours(0,0,0,0),Jo(t,u)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class gz extends Re{priority=130;parse(t,i){return tg(i==="R"?4:i.length,t)}set(t,i,s){const u=Fe(t,0);return u.setFullYear(s,0,4),u.setHours(0,0,0,0),mh(u)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class yz extends Re{priority=130;parse(t,i){return tg(i==="u"?4:i.length,t)}set(t,i,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class vz extends Re{priority=120;parse(t,i,s){switch(i){case"Q":case"QQ":return Vn(i.length,t);case"Qo":return s.ordinalNumber(t,{unit:"quarter"});case"QQQ":return s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(t,{width:"narrow",context:"formatting"});default:return s.quarter(t,{width:"wide",context:"formatting"})||s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=1&&i<=4}set(t,i,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Sz extends Re{priority=120;parse(t,i,s){switch(i){case"q":case"qq":return Vn(i.length,t);case"qo":return s.ordinalNumber(t,{unit:"quarter"});case"qqq":return s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(t,{width:"narrow",context:"standalone"});default:return s.quarter(t,{width:"wide",context:"standalone"})||s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=1&&i<=4}set(t,i,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class bz extends Re{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,i,s){const u=c=>c-1;switch(i){case"M":return Zn(Tn(Qn.month,t),u);case"MM":return Zn(Vn(2,t),u);case"Mo":return Zn(s.ordinalNumber(t,{unit:"month"}),u);case"MMM":return s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(t,{width:"narrow",context:"formatting"});default:return s.month(t,{width:"wide",context:"formatting"})||s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=11}set(t,i,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}class Ez extends Re{priority=110;parse(t,i,s){const u=c=>c-1;switch(i){case"L":return Zn(Tn(Qn.month,t),u);case"LL":return Zn(Vn(2,t),u);case"Lo":return Zn(s.ordinalNumber(t,{unit:"month"}),u);case"LLL":return s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(t,{width:"narrow",context:"standalone"});default:return s.month(t,{width:"wide",context:"standalone"})||s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=0&&i<=11}set(t,i,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Tz(n,t,i){const s=Oe(n),u=WR(s,i)-t;return s.setDate(s.getDate()-u*7),s}class Cz extends Re{priority=100;parse(t,i,s){switch(i){case"w":return Tn(Qn.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return Vn(i.length,t)}}validate(t,i){return i>=1&&i<=53}set(t,i,s,u){return Jo(Tz(t,s,u),u)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function _z(n,t){const i=Oe(n),s=kR(i)-t;return i.setDate(i.getDate()-s*7),i}class xz extends Re{priority=100;parse(t,i,s){switch(i){case"I":return Tn(Qn.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return Vn(i.length,t)}}validate(t,i){return i>=1&&i<=53}set(t,i,s){return mh(_z(t,s))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Dz=[31,28,31,30,31,30,31,31,30,31,30,31],Az=[31,29,31,30,31,30,31,31,30,31,30,31];class Mz extends Re{priority=90;subPriority=1;parse(t,i,s){switch(i){case"d":return Tn(Qn.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return Vn(i.length,t)}}validate(t,i){const s=t.getFullYear(),u=yb(s),c=t.getMonth();return u?i>=1&&i<=Az[c]:i>=1&&i<=Dz[c]}set(t,i,s){return t.setDate(s),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Nz extends Re{priority=90;subpriority=1;parse(t,i,s){switch(i){case"D":case"DD":return Tn(Qn.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return Vn(i.length,t)}}validate(t,i){const s=t.getFullYear();return yb(s)?i>=1&&i<=366:i>=1&&i<=365}set(t,i,s){return t.setMonth(0,s),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Mv(n,t,i){const s=l0(),u=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,c=Oe(n),f=c.getDay(),m=(t%7+7)%7,S=7-u,b=t<0||t>6?t-(f+S)%7:(m+S)%7-(f+S)%7;return ph(c,b)}class Oz extends Re{priority=90;parse(t,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=6}set(t,i,s,u){return t=Mv(t,s,u),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class Rz extends Re{priority=90;parse(t,i,s,u){const c=f=>{const p=Math.floor((f-1)/7)*7;return(f+u.weekStartsOn+6)%7+p};switch(i){case"e":case"ee":return Zn(Vn(i.length,t),c);case"eo":return Zn(s.ordinalNumber(t,{unit:"day"}),c);case"eee":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeeee":return s.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=6}set(t,i,s,u){return t=Mv(t,s,u),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class zz extends Re{priority=90;parse(t,i,s,u){const c=f=>{const p=Math.floor((f-1)/7)*7;return(f+u.weekStartsOn+6)%7+p};switch(i){case"c":case"cc":return Zn(Vn(i.length,t),c);case"co":return Zn(s.ordinalNumber(t,{unit:"day"}),c);case"ccc":return s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"ccccc":return s.day(t,{width:"narrow",context:"standalone"});case"cccccc":return s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});default:return s.day(t,{width:"wide",context:"standalone"})||s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=0&&i<=6}set(t,i,s,u){return t=Mv(t,s,u),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Hz(n,t){const i=Oe(n),s=lz(i),u=t-s;return ph(i,u)}class wz extends Re{priority=90;parse(t,i,s){const u=c=>c===0?7:c;switch(i){case"i":case"ii":return Vn(i.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return Zn(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),u);case"iiiii":return Zn(s.day(t,{width:"narrow",context:"formatting"}),u);case"iiiiii":return Zn(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),u);default:return Zn(s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),u)}}validate(t,i){return i>=1&&i<=7}set(t,i,s){return t=Hz(t,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Uz extends Re{priority=80;parse(t,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(t,{width:"narrow",context:"formatting"});default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,s){return t.setHours(Av(s),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class Bz extends Re{priority=80;parse(t,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(t,{width:"narrow",context:"formatting"});default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,s){return t.setHours(Av(s),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class Vz extends Re{priority=80;parse(t,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(t,{width:"narrow",context:"formatting"});default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,s){return t.setHours(Av(s),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class Gz extends Re{priority=70;parse(t,i,s){switch(i){case"h":return Tn(Qn.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return Vn(i.length,t)}}validate(t,i){return i>=1&&i<=12}set(t,i,s){const u=t.getHours()>=12;return u&&s<12?t.setHours(s+12,0,0,0):!u&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class jz extends Re{priority=70;parse(t,i,s){switch(i){case"H":return Tn(Qn.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return Vn(i.length,t)}}validate(t,i){return i>=0&&i<=23}set(t,i,s){return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class Lz extends Re{priority=70;parse(t,i,s){switch(i){case"K":return Tn(Qn.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return Vn(i.length,t)}}validate(t,i){return i>=0&&i<=11}set(t,i,s){return t.getHours()>=12&&s<12?t.setHours(s+12,0,0,0):t.setHours(s,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Pz extends Re{priority=70;parse(t,i,s){switch(i){case"k":return Tn(Qn.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return Vn(i.length,t)}}validate(t,i){return i>=1&&i<=24}set(t,i,s){const u=s<=24?s%24:s;return t.setHours(u,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class Yz extends Re{priority=60;parse(t,i,s){switch(i){case"m":return Tn(Qn.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return Vn(i.length,t)}}validate(t,i){return i>=0&&i<=59}set(t,i,s){return t.setMinutes(s,0,0),t}incompatibleTokens=["t","T"]}class qz extends Re{priority=50;parse(t,i,s){switch(i){case"s":return Tn(Qn.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return Vn(i.length,t)}}validate(t,i){return i>=0&&i<=59}set(t,i,s){return t.setSeconds(s,0),t}incompatibleTokens=["t","T"]}class Xz extends Re{priority=30;parse(t,i){const s=u=>Math.trunc(u*Math.pow(10,-i.length+3));return Zn(Vn(i.length,t),s)}set(t,i,s){return t.setMilliseconds(s),t}incompatibleTokens=["t","T"]}class Kz extends Re{priority=10;parse(t,i){switch(i){case"X":return Jl(Zl.basicOptionalMinutes,t);case"XX":return Jl(Zl.basic,t);case"XXXX":return Jl(Zl.basicOptionalSeconds,t);case"XXXXX":return Jl(Zl.extendedOptionalSeconds,t);default:return Jl(Zl.extended,t)}}set(t,i,s){return i.timestampIsSet?t:Fe(t,t.getTime()-sb(t)-s)}incompatibleTokens=["t","T","x"]}class Qz extends Re{priority=10;parse(t,i){switch(i){case"x":return Jl(Zl.basicOptionalMinutes,t);case"xx":return Jl(Zl.basic,t);case"xxxx":return Jl(Zl.basicOptionalSeconds,t);case"xxxxx":return Jl(Zl.extendedOptionalSeconds,t);default:return Jl(Zl.extended,t)}}set(t,i,s){return i.timestampIsSet?t:Fe(t,t.getTime()-sb(t)-s)}incompatibleTokens=["t","T","X"]}class Zz extends Re{priority=40;parse(t){return mb(t)}set(t,i,s){return[Fe(t,s*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Jz extends Re{priority=20;parse(t){return mb(t)}set(t,i,s){return[Fe(t,s),{timestampIsSet:!0}]}incompatibleTokens="*"}const Fz={G:new dz,y:new pz,Y:new mz,R:new gz,u:new yz,Q:new vz,q:new Sz,M:new bz,L:new Ez,w:new Cz,I:new xz,d:new Mz,D:new Nz,E:new Oz,e:new Rz,c:new zz,i:new wz,a:new Uz,b:new Bz,B:new Vz,h:new Gz,H:new jz,K:new Lz,k:new Pz,m:new Yz,s:new qz,S:new Xz,X:new Kz,x:new Qz,t:new Zz,T:new Jz},kz=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Iz=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Wz=/^'([^]*?)'?$/,$z=/''/g,tH=/\S/,eH=/[a-zA-Z]/;function Fl(n,t,i,s){const u=sz(),c=s?.locale??u.locale??FR,f=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??u.firstWeekContainsDate??u.locale?.options?.firstWeekContainsDate??1,p=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??u.weekStartsOn??u.locale?.options?.weekStartsOn??0;if(t==="")return n===""?Oe(i):Fe(i,NaN);const m={firstWeekContainsDate:f,weekStartsOn:p,locale:c},S=[new hz],b=t.match(Iz).map(N=>{const R=N[0];if(R in fb){const O=fb[R];return O(N,c.formatLong)}return N}).join("").match(kz),_=[];for(let N of b){!s?.useAdditionalWeekYearTokens&&az(N)&&hb(N,t,n),!s?.useAdditionalDayOfYearTokens&&nz(N)&&hb(N,t,n);const R=N[0],O=Fz[R];if(O){const{incompatibleTokens:U}=O;if(Array.isArray(U)){const V=_.find(J=>U.includes(J.token)||J.token===R);if(V)throw new RangeError(`The format string mustn't contain \`${V.fullToken}\` and \`${N}\` at the same time`)}else if(O.incompatibleTokens==="*"&&_.length>0)throw new RangeError(`The format string mustn't contain \`${N}\` and any other token at the same time`);_.push({token:R,fullToken:N});const j=O.run(n,N,c.match,m);if(!j)return Fe(i,NaN);S.push(j.setter),n=j.rest}else{if(R.match(eH))throw new RangeError("Format string contains an unescaped latin alphabet character `"+R+"`");if(N==="''"?N="'":R==="'"&&(N=nH(N)),n.indexOf(N)===0)n=n.slice(N.length);else return Fe(i,NaN)}}if(n.length>0&&tH.test(n))return Fe(i,NaN);const x=S.map(N=>N.priority).sort((N,R)=>R-N).filter((N,R,O)=>O.indexOf(N)===R).map(N=>S.filter(R=>R.priority===N).sort((R,O)=>O.subPriority-R.subPriority)).map(N=>N[0]);let D=Oe(i);if(isNaN(D.getTime()))return Fe(i,NaN);const A={};for(const N of x){if(!N.validate(D,m))return Fe(i,NaN);const R=N.set(D,A,m);Array.isArray(R)?(D=R[0],Object.assign(A,R[1])):D=R}return Fe(i,D)}function nH(n){return n.match(Wz)[1].replace($z,"'")}function aH(n){return lb(n,Date.now())}function iH(n,t){return ph(n,-t)}function sH(n,t){let i=t-Dv(n);return i<=0&&(i+=7),ph(n,i)}function lH(n,t){const s=cH(n);let u;if(s.date){const m=fH(s.date,2);u=hH(m.restDateString,m.year)}if(!u||isNaN(u.getTime()))return new Date(NaN);const c=u.getTime();let f=0,p;if(s.time&&(f=dH(s.time),isNaN(f)))return new Date(NaN);if(s.timezone){if(p=pH(s.timezone),isNaN(p))return new Date(NaN)}else{const m=new Date(c+f),S=new Date(0);return S.setFullYear(m.getUTCFullYear(),m.getUTCMonth(),m.getUTCDate()),S.setHours(m.getUTCHours(),m.getUTCMinutes(),m.getUTCSeconds(),m.getUTCMilliseconds()),S}return new Date(c+f+p)}const eg={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},rH=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,oH=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,uH=/^([+-])(\d{2})(?::?(\d{2}))?$/;function cH(n){const t={},i=n.split(eg.dateTimeDelimiter);let s;if(i.length>2)return t;if(/:/.test(i[0])?s=i[0]:(t.date=i[0],s=i[1],eg.timeZoneDelimiter.test(t.date)&&(t.date=n.split(eg.timeZoneDelimiter)[0],s=n.substr(t.date.length,n.length))),s){const u=eg.timezone.exec(s);u?(t.time=s.replace(u[1],""),t.timezone=u[1]):t.time=s}return t}function fH(n,t){const i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),s=n.match(i);if(!s)return{year:NaN,restDateString:""};const u=s[1]?parseInt(s[1]):null,c=s[2]?parseInt(s[2]):null;return{year:c===null?u:c*100,restDateString:n.slice((s[1]||s[2]).length)}}function hH(n,t){if(t===null)return new Date(NaN);const i=n.match(rH);if(!i)return new Date(NaN);const s=!!i[4],u=c0(i[1]),c=c0(i[2])-1,f=c0(i[3]),p=c0(i[4]),m=c0(i[5])-1;if(s)return SH(t,p,m)?mH(t,p,m):new Date(NaN);{const S=new Date(0);return!yH(t,c,f)||!vH(t,u)?new Date(NaN):(S.setUTCFullYear(t,c,Math.max(u,f)),S)}}function c0(n){return n?parseInt(n):1}function dH(n){const t=n.match(oH);if(!t)return NaN;const i=Nv(t[1]),s=Nv(t[2]),u=Nv(t[3]);return bH(i,s,u)?i*_v+s*Cv+u*1e3:NaN}function Nv(n){return n&&parseFloat(n.replace(",","."))||0}function pH(n){if(n==="Z")return 0;const t=n.match(uH);if(!t)return 0;const i=t[1]==="+"?-1:1,s=parseInt(t[2]),u=t[3]&&parseInt(t[3])||0;return EH(s,u)?i*(s*_v+u*Cv):NaN}function mH(n,t,i){const s=new Date(0);s.setUTCFullYear(n,0,4);const u=s.getUTCDay()||7,c=(t-1)*7+i+1-u;return s.setUTCDate(s.getUTCDate()+c),s}const gH=[31,null,31,30,31,30,31,31,30,31,30,31];function vb(n){return n%400===0||n%4===0&&n%100!==0}function yH(n,t,i){return t>=0&&t<=11&&i>=1&&i<=(gH[t]||(vb(n)?29:28))}function vH(n,t){return t>=1&&t<=(vb(n)?366:365)}function SH(n,t,i){return t>=1&&t<=53&&i>=0&&i<=6}function bH(n,t,i){return n===24?t===0&&i===0:i>=0&&i<60&&t>=0&&t<60&&n>=0&&n<25}function EH(n,t){return t>=0&&t<=59}function TH(n,t){const i=Oe(n),s=i.getFullYear(),u=i.getDate(),c=Fe(n,0);c.setFullYear(s,t,15),c.setHours(0,0,0,0);const f=db(c);return i.setMonth(t,Math.min(u,f)),i}function CH(n,t){const i=Oe(n);return isNaN(+i)?Fe(n,NaN):(i.setFullYear(t),i)}function Ov(n,t){return Zo(n,-t)}function Rv(n,t){return r0(n,-t)}function _H(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function xH(n,t,i){const s=[];for(let u=n;u<=t;u++)s.push(i?i(u):u);return s}function DH(n,t){const i=n.target;return i?!t.isSameNode(i)&&!t.contains(i):!1}function AH(n,t){return n.isSameNode(t)||n.contains(t)}function MH(n,t){const i=Object.entries(t),s=getComputedStyle(n);for(let u=0,c=i.length;u<c;u++){const[f,p]=i[u];if(typeof p=="string"&&p.indexOf(",")>-1){if(!p.split(",").map(S=>S.trim()).includes(s[f]))return!1}else if(s[f]!==p)return!1}return!0}function NH(n,t){const i=Object.entries(t),s=getComputedStyle(n);for(let u=0,c=i.length;u<c;u++){const[f,p]=i[u];if(typeof p=="string"&&p.indexOf(",")>-1){if(p.split(",").map(S=>S.trim()).includes(s[f]))return!0}else if(s[f]===p)return!0}return!1}function Sb(n,t,i=!1,s){if(i&&MH(n,t)){if(!s||s?.(n)===!0)return n}else if(!i&&NH(n,t)&&(!s||s?.(n)===!0))return n;return n.parentElement?Sb(n.parentElement,t,i,s):n}function bb(n,t){const i=Array.from(document.querySelectorAll("body *")),s=[];for(let u=0,c=i.length;u<c;u++){const f=getComputedStyle(i[u]);f[n]&&t(f[n])&&s.push(f[n])}return s}function bj(n){return n}function OH(n){const t=document.documentElement;Object.keys(n).forEach(i=>{t.style.setProperty(i,n[i])})}function RH(n){return{"--theme-bsc-primary-1":n.primary1,"--theme-bsc-primary-2":n.primary2,"--theme-bsc-primary-3":n.primary3,"--theme-bsc-primary-4":n.primary4,"--theme-bsc-primary-5":n.primary5,"--theme-bsc-gray-1":n.gray1||"#303030","--theme-bsc-gray-2":n.gray2||"#5f5f5f","--theme-bsc-gray-3":n.gray3||"#8f8f8f","--theme-bsc-gray-4":n.gray4||"#bebebe","--theme-bsc-gray-5":n.gray5||"#eee","--theme-bsc-black":n.black||"#000","--theme-bsc-white":n.white||"#fff","--theme-bsc-mono-dark-1":n.monoDark1||"#222","--theme-bsc-mono-dark-2":n.monoDark2||"#3c3c3c","--theme-bsc-mono-dark-3":n.monoDark3||"#4e4e4e","--theme-bsc-mono-light-1":n.monoLight1||"#fefefe","--theme-bsc-mono-light-2":n.monoLight2||"#eee","--theme-bsc-mono-light-3":n.monoLight3||"#ccc","--theme-bsc-info":n.info||"#2e7ff8","--theme-bsc-success":n.success||"#53ae0c","--theme-bsc-warning":n.warning||"#ff6914","--theme-bsc-error":n.error||"#f01616"}}var ka=(n=>(n[n.Regular=24]="Regular",n[n.Small=20]="Small",n))(ka||{});const Eb=({className:n})=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:n,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})}),zH=({className:n})=>{const t=Se("bsc:h-6 bsc:w-6",n);return X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},HH=({className:n})=>{const t=Se("bsc:h-6 bsc:w-6",n);return X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})},wH=({className:n})=>{const t=Se("bsc:h-6 bsc:w-6",n);return X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},UH=({className:n})=>{const t=Se("bsc:h-6 bsc:w-6",n);return X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},BH=({className:n})=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:n,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}),Ts=({icon:n,size:t=ka.Regular,onClick:i,className:s})=>{const u=H.useRef({calendar:Eb,chevronDown:zH,chevronLeft:HH,chevronRight:wH,chevronUp:UH,close:BH}),c=H.useMemo(()=>u.current[n]||Eb,[n]),f=Se({"bsc:h-[24px] bsc:w-[24px]":t===ka.Regular,"bsc:h-[20px] bsc:w-[20px]":t===ka.Small},s);return X.jsx("div",{onClick:i,children:X.jsx(c,{className:f})})},vc=({template:n,props:t,children:i})=>n(t,i);function VH(n,t){if(t===n)return!1;const i=Object.values(t),s=Object.values(n);if(i.length!==s.length||i.some((c,f)=>c!==s[f]))return!0;const u=Object.keys(n);return Object.keys(t).some((c,f)=>c!==u[f])}function GH(n,t){return n.matches[t]=!1,n.mediaQueries[t]={},n}function Tb(n){const t=Object.keys(n);return typeof window>"u"?t.reduce(GH,{mediaQueries:{},matches:{}}):t.reduce((i,s)=>{const u=window.matchMedia(n[s]);return i.mediaQueries[s]=u,i.matches[s]=u.matches,i},{mediaQueries:{},matches:{}})}function jH(n,t){function i(s,u){return s[u]=n.mediaQueries[u].matches,s}switch(t.type){case"updateMatches":return{matches:Object.keys(n.mediaQueries).reduce(i,{}),mediaQueries:n.mediaQueries};case"setQueries":return Tb(t.queries)}}function LH(n){const t=Ha.useRef(n),[i,s]=Ha.useReducer(jH,n,Tb);Ha.useEffect(()=>{VH(n,t.current)&&(s({type:"setQueries",queries:n}),t.current=n)},[n]);function u(){return s({type:"updateMatches"})}function c(m){const S=u;return typeof m.addListener<"u"?m.addListener(S):m.addEventListener("change",S),S}Ha.useEffect(()=>{const m=Object.values(i.mediaQueries),S=m.map(c);function b(_,x){typeof _.addListener<"u"?_.removeListener(S[x]):_.removeEventListener("change",S[x])}return()=>{m.forEach(b)}},[i.mediaQueries]);const{matches:f}=i,p=Ha.useMemo(()=>Object.values(f),[f]);return{matches:f,matchesAny:p.some(Boolean),matchesAll:p.length>0&&p.every(Boolean)}}function ng(n){return LH(PH(n)).matchesAll}const zv={};function PH(n){return zv[n]===void 0&&(zv[n]={default:n}),zv[n]}const Hv=({mobileQuery:n="screen and (max-device-width: 40rem)",tabletQuery:t="screen and (min-device-width: 40.01rem) and (max-device-width: 63.9375rem)",desktopQuery:i="screen and (min-device-width: 64rem)",mobileMarkup:s,aboveMobileMarkup:u,tabletMarkup:c,desktopMarkup:f})=>{const p=ng(n),m=ng(t),S=ng(i);return p&&s?s:!p&&u?u:m&&c?c:S&&f?f:(console.error("Invalid media settings"),null)};function Cb(n,t,i){const s=c=>{const f=c.target,p=n.style.display!=="hidden";n&&p&&!AH(n,f)&&!u(i,f)?t(!1):t(!0)},u=(c,f)=>{if(!c)return!1;for(let p=0,m=c.length;p<m;p++)if(c[p].isSameNode(f)||c[p].contains(f))return!0;return!1};return document.addEventListener("mousedown",s),s}function _b(n){document.removeEventListener("mousedown",n)}function xb(n){return n.target?n.target:n}const Db=H.createContext({});function YH(n){const t=H.useRef(null);return t.current===null&&(t.current=n()),t.current}const wv=typeof window<"u",qH=wv?H.useLayoutEffect:H.useEffect,Uv=H.createContext(null);function Bv(n,t){n.indexOf(t)===-1&&n.push(t)}function Vv(n,t){const i=n.indexOf(t);i>-1&&n.splice(i,1)}const Vr=(n,t,i)=>i>t?t:i<n?n:i;function Gv(n,t){return t?`${n}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:n}let gh=()=>{},Gr=()=>{};typeof process<"u"&&process.env?.NODE_ENV!=="production"&&(gh=(n,t,i)=>{!n&&typeof console<"u"&&console.warn(Gv(t,i))},Gr=(n,t,i)=>{if(!n)throw new Error(Gv(t,i))});const jr={},Ab=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n);function Mb(n){return typeof n=="object"&&n!==null}const Nb=n=>/^0[^.\s]+$/u.test(n);function jv(n){let t;return()=>(t===void 0&&(t=n()),t)}const Cs=n=>n,XH=(n,t)=>i=>t(n(i)),f0=(...n)=>n.reduce(XH),h0=(n,t,i)=>{const s=t-n;return s===0?1:(i-n)/s};class Lv{constructor(){this.subscriptions=[]}add(t){return Bv(this.subscriptions,t),()=>Vv(this.subscriptions,t)}notify(t,i,s){const u=this.subscriptions.length;if(u)if(u===1)this.subscriptions[0](t,i,s);else for(let c=0;c<u;c++){const f=this.subscriptions[c];f&&f(t,i,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ol=n=>n*1e3,_s=n=>n/1e3;function Ob(n,t){return t?n*(1e3/t):0}const Rb=new Set;function Pv(n,t,i){n||Rb.has(t)||(console.warn(Gv(t,i)),Rb.add(t))}const zb=(n,t,i)=>(((1-3*i+3*t)*n+(3*i-6*t))*n+3*t)*n,KH=1e-7,QH=12;function ZH(n,t,i,s,u){let c,f,p=0;do f=t+(i-t)/2,c=zb(f,s,u)-n,c>0?i=f:t=f;while(Math.abs(c)>KH&&++p<QH);return f}function d0(n,t,i,s){if(n===t&&i===s)return Cs;const u=c=>ZH(c,0,1,n,i);return c=>c===0||c===1?c:zb(u(c),t,s)}const Hb=n=>t=>t<=.5?n(2*t)/2:(2-n(2*(1-t)))/2,wb=n=>t=>1-n(1-t),Ub=d0(.33,1.53,.69,.99),Yv=wb(Ub),Bb=Hb(Yv),Vb=n=>(n*=2)<1?.5*Yv(n):.5*(2-Math.pow(2,-10*(n-1))),qv=n=>1-Math.sin(Math.acos(n)),Gb=wb(qv),jb=Hb(qv),JH=d0(.42,0,1,1),FH=d0(0,0,.58,1),Lb=d0(.42,0,.58,1),kH=n=>Array.isArray(n)&&typeof n[0]!="number",Pb=n=>Array.isArray(n)&&typeof n[0]=="number",Yb={linear:Cs,easeIn:JH,easeInOut:Lb,easeOut:FH,circIn:qv,circInOut:jb,circOut:Gb,backIn:Yv,backInOut:Bb,backOut:Ub,anticipate:Vb},IH=n=>typeof n=="string",qb=n=>{if(Pb(n)){Gr(n.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,i,s,u]=n;return d0(t,i,s,u)}else if(IH(n))return Gr(Yb[n]!==void 0,`Invalid easing type '${n}'`,"invalid-easing-type"),Yb[n];return n},ag=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function WH(n,t){let i=new Set,s=new Set,u=!1,c=!1;const f=new WeakSet;let p={delta:0,timestamp:0,isProcessing:!1};function m(b){f.has(b)&&(S.schedule(b),n()),b(p)}const S={schedule:(b,_=!1,x=!1)=>{const A=x&&u?i:s;return _&&f.add(b),A.has(b)||A.add(b),b},cancel:b=>{s.delete(b),f.delete(b)},process:b=>{if(p=b,u){c=!0;return}u=!0,[i,s]=[s,i],i.forEach(m),i.clear(),u=!1,c&&(c=!1,S.process(b))}};return S}const $H=40;function Xb(n,t){let i=!1,s=!0;const u={delta:0,timestamp:0,isProcessing:!1},c=()=>i=!0,f=ag.reduce((j,V)=>(j[V]=WH(c),j),{}),{setup:p,read:m,resolveKeyframes:S,preUpdate:b,update:_,preRender:x,render:D,postRender:A}=f,N=()=>{const j=jr.useManualTiming?u.timestamp:performance.now();i=!1,jr.useManualTiming||(u.delta=s?1e3/60:Math.max(Math.min(j-u.timestamp,$H),1)),u.timestamp=j,u.isProcessing=!0,p.process(u),m.process(u),S.process(u),b.process(u),_.process(u),x.process(u),D.process(u),A.process(u),u.isProcessing=!1,i&&t&&(s=!1,n(N))},R=()=>{i=!0,s=!0,u.isProcessing||n(N)};return{schedule:ag.reduce((j,V)=>{const J=f[V];return j[V]=(W,st=!1,I=!1)=>(i||R(),J.schedule(W,st,I)),j},{}),cancel:j=>{for(let V=0;V<ag.length;V++)f[ag[V]].cancel(j)},state:u,steps:f}}const{schedule:hn,cancel:Fo,state:wa,steps:Xv}=Xb(typeof requestAnimationFrame<"u"?requestAnimationFrame:Cs,!0);let ig;function tw(){ig=void 0}const Ai={now:()=>(ig===void 0&&Ai.set(wa.isProcessing||jr.useManualTiming?wa.timestamp:performance.now()),ig),set:n=>{ig=n,queueMicrotask(tw)}},Kb=n=>t=>typeof t=="string"&&t.startsWith(n),Qb=Kb("--"),ew=Kb("var(--"),Kv=n=>ew(n)?nw.test(n.split("/*")[0].trim()):!1,nw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Zb(n){return typeof n!="string"?!1:n.split("/*")[0].includes("var(--")}const yh={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},p0={...yh,transform:n=>Vr(0,1,n)},sg={...yh,default:1},m0=n=>Math.round(n*1e5)/1e5,Qv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function aw(n){return n==null}const iw=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Zv=(n,t)=>i=>!!(typeof i=="string"&&iw.test(i)&&i.startsWith(n)||t&&!aw(i)&&Object.prototype.hasOwnProperty.call(i,t)),Jb=(n,t,i)=>s=>{if(typeof s!="string")return s;const[u,c,f,p]=s.match(Qv);return{[n]:parseFloat(u),[t]:parseFloat(c),[i]:parseFloat(f),alpha:p!==void 0?parseFloat(p):1}},sw=n=>Vr(0,255,n),Jv={...yh,transform:n=>Math.round(sw(n))},Sc={test:Zv("rgb","red"),parse:Jb("red","green","blue"),transform:({red:n,green:t,blue:i,alpha:s=1})=>"rgba("+Jv.transform(n)+", "+Jv.transform(t)+", "+Jv.transform(i)+", "+m0(p0.transform(s))+")"};function lw(n){let t="",i="",s="",u="";return n.length>5?(t=n.substring(1,3),i=n.substring(3,5),s=n.substring(5,7),u=n.substring(7,9)):(t=n.substring(1,2),i=n.substring(2,3),s=n.substring(3,4),u=n.substring(4,5),t+=t,i+=i,s+=s,u+=u),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:u?parseInt(u,16)/255:1}}const Fv={test:Zv("#"),parse:lw,transform:Sc.transform},g0=n=>({test:t=>typeof t=="string"&&t.endsWith(n)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${n}`}),ko=g0("deg"),kl=g0("%"),wt=g0("px"),rw=g0("vh"),ow=g0("vw"),Fb={...kl,parse:n=>kl.parse(n)/100,transform:n=>kl.transform(n*100)},vh={test:Zv("hsl","hue"),parse:Jb("hue","saturation","lightness"),transform:({hue:n,saturation:t,lightness:i,alpha:s=1})=>"hsla("+Math.round(n)+", "+kl.transform(m0(t))+", "+kl.transform(m0(i))+", "+m0(p0.transform(s))+")"},$n={test:n=>Sc.test(n)||Fv.test(n)||vh.test(n),parse:n=>Sc.test(n)?Sc.parse(n):vh.test(n)?vh.parse(n):Fv.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Sc.transform(n):vh.transform(n),getAnimatableNone:n=>{const t=$n.parse(n);return t.alpha=0,$n.transform(t)}},uw=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function cw(n){return isNaN(n)&&typeof n=="string"&&(n.match(Qv)?.length||0)+(n.match(uw)?.length||0)>0}const kb="number",Ib="color",fw="var",hw="var(",Wb="${}",dw=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function y0(n){const t=n.toString(),i=[],s={color:[],number:[],var:[]},u=[];let c=0;const p=t.replace(dw,m=>($n.test(m)?(s.color.push(c),u.push(Ib),i.push($n.parse(m))):m.startsWith(hw)?(s.var.push(c),u.push(fw),i.push(m)):(s.number.push(c),u.push(kb),i.push(parseFloat(m))),++c,Wb)).split(Wb);return{values:i,split:p,indexes:s,types:u}}function $b(n){return y0(n).values}function t8(n){const{split:t,types:i}=y0(n),s=t.length;return u=>{let c="";for(let f=0;f<s;f++)if(c+=t[f],u[f]!==void 0){const p=i[f];p===kb?c+=m0(u[f]):p===Ib?c+=$n.transform(u[f]):c+=u[f]}return c}}const pw=n=>typeof n=="number"?0:$n.test(n)?$n.getAnimatableNone(n):n;function mw(n){const t=$b(n);return t8(n)(t.map(pw))}const Io={test:cw,parse:$b,createTransformer:t8,getAnimatableNone:mw};function kv(n,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?n+(t-n)*6*i:i<1/2?t:i<2/3?n+(t-n)*(2/3-i)*6:n}function gw({hue:n,saturation:t,lightness:i,alpha:s}){n/=360,t/=100,i/=100;let u=0,c=0,f=0;if(!t)u=c=f=i;else{const p=i<.5?i*(1+t):i+t-i*t,m=2*i-p;u=kv(m,p,n+1/3),c=kv(m,p,n),f=kv(m,p,n-1/3)}return{red:Math.round(u*255),green:Math.round(c*255),blue:Math.round(f*255),alpha:s}}function lg(n,t){return i=>i>0?t:n}const Cn=(n,t,i)=>n+(t-n)*i,Iv=(n,t,i)=>{const s=n*n,u=i*(t*t-s)+s;return u<0?0:Math.sqrt(u)},yw=[Fv,Sc,vh],vw=n=>yw.find(t=>t.test(n));function e8(n){const t=vw(n);if(gh(!!t,`'${n}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let i=t.parse(n);return t===vh&&(i=gw(i)),i}const n8=(n,t)=>{const i=e8(n),s=e8(t);if(!i||!s)return lg(n,t);const u={...i};return c=>(u.red=Iv(i.red,s.red,c),u.green=Iv(i.green,s.green,c),u.blue=Iv(i.blue,s.blue,c),u.alpha=Cn(i.alpha,s.alpha,c),Sc.transform(u))},Wv=new Set(["none","hidden"]);function Sw(n,t){return Wv.has(n)?i=>i<=0?n:t:i=>i>=1?t:n}function bw(n,t){return i=>Cn(n,t,i)}function $v(n){return typeof n=="number"?bw:typeof n=="string"?Kv(n)?lg:$n.test(n)?n8:Cw:Array.isArray(n)?a8:typeof n=="object"?$n.test(n)?n8:Ew:lg}function a8(n,t){const i=[...n],s=i.length,u=n.map((c,f)=>$v(c)(c,t[f]));return c=>{for(let f=0;f<s;f++)i[f]=u[f](c);return i}}function Ew(n,t){const i={...n,...t},s={};for(const u in i)n[u]!==void 0&&t[u]!==void 0&&(s[u]=$v(n[u])(n[u],t[u]));return u=>{for(const c in s)i[c]=s[c](u);return i}}function Tw(n,t){const i=[],s={color:0,var:0,number:0};for(let u=0;u<t.values.length;u++){const c=t.types[u],f=n.indexes[c][s[c]],p=n.values[f]??0;i[u]=p,s[c]++}return i}const Cw=(n,t)=>{const i=Io.createTransformer(t),s=y0(n),u=y0(t);return s.indexes.var.length===u.indexes.var.length&&s.indexes.color.length===u.indexes.color.length&&s.indexes.number.length>=u.indexes.number.length?Wv.has(n)&&!u.values.length||Wv.has(t)&&!s.values.length?Sw(n,t):f0(a8(Tw(s,u),u.values),i):(gh(!0,`Complex values '${n}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),lg(n,t))};function i8(n,t,i){return typeof n=="number"&&typeof t=="number"&&typeof i=="number"?Cn(n,t,i):$v(n)(n,t)}const _w=n=>{const t=({timestamp:i})=>n(i);return{start:(i=!0)=>hn.update(t,i),stop:()=>Fo(t),now:()=>wa.isProcessing?wa.timestamp:Ai.now()}},s8=(n,t,i=10)=>{let s="";const u=Math.max(Math.round(t/i),2);for(let c=0;c<u;c++)s+=Math.round(n(c/(u-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},rg=2e4;function tS(n){let t=0;const i=50;let s=n.next(t);for(;!s.done&&t<rg;)t+=i,s=n.next(t);return t>=rg?1/0:t}function xw(n,t=100,i){const s=i({...n,keyframes:[0,t]}),u=Math.min(tS(s),rg);return{type:"keyframes",ease:c=>s.next(u*c).value/t,duration:_s(u)}}const Dw=5;function l8(n,t,i){const s=Math.max(t-Dw,0);return Ob(i-n(s),t-s)}const _n={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},eS=.001;function Aw({duration:n=_n.duration,bounce:t=_n.bounce,velocity:i=_n.velocity,mass:s=_n.mass}){let u,c;gh(n<=ol(_n.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let f=1-t;f=Vr(_n.minDamping,_n.maxDamping,f),n=Vr(_n.minDuration,_n.maxDuration,_s(n)),f<1?(u=S=>{const b=S*f,_=b*n,x=b-i,D=nS(S,f),A=Math.exp(-_);return eS-x/D*A},c=S=>{const _=S*f*n,x=_*i+i,D=Math.pow(f,2)*Math.pow(S,2)*n,A=Math.exp(-_),N=nS(Math.pow(S,2),f);return(-u(S)+eS>0?-1:1)*((x-D)*A)/N}):(u=S=>{const b=Math.exp(-S*n),_=(S-i)*n+1;return-eS+b*_},c=S=>{const b=Math.exp(-S*n),_=(i-S)*(n*n);return b*_});const p=5/n,m=Nw(u,c,p);if(n=ol(n),isNaN(m))return{stiffness:_n.stiffness,damping:_n.damping,duration:n};{const S=Math.pow(m,2)*s;return{stiffness:S,damping:f*2*Math.sqrt(s*S),duration:n}}}const Mw=12;function Nw(n,t,i){let s=i;for(let u=1;u<Mw;u++)s=s-n(s)/t(s);return s}function nS(n,t){return n*Math.sqrt(1-t*t)}const Ow=["duration","bounce"],Rw=["stiffness","damping","mass"];function r8(n,t){return t.some(i=>n[i]!==void 0)}function zw(n){let t={velocity:_n.velocity,stiffness:_n.stiffness,damping:_n.damping,mass:_n.mass,isResolvedFromDuration:!1,...n};if(!r8(n,Rw)&&r8(n,Ow))if(n.visualDuration){const i=n.visualDuration,s=2*Math.PI/(i*1.2),u=s*s,c=2*Vr(.05,1,1-(n.bounce||0))*Math.sqrt(u);t={...t,mass:_n.mass,stiffness:u,damping:c}}else{const i=Aw(n);t={...t,...i,mass:_n.mass},t.isResolvedFromDuration=!0}return t}function og(n=_n.visualDuration,t=_n.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:t}:n;let{restSpeed:s,restDelta:u}=i;const c=i.keyframes[0],f=i.keyframes[i.keyframes.length-1],p={done:!1,value:c},{stiffness:m,damping:S,mass:b,duration:_,velocity:x,isResolvedFromDuration:D}=zw({...i,velocity:-_s(i.velocity||0)}),A=x||0,N=S/(2*Math.sqrt(m*b)),R=f-c,O=_s(Math.sqrt(m/b)),U=Math.abs(R)<5;s||(s=U?_n.restSpeed.granular:_n.restSpeed.default),u||(u=U?_n.restDelta.granular:_n.restDelta.default);let j;if(N<1){const J=nS(O,N);j=W=>{const st=Math.exp(-N*O*W);return f-st*((A+N*O*R)/J*Math.sin(J*W)+R*Math.cos(J*W))}}else if(N===1)j=J=>f-Math.exp(-O*J)*(R+(A+O*R)*J);else{const J=O*Math.sqrt(N*N-1);j=W=>{const st=Math.exp(-N*O*W),I=Math.min(J*W,300);return f-st*((A+N*O*R)*Math.sinh(I)+J*R*Math.cosh(I))/J}}const V={calculatedDuration:D&&_||null,next:J=>{const W=j(J);if(D)p.done=J>=_;else{let st=J===0?A:0;N<1&&(st=J===0?ol(A):l8(j,J,W));const I=Math.abs(st)<=s,et=Math.abs(f-W)<=u;p.done=I&&et}return p.value=p.done?f:W,p},toString:()=>{const J=Math.min(tS(V),rg),W=s8(st=>V.next(J*st).value,J,30);return J+"ms "+W},toTransition:()=>{}};return V}og.applyToOptions=n=>{const t=xw(n,100,og);return n.ease=t.ease,n.duration=ol(t.duration),n.type="keyframes",n};function aS({keyframes:n,velocity:t=0,power:i=.8,timeConstant:s=325,bounceDamping:u=10,bounceStiffness:c=500,modifyTarget:f,min:p,max:m,restDelta:S=.5,restSpeed:b}){const _=n[0],x={done:!1,value:_},D=I=>p!==void 0&&I<p||m!==void 0&&I>m,A=I=>p===void 0?m:m===void 0||Math.abs(p-I)<Math.abs(m-I)?p:m;let N=i*t;const R=_+N,O=f===void 0?R:f(R);O!==R&&(N=O-_);const U=I=>-N*Math.exp(-I/s),j=I=>O+U(I),V=I=>{const et=U(I),nt=j(I);x.done=Math.abs(et)<=S,x.value=x.done?O:nt};let J,W;const st=I=>{D(x.value)&&(J=I,W=og({keyframes:[x.value,A(x.value)],velocity:l8(j,I,x.value),damping:u,stiffness:c,restDelta:S,restSpeed:b}))};return st(0),{calculatedDuration:null,next:I=>{let et=!1;return!W&&J===void 0&&(et=!0,V(I),st(I)),J!==void 0&&I>=J?W.next(I-J):(!et&&V(I),x)}}}function Hw(n,t,i){const s=[],u=i||jr.mix||i8,c=n.length-1;for(let f=0;f<c;f++){let p=u(n[f],n[f+1]);if(t){const m=Array.isArray(t)?t[f]||Cs:t;p=f0(m,p)}s.push(p)}return s}function ww(n,t,{clamp:i=!0,ease:s,mixer:u}={}){const c=n.length;if(Gr(c===t.length,"Both input and output ranges must be the same length","range-length"),c===1)return()=>t[0];if(c===2&&t[0]===t[1])return()=>t[1];const f=n[0]===n[1];n[0]>n[c-1]&&(n=[...n].reverse(),t=[...t].reverse());const p=Hw(t,s,u),m=p.length,S=b=>{if(f&&b<n[0])return t[0];let _=0;if(m>1)for(;_<n.length-2&&!(b<n[_+1]);_++);const x=h0(n[_],n[_+1],b);return p[_](x)};return i?b=>S(Vr(n[0],n[c-1],b)):S}function Uw(n,t){const i=n[n.length-1];for(let s=1;s<=t;s++){const u=h0(0,t,s);n.push(Cn(i,1,u))}}function Bw(n){const t=[0];return Uw(t,n.length-1),t}function Vw(n,t){return n.map(i=>i*t)}function Gw(n,t){return n.map(()=>t||Lb).splice(0,n.length-1)}function Sh({duration:n=300,keyframes:t,times:i,ease:s="easeInOut"}){const u=kH(s)?s.map(qb):qb(s),c={done:!1,value:t[0]},f=Vw(i&&i.length===t.length?i:Bw(t),n),p=ww(f,t,{ease:Array.isArray(u)?u:Gw(t,u)});return{calculatedDuration:n,next:m=>(c.value=p(m),c.done=m>=n,c)}}const jw=n=>n!==null;function iS(n,{repeat:t,repeatType:i="loop"},s,u=1){const c=n.filter(jw),p=u<0||t&&i!=="loop"&&t%2===1?0:c.length-1;return!p||s===void 0?c[p]:s}const Lw={decay:aS,inertia:aS,tween:Sh,keyframes:Sh,spring:og};function o8(n){typeof n.type=="string"&&(n.type=Lw[n.type])}class sS{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,i){return this.finished.then(t,i)}}const Pw=n=>n/100;class lS extends sS{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:i}=this.options;i&&i.updatedAt!==Ai.now()&&this.tick(Ai.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;o8(t);const{type:i=Sh,repeat:s=0,repeatDelay:u=0,repeatType:c,velocity:f=0}=t;let{keyframes:p}=t;const m=i||Sh;process.env.NODE_ENV!=="production"&&m!==Sh&&Gr(p.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${p}`,"spring-two-frames"),m!==Sh&&typeof p[0]!="number"&&(this.mixKeyframes=f0(Pw,i8(p[0],p[1])),p=[0,100]);const S=m({...t,keyframes:p});c==="mirror"&&(this.mirroredGenerator=m({...t,keyframes:[...p].reverse(),velocity:-f})),S.calculatedDuration===null&&(S.calculatedDuration=tS(S));const{calculatedDuration:b}=S;this.calculatedDuration=b,this.resolvedDuration=b+u,this.totalDuration=this.resolvedDuration*(s+1)-u,this.generator=S}updateTime(t){const i=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(t,i=!1){const{generator:s,totalDuration:u,mixKeyframes:c,mirroredGenerator:f,resolvedDuration:p,calculatedDuration:m}=this;if(this.startTime===null)return s.next(0);const{delay:S=0,keyframes:b,repeat:_,repeatType:x,repeatDelay:D,type:A,onUpdate:N,finalKeyframe:R}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),i?this.currentTime=t:this.updateTime(t);const O=this.currentTime-S*(this.playbackSpeed>=0?1:-1),U=this.playbackSpeed>=0?O<0:O>u;this.currentTime=Math.max(O,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let j=this.currentTime,V=s;if(_){const I=Math.min(this.currentTime,u)/p;let et=Math.floor(I),nt=I%1;!nt&&I>=1&&(nt=1),nt===1&&et--,et=Math.min(et,_+1),et%2&&(x==="reverse"?(nt=1-nt,D&&(nt-=D/p)):x==="mirror"&&(V=f)),j=Vr(0,1,nt)*p}const J=U?{done:!1,value:b[0]}:V.next(j);c&&(J.value=c(J.value));let{done:W}=J;!U&&m!==null&&(W=this.playbackSpeed>=0?this.currentTime>=u:this.currentTime<=0);const st=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&W);return st&&A!==aS&&(J.value=iS(b,this.options,R,this.speed)),N&&N(J.value),st&&this.finish(),J}then(t,i){return this.finished.then(t,i)}get duration(){return _s(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+_s(t)}get time(){return _s(this.currentTime)}set time(t){t=ol(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Ai.now());const i=this.playbackSpeed!==t;this.playbackSpeed=t,i&&(this.time=_s(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=_w,startTime:i}=this.options;this.driver||(this.driver=t(u=>this.tick(u))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=i??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ai.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Yw(n){for(let t=1;t<n.length;t++)n[t]??(n[t]=n[t-1])}const bc=n=>n*180/Math.PI,rS=n=>{const t=bc(Math.atan2(n[1],n[0]));return oS(t)},qw={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:rS,rotateZ:rS,skewX:n=>bc(Math.atan(n[1])),skewY:n=>bc(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},oS=n=>(n=n%360,n<0&&(n+=360),n),u8=rS,c8=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),f8=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),Xw={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:c8,scaleY:f8,scale:n=>(c8(n)+f8(n))/2,rotateX:n=>oS(bc(Math.atan2(n[6],n[5]))),rotateY:n=>oS(bc(Math.atan2(-n[2],n[0]))),rotateZ:u8,rotate:u8,skewX:n=>bc(Math.atan(n[4])),skewY:n=>bc(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function uS(n){return n.includes("scale")?1:0}function cS(n,t){if(!n||n==="none")return uS(t);const i=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,u;if(i)s=Xw,u=i;else{const p=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=qw,u=p}if(!u)return uS(t);const c=s[t],f=u[1].split(",").map(Qw);return typeof c=="function"?c(f):f[c]}const Kw=(n,t)=>{const{transform:i="none"}=getComputedStyle(n);return cS(i,t)};function Qw(n){return parseFloat(n.trim())}const bh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Eh=new Set(bh),h8=n=>n===yh||n===wt,Zw=new Set(["x","y","z"]),Jw=bh.filter(n=>!Zw.has(n));function Fw(n){const t=[];return Jw.forEach(i=>{const s=n.getValue(i);s!==void 0&&(t.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),t}const Wo={width:({x:n},{paddingLeft:t="0",paddingRight:i="0"})=>n.max-n.min-parseFloat(t)-parseFloat(i),height:({y:n},{paddingTop:t="0",paddingBottom:i="0"})=>n.max-n.min-parseFloat(t)-parseFloat(i),top:(n,{top:t})=>parseFloat(t),left:(n,{left:t})=>parseFloat(t),bottom:({y:n},{top:t})=>parseFloat(t)+(n.max-n.min),right:({x:n},{left:t})=>parseFloat(t)+(n.max-n.min),x:(n,{transform:t})=>cS(t,"x"),y:(n,{transform:t})=>cS(t,"y")};Wo.translateX=Wo.x,Wo.translateY=Wo.y;const Ec=new Set;let fS=!1,hS=!1,dS=!1;function d8(){if(hS){const n=Array.from(Ec).filter(s=>s.needsMeasurement),t=new Set(n.map(s=>s.element)),i=new Map;t.forEach(s=>{const u=Fw(s);u.length&&(i.set(s,u),s.render())}),n.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const u=i.get(s);u&&u.forEach(([c,f])=>{s.getValue(c)?.set(f)})}),n.forEach(s=>s.measureEndState()),n.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}hS=!1,fS=!1,Ec.forEach(n=>n.complete(dS)),Ec.clear()}function p8(){Ec.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(hS=!0)})}function kw(){dS=!0,p8(),d8(),dS=!1}class pS{constructor(t,i,s,u,c,f=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=i,this.name=s,this.motionValue=u,this.element=c,this.isAsync=f}scheduleResolve(){this.state="scheduled",this.isAsync?(Ec.add(this),fS||(fS=!0,hn.read(p8),hn.resolveKeyframes(d8))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:i,element:s,motionValue:u}=this;if(t[0]===null){const c=u?.get(),f=t[t.length-1];if(c!==void 0)t[0]=c;else if(s&&i){const p=s.readValue(i,f);p!=null&&(t[0]=p)}t[0]===void 0&&(t[0]=f),u&&c===void 0&&u.set(t[0])}Yw(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ec.delete(this)}cancel(){this.state==="scheduled"&&(Ec.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Iw=n=>n.startsWith("--");function Ww(n,t,i){Iw(t)?n.style.setProperty(t,i):n.style[t]=i}const $w=jv(()=>window.ScrollTimeline!==void 0),tU={};function eU(n,t){const i=jv(n);return()=>tU[t]??i()}const m8=eU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),v0=([n,t,i,s])=>`cubic-bezier(${n}, ${t}, ${i}, ${s})`,g8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:v0([0,.65,.55,1]),circOut:v0([.55,0,1,.45]),backIn:v0([.31,.01,.66,-.59]),backOut:v0([.33,1.53,.69,.99])};function y8(n,t){if(n)return typeof n=="function"?m8()?s8(n,t):"ease-out":Pb(n)?v0(n):Array.isArray(n)?n.map(i=>y8(i,t)||g8.easeOut):g8[n]}function nU(n,t,i,{delay:s=0,duration:u=300,repeat:c=0,repeatType:f="loop",ease:p="easeOut",times:m}={},S=void 0){const b={[t]:i};m&&(b.offset=m);const _=y8(p,u);Array.isArray(_)&&(b.easing=_);const x={delay:s,duration:u,easing:Array.isArray(_)?"linear":_,fill:"both",iterations:c+1,direction:f==="reverse"?"alternate":"normal"};return S&&(x.pseudoElement=S),n.animate(b,x)}function v8(n){return typeof n=="function"&&"applyToOptions"in n}function aU({type:n,...t}){return v8(n)&&m8()?n.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class iU extends sS{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:i,name:s,keyframes:u,pseudoElement:c,allowFlatten:f=!1,finalKeyframe:p,onComplete:m}=t;this.isPseudoElement=!!c,this.allowFlatten=f,this.options=t,Gr(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const S=aU(t);this.animation=nU(i,s,u,S,c),S.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!c){const b=iS(u,this.options,p,this.speed);this.updateMotionValue?this.updateMotionValue(b):Ww(i,s,b),this.animation.cancel()}m?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return _s(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+_s(t)}get time(){return _s(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=ol(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&$w()?(this.animation.timeline=t,Cs):i(this)}}const S8={anticipate:Vb,backInOut:Bb,circInOut:jb};function sU(n){return n in S8}function lU(n){typeof n.ease=="string"&&sU(n.ease)&&(n.ease=S8[n.ease])}const b8=10;class rU extends iU{constructor(t){lU(t),o8(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:i,onUpdate:s,onComplete:u,element:c,...f}=this.options;if(!i)return;if(t!==void 0){i.set(t);return}const p=new lS({...f,autoplay:!1}),m=ol(this.finishedTime??this.time);i.setWithVelocity(p.sample(m-b8).value,p.sample(m).value,b8),p.stop()}}const E8=(n,t)=>t==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Io.test(n)||n==="0")&&!n.startsWith("url("));function oU(n){const t=n[0];if(n.length===1)return!0;for(let i=0;i<n.length;i++)if(n[i]!==t)return!0}function uU(n,t,i,s){const u=n[0];if(u===null)return!1;if(t==="display"||t==="visibility")return!0;const c=n[n.length-1],f=E8(u,t),p=E8(c,t);return gh(f===p,`You are trying to animate ${t} from "${u}" to "${c}". "${f?c:u}" is not an animatable value.`,"value-not-animatable"),!f||!p?!1:oU(n)||(i==="spring"||v8(i))&&s}function mS(n){n.duration=0,n.type="keyframes"}const cU=new Set(["opacity","clipPath","filter","transform"]),fU=jv(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function hU(n){const{motionValue:t,name:i,repeatDelay:s,repeatType:u,damping:c,type:f}=n;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:S}=t.owner.getProps();return fU()&&i&&cU.has(i)&&(i!=="transform"||!S)&&!m&&!s&&u!=="mirror"&&c!==0&&f!=="inertia"}const dU=40;class pU extends sS{constructor({autoplay:t=!0,delay:i=0,type:s="keyframes",repeat:u=0,repeatDelay:c=0,repeatType:f="loop",keyframes:p,name:m,motionValue:S,element:b,..._}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ai.now();const x={autoplay:t,delay:i,type:s,repeat:u,repeatDelay:c,repeatType:f,name:m,motionValue:S,element:b,..._},D=b?.KeyframeResolver||pS;this.keyframeResolver=new D(p,(A,N,R)=>this.onKeyframesResolved(A,N,x,!R),m,S,b),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,i,s,u){this.keyframeResolver=void 0;const{name:c,type:f,velocity:p,delay:m,isHandoff:S,onUpdate:b}=s;this.resolvedAt=Ai.now(),uU(t,c,f,p)||((jr.instantAnimations||!m)&&b?.(iS(t,s,i)),t[0]=t[t.length-1],mS(s),s.repeat=0);const x={startTime:u?this.resolvedAt?this.resolvedAt-this.createdAt>dU?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...s,keyframes:t},D=!S&&hU(x)?new rU({...x,element:x.motionValue.owner.current}):new lS(x);D.finished.then(()=>this.notifyFinished()).catch(Cs),this.pendingTimeline&&(this.stopTimeline=D.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=D}get finished(){return this._animation?this.animation.finished:this._finished}then(t,i){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),kw()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const mU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function gU(n){const t=mU.exec(n);if(!t)return[,];const[,i,s,u]=t;return[`--${i??s}`,u]}const yU=4;function T8(n,t,i=1){Gr(i<=yU,`Max CSS variable fallback depth detected in property "${n}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,u]=gU(n);if(!s)return;const c=window.getComputedStyle(t).getPropertyValue(s);if(c){const f=c.trim();return Ab(f)?parseFloat(f):f}return Kv(u)?T8(u,t,i+1):u}function gS(n,t){return n?.[t]??n?.default??n}const C8=new Set(["width","height","top","left","right","bottom",...bh]),vU={test:n=>n==="auto",parse:n=>n},_8=n=>t=>t.test(n),x8=[yh,wt,kl,ko,ow,rw,vU],D8=n=>x8.find(_8(n));function SU(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||Nb(n):!0}const bU=new Set(["brightness","contrast","saturate","opacity"]);function EU(n){const[t,i]=n.slice(0,-1).split("(");if(t==="drop-shadow")return n;const[s]=i.match(Qv)||[];if(!s)return n;const u=i.replace(s,"");let c=bU.has(t)?1:0;return s!==i&&(c*=100),t+"("+c+u+")"}const TU=/\b([a-z-]*)\(.*?\)/gu,yS={...Io,getAnimatableNone:n=>{const t=n.match(TU);return t?t.map(EU).join(" "):n}},A8={...yh,transform:Math.round},vS={borderWidth:wt,borderTopWidth:wt,borderRightWidth:wt,borderBottomWidth:wt,borderLeftWidth:wt,borderRadius:wt,radius:wt,borderTopLeftRadius:wt,borderTopRightRadius:wt,borderBottomRightRadius:wt,borderBottomLeftRadius:wt,width:wt,maxWidth:wt,height:wt,maxHeight:wt,top:wt,right:wt,bottom:wt,left:wt,inset:wt,insetBlock:wt,insetBlockStart:wt,insetBlockEnd:wt,insetInline:wt,insetInlineStart:wt,insetInlineEnd:wt,padding:wt,paddingTop:wt,paddingRight:wt,paddingBottom:wt,paddingLeft:wt,paddingBlock:wt,paddingBlockStart:wt,paddingBlockEnd:wt,paddingInline:wt,paddingInlineStart:wt,paddingInlineEnd:wt,margin:wt,marginTop:wt,marginRight:wt,marginBottom:wt,marginLeft:wt,marginBlock:wt,marginBlockStart:wt,marginBlockEnd:wt,marginInline:wt,marginInlineStart:wt,marginInlineEnd:wt,backgroundPositionX:wt,backgroundPositionY:wt,...{rotate:ko,rotateX:ko,rotateY:ko,rotateZ:ko,scale:sg,scaleX:sg,scaleY:sg,scaleZ:sg,skew:ko,skewX:ko,skewY:ko,distance:wt,translateX:wt,translateY:wt,translateZ:wt,x:wt,y:wt,z:wt,perspective:wt,transformPerspective:wt,opacity:p0,originX:Fb,originY:Fb,originZ:wt},zIndex:A8,fillOpacity:p0,strokeOpacity:p0,numOctaves:A8},CU={...vS,color:$n,backgroundColor:$n,outlineColor:$n,fill:$n,stroke:$n,borderColor:$n,borderTopColor:$n,borderRightColor:$n,borderBottomColor:$n,borderLeftColor:$n,filter:yS,WebkitFilter:yS},M8=n=>CU[n];function N8(n,t){let i=M8(n);return i!==yS&&(i=Io),i.getAnimatableNone?i.getAnimatableNone(t):void 0}const _U=new Set(["auto","none","0"]);function xU(n,t,i){let s=0,u;for(;s<n.length&&!u;){const c=n[s];typeof c=="string"&&!_U.has(c)&&y0(c).values.length&&(u=n[s]),s++}if(u&&i)for(const c of t)n[c]=N8(i,u)}class DU extends pS{constructor(t,i,s,u,c){super(t,i,s,u,c,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:i,name:s}=this;if(!i||!i.current)return;super.readKeyframes();for(let b=0;b<t.length;b++){let _=t[b];if(typeof _=="string"&&(_=_.trim(),Kv(_))){const x=T8(_,i.current);x!==void 0&&(t[b]=x),b===t.length-1&&(this.finalKeyframe=_)}}if(this.resolveNoneKeyframes(),!C8.has(s)||t.length!==2)return;const[u,c]=t,f=D8(u),p=D8(c),m=Zb(u),S=Zb(c);if(m!==S&&Wo[s]){this.needsMeasurement=!0;return}if(f!==p)if(h8(f)&&h8(p))for(let b=0;b<t.length;b++){const _=t[b];typeof _=="string"&&(t[b]=parseFloat(_))}else Wo[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:i}=this,s=[];for(let u=0;u<t.length;u++)(t[u]===null||SU(t[u]))&&s.push(u);s.length&&xU(t,s,i)}measureInitialState(){const{element:t,unresolvedKeyframes:i,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Wo[s](t.measureViewportBox(),window.getComputedStyle(t.current)),i[0]=this.measuredOrigin;const u=i[i.length-1];u!==void 0&&t.getValue(s,u).jump(u,!1)}measureEndState(){const{element:t,name:i,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const u=t.getValue(i);u&&u.jump(this.measuredOrigin,!1);const c=s.length-1,f=s[c];s[c]=Wo[i](t.measureViewportBox(),window.getComputedStyle(t.current)),f!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=f),this.removedTransforms?.length&&this.removedTransforms.forEach(([p,m])=>{t.getValue(p).set(m)}),this.resolveNoneKeyframes()}}function AU(n,t,i){if(n instanceof EventTarget)return[n];if(typeof n=="string"){let s=document;const u=i?.[n]??s.querySelectorAll(n);return u?Array.from(u):[]}return Array.from(n)}const O8=(n,t)=>t&&typeof n=="number"?t.transform(n):n;function MU(n){return Mb(n)&&"offsetHeight"in n}const R8=30,NU=n=>!isNaN(parseFloat(n));class OU{constructor(t,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const u=Ai.now();if(this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=i.owner}setCurrent(t){this.current=t,this.updatedAt=Ai.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=NU(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Pv(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,i){this.events[t]||(this.events[t]=new Lv);const s=this.events[t].add(i);return t==="change"?()=>{s(),hn.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,i){this.passiveEffect=t,this.stopPassiveEffect=i}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,i,s){this.set(i),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,i=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ai.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>R8)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,R8);return Ob(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(t){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=t(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Th(n,t){return new OU(n,t)}const{schedule:SS}=Xb(queueMicrotask,!1),ul={x:!1,y:!1};function z8(){return ul.x||ul.y}function RU(n){return n==="x"||n==="y"?ul[n]?null:(ul[n]=!0,()=>{ul[n]=!1}):ul.x||ul.y?null:(ul.x=ul.y=!0,()=>{ul.x=ul.y=!1})}function H8(n,t){const i=AU(n),s=new AbortController,u={passive:!0,...t,signal:s.signal};return[i,u,()=>s.abort()]}function w8(n){return!(n.pointerType==="touch"||z8())}function zU(n,t,i={}){const[s,u,c]=H8(n,i),f=p=>{if(!w8(p))return;const{target:m}=p,S=t(m,p);if(typeof S!="function"||!m)return;const b=_=>{w8(_)&&(S(_),m.removeEventListener("pointerleave",b))};m.addEventListener("pointerleave",b,u)};return s.forEach(p=>{p.addEventListener("pointerenter",f,u)}),c}const U8=(n,t)=>t?n===t?!0:U8(n,t.parentElement):!1,bS=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,HU=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function B8(n){return HU.has(n.tagName)||n.isContentEditable===!0}const ug=new WeakSet;function V8(n){return t=>{t.key==="Enter"&&n(t)}}function ES(n,t){n.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const wU=(n,t)=>{const i=n.currentTarget;if(!i)return;const s=V8(()=>{if(ug.has(i))return;ES(i,"down");const u=V8(()=>{ES(i,"up")}),c=()=>ES(i,"cancel");i.addEventListener("keyup",u,t),i.addEventListener("blur",c,t)});i.addEventListener("keydown",s,t),i.addEventListener("blur",()=>i.removeEventListener("keydown",s),t)};function G8(n){return bS(n)&&!z8()}function UU(n,t,i={}){const[s,u,c]=H8(n,i),f=p=>{const m=p.currentTarget;if(!G8(p))return;ug.add(m);const S=t(m,p),b=(D,A)=>{window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",x),ug.has(m)&&ug.delete(m),G8(D)&&typeof S=="function"&&S(D,{success:A})},_=D=>{b(D,m===window||m===document||i.useGlobalTarget||U8(m,D.target))},x=D=>{b(D,!1)};window.addEventListener("pointerup",_,u),window.addEventListener("pointercancel",x,u)};return s.forEach(p=>{(i.useGlobalTarget?window:p).addEventListener("pointerdown",f,u),MU(p)&&(p.addEventListener("focus",S=>wU(S,u)),!B8(p)&&!p.hasAttribute("tabindex")&&(p.tabIndex=0))}),c}function j8(n){return Mb(n)&&"ownerSVGElement"in n}function BU(n){return j8(n)&&n.tagName==="svg"}const Ia=n=>!!(n&&n.getVelocity),VU=[...x8,$n,Io],GU=n=>VU.find(_8(n)),L8=H.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});function jU(n=!0){const t=H.useContext(Uv);if(t===null)return[!0,null];const{isPresent:i,onExitComplete:s,register:u}=t,c=H.useId();H.useEffect(()=>{if(n)return u(c)},[n]);const f=H.useCallback(()=>n&&s&&s(c),[c,s,n]);return!i&&s?[!1,f]:[!0]}const P8=H.createContext({strict:!1}),Y8={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ch={};for(const n in Y8)Ch[n]={isEnabled:t=>Y8[n].some(i=>!!t[i])};function LU(n){for(const t in n)Ch[t]={...Ch[t],...n[t]}}const PU=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function cg(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||PU.has(n)}let q8=n=>!cg(n);function YU(n){typeof n=="function"&&(q8=t=>t.startsWith("on")?!cg(t):n(t))}try{YU(require("@emotion/is-prop-valid").default)}catch{}function qU(n,t,i){const s={};for(const u in n)u==="values"&&typeof n.values=="object"||(q8(u)||i===!0&&cg(u)||!t&&!cg(u)||n.draggable&&u.startsWith("onDrag"))&&(s[u]=n[u]);return s}const fg=H.createContext({});function hg(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function S0(n){return typeof n=="string"||Array.isArray(n)}const TS=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],CS=["initial",...TS];function dg(n){return hg(n.animate)||CS.some(t=>S0(n[t]))}function X8(n){return!!(dg(n)||n.variants)}function XU(n,t){if(dg(n)){const{initial:i,animate:s}=n;return{initial:i===!1||S0(i)?i:void 0,animate:S0(s)?s:void 0}}return n.inherit!==!1?t:{}}function KU(n){const{initial:t,animate:i}=XU(n,H.useContext(fg));return H.useMemo(()=>({initial:t,animate:i}),[K8(t),K8(i)])}function K8(n){return Array.isArray(n)?n.join(" "):n}function Q8(n,t){return t.max===t.min?0:n/(t.max-t.min)*100}const b0={correct:(n,t)=>{if(!t.target)return n;if(typeof n=="string")if(wt.test(n))n=parseFloat(n);else return n;const i=Q8(n,t.target.x),s=Q8(n,t.target.y);return`${i}% ${s}%`}},QU={correct:(n,{treeScale:t,projectionDelta:i})=>{const s=n,u=Io.parse(n);if(u.length>5)return s;const c=Io.createTransformer(n),f=typeof u[0]!="number"?1:0,p=i.x.scale*t.x,m=i.y.scale*t.y;u[0+f]/=p,u[1+f]/=m;const S=Cn(p,m,.5);return typeof u[2+f]=="number"&&(u[2+f]/=S),typeof u[3+f]=="number"&&(u[3+f]/=S),c(u)}},_S={borderRadius:{...b0,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:b0,borderTopRightRadius:b0,borderBottomLeftRadius:b0,borderBottomRightRadius:b0,boxShadow:QU};function Z8(n,{layout:t,layoutId:i}){return Eh.has(n)||n.startsWith("origin")||(t||i!==void 0)&&(!!_S[n]||n==="opacity")}const ZU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},JU=bh.length;function FU(n,t,i){let s="",u=!0;for(let c=0;c<JU;c++){const f=bh[c],p=n[f];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(f.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const S=O8(p,vS[f]);if(!m){u=!1;const b=ZU[f]||f;s+=`${b}(${S}) `}i&&(t[f]=S)}}return s=s.trim(),i?s=i(t,u?"":s):u&&(s="none"),s}function xS(n,t,i){const{style:s,vars:u,transformOrigin:c}=n;let f=!1,p=!1;for(const m in t){const S=t[m];if(Eh.has(m)){f=!0;continue}else if(Qb(m)){u[m]=S;continue}else{const b=O8(S,vS[m]);m.startsWith("origin")?(p=!0,c[m]=b):s[m]=b}}if(t.transform||(f||i?s.transform=FU(t,n.transform,i):s.transform&&(s.transform="none")),p){const{originX:m="50%",originY:S="50%",originZ:b=0}=c;s.transformOrigin=`${m} ${S} ${b}`}}const DS=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function J8(n,t,i){for(const s in t)!Ia(t[s])&&!Z8(s,i)&&(n[s]=t[s])}function kU({transformTemplate:n},t){return H.useMemo(()=>{const i=DS();return xS(i,t,n),Object.assign({},i.vars,i.style)},[t])}function IU(n,t){const i=n.style||{},s={};return J8(s,i,n),Object.assign(s,kU(n,t)),s}function WU(n,t){const i={},s=IU(n,t);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=s,i}const $U={offset:"stroke-dashoffset",array:"stroke-dasharray"},tB={offset:"strokeDashoffset",array:"strokeDasharray"};function eB(n,t,i=1,s=0,u=!0){n.pathLength=1;const c=u?$U:tB;n[c.offset]=wt.transform(-s);const f=wt.transform(t),p=wt.transform(i);n[c.array]=`${f} ${p}`}const nB=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function F8(n,{attrX:t,attrY:i,attrScale:s,pathLength:u,pathSpacing:c=1,pathOffset:f=0,...p},m,S,b){if(xS(n,p,S),m){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:_,style:x}=n;_.transform&&(x.transform=_.transform,delete _.transform),(x.transform||_.transformOrigin)&&(x.transformOrigin=_.transformOrigin??"50% 50%",delete _.transformOrigin),x.transform&&(x.transformBox=b?.transformBox??"fill-box",delete _.transformBox);for(const D of nB)_[D]!==void 0&&(x[D]=_[D],delete _[D]);t!==void 0&&(_.x=t),i!==void 0&&(_.y=i),s!==void 0&&(_.scale=s),u!==void 0&&eB(_,u,c,f,!1)}const k8=()=>({...DS(),attrs:{}}),I8=n=>typeof n=="string"&&n.toLowerCase()==="svg";function aB(n,t,i,s){const u=H.useMemo(()=>{const c=k8();return F8(c,t,I8(s),n.transformTemplate,n.style),{...c.attrs,style:{...c.style}}},[t]);if(n.style){const c={};J8(c,n.style,n),u.style={...c,...u.style}}return u}const iB=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function AS(n){return typeof n!="string"||n.includes("-")?!1:!!(iB.indexOf(n)>-1||/[A-Z]/u.test(n))}function sB(n,t,i,{latestValues:s},u,c=!1,f){const m=(f??AS(n)?aB:WU)(t,s,u,n),S=qU(t,typeof n=="string",c),b=n!==H.Fragment?{...S,...m,ref:i}:{},{children:_}=t,x=H.useMemo(()=>Ia(_)?_.get():_,[_]);return H.createElement(n,{...b,children:x})}function W8(n){const t=[{},{}];return n?.values.forEach((i,s)=>{t[0][s]=i.get(),t[1][s]=i.getVelocity()}),t}function MS(n,t,i,s){if(typeof t=="function"){const[u,c]=W8(s);t=t(i!==void 0?i:n.custom,u,c)}if(typeof t=="string"&&(t=n.variants&&n.variants[t]),typeof t=="function"){const[u,c]=W8(s);t=t(i!==void 0?i:n.custom,u,c)}return t}function pg(n){return Ia(n)?n.get():n}function lB({scrapeMotionValuesFromProps:n,createRenderState:t},i,s,u){return{latestValues:rB(i,s,u,n),renderState:t()}}function rB(n,t,i,s){const u={},c=s(n,{});for(const x in c)u[x]=pg(c[x]);let{initial:f,animate:p}=n;const m=dg(n),S=X8(n);t&&S&&!m&&n.inherit!==!1&&(f===void 0&&(f=t.initial),p===void 0&&(p=t.animate));let b=i?i.initial===!1:!1;b=b||f===!1;const _=b?p:f;if(_&&typeof _!="boolean"&&!hg(_)){const x=Array.isArray(_)?_:[_];for(let D=0;D<x.length;D++){const A=MS(n,x[D]);if(A){const{transitionEnd:N,transition:R,...O}=A;for(const U in O){let j=O[U];if(Array.isArray(j)){const V=b?j.length-1:0;j=j[V]}j!==null&&(u[U]=j)}for(const U in N)u[U]=N[U]}}}return u}const $8=n=>(t,i)=>{const s=H.useContext(fg),u=H.useContext(Uv),c=()=>lB(n,t,s,u);return i?c():YH(c)};function NS(n,t,i){const{style:s}=n,u={};for(const c in s)(Ia(s[c])||t.style&&Ia(t.style[c])||Z8(c,n)||i?.getValue(c)?.liveStyle!==void 0)&&(u[c]=s[c]);return u}const oB=$8({scrapeMotionValuesFromProps:NS,createRenderState:DS});function t7(n,t,i){const s=NS(n,t,i);for(const u in n)if(Ia(n[u])||Ia(t[u])){const c=bh.indexOf(u)!==-1?"attr"+u.charAt(0).toUpperCase()+u.substring(1):u;s[c]=n[u]}return s}const uB=$8({scrapeMotionValuesFromProps:t7,createRenderState:k8}),cB=Symbol.for("motionComponentSymbol");function fB(n,t,i){const s=H.useRef(i);H.useInsertionEffect(()=>{s.current=i});const u=H.useRef(null);return H.useCallback(c=>{c&&n.onMount?.(c),t&&(c?t.mount(c):t.unmount());const f=s.current;if(typeof f=="function")if(c){const p=f(c);typeof p=="function"&&(u.current=p)}else u.current?(u.current(),u.current=null):f(c);else f&&(f.current=c)},[t])}const OS=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),e7="data-"+OS("framerAppearId"),n7=H.createContext({});function E0(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function hB(n,t,i,s,u,c){const{visualElement:f}=H.useContext(fg),p=H.useContext(P8),m=H.useContext(Uv),S=H.useContext(L8).reducedMotion,b=H.useRef(null);s=s||p.renderer,!b.current&&s&&(b.current=s(n,{visualState:t,parent:f,props:i,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:S,isSVG:c}));const _=b.current,x=H.useContext(n7);_&&!_.projection&&u&&(_.type==="html"||_.type==="svg")&&dB(b.current,i,u,x);const D=H.useRef(!1);H.useInsertionEffect(()=>{_&&D.current&&_.update(i,m)});const A=i[e7],N=H.useRef(!!A&&!window.MotionHandoffIsComplete?.(A)&&window.MotionHasOptimisedAnimation?.(A));return qH(()=>{_&&(D.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),N.current&&_.animationState&&_.animationState.animateChanges())}),H.useEffect(()=>{_&&(!N.current&&_.animationState&&_.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(A)}),N.current=!1),_.enteringChildren=void 0)}),_}function dB(n,t,i,s){const{layoutId:u,layout:c,drag:f,dragConstraints:p,layoutScroll:m,layoutRoot:S,layoutCrossfade:b}=t;n.projection=new i(n.latestValues,t["data-framer-portal-id"]?void 0:a7(n.parent)),n.projection.setOptions({layoutId:u,layout:c,alwaysMeasureLayout:!!f||p&&E0(p),visualElement:n,animationType:typeof c=="string"?c:"both",initialPromotionConfig:s,crossfade:b,layoutScroll:m,layoutRoot:S})}function a7(n){if(n)return n.options.allowProjection!==!1?n.projection:a7(n.parent)}function RS(n,{forwardMotionProps:t=!1,type:i}={},s,u){s&&LU(s);const c=i?i==="svg":AS(n),f=c?uB:oB;function p(S,b){let _;const x={...H.useContext(L8),...S,layoutId:pB(S)},{isStatic:D}=x,A=KU(S),N=f(S,D);if(!D&&wv){mB(x,s);const R=gB(x);_=R.MeasureLayout,A.visualElement=hB(n,N,x,u,R.ProjectionNode,c)}return X.jsxs(fg.Provider,{value:A,children:[_&&A.visualElement?X.jsx(_,{visualElement:A.visualElement,...x}):null,sB(n,S,fB(N,A.visualElement,b),N,D,t,c)]})}p.displayName=`motion.${typeof n=="string"?n:`create(${n.displayName??n.name??""})`}`;const m=H.forwardRef(p);return m[cB]=n,m}function pB({layoutId:n}){const t=H.useContext(Db).id;return t&&n!==void 0?t+"-"+n:n}function mB(n,t){const i=H.useContext(P8).strict;if(process.env.NODE_ENV!=="production"&&t&&i){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";n.ignoreStrict?gh(!1,s,"lazy-strict-mode"):Gr(!1,s,"lazy-strict-mode")}}function gB(n){const{drag:t,layout:i}=Ch;if(!t&&!i)return{};const s={...t,...i};return{MeasureLayout:t?.isEnabled(n)||i?.isEnabled(n)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function yB(n,t){if(typeof Proxy>"u")return RS;const i=new Map,s=(c,f)=>RS(c,f,n,t),u=(c,f)=>(process.env.NODE_ENV!=="production"&&Pv(!1,"motion() is deprecated. Use motion.create() instead."),s(c,f));return new Proxy(u,{get:(c,f)=>f==="create"?s:(i.has(f)||i.set(f,RS(f,void 0,n,t)),i.get(f))})}function i7({top:n,left:t,right:i,bottom:s}){return{x:{min:t,max:i},y:{min:n,max:s}}}function vB({x:n,y:t}){return{top:t.min,right:n.max,bottom:t.max,left:n.min}}function SB(n,t){if(!t)return n;const i=t({x:n.left,y:n.top}),s=t({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}function zS(n){return n===void 0||n===1}function HS({scale:n,scaleX:t,scaleY:i}){return!zS(n)||!zS(t)||!zS(i)}function Tc(n){return HS(n)||s7(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function s7(n){return l7(n.x)||l7(n.y)}function l7(n){return n&&n!=="0%"}function mg(n,t,i){const s=n-i,u=t*s;return i+u}function r7(n,t,i,s,u){return u!==void 0&&(n=mg(n,u,s)),mg(n,i,s)+t}function wS(n,t=0,i=1,s,u){n.min=r7(n.min,t,i,s,u),n.max=r7(n.max,t,i,s,u)}function o7(n,{x:t,y:i}){wS(n.x,t.translate,t.scale,t.originPoint),wS(n.y,i.translate,i.scale,i.originPoint)}const u7=.999999999999,c7=1.0000000000001;function bB(n,t,i,s=!1){const u=i.length;if(!u)return;t.x=t.y=1;let c,f;for(let p=0;p<u;p++){c=i[p],f=c.projectionDelta;const{visualElement:m}=c.options;m&&m.props.style&&m.props.style.display==="contents"||(s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&xh(n,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),f&&(t.x*=f.x.scale,t.y*=f.y.scale,o7(n,f)),s&&Tc(c.latestValues)&&xh(n,c.latestValues))}t.x<c7&&t.x>u7&&(t.x=1),t.y<c7&&t.y>u7&&(t.y=1)}function _h(n,t){n.min=n.min+t,n.max=n.max+t}function f7(n,t,i,s,u=.5){const c=Cn(n.min,n.max,u);wS(n,t,i,c,s)}function xh(n,t){f7(n.x,t.x,t.scaleX,t.scale,t.originX),f7(n.y,t.y,t.scaleY,t.scale,t.originY)}function h7(n,t){return i7(SB(n.getBoundingClientRect(),t))}function EB(n,t,i){const s=h7(n,i),{scroll:u}=t;return u&&(_h(s.x,u.offset.x),_h(s.y,u.offset.y)),s}const d7=()=>({translate:0,scale:1,origin:0,originPoint:0}),Dh=()=>({x:d7(),y:d7()}),p7=()=>({min:0,max:0}),fa=()=>({x:p7(),y:p7()}),US={current:null},m7={current:!1};function TB(){if(m7.current=!0,!!wv)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),t=()=>US.current=n.matches;n.addEventListener("change",t),t()}else US.current=!1}const CB=new WeakMap;function _B(n,t,i){for(const s in t){const u=t[s],c=i[s];if(Ia(u))n.addValue(s,u);else if(Ia(c))n.addValue(s,Th(u,{owner:n}));else if(c!==u)if(n.hasValue(s)){const f=n.getValue(s);f.liveStyle===!0?f.jump(u):f.hasAnimated||f.set(u)}else{const f=n.getStaticValue(s);n.addValue(s,Th(f!==void 0?f:u,{owner:n}))}}for(const s in i)t[s]===void 0&&n.removeValue(s);return t}const g7=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class xB{scrapeMotionValuesFromProps(t,i,s){return{}}constructor({parent:t,props:i,presenceContext:s,reducedMotionConfig:u,blockInitialAnimation:c,visualState:f},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=pS,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=Ai.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,hn.render(this.render,!1,!0))};const{latestValues:m,renderState:S}=f;this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=S,this.parent=t,this.props=i,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=u,this.options=p,this.blockInitialAnimation=!!c,this.isControllingVariants=dg(i),this.isVariantNode=X8(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:b,..._}=this.scrapeMotionValuesFromProps(i,{},this);for(const x in _){const D=_[x];m[x]!==void 0&&Ia(D)&&D.set(m[x])}}mount(t){this.current=t,CB.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(m7.current||TB(),this.shouldReduceMotion=US.current),process.env.NODE_ENV!=="production"&&Pv(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Fo(this.notifyUpdate),Fo(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const i=this.features[t];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,i){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=Eh.has(t);s&&this.onBindTransform&&this.onBindTransform();const u=i.on("change",f=>{this.latestValues[t]=f,this.props.onUpdate&&hn.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let c;window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,i)),this.valueSubscriptions.set(t,()=>{u(),c&&c(),i.owner&&i.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ch){const i=Ch[t];if(!i)continue;const{isEnabled:s,Feature:u}=i;if(!this.features[t]&&u&&s(this.props)&&(this.features[t]=new u(this)),this.features[t]){const c=this.features[t];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fa()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,i){this.latestValues[t]=i}update(t,i){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let s=0;s<g7.length;s++){const u=g7[s];this.propEventSubscriptions[u]&&(this.propEventSubscriptions[u](),delete this.propEventSubscriptions[u]);const c="on"+u,f=t[c];f&&(this.propEventSubscriptions[u]=this.on(u,f))}this.prevMotionValues=_B(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(t),()=>i.variantChildren.delete(t)}addValue(t,i){const s=this.values.get(t);i!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,i),this.values.set(t,i),this.latestValues[t]=i.get())}removeValue(t){this.values.delete(t);const i=this.valueSubscriptions.get(t);i&&(i(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,i){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&i!==void 0&&(s=Th(i===null?void 0:i,{owner:this}),this.addValue(t,s)),s}readValue(t,i){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Ab(s)||Nb(s))?s=parseFloat(s):!GU(s)&&Io.test(i)&&(s=N8(t,i)),this.setBaseTarget(t,Ia(s)?s.get():s)),Ia(s)?s.get():s}setBaseTarget(t,i){this.baseTarget[t]=i}getBaseTarget(t){const{initial:i}=this.props;let s;if(typeof i=="string"||typeof i=="object"){const c=MS(this.props,i,this.presenceContext?.custom);c&&(s=c[t])}if(i&&s!==void 0)return s;const u=this.getBaseTargetFromProps(this.props,t);return u!==void 0&&!Ia(u)?u:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,i){return this.events[t]||(this.events[t]=new Lv),this.events[t].add(i)}notify(t,...i){this.events[t]&&this.events[t].notify(...i)}scheduleRenderMicrotask(){SS.render(this.render)}}class y7 extends xB{constructor(){super(...arguments),this.KeyframeResolver=DU}sortInstanceNodePosition(t,i){return t.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(t,i){return t.style?t.style[i]:void 0}removeValueFromRenderState(t,{vars:i,style:s}){delete i[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ia(t)&&(this.childSubscription=t.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function v7(n,{style:t,vars:i},s,u){const c=n.style;let f;for(f in t)c[f]=t[f];u?.applyProjectionStyles(c,s);for(f in i)c.setProperty(f,i[f])}function DB(n){return window.getComputedStyle(n)}class AB extends y7{constructor(){super(...arguments),this.type="html",this.renderInstance=v7}readValueFromInstance(t,i){if(Eh.has(i))return this.projection?.isProjecting?uS(i):Kw(t,i);{const s=DB(t),u=(Qb(i)?s.getPropertyValue(i):s[i])||0;return typeof u=="string"?u.trim():u}}measureInstanceViewportBox(t,{transformPagePoint:i}){return h7(t,i)}build(t,i,s){xS(t,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,i,s){return NS(t,i,s)}}const S7=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function MB(n,t,i,s){v7(n,t,void 0,s);for(const u in t.attrs)n.setAttribute(S7.has(u)?u:OS(u),t.attrs[u])}class NB extends y7{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fa}getBaseTargetFromProps(t,i){return t[i]}readValueFromInstance(t,i){if(Eh.has(i)){const s=M8(i);return s&&s.default||0}return i=S7.has(i)?i:OS(i),t.getAttribute(i)}scrapeMotionValuesFromProps(t,i,s){return t7(t,i,s)}build(t,i,s){F8(t,i,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,i,s,u){MB(t,i,s,u)}mount(t){this.isSVGTag=I8(t.tagName),super.mount(t)}}const OB=(n,t)=>t.isSVG??AS(n)?new NB(t):new AB(t,{allowProjection:n!==H.Fragment});function Ah(n,t,i){const s=n.getProps();return MS(s,t,i!==void 0?i:s.custom,n)}const BS=n=>Array.isArray(n);function RB(n,t,i){n.hasValue(t)?n.getValue(t).set(i):n.addValue(t,Th(i))}function zB(n){return BS(n)?n[n.length-1]||0:n}function HB(n,t){const i=Ah(n,t);let{transitionEnd:s={},transition:u={},...c}=i||{};c={...c,...s};for(const f in c){const p=zB(c[f]);RB(n,f,p)}}function wB(n){return!!(Ia(n)&&n.add)}function VS(n,t){const i=n.getValue("willChange");if(wB(i))return i.add(t);if(!i&&jr.WillChange){const s=new jr.WillChange("auto");n.addValue("willChange",s),s.add(t)}}function b7(n){return n.props[e7]}const UB=n=>n!==null;function BB(n,{repeat:t,repeatType:i="loop"},s){const u=n.filter(UB),c=t&&i!=="loop"&&t%2===1?0:u.length-1;return u[c]}const VB={type:"spring",stiffness:500,damping:25,restSpeed:10},GB=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),jB={type:"keyframes",duration:.8},LB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PB=(n,{keyframes:t})=>t.length>2?jB:Eh.has(n)?n.startsWith("scale")?GB(t[1]):VB:LB;function YB({when:n,delay:t,delayChildren:i,staggerChildren:s,staggerDirection:u,repeat:c,repeatType:f,repeatDelay:p,from:m,elapsed:S,...b}){return!!Object.keys(b).length}const GS=(n,t,i,s={},u,c)=>f=>{const p=gS(s,n)||{},m=p.delay||s.delay||0;let{elapsed:S=0}=s;S=S-ol(m);const b={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:t.getVelocity(),...p,delay:-S,onUpdate:x=>{t.set(x),p.onUpdate&&p.onUpdate(x)},onComplete:()=>{f(),p.onComplete&&p.onComplete()},name:n,motionValue:t,element:c?void 0:u};YB(p)||Object.assign(b,PB(n,b)),b.duration&&(b.duration=ol(b.duration)),b.repeatDelay&&(b.repeatDelay=ol(b.repeatDelay)),b.from!==void 0&&(b.keyframes[0]=b.from);let _=!1;if((b.type===!1||b.duration===0&&!b.repeatDelay)&&(mS(b),b.delay===0&&(_=!0)),(jr.instantAnimations||jr.skipAnimations)&&(_=!0,mS(b),b.delay=0),b.allowFlatten=!p.type&&!p.ease,_&&!c&&t.get()!==void 0){const x=BB(b.keyframes,p);if(x!==void 0){hn.update(()=>{b.onUpdate(x),b.onComplete()});return}}return p.isSync?new lS(b):new pU(b)};function qB({protectedKeys:n,needsAnimating:t},i){const s=n.hasOwnProperty(i)&&t[i]!==!0;return t[i]=!1,s}function E7(n,t,{delay:i=0,transitionOverride:s,type:u}={}){let{transition:c=n.getDefaultTransition(),transitionEnd:f,...p}=t;s&&(c=s);const m=[],S=u&&n.animationState&&n.animationState.getState()[u];for(const b in p){const _=n.getValue(b,n.latestValues[b]??null),x=p[b];if(x===void 0||S&&qB(S,b))continue;const D={delay:i,...gS(c||{},b)},A=_.get();if(A!==void 0&&!_.isAnimating&&!Array.isArray(x)&&x===A&&!D.velocity)continue;let N=!1;if(window.MotionHandoffAnimation){const O=b7(n);if(O){const U=window.MotionHandoffAnimation(O,b,hn);U!==null&&(D.startTime=U,N=!0)}}VS(n,b),_.start(GS(b,_,x,n.shouldReduceMotion&&C8.has(b)?{type:!1}:D,n,N));const R=_.animation;R&&m.push(R)}return f&&Promise.all(m).then(()=>{hn.update(()=>{f&&HB(n,f)})}),m}function T7(n,t,i,s=0,u=1){const c=Array.from(n).sort((S,b)=>S.sortNodePosition(b)).indexOf(t),f=n.size,p=(f-1)*s;return typeof i=="function"?i(c,f):u===1?c*s:p-c*s}function jS(n,t,i={}){const s=Ah(n,t,i.type==="exit"?n.presenceContext?.custom:void 0);let{transition:u=n.getDefaultTransition()||{}}=s||{};i.transitionOverride&&(u=i.transitionOverride);const c=s?()=>Promise.all(E7(n,s,i)):()=>Promise.resolve(),f=n.variantChildren&&n.variantChildren.size?(m=0)=>{const{delayChildren:S=0,staggerChildren:b,staggerDirection:_}=u;return XB(n,t,m,S,b,_,i)}:()=>Promise.resolve(),{when:p}=u;if(p){const[m,S]=p==="beforeChildren"?[c,f]:[f,c];return m().then(()=>S())}else return Promise.all([c(),f(i.delay)])}function XB(n,t,i=0,s=0,u=0,c=1,f){const p=[];for(const m of n.variantChildren)m.notify("AnimationStart",t),p.push(jS(m,t,{...f,delay:i+(typeof s=="function"?0:s)+T7(n.variantChildren,m,s,u,c)}).then(()=>m.notify("AnimationComplete",t)));return Promise.all(p)}function KB(n,t,i={}){n.notify("AnimationStart",t);let s;if(Array.isArray(t)){const u=t.map(c=>jS(n,c,i));s=Promise.all(u)}else if(typeof t=="string")s=jS(n,t,i);else{const u=typeof t=="function"?Ah(n,t,i.custom):t;s=Promise.all(E7(n,u,i))}return s.then(()=>{n.notify("AnimationComplete",t)})}function C7(n,t){if(!Array.isArray(t))return!1;const i=t.length;if(i!==n.length)return!1;for(let s=0;s<i;s++)if(t[s]!==n[s])return!1;return!0}const QB=CS.length;function _7(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?_7(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const t={};for(let i=0;i<QB;i++){const s=CS[i],u=n.props[s];(S0(u)||u===!1)&&(t[s]=u)}return t}const ZB=[...TS].reverse(),JB=TS.length;function FB(n){return t=>Promise.all(t.map(({animation:i,options:s})=>KB(n,i,s)))}function kB(n){let t=FB(n),i=x7(),s=!0;const u=m=>(S,b)=>{const _=Ah(n,b,m==="exit"?n.presenceContext?.custom:void 0);if(_){const{transition:x,transitionEnd:D,...A}=_;S={...S,...A,...D}}return S};function c(m){t=m(n)}function f(m){const{props:S}=n,b=_7(n.parent)||{},_=[],x=new Set;let D={},A=1/0;for(let R=0;R<JB;R++){const O=ZB[R],U=i[O],j=S[O]!==void 0?S[O]:b[O],V=S0(j),J=O===m?U.isActive:null;J===!1&&(A=R);let W=j===b[O]&&j!==S[O]&&V;if(W&&s&&n.manuallyAnimateOnMount&&(W=!1),U.protectedKeys={...D},!U.isActive&&J===null||!j&&!U.prevProp||hg(j)||typeof j=="boolean")continue;const st=IB(U.prevProp,j);let I=st||O===m&&U.isActive&&!W&&V||R>A&&V,et=!1;const nt=Array.isArray(j)?j:[j];let bt=nt.reduce(u(O),{});J===!1&&(bt={});const{prevResolvedValues:rt={}}=U,dt={...rt,...bt},pt=F=>{I=!0,x.has(F)&&(et=!0,x.delete(F)),U.needsAnimating[F]=!0;const K=n.getValue(F);K&&(K.liveStyle=!1)};for(const F in dt){const K=bt[F],at=rt[F];if(D.hasOwnProperty(F))continue;let St=!1;BS(K)&&BS(at)?St=!C7(K,at):St=K!==at,St?K!=null?pt(F):x.add(F):K!==void 0&&x.has(F)?pt(F):U.protectedKeys[F]=!0}U.prevProp=j,U.prevResolvedValues=bt,U.isActive&&(D={...D,...bt}),s&&n.blockInitialAnimation&&(I=!1);const tt=W&&st;I&&(!tt||et)&&_.push(...nt.map(F=>{const K={type:O};if(typeof F=="string"&&s&&!tt&&n.manuallyAnimateOnMount&&n.parent){const{parent:at}=n,St=Ah(at,F);if(at.enteringChildren&&St){const{delayChildren:$}=St.transition||{};K.delay=T7(at.enteringChildren,n,$)}}return{animation:F,options:K}}))}if(x.size){const R={};if(typeof S.initial!="boolean"){const O=Ah(n,Array.isArray(S.initial)?S.initial[0]:S.initial);O&&O.transition&&(R.transition=O.transition)}x.forEach(O=>{const U=n.getBaseTarget(O),j=n.getValue(O);j&&(j.liveStyle=!0),R[O]=U??null}),_.push({animation:R})}let N=!!_.length;return s&&(S.initial===!1||S.initial===S.animate)&&!n.manuallyAnimateOnMount&&(N=!1),s=!1,N?t(_):Promise.resolve()}function p(m,S){if(i[m].isActive===S)return Promise.resolve();n.variantChildren?.forEach(_=>_.animationState?.setActive(m,S)),i[m].isActive=S;const b=f(m);for(const _ in i)i[_].protectedKeys={};return b}return{animateChanges:f,setActive:p,setAnimateFunction:c,getState:()=>i,reset:()=>{i=x7()}}}function IB(n,t){return typeof t=="string"?t!==n:Array.isArray(t)?!C7(t,n):!1}function Cc(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function x7(){return{animate:Cc(!0),whileInView:Cc(),whileHover:Cc(),whileTap:Cc(),whileDrag:Cc(),whileFocus:Cc(),exit:Cc()}}class $o{constructor(t){this.isMounted=!1,this.node=t}update(){}}class WB extends $o{constructor(t){super(t),t.animationState||(t.animationState=kB(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();hg(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:i}=this.node.prevProps||{};t!==i&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let $B=0;class tV extends $o{constructor(){super(...arguments),this.id=$B++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const u=this.node.animationState.setActive("exit",!t);i&&!t&&u.then(()=>{i(this.id)})}mount(){const{register:t,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const eV={animation:{Feature:WB},exit:{Feature:tV}};function T0(n,t,i,s={passive:!0}){return n.addEventListener(t,i,s),()=>n.removeEventListener(t,i)}function C0(n){return{point:{x:n.pageX,y:n.pageY}}}const nV=n=>t=>bS(t)&&n(t,C0(t));function _0(n,t,i,s){return T0(n,t,nV(i),s)}const D7=1e-4,aV=1-D7,iV=1+D7,A7=.01,sV=0-A7,lV=0+A7;function hi(n){return n.max-n.min}function rV(n,t,i){return Math.abs(n-t)<=i}function M7(n,t,i,s=.5){n.origin=s,n.originPoint=Cn(t.min,t.max,n.origin),n.scale=hi(i)/hi(t),n.translate=Cn(i.min,i.max,n.origin)-n.originPoint,(n.scale>=aV&&n.scale<=iV||isNaN(n.scale))&&(n.scale=1),(n.translate>=sV&&n.translate<=lV||isNaN(n.translate))&&(n.translate=0)}function x0(n,t,i,s){M7(n.x,t.x,i.x,s?s.originX:void 0),M7(n.y,t.y,i.y,s?s.originY:void 0)}function N7(n,t,i){n.min=i.min+t.min,n.max=n.min+hi(t)}function oV(n,t,i){N7(n.x,t.x,i.x),N7(n.y,t.y,i.y)}function O7(n,t,i){n.min=t.min-i.min,n.max=n.min+hi(t)}function gg(n,t,i){O7(n.x,t.x,i.x),O7(n.y,t.y,i.y)}function xs(n){return[n("x"),n("y")]}const R7=({current:n})=>n?n.ownerDocument.defaultView:null,z7=(n,t)=>Math.abs(n-t);function uV(n,t){const i=z7(n.x,t.x),s=z7(n.y,t.y);return Math.sqrt(i**2+s**2)}class H7{constructor(t,i,{transformPagePoint:s,contextWindow:u=window,dragSnapToOrigin:c=!1,distanceThreshold:f=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=PS(this.lastMoveEventInfo,this.history),D=this.startEvent!==null,A=uV(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!D&&!A)return;const{point:N}=x,{timestamp:R}=wa;this.history.push({...N,timestamp:R});const{onStart:O,onMove:U}=this.handlers;D||(O&&O(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),U&&U(this.lastMoveEvent,x)},this.handlePointerMove=(x,D)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=LS(D,this.transformPagePoint),hn.update(this.updatePoint,!0)},this.handlePointerUp=(x,D)=>{this.end();const{onEnd:A,onSessionEnd:N,resumeAnimation:R}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&R&&R(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const O=PS(x.type==="pointercancel"?this.lastMoveEventInfo:LS(D,this.transformPagePoint),this.history);this.startEvent&&A&&A(x,O),N&&N(x,O)},!bS(t))return;this.dragSnapToOrigin=c,this.handlers=i,this.transformPagePoint=s,this.distanceThreshold=f,this.contextWindow=u||window;const p=C0(t),m=LS(p,this.transformPagePoint),{point:S}=m,{timestamp:b}=wa;this.history=[{...S,timestamp:b}];const{onSessionStart:_}=i;_&&_(t,PS(m,this.history)),this.removeListeners=f0(_0(this.contextWindow,"pointermove",this.handlePointerMove),_0(this.contextWindow,"pointerup",this.handlePointerUp),_0(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Fo(this.updatePoint)}}function LS(n,t){return t?{point:t(n.point)}:n}function w7(n,t){return{x:n.x-t.x,y:n.y-t.y}}function PS({point:n},t){return{point:n,delta:w7(n,U7(t)),offset:w7(n,cV(t)),velocity:fV(t,.1)}}function cV(n){return n[0]}function U7(n){return n[n.length-1]}function fV(n,t){if(n.length<2)return{x:0,y:0};let i=n.length-1,s=null;const u=U7(n);for(;i>=0&&(s=n[i],!(u.timestamp-s.timestamp>ol(t)));)i--;if(!s)return{x:0,y:0};const c=_s(u.timestamp-s.timestamp);if(c===0)return{x:0,y:0};const f={x:(u.x-s.x)/c,y:(u.y-s.y)/c};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}function hV(n,{min:t,max:i},s){return t!==void 0&&n<t?n=s?Cn(t,n,s.min):Math.max(n,t):i!==void 0&&n>i&&(n=s?Cn(i,n,s.max):Math.min(n,i)),n}function B7(n,t,i){return{min:t!==void 0?n.min+t:void 0,max:i!==void 0?n.max+i-(n.max-n.min):void 0}}function dV(n,{top:t,left:i,bottom:s,right:u}){return{x:B7(n.x,i,u),y:B7(n.y,t,s)}}function V7(n,t){let i=t.min-n.min,s=t.max-n.max;return t.max-t.min<n.max-n.min&&([i,s]=[s,i]),{min:i,max:s}}function pV(n,t){return{x:V7(n.x,t.x),y:V7(n.y,t.y)}}function mV(n,t){let i=.5;const s=hi(n),u=hi(t);return u>s?i=h0(t.min,t.max-s,n.min):s>u&&(i=h0(n.min,n.max-u,t.min)),Vr(0,1,i)}function gV(n,t){const i={};return t.min!==void 0&&(i.min=t.min-n.min),t.max!==void 0&&(i.max=t.max-n.min),i}const YS=.35;function yV(n=YS){return n===!1?n=0:n===!0&&(n=YS),{x:G7(n,"left","right"),y:G7(n,"top","bottom")}}function G7(n,t,i){return{min:j7(n,t),max:j7(n,i)}}function j7(n,t){return typeof n=="number"?n:n[t]||0}const vV=new WeakMap;class SV{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fa(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:i=!1,distanceThreshold:s}={}){const{presenceContext:u}=this.visualElement;if(u&&u.isPresent===!1)return;const c=_=>{i?(this.stopAnimation(),this.snapToCursor(C0(_).point)):this.pauseAnimation()},f=(_,x)=>{this.stopAnimation();const{drag:D,dragPropagation:A,onDragStart:N}=this.getProps();if(D&&!A&&(this.openDragLock&&this.openDragLock(),this.openDragLock=RU(D),!this.openDragLock))return;this.latestPointerEvent=_,this.latestPanInfo=x,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),xs(O=>{let U=this.getAxisMotionValue(O).get()||0;if(kl.test(U)){const{projection:j}=this.visualElement;if(j&&j.layout){const V=j.layout.layoutBox[O];V&&(U=hi(V)*(parseFloat(U)/100))}}this.originPoint[O]=U}),N&&hn.postRender(()=>N(_,x)),VS(this.visualElement,"transform");const{animationState:R}=this.visualElement;R&&R.setActive("whileDrag",!0)},p=(_,x)=>{this.latestPointerEvent=_,this.latestPanInfo=x;const{dragPropagation:D,dragDirectionLock:A,onDirectionLock:N,onDrag:R}=this.getProps();if(!D&&!this.openDragLock)return;const{offset:O}=x;if(A&&this.currentDirection===null){this.currentDirection=bV(O),this.currentDirection!==null&&N&&N(this.currentDirection);return}this.updateAxis("x",x.point,O),this.updateAxis("y",x.point,O),this.visualElement.render(),R&&R(_,x)},m=(_,x)=>{this.latestPointerEvent=_,this.latestPanInfo=x,this.stop(_,x),this.latestPointerEvent=null,this.latestPanInfo=null},S=()=>xs(_=>this.getAnimationState(_)==="paused"&&this.getAxisMotionValue(_).animation?.play()),{dragSnapToOrigin:b}=this.getProps();this.panSession=new H7(t,{onSessionStart:c,onStart:f,onMove:p,onSessionEnd:m,resumeAnimation:S},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:b,distanceThreshold:s,contextWindow:R7(this.visualElement)})}stop(t,i){const s=t||this.latestPointerEvent,u=i||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!u||!s)return;const{velocity:f}=u;this.startAnimation(f);const{onDragEnd:p}=this.getProps();p&&hn.postRender(()=>p(s,u))}cancel(){this.isDragging=!1;const{projection:t,animationState:i}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(t,i,s){const{drag:u}=this.getProps();if(!s||!yg(t,u,this.currentDirection))return;const c=this.getAxisMotionValue(t);let f=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(f=hV(f,this.constraints[t],this.elastic[t])),c.set(f)}resolveConstraints(){const{dragConstraints:t,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,u=this.constraints;t&&E0(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=dV(s.layoutBox,t):this.constraints=!1,this.elastic=yV(i),u!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&xs(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=gV(s.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!E0(t))return!1;const s=t.current;Gr(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:u}=this.visualElement;if(!u||!u.layout)return!1;const c=EB(s,u.root,this.visualElement.getTransformPagePoint());let f=pV(u.layout.layoutBox,c);if(i){const p=i(vB(f));this.hasMutatedConstraints=!!p,p&&(f=i7(p))}return f}startAnimation(t){const{drag:i,dragMomentum:s,dragElastic:u,dragTransition:c,dragSnapToOrigin:f,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},S=xs(b=>{if(!yg(b,i,this.currentDirection))return;let _=m&&m[b]||{};f&&(_={min:0,max:0});const x=u?200:1e6,D=u?40:1e7,A={type:"inertia",velocity:s?t[b]:0,bounceStiffness:x,bounceDamping:D,timeConstant:750,restDelta:1,restSpeed:10,...c,..._};return this.startAxisValueAnimation(b,A)});return Promise.all(S).then(p)}startAxisValueAnimation(t,i){const s=this.getAxisMotionValue(t);return VS(this.visualElement,t),s.start(GS(t,s,0,i,this.visualElement,!1))}stopAnimation(){xs(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){xs(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const i=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),u=s[i];return u||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){xs(i=>{const{drag:s}=this.getProps();if(!yg(i,s,this.currentDirection))return;const{projection:u}=this.visualElement,c=this.getAxisMotionValue(i);if(u&&u.layout){const{min:f,max:p}=u.layout.layoutBox[i],m=c.get()||0;c.set(t[i]-Cn(f,p,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:i}=this.getProps(),{projection:s}=this.visualElement;if(!E0(i)||!s||!this.constraints)return;this.stopAnimation();const u={x:0,y:0};xs(f=>{const p=this.getAxisMotionValue(f);if(p&&this.constraints!==!1){const m=p.get();u[f]=mV({min:m,max:m},this.constraints[f])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),xs(f=>{if(!yg(f,t,null))return;const p=this.getAxisMotionValue(f),{min:m,max:S}=this.constraints[f];p.set(Cn(m,S,u[f]))})}addListeners(){if(!this.visualElement.current)return;vV.set(this.visualElement,this);const t=this.visualElement.current,i=_0(t,"pointerdown",m=>{const{drag:S,dragListener:b=!0}=this.getProps();S&&b&&!B8(m.target)&&this.start(m)}),s=()=>{const{dragConstraints:m}=this.getProps();E0(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:u}=this.visualElement,c=u.addEventListener("measure",s);u&&!u.layout&&(u.root&&u.root.updateScroll(),u.updateLayout()),hn.read(s);const f=T0(window,"resize",()=>this.scalePositionWithinConstraints()),p=u.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:S})=>{this.isDragging&&S&&(xs(b=>{const _=this.getAxisMotionValue(b);_&&(this.originPoint[b]+=m[b].translate,_.set(_.get()+m[b].translate))}),this.visualElement.render())}));return()=>{f(),i(),c(),p&&p()}}getProps(){const t=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:s=!1,dragPropagation:u=!1,dragConstraints:c=!1,dragElastic:f=YS,dragMomentum:p=!0}=t;return{...t,drag:i,dragDirectionLock:s,dragPropagation:u,dragConstraints:c,dragElastic:f,dragMomentum:p}}}function yg(n,t,i){return(t===!0||t===n)&&(i===null||i===n)}function bV(n,t=10){let i=null;return Math.abs(n.y)>t?i="y":Math.abs(n.x)>t&&(i="x"),i}class EV extends $o{constructor(t){super(t),this.removeGroupControls=Cs,this.removeListeners=Cs,this.controls=new SV(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Cs}update(){const{dragControls:t}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};t!==i&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const L7=n=>(t,i)=>{n&&hn.postRender(()=>n(t,i))};class TV extends $o{constructor(){super(...arguments),this.removePointerDownListener=Cs}onPointerDown(t){this.session=new H7(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:R7(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:i,onPan:s,onPanEnd:u}=this.node.getProps();return{onSessionStart:L7(t),onStart:L7(i),onMove:s,onEnd:(c,f)=>{delete this.session,u&&hn.postRender(()=>u(c,f))}}}mount(){this.removePointerDownListener=_0(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const vg={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let qS=!1;class CV extends H.Component{componentDidMount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:s,layoutId:u}=this.props,{projection:c}=t;c&&(i.group&&i.group.add(c),s&&s.register&&u&&s.register(c),qS&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,onExitComplete:()=>this.safeToRemove()})),vg.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:i,visualElement:s,drag:u,isPresent:c}=this.props,{projection:f}=s;return f&&(f.isPresent=c,qS=!0,u||t.layoutDependency!==i||i===void 0||t.isPresent!==c?f.willUpdate():this.safeToRemove(),t.isPresent!==c&&(c?f.promote():f.relegate()||hn.postRender(()=>{const p=f.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),SS.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:s}=this.props,{projection:u}=t;qS=!0,u&&(u.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(u),s&&s.deregister&&s.deregister(u))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function P7(n){const[t,i]=jU(),s=H.useContext(Db);return X.jsx(CV,{...n,layoutGroup:s,switchLayoutGroup:H.useContext(n7),isPresent:t,safeToRemove:i})}function _V(n,t,i){const s=Ia(n)?n:Th(n);return s.start(GS("",s,t,i)),s.animation}const xV=(n,t)=>n.depth-t.depth;class DV{constructor(){this.children=[],this.isDirty=!1}add(t){Bv(this.children,t),this.isDirty=!0}remove(t){Vv(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(xV),this.isDirty=!1,this.children.forEach(t)}}function AV(n,t){const i=Ai.now(),s=({timestamp:u})=>{const c=u-i;c>=t&&(Fo(s),n(c-t))};return hn.setup(s,!0),()=>Fo(s)}const Y7=["TopLeft","TopRight","BottomLeft","BottomRight"],MV=Y7.length,q7=n=>typeof n=="string"?parseFloat(n):n,X7=n=>typeof n=="number"||wt.test(n);function NV(n,t,i,s,u,c){u?(n.opacity=Cn(0,i.opacity??1,OV(s)),n.opacityExit=Cn(t.opacity??1,0,RV(s))):c&&(n.opacity=Cn(t.opacity??1,i.opacity??1,s));for(let f=0;f<MV;f++){const p=`border${Y7[f]}Radius`;let m=K7(t,p),S=K7(i,p);if(m===void 0&&S===void 0)continue;m||(m=0),S||(S=0),m===0||S===0||X7(m)===X7(S)?(n[p]=Math.max(Cn(q7(m),q7(S),s),0),(kl.test(S)||kl.test(m))&&(n[p]+="%")):n[p]=S}(t.rotate||i.rotate)&&(n.rotate=Cn(t.rotate||0,i.rotate||0,s))}function K7(n,t){return n[t]!==void 0?n[t]:n.borderRadius}const OV=Q7(0,.5,Gb),RV=Q7(.5,.95,Cs);function Q7(n,t,i){return s=>s<n?0:s>t?1:i(h0(n,t,s))}function Z7(n,t){n.min=t.min,n.max=t.max}function cl(n,t){Z7(n.x,t.x),Z7(n.y,t.y)}function J7(n,t){n.translate=t.translate,n.scale=t.scale,n.originPoint=t.originPoint,n.origin=t.origin}function F7(n,t,i,s,u){return n-=t,n=mg(n,1/i,s),u!==void 0&&(n=mg(n,1/u,s)),n}function zV(n,t=0,i=1,s=.5,u,c=n,f=n){if(kl.test(t)&&(t=parseFloat(t),t=Cn(f.min,f.max,t/100)-f.min),typeof t!="number")return;let p=Cn(c.min,c.max,s);n===c&&(p-=t),n.min=F7(n.min,t,i,p,u),n.max=F7(n.max,t,i,p,u)}function k7(n,t,[i,s,u],c,f){zV(n,t[i],t[s],t[u],t.scale,c,f)}const HV=["x","scaleX","originX"],wV=["y","scaleY","originY"];function I7(n,t,i,s){k7(n.x,t,HV,i?i.x:void 0,s?s.x:void 0),k7(n.y,t,wV,i?i.y:void 0,s?s.y:void 0)}function W7(n){return n.translate===0&&n.scale===1}function $7(n){return W7(n.x)&&W7(n.y)}function t9(n,t){return n.min===t.min&&n.max===t.max}function UV(n,t){return t9(n.x,t.x)&&t9(n.y,t.y)}function e9(n,t){return Math.round(n.min)===Math.round(t.min)&&Math.round(n.max)===Math.round(t.max)}function n9(n,t){return e9(n.x,t.x)&&e9(n.y,t.y)}function a9(n){return hi(n.x)/hi(n.y)}function i9(n,t){return n.translate===t.translate&&n.scale===t.scale&&n.originPoint===t.originPoint}class BV{constructor(){this.members=[]}add(t){Bv(this.members,t),t.scheduleRender()}remove(t){if(Vv(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(t){const i=this.members.findIndex(u=>t===u);if(i===0)return!1;let s;for(let u=i;u>=0;u--){const c=this.members[u];if(c.isPresent!==!1){s=c;break}}return s?(this.promote(s),!0):!1}promote(t,i){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,i&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:u}=t.options;u===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:i,resumingFrom:s}=t;i.onExitComplete&&i.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function VV(n,t,i){let s="";const u=n.x.translate/t.x,c=n.y.translate/t.y,f=i?.z||0;if((u||c||f)&&(s=`translate3d(${u}px, ${c}px, ${f}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),i){const{transformPerspective:S,rotate:b,rotateX:_,rotateY:x,skewX:D,skewY:A}=i;S&&(s=`perspective(${S}px) ${s}`),b&&(s+=`rotate(${b}deg) `),_&&(s+=`rotateX(${_}deg) `),x&&(s+=`rotateY(${x}deg) `),D&&(s+=`skewX(${D}deg) `),A&&(s+=`skewY(${A}deg) `)}const p=n.x.scale*t.x,m=n.y.scale*t.y;return(p!==1||m!==1)&&(s+=`scale(${p}, ${m})`),s||"none"}const XS=["","X","Y","Z"],GV=1e3;let jV=0;function KS(n,t,i,s){const{latestValues:u}=t;u[n]&&(i[n]=u[n],t.setStaticValue(n,0),s&&(s[n]=0))}function s9(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:t}=n.options;if(!t)return;const i=b7(t);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:u,layoutId:c}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",hn,!(u||c))}const{parent:s}=n;s&&!s.hasCheckedOptimisedAppear&&s9(s)}function l9({attachResizeListener:n,defaultParent:t,measureScroll:i,checkIsScrollRoot:s,resetTransform:u}){return class{constructor(f={},p=t?.()){this.id=jV++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(YV),this.nodes.forEach(QV),this.nodes.forEach(ZV),this.nodes.forEach(qV)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new DV)}addEventListener(f,p){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new Lv),this.eventHandlers.get(f).add(p)}notifyListeners(f,...p){const m=this.eventHandlers.get(f);m&&m.notify(...p)}hasListeners(f){return this.eventHandlers.has(f)}mount(f){if(this.instance)return;this.isSVG=j8(f)&&!BU(f),this.instance=f;const{layoutId:p,layout:m,visualElement:S}=this.options;if(S&&!S.current&&S.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(m||p)&&(this.isLayoutDirty=!0),n){let b,_=0;const x=()=>this.root.updateBlockedByResize=!1;hn.read(()=>{_=window.innerWidth}),n(f,()=>{const D=window.innerWidth;D!==_&&(_=D,this.root.updateBlockedByResize=!0,b&&b(),b=AV(x,250),vg.hasAnimatedSinceResize&&(vg.hasAnimatedSinceResize=!1,this.nodes.forEach(u9)))})}p&&this.root.registerSharedNode(p,this),this.options.animate!==!1&&S&&(p||m)&&this.addEventListener("didUpdate",({delta:b,hasLayoutChanged:_,hasRelativeLayoutChanged:x,layout:D})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=this.options.transition||S.getDefaultTransition()||WV,{onLayoutAnimationStart:N,onLayoutAnimationComplete:R}=S.getProps(),O=!this.targetLayout||!n9(this.targetLayout,D),U=!_&&x;if(this.options.layoutRoot||this.resumeFrom||U||_&&(O||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const j={...gS(A,"layout"),onPlay:N,onComplete:R};(S.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j),this.setAnimationOrigin(b,U)}else _||u9(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=D})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Fo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(JV),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&s9(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let b=0;b<this.path.length;b++){const _=this.path[b];_.shouldResetTransform=!0,_.updateScroll("snapshot"),_.options.layoutRoot&&_.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const S=this.getTransformTemplate();this.prevTransformTemplateValue=S?S(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(r9);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(o9);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(KV),this.nodes.forEach(LV),this.nodes.forEach(PV)):this.nodes.forEach(o9),this.clearAllSnapshots();const p=Ai.now();wa.delta=Vr(0,1e3/60,p-wa.timestamp),wa.timestamp=p,wa.isProcessing=!0,Xv.update.process(wa),Xv.preRender.process(wa),Xv.render.process(wa),wa.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,SS.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(XV),this.sharedNodes.forEach(FV)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,hn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){hn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!hi(this.snapshot.measuredBox.x)&&!hi(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=fa(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(p=!1),p&&this.instance){const m=s(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!u)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!$7(this.projectionDelta),m=this.getTransformTemplate(),S=m?m(this.latestValues,""):void 0,b=S!==this.prevTransformTemplateValue;f&&this.instance&&(p||Tc(this.latestValues)||b)&&(u(this.instance,S),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return f&&(m=this.removeTransform(m)),$V(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:f}=this.options;if(!f)return fa();const p=f.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(tG))){const{scroll:S}=this.root;S&&(_h(p.x,S.offset.x),_h(p.y,S.offset.y))}return p}removeElementScroll(f){const p=fa();if(cl(p,f),this.scroll?.wasRoot)return p;for(let m=0;m<this.path.length;m++){const S=this.path[m],{scroll:b,options:_}=S;S!==this.root&&b&&_.layoutScroll&&(b.wasRoot&&cl(p,f),_h(p.x,b.offset.x),_h(p.y,b.offset.y))}return p}applyTransform(f,p=!1){const m=fa();cl(m,f);for(let S=0;S<this.path.length;S++){const b=this.path[S];!p&&b.options.layoutScroll&&b.scroll&&b!==b.root&&xh(m,{x:-b.scroll.offset.x,y:-b.scroll.offset.y}),Tc(b.latestValues)&&xh(m,b.latestValues)}return Tc(this.latestValues)&&xh(m,this.latestValues),m}removeTransform(f){const p=fa();cl(p,f);for(let m=0;m<this.path.length;m++){const S=this.path[m];if(!S.instance||!Tc(S.latestValues))continue;HS(S.latestValues)&&S.updateSnapshot();const b=fa(),_=S.measurePageBox();cl(b,_),I7(p,S.latestValues,S.snapshot?S.snapshot.layoutBox:void 0,b)}return Tc(this.latestValues)&&I7(p,this.latestValues),p}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==wa.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){const p=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=p.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=p.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=p.isSharedProjectionDirty);const m=!!this.resumingFrom||this!==p;if(!(f||m&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:b,layoutId:_}=this.options;if(!this.layout||!(b||_))return;this.resolvedRelativeTargetAt=wa.timestamp;const x=this.getClosestProjectingParent();x&&this.linkedParentVersion!==x.layoutVersion&&!x.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(x&&x.layout?this.createRelativeTarget(x,this.layout.layoutBox,x.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=fa(),this.targetWithTransforms=fa()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),oV(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):cl(this.target,this.layout.layoutBox),o7(this.target,this.targetDelta)):cl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?this.createRelativeTarget(x,this.target,x.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||HS(this.parent.latestValues)||s7(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(f,p,m){this.relativeParent=f,this.linkedParentVersion=f.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fa(),this.relativeTargetOrigin=fa(),gg(this.relativeTargetOrigin,p,m),cl(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const f=this.getLead(),p=!!this.resumingFrom||this!==f;let m=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(m=!1),p&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(m=!1),this.resolvedRelativeTargetAt===wa.timestamp&&(m=!1),m)return;const{layout:S,layoutId:b}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(S||b))return;cl(this.layoutCorrected,this.layout.layoutBox);const _=this.treeScale.x,x=this.treeScale.y;bB(this.layoutCorrected,this.treeScale,this.path,p),f.layout&&!f.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(f.target=f.layout.layoutBox,f.targetWithTransforms=fa());const{target:D}=f;if(!D){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(J7(this.prevProjectionDelta.x,this.projectionDelta.x),J7(this.prevProjectionDelta.y,this.projectionDelta.y)),x0(this.projectionDelta,this.layoutCorrected,D,this.latestValues),(this.treeScale.x!==_||this.treeScale.y!==x||!i9(this.projectionDelta.x,this.prevProjectionDelta.x)||!i9(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",D))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){if(this.options.visualElement?.scheduleRender(),f){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Dh(),this.projectionDelta=Dh(),this.projectionDeltaWithTransform=Dh()}setAnimationOrigin(f,p=!1){const m=this.snapshot,S=m?m.latestValues:{},b={...this.latestValues},_=Dh();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const x=fa(),D=m?m.source:void 0,A=this.layout?this.layout.source:void 0,N=D!==A,R=this.getStack(),O=!R||R.members.length<=1,U=!!(N&&!O&&this.options.crossfade===!0&&!this.path.some(IV));this.animationProgress=0;let j;this.mixTargetDelta=V=>{const J=V/1e3;c9(_.x,f.x,J),c9(_.y,f.y,J),this.setTargetDelta(_),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gg(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),kV(this.relativeTarget,this.relativeTargetOrigin,x,J),j&&UV(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=fa()),cl(j,this.relativeTarget)),N&&(this.animationValues=b,NV(b,S,this.latestValues,J,U,O)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=J},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Fo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=hn.update(()=>{vg.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Th(0)),this.currentAnimation=_V(this.motionValue,[0,1e3],{...f,velocity:0,isSync:!0,onUpdate:p=>{this.mixTargetDelta(p),f.onUpdate&&f.onUpdate(p)},onStop:()=>{},onComplete:()=>{f.onComplete&&f.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(GV),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:p,target:m,layout:S,latestValues:b}=f;if(!(!p||!m||!S)){if(this!==f&&this.layout&&S&&m9(this.options.animationType,this.layout.layoutBox,S.layoutBox)){m=this.target||fa();const _=hi(this.layout.layoutBox.x);m.x.min=f.target.x.min,m.x.max=m.x.min+_;const x=hi(this.layout.layoutBox.y);m.y.min=f.target.y.min,m.y.max=m.y.min+x}cl(p,m),xh(p,b),x0(this.projectionDeltaWithTransform,this.layoutCorrected,p,b)}}registerSharedNode(f,p){this.sharedNodes.has(f)||this.sharedNodes.set(f,new BV),this.sharedNodes.get(f).add(p);const S=p.options.initialPromotionConfig;p.promote({transition:S?S.transition:void 0,preserveFollowOpacity:S&&S.shouldPreserveFollowOpacity?S.shouldPreserveFollowOpacity(p):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){const{layoutId:f}=this.options;return f?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:f}=this.options;return f?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:p,preserveFollowOpacity:m}={}){const S=this.getStack();S&&S.promote(this,m),f&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let p=!1;const{latestValues:m}=f;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const S={};m.z&&KS("z",f,S,this.animationValues);for(let b=0;b<XS.length;b++)KS(`rotate${XS[b]}`,f,S,this.animationValues),KS(`skew${XS[b]}`,f,S,this.animationValues);f.render();for(const b in S)f.setStaticValue(b,S[b]),this.animationValues&&(this.animationValues[b]=S[b]);f.scheduleRender()}applyProjectionStyles(f,p){if(!this.instance||this.isSVG)return;if(!this.isVisible){f.visibility="hidden";return}const m=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,f.visibility="",f.opacity="",f.pointerEvents=pg(p?.pointerEvents)||"",f.transform=m?m(this.latestValues,""):"none";return}const S=this.getLead();if(!this.projectionDelta||!this.layout||!S.target){this.options.layoutId&&(f.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,f.pointerEvents=pg(p?.pointerEvents)||""),this.hasProjected&&!Tc(this.latestValues)&&(f.transform=m?m({},""):"none",this.hasProjected=!1);return}f.visibility="";const b=S.animationValues||S.latestValues;this.applyTransformsToTarget();let _=VV(this.projectionDeltaWithTransform,this.treeScale,b);m&&(_=m(b,_)),f.transform=_;const{x,y:D}=this.projectionDelta;f.transformOrigin=`${x.origin*100}% ${D.origin*100}% 0`,S.animationValues?f.opacity=S===this?b.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:b.opacityExit:f.opacity=S===this?b.opacity!==void 0?b.opacity:"":b.opacityExit!==void 0?b.opacityExit:0;for(const A in _S){if(b[A]===void 0)continue;const{correct:N,applyTo:R,isCSSVariable:O}=_S[A],U=_==="none"?b[A]:N(b[A],S);if(R){const j=R.length;for(let V=0;V<j;V++)f[R[V]]=U}else O?this.options.visualElement.renderState.vars[A]=U:f[A]=U}this.options.layoutId&&(f.pointerEvents=S===this?pg(p?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>f.currentAnimation?.stop()),this.root.nodes.forEach(r9),this.root.sharedNodes.clear()}}}function LV(n){n.updateLayout()}function PV(n){const t=n.resumeFrom?.snapshot||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=n.layout,{animationType:u}=n.options,c=t.source!==n.layout.source;u==="size"?xs(b=>{const _=c?t.measuredBox[b]:t.layoutBox[b],x=hi(_);_.min=i[b].min,_.max=_.min+x}):m9(u,t.layoutBox,i)&&xs(b=>{const _=c?t.measuredBox[b]:t.layoutBox[b],x=hi(i[b]);_.max=_.min+x,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[b].max=n.relativeTarget[b].min+x)});const f=Dh();x0(f,i,t.layoutBox);const p=Dh();c?x0(p,n.applyTransform(s,!0),t.measuredBox):x0(p,i,t.layoutBox);const m=!$7(f);let S=!1;if(!n.resumeFrom){const b=n.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:_,layout:x}=b;if(_&&x){const D=fa();gg(D,t.layoutBox,_.layoutBox);const A=fa();gg(A,i,x.layoutBox),n9(D,A)||(S=!0),b.options.layoutRoot&&(n.relativeTarget=A,n.relativeTargetOrigin=D,n.relativeParent=b)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:p,layoutDelta:f,hasLayoutChanged:m,hasRelativeLayoutChanged:S})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function YV(n){n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function qV(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function XV(n){n.clearSnapshot()}function r9(n){n.clearMeasurements()}function o9(n){n.isLayoutDirty=!1}function KV(n){const{visualElement:t}=n.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),n.resetTransform()}function u9(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function QV(n){n.resolveTargetDelta()}function ZV(n){n.calcProjection()}function JV(n){n.resetSkewAndRotation()}function FV(n){n.removeLeadSnapshot()}function c9(n,t,i){n.translate=Cn(t.translate,0,i),n.scale=Cn(t.scale,1,i),n.origin=t.origin,n.originPoint=t.originPoint}function f9(n,t,i,s){n.min=Cn(t.min,i.min,s),n.max=Cn(t.max,i.max,s)}function kV(n,t,i,s){f9(n.x,t.x,i.x,s),f9(n.y,t.y,i.y,s)}function IV(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const WV={duration:.45,ease:[.4,0,.1,1]},h9=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),d9=h9("applewebkit/")&&!h9("chrome/")?Math.round:Cs;function p9(n){n.min=d9(n.min),n.max=d9(n.max)}function $V(n){p9(n.x),p9(n.y)}function m9(n,t,i){return n==="position"||n==="preserve-aspect"&&!rV(a9(t),a9(i),.2)}function tG(n){return n!==n.root&&n.scroll?.wasRoot}const eG=l9({attachResizeListener:(n,t)=>T0(n,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),QS={current:void 0},g9=l9({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!QS.current){const n=new eG({});n.mount(window),n.setOptions({layoutScroll:!0}),QS.current=n}return QS.current},resetTransform:(n,t)=>{n.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),nG={pan:{Feature:TV},drag:{Feature:EV,ProjectionNode:g9,MeasureLayout:P7}};function y9(n,t,i){const{props:s}=n;n.animationState&&s.whileHover&&n.animationState.setActive("whileHover",i==="Start");const u="onHover"+i,c=s[u];c&&hn.postRender(()=>c(t,C0(t)))}class aG extends $o{mount(){const{current:t}=this.node;t&&(this.unmount=zU(t,(i,s)=>(y9(this.node,s,"Start"),u=>y9(this.node,u,"End"))))}unmount(){}}class iG extends $o{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=f0(T0(this.node.current,"focus",()=>this.onFocus()),T0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function v9(n,t,i){const{props:s}=n;if(n.current instanceof HTMLButtonElement&&n.current.disabled)return;n.animationState&&s.whileTap&&n.animationState.setActive("whileTap",i==="Start");const u="onTap"+(i==="End"?"":i),c=s[u];c&&hn.postRender(()=>c(t,C0(t)))}class sG extends $o{mount(){const{current:t}=this.node;t&&(this.unmount=UU(t,(i,s)=>(v9(this.node,s,"Start"),(u,{success:c})=>v9(this.node,u,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ZS=new WeakMap,JS=new WeakMap,lG=n=>{const t=ZS.get(n.target);t&&t(n)},rG=n=>{n.forEach(lG)};function oG({root:n,...t}){const i=n||document;JS.has(i)||JS.set(i,{});const s=JS.get(i),u=JSON.stringify(t);return s[u]||(s[u]=new IntersectionObserver(rG,{root:n,...t})),s[u]}function uG(n,t,i){const s=oG(t);return ZS.set(n,i),s.observe(n),()=>{ZS.delete(n),s.unobserve(n)}}const cG={some:0,all:1};class fG extends $o{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:i,margin:s,amount:u="some",once:c}=t,f={root:i?i.current:void 0,rootMargin:s,threshold:typeof u=="number"?u:cG[u]},p=m=>{const{isIntersecting:S}=m;if(this.isInView===S||(this.isInView=S,c&&!S&&this.hasEnteredView))return;S&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",S);const{onViewportEnter:b,onViewportLeave:_}=this.node.getProps(),x=S?b:_;x&&x(m)};return uG(this.node.current,f,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:i}=this.node;["amount","margin","root"].some(hG(t,i))&&this.startObserver()}unmount(){}}function hG({viewport:n={}},{viewport:t={}}={}){return i=>n[i]!==t[i]}const dG={...eV,...{inView:{Feature:fG},tap:{Feature:sG},focus:{Feature:iG},hover:{Feature:aG}},...nG,...{layout:{ProjectionNode:g9,MeasureLayout:P7}}},S9=yB(dG,OB),b9=({visible:n,target:t,appendTo:i=document.body,unmountWhenHidden:s=!1,transitionDuration:u=400,showTransitionOptions:c="easeInOut",hideTransitionOptions:f="linear",approveText:p="DONE",shown:m,hidden:S,isClickedWithin:b,children:_})=>{const[x,D]=H.useState(-1),[A,N]=H.useState(-1),[R,O]=H.useState(n),[U,j]=H.useState(!0),V=H.useRef(100),J=H.useRef(101),W=H.useRef(void 0),st=H.useRef(void 0),I=H.useRef(void 0),et=H.useRef(!1),nt=u/1e3;H.useEffect(()=>{t&&(W.current=xb(t));const gt=bb("zIndex",Tt=>Tt==="auto"||Tt==="-1"?!1:parseInt(Tt)>100).map(Tt=>parseInt(Tt,10));gt.length>0&&(V.current=Math.max(...gt)+1,J.current=Math.max(...gt)+2),j(!1),O(n)},[n,t]);const bt=gt=>{st.current=gt},rt=()=>{N(V.current),D(J.current),et.current=!0},dt=()=>{if(!st.current)return;m?.();let gt;W.current&&(gt=[W.current]);const Tt=Pt=>{Pt?b?.():(j(!1),O(!1))};I.current=Cb(st.current,Tt,gt)},pt=()=>{I.current&&_b(I.current)},tt=()=>{N(-1),D(-1),S?.()},w=Q1(()=>{R?rt():pt()}),F=Q1(()=>{R?dt():tt(),j(!0)}),K={opacity:.5},at={opacity:0},St={opacity:1,pointerEvents:"auto"},$={opacity:0,pointerEvents:"none"};return et.current&&!R&&s===!0&&U?null:vT.createPortal(X.jsxs("div",{children:[X.jsx(S9.div,{className:"bsc:fixed bsc:left-0 bsc:top-0 bsc:h-full bsc:w-full bsc:bg-mono-dark-1",style:{zIndex:A},initial:!1,animate:R?K:at}),X.jsxs(S9.div,{ref:gt=>{gt&&bt(gt)},className:"dark:bsc-border-mono-light-1 bsc:fixed bsc:bottom-0 bsc:left-0 bsc:w-full bsc:bg-white bsc:dark:border-t bsc:dark:border-solid bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1",style:{zIndex:x},initial:!1,animate:R?St:$,transition:{duration:nt,ease:R?c:f},onAnimationStart:w,onAnimationComplete:F,children:[X.jsx("div",{className:"bsc:w-full",children:_}),X.jsx(X.Fragment,{children:X.jsx(Ql,{buttonType:"primary",fullWidth:!0,onClick:()=>O(!1),className:"bsc:text-xs bsc:font-bold",children:p})})]})]}),i)};var E9=(n=>(n[n.TopLeft=0]="TopLeft",n[n.TopRight=1]="TopRight",n[n.BottomLeft=2]="BottomLeft",n[n.BottomRight=3]="BottomRight",n))(E9||{}),T9=(n=>(n[n.TopLeft=0]="TopLeft",n[n.TopRight=1]="TopRight",n[n.BottomLeft=2]="BottomLeft",n[n.BottomRight=3]="BottomRight",n))(T9||{});class dn{static positionToTarget(t,i=2){const s=t.getBoundingClientRect();let u=0,c=0;const f=window.scrollY;switch(i){case 2:u=s.top+s.height+f,c=s.left;break;case 0:u=s.top+f,c=s.left;break;case 3:u=s.top+s.height+f,c=s.left+s.width;break;case 1:u=s.top+f,c=s.left+s.width}return{top:u,left:c}}static positionElementToTarget(t,i,s=0,u=2){let{left:c,top:f}=dn.positionToTarget(i,u);const p=t.getBoundingClientRect();switch(s){case 0:break;case 1:c=c-p.width;break;case 2:f=f-p.height;break;case 3:f=f-p.height,c=c-p.width;break}return{top:f,left:c}}static canPositionElementOnScreenWithTarget(t,i){const s=dn.getScreenDimensions(),u=t.getBoundingClientRect(),c=dn.positionElementToTarget(t,i,0,2);if(c.left+u.width<s.width&&c.top+u.height<s.height||dn.positionElementToTarget(t,i,1,3).left>=0&&c.top+u.height<s.height)return!0;const p=dn.positionElementToTarget(t,i,2,0);if(p.left+u.width<s.width&&p.top>=0)return!0;const m=dn.positionElementToTarget(t,i,3,1);return m.left>=0&&m.top>=0}static canPositionElementOnScreen(t){const i=dn.getScreenDimensions(),s=t.getBoundingClientRect();return s.width<=i.width&&s.height<=i.height}static positionElementToTargetOnScreen(t,i,s=0,u=2){const{left:c,top:f}=dn.positionElementToTarget(t,i,s,u),p=t.getBoundingClientRect(),m=dn.determineOffScreenLocation(p);if(m){if(s===0&&u===2){if(m.right&&!m.bottom)return dn.positionElementToTarget(t,i,1,3);if(m.bottom&&!m.right)return dn.positionElementToTarget(t,i,2,0);if(m.right&&m.bottom)return dn.positionElementToTarget(t,i,3,1)}else if(s===1&&u===3){if(m.left&&!m.bottom)return dn.positionElementToTarget(t,i,0,2);if(m.bottom&&!m.left)return dn.positionElementToTarget(t,i,3,1);if(m.left&&m.bottom)return dn.positionElementToTarget(t,i,2,0)}}return{top:f,left:c}}static determineOffScreenLocation(t){const i=dn.getScreenDimensions(),s={left:t.left<0,top:t.top<0,right:t.left+t.width>i.width,bottom:t.top+t.height>i.height};return s.left||s.top||s.right||s.bottom?s:void 0}static getScreenDimensions(){return{width:window.innerWidth,height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}}const C9=({visible:n,target:t,targetPosition:i=E9.BottomLeft,elementAlignment:s=T9.TopLeft,shouldTargetCloseOverlay:u=!0,shouldMatchTargetWidth:c=!1,shouldScrollCloseOverlay:f=!1,shouldCheckZIndex:p=!1,shouldRemainOnScreen:m=!1,unmountWhenHidden:S=!1,transitionDuration:b=400,showTransitionOptions:_="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:x="linear",shown:D,hidden:A,isClickedWithin:N,markupCreated:R,children:O})=>{const[U,j]=H.useState(-1),[V,J]=H.useState(n),[W,st]=H.useState(!1),I=H.useRef(!1),et=H.useRef(100),nt=H.useRef({left:0,top:0,width:0}),bt=H.useRef(void 0),rt=H.useRef(void 0),dt=H.useRef(void 0),pt=H.useRef(void 0),tt=H.useRef(void 0),w=H.useRef(void 0),F=H.useRef(!1),K=j4();H.useEffect(()=>(m===!0&&(w.current=new ResizeObserver(at)),()=>{m===!0&&(rt.current&&w.current?.unobserve(rt.current),w.current?.disconnect())}),[]),H.useEffect(()=>{if(t&&(bt.current=xb(t),f)){const Be=K?.isValidScrollableElement;dt.current=Sb(bt.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,Be),dt.current.tagName.toLowerCase()==="html"&&(dt.current=document)}if(p){const Be=bb("zIndex",At=>parseInt(At)>=100).map(At=>parseInt(At));Be.length>0&&(et.current=Math.max(...Be)+1)}n!==void 0&&J(n)},[t,n,f,p]);const at=Be=>{if(rt.current){const At=dn.getScreenDimensions(),ue=Be[Be.length-1].target,ta=ue.getBoundingClientRect(),ea=dn.determineOffScreenLocation(ta);if(ea){if(bt.current&&dn.canPositionElementOnScreenWithTarget(ue,bt.current)){const An=dn.positionElementToTargetOnScreen(rt.current,bt.current,s,i);nt.current={...nt.current,...An}}else ea.right?nt.current.left=At.width-ta.width:ea.left&&(nt.current.left=0),ea.bottom?nt.current.top=At.height-ta.height:ea.top&&(nt.current.top=0);St()}}},St=s0(()=>{I.current=!I.current,st(I.current)},20),$=()=>{j(et.current)},gt=()=>{if(!rt.current)return;D?.();let Be;!u&&bt.current&&(Be=[bt.current]);const At=ue=>{ue?N?.():J(!1)};pt.current=Cb(rt.current,At,Be),f&&(tt.current=uR(ue=>rt.current&&DH(ue,rt.current)&&J(!1),100,{leading:!0}),dt.current&&dt.current.addEventListener("scroll",tt.current)),F.current=!0},Tt=()=>{dt.current&&tt.current&&(dt.current.removeEventListener("scroll",tt.current),tt.current=void 0),pt.current&&_b(pt.current)},Pt=()=>{j(-1),A?.()},le=Be=>{if(m===!0&&rt.current&&w.current?.unobserve(rt.current),rt.current=Be,R?.(Be),bt.current){const At=dn.positionElementToTarget(rt.current,bt.current,s,i);nt.current={...At,width:bt.current.offsetWidth},m===!0&&(dn.canPositionElementOnScreenWithTarget(rt.current,bt.current)||dn.canPositionElementOnScreen(rt.current))&&w.current?.observe(rt.current)}},xn=Q1(()=>{V?$():Tt()}),xe=Q1(()=>{V?gt():Pt()}),Dn=H.useMemo(()=>V?{transition:`opacity ${b}ms ${_}`,pointerEvents:"auto",opacity:1}:{transition:`opacity ${b}ms ${x}`,pointerEvents:"none",opacity:0},[V]),ln=H.useMemo(()=>{const Be={top:`${nt.current.top}px`,left:`${nt.current.left}px`,zIndex:U};return c&&(Be.width=`${nt.current.width}px`),Be},[W,U,c]);return F.current&&!V&&S===!0?null:X.jsx("div",{onTransitionStart:xn,onTransitionEnd:xe,children:X.jsx("div",{className:"bsc:fixed bsc:border! bsc:border-solid! bsc:border-black bsc:bg-white bsc:shadow bsc:dark:border-mono-light-1 bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1",style:{...ln,...Dn},ref:Be=>{Be&&le(Be)},children:O})})};let Sg;const pG=new Uint8Array(16);function mG(){if(!Sg&&(Sg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Sg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Sg(pG)}const Ua=[];for(let n=0;n<256;++n)Ua.push((n+256).toString(16).slice(1));function gG(n,t=0){return Ua[n[t+0]]+Ua[n[t+1]]+Ua[n[t+2]]+Ua[n[t+3]]+"-"+Ua[n[t+4]]+Ua[n[t+5]]+"-"+Ua[n[t+6]]+Ua[n[t+7]]+"-"+Ua[n[t+8]]+Ua[n[t+9]]+"-"+Ua[n[t+10]]+Ua[n[t+11]]+Ua[n[t+12]]+Ua[n[t+13]]+Ua[n[t+14]]+Ua[n[t+15]]}const _9={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function yG(n,t,i){if(_9.randomUUID&&!n)return _9.randomUUID();n=n||{};const s=n.random||(n.rng||mG)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,gG(s)}class D0{static create(t){const i=[];let s=0;for(let u=0,c=t.formatParts.length;u<c;u++){const f=t.formatParts[u],p=s,m=p+f.characterCount;i.push({startPosition:p,endPosition:m,...f}),s=m}return i}}class vG{instanceCollection;formatPartList;inputSlotCollection;currentPartIndex=0;currentPartIndices=[];currentCursorPosition=0;highlightCursorPosition=0;currentCursorStartPosition=-1;currentCursorEndPosition=-1;inputElement;inputSelection=null;inputRange;textNode;constructor(t,i){this.instanceCollection=A0.getInstance(),this.formatPartList=D0.create(t),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(i,t)}get isSelection(){return this.inputRange!==void 0&&this.inputRange.startOffset!==this.inputRange.endOffset}get isAllSelected(){const t=this.inputSlotCollection.getLastSlot();return this.isSelection&&this.inputRange?.startOffset===0&&this.inputRange.endOffset===t.endPosition}getCursorPosition(){return this.currentCursorPosition}getCursorStartPosition(){return this.currentCursorStartPosition}getCursorEndPosition(){return this.currentCursorEndPosition}getCurrentPartIndex(){return this.currentPartIndex}getCurrentPartIndices(){return this.currentPartIndices}setInputElement(t){this.inputElement=t}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition>-1?this.currentCursorPosition:this.highlightCursorPosition)}setCursorPosition(t){this.setCursorSelection(t)}setCursorSelection(t,i){if(this.createInputRangeSelection(),this.inputRange&&this.textNode){let s,u,c=!0;i===void 0?(s=t,u=t):t<i?(s=t,u=i):(c=!1,s=i,u=t),this.inputRange.setStart(this.textNode,s),this.inputRange.setEnd(this.textNode,u),this.currentPartIndices=[],s===u?(this.currentCursorPosition=u,this.highlightCursorPosition=u,this.currentCursorStartPosition=-1,this.currentCursorEndPosition=-1,this.setPartIndexByCursorPosition()):(c?this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1?this.highlightCursorPosition=u:this.currentCursorStartPosition!==s?this.highlightCursorPosition=s:this.currentCursorEndPosition!==u&&(this.highlightCursorPosition=u):this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1?this.highlightCursorPosition=s:this.currentCursorStartPosition!==u?this.highlightCursorPosition=u:this.currentCursorEndPosition!==s&&(this.highlightCursorPosition=s),this.currentCursorStartPosition=s,this.currentCursorEndPosition=u,this.currentCursorPosition=-1,this.setPartIndexByHighlightPosition(),this.setPartIndicesByCursorPositions())}}findCursorPosition(){const t=window.getSelection(),i=t?.getRangeAt(0);if(this.inputElement&&t&&i){const s=document.createTreeWalker(this.inputElement,NodeFilter.SHOW_TEXT,p=>{const m=document.createRange();return m.selectNodeContents(p),m.compareBoundaryPoints(Range.END_TO_END,i)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let u=0;for(;s.nextNode();)u+=s.currentNode.textContent?.length||0;i.startContainer.nodeType===Node.TEXT_NODE&&(u+=i.startOffset);const c=this.inputSlotCollection.getLastSlotWithData(),f=c.startPosition+c.partText.length;t.anchorOffset===t.focusOffset?this.setCursorSelection(u>f?f:u):this.setCursorSelection(t.anchorOffset,t.focusOffset)}}isAtLastPart(){return this.currentPartIndex===this.formatPartList.length-1}moveHome(){const t=this.inputSlotCollection.getFirstSlot();this.setCursorSelection(t.startPosition)}moveEnd(){const t=this.inputSlotCollection.getLastSlotWithData(),i=t.startPosition+t.partText.length;this.setCursorSelection(i)}moveCursorLeft(){if(this.updateCursorPosition(),this.currentCursorPosition>0&&!this.isSelection){const t=this.currentCursorPosition-1;let i=this.formatPartList[this.currentPartIndex];if(t>=i.startPosition&&t<=i.endPosition)this.setCursorSelection(t);else for(let s=this.currentPartIndex-1;s>=0;s--)if(i=this.formatPartList[s],t>=i.startPosition&&t<=i.endPosition){i.isSeparator?this.setCursorSelection(this.formatPartList[s-1].endPosition):this.setCursorSelection(t);break}}else this.isSelection?this.setCursorSelection(this.currentCursorPosition):this.moveHome()}moveCursorRight(){this.updateCursorPosition(!1);const t=this.inputSlotCollection.getLastSlotWithData(),i=t.startPosition+t.partText.length;if(this.currentCursorPosition<i&&!this.isSelection){const s=this.currentCursorPosition+1;let u=this.formatPartList[this.currentPartIndex];if(s>=u.startPosition&&s<=u.endPosition)this.setCursorSelection(s);else for(let c=this.currentPartIndex+1,f=this.formatPartList.length;c<f;c++)if(u=this.formatPartList[c],s>=u.startPosition&&s<=u.endPosition){u.isSeparator?this.setCursorSelection(this.formatPartList[c+1].startPosition):this.setCursorSelection(s);break}}else this.setCursorSelection(this.currentCursorPosition)}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const t=this.findNextEditablePart();t&&(this.currentPartIndex=t.partIndex,this.setCursorSelection(t.startPosition))}}moveToPreviousInputPart(){if(this.currentPartIndex>0){const t=this.findPreviousEditablePart();t&&(this.currentPartIndex=t.partIndex,this.setCursorSelection(t.endPosition))}}highlightAll(){const t=this.formatPartList[this.formatPartList.length-1].endPosition;this.setCursorSelection(0,t)}moveHighlightLeft(){this.updateHighlightPositions();const t=this.highlightCursorPosition>this.currentCursorStartPosition;if(this.currentCursorStartPosition>0||t){let i=t?this.currentCursorStartPosition:this.currentCursorStartPosition-1,s=t?this.highlightCursorPosition-1:this.currentCursorEndPosition,u=this.formatPartList[this.currentPartIndex];if(i>=u.startPosition&&i<=u.endPosition||t&&s>=u.startPosition&&s<=u.endPosition)this.setCursorSelection(i,s);else for(let c=this.currentPartIndex-1;c>=0;c--)if(u=this.formatPartList[c],i>=u.startPosition&&i<=u.endPosition||t&&s>=u.startPosition&&s<=u.endPosition){u.isSeparator?(t?s=this.formatPartList[c-1].endPosition:i=this.formatPartList[c-1].endPosition,this.setCursorSelection(i,s)):this.setCursorSelection(i,s);break}}}moveHighlightRight(){this.updateHighlightPositions();const t=this.inputSlotCollection.getLastSlotWithData(),i=t.startPosition+t.partText.length,s=this.highlightCursorPosition<this.currentCursorEndPosition;if(this.currentCursorEndPosition<i||s){let u=s?this.highlightCursorPosition+1:this.currentCursorStartPosition,c=s?this.currentCursorEndPosition:this.currentCursorEndPosition+1,f=this.formatPartList[this.currentPartIndex];if(c>=f.startPosition&&c<=f.endPosition||s&&u>=f.startPosition&&u<=f.endPosition)this.setCursorSelection(u,c);else for(let p=this.currentPartIndex+1,m=this.formatPartList.length;p<m;p++)if(f=this.formatPartList[p],c>=f.startPosition&&c<=f.endPosition||s&&u>=f.startPosition&&u<=f.endPosition){f.isSeparator?(s?u=this.formatPartList[p+1].startPosition:c=this.formatPartList[p+1].startPosition,this.setCursorSelection(u,c)):this.setCursorSelection(u,c);break}}}updateHighlightPositions(){this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1&&this.currentCursorPosition>-1&&(this.currentCursorStartPosition=this.currentCursorPosition,this.currentCursorEndPosition=this.currentCursorPosition,this.highlightCursorPosition=this.currentCursorPosition)}updateCursorPosition(t=!0){this.currentCursorPosition===-1&&this.currentCursorStartPosition>-1&&this.currentCursorEndPosition>-1&&(t?this.currentCursorPosition=this.currentCursorStartPosition:this.currentCursorPosition=this.currentCursorEndPosition)}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let t=0;t<this.formatPartList.length;t++){const i=this.formatPartList[t];if(this.currentCursorPosition>=i.startPosition&&this.currentCursorPosition<=i.endPosition){if(i.isSeparator){this.currentCursorPosition=this.formatPartList[t+1].startPosition,this.currentPartIndex=t+1;break}this.currentPartIndex=t;break}}}setPartIndexByHighlightPosition(){for(let t=0;t<this.formatPartList.length;t++){const i=this.formatPartList[t];if(this.highlightCursorPosition>=i.startPosition&&this.highlightCursorPosition<=i.endPosition){if(i.isSeparator){this.highlightCursorPosition=this.formatPartList[t+1].startPosition,this.currentPartIndex=t+1;break}this.currentPartIndex=t;break}}}setPartIndicesByCursorPositions(){for(let t=0,i=this.formatPartList.length;t<i;t++){const s=this.formatPartList[t];s.isSeparator||(s.startPosition>=this.currentCursorStartPosition&&s.startPosition<=this.currentCursorEndPosition||s.endPosition>=this.currentCursorStartPosition&&s.endPosition<=this.currentCursorEndPosition||s.startPosition<this.currentCursorStartPosition&&s.endPosition>this.currentCursorEndPosition)&&this.currentPartIndices.push(t)}}createInputRangeSelection(){this.inputElement&&(this.inputSelection=window.getSelection(),this.inputRange=document.createRange(),this.inputSelection?.removeAllRanges(),this.inputRange.selectNodeContents(this.inputElement),this.inputRange.collapse(!0),this.inputSelection?.addRange(this.inputRange),this.inputElement.firstChild&&(this.textNode=this.inputElement.firstChild))}}class SG{static create(t){const i=[];for(let s=0,u=t.length;s<u;s++){const c=t[s];c.isSeparator||i.push({partIndex:s,partText:"",isComplete:!1,...c})}return i}}class bG{inputSlots;constructor(t){this.inputSlots=SG.create(D0.create(t))}clearAllSlots(){for(let t=0,i=this.inputSlots.length;t<i;t++)this.inputSlots[t].partText=""}getSlot(t){return this.inputSlots.find(i=>i.partIndex===t)}getSlots(t){return this.inputSlots.filter(i=>t.includes(i.partIndex))}getSlotsFromCursorPosition(t){let i=-1;for(let s=0,u=this.inputSlots.length;s<u;s++){const c=this.inputSlots[s];if(t>=c.startPosition&&t<=c.endPosition){i=c.partIndex;break}}return i>-1?this.inputSlots.filter(s=>s.partIndex>=i):void 0}getFirstSlot(){return this.inputSlots[0]}getLastSlot(){return this.inputSlots[this.inputSlots.length-1]}getNextSlot(t){const i=this.inputSlots.findIndex(s=>s.partIndex===t);if(i>-1&&i+1<this.inputSlots.length)return this.inputSlots[i+1]}getPreviousSlot(t){const i=this.inputSlots.findIndex(s=>s.partIndex===t);if(i>-1&&i-1>=0)return this.inputSlots[i-1]}getLastSlotWithData(){const t=this.inputSlots.findIndex(s=>!s.isComplete);let i=t;for(let s=t+1,u=this.inputSlots.length;s<u;s++)this.inputSlots[s].partText.length>0&&(i=s);return this.inputSlots[i>-1?i:0]}allSlotsCompleted(){return this.inputSlots.every(t=>t.isComplete)}allSlotsEmpty(){return this.inputSlots.every(t=>t.partText.length===0)}}class A0{static instance;static getInstance(){return this.instance||(this.instance=new EG),this.instance}}class EG{navigatorInstances;inputSlotInstances;constructor(){this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(t,i){return this.navigatorInstances[t]||(this.navigatorInstances[t]=new vG(i,t)),this.navigatorInstances[t]}getInputSlotInstance(t,i){return this.inputSlotInstances[t]||(this.inputSlotInstances[t]=new bG(i)),this.inputSlotInstances[t]}removeInstances(t){this.navigatorInstances[t]&&delete this.navigatorInstances[t],this.inputSlotInstances[t]&&delete this.inputSlotInstances[t]}}class FS{instanceCollection;formatPartList;inputSlotCollection;inputElement;constructor(t,i){this.instanceCollection=A0.getInstance(),this.formatPartList=D0.create(t),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(i,t)}setInputElement(t){this.inputElement=t}render(){let t="";for(let i=0,s=this.formatPartList.length;i<s;i++){const u=this.formatPartList[i];if(u.isSeparator)t+=u.inputText;else{const c=this.inputSlotCollection.getSlot(i);c&&(t+=c.partText+c.inputText?.repeat(c.characterCount-c.partText.length))}}this.inputElement&&(this.inputElement.innerHTML=t)}}var Il=(n=>(n[n.Text=0]="Text",n[n.Numeric=1]="Numeric",n))(Il||{});class x9{numberKeys=["0","1","2","3","4","5","6","7","8","9"];movementKeys=["ArrowLeft","ArrowRight","Home","End","a"];editingKeys=["Backspace","Delete"];ignoreKeys=["Shift","Alt","Control","Fn","Meta"];isNumberKey(t){return this.numberKeys.includes(t)}isMovementKey(t){return this.movementKeys.includes(t.key)}isEditingKey(t){return this.editingKeys.includes(t.key)}isIgnoreKey(t){return this.ignoreKeys.includes(t.key)}}class TG{_currentIndex=0;index=0;formatParts;get currentIndex(){return this._currentIndex}constructor(t){this.formatParts=D0.create(t)}hasNext(){return this.index<this.formatParts.length}next(){if(this.index<this.formatParts.length)return this._currentIndex=this.index++,this.formatParts[this._currentIndex]}peek(){if(this.index<this.formatParts.length)return this.formatParts[this.index]}reset(){this.index=0}}class CG{formatParts;constructor(t){this.formatParts=D0.create(t)}getUniqueSeparators(){const t=[],i=this.formatParts.filter(s=>s.isSeparator);for(let s=0,u=i.length;s<u;s++){const c=i[s];c.inputText&&!t.includes(c.inputText)&&t.push(c.inputText)}return t}}class D9{constructor(t,i){this.format=t,this.instanceCollection=A0.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(i,t),this.formatNavigator=this.instanceCollection.getNavigatorInstance(i,t),this.keyTypeChecker=new x9,this.formatRenderer=new FS(t,i),this.formatPartList=new TG(t),this.partEntryList=new CG(t)}instanceCollection;inputSlotCollection;formatNavigator;keyTypeChecker;formatRenderer;formatPartList;partEntryList;setInputElement(t){this.formatRenderer.setInputElement(t)}processKeyPress(t){if(this.keyTypeChecker.isEditingKey(t)){this.processEditRules(t);return}this.formatNavigator.isSelection?(this.processSelectionEditRules(),setTimeout(()=>this.processInputRules(t))):this.processInputRules(t)}processInputValue(t){this.inputSlotCollection.clearAllSlots(),this.formatPartList.reset();let i=0;for(;this.formatPartList.hasNext();){const s=this.formatPartList.next();if(s&&!s.isSeparator)if(this.formatPartList.peek()?.isSeparator===!0){const u=this.formatPartList.currentIndex,c=this.formatPartList.next();if(c&&c.inputText){const f=t.indexOf(c.inputText,i),p=this.inputSlotCollection.getSlot(u);if(p&&f>-1){const m=f-i>p.characterCount?i+p.characterCount:f;p.partText=t.substring(i,m),this.processSlotRules(p),i=f+c.characterCount}}}else{const u=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);u&&(u.partText=t.substring(i,i+u.characterCount),this.processSlotRules(u))}}}processPastedValue(t,i=!1){i&&this.processSelectionEditRules();const s=this.formatNavigator.getCursorPosition(),u=this.inputSlotCollection.getSlotsFromCursorPosition(s);if(u){const c=s-u[0].startPosition,f=u[0].partText.substring(0,c);let p=u[0].partText.substring(c);u[0].partText="";for(let _=1,x=u.length;_<x;_++)p+=u[_].partText,u[_].partText="";const m=this.removeSeparatorsFromValue(t),S=f+m+p;let b=0;for(let _=0,x=u.length;_<x;_++){const D=u[_];D.partText=S.substring(b,D.characterCount+b),b+=D.characterCount,this.processSlotRules(D)}}}removeSeparatorsFromValue(t){let i=t;const s=this.partEntryList.getUniqueSeparators();for(let u=0,c=s.length;u<c;u++){const f=s[u];i=i.replaceAll(f,"")}return i}processEditRules(t){this.formatNavigator.isSelection?this.processSelectionEditRules():this.processNonSelectionEditRules(t)}processNonSelectionEditRules(t){const i=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!i)return;const s=this.formatNavigator.getCursorPosition(),u=s-i.startPosition,c=this.format.deleteShiftsFormatPart||!1;switch(t.key){case"Backspace":{if(!(i.startPosition===s))i.partText=i.partText.substring(0,u-1)+i.partText.substring(u),c&&this.shiftFormatParts(i),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(i,!0);else{this.processSlotRules(i,!0);const p=this.inputSlotCollection.getPreviousSlot(i.partIndex);p&&(p.partText=p.partText.substring(0,p.partText.length-1),c&&this.shiftFormatParts(p),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(p.startPosition+p.partText.length),this.processSlotRules(p,!0))}break}case"Delete":i.partText=i.partText.substring(0,u)+i.partText.substring(u+1),c&&this.shiftFormatParts(i),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(i,!0);break}}processSelectionEditRules(){const t=this.inputSlotCollection.getSlots(this.formatNavigator.getCurrentPartIndices());if(t.length<=0)return;const i=this.formatNavigator.getCursorStartPosition(),s=this.formatNavigator.getCursorEndPosition();for(let u=0,c=t.length;u<c;u++){const f=t[u];f.startPosition>=i&&f.endPosition<=s?f.partText="":f.startPosition>=i&&f.endPosition>s?f.partText=f.partText.substring(s-f.startPosition):f.startPosition<i&&f.endPosition<=s?f.partText=f.partText.substring(0,i-f.startPosition):f.startPosition<i&&f.endPosition>s&&(f.partText=f.partText.substring(0,i-f.startPosition)+f.partText.substring(s-f.startPosition))}this.formatRenderer.render(),this.formatNavigator.setCursorPosition(i);for(let u=0,c=t.length;u<c;u++)this.processSlotRules(t[u])}shiftFormatParts(t){let i=t,s;for(;(s=this.inputSlotCollection.getNextSlot(i.partIndex))!==void 0;){const u=s.partText.substring(0,1);s.partText=s.partText.substring(1),i.partText=i.partText+u,i=s}}processInputRules(t){const i=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!i)return;const{key:s}=t,u=i.characterCount,c=i.partText;if(i.valueType===Il.Numeric){if(!this.keyTypeChecker.isNumberKey(s))return;const f=i.maximumValue,p=i.exceedingMaximumValueCausesTab||!1,m=i.padWithZeros||!1,S=parseInt(this.createNewValue(i,s));if(f&&S>f)if(p){m&&(i.partText=i.partText.padStart(u,"0")),i.isComplete=!0;const b=this.inputSlotCollection.getNextSlot(i.partIndex);b&&!b.isComplete&&(b.partText=s),this.formatRenderer.render(),b&&this.formatNavigator.setCursorPosition(b.isComplete?b.startPosition:b.startPosition+1)}else return;else c.length+1===u?(this.addToInputSlot(s),i.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):c.length+1<u&&(this.addToInputSlot(s),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else c.length+1===u?(this.addToInputSlot(s),i.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):(this.addToInputSlot(s),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}addToInputSlot(t){const i=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());i&&(i.partText=this.createNewValue(i,t))}createNewValue(t,i){const s=t.partText,u=this.formatNavigator.getCursorPosition();if(u>=t.startPosition+t.partText.length)return s+i;{const c=u-t.startPosition;return s.substring(0,c)+i+s.substring(c)}}processSlotRules(t,i=!1){const s=t.characterCount,u=t.allCharactersRequired||!1;if(t.valueType===Il.Numeric){const c=t.minimumValue,f=t.maximumValue;if(u)t.isComplete=t.partText.length===s;else if(c!==void 0&&f!==void 0){const p=t.padWithZeros||!1,m=parseInt(t.partText);t.isComplete=m>=c&&m<=f,t.isComplete&&p&&!i&&(t.partText=t.partText.padStart(s,"0"))}else t.isComplete=t.partText.length>0}else u?t.isComplete=t.partText.length===s:t.isComplete=t.partText.length>0}}class _G{constructor(t,i){this.format=t,this.instanceCollection=A0.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(i,t),this.ruleProcessor=new D9(t,i),this.keyTypeChecker=new x9,this.formatRenderer=new FS(t,i)}instanceCollection;formatNavigator;ruleProcessor;keyTypeChecker;formatRenderer;setInputElement(t){this.ruleProcessor.setInputElement(t),this.formatRenderer.setInputElement(t)}processMovementKey(t){const{key:i,metaKey:s,ctrlKey:u,shiftKey:c}=t;switch(i){case"ArrowLeft":c?this.formatNavigator.moveHighlightLeft():s?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":c?this.formatNavigator.moveHighlightRight():s?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break;case"a":(s||u)&&this.formatNavigator.highlightAll();break}}processKeyPress(t){return this.keyTypeChecker.isIgnoreKey(t)?!1:this.keyTypeChecker.isMovementKey(t)?(this.processMovementKey(t),!1):(this.ruleProcessor.processKeyPress(t),!0)}}class xG{constructor(t,i=""){this.inputValue=i,this.instanceId=yG(),this.instanceCollection=A0.getInstance(),this.keyProcessor=new _G(t,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,t),this.formatRenderer=new FS(t,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,t),this.inputRuleProcessor=new D9(t,this.instanceId)}instanceId;instanceCollection;keyProcessor;formatNavigator;formatRenderer;inputSlotCollection;inputRuleProcessor;previousOutputValue="";inputElementSet=!1;isInputFocused=!1;inputElement;onFormatChange;inputElementCreated(t){this.keyProcessor.setInputElement(t),this.formatNavigator.setInputElement(t),this.formatRenderer.setInputElement(t),this.inputElement=t,this.inputElementSet=!0,this.inputElementSet&&this.inputValue.length>0&&this.inputValuePassed(this.inputValue)}inputFocused(){this.isInputFocused=!0,this.formatRenderer.render(),setTimeout(()=>this.formatNavigator.findCursorPosition())}inputBlurred(){this.isInputFocused=!1}inputValuePassed(t){this.inputValue=t,this.inputElementSet&&(this.inputValue.length>0?this.inputRuleProcessor.processInputValue(t):(this.inputSlotCollection.clearAllSlots(),this.previousOutputValue=void 0),this.renderFormat())}pastedValue(t){t.length>0&&(this.formatNavigator.isSelection?this.formatNavigator.isAllSelected?this.inputValuePassed(t):this.inputRuleProcessor.processPastedValue(t,!0):this.inputValue.length===0?this.inputValuePassed(t):this.inputRuleProcessor.processPastedValue(t),this.renderFormat(!0))}registerFormatChangeEvent(t){this.onFormatChange=t}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(t){if(t.key!=="Tab"){if(!(t.key==="c"&&(t.ctrlKey||t.metaKey))&&!(t.key==="x"&&(t.ctrlKey||t.metaKey))&&!(t.key==="v"&&(t.ctrlKey||t.metaKey)))t.preventDefault(),t.stopPropagation();else return;this.keyProcessor.processKeyPress(t)&&this.inputElement&&this.onFormatChange&&(this.inputSlotCollection.allSlotsCompleted()&&this.previousOutputValue!==this.inputElement.innerHTML?(this.previousOutputValue=this.inputElement.innerHTML,this.onFormatChange(this.inputElement.innerHTML)):this.inputSlotCollection.allSlotsEmpty()&&this.previousOutputValue!==void 0&&(this.previousOutputValue=void 0,this.onFormatChange()))}}dispose(){this.instanceCollection.removeInstances(this.instanceId)}renderFormat(t=!1){setTimeout(()=>{this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=this.inputElement?.innerHTML),t&&this.inputElement?.innerHTML&&this.onFormatChange&&this.onFormatChange(this.inputElement.innerHTML)})}}const DG=(n,t)=>{const{value:i="",format:s,readOnly:u=!1,debounceTime:c=800,fillContainer:f=!0,leftElement:p,rightElement:m,className:S,leftElementClassName:b,rightElementClassName:_,isSingleLine:x=!1,allowSingleLineScroll:D=!1,isInputValid:A,onChange:N,onFocus:R,onBlur:O,onElementCreate:U,onLeftElementClick:j,onRightElementClick:V}=n,[J,W]=H.useState(!0),st=H.useRef(void 0),I=H.useRef(void 0),et=H.useRef(void 0),nt=H.useRef(!1);H.useEffect(()=>(document.addEventListener("mouseup",w),()=>{et.current?.dispose(),document.removeEventListener("mouseup",w)}),[]),H.useEffect(()=>{et.current?.inputValuePassed(i)},[i]),H.useEffect(()=>{et.current?.dispose(),s&&(et.current=new xG(s,i),I.current&&et.current?.inputElementCreated(I.current),et.current?.registerFormatChangeEvent(bt))},[s]);const bt=H.useCallback(gt=>{A?A(gt)?(W(!0),N?.(gt)):W(!1):N?.(gt)},[N]),rt=H.useCallback(gt=>{et.current?.inputFocused(),R?.(gt)},[R]),dt=H.useCallback(gt=>{et.current?.inputBlurred(),O?.(gt)},[O]),pt=H.useCallback(()=>{nt.current=!0},[]),tt=H.useCallback(()=>{if(nt.current)nt.current=!1,et.current?.mouseUpHandler();else{const gt=new MouseEvent("mouseup");document.dispatchEvent(gt)}},[]),w=H.useCallback(()=>{nt.current&&(nt.current=!1,et.current?.mouseUpHandler())},[]),F=H.useCallback(gt=>{et.current?.keyDownHandler(gt)},[]),K=H.useCallback(gt=>{gt.preventDefault(),gt.stopPropagation();const Tt=gt.clipboardData?.getData("text/plain");Tt&&et.current?.pastedValue(Tt)},[]),at=H.useCallback(gt=>{st.current?.inputElement?.removeEventListener("keydown",F),st.current?.inputElement?.removeEventListener("mousedown",pt),st.current?.inputElement?.removeEventListener("mouseup",tt),st.current?.inputElement?.removeEventListener("paste",K),st.current=gt,st.current?.inputElement?.addEventListener("keydown",F),st.current?.inputElement?.addEventListener("mousedown",pt),st.current?.inputElement?.addEventListener("mouseup",tt),st.current?.inputElement?.addEventListener("paste",K),I.current=st.current?.inputElement},[]),St=H.useCallback(()=>{st.current?.focus()},[]);H.useImperativeHandle(t,()=>({focus:St}));const $=Se(S,{"bsc:border-error!":!J});return X.jsx($1,{ref:gt=>{gt&&at(gt)},readOnly:u,debounceTime:c,fillContainer:f,leftElement:p,rightElement:m,className:$,leftElementClassName:b,rightElementClassName:_,isSingleLine:x,allowSingleLineScroll:D,onFocus:rt,onBlur:dt,onElementCreate:U,onLeftElementClick:j,onRightElementClick:V})},A9=H.forwardRef(DG),kS=H.createContext(void 0);function M9(n,t,i=!0){const s=db(n),u=rb(n),c=rz(n);let f=Dv(u)-(t.options?.weekStartsOn||0);f=f===-1?6:f;const p=Dv(c)-(t.options?.weekStartsOn||0),m=gR({start:u,end:c}),S=s+f>35?6:5,b=N9(S,7,{dayValue:null,isCurrent:!0});let _=1;for(let x=0,D=S;x<D;x++){for(let A=x>0?0:f;A<7;A++){const N=m[_-1];if(N.setHours(n.getHours(),n.getMinutes(),n.getSeconds()),b[x][A].dayValue=N,++_>s)break}if(_>s)break}if(f>0&&i)for(let x=0;x<f;x++)b[0][x].dayValue=iH(u,f-x),b[0][x].isCurrent=!1;if(p>-1&&i)for(let x=6;x>p;x--)b[S-1][x].dayValue=ph(c,x-p),b[S-1][x].isCurrent=!1;return b}function N9(n,t,i){const s=[];for(let u=0,c=n;u<c;u++){const f=[];for(let p=0,m=t;p<m;p++){const S=AG(i)?i:{...i};f.push(S)}s.push(f)}return s}function AG(n){const t=typeof n;return t==="string"||t==="number"||t==="boolean"||n instanceof Date}function MG(n){const t=sH(new Date,n.options?.weekStartsOn||0),i=[];for(let s=0;s<7;s++)i.push(ph(t,s).toLocaleDateString(n.code,{weekday:"short"}));return i}function NG(n){const t=new Date(Date.UTC(2020,0,1)),i=[[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}]];let s=0;for(let u=0;u<3;u++)for(let c=0;c<4;c++)i[u][c]={monthNumber:s,monthName:Zo(t,s++).toLocaleDateString(n.code,{month:"short"})};return i}function OG(n,t){const i=new Date(n.getTime()),s=Math.floor(i.getFullYear()/10)*10;i.setFullYear(s);const u=yR({start:i,end:r0(i,9)}),c=N9(3,4,"");let f=0;for(let p=0;p<3;p++)for(let m=0;m<4&&(c[p][m]=u[f++].toLocaleDateString(t.code,{year:"numeric"}),f!==u.length);m++);return c}function RG(n){const t=new Date;return t.setHours(0,0,0,0),t.toLocaleTimeString(n.code)}function zG(n,t,i){return n.getTime()>=t.getTime()&&n.getTime()<=i.getTime()}function M0(n,t){const i=lH(n);if(isNaN(i.valueOf())){let s=Fl(n,"P pp",new Date,{locale:t});return!isNaN(s.valueOf())||(s=Fl(n,"Pp",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P HH:mm",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P hh:mm a..aaa",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P HH:mm:ss",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P hh:mm:ss a..aaa",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P p",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"pp",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"p",new Date,{locale:t}),!isNaN(s.valueOf()))?s:void 0}return i}function IS(n,t){const i=n.split("-");if(i.length!==2)return;const s=M0(i[0].trim(),t);if(!s)return;const u=M0(i[1].trim(),t);if(u)return[s,u]}var Qe=(n=>(n[n.DateTime=0]="DateTime",n[n.DateOnly=1]="DateOnly",n[n.TimeOnly=2]="TimeOnly",n[n.DateRange=3]="DateRange",n))(Qe||{}),Ta=(n=>(n[n.DaySelector=0]="DaySelector",n[n.MonthSelector=1]="MonthSelector",n[n.YearSelector=2]="YearSelector",n[n.TimeSelector=3]="TimeSelector",n[n.DateRangeSelector=4]="DateRangeSelector",n))(Ta||{}),Mh=(n=>(n[n.Day=0]="Day",n[n.Month=1]="Month",n[n.Year=2]="Year",n[n.Range=3]="Range",n))(Mh||{}),N0=(n=>(n[n.Short=0]="Short",n[n.Medium=1]="Medium",n[n.Long=2]="Long",n))(N0||{}),Gn=(n=>(n[n.TwelveHour=0]="TwelveHour",n[n.TwentyFourHour=1]="TwentyFourHour",n))(Gn||{}),tu=(n=>(n[n.Normal=0]="Normal",n[n.Range=1]="Range",n))(tu||{}),bg=(n=>(n[n.Right=0]="Right",n[n.Left=1]="Left",n[n.None=2]="None",n))(bg||{}),pe=(n=>(n[n.SetDateSelector=0]="SetDateSelector",n[n.SetViewDate=1]="SetViewDate",n[n.SetSelectedDate=2]="SetSelectedDate",n[n.SetSelectedDateRange=3]="SetSelectedDateRange",n[n.SetSelectedStartDate=4]="SetSelectedStartDate",n[n.SetSelectedEndDate=5]="SetSelectedEndDate",n[n.SetTimeFormat=6]="SetTimeFormat",n[n.ClearDates=7]="ClearDates",n[n.InitializeDates=8]="InitializeDates",n))(pe||{});const HG=(n,t)=>{switch(t.type){case 0:return t.dateSelector!==void 0?{...n,currentSelector:t.dateSelector,currentViewDate:t.viewDate||n.currentViewDate}:{...n};case 1:return{...n,currentViewDate:t.viewDate||new Date,dateInitialized:!0};case 2:return{...n,selectedDate:t.selectedDate||n.selectedDate,currentViewDate:t.viewDate||n.currentViewDate};case 3:return{...n,selectedStartDate:t.selectedStartDate||n.selectedStartDate,selectedEndDate:t.selectedEndDate||n.selectedEndDate};case 4:return{...n,selectedStartDate:t.selectedStartDate,selectedEndDate:void 0};case 5:return{...n,selectedEndDate:t.selectedEndDate};case 6:return{...n,timeFormat:t.timeFormat||n.timeFormat};case 7:return{currentSelector:n.currentSelector,currentViewDate:n.currentViewDate,timeFormat:n.timeFormat,dateInitialized:!0};case 8:{const i={...n,currentViewDate:wG(t.initialDate),dateInitialized:!0};return Array.isArray(t.initialDate)?{...i,selectedStartDate:t.initialDate[0],selectedEndDate:t.initialDate[1]}:{...i,selectedDate:t.initialDate}}default:return{...n,currentSelector:Ta.DaySelector}}};function wG(n){return n?Array.isArray(n)?n[0]:n:new Date}const WS=(n,t,i)=>{const s=H.useCallback(m=>{i({type:pe.SetViewDate,viewDate:Zo(t,m)})},[t]),u=H.useCallback(m=>{i({type:pe.SetViewDate,viewDate:Ov(t,m)})},[t]),c=H.useCallback(m=>{i({type:pe.SetViewDate,viewDate:r0(t,m)})},[t]),f=H.useCallback(m=>{i({type:pe.SetViewDate,viewDate:Rv(t,m)})},[t]),p=H.useCallback(m=>{i({type:pe.SetDateSelector,dateSelector:m})},[]);return{...n,incrementViewMonths:s,decrementViewMonths:u,incrementViewYears:c,decrementViewYears:f,setDateSelector:p}},Eg=({viewDate:n,selectedDate:t,selectedStartDate:i,selectedEndDate:s,selectionMode:u=tu.Normal,locale:c,onDateSelected:f,selectableDate:p,isValidDate:m,dispatcher:S})=>{const[b,_]=H.useState(!1),[x,D]=H.useState(),[A,N]=H.useState(),[R,O]=H.useState(),[U,j]=H.useState(),V=H.useRef(void 0),J=H.useRef(void 0),W=H.useContext(kS),st=H.useMemo(()=>W.calendarTemplate,[W.calendarTemplate]);H.useEffect(()=>{V.current=c,J.current=MG(V.current),_(!0)},[]),H.useEffect(()=>{n&&V.current&&O(M9(n,V.current,u===tu.Normal))},[n,b]),H.useEffect(()=>{j(t?new Date(t.getFullYear(),t.getMonth(),t.getDate()):void 0)},[t]),H.useEffect(()=>{D(i?new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,0).getTime():void 0),N(s?new Date(s.getFullYear(),s.getMonth(),s.getDate(),23,59,59).getTime():void 0)},[i,s]),H.useEffect(()=>{V.current&&c&&(V.current=c,O(M9(n,V.current,u===tu.Normal)))},[c]);const I=pt=>{if(u===tu.Normal)S?.({type:pe.SetSelectedDate,selectedDate:pt,viewDate:pt}),f?.(pt);else{if(!f)throw new Error("Range selection mode requires onDateSelected to be set");!i||oz(pt,i)?f(pt):i&&!s?f(pt,{setEndDate:!0}):i&&s&&f(pt)}},et=pt=>U?.toLocaleDateString()===pt.toLocaleDateString(),nt=pt=>{if(x&&A){const tt=pt.getTime();return tt>=x&&tt<=A}return!1},bt=WS({viewDate:n,selectedDate:t,selectedStartDate:i,selectedEndDate:s,selectionMode:u,locale:c,weekDays:J.current,monthMatrix:R,selectableDate:p,isValidDate:m,onDateClicked:I,isSelectedDate:et,isInSelectedDateRange:nt},n,S),dt=st||((pt,tt)=>X.jsx("div",{className:"bc-dt-calendar bsc:w-full",children:tt}));return X.jsx(vc,{props:bt,template:dt,children:X.jsxs("div",{className:"bc-dt-day-row bsc:grid bsc:min-w-[329px] bsc:grid-cols-7 bsc:gap-3",children:[J.current?.map((pt,tt)=>X.jsx("div",{className:"bc-dt-day-cell bsc:text-center bsc:font-bold",children:pt},tt)),R?.map((pt,tt)=>pt.map((w,F)=>{const K=w.dayValue!==null&&(p===void 0||p(w.dayValue)),at=Se("bsc:text-center bsc:py-1 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",{"bsc:text-gray-3":!w.isCurrent,"bsc:bg-primary-1 bsc:text-white bsc:dark:bg-mono-light-1 bsc:dark:text-mono-dark-1":w&&w.dayValue&&(U&&et(w.dayValue)||x&&!A&&lb(x,w.dayValue)||x&&A&&nt(w.dayValue)),"bsc:cursor-pointer":K,"bsc:text-error bsc:cursor-not-allowed":!K,"bsc:bg-primary-5 bsc:dark:bg-mono-light-3 bsc:dark:text-mono-dark-1":w.dayValue&&aH(w.dayValue)&&!(et(w.dayValue)||nt(w.dayValue))},"bc-dt-date-cell");return X.jsx("div",{className:at,onClick:()=>w&&w.dayValue&&K&&(m===void 0||m(w.dayValue))&&I(w.dayValue),children:w.dayValue?.getDate().toLocaleString(V.current?.code)},tt.toString()+F.toString())}))]})})},Tg=({title:n,scrollerType:t,onTitleClicked:i,onMovePrevious:s,onMoveNext:u,viewDate:c,dispatcher:f})=>{const m=H.useContext(kS).dateScrollerTemplate,S=WS({title:n,scrollerType:t,onTitleClicked:i,onMovePrevious:s,onMoveNext:u},c,f),b="bsc:bg-transparent bsc:cursor-pointer bsc:focus:outline-hidden bsc:hover:bg-primary-1! bsc:hover:text-white! bsc:dark:hover:bg-mono-light-3!",x=m||((D,A)=>X.jsx("div",{className:"bc-dt-scroller bsc:flex bsc:w-full bsc:flex-row bsc:items-center bsc:px-2 bsc:py-1",children:A}));return X.jsxs(vc,{props:S,template:x,children:[X.jsx("div",{className:"bc-dt-scroller-left bsc:shrink bsc:cursor-pointer",children:X.jsx(Ql,{className:b,onClick:s,children:X.jsx(Ts,{icon:"chevronLeft",size:ka.Regular})})}),X.jsx("div",{className:"bc-dt-scroller-title bsc:grow bsc:cursor-pointer bsc:text-center bsc:hover:text-primary-2 bsc:dark:hover:text-mono-light-3",onClick:i,children:n}),X.jsx("div",{className:"bc-dt-scroller-right bsc:shrink bsc:cursor-pointer",children:X.jsx(Ql,{className:b,onClick:u,children:X.jsx(Ts,{icon:"chevronRight",size:ka.Regular})})})]})},UG=({selectedDate:n,viewDate:t,locale:i,showTimeSelector:s,selectableDate:u,isValidDate:c,onChange:f,dispatcher:p})=>{const m=()=>{t&&p({type:pe.SetViewDate,viewDate:Ov(t,1)})},S=()=>{t&&p({type:pe.SetViewDate,viewDate:Zo(t,1)})},b=()=>{p({type:pe.SetDateSelector,dateSelector:Ta.MonthSelector})},_=()=>{p({type:pe.SetDateSelector,dateSelector:Ta.TimeSelector})},x=()=>t?t.toLocaleDateString(i.code,{month:"long",year:"numeric"}):"";return X.jsxs("div",{className:"bc-dt-day-selector bsc:p-2",children:[X.jsx(Tg,{title:x(),scrollerType:Mh.Day,onTitleClicked:b,onMovePrevious:m,onMoveNext:S,viewDate:t,dispatcher:p}),X.jsx(Eg,{viewDate:t,selectedDate:n,locale:i,selectableDate:u,isValidDate:c,onDateSelected:f,dispatcher:p}),s&&X.jsx("div",{className:"bc-dt-time-value-wrapper bsc:flex bsc:w-full bsc:flex-row bsc:justify-center bsc:p-2",children:X.jsx("div",{className:"bc-dt-time-value bsc:cursor-pointer bsc:p-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1 bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-2",onClick:_,children:n?.toLocaleTimeString(i.code)||RG(i)})})]})},BG=({viewDate:n,locale:t,dateSelection:i=Qe.DateTime,dispatcher:s})=>{const u=H.useRef(NG(t)),c=()=>{const b=Rv(n,1);s({type:pe.SetViewDate,viewDate:b})},f=()=>{const b=r0(n,1);s({type:pe.SetViewDate,viewDate:b})},p=b=>{s({type:pe.SetDateSelector,dateSelector:i!==Qe.DateRange?Ta.DaySelector:Ta.DateRangeSelector,viewDate:TH(n,b)})},m=()=>n.toLocaleDateString(t.code,{year:"numeric"}),S=()=>{s({type:pe.SetDateSelector,dateSelector:Ta.YearSelector})};return X.jsxs("div",{className:"bc-dt-month-selector bsc:p-2",style:{minWidth:"20rem"},children:[X.jsx(Tg,{title:m(),scrollerType:Mh.Month,onTitleClicked:S,onMovePrevious:c,onMoveNext:f,viewDate:n,dispatcher:s}),X.jsx("div",{className:"bc-dt-month-grid bsc:grid bsc:w-full bsc:grid-cols-4 bsc:gap-4",children:u.current.map((b,_)=>b.map((x,D)=>X.jsx("div",{className:"bc-dt-month-cell bsc:cursor-pointer bsc:text-center bsc:py-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",onClick:()=>p(x.monthNumber),children:x.monthName},_.toString()+D.toString())))})]})},VG=({viewDate:n,selectedStartDate:t,selectedEndDate:i,locale:s,onChange:u,dispatcher:c})=>{const f=ng("screen and (max-device-width: 40rem)"),p=Zo(n,1),m=(D,A)=>{!A||!A.setEndDate?c({type:pe.SetSelectedStartDate,selectedStartDate:D}):(c({type:pe.SetSelectedEndDate,selectedEndDate:D}),t&&u&&u([t,D]))},S=()=>{c({type:pe.SetDateSelector,dateSelector:Ta.MonthSelector})},b=()=>f?`${n.toLocaleDateString(s.code,{month:"long"})} ${n.toLocaleDateString(s.code,{year:"numeric"})}`:`${n.toLocaleDateString(s.code,{month:"long"})} ${n.toLocaleDateString(s.code,{year:"numeric"})} - ${p.toLocaleDateString(s.code,{month:"long"})} ${p.toLocaleDateString(s.code,{year:"numeric"})}`,_=()=>{n&&c({type:pe.SetViewDate,viewDate:Ov(n,1)})},x=()=>{n&&c({type:pe.SetViewDate,viewDate:Zo(n,1)})};return X.jsxs("div",{className:"bc-dt-range-selector bsc:flex bsc:flex-col",children:[X.jsx("div",{className:"bc-dt-range-scroller-wrapper bsc:shrink",children:X.jsx(Tg,{title:b(),scrollerType:Mh.Range,onTitleClicked:S,onMovePrevious:_,onMoveNext:x,viewDate:n,dispatcher:c})}),X.jsx("div",{className:"bsc-flex-grow",children:X.jsx(Hv,{mobileMarkup:X.jsx("div",{className:"bc-dt-range-calendar bsc:px-2 bsc:py-1",children:X.jsx(Eg,{viewDate:n,selectedStartDate:t,selectedEndDate:i,selectionMode:tu.Range,onDateSelected:m,locale:s,dispatcher:c})}),aboveMobileMarkup:X.jsxs("div",{className:"bc-dt-range-wrapper bsc:flex bsc:flex-row bsc:px-2 bsc:py-1",children:[X.jsx("div",{className:"bc-dt-range-calendar-1 bsc:border-r bsc:border-solid bsc:border-gray-3 bsc:pr-4",children:X.jsx(Eg,{viewDate:n,selectedStartDate:t,selectedEndDate:i,selectionMode:tu.Range,onDateSelected:m,locale:s,dispatcher:c})}),X.jsx("div",{className:"bc-dt-range-calendar-2 bsc:pl-4",children:X.jsx(Eg,{viewDate:p,selectedStartDate:t,selectedEndDate:i,selectionMode:tu.Range,onDateSelected:m,locale:s,dispatcher:c})})]})})})]})},GG=({viewDate:n,showDateSelector:t,locale:i,timeFormat:s=Gn.TwelveHour,timeConstraints:u,onChange:c,dispatcher:f})=>{const p=H.useRef(s===Gn.TwelveHour?11:23),m=H.useRef(s===Gn.TwelveHour?["12","01","02","03","04","05","06","07","08","09","10","11"]:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]),S=H.useRef(xH(0,59,pt=>pt.toString().padStart(2,"0"))),b=H.useRef(["AM","PM"]),_=H.useRef(iR(n)),x=pt=>pt>11?pt-12:pt,[D,A]=H.useState(x(n.getHours())),[N,R]=H.useState(n.getMinutes()),[O,U]=H.useState(n.getHours()<=12?0:1),j=H.useRef(n.toLocaleDateString(i.code));H.useEffect(()=>{const pt=n.getHours(),tt=n.getMinutes();if(pt!==D&&A(s===Gn.TwelveHour?x(pt):pt),tt!==N&&R(tt),s===Gn.TwelveHour){const w=pt<=11?0:1;w!==O&&U(w)}},[n]);const V=()=>{const pt=u?.hours?.step||1,tt=D<p.current?D+pt:0;A(tt),et(tt,N,O)},J=()=>{const pt=u?.hours?.step||1,tt=D>0?D-pt:p.current;A(tt),et(tt,N,O)},W=()=>{const pt=u?.minutes?.step||1,tt=N+pt<(u?.minutes?.max||59)?N+pt:u?.minutes?.min||0;R(tt),et(D,tt,O)},st=()=>{const pt=u?.minutes?.step||1,tt=N-pt>=(u?.minutes?.min||0)?N-pt:(u?.minutes?.max||60)-pt;R(tt),et(D,tt,O)},I=()=>{const pt=O===0?1:0;U(pt),et(D,N,pt)},et=(pt,tt,w)=>{const F=s===Gn.TwelveHour&&w===1?pt+12:pt;_.current.setHours(F,tt),f({type:pe.SetSelectedDate,selectedDate:_.current,viewDate:_.current}),c?.(_.current)},nt=()=>{f({type:pe.SetDateSelector,dateSelector:Ta.DaySelector})},bt=Se("bsc:w-full bsc:grid bsc:grid-rows-3 bsc:gap-4 bsc:items-center bc-dt-time-grid",{"bsc:grid-cols-4":s===Gn.TwelveHour,"bsc:grid-cols-3":s===Gn.TwentyFourHour}),rt=Se("bsc:text-center bsc:cursor-pointer bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:text-mono-light-1 bsc:dark:hover:bg-mono-light-1 bsc:dark:hover:text-mono-dark-1 bc-dt-time-date-value",{"bsc:col-span-4":s===Gn.TwelveHour,"bsc:col-span-3":s===Gn.TwentyFourHour}),dt="bsc-bg-transparent bsc:p-2 bsc:cursor-pointer bsc:focus:outline-hidden bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-1 bsc:dark:hover:text-mono-dark-1";return X.jsx("div",{className:"bc-dt-time-selector bsc:flex bsc:flex-row bsc:justify-center bsc:p-2",style:{minWidth:s===Gn.TwelveHour?"15rem":"11rem"},children:X.jsxs("div",{className:bt,children:[t&&X.jsx("div",{className:rt,onClick:nt,children:j.current}),X.jsx("div",{className:"bc-dt-time-hour-increase bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:V,children:X.jsx(Ts,{icon:"chevronUp",size:ka.Regular})})}),X.jsx("div",{}),X.jsx("div",{className:"bc-dt-time-minute-increase bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:W,children:X.jsx(Ts,{icon:"chevronUp",size:ka.Regular})})}),s===Gn.TwelveHour&&X.jsx("div",{className:"bc-dt-time-meridian-increase bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:I,children:X.jsx(Ts,{icon:"chevronUp",size:ka.Regular})})}),X.jsx("div",{className:"bc-dt-time-hour-value bsc:text-center",children:m.current[D]}),X.jsx("div",{className:"bc-dt-time-separator bsc:text-center",children:":"}),X.jsx("div",{className:"bc-dt-time-minute-value bsc:text-center",children:S.current[N]}),s===Gn.TwelveHour&&X.jsx("div",{className:"bc-dt-time-meridian-value bsc:text-center",children:b.current[O]}),X.jsx("div",{className:"bc-dt-time-hour-decrease bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:J,children:X.jsx(Ts,{icon:"chevronDown",size:ka.Regular})})}),X.jsx("div",{}),X.jsx("div",{className:"bc-dt-time-minute-decrease bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:st,children:X.jsx(Ts,{icon:"chevronDown",size:ka.Regular})})}),s===Gn.TwelveHour&&X.jsx("div",{className:"bc-dt-time-meridian-decrease bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:I,children:X.jsx(Ts,{icon:"chevronDown",size:ka.Regular})})})]})})},jG=({viewDate:n,locale:t,dispatcher:i})=>{const s=OG(n,t),u=()=>{const m=Rv(n,10);i({type:pe.SetViewDate,viewDate:m})},c=()=>{const m=r0(n,10);i({type:pe.SetViewDate,viewDate:m})},f=m=>{const S=parseInt(m);i({type:pe.SetDateSelector,dateSelector:Ta.MonthSelector,viewDate:CH(n,S)})},p=()=>`${s[0][0].toString()} - ${s[2][1].toString()}`;return X.jsxs("div",{className:"bc-dt-year-selector bsc:p-2",style:{minWidth:"20rem"},children:[X.jsx(Tg,{title:p(),scrollerType:Mh.Year,onMovePrevious:u,onMoveNext:c,viewDate:n,dispatcher:i}),X.jsx("div",{className:"bc-dt-year-wrapper bsc:w-full",children:X.jsx("div",{className:"bc-dt-year-grid bsc:grid bsc:grid-cols-4 bsc:gap-4",children:s.map((m,S)=>m.map((b,_)=>b.length>0?X.jsx("div",{className:"bc-dt-year-cell bsc:cursor-pointer bsc:text-center bsc:py-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",onClick:()=>f(b),children:b},S.toString()+_.toString()):X.jsx("div",{},S.toString()+_.toString())))})})]})};class LG{constructor(t,i){this.dateSelection=t;const s=2023,u=12,c=20,p=new Date(s,u-1,c).toLocaleDateString(i,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=p.replace(`${s}`,"YYYY").replace(`${u}`,"MM").replace(`${c}`,"DD");const m=new Date,S=18,b=24,_=37,x=317;m.setHours(S,b,_,x);const D=m.toLocaleTimeString(i);this.use24HourTime=D.startsWith("18"),this.timeFormat=D.replace(`${this.use24HourTime?S:"6"}`,"HH").replace(`${b}`,"MM").replace(`${_}`,"SS").replace(`${x}`,"LLL"),this.createDateParts()}dateFormat;timeFormat;use24HourTime;monthPart;dayPart;yearPart;twelveHourPart;twentyFourHourPart;minutePart;meridianPart;get is24HourTime(){return this.use24HourTime}createInputFormat(){const t={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case Qe.DateOnly:return this.createDateFormat(t);case Qe.TimeOnly:return this.createTimeFormat(t);case Qe.DateRange:return this.createDateRangeFormat(t);case Qe.DateTime:return this.createDateTimeFormat(t)}}createDateFormat(t){return this.dateFormat.startsWith("MM")?t.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.formatParts.push(...this.createDayMonthYearFormatParts()):t.formatParts.push(...this.createYearMonthDayFormatParts()),t}createTimeFormat(t){return this.use24HourTime?t.formatParts.push(...this.createTwentyFourHourFormatParts()):t.formatParts.push(...this.createTwelveHourFormatParts()),t}createDateRangeFormat(t){const i=[];this.dateFormat.startsWith("MM")?i.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?i.push(...this.createDayMonthYearFormatParts()):i.push(...this.createYearMonthDayFormatParts());const s={characterCount:3,placeholder:" - ",inputText:" - ",isSeparator:!0};return t.formatParts.push(...i,s,...i),t}createDateTimeFormat(t){this.dateFormat.startsWith("MM")?t.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.formatParts.push(...this.createDayMonthYearFormatParts()):t.formatParts.push(...this.createYearMonthDayFormatParts());const i={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return t.formatParts.push(i),this.use24HourTime?t.formatParts.push(...this.createTwentyFourHourFormatParts()):t.formatParts.push(...this.createTwelveHourFormatParts()),t}createMonthDayYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("MM",""),i=t.indexOf("DD"),s=t.substring(0,i);t=t.replace(s,"").replace("DD","");const u={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};i=t.indexOf("YYYY"),s=t.substring(0,i);const c={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};return[this.monthPart,u,this.dayPart,c,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("DD",""),i=t.indexOf("MM"),s=t.substring(0,i);t=t.replace(s,"").replace("MM","");const u={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};i=t.indexOf("YYYY"),s=t.substring(0,i);const c={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};return[this.dayPart,u,this.monthPart,c,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("YYYY",""),i=t.indexOf("MM"),s=t.substring(0,i);t=t.replace(s,"").replace("MM","");const u={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};i=t.indexOf("DD"),s=t.substring(0,i);const c={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};return[this.yearPart,u,this.monthPart,c,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const t=this.timeFormat.replace("HH",""),i=t.indexOf("MM"),s=t.substring(0,i),u={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0},c={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,u,this.minutePart,c,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const t=this.timeFormat.replace("HH",""),i=t.indexOf("MM"),s=t.substring(0,i),u={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};return[this.twentyFourHourPart,u,this.minutePart]}return[]}createDateParts(){this.monthPart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Il.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.dayPart={characterCount:2,placeholder:"D",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Il.Numeric,minimumValue:1,maximumValue:31,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.yearPart={characterCount:4,placeholder:"Y",inputText:"_",isSeparator:!1,allCharactersRequired:!0,valueType:Il.Numeric},this.twelveHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Il.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.twentyFourHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Il.Numeric,minimumValue:0,maximumValue:23,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.minutePart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Il.Numeric,minimumValue:0,maximumValue:59,exceedingMaximumValueCausesError:!0,padWithZeros:!0},this.meridianPart={characterCount:2,inputText:"_",isSeparator:!1,valueType:Il.Text,possibleValues:["AM","PM"]}}}const PG=(n,t)=>{const[i,s]=H.useState(),u=H.useRef(void 0);return H.useEffect(()=>{t&&!i&&(u.current=new LG(n,t),s(u.current.createInputFormat()))},[t]),[i,u.current?.is24HourTime]},YG=({value:n,readOnly:t=!1,label:i,useDefaultDateValue:s=!1,useFormattedInput:u=!1,allowClear:c=!1,closeSelector:f=!1,locale:p,className:m,dateSelection:S=Qe.DateTime,dateFormat:b,timeConstraints:_,icon:x,iconPosition:D=bg.Right,inputElement:A,selectableDate:N,isValidDate:R,onChange:O,onError:U,calendarTemplate:j,dateScrollerTemplate:V,inputTemplate:J,wrapperTemplate:W})=>{const[st,I]=H.useState(!1),[et,nt]=H.useState(),[bt,rt]=H.useState(),[dt,pt,tt]=OD(S),w=H.useRef(void 0),F=H.useRef(!1),K=H.useRef(p||_H()),at=H.useRef(void 0),St=H.useRef(void 0),$=H.useRef(void 0),gt=H.useRef(null),Tt=H.useRef(null),[Pt,le]=PG(S,et),xn=yT.useDateLocale(K.current),xe=H.useRef({calendarTemplate:j,dateScrollerTemplate:V});H.useEffect(()=>{nt(xn.code),at.current=xn;const Ht=ln();ue(n||s?{type:pe.InitializeDates,initialDate:Array.isArray(Ht)?Ht[0]:Ht}:{type:pe.SetViewDate,viewDate:Array.isArray(Ht)?Ht[0]:Ht})},[xn]),H.useEffect(()=>{if(n){const Ht=ln();ue({type:pe.InitializeDates,initialDate:Ht})}else ue({type:pe.ClearDates})},[n,at.current]),H.useEffect(()=>{le&&ue({type:pe.SetTimeFormat,timeFormat:le?Gn.TwentyFourHour:Gn.TwelveHour})},[le]),H.useEffect(()=>{A&&(St.current=A)},[A]),H.useEffect(()=>{ue({type:pe.SetDateSelector,dateSelector:Dn()})},[dt]);const Dn=H.useCallback(()=>tt.current===Qe.TimeOnly?Ta.TimeSelector:tt.current===Qe.DateTime||tt.current===Qe.DateOnly?Ta.DaySelector:Ta.DateRangeSelector,[]),ln=()=>{const Ht=new Date;return Ht.setHours(0,0,0,0),n?typeof n=="string"?tt.current!==Qe.DateRange?M0(n,at.current):IS(n,at.current):n:Ht},Be={currentSelector:Dn(),currentViewDate:new Date,timeFormat:Gn.TwelveHour,dateInitialized:!1},[At,ue]=H.useReducer(HG,Be),ta=()=>{Mi(),I(!0)},ea=H.useMemo(()=>s0(()=>{I(!1)},250),[]),An=H.useMemo(()=>s0(()=>{ea.cancel()},5),[ea]),Ba=Ht=>{const ge=Ht.target.innerText;Ji(ge)},pn=Ht=>{if(Ht){const ge=tt.current!==Qe.DateRange?M0(Ht,at.current):IS(Ht,at.current);if(ge)if(R){const qr=Array.isArray(ge)?ge.every(Wl=>R(Wl)):R(ge);return!qr&&U&&U(ge),qr}else return!0;else return!1}else return!0},ha=Ht=>{Ji(Ht||"")},Ji=Ht=>{const ge=tt.current!==Qe.DateRange?M0(Ht,at.current):IS(Ht,at.current);ge?(Array.isArray(ge)?(zG(ge[0],rb(At.currentViewDate),mR(Zo(At.currentViewDate,1)))||ue({type:pe.SetViewDate,viewDate:ge[0]}),ue({type:pe.SetSelectedDateRange,selectedStartDate:ge[0],selectedEndDate:ge[1]})):ue({type:pe.SetSelectedDate,selectedDate:ge,viewDate:ge}),O?.(ge)):Ht===""&&(ue({type:pe.ClearDates}),O?.())},di=Ht=>{tt.current===Qe.DateOnly&&f===!0&&I(!1),O?.(Ht)},Fi=()=>{Mi(),I(!st),Tt.current?Tt.current.focus():gt.current&>.current.focus()},Mn=()=>{ue({type:pe.ClearDates}),I(!1),O?.()},rn=(Ht,ge)=>{(!St.current||w.current!==ge)&&(St.current=Ht,w.current=ge,F.current=!0)},Mi=()=>{(!$.current||F.current)&&St.current&&($.current=St.current,rt(St.current),F.current=!1)},Ut=()=>{I(!1),ue({type:pe.SetDateSelector,dateSelector:Dn()})},Ae=()=>{switch(b){case N0.Short:return"short";case N0.Medium:return"medium";case N0.Long:return"long";default:return}},jn=()=>{const Ht=Ae();switch(tt.current){case Qe.DateTime:return At.selectedDate?Ht?At.selectedDate.toLocaleString(at.current?.code,{dateStyle:Ht,timeStyle:Ht}):At.selectedDate.toLocaleString(at.current?.code):"";case Qe.DateOnly:return At.selectedDate?Ht?At.selectedDate.toLocaleDateString(at.current?.code,{dateStyle:Ht}):At.selectedDate.toLocaleDateString(at.current?.code):"";case Qe.TimeOnly:return At.selectedDate?Ht?At.selectedDate.toLocaleTimeString(at.current?.code,{timeStyle:Ht,hour12:At.timeFormat===Gn.TwelveHour,hourCycle:At.timeFormat===Gn.TwentyFourHour?"h23":void 0}):At.selectedDate.toLocaleTimeString(at.current?.code,{hour12:At.timeFormat===Gn.TwelveHour,hourCycle:At.timeFormat===Gn.TwentyFourHour?"h23":void 0}):"";case Qe.DateRange:return At.selectedStartDate&&At.selectedEndDate?Ht?`${At.selectedStartDate.toLocaleDateString(at.current?.code,{dateStyle:Ht})} - ${At.selectedEndDate.toLocaleDateString(at.current?.code,{dateStyle:Ht})}`:`${At.selectedStartDate.toLocaleDateString(at.current?.code)} - ${At.selectedEndDate.toLocaleDateString(at.current?.code)}`:"";default:return At.selectedDate?Ht?At.selectedDate.toLocaleString(at.current?.code,{dateStyle:Ht,timeStyle:Ht}):At.selectedDate.toLocaleString(at.current?.code):""}},Va=dt===Qe.DateTime||dt===Qe.DateOnly||dt===Qe.DateRange,ke=dt===Qe.DateTime||dt===Qe.TimeOnly,mn=D===bg.None?{}:D===bg.Right?{rightElement:X.jsxs("div",{className:"bsc:flex bsc:text-black bsc:dark:text-mono-light-1",children:[c&&!t&&X.jsx("div",{children:X.jsx(Ts,{icon:"close",size:ka.Small,className:"bsc:cursor-pointer bsc:text-sm",onClick:Mn})}),X.jsx("div",{className:"bsc:ml-2",onClick:t?void 0:Fi,children:x||X.jsx(Ts,{icon:"calendar",size:ka.Small,className:t?void 0:"bsc:cursor-pointer"})})]}),rightElementClassName:"bsc:justify-center"}:{leftElement:X.jsxs("div",{className:"bsc:flex bsc:text-black bsc:dark:text-mono-light-1",children:[X.jsx("div",{className:"bsc:mr-2",onClick:t?void 0:Fi,children:x||X.jsx(Ts,{icon:"calendar",size:ka.Small,className:t?void 0:"bsc:cursor-pointer"})}),c&&!t&&X.jsx("div",{children:X.jsx(Ts,{icon:"close",size:ka.Small,className:"bsc:cursor-pointer bsc:text-sm",onClick:Mn})})]}),leftElementClassName:"bsc:justify-center"},eu={setDateSelector:Ht=>pt(Ht)},nu=W||((Ht,ge)=>X.jsx(X.Fragment,{children:ge})),da=()=>X.jsx(vc,{props:eu,template:nu,children:X.jsxs(X.Fragment,{children:[At.currentSelector===Ta.DaySelector&&Va&&At.dateInitialized&&at.current&&X.jsx(UG,{selectedDate:At.selectedDate,viewDate:At.currentViewDate,locale:at.current,showTimeSelector:tt.current===Qe.DateTime,selectableDate:N,isValidDate:R,dispatcher:ue,onChange:di}),At.currentSelector===Ta.MonthSelector&&Va&&At.dateInitialized&&at.current&&X.jsx(BG,{viewDate:At.currentViewDate,locale:at.current,dateSelection:tt.current,dispatcher:ue}),At.currentSelector===Ta.YearSelector&&Va&&At.dateInitialized&&at.current&&X.jsx(jG,{viewDate:At.currentViewDate,locale:at.current,dispatcher:ue}),At.currentSelector===Ta.TimeSelector&&ke&&At.dateInitialized&&at.current&&X.jsx(GG,{viewDate:At.currentViewDate,showDateSelector:tt.current===Qe.DateTime,locale:at.current,timeFormat:At.timeFormat,timeConstraints:_,onChange:O,dispatcher:ue}),At.currentSelector===Ta.DateRangeSelector&&Va&&At.dateInitialized&&at.current&&X.jsx(VG,{viewDate:At.currentViewDate,selectedStartDate:At.selectedStartDate,selectedEndDate:At.selectedEndDate,locale:at.current,onChange:O,dispatcher:ue})]})}),Pr=WS({label:i,readOnly:t,allowClear:c,getValue:jn,onFocus:ta,onInput:Ba,iconPosition:D,iconElement:mn.rightElement||mn.leftElement},At.currentViewDate,ue),Yr=J||((Ht,ge)=>X.jsx(X.Fragment,{children:ge})),au=Se("bsc:text-left",{"bc-read-only bsc:bg-gray-4 bsc:dark:bg-mono-dark-3":t,"bsc:bg-white bsc:dark:bg-mono-dark-1":!t},"bc-dt-input",m);return X.jsx(kS.Provider,{value:xe.current,children:X.jsxs("div",{className:"bc-date-time",children:[i&&X.jsx(wr,{label:i,readOnly:t,className:"bc-dt-label"}),X.jsx(Hv,{mobileMarkup:X.jsxs(X.Fragment,{children:[X.jsx(vc,{props:Pr,template:Yr,children:X.jsx($1,{ref:gt,value:jn(),readOnly:t,inputMode:"none",className:au,onFocus:ta,onElementCreate:Ht=>rn(Ht,!1),...mn})}),X.jsx(b9,{visible:st,target:bt,hidden:Ut,unmountWhenHidden:!0,children:da()})]}),aboveMobileMarkup:X.jsxs(X.Fragment,{children:[X.jsx(vc,{props:Pr,template:Yr,children:u===!1?X.jsx($1,{ref:gt,value:jn(),readOnly:t,className:au,onFocus:ta,onBlur:ea,onInput:Ba,onElementCreate:Ht=>rn(Ht,!1),...mn}):X.jsx(A9,{ref:Tt,value:jn(),readOnly:t,className:au,format:Pt,isInputValid:pn,onFocus:ta,onBlur:ea,onChange:ha,onElementCreate:Ht=>rn(Ht,!0),...mn})}),X.jsx(C9,{visible:st,target:bt,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:Ut,isClickedWithin:An,unmountWhenHidden:!1,children:da()})]})})]})})};var $S,O9;function qG(){if(O9)return $S;O9=1;function n(D,A){var N,R;if(typeof A=="function")R=A(D),R!==void 0&&(D=R);else if(Array.isArray(A))for(N=0;N<A.length;N++)R=A[N](D),R!==void 0&&(D=R);return D}function t(D,A){return D[0]==="-"&&Array.isArray(A)&&/^-\d+$/.test(D)?A.length+parseInt(D,10):D}function i(D){return/^\d+$/.test(D)}function s(D){return Object.prototype.toString.call(D)==="[object Object]"}function u(D){return Object(D)===D}function c(D){return Object.keys(D).length===0}var f=["__proto__","prototype","constructor"],p=function(D){return f.indexOf(D)===-1};function m(D,A){D.indexOf("[")>=0&&(D=D.replace(/\[/g,A).replace(/]/g,""));var N=D.split(A),R=N.filter(p);if(R.length!==N.length)throw Error("Refusing to update blacklisted property "+D);return N}var S=Object.prototype.hasOwnProperty;function b(D,A,N,R){if(!(this instanceof b))return new b(D,A,N,R);typeof A>"u"&&(A=!1),typeof N>"u"&&(N=!0),typeof R>"u"&&(R=!0),this.separator=D||".",this.override=A,this.useArray=N,this.useBrackets=R,this.keepArray=!1,this.cleanup=[]}var _=new b(".",!1,!0,!0);function x(D){return function(){return _[D].apply(_,arguments)}}return b.prototype._fill=function(D,A,N,R){var O=D.shift();if(D.length>0){if(A[O]=A[O]||(this.useArray&&i(D[0])?[]:{}),!u(A[O]))if(this.override)A[O]={};else{if(!(u(N)&&c(N)))throw new Error("Trying to redefine `"+O+"` which is a "+typeof A[O]);return}this._fill(D,A[O],N,R)}else{if(!this.override&&u(A[O])&&!c(A[O])){if(!(u(N)&&c(N)))throw new Error("Trying to redefine non-empty obj['"+O+"']");return}A[O]=n(N,R)}},b.prototype.object=function(D,A){var N=this;return Object.keys(D).forEach(function(R){var O=A===void 0?null:A[R],U=m(R,N.separator).join(N.separator);U.indexOf(N.separator)!==-1?(N._fill(U.split(N.separator),D,D[R],O),delete D[R]):D[R]=n(D[R],O)}),D},b.prototype.str=function(D,A,N,R){var O=m(D,this.separator).join(this.separator);return D.indexOf(this.separator)!==-1?this._fill(O.split(this.separator),N,A,R):N[D]=n(A,R),N},b.prototype.pick=function(D,A,N,R){var O,U,j,V,J;for(U=m(D,this.separator),O=0;O<U.length;O++)if(V=t(U[O],A),A&&typeof A=="object"&&V in A){if(O===U.length-1)return N?(j=A[V],R&&Array.isArray(A)?A.splice(V,1):delete A[V],Array.isArray(A)&&(J=U.slice(0,-1).join("."),this.cleanup.indexOf(J)===-1&&this.cleanup.push(J)),j):A[V];A=A[V]}else return;return N&&Array.isArray(A)&&(A=A.filter(function(W){return W!==void 0})),A},b.prototype.delete=function(D,A){return this.remove(D,A,!0)},b.prototype.remove=function(D,A,N){var R;if(this.cleanup=[],Array.isArray(D)){for(R=0;R<D.length;R++)this.pick(D[R],A,!0,N);return N||this._cleanup(A),A}else return this.pick(D,A,!0,N)},b.prototype._cleanup=function(D){var A,N,R,O;if(this.cleanup.length){for(N=0;N<this.cleanup.length;N++)R=this.cleanup[N].split("."),O=R.splice(0,-1).join("."),A=O?this.pick(O,D):D,A=A[R[0]].filter(function(U){return U!==void 0}),this.set(this.cleanup[N],A,D);this.cleanup=[]}},b.prototype.del=b.prototype.remove,b.prototype.move=function(D,A,N,R,O){return typeof R=="function"||Array.isArray(R)?this.set(A,n(this.pick(D,N,!0),R),N,O):(O=R,this.set(A,this.pick(D,N,!0),N,O)),N},b.prototype.transfer=function(D,A,N,R,O,U){return typeof O=="function"||Array.isArray(O)?this.set(A,n(this.pick(D,N,!0),O),R,U):(U=O,this.set(A,this.pick(D,N,!0),R,U)),R},b.prototype.copy=function(D,A,N,R,O,U){return typeof O=="function"||Array.isArray(O)?this.set(A,n(JSON.parse(JSON.stringify(this.pick(D,N,!1))),O),R,U):(U=O,this.set(A,this.pick(D,N,!1),R,U)),R},b.prototype.set=function(D,A,N,R){var O,U,j,V;if(typeof A>"u")return N;for(j=m(D,this.separator),O=0;O<j.length;O++){if(V=j[O],O===j.length-1)if(R&&s(A)&&s(N[V]))for(U in A)S.call(A,U)&&(N[V][U]=A[U]);else if(R&&Array.isArray(N[V])&&Array.isArray(A))for(var J=0;J<A.length;J++)N[j[O]].push(A[J]);else N[V]=A;else(!S.call(N,V)||!s(N[V])&&!Array.isArray(N[V]))&&(/^\d+$/.test(j[O+1])?N[V]=[]:N[V]={});N=N[V]}return N},b.prototype.transform=function(D,A,N){return A=A||{},N=N||{},Object.keys(D).forEach((function(R){this.set(D[R],this.pick(R,A),N)}).bind(this)),N},b.prototype.dot=function(D,A,N){A=A||{},N=N||[];var R=Array.isArray(D);return Object.keys(D).forEach((function(O){var U=R&&this.useBrackets?"["+O+"]":O;if(u(D[O])&&(s(D[O])&&!c(D[O])||Array.isArray(D[O])&&!this.keepArray&&D[O].length!==0))if(R&&this.useBrackets){var j=N[N.length-1]||"";return this.dot(D[O],A,N.slice(0,-1).concat(j+U))}else return this.dot(D[O],A,N.concat(U));else R&&this.useBrackets?A[N.join(this.separator).concat("["+O+"]")]=D[O]:A[N.concat(U).join(this.separator)]=D[O]}).bind(this)),A},b.pick=x("pick"),b.move=x("move"),b.transfer=x("transfer"),b.transform=x("transform"),b.copy=x("copy"),b.object=x("object"),b.str=x("str"),b.set=x("set"),b.delete=x("delete"),b.del=b.remove=x("remove"),b.dot=x("dot"),["override","overwrite"].forEach(function(D){Object.defineProperty(b,D,{get:function(){return _.override},set:function(A){_.override=!!A}})}),["useArray","keepArray","useBrackets"].forEach(function(D){Object.defineProperty(b,D,{get:function(){return _[D]},set:function(A){_[D]=A}})}),b._process=n,$S=b,$S}var XG=qG();const R9=X2(XG),KG=({name:n,label:t,value:i,data:s,textField:u,valueField:c,readOnly:f=!1,orientation:p=Za.Horizontal,isMultiSelect:m=!1,className:S,onChange:b,itemTemplate:_})=>{const[x,D]=H.useState(),[A,N]=H.useState([]),R=tv(()=>s,[s]),O=H.useId();H.useEffect(()=>{if(m){const rt=Array.isArray(i)?i.map(dt=>dt.toString()):i?[String(i)]:void 0;N(rt??[])}else i&&D(i.toString())},[i]);const U=rt=>m?A.findIndex(dt=>dt===rt)>-1:x===rt,j=rt=>{const dt=rt.toString();if(m){const pt=U(dt);let tt;pt?tt=A.filter(w=>w!=dt):tt=[...A,dt],N(tt),b?.({name:n,value:tt})}else dt!==x&&(D(dt),b?.({name:n,value:dt}))},V=rt=>{Array.isArray(rt?.value)?N(rt?.value??[]):D(rt?.value),b?.(rt)},J=kp(nh.FocusWithin),W=H.useCallback((rt,dt)=>X.jsx(X.Fragment,{children:dt}),[]),st=_||W,I=(rt,dt,pt)=>{const tt=`element_${O}_${dt}`,w=R9.pick(u,rt),F=String(R9.pick(c,rt)),K=dt===0,at=dt===pt.length-1,St=Se("bc-group-button-item bsc:cursor-pointer bsc:border-solid bsc:p-2 bsc:font-medium",{"bsc:has-data-checked:bg-primary-1 bsc:dark:has-data-checked:bg-mono-light-1 bsc:has-data-checked:text-white bsc:dark:has-data-checked:text-mono-dark-1 bsc:dark:text-mono-light-1 bsc:text-gray-2 bsc:border-gray-3 bsc:dark:border-mono-light-2":!f,"bc-read-only bsc:has-data-checked:bg-primary-4 bsc:dark:has-data-checked:bg-mono-light-3 bsc:has-data-checked:text-gray-5 bsc:dark:has-data-checked:text-mono-dark-3 bsc:dark:text-mono-light-3 bsc:text-gray-3 bsc:border-gray-4 bsc:dark:border-mono-light-3 bsc:pointer-events-none":f,"bsc:border-t bsc:border-l bsc:border-b bsc:rounded-l-md bsc:pl-2":K&&p===Za.Horizontal,"bsc:border-t bsc:border-r bsc:border-l bsc:border-b bsc:rounded-r-md bsc:pr-2":at&&p===Za.Horizontal,"bsc:border-t bsc:border-b":!K&&!at&&p===Za.Horizontal,"bsc:border-l":!K&&p===Za.Horizontal,"bsc:border-l bsc:border-r bsc:border-t bsc:rounded-t-md":K&&p===Za.Vertical,"bsc:border bsc:rounded-b-md":at&&p===Za.Vertical,"bsc:border-t bsc:border-l bsc:border-r":!K&&!at&&p===Za.Vertical},J),$={itemId:tt,selectedValue:m?A:x,itemText:w,itemValue:F,itemData:rt,itemStyles:St,isSelected:U(F),isFirstItem:K,isLastItem:at,onItemChanged:j};return m?X.jsx(vc,{props:$,template:st,children:X.jsx(rh,{className:St,children:X.jsx(c6,{value:F,className:"bsc:block bsc:w-full bsc:cursor-pointer",children:w})})},tt):X.jsx(vc,{props:$,template:st,children:X.jsx(rh,{className:St,children:X.jsx(y6,{value:F,className:"bsc:block bsc:w-full bsc:cursor-pointer",children:w})})},tt)},et=Se("bsc:flex bsc:flex-col bsc:gap-2",S),nt=Se("bsc:flex",{"bsc:flex-col bsc:w-max":p===Za.Vertical}),bt=rt=>m?X.jsx(d6,{name:n,value:A,readOnly:f,onChange:V,className:nt,children:rt.map(I)}):X.jsx(g6,{name:n,value:x,readOnly:f,onChange:V,className:nt,children:rt.map(I)});return X.jsxs(rh,{className:et,children:[t&&X.jsx(wr,{label:t,readOnly:f}),R&&bt(R)]})},QG=H.memo(KG),ZG=({name:n,label:t,value:i,data:s,textField:u,valueField:c,readOnly:f=!1,labelLocation:p=Es.Right,orientation:m=Za.Vertical,className:S,useAnimation:b,onChange:_})=>{const x=tv(()=>s,[s]),D=H.useId(),A=hv(b),N=kp(nh.FocusWithin),R=Se("bc-radio-container bsc:flex bsc:flex-col bsc:gap-1",S),O=Se("bc-radio-wrapper bsc:flex bsc:gap-1",{"bsc:flex-col":m===Za.Vertical,"bsc:*:pr-2":m===Za.Horizontal}),U=Se("bc-radio-item-wrapper bsc:flex bsc:items-center bsc:*:cursor-pointer",{"bc-read-only":f}),j=Se("bc-radio-item bsc:group bsc:relative bsc:*:size-[21px] bsc:rounded-full",{"bsc:ml-2":p===Es.Left,"bsc:mr-2":p===Es.Right,"bc-read-only":f},N),V=Se("bc-radio-item-svg bsc:stroke-2 bsc:fill-none bsc:rounded-full bsc:stroke-gray-1 bsc:dark:stroke-mono-light-2 bsc:group-data-read-only:stroke-gray-4 bsc:dark:group-data-read-only:stroke-mono-light-3"),J=Se("bsc:group-data-checked:fill-primary-1 bsc:dark:group-data-checked:fill-mono-light-2 bsc:group-data-checked:group-data-read-only:fill-primary-4 bsc:dark:group-data-checked:group-data-read-only:fill-mono-light-3",{"bsc:group-data-checked:animate-bounce":!f&&A}),W=Se("bsc:invisible bsc:group-data-checked:visible bsc:group-data-checked:fill-white bsc:dark:group-data-checked:fill-mono-dark-1",{"bsc:group-data-checked:animate-bounce":!f&&A}),st=(I,et)=>{const nt=I[u],bt=I[c];return X.jsxs(rh,{className:U,children:[p===Es.Left&&X.jsx(wr,{label:nt,readOnly:f}),X.jsx(y6,{value:bt,className:j,children:X.jsxs("svg",{viewBox:"0 0 30 30",preserveAspectRatio:"xMidYMid meet",className:V,children:[X.jsx("circle",{cx:15,cy:15,r:15,className:J}),X.jsx("circle",{cx:"50%",cy:"50%",r:7,className:W})]})}),p===Es.Right&&X.jsx(wr,{label:nt,readOnly:f})]},`radio_${D}_item${et}`)};return X.jsxs("div",{className:R,children:[t&&X.jsx(wr,{label:t,readOnly:f}),X.jsx(g6,{name:n,value:i,readOnly:f,onChange:_,className:O,children:x&&x.map(st)})]})},JG=H.memo(ZG),FG=({name:n,label:t,value:i,checked:s=!1,readOnly:u=!1,useAnimation:c,className:f,onChange:p})=>{const m=hv(c),S=Se("bc-toggle-wrapper bsc:flex bsc:flex-col",f),b=kp(nh.FocusWithin),_=Se("bc-toggle-container bsc:group bsc:flex bsc:mt-0.5 bsc:relative bsc:w-[60px] bsc:h-[26px] bsc:rounded-full bsc:[transition:background-color_1s]",{"bsc:cursor-pointer bsc:bg-gray-3 bsc:dark:bg-mono-dark-3 bsc:has-checked:bg-primary-1 bsc:dark:has-checked:bg-mono-light-2":!u,"bc-read-only bsc:pointer-events-none bsc:bg-gray-4 bsc:dark:bg-mono-dark-2 bsc:has-checked:bg-primary-4 bsc:dark:has-checked:bg-mono-light-3":u},b),x=Se("bc-toggle-switch bsc:absolute bsc:rounded-full bsc:dark:border bsc:dark:border-solid bsc:dark:border-mono-dark-1 bsc:group-data-toggled:translate-x-[35px] bsc:w-[18px] bsc:h-[18px] bsc:top-[4px] bsc:left-[4px]",{"bsc:bg-white bsc:cursor-pointer":!u,"bc-read-only bsc:bg-gray-5 bsc:pointer-events-none":u,"bsc:[transition:0.3s]":!u&&m});return X.jsxs(rh,{className:S,children:[t&&X.jsx(wr,{label:t,readOnly:u}),X.jsx(SA,{name:n,value:i,toggled:s,onChange:p,className:_,children:X.jsx("div",{className:x})})]})},kG=H.memo(FG);$t.AvatarEditor=RD,$t.BeeSoftProvider=zD,$t.Button=Ql,$t.Checkbox=v6,$t.CheckboxGroup=TA,$t.ContentEditableInput=$1,$t.DateFormatType=N0,$t.DateScrollerType=Mh,$t.DateSelectionType=Qe,$t.DateTime=YG,$t.FormGroupItemOrientation=Za,$t.FormattedInput=A9,$t.GroupButton=QG,$t.MediaQuery=Hv,$t.MobileOverlayPanel=b9,$t.OverlayPanel=C9,$t.RadioButton=JG,$t.SelectionLabelLocation=Es,$t.Toggle=kG,$t.applyBeeSoftTheme=OH,$t.createBeeSoftTheme=RH,Object.defineProperty($t,Symbol.toStringTag,{value:"Module"})}));
|
|
234
|
+
<%s key={someKey} {...props} />`,Pt,xe,Dn,xe),St[xe+Pt]=!0)}if(xe=null,Tt!==void 0&&(i(Tt),xe=""+Tt),f(gt)&&(i(gt.key),xe=""+gt.key),"key"in gt){Tt={};for(var ln in gt)ln!=="key"&&(Tt[ln]=gt[ln])}else Tt=gt;return xe&&p(Tt,typeof W=="function"?W.displayName||W.name||"Unknown":W),S(W,xe,Tt,u(),le,xn)}function _(W){x(W)?W._store&&(W._store.validated=1):typeof W=="object"&&W!==null&&W.$$typeof===et&&(W._payload.status==="fulfilled"?x(W._payload.value)&&W._payload.value._store&&(W._payload.value._store.validated=1):W._store&&(W._store.validated=1))}function x(W){return typeof W=="object"&&W!==null&&W.$$typeof===A}var D=H,A=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),V=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),st=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),et=Symbol.for("react.lazy"),nt=Symbol.for("react.activity"),bt=Symbol.for("react.client.reference"),rt=D.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,dt=Object.prototype.hasOwnProperty,pt=Array.isArray,tt=console.createTask?console.createTask:function(){return null};D={react_stack_bottom_frame:function(W){return W()}};var w,F={},K=D.react_stack_bottom_frame.bind(D,c)(),at=tt(s(c)),St={};Z1.Fragment=R,Z1.jsx=function(W,gt,Tt){var Pt=1e4>rt.recentlyCreatedOwnerStacks++;return b(W,gt,Tt,!1,Pt?Error("react-stack-top-frame"):K,Pt?tt(s(W)):at)},Z1.jsxs=function(W,gt,Tt){var Pt=1e4>rt.recentlyCreatedOwnerStacks++;return b(W,gt,Tt,!0,Pt?Error("react-stack-top-frame"):K,Pt?tt(s(W)):at)}})()),Z1}var q4;function GD(){return q4||(q4=1,process.env.NODE_ENV==="production"?nv.exports=BD():nv.exports=VD()),nv.exports}var Ja=GD();function jD(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var X4,K4;function LD(){return K4||(K4=1,X4=function n(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;var s,u,c;if(Array.isArray(t)){if(s=t.length,s!=i.length)return!1;for(u=s;u--!==0;)if(!n(t[u],i[u]))return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if(c=Object.keys(t),s=c.length,s!==Object.keys(i).length)return!1;for(u=s;u--!==0;)if(!Object.prototype.hasOwnProperty.call(i,c[u]))return!1;for(u=s;u--!==0;){var f=c[u];if(!n(t[f],i[f]))return!1}return!0}return t!==t&&i!==i}),X4}var PD=LD();const YD=jD(PD),qD=()=>{throw new Error("useEvent should not be called before the component is mounted")},Wp=n=>{const t=H.useRef(qD);H.useInsertionEffect(()=>{t.current=n},[n]);const i=H.useRef(null);return i.current||(i.current=function(){return t.current?.apply(this,arguments)}),i.current},Q4=n=>{const t=H.useRef(void 0);let i=!1;t.current!==void 0&&(i=!YD(t.current,n));const s={changed:i,previousValue:t.current};return t.current=n,s},XD=n=>typeof n=="function",KD=n=>{const[t,i]=H.useState({value:n,initial:!0}),s=H.useRef(n);return[t,u=>{if(!XD(u))i({value:u,initial:!1});else{const c=u(s.current);s.current=c,i({value:c,initial:!1})}}]},QD=n=>{const[t,i]=KD(n),s=H.useRef({value:n,initial:!0});return s.current!==t&&(s.current=t),[t,i,s]},Z4=H.createContext(void 0),J1=()=>H.useContext(Z4),av=({id:n,name:t,value:i,type:s,checked:u,readOnly:c,onChange:f})=>Ja.jsx("input",{id:n,name:t,value:i,type:s,checked:u,onChange:f,readOnly:c,disabled:c,className:"bsh:appearance-none! bsh:absolute! bsh:left-[-1000px]!"});function ZD(n){const t=Object.keys(n),i={};for(let s=0,u=t.length;s<u;s++){const c=t[s];if(c){const f=n[c],p=c.replace(/([A-Z])/g,m=>`-${m.toLowerCase()}`);typeof f=="boolean"?f&&(i[`data-${p}`]=!0):i[`data-${p}`]=n[c]}}return i}const $p=({wrapperElement:n,renderProps:t,elementProps:i,innerWrapperElement:s,className:u,children:c})=>{if(typeof c=="function")return s?Ja.jsxs(Ja.Fragment,{children:[s,c(t)]}):c(t);{const f=s?Ja.jsxs(Ja.Fragment,{children:[s,c]}):c;return H.createElement(n,Object.assign({},t?ZD(t):{},i,{className:u}),f)}};var JD=Symbol.for("preact-signals");function iv(){if(ah>1)ah--;else{for(var n,t=!1;t0!==void 0;){var i=t0;for(t0=void 0,sv++;i!==void 0;){var s=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&k4(i))try{i.c()}catch(u){t||(n=u,t=!0)}i=s}}if(sv=0,ah--,t)throw n}}var Ue=void 0;function J4(n){var t=Ue;Ue=void 0;try{return n()}finally{Ue=t}}var t0=void 0,ah=0,sv=0,F1=0;function F4(n){if(Ue!==void 0){var t=n.n;if(t===void 0||t.t!==Ue)return t={i:0,S:n,p:Ue.s,n:void 0,t:Ue,e:void 0,x:void 0,r:t},Ue.s!==void 0&&(Ue.s.n=t),Ue.s=t,n.n=t,32&Ue.f&&n.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ue.s,t.n=void 0,Ue.s.n=t,Ue.s=t),t}}function Fa(n,t){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Fa.prototype.brand=JD,Fa.prototype.h=function(){return!0},Fa.prototype.S=function(n){var t=this,i=this.t;i!==n&&n.e===void 0&&(n.x=i,this.t=n,i!==void 0?i.e=n:J4(function(){var s;(s=t.W)==null||s.call(t)}))},Fa.prototype.U=function(n){var t=this;if(this.t!==void 0){var i=n.e,s=n.x;i!==void 0&&(i.x=s,n.e=void 0),s!==void 0&&(s.e=i,n.x=void 0),n===this.t&&(this.t=s,s===void 0&&J4(function(){var u;(u=t.Z)==null||u.call(t)}))}},Fa.prototype.subscribe=function(n){var t=this;return rv(function(){var i=t.value,s=Ue;Ue=void 0;try{n(i)}finally{Ue=s}},{name:"sub"})},Fa.prototype.valueOf=function(){return this.value},Fa.prototype.toString=function(){return this.value+""},Fa.prototype.toJSON=function(){return this.value},Fa.prototype.peek=function(){var n=Ue;Ue=void 0;try{return this.value}finally{Ue=n}},Object.defineProperty(Fa.prototype,"value",{get:function(){var n=F4(this);return n!==void 0&&(n.i=this.i),this.v},set:function(n){if(n!==this.v){if(sv>100)throw new Error("Cycle detected");this.v=n,this.i++,F1++,ah++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{iv()}}}});function FD(n,t){return new Fa(n,t)}function k4(n){for(var t=n.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function I4(n){for(var t=n.s;t!==void 0;t=t.n){var i=t.S.n;if(i!==void 0&&(t.r=i),t.S.n=t,t.i=-1,t.n===void 0){n.s=t;break}}}function W4(n){for(var t=n.s,i=void 0;t!==void 0;){var s=t.p;t.i===-1?(t.S.U(t),s!==void 0&&(s.n=t.n),t.n!==void 0&&(t.n.p=s)):i=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=s}n.s=i}function ih(n,t){Fa.call(this,void 0),this.x=n,this.s=void 0,this.g=F1-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}ih.prototype=new Fa,ih.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===F1))return!0;if(this.g=F1,this.f|=1,this.i>0&&!k4(this))return this.f&=-2,!0;var n=Ue;try{I4(this),Ue=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return Ue=n,W4(this),this.f&=-2,!0},ih.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Fa.prototype.S.call(this,n)},ih.prototype.U=function(n){if(this.t!==void 0&&(Fa.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},ih.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(ih.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var n=F4(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}});function $4(n){var t=n.u;if(n.u=void 0,typeof t=="function"){ah++;var i=Ue;Ue=void 0;try{t()}catch(s){throw n.f&=-2,n.f|=8,lv(n),s}finally{Ue=i,iv()}}}function lv(n){for(var t=n.s;t!==void 0;t=t.n)t.S.U(t);n.x=void 0,n.s=void 0,$4(n)}function kD(n){if(Ue!==this)throw new Error("Out-of-order effect");W4(this),Ue=n,this.f&=-2,8&this.f&&lv(this),iv()}function sh(n,t){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}sh.prototype.c=function(){var n=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{n()}},sh.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,$4(this),I4(this),ah++;var n=Ue;return Ue=this,kD.bind(this,n)},sh.prototype.N=function(){2&this.f||(this.f|=2,this.o=t0,t0=this)},sh.prototype.d=function(){this.f|=8,1&this.f||lv(this)},sh.prototype.dispose=function(){this.d()};function rv(n,t){var i=new sh(n,t);try{i.c()}catch(u){throw i.d(),u}var s=i.d.bind(i);return s[Symbol.dispose]=s,s}var ov={exports:{}},uv={},t6;function ID(){if(t6)return uv;t6=1;var n=H;function t(_,x){return _===x&&(_!==0||1/_===1/x)||_!==_&&x!==x}var i=typeof Object.is=="function"?Object.is:t,s=n.useState,u=n.useEffect,c=n.useLayoutEffect,f=n.useDebugValue;function p(_,x){var D=x(),A=s({inst:{value:D,getSnapshot:x}}),N=A[0].inst,R=A[1];return c(function(){N.value=D,N.getSnapshot=x,m(N)&&R({inst:N})},[_,D,x]),u(function(){return m(N)&&R({inst:N}),_(function(){m(N)&&R({inst:N})})},[_]),f(D),D}function m(_){var x=_.getSnapshot;_=_.value;try{var D=x();return!i(_,D)}catch{return!0}}function S(_,x){return x()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?S:p;return uv.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:b,uv}var e6={},n6;function WD(){return n6||(n6=1,process.env.NODE_ENV!=="production"&&(function(){function n(D,A){return D===A&&(D!==0||1/D===1/A)||D!==D&&A!==A}function t(D,A){b||u.startTransition===void 0||(b=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var N=A();if(!_){var R=A();c(N,R)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),_=!0)}R=f({inst:{value:N,getSnapshot:A}});var O=R[0].inst,U=R[1];return m(function(){O.value=N,O.getSnapshot=A,i(O)&&U({inst:O})},[D,N,A]),p(function(){return i(O)&&U({inst:O}),D(function(){i(O)&&U({inst:O})})},[D]),S(N),N}function i(D){var A=D.getSnapshot;D=D.value;try{var N=A();return!c(D,N)}catch{return!0}}function s(D,A){return A()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var u=H,c=typeof Object.is=="function"?Object.is:n,f=u.useState,p=u.useEffect,m=u.useLayoutEffect,S=u.useDebugValue,b=!1,_=!1,x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;e6.useSyncExternalStore=u.useSyncExternalStore!==void 0?u.useSyncExternalStore:x,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),e6}var a6;function $D(){return a6||(a6=1,process.env.NODE_ENV==="production"?ov.exports=ID():ov.exports=WD()),ov.exports}var tA=$D(),eA=H.version.split(".").map(Number)[0],i6=[],nA=Symbol.for(eA>=19?"react.transitional.element":"react.element"),pc,s6=Symbol.dispose||Symbol.for("Symbol.dispose");function cv(n,t){var i=t.effect.S();return pc=t,aA.bind(t,n,i)}function aA(n,t){t(),pc=n}var l6,fv,r6=function(){},iA=((l6={o:0,effect:{s:void 0,c:function(){},S:function(){return r6},d:function(){}},subscribe:function(){return r6},getSnapshot:function(){return 0},S:function(){},f:function(){}})[s6]=function(){},l6),sA=Promise.prototype.then.bind(Promise.resolve());function lA(){fv||(fv=sA(rA))}function rA(){var n;fv=void 0,(n=pc)==null||n.f()}function oA(n){lA();var t=H.useRef();t.current==null&&(typeof window>"u"?t.current=iA:t.current=(function(s){var u,c,f,p,m=0,S=rv(function(){c=this});return c.c=function(){m=m+1|0,p&&p()},(u={o:s,effect:c,subscribe:function(b){return p=b,function(){m=m+1|0,p=void 0,S()}},getSnapshot:function(){return m},S:function(){if(pc!=null){var b=pc.o,_=this.o;b==0&&_==0||b==0&&_==1?(pc.f(),f=cv(void 0,this)):b==1&&_==0||b==2&&_==0||(f=cv(pc,this))}else f=cv(void 0,this)},f:function(){var b=f;f=void 0,b?.()}})[s6]=function(){this.f()},u})(n));var i=t.current;return tA.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot),i.S(),i}Object.defineProperties(Fa.prototype,{$$typeof:{configurable:!0,value:nA},type:{configurable:!0,value:function(n){var t=n.data,i=oA(1);try{return t.value}finally{i.f()}}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}});function Ko(n,t){return H.useMemo(function(){return FD(n,t)},i6)}function lh(n,t){var i=H.useRef(n);i.current=n,H.useEffect(function(){return rv(function(){return i.current()},t)},i6)}const o6=H.createContext(void 0),u6=()=>H.useContext(o6),uA=(n,t)=>{const{name:i,value:s,checked:u=!1,partial:c=!1,readOnly:f=!1,onChange:p,children:m,className:S}=n,[b,_]=H.useState(i),[x,D]=H.useState(f),A=H.useRef(void 0),N=H.useRef(void 0),R=H.useRef(void 0),O=H.useRef(void 0),U=H.useRef(void 0),j=H.useRef(void 0),V=u6(),J=J1(),$=H.useId(),st=H.useMemo(()=>J?.sharedId||n.id||$,[J?.sharedId,n.id,$]),[I,et,nt]=QD({checked:!1,partial:!1}),bt=Q4(u),rt=Q4(c);H.useEffect(()=>{if(I.initial)et({checked:c?!1:u,partial:c});else{const F=bt.changed?u:I.value.checked,K=rt.changed?c:I.value.partial;et({checked:K?!1:F,partial:K})}},[u,c]),H.useEffect(()=>{D(f)},[f]),H.useEffect(()=>{V&&(A.current=V.nameSignal,N.current=V.valueSignal,R.current=V.readOnlySignal,O.current=V.useComparator,U.current=V.compare,j.current=V.onCheckboxChange)},[V]),lh(()=>{if(N.current)if(O.current?.value&&U.current){const F=U.current,K=N.current.value?.some(at=>F(s,at))??!1;et(at=>({...at,checked:K}))}else{const F=N.current.value?.some(K=>s===K)??!1;et(K=>({...K,checked:F}))}}),lh(()=>{A.current&&_(A.current.value)}),lh(()=>{R.current&&D(R.current.value??!1)});const dt=Wp(F=>{const K=nt.current?.value.partial===!0?!0:F.target.checked;et({checked:K,partial:!1}),j.current?j.current({originalEvent:F,name:b,value:s,checked:K}):p?.({originalEvent:F,name:b,value:s,checked:K})}),pt=F=>{const K={checked:F?!1:nt.current?.value.checked??!1,partial:F};et(K)},tt=F=>{et({checked:F,partial:!1})};H.useImperativeHandle(t,()=>({setPartiallyChecked:pt,setChecked:tt}));const w=b&&Ja.jsx(av,{id:st,name:b,type:"checkbox",checked:I.value.checked,readOnly:x,onChange:dt});return $p({wrapperElement:"label",renderProps:{...I.value,readOnly:x},elementProps:{htmlFor:st},className:S,innerWrapperElement:w,children:m})},c6=H.memo(H.forwardRef(uA)),cA=(n,t)=>n&&t&&typeof n=="object"&&typeof t=="object"&&"value"in n&&"value"in t?n.value===t.value:n===t,f6=(n=cA)=>Wp((t,i)=>{if(typeof n=="string"){const s=n;return t?.[s]===i?.[s]}return n(t,i)}),h6=({props:n,children:t})=>Ja.jsx(o6.Provider,{value:n,children:t}),fA=({name:n,value:t,comparator:i,readOnly:s=!1,onChange:u,className:c,children:f})=>{const p=Ko(),m=Ko(),S=Ko(),b=Ko(),_=f6(i),x=Wp(A=>{if(A){const{checked:N}=A,R=A.value;if(m.value)if(i)if(N)m.value.findIndex(O=>_(R,O))===-1&&m.value.push(R);else{const O=m.value.filter(U=>!_(R,U));m.value=[...O]}else if(N)m.value.indexOf(R)===-1&&m.value.push(R);else{const O=m.value.filter(U=>U!==R);m.value=[...O]}else N&&(m.value=[R])}u?.({originalEvent:A?.originalEvent,name:n,value:m.value})}),D=H.useMemo(()=>({nameSignal:p,valueSignal:m,readOnlySignal:S,useComparator:b,compare:_,onCheckboxChange:x}),[]);return H.useEffect(()=>{p.value=n},[n]),H.useEffect(()=>{m.value=t},[t]),H.useEffect(()=>{S.value=s},[s]),H.useEffect(()=>{b.value=i!==void 0},[i]),Ja.jsx("div",{className:c,children:Ja.jsx(h6,{props:D,children:f})})},d6=H.memo(fA),rh=({className:n,children:t})=>{const i=H.useId(),s=H.useMemo(()=>({sharedId:i}),[i]),u=Ja.jsx(Z4.Provider,{value:s,children:t});return $p({wrapperElement:"div",className:n,children:u})},hA=({htmlFor:n,className:t,children:i})=>{const s=J1(),u=H.useMemo(()=>s?.sharedId||n,[s?.sharedId,n]);return $p({wrapperElement:"label",elementProps:{htmlFor:u},className:t,children:i})};var p6={exports:{}},m6;function dA(){return m6||(m6=1,(function(n){(function(){var t={}.hasOwnProperty;function i(){for(var c="",f=0;f<arguments.length;f++){var p=arguments[f];p&&(c=u(c,s(p)))}return c}function s(c){if(typeof c=="string"||typeof c=="number")return c;if(typeof c!="object")return"";if(Array.isArray(c))return i.apply(null,c);if(c.toString!==Object.prototype.toString&&!c.toString.toString().includes("[native code]"))return c.toString();var f="";for(var p in c)t.call(c,p)&&c[p]&&(f=u(f,p));return f}function u(c,f){return f?c?c+" "+f:c+f:c}n.exports?(i.default=i,n.exports=i):window.classNames=i})()})(p6)),p6.exports}dA();const pA=({intersectionObserver:n,resizeObserver:t,page:i,height:s,children:u})=>{const c=H.useRef(void 0);H.useEffect(()=>()=>{c.current&&(n?.unobserve(c.current),t?.unobserve(c.current))},[]),H.useEffect(()=>(c.current&&n?.observe(c.current),()=>{c.current&&n&&n.unobserve(c.current)}),[n]);const f=m=>{c.current&&(n?.unobserve(c.current),t?.unobserve(c.current)),n?.observe(m),t?.observe(m),c.current=m},p=s?{height:`${s}px`}:{};return Ja.jsx("div",{"data-page":i,"data-name":"page",style:p,ref:m=>{m&&f(m)},children:u})};H.memo(pA);const mA=({intersectionObserver:n,page:t})=>{const i=H.useRef(void 0);H.useEffect(()=>()=>{i.current&&n?.unobserve(i.current)},[]);const s=u=>{i.current&&n?.unobserve(i.current),n?.observe(u),i.current=u};return Ja.jsx("div",{"data-page":t,"data-name":"marker",ref:u=>{u&&s(u)}})};H.memo(mA);const gA=({name:n,value:t,comparator:i,readOnly:s=!1,onChange:u,className:c,children:f})=>{const p=Ko(),m=Ko(),S=Ko(),b=Ko(),_=f6(i),x=H.useMemo(()=>({nameSignal:p,valueSignal:m,readOnlySignal:S,useComparator:b,compare:_}),[]);H.useEffect(()=>{p.value=n},[n]),H.useEffect(()=>{m.value=t},[t]),H.useEffect(()=>{S.value=s},[s]),H.useEffect(()=>{b.value=i!==void 0},[i]);const D=Wp(A=>{u?.({originalEvent:A,name:n,value:m.value})});return Ja.jsx("div",{className:c,onChange:D,children:Ja.jsx(h6,{props:x,children:f})})},g6=H.memo(gA),yA=({value:n,className:t,children:i})=>{const[s,u]=H.useState(),[c,f]=H.useState(!1),[p,m]=H.useState(!1),S=H.useRef(void 0),b=H.useRef(void 0),_=H.useRef(void 0),x=H.useRef(void 0),D=H.useRef(void 0),A=u6(),N=J1(),R=H.useId(),O=H.useMemo(()=>N?.sharedId||R,[N?.sharedId,R]);H.useEffect(()=>{A&&(S.current=A.nameSignal,b.current=A.valueSignal,_.current=A.readOnlySignal,x.current=A.useComparator,D.current=A.compare)},[A]),lh(()=>{x&&b.current&&D.current?f(D.current(n,b.current.value)):f(n===b.current?.value)}),lh(()=>{u(S.current?.value)}),lh(()=>{m(_.current?.value??!1)});const U=Wp(j=>{j.target.checked&&b.current&&(b.current.value=n)});return $p({wrapperElement:"label",renderProps:{checked:c,readOnly:p},elementProps:{htmlFor:O},className:t,innerWrapperElement:s?Ja.jsx(av,{id:O,name:s,type:"radio",value:n,checked:c,readOnly:p,onChange:U}):null,children:i})},y6=H.memo(yA),vA=(n,t)=>{const{id:i,name:s,value:u,toggled:c=!1,readOnly:f,onChange:p,children:m,className:S}=n,[b,_]=H.useState(c),x=J1(),D=H.useId(),A=H.useMemo(()=>x?.sharedId||i||D,[x?.sharedId,i,D]);H.useEffect(()=>{_(c)},[c]);const N=O=>{_(O.target.checked),p?.({originalEvent:O,name:s,value:u,checked:O.target.checked})},R=O=>{_(O)};return H.useImperativeHandle(t,()=>({setToggled:R})),$p({wrapperElement:"label",renderProps:{toggled:b,readOnly:f},elementProps:{htmlFor:A},className:S,innerWrapperElement:Ja.jsx(av,{id:A,name:s,type:"checkbox",checked:b,readOnly:f,onChange:N}),children:m})},SA=H.memo(H.forwardRef(vA)),hv=n=>{const[t,i]=H.useState(!0),s=j4();return H.useEffect(()=>{s&&s.useAnimations!==void 0?i(s.useAnimations):n!==void 0&&i(n)},[s,n]),t},wr=({label:n,htmlFor:t,readOnly:i=!1,className:s})=>{const u=Se("bc-label",{"bsc:text-black bsc:dark:text-mono-light-1":!i,"bc-read-only bsc:text-gray-4 bsc:dark:text-mono-light-3 bsc:pointer-events-none":i},s);return X.jsx(hA,{htmlFor:t,className:u,children:n})},bA=(n,t)=>{const{name:i,label:s,value:u,readOnly:c=!1,checked:f=!1,partial:p=!1,labelLocation:m=Es.Right,className:S,useAnimation:b,onChange:_}=n,x=hv(b),D=Se("bc-checkbox-wrapper bsc:flex bsc:items-center bsc:group/wrapper bsc:*:cursor-pointer bsc:has-data-read-only:text-gray-4 bsc:dark:has-data-read-only:text-mono-light-3 bsc:has-data-read-only:pointer-events-none",S),A=Se("bc-checkbox-label bsc:peer-data-read-only:text-gray-4 bsc:dark:peer-data-read-only:text-mono-light-3",{"bsc:ml-2":m===Es.Right,"bsc:mr-2":m===Es.Left}),N=kp(nh.FocusWithin),R=Se("bc-checkbox-outer bsc:group/checkbox bsc:peer bsc:rounded bsc:*:block bsc:*:size-[21px]","bsc:inset-shadow-[0_0_0_1px] bsc:inset-shadow-gray-2 bsc:dark:inset-shadow-[0_0_0_1px] bsc:dark:inset-shadow-mono-light-2","bsc:group-hover/wrapper:not-data-checked:inset-shadow-[0_0_0_2px] bsc:group-hover/wrapper:not-data-checked:inset-shadow-gray-4","bsc:dark:group-hover/wrapper:not-data-checked:inset-shadow-[0_0_0_2px] bsc:[transition:box-shadow_0.3s]",N),O=Se("bc-checkbox-svg bsc:rounded bsc:stroke-mono-light-1 bsc:stroke-2 bsc:[stroke-linecap:round]","bsc:[stroke-linejoin:round] bsc:dark:stroke-mono-dark-3 bsc:[transform:scale(0)]","bsc:group-data-checked/checkbox:group-data-read-only/checkbox:bg-primary-4 bsc:group-data-checked/checkbox:group-data-read-only/checkbox:fill-primary-4 bsc:group-data-partial/checkbox:group-data-read-only/checkbox:bg-primary-4 bsc:group-data-partial/checkbox:group-data-read-only/checkbox:fill-primary-4 bsc:dark:group-data-checked/checkbox:group-data-read-only/checkbox:bg-mono-light-3 bsc:dark:group-data-checked/checkbox:group-data-read-only/checkbox:fill-mono-light-3 bsc:dark:group-data-partial/checkbox:group-data-read-only/checkbox:bg-mono-light-3 bsc:dark:group-data-partial/checkbox:group-data-read-only/checkbox:fill-mono-light-3","bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:bg-primary-1 bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:fill-primary-1 bsc:group-data-partial/checkbox:bg-primary-1 bsc:group-data-partial/checkbox:fill-primary-1 bsc:dark:group-data-checked/checkbox:bg-mono-light-1 bsc:dark:group-data-checked/checkbox:fill-mono-light-1 bsc:dark:group-data-partial/checkbox:bg-mono-light-1 bsc:dark:group-data-partial/checkbox:fill-mono-light-1",{"bsc:group-data-checked/checkbox:group-not-data-read-only/checkbox:animate-bounce bsc:group-data-partial/checkbox:group-not-data-read-only/checkbox:animate-bounce bsc:group-data-checked/checkbox:group-data-read-only/checkbox:[transform:scale(1)] bsc:group-data-partial/checkbox:group-data-read-only/checkbox:[transform:scale(1)]":x,"bsc:group-data-checked/checkbox:[transform:scale(1)] bsc:group-data-partial/checkbox:[transform:scale(1)]":!x});return X.jsxs(rh,{className:D,children:[s&&m===Es.Left&&X.jsx(wr,{label:s,readOnly:c,className:A}),X.jsx(c6,{ref:t,name:i,value:u,checked:f,partial:p,readOnly:c,className:R,onChange:_,children:X.jsxs("svg",{viewBox:"0 0 21 21",className:O,children:[X.jsx("polyline",{className:"bsc:[visibility:hidden] bsc:group-data-checked/checkbox:visible",points:"5 10.75 8.5 14.25 16 6"}),X.jsx("polyline",{className:"bsc:[visibility:hidden] bsc:group-data-partial/checkbox:visible",points:"6 10.5 16 10.5"})]})}),s&&m===Es.Right&&X.jsx(wr,{label:s,readOnly:c,className:A})]})},v6=H.memo(H.forwardRef(bA)),EA=({name:n,label:t,value:i,data:s,textField:u,valueField:c,readOnly:f=!1,orientation:p=Za.Vertical,className:m,onChange:S})=>{const[b,_]=H.useState([]),x=tv(()=>s,[s]);H.useEffect(()=>{_(i??[])},[i]);const D=U=>{if(U){const{value:j}=U;_(j??[]),S?.({name:n,value:j})}},A=(U,j)=>X.jsx(v6,{label:U[u],value:U[c],className:"bsc:mr-3"},`${n}_checkbox_${j}`),N=Se("bsc:flex bsc:flex-col bsc:gap-1",m),R=Se("bsc:flex bsc:gap-1",{"bsc:flex-col":p===Za.Vertical}),O=U=>X.jsx(d6,{name:n,value:b,readOnly:f,onChange:D,className:R,children:U.map(A)});return X.jsxs("div",{className:N,children:[t&&X.jsx(wr,{label:t,readOnly:f}),x&&O(x)]})},TA=H.memo(EA);var S6=typeof global=="object"&&global&&global.Object===Object&&global,CA=typeof self=="object"&&self&&self.Object===Object&&self,rl=S6||CA||Function("return this")(),oh=rl.Symbol,b6=Object.prototype,_A=b6.hasOwnProperty,xA=b6.toString,e0=oh?oh.toStringTag:void 0;function DA(n){var t=_A.call(n,e0),i=n[e0];try{n[e0]=void 0;var s=!0}catch{}var u=xA.call(n);return s&&(t?n[e0]=i:delete n[e0]),u}var AA=Object.prototype,MA=AA.toString;function NA(n){return MA.call(n)}var OA="[object Null]",RA="[object Undefined]",E6=oh?oh.toStringTag:void 0;function uh(n){return n==null?n===void 0?RA:OA:E6&&E6 in Object(n)?DA(n):NA(n)}function ch(n){return n!=null&&typeof n=="object"}var zA="[object Symbol]";function HA(n){return typeof n=="symbol"||ch(n)&&uh(n)==zA}var dv=Array.isArray,wA=/\s/;function UA(n){for(var t=n.length;t--&&wA.test(n.charAt(t)););return t}var BA=/^\s+/;function VA(n){return n&&n.slice(0,UA(n)+1).replace(BA,"")}function Qo(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}var T6=NaN,GA=/^[-+]0x[0-9a-f]+$/i,jA=/^0b[01]+$/i,LA=/^0o[0-7]+$/i,PA=parseInt;function C6(n){if(typeof n=="number")return n;if(HA(n))return T6;if(Qo(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=Qo(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=VA(n);var i=jA.test(n);return i||LA.test(n)?PA(n.slice(2),i?2:8):GA.test(n)?T6:+n}var YA="[object AsyncFunction]",qA="[object Function]",XA="[object GeneratorFunction]",KA="[object Proxy]";function _6(n){if(!Qo(n))return!1;var t=uh(n);return t==qA||t==XA||t==YA||t==KA}var pv=rl["__core-js_shared__"],x6=(function(){var n=/[^.]+$/.exec(pv&&pv.keys&&pv.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function QA(n){return!!x6&&x6 in n}var ZA=Function.prototype,JA=ZA.toString;function mc(n){if(n!=null){try{return JA.call(n)}catch{}try{return n+""}catch{}}return""}var FA=/[\\^$.*+?()[\]{}|]/g,kA=/^\[object .+?Constructor\]$/,IA=Function.prototype,WA=Object.prototype,$A=IA.toString,tM=WA.hasOwnProperty,eM=RegExp("^"+$A.call(tM).replace(FA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nM(n){if(!Qo(n)||QA(n))return!1;var t=_6(n)?eM:kA;return t.test(mc(n))}function aM(n,t){return n?.[t]}function gc(n,t){var i=aM(n,t);return nM(i)?i:void 0}var mv=gc(rl,"WeakMap"),D6=Object.create,iM=(function(){function n(){}return function(t){if(!Qo(t))return{};if(D6)return D6(t);n.prototype=t;var i=new n;return n.prototype=void 0,i}})(),A6=(function(){try{var n=gc(Object,"defineProperty");return n({},"",{}),n}catch{}})();function sM(n,t){for(var i=-1,s=n==null?0:n.length;++i<s&&t(n[i],i,n)!==!1;);return n}var lM=9007199254740991,rM=/^(?:0|[1-9]\d*)$/;function oM(n,t){var i=typeof n;return t=t??lM,!!t&&(i=="number"||i!="symbol"&&rM.test(n))&&n>-1&&n%1==0&&n<t}function uM(n,t,i){t=="__proto__"&&A6?A6(n,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[t]=i}function M6(n,t){return n===t||n!==n&&t!==t}var cM=Object.prototype,fM=cM.hasOwnProperty;function hM(n,t,i){var s=n[t];(!(fM.call(n,t)&&M6(s,i))||i===void 0&&!(t in n))&&uM(n,t,i)}var dM=9007199254740991;function N6(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=dM}function pM(n){return n!=null&&N6(n.length)&&!_6(n)}var mM=Object.prototype;function O6(n){var t=n&&n.constructor,i=typeof t=="function"&&t.prototype||mM;return n===i}function gM(n,t){for(var i=-1,s=Array(n);++i<n;)s[i]=t(i);return s}var yM="[object Arguments]";function R6(n){return ch(n)&&uh(n)==yM}var z6=Object.prototype,vM=z6.hasOwnProperty,SM=z6.propertyIsEnumerable,bM=R6((function(){return arguments})())?R6:function(n){return ch(n)&&vM.call(n,"callee")&&!SM.call(n,"callee")};function EM(){return!1}var H6=typeof $t=="object"&&$t&&!$t.nodeType&&$t,w6=H6&&typeof module=="object"&&module&&!module.nodeType&&module,TM=w6&&w6.exports===H6,U6=TM?rl.Buffer:void 0,CM=U6?U6.isBuffer:void 0,B6=CM||EM,_M="[object Arguments]",xM="[object Array]",DM="[object Boolean]",AM="[object Date]",MM="[object Error]",NM="[object Function]",OM="[object Map]",RM="[object Number]",zM="[object Object]",HM="[object RegExp]",wM="[object Set]",UM="[object String]",BM="[object WeakMap]",VM="[object ArrayBuffer]",GM="[object DataView]",jM="[object Float32Array]",LM="[object Float64Array]",PM="[object Int8Array]",YM="[object Int16Array]",qM="[object Int32Array]",XM="[object Uint8Array]",KM="[object Uint8ClampedArray]",QM="[object Uint16Array]",ZM="[object Uint32Array]",sn={};sn[jM]=sn[LM]=sn[PM]=sn[YM]=sn[qM]=sn[XM]=sn[KM]=sn[QM]=sn[ZM]=!0,sn[_M]=sn[xM]=sn[VM]=sn[DM]=sn[GM]=sn[AM]=sn[MM]=sn[NM]=sn[OM]=sn[RM]=sn[zM]=sn[HM]=sn[wM]=sn[UM]=sn[BM]=!1;function JM(n){return ch(n)&&N6(n.length)&&!!sn[uh(n)]}function gv(n){return function(t){return n(t)}}var V6=typeof $t=="object"&&$t&&!$t.nodeType&&$t,n0=V6&&typeof module=="object"&&module&&!module.nodeType&&module,FM=n0&&n0.exports===V6,yv=FM&&S6.process,fh=(function(){try{var n=n0&&n0.require&&n0.require("util").types;return n||yv&&yv.binding&&yv.binding("util")}catch{}})(),G6=fh&&fh.isTypedArray,kM=G6?gv(G6):JM,IM=Object.prototype,WM=IM.hasOwnProperty;function $M(n,t){var i=dv(n),s=!i&&bM(n),u=!i&&!s&&B6(n),c=!i&&!s&&!u&&kM(n),f=i||s||u||c,p=f?gM(n.length,String):[],m=p.length;for(var S in n)WM.call(n,S)&&!(f&&(S=="length"||u&&(S=="offset"||S=="parent")||c&&(S=="buffer"||S=="byteLength"||S=="byteOffset")||oM(S,m)))&&p.push(S);return p}function j6(n,t){return function(i){return n(t(i))}}var tN=j6(Object.keys,Object),eN=Object.prototype,nN=eN.hasOwnProperty;function aN(n){if(!O6(n))return tN(n);var t=[];for(var i in Object(n))nN.call(n,i)&&i!="constructor"&&t.push(i);return t}function iN(n){return pM(n)?$M(n):aN(n)}var a0=gc(Object,"create");function sN(){this.__data__=a0?a0(null):{},this.size=0}function lN(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}var rN="__lodash_hash_undefined__",oN=Object.prototype,uN=oN.hasOwnProperty;function cN(n){var t=this.__data__;if(a0){var i=t[n];return i===rN?void 0:i}return uN.call(t,n)?t[n]:void 0}var fN=Object.prototype,hN=fN.hasOwnProperty;function dN(n){var t=this.__data__;return a0?t[n]!==void 0:hN.call(t,n)}var pN="__lodash_hash_undefined__";function mN(n,t){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=a0&&t===void 0?pN:t,this}function yc(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}yc.prototype.clear=sN,yc.prototype.delete=lN,yc.prototype.get=cN,yc.prototype.has=dN,yc.prototype.set=mN;function gN(){this.__data__=[],this.size=0}function k1(n,t){for(var i=n.length;i--;)if(M6(n[i][0],t))return i;return-1}var yN=Array.prototype,vN=yN.splice;function SN(n){var t=this.__data__,i=k1(t,n);if(i<0)return!1;var s=t.length-1;return i==s?t.pop():vN.call(t,i,1),--this.size,!0}function bN(n){var t=this.__data__,i=k1(t,n);return i<0?void 0:t[i][1]}function EN(n){return k1(this.__data__,n)>-1}function TN(n,t){var i=this.__data__,s=k1(i,n);return s<0?(++this.size,i.push([n,t])):i[s][1]=t,this}function Ur(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}Ur.prototype.clear=gN,Ur.prototype.delete=SN,Ur.prototype.get=bN,Ur.prototype.has=EN,Ur.prototype.set=TN;var i0=gc(rl,"Map");function CN(){this.size=0,this.__data__={hash:new yc,map:new(i0||Ur),string:new yc}}function _N(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function I1(n,t){var i=n.__data__;return _N(t)?i[typeof t=="string"?"string":"hash"]:i.map}function xN(n){var t=I1(this,n).delete(n);return this.size-=t?1:0,t}function DN(n){return I1(this,n).get(n)}function AN(n){return I1(this,n).has(n)}function MN(n,t){var i=I1(this,n),s=i.size;return i.set(n,t),this.size+=i.size==s?0:1,this}function hh(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}hh.prototype.clear=CN,hh.prototype.delete=xN,hh.prototype.get=DN,hh.prototype.has=AN,hh.prototype.set=MN;function NN(n,t){for(var i=-1,s=t.length,u=n.length;++i<s;)n[u+i]=t[i];return n}var ON=j6(Object.getPrototypeOf,Object);function RN(){this.__data__=new Ur,this.size=0}function zN(n){var t=this.__data__,i=t.delete(n);return this.size=t.size,i}function HN(n){return this.__data__.get(n)}function wN(n){return this.__data__.has(n)}var UN=200;function BN(n,t){var i=this.__data__;if(i instanceof Ur){var s=i.__data__;if(!i0||s.length<UN-1)return s.push([n,t]),this.size=++i.size,this;i=this.__data__=new hh(s)}return i.set(n,t),this.size=i.size,this}function dh(n){var t=this.__data__=new Ur(n);this.size=t.size}dh.prototype.clear=RN,dh.prototype.delete=zN,dh.prototype.get=HN,dh.prototype.has=wN,dh.prototype.set=BN;var L6=typeof $t=="object"&&$t&&!$t.nodeType&&$t,P6=L6&&typeof module=="object"&&module&&!module.nodeType&&module,VN=P6&&P6.exports===L6,Y6=VN?rl.Buffer:void 0;Y6&&Y6.allocUnsafe;function GN(n,t){return n.slice()}function jN(n,t){for(var i=-1,s=n==null?0:n.length,u=0,c=[];++i<s;){var f=n[i];t(f,i,n)&&(c[u++]=f)}return c}function LN(){return[]}var PN=Object.prototype,YN=PN.propertyIsEnumerable,q6=Object.getOwnPropertySymbols,qN=q6?function(n){return n==null?[]:(n=Object(n),jN(q6(n),function(t){return YN.call(n,t)}))}:LN;function XN(n,t,i){var s=t(n);return dv(n)?s:NN(s,i(n))}function KN(n){return XN(n,iN,qN)}var vv=gc(rl,"DataView"),Sv=gc(rl,"Promise"),bv=gc(rl,"Set"),X6="[object Map]",QN="[object Object]",K6="[object Promise]",Q6="[object Set]",Z6="[object WeakMap]",J6="[object DataView]",ZN=mc(vv),JN=mc(i0),FN=mc(Sv),kN=mc(bv),IN=mc(mv),Br=uh;(vv&&Br(new vv(new ArrayBuffer(1)))!=J6||i0&&Br(new i0)!=X6||Sv&&Br(Sv.resolve())!=K6||bv&&Br(new bv)!=Q6||mv&&Br(new mv)!=Z6)&&(Br=function(n){var t=uh(n),i=t==QN?n.constructor:void 0,s=i?mc(i):"";if(s)switch(s){case ZN:return J6;case JN:return X6;case FN:return K6;case kN:return Q6;case IN:return Z6}return t});var WN=Object.prototype,$N=WN.hasOwnProperty;function tO(n){var t=n.length,i=new n.constructor(t);return t&&typeof n[0]=="string"&&$N.call(n,"index")&&(i.index=n.index,i.input=n.input),i}var F6=rl.Uint8Array;function Ev(n){var t=new n.constructor(n.byteLength);return new F6(t).set(new F6(n)),t}function eO(n,t){var i=Ev(n.buffer);return new n.constructor(i,n.byteOffset,n.byteLength)}var nO=/\w*$/;function aO(n){var t=new n.constructor(n.source,nO.exec(n));return t.lastIndex=n.lastIndex,t}var k6=oh?oh.prototype:void 0,I6=k6?k6.valueOf:void 0;function iO(n){return I6?Object(I6.call(n)):{}}function sO(n,t){var i=Ev(n.buffer);return new n.constructor(i,n.byteOffset,n.length)}var lO="[object Boolean]",rO="[object Date]",oO="[object Map]",uO="[object Number]",cO="[object RegExp]",fO="[object Set]",hO="[object String]",dO="[object Symbol]",pO="[object ArrayBuffer]",mO="[object DataView]",gO="[object Float32Array]",yO="[object Float64Array]",vO="[object Int8Array]",SO="[object Int16Array]",bO="[object Int32Array]",EO="[object Uint8Array]",TO="[object Uint8ClampedArray]",CO="[object Uint16Array]",_O="[object Uint32Array]";function xO(n,t,i){var s=n.constructor;switch(t){case pO:return Ev(n);case lO:case rO:return new s(+n);case mO:return eO(n);case gO:case yO:case vO:case SO:case bO:case EO:case TO:case CO:case _O:return sO(n);case oO:return new s;case uO:case hO:return new s(n);case cO:return aO(n);case fO:return new s;case dO:return iO(n)}}function DO(n){return typeof n.constructor=="function"&&!O6(n)?iM(ON(n)):{}}var AO="[object Map]";function MO(n){return ch(n)&&Br(n)==AO}var W6=fh&&fh.isMap,NO=W6?gv(W6):MO,OO="[object Set]";function RO(n){return ch(n)&&Br(n)==OO}var $6=fh&&fh.isSet,zO=$6?gv($6):RO,tb="[object Arguments]",HO="[object Array]",wO="[object Boolean]",UO="[object Date]",BO="[object Error]",eb="[object Function]",VO="[object GeneratorFunction]",GO="[object Map]",jO="[object Number]",nb="[object Object]",LO="[object RegExp]",PO="[object Set]",YO="[object String]",qO="[object Symbol]",XO="[object WeakMap]",KO="[object ArrayBuffer]",QO="[object DataView]",ZO="[object Float32Array]",JO="[object Float64Array]",FO="[object Int8Array]",kO="[object Int16Array]",IO="[object Int32Array]",WO="[object Uint8Array]",$O="[object Uint8ClampedArray]",tR="[object Uint16Array]",eR="[object Uint32Array]",Je={};Je[tb]=Je[HO]=Je[KO]=Je[QO]=Je[wO]=Je[UO]=Je[ZO]=Je[JO]=Je[FO]=Je[kO]=Je[IO]=Je[GO]=Je[jO]=Je[nb]=Je[LO]=Je[PO]=Je[YO]=Je[qO]=Je[WO]=Je[$O]=Je[tR]=Je[eR]=!0,Je[BO]=Je[eb]=Je[XO]=!1;function W1(n,t,i,s,u,c){var f;if(f!==void 0)return f;if(!Qo(n))return n;var p=dv(n);if(p)f=tO(n);else{var m=Br(n),S=m==eb||m==VO;if(B6(n))return GN(n);if(m==nb||m==tb||S&&!u)f=S?{}:DO(n);else{if(!Je[m])return u?n:{};f=xO(n,m)}}c||(c=new dh);var b=c.get(n);if(b)return b;c.set(n,f),zO(n)?n.forEach(function(D){f.add(W1(D,t,i,D,n,c))}):NO(n)&&n.forEach(function(D,A){f.set(A,W1(D,t,i,A,n,c))});var _=KN,x=p?void 0:_(n);return sM(x||n,function(D,A){x&&(A=D,D=n[A]),hM(f,A,W1(D,t,i,A,n,c))}),f}var nR=1,aR=4;function iR(n){return W1(n,nR|aR)}var Tv=function(){return rl.Date.now()},sR="Expected a function",lR=Math.max,rR=Math.min;function s0(n,t,i){var s,u,c,f,p,m,S=0,b=!1,_=!1,x=!0;if(typeof n!="function")throw new TypeError(sR);t=C6(t)||0,Qo(i)&&(b=!!i.leading,_="maxWait"in i,c=_?lR(C6(i.maxWait)||0,t):c,x="trailing"in i?!!i.trailing:x);function D($){var st=s,I=u;return s=u=void 0,S=$,f=n.apply(I,st),f}function A($){return S=$,p=setTimeout(O,t),b?D($):f}function N($){var st=$-m,I=$-S,et=t-st;return _?rR(et,c-I):et}function R($){var st=$-m,I=$-S;return m===void 0||st>=t||st<0||_&&I>=c}function O(){var $=Tv();if(R($))return U($);p=setTimeout(O,N($))}function U($){return p=void 0,x&&s?D($):(s=u=void 0,f)}function j(){p!==void 0&&clearTimeout(p),S=0,s=m=u=p=void 0}function V(){return p===void 0?f:U(Tv())}function J(){var $=Tv(),st=R($);if(s=arguments,u=this,m=$,st){if(p===void 0)return A(m);if(_)return clearTimeout(p),p=setTimeout(O,t),D(m)}return p===void 0&&(p=setTimeout(O,t)),f}return J.cancel=j,J.flush=V,J}var oR="Expected a function";function uR(n,t,i){var s=!0,u=!0;if(typeof n!="function")throw new TypeError(oR);return Qo(i)&&(s="leading"in i?!0:s,u="trailing"in i?!!i.trailing:u),s0(n,t,{leading:s,maxWait:t,trailing:u})}const cR=(n,t)=>{const{value:i,readOnly:s=!1,debounceTime:u=800,fillContainer:c=!0,leftElement:f,rightElement:p,className:m,leftElementClassName:S,rightElementClassName:b,isSingleLine:_=!0,allowSingleLineScroll:x=!1,inputMode:D,placeholder:A,onFocus:N,onBlur:R,onInput:O,onInnerTextChange:U,onInnerHTMLChange:j,onElementCreate:V,onLeftElementClick:J,onRightElementClick:$}=n,st=H.useRef("bsc:grow bsc:focus:outline-hidden"),I=H.useRef("bsc:text-gray-4"),et=H.useRef(void 0),nt=H.useCallback(Tt=>{const Pt=Tt.target,le=Pt.innerHTML;Pt.className=`${st.current}`,A&&le===A&&(Pt.innerHTML=""),N?.(Tt)},[A,N]),bt=H.useCallback(Tt=>{const Pt=Tt.target.innerHTML;if(A&&Pt===""){const le=Tt.target;le.innerHTML=A,le.className=`${st.current} ${I.current}`}R?.(Tt)},[A,R]),rt=H.useCallback(Tt=>{et.current?.removeEventListener("focus",nt),et.current?.removeEventListener("blur",bt),A&&Tt&&Tt!==document.activeElement&&Tt.innerHTML===""&&(Tt.innerHTML=A,Tt.className=`${st.current} ${I.current}`),Tt.addEventListener("focus",nt),Tt.addEventListener("blur",bt),et.current=Tt},[A]),dt=H.useCallback(Tt=>{V?.(Tt)},[V]),pt=Tt=>{J?.(Tt)},tt=Tt=>{$?.(Tt)},w=s0(Tt=>{O?.(Tt),U?.(Tt.target.innerText),j?.(Tt.target.innerHTML)},u),F=H.useCallback(Tt=>{et.current&&(et.current.innerText=Tt)},[]),K=H.useCallback(Tt=>{et.current&&(et.current.innerHTML=Tt)},[]),at=H.useCallback(()=>{et.current?.focus()},[]);H.useImperativeHandle(t,()=>({inputElement:et.current,setInnerText:F,setInnerHTML:K,focus:at}));const St=Se({"bsc:w-full ":c},"bsc:flex bsc:flex-row bsc:items-center bsc:shadow-sm bsc:border bsc:border-solid bsc:border-gray-3 bsc:dark:border-white bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1 bsc:rounded-md bsc:p-2",{"bsc:overflow-x-auto bsc:overflow-y-hidden bsc:whitespace-pre":_&&x,"bsc:overflow-hidden bsc:whitespace-pre":_&&!x},m),W=Se("bsc:shrink",{"bsc:mr-2":f},S),gt=Se("bsc:shrink",{"bsc:ml-2":p},b);return X.jsxs("div",{className:St,ref:Tt=>{Tt&&dt(Tt)},children:[f&&X.jsx("div",{className:W,onClick:pt,children:f}),X.jsx("div",{ref:Tt=>{Tt&&rt(Tt)},className:st.current,contentEditable:!s,suppressContentEditableWarning:!0,inputMode:D,onInput:w,children:i}),p&&X.jsx("div",{className:gt,onClick:tt,children:p})]})},$1=H.forwardRef(cR);function Oe(n){const t=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&t==="[object Date]"?new n.constructor(+n):typeof n=="number"||t==="[object Number]"||typeof n=="string"||t==="[object String]"?new Date(n):new Date(NaN)}function Fe(n,t){return n instanceof Date?new n.constructor(t):new Date(t)}function ph(n,t){const i=Oe(n);return isNaN(t)?Fe(n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Zo(n,t){const i=Oe(n);if(isNaN(t))return Fe(n,NaN);if(!t)return i;const s=i.getDate(),u=Fe(n,i.getTime());u.setMonth(i.getMonth()+t+1,0);const c=u.getDate();return s>=c?u:(i.setFullYear(u.getFullYear(),u.getMonth(),s),i)}const ab=6048e5,Cv=6e4,_v=36e5,fR=1e3;let hR={};function l0(){return hR}function Jo(n,t){const i=l0(),s=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,u=Oe(n),c=u.getDay(),f=(c<s?7:0)+c-s;return u.setDate(u.getDate()-f),u.setHours(0,0,0,0),u}function mh(n){return Jo(n,{weekStartsOn:1})}function dR(n){const t=Oe(n),i=t.getFullYear(),s=Fe(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const u=mh(s),c=Fe(n,0);c.setFullYear(i,0,4),c.setHours(0,0,0,0);const f=mh(c);return t.getTime()>=u.getTime()?i+1:t.getTime()>=f.getTime()?i:i-1}function ib(n){const t=Oe(n);return t.setHours(0,0,0,0),t}function sb(n){const t=Oe(n),i=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return i.setUTCFullYear(t.getFullYear()),+n-+i}function pR(n){const t=dR(n),i=Fe(n,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),mh(i)}function r0(n,t){return Zo(n,t*12)}function lb(n,t){const i=ib(n),s=ib(t);return+i==+s}function mR(n){const t=Oe(n),i=t.getMonth();return t.setFullYear(t.getFullYear(),i+1,0),t.setHours(23,59,59,999),t}function gR(n,t){const i=Oe(n.start),s=Oe(n.end);let u=+i>+s;const c=u?+i:+s,f=u?s:i;f.setHours(0,0,0,0);let p=1;const m=[];for(;+f<=c;)m.push(Oe(f)),f.setDate(f.getDate()+p),f.setHours(0,0,0,0);return u?m.reverse():m}function rb(n){const t=Oe(n);return t.setDate(1),t.setHours(0,0,0,0),t}function yR(n,t){const i=Oe(n.start),s=Oe(n.end);let u=+i>+s;const c=u?+i:+s,f=u?s:i;f.setHours(0,0,0,0),f.setMonth(0,1);let p=1;const m=[];for(;+f<=c;)m.push(Oe(f)),f.setFullYear(f.getFullYear()+p);return u?m.reverse():m}const vR={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},SR=(n,t,i)=>{let s;const u=vR[n];return typeof u=="string"?s=u:t===1?s=u.one:s=u.other.replace("{{count}}",t.toString()),i?.addSuffix?i.comparison&&i.comparison>0?"in "+s:s+" ago":s};function xv(n){return(t={})=>{const i=t.width?String(t.width):n.defaultWidth;return n.formats[i]||n.formats[n.defaultWidth]}}const bR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ER={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},TR={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},CR={date:xv({formats:bR,defaultWidth:"full"}),time:xv({formats:ER,defaultWidth:"full"}),dateTime:xv({formats:TR,defaultWidth:"full"})},_R={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xR=(n,t,i,s)=>_R[n];function o0(n){return(t,i)=>{const s=i?.context?String(i.context):"standalone";let u;if(s==="formatting"&&n.formattingValues){const f=n.defaultFormattingWidth||n.defaultWidth,p=i?.width?String(i.width):f;u=n.formattingValues[p]||n.formattingValues[f]}else{const f=n.defaultWidth,p=i?.width?String(i.width):n.defaultWidth;u=n.values[p]||n.values[f]}const c=n.argumentCallback?n.argumentCallback(t):t;return u[c]}}const DR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},AR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},MR={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},NR={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},OR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},RR={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},zR={ordinalNumber:(n,t)=>{const i=Number(n),s=i%100;if(s>20||s<10)switch(s%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:o0({values:DR,defaultWidth:"wide"}),quarter:o0({values:AR,defaultWidth:"wide",argumentCallback:n=>n-1}),month:o0({values:MR,defaultWidth:"wide"}),day:o0({values:NR,defaultWidth:"wide"}),dayPeriod:o0({values:OR,defaultWidth:"wide",formattingValues:RR,defaultFormattingWidth:"wide"})};function u0(n){return(t,i={})=>{const s=i.width,u=s&&n.matchPatterns[s]||n.matchPatterns[n.defaultMatchWidth],c=t.match(u);if(!c)return null;const f=c[0],p=s&&n.parsePatterns[s]||n.parsePatterns[n.defaultParseWidth],m=Array.isArray(p)?wR(p,_=>_.test(f)):HR(p,_=>_.test(f));let S;S=n.valueCallback?n.valueCallback(m):m,S=i.valueCallback?i.valueCallback(S):S;const b=t.slice(f.length);return{value:S,rest:b}}}function HR(n,t){for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&t(n[i]))return i}function wR(n,t){for(let i=0;i<n.length;i++)if(t(n[i]))return i}function UR(n){return(t,i={})=>{const s=t.match(n.matchPattern);if(!s)return null;const u=s[0],c=t.match(n.parsePattern);if(!c)return null;let f=n.valueCallback?n.valueCallback(c[0]):c[0];f=i.valueCallback?i.valueCallback(f):f;const p=t.slice(u.length);return{value:f,rest:p}}}const BR=/^(\d+)(th|st|nd|rd)?/i,VR=/\d+/i,GR={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jR={any:[/^b/i,/^(a|c)/i]},LR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},PR={any:[/1/i,/2/i,/3/i,/4/i]},YR={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},qR={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},XR={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},KR={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},QR={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ZR={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},JR={ordinalNumber:UR({matchPattern:BR,parsePattern:VR,valueCallback:n=>parseInt(n,10)}),era:u0({matchPatterns:GR,defaultMatchWidth:"wide",parsePatterns:jR,defaultParseWidth:"any"}),quarter:u0({matchPatterns:LR,defaultMatchWidth:"wide",parsePatterns:PR,defaultParseWidth:"any",valueCallback:n=>n+1}),month:u0({matchPatterns:YR,defaultMatchWidth:"wide",parsePatterns:qR,defaultParseWidth:"any"}),day:u0({matchPatterns:XR,defaultMatchWidth:"wide",parsePatterns:KR,defaultParseWidth:"any"}),dayPeriod:u0({matchPatterns:QR,defaultMatchWidth:"any",parsePatterns:ZR,defaultParseWidth:"any"})},FR={code:"en-US",formatDistance:SR,formatLong:CR,formatRelative:xR,localize:zR,match:JR,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kR(n){const t=Oe(n),i=+mh(t)-+pR(t);return Math.round(i/ab)+1}function ob(n,t){const i=Oe(n),s=i.getFullYear(),u=l0(),c=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??u.firstWeekContainsDate??u.locale?.options?.firstWeekContainsDate??1,f=Fe(n,0);f.setFullYear(s+1,0,c),f.setHours(0,0,0,0);const p=Jo(f,t),m=Fe(n,0);m.setFullYear(s,0,c),m.setHours(0,0,0,0);const S=Jo(m,t);return i.getTime()>=p.getTime()?s+1:i.getTime()>=S.getTime()?s:s-1}function IR(n,t){const i=l0(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,u=ob(n,t),c=Fe(n,0);return c.setFullYear(u,0,s),c.setHours(0,0,0,0),Jo(c,t)}function WR(n,t){const i=Oe(n),s=+Jo(i,t)-+IR(i,t);return Math.round(s/ab)+1}const ub=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},cb=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},fb={p:cb,P:(n,t)=>{const i=n.match(/(P+)(p+)?/)||[],s=i[1],u=i[2];if(!u)return ub(n,t);let c;switch(s){case"P":c=t.dateTime({width:"short"});break;case"PP":c=t.dateTime({width:"medium"});break;case"PPP":c=t.dateTime({width:"long"});break;default:c=t.dateTime({width:"full"});break}return c.replace("{{date}}",ub(s,t)).replace("{{time}}",cb(u,t))}},$R=/^D+$/,tz=/^Y+$/,ez=["D","DD","YY","YYYY"];function nz(n){return $R.test(n)}function az(n){return tz.test(n)}function hb(n,t,i){const s=iz(n,t,i);if(console.warn(s),ez.includes(n))throw new RangeError(s)}function iz(n,t,i){const s=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${s} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Dv(n){return Oe(n).getDay()}function db(n){const t=Oe(n),i=t.getFullYear(),s=t.getMonth(),u=Fe(n,0);return u.setFullYear(i,s+1,0),u.setHours(0,0,0,0),u.getDate()}function sz(){return Object.assign({},l0())}function lz(n){let i=Oe(n).getDay();return i===0&&(i=7),i}function rz(n){const t=Oe(n),i=t.getMonth();return t.setFullYear(t.getFullYear(),i+1,0),t.setHours(0,0,0,0),t}function oz(n,t){const i=Oe(n),s=Oe(t);return+i<+s}function uz(n,t){const i=t instanceof Date?Fe(t,0):new t(0);return i.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),i.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),i}const cz=10;class pb{subPriority=0;validate(t,i){return!0}}class fz extends pb{constructor(t,i,s,u,c){super(),this.value=t,this.validateValue=i,this.setValue=s,this.priority=u,c&&(this.subPriority=c)}validate(t,i){return this.validateValue(t,this.value,i)}set(t,i,s){return this.setValue(t,i,this.value,s)}}class hz extends pb{priority=cz;subPriority=-1;set(t,i){return i.timestampIsSet?t:Fe(t,uz(t,Date))}}class Re{run(t,i,s,u){const c=this.parse(t,i,s,u);return c?{setter:new fz(c.value,this.validate,this.set,this.priority,this.subPriority),rest:c.rest}:null}validate(t,i,s){return!0}}class dz extends Re{priority=140;parse(t,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"});case"GGGGG":return s.era(t,{width:"narrow"});default:return s.era(t,{width:"wide"})||s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"})}}set(t,i,s){return i.era=s,t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const Qn={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Zl={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Zn(n,t){return n&&{value:t(n.value),rest:n.rest}}function Tn(n,t){const i=t.match(n);return i?{value:parseInt(i[0],10),rest:t.slice(i[0].length)}:null}function Jl(n,t){const i=t.match(n);if(!i)return null;if(i[0]==="Z")return{value:0,rest:t.slice(1)};const s=i[1]==="+"?1:-1,u=i[2]?parseInt(i[2],10):0,c=i[3]?parseInt(i[3],10):0,f=i[5]?parseInt(i[5],10):0;return{value:s*(u*_v+c*Cv+f*fR),rest:t.slice(i[0].length)}}function mb(n){return Tn(Qn.anyDigitsSigned,n)}function Vn(n,t){switch(n){case 1:return Tn(Qn.singleDigit,t);case 2:return Tn(Qn.twoDigits,t);case 3:return Tn(Qn.threeDigits,t);case 4:return Tn(Qn.fourDigits,t);default:return Tn(new RegExp("^\\d{1,"+n+"}"),t)}}function tg(n,t){switch(n){case 1:return Tn(Qn.singleDigitSigned,t);case 2:return Tn(Qn.twoDigitsSigned,t);case 3:return Tn(Qn.threeDigitsSigned,t);case 4:return Tn(Qn.fourDigitsSigned,t);default:return Tn(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Av(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function gb(n,t){const i=t>0,s=i?t:1-t;let u;if(s<=50)u=n||100;else{const c=s+50,f=Math.trunc(c/100)*100,p=n>=c%100;u=n+f-(p?100:0)}return i?u:1-u}function yb(n){return n%400===0||n%4===0&&n%100!==0}class pz extends Re{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,i,s){const u=c=>({year:c,isTwoDigitYear:i==="yy"});switch(i){case"y":return Zn(Vn(4,t),u);case"yo":return Zn(s.ordinalNumber(t,{unit:"year"}),u);default:return Zn(Vn(i.length,t),u)}}validate(t,i){return i.isTwoDigitYear||i.year>0}set(t,i,s){const u=t.getFullYear();if(s.isTwoDigitYear){const f=gb(s.year,u);return t.setFullYear(f,0,1),t.setHours(0,0,0,0),t}const c=!("era"in i)||i.era===1?s.year:1-s.year;return t.setFullYear(c,0,1),t.setHours(0,0,0,0),t}}class mz extends Re{priority=130;parse(t,i,s){const u=c=>({year:c,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Zn(Vn(4,t),u);case"Yo":return Zn(s.ordinalNumber(t,{unit:"year"}),u);default:return Zn(Vn(i.length,t),u)}}validate(t,i){return i.isTwoDigitYear||i.year>0}set(t,i,s,u){const c=ob(t,u);if(s.isTwoDigitYear){const p=gb(s.year,c);return t.setFullYear(p,0,u.firstWeekContainsDate),t.setHours(0,0,0,0),Jo(t,u)}const f=!("era"in i)||i.era===1?s.year:1-s.year;return t.setFullYear(f,0,u.firstWeekContainsDate),t.setHours(0,0,0,0),Jo(t,u)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class gz extends Re{priority=130;parse(t,i){return tg(i==="R"?4:i.length,t)}set(t,i,s){const u=Fe(t,0);return u.setFullYear(s,0,4),u.setHours(0,0,0,0),mh(u)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class yz extends Re{priority=130;parse(t,i){return tg(i==="u"?4:i.length,t)}set(t,i,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class vz extends Re{priority=120;parse(t,i,s){switch(i){case"Q":case"QQ":return Vn(i.length,t);case"Qo":return s.ordinalNumber(t,{unit:"quarter"});case"QQQ":return s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(t,{width:"narrow",context:"formatting"});default:return s.quarter(t,{width:"wide",context:"formatting"})||s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=1&&i<=4}set(t,i,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Sz extends Re{priority=120;parse(t,i,s){switch(i){case"q":case"qq":return Vn(i.length,t);case"qo":return s.ordinalNumber(t,{unit:"quarter"});case"qqq":return s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(t,{width:"narrow",context:"standalone"});default:return s.quarter(t,{width:"wide",context:"standalone"})||s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=1&&i<=4}set(t,i,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class bz extends Re{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,i,s){const u=c=>c-1;switch(i){case"M":return Zn(Tn(Qn.month,t),u);case"MM":return Zn(Vn(2,t),u);case"Mo":return Zn(s.ordinalNumber(t,{unit:"month"}),u);case"MMM":return s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(t,{width:"narrow",context:"formatting"});default:return s.month(t,{width:"wide",context:"formatting"})||s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=11}set(t,i,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}class Ez extends Re{priority=110;parse(t,i,s){const u=c=>c-1;switch(i){case"L":return Zn(Tn(Qn.month,t),u);case"LL":return Zn(Vn(2,t),u);case"Lo":return Zn(s.ordinalNumber(t,{unit:"month"}),u);case"LLL":return s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(t,{width:"narrow",context:"standalone"});default:return s.month(t,{width:"wide",context:"standalone"})||s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=0&&i<=11}set(t,i,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Tz(n,t,i){const s=Oe(n),u=WR(s,i)-t;return s.setDate(s.getDate()-u*7),s}class Cz extends Re{priority=100;parse(t,i,s){switch(i){case"w":return Tn(Qn.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return Vn(i.length,t)}}validate(t,i){return i>=1&&i<=53}set(t,i,s,u){return Jo(Tz(t,s,u),u)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function _z(n,t){const i=Oe(n),s=kR(i)-t;return i.setDate(i.getDate()-s*7),i}class xz extends Re{priority=100;parse(t,i,s){switch(i){case"I":return Tn(Qn.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return Vn(i.length,t)}}validate(t,i){return i>=1&&i<=53}set(t,i,s){return mh(_z(t,s))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Dz=[31,28,31,30,31,30,31,31,30,31,30,31],Az=[31,29,31,30,31,30,31,31,30,31,30,31];class Mz extends Re{priority=90;subPriority=1;parse(t,i,s){switch(i){case"d":return Tn(Qn.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return Vn(i.length,t)}}validate(t,i){const s=t.getFullYear(),u=yb(s),c=t.getMonth();return u?i>=1&&i<=Az[c]:i>=1&&i<=Dz[c]}set(t,i,s){return t.setDate(s),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Nz extends Re{priority=90;subpriority=1;parse(t,i,s){switch(i){case"D":case"DD":return Tn(Qn.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return Vn(i.length,t)}}validate(t,i){const s=t.getFullYear();return yb(s)?i>=1&&i<=366:i>=1&&i<=365}set(t,i,s){return t.setMonth(0,s),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Mv(n,t,i){const s=l0(),u=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,c=Oe(n),f=c.getDay(),m=(t%7+7)%7,S=7-u,b=t<0||t>6?t-(f+S)%7:(m+S)%7-(f+S)%7;return ph(c,b)}class Oz extends Re{priority=90;parse(t,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=6}set(t,i,s,u){return t=Mv(t,s,u),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class Rz extends Re{priority=90;parse(t,i,s,u){const c=f=>{const p=Math.floor((f-1)/7)*7;return(f+u.weekStartsOn+6)%7+p};switch(i){case"e":case"ee":return Zn(Vn(i.length,t),c);case"eo":return Zn(s.ordinalNumber(t,{unit:"day"}),c);case"eee":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeeee":return s.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=6}set(t,i,s,u){return t=Mv(t,s,u),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class zz extends Re{priority=90;parse(t,i,s,u){const c=f=>{const p=Math.floor((f-1)/7)*7;return(f+u.weekStartsOn+6)%7+p};switch(i){case"c":case"cc":return Zn(Vn(i.length,t),c);case"co":return Zn(s.ordinalNumber(t,{unit:"day"}),c);case"ccc":return s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"ccccc":return s.day(t,{width:"narrow",context:"standalone"});case"cccccc":return s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});default:return s.day(t,{width:"wide",context:"standalone"})||s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=0&&i<=6}set(t,i,s,u){return t=Mv(t,s,u),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Hz(n,t){const i=Oe(n),s=lz(i),u=t-s;return ph(i,u)}class wz extends Re{priority=90;parse(t,i,s){const u=c=>c===0?7:c;switch(i){case"i":case"ii":return Vn(i.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return Zn(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),u);case"iiiii":return Zn(s.day(t,{width:"narrow",context:"formatting"}),u);case"iiiiii":return Zn(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),u);default:return Zn(s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),u)}}validate(t,i){return i>=1&&i<=7}set(t,i,s){return t=Hz(t,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Uz extends Re{priority=80;parse(t,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(t,{width:"narrow",context:"formatting"});default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,s){return t.setHours(Av(s),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class Bz extends Re{priority=80;parse(t,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(t,{width:"narrow",context:"formatting"});default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,s){return t.setHours(Av(s),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class Vz extends Re{priority=80;parse(t,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(t,{width:"narrow",context:"formatting"});default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,s){return t.setHours(Av(s),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class Gz extends Re{priority=70;parse(t,i,s){switch(i){case"h":return Tn(Qn.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return Vn(i.length,t)}}validate(t,i){return i>=1&&i<=12}set(t,i,s){const u=t.getHours()>=12;return u&&s<12?t.setHours(s+12,0,0,0):!u&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class jz extends Re{priority=70;parse(t,i,s){switch(i){case"H":return Tn(Qn.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return Vn(i.length,t)}}validate(t,i){return i>=0&&i<=23}set(t,i,s){return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class Lz extends Re{priority=70;parse(t,i,s){switch(i){case"K":return Tn(Qn.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return Vn(i.length,t)}}validate(t,i){return i>=0&&i<=11}set(t,i,s){return t.getHours()>=12&&s<12?t.setHours(s+12,0,0,0):t.setHours(s,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Pz extends Re{priority=70;parse(t,i,s){switch(i){case"k":return Tn(Qn.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return Vn(i.length,t)}}validate(t,i){return i>=1&&i<=24}set(t,i,s){const u=s<=24?s%24:s;return t.setHours(u,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class Yz extends Re{priority=60;parse(t,i,s){switch(i){case"m":return Tn(Qn.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return Vn(i.length,t)}}validate(t,i){return i>=0&&i<=59}set(t,i,s){return t.setMinutes(s,0,0),t}incompatibleTokens=["t","T"]}class qz extends Re{priority=50;parse(t,i,s){switch(i){case"s":return Tn(Qn.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return Vn(i.length,t)}}validate(t,i){return i>=0&&i<=59}set(t,i,s){return t.setSeconds(s,0),t}incompatibleTokens=["t","T"]}class Xz extends Re{priority=30;parse(t,i){const s=u=>Math.trunc(u*Math.pow(10,-i.length+3));return Zn(Vn(i.length,t),s)}set(t,i,s){return t.setMilliseconds(s),t}incompatibleTokens=["t","T"]}class Kz extends Re{priority=10;parse(t,i){switch(i){case"X":return Jl(Zl.basicOptionalMinutes,t);case"XX":return Jl(Zl.basic,t);case"XXXX":return Jl(Zl.basicOptionalSeconds,t);case"XXXXX":return Jl(Zl.extendedOptionalSeconds,t);default:return Jl(Zl.extended,t)}}set(t,i,s){return i.timestampIsSet?t:Fe(t,t.getTime()-sb(t)-s)}incompatibleTokens=["t","T","x"]}class Qz extends Re{priority=10;parse(t,i){switch(i){case"x":return Jl(Zl.basicOptionalMinutes,t);case"xx":return Jl(Zl.basic,t);case"xxxx":return Jl(Zl.basicOptionalSeconds,t);case"xxxxx":return Jl(Zl.extendedOptionalSeconds,t);default:return Jl(Zl.extended,t)}}set(t,i,s){return i.timestampIsSet?t:Fe(t,t.getTime()-sb(t)-s)}incompatibleTokens=["t","T","X"]}class Zz extends Re{priority=40;parse(t){return mb(t)}set(t,i,s){return[Fe(t,s*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Jz extends Re{priority=20;parse(t){return mb(t)}set(t,i,s){return[Fe(t,s),{timestampIsSet:!0}]}incompatibleTokens="*"}const Fz={G:new dz,y:new pz,Y:new mz,R:new gz,u:new yz,Q:new vz,q:new Sz,M:new bz,L:new Ez,w:new Cz,I:new xz,d:new Mz,D:new Nz,E:new Oz,e:new Rz,c:new zz,i:new wz,a:new Uz,b:new Bz,B:new Vz,h:new Gz,H:new jz,K:new Lz,k:new Pz,m:new Yz,s:new qz,S:new Xz,X:new Kz,x:new Qz,t:new Zz,T:new Jz},kz=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Iz=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Wz=/^'([^]*?)'?$/,$z=/''/g,tH=/\S/,eH=/[a-zA-Z]/;function Fl(n,t,i,s){const u=sz(),c=s?.locale??u.locale??FR,f=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??u.firstWeekContainsDate??u.locale?.options?.firstWeekContainsDate??1,p=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??u.weekStartsOn??u.locale?.options?.weekStartsOn??0;if(t==="")return n===""?Oe(i):Fe(i,NaN);const m={firstWeekContainsDate:f,weekStartsOn:p,locale:c},S=[new hz],b=t.match(Iz).map(N=>{const R=N[0];if(R in fb){const O=fb[R];return O(N,c.formatLong)}return N}).join("").match(kz),_=[];for(let N of b){!s?.useAdditionalWeekYearTokens&&az(N)&&hb(N,t,n),!s?.useAdditionalDayOfYearTokens&&nz(N)&&hb(N,t,n);const R=N[0],O=Fz[R];if(O){const{incompatibleTokens:U}=O;if(Array.isArray(U)){const V=_.find(J=>U.includes(J.token)||J.token===R);if(V)throw new RangeError(`The format string mustn't contain \`${V.fullToken}\` and \`${N}\` at the same time`)}else if(O.incompatibleTokens==="*"&&_.length>0)throw new RangeError(`The format string mustn't contain \`${N}\` and any other token at the same time`);_.push({token:R,fullToken:N});const j=O.run(n,N,c.match,m);if(!j)return Fe(i,NaN);S.push(j.setter),n=j.rest}else{if(R.match(eH))throw new RangeError("Format string contains an unescaped latin alphabet character `"+R+"`");if(N==="''"?N="'":R==="'"&&(N=nH(N)),n.indexOf(N)===0)n=n.slice(N.length);else return Fe(i,NaN)}}if(n.length>0&&tH.test(n))return Fe(i,NaN);const x=S.map(N=>N.priority).sort((N,R)=>R-N).filter((N,R,O)=>O.indexOf(N)===R).map(N=>S.filter(R=>R.priority===N).sort((R,O)=>O.subPriority-R.subPriority)).map(N=>N[0]);let D=Oe(i);if(isNaN(D.getTime()))return Fe(i,NaN);const A={};for(const N of x){if(!N.validate(D,m))return Fe(i,NaN);const R=N.set(D,A,m);Array.isArray(R)?(D=R[0],Object.assign(A,R[1])):D=R}return Fe(i,D)}function nH(n){return n.match(Wz)[1].replace($z,"'")}function aH(n){return lb(n,Date.now())}function iH(n,t){return ph(n,-t)}function sH(n,t){let i=t-Dv(n);return i<=0&&(i+=7),ph(n,i)}function lH(n,t){const s=cH(n);let u;if(s.date){const m=fH(s.date,2);u=hH(m.restDateString,m.year)}if(!u||isNaN(u.getTime()))return new Date(NaN);const c=u.getTime();let f=0,p;if(s.time&&(f=dH(s.time),isNaN(f)))return new Date(NaN);if(s.timezone){if(p=pH(s.timezone),isNaN(p))return new Date(NaN)}else{const m=new Date(c+f),S=new Date(0);return S.setFullYear(m.getUTCFullYear(),m.getUTCMonth(),m.getUTCDate()),S.setHours(m.getUTCHours(),m.getUTCMinutes(),m.getUTCSeconds(),m.getUTCMilliseconds()),S}return new Date(c+f+p)}const eg={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},rH=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,oH=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,uH=/^([+-])(\d{2})(?::?(\d{2}))?$/;function cH(n){const t={},i=n.split(eg.dateTimeDelimiter);let s;if(i.length>2)return t;if(/:/.test(i[0])?s=i[0]:(t.date=i[0],s=i[1],eg.timeZoneDelimiter.test(t.date)&&(t.date=n.split(eg.timeZoneDelimiter)[0],s=n.substr(t.date.length,n.length))),s){const u=eg.timezone.exec(s);u?(t.time=s.replace(u[1],""),t.timezone=u[1]):t.time=s}return t}function fH(n,t){const i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),s=n.match(i);if(!s)return{year:NaN,restDateString:""};const u=s[1]?parseInt(s[1]):null,c=s[2]?parseInt(s[2]):null;return{year:c===null?u:c*100,restDateString:n.slice((s[1]||s[2]).length)}}function hH(n,t){if(t===null)return new Date(NaN);const i=n.match(rH);if(!i)return new Date(NaN);const s=!!i[4],u=c0(i[1]),c=c0(i[2])-1,f=c0(i[3]),p=c0(i[4]),m=c0(i[5])-1;if(s)return SH(t,p,m)?mH(t,p,m):new Date(NaN);{const S=new Date(0);return!yH(t,c,f)||!vH(t,u)?new Date(NaN):(S.setUTCFullYear(t,c,Math.max(u,f)),S)}}function c0(n){return n?parseInt(n):1}function dH(n){const t=n.match(oH);if(!t)return NaN;const i=Nv(t[1]),s=Nv(t[2]),u=Nv(t[3]);return bH(i,s,u)?i*_v+s*Cv+u*1e3:NaN}function Nv(n){return n&&parseFloat(n.replace(",","."))||0}function pH(n){if(n==="Z")return 0;const t=n.match(uH);if(!t)return 0;const i=t[1]==="+"?-1:1,s=parseInt(t[2]),u=t[3]&&parseInt(t[3])||0;return EH(s,u)?i*(s*_v+u*Cv):NaN}function mH(n,t,i){const s=new Date(0);s.setUTCFullYear(n,0,4);const u=s.getUTCDay()||7,c=(t-1)*7+i+1-u;return s.setUTCDate(s.getUTCDate()+c),s}const gH=[31,null,31,30,31,30,31,31,30,31,30,31];function vb(n){return n%400===0||n%4===0&&n%100!==0}function yH(n,t,i){return t>=0&&t<=11&&i>=1&&i<=(gH[t]||(vb(n)?29:28))}function vH(n,t){return t>=1&&t<=(vb(n)?366:365)}function SH(n,t,i){return t>=1&&t<=53&&i>=0&&i<=6}function bH(n,t,i){return n===24?t===0&&i===0:i>=0&&i<60&&t>=0&&t<60&&n>=0&&n<25}function EH(n,t){return t>=0&&t<=59}function TH(n,t){const i=Oe(n),s=i.getFullYear(),u=i.getDate(),c=Fe(n,0);c.setFullYear(s,t,15),c.setHours(0,0,0,0);const f=db(c);return i.setMonth(t,Math.min(u,f)),i}function CH(n,t){const i=Oe(n);return isNaN(+i)?Fe(n,NaN):(i.setFullYear(t),i)}function Ov(n,t){return Zo(n,-t)}function Rv(n,t){return r0(n,-t)}function _H(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function xH(n,t,i){const s=[];for(let u=n;u<=t;u++)s.push(i?i(u):u);return s}function DH(n,t){const i=n.target;return i?!t.isSameNode(i)&&!t.contains(i):!1}function AH(n,t){return n.isSameNode(t)||n.contains(t)}function MH(n,t){const i=Object.entries(t),s=getComputedStyle(n);for(let u=0,c=i.length;u<c;u++){const[f,p]=i[u];if(typeof p=="string"&&p.indexOf(",")>-1){if(!p.split(",").map(S=>S.trim()).includes(s[f]))return!1}else if(s[f]!==p)return!1}return!0}function NH(n,t){const i=Object.entries(t),s=getComputedStyle(n);for(let u=0,c=i.length;u<c;u++){const[f,p]=i[u];if(typeof p=="string"&&p.indexOf(",")>-1){if(p.split(",").map(S=>S.trim()).includes(s[f]))return!0}else if(s[f]===p)return!0}return!1}function Sb(n,t,i=!1,s){if(i&&MH(n,t)){if(!s||s?.(n)===!0)return n}else if(!i&&NH(n,t)&&(!s||s?.(n)===!0))return n;return n.parentElement?Sb(n.parentElement,t,i,s):n}function bb(n,t){const i=Array.from(document.querySelectorAll("body *")),s=[];for(let u=0,c=i.length;u<c;u++){const f=getComputedStyle(i[u]);f[n]&&t(f[n])&&s.push(f[n])}return s}function bj(n){return n}function OH(n){const t=document.documentElement;Object.keys(n).forEach(i=>{t.style.setProperty(i,n[i])})}function RH(n){return{"--theme-bsc-primary-1":n.primary1,"--theme-bsc-primary-2":n.primary2,"--theme-bsc-primary-3":n.primary3,"--theme-bsc-primary-4":n.primary4,"--theme-bsc-primary-5":n.primary5,"--theme-bsc-gray-1":n.gray1||"#303030","--theme-bsc-gray-2":n.gray2||"#5f5f5f","--theme-bsc-gray-3":n.gray3||"#8f8f8f","--theme-bsc-gray-4":n.gray4||"#bebebe","--theme-bsc-gray-5":n.gray5||"#eee","--theme-bsc-black":n.black||"#000","--theme-bsc-white":n.white||"#fff","--theme-bsc-mono-dark-1":n.monoDark1||"#222","--theme-bsc-mono-dark-2":n.monoDark2||"#3c3c3c","--theme-bsc-mono-dark-3":n.monoDark3||"#4e4e4e","--theme-bsc-mono-light-1":n.monoLight1||"#fefefe","--theme-bsc-mono-light-2":n.monoLight2||"#eee","--theme-bsc-mono-light-3":n.monoLight3||"#ccc","--theme-bsc-info":n.info||"#2e7ff8","--theme-bsc-success":n.success||"#53ae0c","--theme-bsc-warning":n.warning||"#ff6914","--theme-bsc-error":n.error||"#f01616"}}var ka=(n=>(n[n.Regular=24]="Regular",n[n.Small=20]="Small",n))(ka||{});const Eb=({className:n})=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:n,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})}),zH=({className:n})=>{const t=Se("bsc:h-6 bsc:w-6",n);return X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},HH=({className:n})=>{const t=Se("bsc:h-6 bsc:w-6",n);return X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})},wH=({className:n})=>{const t=Se("bsc:h-6 bsc:w-6",n);return X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},UH=({className:n})=>{const t=Se("bsc:h-6 bsc:w-6",n);return X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},BH=({className:n})=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:n,children:X.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}),Ts=({icon:n,size:t=ka.Regular,onClick:i,className:s})=>{const u=H.useRef({calendar:Eb,chevronDown:zH,chevronLeft:HH,chevronRight:wH,chevronUp:UH,close:BH}),c=H.useMemo(()=>u.current[n]||Eb,[n]),f=Se({"bsc:h-[24px] bsc:w-[24px]":t===ka.Regular,"bsc:h-[20px] bsc:w-[20px]":t===ka.Small},s);return X.jsx("div",{onClick:i,children:X.jsx(c,{className:f})})},vc=({template:n,props:t,children:i})=>n(t,i);function VH(n,t){if(t===n)return!1;const i=Object.values(t),s=Object.values(n);if(i.length!==s.length||i.some((c,f)=>c!==s[f]))return!0;const u=Object.keys(n);return Object.keys(t).some((c,f)=>c!==u[f])}function GH(n,t){return n.matches[t]=!1,n.mediaQueries[t]={},n}function Tb(n){const t=Object.keys(n);return typeof window>"u"?t.reduce(GH,{mediaQueries:{},matches:{}}):t.reduce((i,s)=>{const u=window.matchMedia(n[s]);return i.mediaQueries[s]=u,i.matches[s]=u.matches,i},{mediaQueries:{},matches:{}})}function jH(n,t){function i(s,u){return s[u]=n.mediaQueries[u].matches,s}switch(t.type){case"updateMatches":return{matches:Object.keys(n.mediaQueries).reduce(i,{}),mediaQueries:n.mediaQueries};case"setQueries":return Tb(t.queries)}}function LH(n){const t=Ha.useRef(n),[i,s]=Ha.useReducer(jH,n,Tb);Ha.useEffect(()=>{VH(n,t.current)&&(s({type:"setQueries",queries:n}),t.current=n)},[n]);function u(){return s({type:"updateMatches"})}function c(m){const S=u;return typeof m.addListener<"u"?m.addListener(S):m.addEventListener("change",S),S}Ha.useEffect(()=>{const m=Object.values(i.mediaQueries),S=m.map(c);function b(_,x){typeof _.addListener<"u"?_.removeListener(S[x]):_.removeEventListener("change",S[x])}return()=>{m.forEach(b)}},[i.mediaQueries]);const{matches:f}=i,p=Ha.useMemo(()=>Object.values(f),[f]);return{matches:f,matchesAny:p.some(Boolean),matchesAll:p.length>0&&p.every(Boolean)}}function ng(n){return LH(PH(n)).matchesAll}const zv={};function PH(n){return zv[n]===void 0&&(zv[n]={default:n}),zv[n]}const Hv=({mobileQuery:n="screen and (max-device-width: 40rem)",tabletQuery:t="screen and (min-device-width: 40.01rem) and (max-device-width: 63.9375rem)",desktopQuery:i="screen and (min-device-width: 64rem)",mobileMarkup:s,aboveMobileMarkup:u,tabletMarkup:c,desktopMarkup:f})=>{const p=ng(n),m=ng(t),S=ng(i);return p&&s?s:!p&&u?u:m&&c?c:S&&f?f:(console.error("Invalid media settings"),null)};function Cb(n,t,i){const s=c=>{const f=c.target,p=n.style.display!=="hidden";n&&p&&!AH(n,f)&&!u(i,f)?t(!1):t(!0)},u=(c,f)=>{if(!c)return!1;for(let p=0,m=c.length;p<m;p++)if(c[p].isSameNode(f)||c[p].contains(f))return!0;return!1};return document.addEventListener("mousedown",s),s}function _b(n){document.removeEventListener("mousedown",n)}function xb(n){return n.target?n.target:n}const Db=H.createContext({});function YH(n){const t=H.useRef(null);return t.current===null&&(t.current=n()),t.current}const wv=typeof window<"u",qH=wv?H.useLayoutEffect:H.useEffect,Uv=H.createContext(null);function Bv(n,t){n.indexOf(t)===-1&&n.push(t)}function Vv(n,t){const i=n.indexOf(t);i>-1&&n.splice(i,1)}const Vr=(n,t,i)=>i>t?t:i<n?n:i;function Gv(n,t){return t?`${n}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:n}let gh=()=>{},Gr=()=>{};typeof process<"u"&&process.env?.NODE_ENV!=="production"&&(gh=(n,t,i)=>{!n&&typeof console<"u"&&console.warn(Gv(t,i))},Gr=(n,t,i)=>{if(!n)throw new Error(Gv(t,i))});const jr={},Ab=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n);function Mb(n){return typeof n=="object"&&n!==null}const Nb=n=>/^0[^.\s]+$/u.test(n);function jv(n){let t;return()=>(t===void 0&&(t=n()),t)}const Cs=n=>n,XH=(n,t)=>i=>t(n(i)),f0=(...n)=>n.reduce(XH),h0=(n,t,i)=>{const s=t-n;return s===0?1:(i-n)/s};class Lv{constructor(){this.subscriptions=[]}add(t){return Bv(this.subscriptions,t),()=>Vv(this.subscriptions,t)}notify(t,i,s){const u=this.subscriptions.length;if(u)if(u===1)this.subscriptions[0](t,i,s);else for(let c=0;c<u;c++){const f=this.subscriptions[c];f&&f(t,i,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ol=n=>n*1e3,_s=n=>n/1e3;function Ob(n,t){return t?n*(1e3/t):0}const Rb=new Set;function Pv(n,t,i){n||Rb.has(t)||(console.warn(Gv(t,i)),Rb.add(t))}const zb=(n,t,i)=>(((1-3*i+3*t)*n+(3*i-6*t))*n+3*t)*n,KH=1e-7,QH=12;function ZH(n,t,i,s,u){let c,f,p=0;do f=t+(i-t)/2,c=zb(f,s,u)-n,c>0?i=f:t=f;while(Math.abs(c)>KH&&++p<QH);return f}function d0(n,t,i,s){if(n===t&&i===s)return Cs;const u=c=>ZH(c,0,1,n,i);return c=>c===0||c===1?c:zb(u(c),t,s)}const Hb=n=>t=>t<=.5?n(2*t)/2:(2-n(2*(1-t)))/2,wb=n=>t=>1-n(1-t),Ub=d0(.33,1.53,.69,.99),Yv=wb(Ub),Bb=Hb(Yv),Vb=n=>(n*=2)<1?.5*Yv(n):.5*(2-Math.pow(2,-10*(n-1))),qv=n=>1-Math.sin(Math.acos(n)),Gb=wb(qv),jb=Hb(qv),JH=d0(.42,0,1,1),FH=d0(0,0,.58,1),Lb=d0(.42,0,.58,1),kH=n=>Array.isArray(n)&&typeof n[0]!="number",Pb=n=>Array.isArray(n)&&typeof n[0]=="number",Yb={linear:Cs,easeIn:JH,easeInOut:Lb,easeOut:FH,circIn:qv,circInOut:jb,circOut:Gb,backIn:Yv,backInOut:Bb,backOut:Ub,anticipate:Vb},IH=n=>typeof n=="string",qb=n=>{if(Pb(n)){Gr(n.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,i,s,u]=n;return d0(t,i,s,u)}else if(IH(n))return Gr(Yb[n]!==void 0,`Invalid easing type '${n}'`,"invalid-easing-type"),Yb[n];return n},ag=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function WH(n,t){let i=new Set,s=new Set,u=!1,c=!1;const f=new WeakSet;let p={delta:0,timestamp:0,isProcessing:!1};function m(b){f.has(b)&&(S.schedule(b),n()),b(p)}const S={schedule:(b,_=!1,x=!1)=>{const A=x&&u?i:s;return _&&f.add(b),A.has(b)||A.add(b),b},cancel:b=>{s.delete(b),f.delete(b)},process:b=>{if(p=b,u){c=!0;return}u=!0,[i,s]=[s,i],i.forEach(m),i.clear(),u=!1,c&&(c=!1,S.process(b))}};return S}const $H=40;function Xb(n,t){let i=!1,s=!0;const u={delta:0,timestamp:0,isProcessing:!1},c=()=>i=!0,f=ag.reduce((j,V)=>(j[V]=WH(c),j),{}),{setup:p,read:m,resolveKeyframes:S,preUpdate:b,update:_,preRender:x,render:D,postRender:A}=f,N=()=>{const j=jr.useManualTiming?u.timestamp:performance.now();i=!1,jr.useManualTiming||(u.delta=s?1e3/60:Math.max(Math.min(j-u.timestamp,$H),1)),u.timestamp=j,u.isProcessing=!0,p.process(u),m.process(u),S.process(u),b.process(u),_.process(u),x.process(u),D.process(u),A.process(u),u.isProcessing=!1,i&&t&&(s=!1,n(N))},R=()=>{i=!0,s=!0,u.isProcessing||n(N)};return{schedule:ag.reduce((j,V)=>{const J=f[V];return j[V]=($,st=!1,I=!1)=>(i||R(),J.schedule($,st,I)),j},{}),cancel:j=>{for(let V=0;V<ag.length;V++)f[ag[V]].cancel(j)},state:u,steps:f}}const{schedule:hn,cancel:Fo,state:wa,steps:Xv}=Xb(typeof requestAnimationFrame<"u"?requestAnimationFrame:Cs,!0);let ig;function tw(){ig=void 0}const Ai={now:()=>(ig===void 0&&Ai.set(wa.isProcessing||jr.useManualTiming?wa.timestamp:performance.now()),ig),set:n=>{ig=n,queueMicrotask(tw)}},Kb=n=>t=>typeof t=="string"&&t.startsWith(n),Qb=Kb("--"),ew=Kb("var(--"),Kv=n=>ew(n)?nw.test(n.split("/*")[0].trim()):!1,nw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Zb(n){return typeof n!="string"?!1:n.split("/*")[0].includes("var(--")}const yh={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},p0={...yh,transform:n=>Vr(0,1,n)},sg={...yh,default:1},m0=n=>Math.round(n*1e5)/1e5,Qv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function aw(n){return n==null}const iw=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Zv=(n,t)=>i=>!!(typeof i=="string"&&iw.test(i)&&i.startsWith(n)||t&&!aw(i)&&Object.prototype.hasOwnProperty.call(i,t)),Jb=(n,t,i)=>s=>{if(typeof s!="string")return s;const[u,c,f,p]=s.match(Qv);return{[n]:parseFloat(u),[t]:parseFloat(c),[i]:parseFloat(f),alpha:p!==void 0?parseFloat(p):1}},sw=n=>Vr(0,255,n),Jv={...yh,transform:n=>Math.round(sw(n))},Sc={test:Zv("rgb","red"),parse:Jb("red","green","blue"),transform:({red:n,green:t,blue:i,alpha:s=1})=>"rgba("+Jv.transform(n)+", "+Jv.transform(t)+", "+Jv.transform(i)+", "+m0(p0.transform(s))+")"};function lw(n){let t="",i="",s="",u="";return n.length>5?(t=n.substring(1,3),i=n.substring(3,5),s=n.substring(5,7),u=n.substring(7,9)):(t=n.substring(1,2),i=n.substring(2,3),s=n.substring(3,4),u=n.substring(4,5),t+=t,i+=i,s+=s,u+=u),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:u?parseInt(u,16)/255:1}}const Fv={test:Zv("#"),parse:lw,transform:Sc.transform},g0=n=>({test:t=>typeof t=="string"&&t.endsWith(n)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${n}`}),ko=g0("deg"),kl=g0("%"),wt=g0("px"),rw=g0("vh"),ow=g0("vw"),Fb={...kl,parse:n=>kl.parse(n)/100,transform:n=>kl.transform(n*100)},vh={test:Zv("hsl","hue"),parse:Jb("hue","saturation","lightness"),transform:({hue:n,saturation:t,lightness:i,alpha:s=1})=>"hsla("+Math.round(n)+", "+kl.transform(m0(t))+", "+kl.transform(m0(i))+", "+m0(p0.transform(s))+")"},$n={test:n=>Sc.test(n)||Fv.test(n)||vh.test(n),parse:n=>Sc.test(n)?Sc.parse(n):vh.test(n)?vh.parse(n):Fv.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Sc.transform(n):vh.transform(n),getAnimatableNone:n=>{const t=$n.parse(n);return t.alpha=0,$n.transform(t)}},uw=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function cw(n){return isNaN(n)&&typeof n=="string"&&(n.match(Qv)?.length||0)+(n.match(uw)?.length||0)>0}const kb="number",Ib="color",fw="var",hw="var(",Wb="${}",dw=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function y0(n){const t=n.toString(),i=[],s={color:[],number:[],var:[]},u=[];let c=0;const p=t.replace(dw,m=>($n.test(m)?(s.color.push(c),u.push(Ib),i.push($n.parse(m))):m.startsWith(hw)?(s.var.push(c),u.push(fw),i.push(m)):(s.number.push(c),u.push(kb),i.push(parseFloat(m))),++c,Wb)).split(Wb);return{values:i,split:p,indexes:s,types:u}}function $b(n){return y0(n).values}function t8(n){const{split:t,types:i}=y0(n),s=t.length;return u=>{let c="";for(let f=0;f<s;f++)if(c+=t[f],u[f]!==void 0){const p=i[f];p===kb?c+=m0(u[f]):p===Ib?c+=$n.transform(u[f]):c+=u[f]}return c}}const pw=n=>typeof n=="number"?0:$n.test(n)?$n.getAnimatableNone(n):n;function mw(n){const t=$b(n);return t8(n)(t.map(pw))}const Io={test:cw,parse:$b,createTransformer:t8,getAnimatableNone:mw};function kv(n,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?n+(t-n)*6*i:i<1/2?t:i<2/3?n+(t-n)*(2/3-i)*6:n}function gw({hue:n,saturation:t,lightness:i,alpha:s}){n/=360,t/=100,i/=100;let u=0,c=0,f=0;if(!t)u=c=f=i;else{const p=i<.5?i*(1+t):i+t-i*t,m=2*i-p;u=kv(m,p,n+1/3),c=kv(m,p,n),f=kv(m,p,n-1/3)}return{red:Math.round(u*255),green:Math.round(c*255),blue:Math.round(f*255),alpha:s}}function lg(n,t){return i=>i>0?t:n}const Cn=(n,t,i)=>n+(t-n)*i,Iv=(n,t,i)=>{const s=n*n,u=i*(t*t-s)+s;return u<0?0:Math.sqrt(u)},yw=[Fv,Sc,vh],vw=n=>yw.find(t=>t.test(n));function e8(n){const t=vw(n);if(gh(!!t,`'${n}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let i=t.parse(n);return t===vh&&(i=gw(i)),i}const n8=(n,t)=>{const i=e8(n),s=e8(t);if(!i||!s)return lg(n,t);const u={...i};return c=>(u.red=Iv(i.red,s.red,c),u.green=Iv(i.green,s.green,c),u.blue=Iv(i.blue,s.blue,c),u.alpha=Cn(i.alpha,s.alpha,c),Sc.transform(u))},Wv=new Set(["none","hidden"]);function Sw(n,t){return Wv.has(n)?i=>i<=0?n:t:i=>i>=1?t:n}function bw(n,t){return i=>Cn(n,t,i)}function $v(n){return typeof n=="number"?bw:typeof n=="string"?Kv(n)?lg:$n.test(n)?n8:Cw:Array.isArray(n)?a8:typeof n=="object"?$n.test(n)?n8:Ew:lg}function a8(n,t){const i=[...n],s=i.length,u=n.map((c,f)=>$v(c)(c,t[f]));return c=>{for(let f=0;f<s;f++)i[f]=u[f](c);return i}}function Ew(n,t){const i={...n,...t},s={};for(const u in i)n[u]!==void 0&&t[u]!==void 0&&(s[u]=$v(n[u])(n[u],t[u]));return u=>{for(const c in s)i[c]=s[c](u);return i}}function Tw(n,t){const i=[],s={color:0,var:0,number:0};for(let u=0;u<t.values.length;u++){const c=t.types[u],f=n.indexes[c][s[c]],p=n.values[f]??0;i[u]=p,s[c]++}return i}const Cw=(n,t)=>{const i=Io.createTransformer(t),s=y0(n),u=y0(t);return s.indexes.var.length===u.indexes.var.length&&s.indexes.color.length===u.indexes.color.length&&s.indexes.number.length>=u.indexes.number.length?Wv.has(n)&&!u.values.length||Wv.has(t)&&!s.values.length?Sw(n,t):f0(a8(Tw(s,u),u.values),i):(gh(!0,`Complex values '${n}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),lg(n,t))};function i8(n,t,i){return typeof n=="number"&&typeof t=="number"&&typeof i=="number"?Cn(n,t,i):$v(n)(n,t)}const _w=n=>{const t=({timestamp:i})=>n(i);return{start:(i=!0)=>hn.update(t,i),stop:()=>Fo(t),now:()=>wa.isProcessing?wa.timestamp:Ai.now()}},s8=(n,t,i=10)=>{let s="";const u=Math.max(Math.round(t/i),2);for(let c=0;c<u;c++)s+=Math.round(n(c/(u-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},rg=2e4;function tS(n){let t=0;const i=50;let s=n.next(t);for(;!s.done&&t<rg;)t+=i,s=n.next(t);return t>=rg?1/0:t}function xw(n,t=100,i){const s=i({...n,keyframes:[0,t]}),u=Math.min(tS(s),rg);return{type:"keyframes",ease:c=>s.next(u*c).value/t,duration:_s(u)}}const Dw=5;function l8(n,t,i){const s=Math.max(t-Dw,0);return Ob(i-n(s),t-s)}const _n={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},eS=.001;function Aw({duration:n=_n.duration,bounce:t=_n.bounce,velocity:i=_n.velocity,mass:s=_n.mass}){let u,c;gh(n<=ol(_n.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let f=1-t;f=Vr(_n.minDamping,_n.maxDamping,f),n=Vr(_n.minDuration,_n.maxDuration,_s(n)),f<1?(u=S=>{const b=S*f,_=b*n,x=b-i,D=nS(S,f),A=Math.exp(-_);return eS-x/D*A},c=S=>{const _=S*f*n,x=_*i+i,D=Math.pow(f,2)*Math.pow(S,2)*n,A=Math.exp(-_),N=nS(Math.pow(S,2),f);return(-u(S)+eS>0?-1:1)*((x-D)*A)/N}):(u=S=>{const b=Math.exp(-S*n),_=(S-i)*n+1;return-eS+b*_},c=S=>{const b=Math.exp(-S*n),_=(i-S)*(n*n);return b*_});const p=5/n,m=Nw(u,c,p);if(n=ol(n),isNaN(m))return{stiffness:_n.stiffness,damping:_n.damping,duration:n};{const S=Math.pow(m,2)*s;return{stiffness:S,damping:f*2*Math.sqrt(s*S),duration:n}}}const Mw=12;function Nw(n,t,i){let s=i;for(let u=1;u<Mw;u++)s=s-n(s)/t(s);return s}function nS(n,t){return n*Math.sqrt(1-t*t)}const Ow=["duration","bounce"],Rw=["stiffness","damping","mass"];function r8(n,t){return t.some(i=>n[i]!==void 0)}function zw(n){let t={velocity:_n.velocity,stiffness:_n.stiffness,damping:_n.damping,mass:_n.mass,isResolvedFromDuration:!1,...n};if(!r8(n,Rw)&&r8(n,Ow))if(n.visualDuration){const i=n.visualDuration,s=2*Math.PI/(i*1.2),u=s*s,c=2*Vr(.05,1,1-(n.bounce||0))*Math.sqrt(u);t={...t,mass:_n.mass,stiffness:u,damping:c}}else{const i=Aw(n);t={...t,...i,mass:_n.mass},t.isResolvedFromDuration=!0}return t}function og(n=_n.visualDuration,t=_n.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:t}:n;let{restSpeed:s,restDelta:u}=i;const c=i.keyframes[0],f=i.keyframes[i.keyframes.length-1],p={done:!1,value:c},{stiffness:m,damping:S,mass:b,duration:_,velocity:x,isResolvedFromDuration:D}=zw({...i,velocity:-_s(i.velocity||0)}),A=x||0,N=S/(2*Math.sqrt(m*b)),R=f-c,O=_s(Math.sqrt(m/b)),U=Math.abs(R)<5;s||(s=U?_n.restSpeed.granular:_n.restSpeed.default),u||(u=U?_n.restDelta.granular:_n.restDelta.default);let j;if(N<1){const J=nS(O,N);j=$=>{const st=Math.exp(-N*O*$);return f-st*((A+N*O*R)/J*Math.sin(J*$)+R*Math.cos(J*$))}}else if(N===1)j=J=>f-Math.exp(-O*J)*(R+(A+O*R)*J);else{const J=O*Math.sqrt(N*N-1);j=$=>{const st=Math.exp(-N*O*$),I=Math.min(J*$,300);return f-st*((A+N*O*R)*Math.sinh(I)+J*R*Math.cosh(I))/J}}const V={calculatedDuration:D&&_||null,next:J=>{const $=j(J);if(D)p.done=J>=_;else{let st=J===0?A:0;N<1&&(st=J===0?ol(A):l8(j,J,$));const I=Math.abs(st)<=s,et=Math.abs(f-$)<=u;p.done=I&&et}return p.value=p.done?f:$,p},toString:()=>{const J=Math.min(tS(V),rg),$=s8(st=>V.next(J*st).value,J,30);return J+"ms "+$},toTransition:()=>{}};return V}og.applyToOptions=n=>{const t=xw(n,100,og);return n.ease=t.ease,n.duration=ol(t.duration),n.type="keyframes",n};function aS({keyframes:n,velocity:t=0,power:i=.8,timeConstant:s=325,bounceDamping:u=10,bounceStiffness:c=500,modifyTarget:f,min:p,max:m,restDelta:S=.5,restSpeed:b}){const _=n[0],x={done:!1,value:_},D=I=>p!==void 0&&I<p||m!==void 0&&I>m,A=I=>p===void 0?m:m===void 0||Math.abs(p-I)<Math.abs(m-I)?p:m;let N=i*t;const R=_+N,O=f===void 0?R:f(R);O!==R&&(N=O-_);const U=I=>-N*Math.exp(-I/s),j=I=>O+U(I),V=I=>{const et=U(I),nt=j(I);x.done=Math.abs(et)<=S,x.value=x.done?O:nt};let J,$;const st=I=>{D(x.value)&&(J=I,$=og({keyframes:[x.value,A(x.value)],velocity:l8(j,I,x.value),damping:u,stiffness:c,restDelta:S,restSpeed:b}))};return st(0),{calculatedDuration:null,next:I=>{let et=!1;return!$&&J===void 0&&(et=!0,V(I),st(I)),J!==void 0&&I>=J?$.next(I-J):(!et&&V(I),x)}}}function Hw(n,t,i){const s=[],u=i||jr.mix||i8,c=n.length-1;for(let f=0;f<c;f++){let p=u(n[f],n[f+1]);if(t){const m=Array.isArray(t)?t[f]||Cs:t;p=f0(m,p)}s.push(p)}return s}function ww(n,t,{clamp:i=!0,ease:s,mixer:u}={}){const c=n.length;if(Gr(c===t.length,"Both input and output ranges must be the same length","range-length"),c===1)return()=>t[0];if(c===2&&t[0]===t[1])return()=>t[1];const f=n[0]===n[1];n[0]>n[c-1]&&(n=[...n].reverse(),t=[...t].reverse());const p=Hw(t,s,u),m=p.length,S=b=>{if(f&&b<n[0])return t[0];let _=0;if(m>1)for(;_<n.length-2&&!(b<n[_+1]);_++);const x=h0(n[_],n[_+1],b);return p[_](x)};return i?b=>S(Vr(n[0],n[c-1],b)):S}function Uw(n,t){const i=n[n.length-1];for(let s=1;s<=t;s++){const u=h0(0,t,s);n.push(Cn(i,1,u))}}function Bw(n){const t=[0];return Uw(t,n.length-1),t}function Vw(n,t){return n.map(i=>i*t)}function Gw(n,t){return n.map(()=>t||Lb).splice(0,n.length-1)}function Sh({duration:n=300,keyframes:t,times:i,ease:s="easeInOut"}){const u=kH(s)?s.map(qb):qb(s),c={done:!1,value:t[0]},f=Vw(i&&i.length===t.length?i:Bw(t),n),p=ww(f,t,{ease:Array.isArray(u)?u:Gw(t,u)});return{calculatedDuration:n,next:m=>(c.value=p(m),c.done=m>=n,c)}}const jw=n=>n!==null;function iS(n,{repeat:t,repeatType:i="loop"},s,u=1){const c=n.filter(jw),p=u<0||t&&i!=="loop"&&t%2===1?0:c.length-1;return!p||s===void 0?c[p]:s}const Lw={decay:aS,inertia:aS,tween:Sh,keyframes:Sh,spring:og};function o8(n){typeof n.type=="string"&&(n.type=Lw[n.type])}class sS{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,i){return this.finished.then(t,i)}}const Pw=n=>n/100;class lS extends sS{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:i}=this.options;i&&i.updatedAt!==Ai.now()&&this.tick(Ai.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;o8(t);const{type:i=Sh,repeat:s=0,repeatDelay:u=0,repeatType:c,velocity:f=0}=t;let{keyframes:p}=t;const m=i||Sh;process.env.NODE_ENV!=="production"&&m!==Sh&&Gr(p.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${p}`,"spring-two-frames"),m!==Sh&&typeof p[0]!="number"&&(this.mixKeyframes=f0(Pw,i8(p[0],p[1])),p=[0,100]);const S=m({...t,keyframes:p});c==="mirror"&&(this.mirroredGenerator=m({...t,keyframes:[...p].reverse(),velocity:-f})),S.calculatedDuration===null&&(S.calculatedDuration=tS(S));const{calculatedDuration:b}=S;this.calculatedDuration=b,this.resolvedDuration=b+u,this.totalDuration=this.resolvedDuration*(s+1)-u,this.generator=S}updateTime(t){const i=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(t,i=!1){const{generator:s,totalDuration:u,mixKeyframes:c,mirroredGenerator:f,resolvedDuration:p,calculatedDuration:m}=this;if(this.startTime===null)return s.next(0);const{delay:S=0,keyframes:b,repeat:_,repeatType:x,repeatDelay:D,type:A,onUpdate:N,finalKeyframe:R}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),i?this.currentTime=t:this.updateTime(t);const O=this.currentTime-S*(this.playbackSpeed>=0?1:-1),U=this.playbackSpeed>=0?O<0:O>u;this.currentTime=Math.max(O,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let j=this.currentTime,V=s;if(_){const I=Math.min(this.currentTime,u)/p;let et=Math.floor(I),nt=I%1;!nt&&I>=1&&(nt=1),nt===1&&et--,et=Math.min(et,_+1),et%2&&(x==="reverse"?(nt=1-nt,D&&(nt-=D/p)):x==="mirror"&&(V=f)),j=Vr(0,1,nt)*p}const J=U?{done:!1,value:b[0]}:V.next(j);c&&(J.value=c(J.value));let{done:$}=J;!U&&m!==null&&($=this.playbackSpeed>=0?this.currentTime>=u:this.currentTime<=0);const st=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return st&&A!==aS&&(J.value=iS(b,this.options,R,this.speed)),N&&N(J.value),st&&this.finish(),J}then(t,i){return this.finished.then(t,i)}get duration(){return _s(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+_s(t)}get time(){return _s(this.currentTime)}set time(t){t=ol(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Ai.now());const i=this.playbackSpeed!==t;this.playbackSpeed=t,i&&(this.time=_s(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=_w,startTime:i}=this.options;this.driver||(this.driver=t(u=>this.tick(u))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=i??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ai.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Yw(n){for(let t=1;t<n.length;t++)n[t]??(n[t]=n[t-1])}const bc=n=>n*180/Math.PI,rS=n=>{const t=bc(Math.atan2(n[1],n[0]));return oS(t)},qw={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:rS,rotateZ:rS,skewX:n=>bc(Math.atan(n[1])),skewY:n=>bc(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},oS=n=>(n=n%360,n<0&&(n+=360),n),u8=rS,c8=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),f8=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),Xw={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:c8,scaleY:f8,scale:n=>(c8(n)+f8(n))/2,rotateX:n=>oS(bc(Math.atan2(n[6],n[5]))),rotateY:n=>oS(bc(Math.atan2(-n[2],n[0]))),rotateZ:u8,rotate:u8,skewX:n=>bc(Math.atan(n[4])),skewY:n=>bc(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function uS(n){return n.includes("scale")?1:0}function cS(n,t){if(!n||n==="none")return uS(t);const i=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,u;if(i)s=Xw,u=i;else{const p=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=qw,u=p}if(!u)return uS(t);const c=s[t],f=u[1].split(",").map(Qw);return typeof c=="function"?c(f):f[c]}const Kw=(n,t)=>{const{transform:i="none"}=getComputedStyle(n);return cS(i,t)};function Qw(n){return parseFloat(n.trim())}const bh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Eh=new Set(bh),h8=n=>n===yh||n===wt,Zw=new Set(["x","y","z"]),Jw=bh.filter(n=>!Zw.has(n));function Fw(n){const t=[];return Jw.forEach(i=>{const s=n.getValue(i);s!==void 0&&(t.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),t}const Wo={width:({x:n},{paddingLeft:t="0",paddingRight:i="0"})=>n.max-n.min-parseFloat(t)-parseFloat(i),height:({y:n},{paddingTop:t="0",paddingBottom:i="0"})=>n.max-n.min-parseFloat(t)-parseFloat(i),top:(n,{top:t})=>parseFloat(t),left:(n,{left:t})=>parseFloat(t),bottom:({y:n},{top:t})=>parseFloat(t)+(n.max-n.min),right:({x:n},{left:t})=>parseFloat(t)+(n.max-n.min),x:(n,{transform:t})=>cS(t,"x"),y:(n,{transform:t})=>cS(t,"y")};Wo.translateX=Wo.x,Wo.translateY=Wo.y;const Ec=new Set;let fS=!1,hS=!1,dS=!1;function d8(){if(hS){const n=Array.from(Ec).filter(s=>s.needsMeasurement),t=new Set(n.map(s=>s.element)),i=new Map;t.forEach(s=>{const u=Fw(s);u.length&&(i.set(s,u),s.render())}),n.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const u=i.get(s);u&&u.forEach(([c,f])=>{s.getValue(c)?.set(f)})}),n.forEach(s=>s.measureEndState()),n.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}hS=!1,fS=!1,Ec.forEach(n=>n.complete(dS)),Ec.clear()}function p8(){Ec.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(hS=!0)})}function kw(){dS=!0,p8(),d8(),dS=!1}class pS{constructor(t,i,s,u,c,f=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=i,this.name=s,this.motionValue=u,this.element=c,this.isAsync=f}scheduleResolve(){this.state="scheduled",this.isAsync?(Ec.add(this),fS||(fS=!0,hn.read(p8),hn.resolveKeyframes(d8))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:i,element:s,motionValue:u}=this;if(t[0]===null){const c=u?.get(),f=t[t.length-1];if(c!==void 0)t[0]=c;else if(s&&i){const p=s.readValue(i,f);p!=null&&(t[0]=p)}t[0]===void 0&&(t[0]=f),u&&c===void 0&&u.set(t[0])}Yw(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ec.delete(this)}cancel(){this.state==="scheduled"&&(Ec.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Iw=n=>n.startsWith("--");function Ww(n,t,i){Iw(t)?n.style.setProperty(t,i):n.style[t]=i}const $w=jv(()=>window.ScrollTimeline!==void 0),tU={};function eU(n,t){const i=jv(n);return()=>tU[t]??i()}const m8=eU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),v0=([n,t,i,s])=>`cubic-bezier(${n}, ${t}, ${i}, ${s})`,g8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:v0([0,.65,.55,1]),circOut:v0([.55,0,1,.45]),backIn:v0([.31,.01,.66,-.59]),backOut:v0([.33,1.53,.69,.99])};function y8(n,t){if(n)return typeof n=="function"?m8()?s8(n,t):"ease-out":Pb(n)?v0(n):Array.isArray(n)?n.map(i=>y8(i,t)||g8.easeOut):g8[n]}function nU(n,t,i,{delay:s=0,duration:u=300,repeat:c=0,repeatType:f="loop",ease:p="easeOut",times:m}={},S=void 0){const b={[t]:i};m&&(b.offset=m);const _=y8(p,u);Array.isArray(_)&&(b.easing=_);const x={delay:s,duration:u,easing:Array.isArray(_)?"linear":_,fill:"both",iterations:c+1,direction:f==="reverse"?"alternate":"normal"};return S&&(x.pseudoElement=S),n.animate(b,x)}function v8(n){return typeof n=="function"&&"applyToOptions"in n}function aU({type:n,...t}){return v8(n)&&m8()?n.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class iU extends sS{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:i,name:s,keyframes:u,pseudoElement:c,allowFlatten:f=!1,finalKeyframe:p,onComplete:m}=t;this.isPseudoElement=!!c,this.allowFlatten=f,this.options=t,Gr(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const S=aU(t);this.animation=nU(i,s,u,S,c),S.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!c){const b=iS(u,this.options,p,this.speed);this.updateMotionValue?this.updateMotionValue(b):Ww(i,s,b),this.animation.cancel()}m?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return _s(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+_s(t)}get time(){return _s(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=ol(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&$w()?(this.animation.timeline=t,Cs):i(this)}}const S8={anticipate:Vb,backInOut:Bb,circInOut:jb};function sU(n){return n in S8}function lU(n){typeof n.ease=="string"&&sU(n.ease)&&(n.ease=S8[n.ease])}const b8=10;class rU extends iU{constructor(t){lU(t),o8(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:i,onUpdate:s,onComplete:u,element:c,...f}=this.options;if(!i)return;if(t!==void 0){i.set(t);return}const p=new lS({...f,autoplay:!1}),m=ol(this.finishedTime??this.time);i.setWithVelocity(p.sample(m-b8).value,p.sample(m).value,b8),p.stop()}}const E8=(n,t)=>t==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Io.test(n)||n==="0")&&!n.startsWith("url("));function oU(n){const t=n[0];if(n.length===1)return!0;for(let i=0;i<n.length;i++)if(n[i]!==t)return!0}function uU(n,t,i,s){const u=n[0];if(u===null)return!1;if(t==="display"||t==="visibility")return!0;const c=n[n.length-1],f=E8(u,t),p=E8(c,t);return gh(f===p,`You are trying to animate ${t} from "${u}" to "${c}". "${f?c:u}" is not an animatable value.`,"value-not-animatable"),!f||!p?!1:oU(n)||(i==="spring"||v8(i))&&s}function mS(n){n.duration=0,n.type="keyframes"}const cU=new Set(["opacity","clipPath","filter","transform"]),fU=jv(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function hU(n){const{motionValue:t,name:i,repeatDelay:s,repeatType:u,damping:c,type:f}=n;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:S}=t.owner.getProps();return fU()&&i&&cU.has(i)&&(i!=="transform"||!S)&&!m&&!s&&u!=="mirror"&&c!==0&&f!=="inertia"}const dU=40;class pU extends sS{constructor({autoplay:t=!0,delay:i=0,type:s="keyframes",repeat:u=0,repeatDelay:c=0,repeatType:f="loop",keyframes:p,name:m,motionValue:S,element:b,..._}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ai.now();const x={autoplay:t,delay:i,type:s,repeat:u,repeatDelay:c,repeatType:f,name:m,motionValue:S,element:b,..._},D=b?.KeyframeResolver||pS;this.keyframeResolver=new D(p,(A,N,R)=>this.onKeyframesResolved(A,N,x,!R),m,S,b),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,i,s,u){this.keyframeResolver=void 0;const{name:c,type:f,velocity:p,delay:m,isHandoff:S,onUpdate:b}=s;this.resolvedAt=Ai.now(),uU(t,c,f,p)||((jr.instantAnimations||!m)&&b?.(iS(t,s,i)),t[0]=t[t.length-1],mS(s),s.repeat=0);const x={startTime:u?this.resolvedAt?this.resolvedAt-this.createdAt>dU?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...s,keyframes:t},D=!S&&hU(x)?new rU({...x,element:x.motionValue.owner.current}):new lS(x);D.finished.then(()=>this.notifyFinished()).catch(Cs),this.pendingTimeline&&(this.stopTimeline=D.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=D}get finished(){return this._animation?this.animation.finished:this._finished}then(t,i){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),kw()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const mU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function gU(n){const t=mU.exec(n);if(!t)return[,];const[,i,s,u]=t;return[`--${i??s}`,u]}const yU=4;function T8(n,t,i=1){Gr(i<=yU,`Max CSS variable fallback depth detected in property "${n}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,u]=gU(n);if(!s)return;const c=window.getComputedStyle(t).getPropertyValue(s);if(c){const f=c.trim();return Ab(f)?parseFloat(f):f}return Kv(u)?T8(u,t,i+1):u}function gS(n,t){return n?.[t]??n?.default??n}const C8=new Set(["width","height","top","left","right","bottom",...bh]),vU={test:n=>n==="auto",parse:n=>n},_8=n=>t=>t.test(n),x8=[yh,wt,kl,ko,ow,rw,vU],D8=n=>x8.find(_8(n));function SU(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||Nb(n):!0}const bU=new Set(["brightness","contrast","saturate","opacity"]);function EU(n){const[t,i]=n.slice(0,-1).split("(");if(t==="drop-shadow")return n;const[s]=i.match(Qv)||[];if(!s)return n;const u=i.replace(s,"");let c=bU.has(t)?1:0;return s!==i&&(c*=100),t+"("+c+u+")"}const TU=/\b([a-z-]*)\(.*?\)/gu,yS={...Io,getAnimatableNone:n=>{const t=n.match(TU);return t?t.map(EU).join(" "):n}},A8={...yh,transform:Math.round},vS={borderWidth:wt,borderTopWidth:wt,borderRightWidth:wt,borderBottomWidth:wt,borderLeftWidth:wt,borderRadius:wt,radius:wt,borderTopLeftRadius:wt,borderTopRightRadius:wt,borderBottomRightRadius:wt,borderBottomLeftRadius:wt,width:wt,maxWidth:wt,height:wt,maxHeight:wt,top:wt,right:wt,bottom:wt,left:wt,inset:wt,insetBlock:wt,insetBlockStart:wt,insetBlockEnd:wt,insetInline:wt,insetInlineStart:wt,insetInlineEnd:wt,padding:wt,paddingTop:wt,paddingRight:wt,paddingBottom:wt,paddingLeft:wt,paddingBlock:wt,paddingBlockStart:wt,paddingBlockEnd:wt,paddingInline:wt,paddingInlineStart:wt,paddingInlineEnd:wt,margin:wt,marginTop:wt,marginRight:wt,marginBottom:wt,marginLeft:wt,marginBlock:wt,marginBlockStart:wt,marginBlockEnd:wt,marginInline:wt,marginInlineStart:wt,marginInlineEnd:wt,backgroundPositionX:wt,backgroundPositionY:wt,...{rotate:ko,rotateX:ko,rotateY:ko,rotateZ:ko,scale:sg,scaleX:sg,scaleY:sg,scaleZ:sg,skew:ko,skewX:ko,skewY:ko,distance:wt,translateX:wt,translateY:wt,translateZ:wt,x:wt,y:wt,z:wt,perspective:wt,transformPerspective:wt,opacity:p0,originX:Fb,originY:Fb,originZ:wt},zIndex:A8,fillOpacity:p0,strokeOpacity:p0,numOctaves:A8},CU={...vS,color:$n,backgroundColor:$n,outlineColor:$n,fill:$n,stroke:$n,borderColor:$n,borderTopColor:$n,borderRightColor:$n,borderBottomColor:$n,borderLeftColor:$n,filter:yS,WebkitFilter:yS},M8=n=>CU[n];function N8(n,t){let i=M8(n);return i!==yS&&(i=Io),i.getAnimatableNone?i.getAnimatableNone(t):void 0}const _U=new Set(["auto","none","0"]);function xU(n,t,i){let s=0,u;for(;s<n.length&&!u;){const c=n[s];typeof c=="string"&&!_U.has(c)&&y0(c).values.length&&(u=n[s]),s++}if(u&&i)for(const c of t)n[c]=N8(i,u)}class DU extends pS{constructor(t,i,s,u,c){super(t,i,s,u,c,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:i,name:s}=this;if(!i||!i.current)return;super.readKeyframes();for(let b=0;b<t.length;b++){let _=t[b];if(typeof _=="string"&&(_=_.trim(),Kv(_))){const x=T8(_,i.current);x!==void 0&&(t[b]=x),b===t.length-1&&(this.finalKeyframe=_)}}if(this.resolveNoneKeyframes(),!C8.has(s)||t.length!==2)return;const[u,c]=t,f=D8(u),p=D8(c),m=Zb(u),S=Zb(c);if(m!==S&&Wo[s]){this.needsMeasurement=!0;return}if(f!==p)if(h8(f)&&h8(p))for(let b=0;b<t.length;b++){const _=t[b];typeof _=="string"&&(t[b]=parseFloat(_))}else Wo[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:i}=this,s=[];for(let u=0;u<t.length;u++)(t[u]===null||SU(t[u]))&&s.push(u);s.length&&xU(t,s,i)}measureInitialState(){const{element:t,unresolvedKeyframes:i,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Wo[s](t.measureViewportBox(),window.getComputedStyle(t.current)),i[0]=this.measuredOrigin;const u=i[i.length-1];u!==void 0&&t.getValue(s,u).jump(u,!1)}measureEndState(){const{element:t,name:i,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const u=t.getValue(i);u&&u.jump(this.measuredOrigin,!1);const c=s.length-1,f=s[c];s[c]=Wo[i](t.measureViewportBox(),window.getComputedStyle(t.current)),f!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=f),this.removedTransforms?.length&&this.removedTransforms.forEach(([p,m])=>{t.getValue(p).set(m)}),this.resolveNoneKeyframes()}}function AU(n,t,i){if(n instanceof EventTarget)return[n];if(typeof n=="string"){let s=document;const u=i?.[n]??s.querySelectorAll(n);return u?Array.from(u):[]}return Array.from(n)}const O8=(n,t)=>t&&typeof n=="number"?t.transform(n):n;function MU(n){return Mb(n)&&"offsetHeight"in n}const R8=30,NU=n=>!isNaN(parseFloat(n));class OU{constructor(t,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const u=Ai.now();if(this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=i.owner}setCurrent(t){this.current=t,this.updatedAt=Ai.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=NU(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Pv(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,i){this.events[t]||(this.events[t]=new Lv);const s=this.events[t].add(i);return t==="change"?()=>{s(),hn.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,i){this.passiveEffect=t,this.stopPassiveEffect=i}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,i,s){this.set(i),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,i=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ai.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>R8)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,R8);return Ob(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(t){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=t(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Th(n,t){return new OU(n,t)}const{schedule:SS}=Xb(queueMicrotask,!1),ul={x:!1,y:!1};function z8(){return ul.x||ul.y}function RU(n){return n==="x"||n==="y"?ul[n]?null:(ul[n]=!0,()=>{ul[n]=!1}):ul.x||ul.y?null:(ul.x=ul.y=!0,()=>{ul.x=ul.y=!1})}function H8(n,t){const i=AU(n),s=new AbortController,u={passive:!0,...t,signal:s.signal};return[i,u,()=>s.abort()]}function w8(n){return!(n.pointerType==="touch"||z8())}function zU(n,t,i={}){const[s,u,c]=H8(n,i),f=p=>{if(!w8(p))return;const{target:m}=p,S=t(m,p);if(typeof S!="function"||!m)return;const b=_=>{w8(_)&&(S(_),m.removeEventListener("pointerleave",b))};m.addEventListener("pointerleave",b,u)};return s.forEach(p=>{p.addEventListener("pointerenter",f,u)}),c}const U8=(n,t)=>t?n===t?!0:U8(n,t.parentElement):!1,bS=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,HU=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function B8(n){return HU.has(n.tagName)||n.isContentEditable===!0}const ug=new WeakSet;function V8(n){return t=>{t.key==="Enter"&&n(t)}}function ES(n,t){n.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const wU=(n,t)=>{const i=n.currentTarget;if(!i)return;const s=V8(()=>{if(ug.has(i))return;ES(i,"down");const u=V8(()=>{ES(i,"up")}),c=()=>ES(i,"cancel");i.addEventListener("keyup",u,t),i.addEventListener("blur",c,t)});i.addEventListener("keydown",s,t),i.addEventListener("blur",()=>i.removeEventListener("keydown",s),t)};function G8(n){return bS(n)&&!z8()}function UU(n,t,i={}){const[s,u,c]=H8(n,i),f=p=>{const m=p.currentTarget;if(!G8(p))return;ug.add(m);const S=t(m,p),b=(D,A)=>{window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",x),ug.has(m)&&ug.delete(m),G8(D)&&typeof S=="function"&&S(D,{success:A})},_=D=>{b(D,m===window||m===document||i.useGlobalTarget||U8(m,D.target))},x=D=>{b(D,!1)};window.addEventListener("pointerup",_,u),window.addEventListener("pointercancel",x,u)};return s.forEach(p=>{(i.useGlobalTarget?window:p).addEventListener("pointerdown",f,u),MU(p)&&(p.addEventListener("focus",S=>wU(S,u)),!B8(p)&&!p.hasAttribute("tabindex")&&(p.tabIndex=0))}),c}function j8(n){return Mb(n)&&"ownerSVGElement"in n}function BU(n){return j8(n)&&n.tagName==="svg"}const Ia=n=>!!(n&&n.getVelocity),VU=[...x8,$n,Io],GU=n=>VU.find(_8(n)),L8=H.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});function jU(n=!0){const t=H.useContext(Uv);if(t===null)return[!0,null];const{isPresent:i,onExitComplete:s,register:u}=t,c=H.useId();H.useEffect(()=>{if(n)return u(c)},[n]);const f=H.useCallback(()=>n&&s&&s(c),[c,s,n]);return!i&&s?[!1,f]:[!0]}const P8=H.createContext({strict:!1}),Y8={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ch={};for(const n in Y8)Ch[n]={isEnabled:t=>Y8[n].some(i=>!!t[i])};function LU(n){for(const t in n)Ch[t]={...Ch[t],...n[t]}}const PU=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function cg(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||PU.has(n)}let q8=n=>!cg(n);function YU(n){typeof n=="function"&&(q8=t=>t.startsWith("on")?!cg(t):n(t))}try{YU(require("@emotion/is-prop-valid").default)}catch{}function qU(n,t,i){const s={};for(const u in n)u==="values"&&typeof n.values=="object"||(q8(u)||i===!0&&cg(u)||!t&&!cg(u)||n.draggable&&u.startsWith("onDrag"))&&(s[u]=n[u]);return s}const fg=H.createContext({});function hg(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function S0(n){return typeof n=="string"||Array.isArray(n)}const TS=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],CS=["initial",...TS];function dg(n){return hg(n.animate)||CS.some(t=>S0(n[t]))}function X8(n){return!!(dg(n)||n.variants)}function XU(n,t){if(dg(n)){const{initial:i,animate:s}=n;return{initial:i===!1||S0(i)?i:void 0,animate:S0(s)?s:void 0}}return n.inherit!==!1?t:{}}function KU(n){const{initial:t,animate:i}=XU(n,H.useContext(fg));return H.useMemo(()=>({initial:t,animate:i}),[K8(t),K8(i)])}function K8(n){return Array.isArray(n)?n.join(" "):n}function Q8(n,t){return t.max===t.min?0:n/(t.max-t.min)*100}const b0={correct:(n,t)=>{if(!t.target)return n;if(typeof n=="string")if(wt.test(n))n=parseFloat(n);else return n;const i=Q8(n,t.target.x),s=Q8(n,t.target.y);return`${i}% ${s}%`}},QU={correct:(n,{treeScale:t,projectionDelta:i})=>{const s=n,u=Io.parse(n);if(u.length>5)return s;const c=Io.createTransformer(n),f=typeof u[0]!="number"?1:0,p=i.x.scale*t.x,m=i.y.scale*t.y;u[0+f]/=p,u[1+f]/=m;const S=Cn(p,m,.5);return typeof u[2+f]=="number"&&(u[2+f]/=S),typeof u[3+f]=="number"&&(u[3+f]/=S),c(u)}},_S={borderRadius:{...b0,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:b0,borderTopRightRadius:b0,borderBottomLeftRadius:b0,borderBottomRightRadius:b0,boxShadow:QU};function Z8(n,{layout:t,layoutId:i}){return Eh.has(n)||n.startsWith("origin")||(t||i!==void 0)&&(!!_S[n]||n==="opacity")}const ZU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},JU=bh.length;function FU(n,t,i){let s="",u=!0;for(let c=0;c<JU;c++){const f=bh[c],p=n[f];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(f.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const S=O8(p,vS[f]);if(!m){u=!1;const b=ZU[f]||f;s+=`${b}(${S}) `}i&&(t[f]=S)}}return s=s.trim(),i?s=i(t,u?"":s):u&&(s="none"),s}function xS(n,t,i){const{style:s,vars:u,transformOrigin:c}=n;let f=!1,p=!1;for(const m in t){const S=t[m];if(Eh.has(m)){f=!0;continue}else if(Qb(m)){u[m]=S;continue}else{const b=O8(S,vS[m]);m.startsWith("origin")?(p=!0,c[m]=b):s[m]=b}}if(t.transform||(f||i?s.transform=FU(t,n.transform,i):s.transform&&(s.transform="none")),p){const{originX:m="50%",originY:S="50%",originZ:b=0}=c;s.transformOrigin=`${m} ${S} ${b}`}}const DS=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function J8(n,t,i){for(const s in t)!Ia(t[s])&&!Z8(s,i)&&(n[s]=t[s])}function kU({transformTemplate:n},t){return H.useMemo(()=>{const i=DS();return xS(i,t,n),Object.assign({},i.vars,i.style)},[t])}function IU(n,t){const i=n.style||{},s={};return J8(s,i,n),Object.assign(s,kU(n,t)),s}function WU(n,t){const i={},s=IU(n,t);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=s,i}const $U={offset:"stroke-dashoffset",array:"stroke-dasharray"},tB={offset:"strokeDashoffset",array:"strokeDasharray"};function eB(n,t,i=1,s=0,u=!0){n.pathLength=1;const c=u?$U:tB;n[c.offset]=wt.transform(-s);const f=wt.transform(t),p=wt.transform(i);n[c.array]=`${f} ${p}`}const nB=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function F8(n,{attrX:t,attrY:i,attrScale:s,pathLength:u,pathSpacing:c=1,pathOffset:f=0,...p},m,S,b){if(xS(n,p,S),m){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:_,style:x}=n;_.transform&&(x.transform=_.transform,delete _.transform),(x.transform||_.transformOrigin)&&(x.transformOrigin=_.transformOrigin??"50% 50%",delete _.transformOrigin),x.transform&&(x.transformBox=b?.transformBox??"fill-box",delete _.transformBox);for(const D of nB)_[D]!==void 0&&(x[D]=_[D],delete _[D]);t!==void 0&&(_.x=t),i!==void 0&&(_.y=i),s!==void 0&&(_.scale=s),u!==void 0&&eB(_,u,c,f,!1)}const k8=()=>({...DS(),attrs:{}}),I8=n=>typeof n=="string"&&n.toLowerCase()==="svg";function aB(n,t,i,s){const u=H.useMemo(()=>{const c=k8();return F8(c,t,I8(s),n.transformTemplate,n.style),{...c.attrs,style:{...c.style}}},[t]);if(n.style){const c={};J8(c,n.style,n),u.style={...c,...u.style}}return u}const iB=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function AS(n){return typeof n!="string"||n.includes("-")?!1:!!(iB.indexOf(n)>-1||/[A-Z]/u.test(n))}function sB(n,t,i,{latestValues:s},u,c=!1,f){const m=(f??AS(n)?aB:WU)(t,s,u,n),S=qU(t,typeof n=="string",c),b=n!==H.Fragment?{...S,...m,ref:i}:{},{children:_}=t,x=H.useMemo(()=>Ia(_)?_.get():_,[_]);return H.createElement(n,{...b,children:x})}function W8(n){const t=[{},{}];return n?.values.forEach((i,s)=>{t[0][s]=i.get(),t[1][s]=i.getVelocity()}),t}function MS(n,t,i,s){if(typeof t=="function"){const[u,c]=W8(s);t=t(i!==void 0?i:n.custom,u,c)}if(typeof t=="string"&&(t=n.variants&&n.variants[t]),typeof t=="function"){const[u,c]=W8(s);t=t(i!==void 0?i:n.custom,u,c)}return t}function pg(n){return Ia(n)?n.get():n}function lB({scrapeMotionValuesFromProps:n,createRenderState:t},i,s,u){return{latestValues:rB(i,s,u,n),renderState:t()}}function rB(n,t,i,s){const u={},c=s(n,{});for(const x in c)u[x]=pg(c[x]);let{initial:f,animate:p}=n;const m=dg(n),S=X8(n);t&&S&&!m&&n.inherit!==!1&&(f===void 0&&(f=t.initial),p===void 0&&(p=t.animate));let b=i?i.initial===!1:!1;b=b||f===!1;const _=b?p:f;if(_&&typeof _!="boolean"&&!hg(_)){const x=Array.isArray(_)?_:[_];for(let D=0;D<x.length;D++){const A=MS(n,x[D]);if(A){const{transitionEnd:N,transition:R,...O}=A;for(const U in O){let j=O[U];if(Array.isArray(j)){const V=b?j.length-1:0;j=j[V]}j!==null&&(u[U]=j)}for(const U in N)u[U]=N[U]}}}return u}const $8=n=>(t,i)=>{const s=H.useContext(fg),u=H.useContext(Uv),c=()=>lB(n,t,s,u);return i?c():YH(c)};function NS(n,t,i){const{style:s}=n,u={};for(const c in s)(Ia(s[c])||t.style&&Ia(t.style[c])||Z8(c,n)||i?.getValue(c)?.liveStyle!==void 0)&&(u[c]=s[c]);return u}const oB=$8({scrapeMotionValuesFromProps:NS,createRenderState:DS});function t7(n,t,i){const s=NS(n,t,i);for(const u in n)if(Ia(n[u])||Ia(t[u])){const c=bh.indexOf(u)!==-1?"attr"+u.charAt(0).toUpperCase()+u.substring(1):u;s[c]=n[u]}return s}const uB=$8({scrapeMotionValuesFromProps:t7,createRenderState:k8}),cB=Symbol.for("motionComponentSymbol");function fB(n,t,i){const s=H.useRef(i);H.useInsertionEffect(()=>{s.current=i});const u=H.useRef(null);return H.useCallback(c=>{c&&n.onMount?.(c),t&&(c?t.mount(c):t.unmount());const f=s.current;if(typeof f=="function")if(c){const p=f(c);typeof p=="function"&&(u.current=p)}else u.current?(u.current(),u.current=null):f(c);else f&&(f.current=c)},[t])}const OS=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),e7="data-"+OS("framerAppearId"),n7=H.createContext({});function E0(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function hB(n,t,i,s,u,c){const{visualElement:f}=H.useContext(fg),p=H.useContext(P8),m=H.useContext(Uv),S=H.useContext(L8).reducedMotion,b=H.useRef(null);s=s||p.renderer,!b.current&&s&&(b.current=s(n,{visualState:t,parent:f,props:i,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:S,isSVG:c}));const _=b.current,x=H.useContext(n7);_&&!_.projection&&u&&(_.type==="html"||_.type==="svg")&&dB(b.current,i,u,x);const D=H.useRef(!1);H.useInsertionEffect(()=>{_&&D.current&&_.update(i,m)});const A=i[e7],N=H.useRef(!!A&&!window.MotionHandoffIsComplete?.(A)&&window.MotionHasOptimisedAnimation?.(A));return qH(()=>{_&&(D.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),N.current&&_.animationState&&_.animationState.animateChanges())}),H.useEffect(()=>{_&&(!N.current&&_.animationState&&_.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(A)}),N.current=!1),_.enteringChildren=void 0)}),_}function dB(n,t,i,s){const{layoutId:u,layout:c,drag:f,dragConstraints:p,layoutScroll:m,layoutRoot:S,layoutCrossfade:b}=t;n.projection=new i(n.latestValues,t["data-framer-portal-id"]?void 0:a7(n.parent)),n.projection.setOptions({layoutId:u,layout:c,alwaysMeasureLayout:!!f||p&&E0(p),visualElement:n,animationType:typeof c=="string"?c:"both",initialPromotionConfig:s,crossfade:b,layoutScroll:m,layoutRoot:S})}function a7(n){if(n)return n.options.allowProjection!==!1?n.projection:a7(n.parent)}function RS(n,{forwardMotionProps:t=!1,type:i}={},s,u){s&&LU(s);const c=i?i==="svg":AS(n),f=c?uB:oB;function p(S,b){let _;const x={...H.useContext(L8),...S,layoutId:pB(S)},{isStatic:D}=x,A=KU(S),N=f(S,D);if(!D&&wv){mB(x,s);const R=gB(x);_=R.MeasureLayout,A.visualElement=hB(n,N,x,u,R.ProjectionNode,c)}return X.jsxs(fg.Provider,{value:A,children:[_&&A.visualElement?X.jsx(_,{visualElement:A.visualElement,...x}):null,sB(n,S,fB(N,A.visualElement,b),N,D,t,c)]})}p.displayName=`motion.${typeof n=="string"?n:`create(${n.displayName??n.name??""})`}`;const m=H.forwardRef(p);return m[cB]=n,m}function pB({layoutId:n}){const t=H.useContext(Db).id;return t&&n!==void 0?t+"-"+n:n}function mB(n,t){const i=H.useContext(P8).strict;if(process.env.NODE_ENV!=="production"&&t&&i){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";n.ignoreStrict?gh(!1,s,"lazy-strict-mode"):Gr(!1,s,"lazy-strict-mode")}}function gB(n){const{drag:t,layout:i}=Ch;if(!t&&!i)return{};const s={...t,...i};return{MeasureLayout:t?.isEnabled(n)||i?.isEnabled(n)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function yB(n,t){if(typeof Proxy>"u")return RS;const i=new Map,s=(c,f)=>RS(c,f,n,t),u=(c,f)=>(process.env.NODE_ENV!=="production"&&Pv(!1,"motion() is deprecated. Use motion.create() instead."),s(c,f));return new Proxy(u,{get:(c,f)=>f==="create"?s:(i.has(f)||i.set(f,RS(f,void 0,n,t)),i.get(f))})}function i7({top:n,left:t,right:i,bottom:s}){return{x:{min:t,max:i},y:{min:n,max:s}}}function vB({x:n,y:t}){return{top:t.min,right:n.max,bottom:t.max,left:n.min}}function SB(n,t){if(!t)return n;const i=t({x:n.left,y:n.top}),s=t({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}function zS(n){return n===void 0||n===1}function HS({scale:n,scaleX:t,scaleY:i}){return!zS(n)||!zS(t)||!zS(i)}function Tc(n){return HS(n)||s7(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function s7(n){return l7(n.x)||l7(n.y)}function l7(n){return n&&n!=="0%"}function mg(n,t,i){const s=n-i,u=t*s;return i+u}function r7(n,t,i,s,u){return u!==void 0&&(n=mg(n,u,s)),mg(n,i,s)+t}function wS(n,t=0,i=1,s,u){n.min=r7(n.min,t,i,s,u),n.max=r7(n.max,t,i,s,u)}function o7(n,{x:t,y:i}){wS(n.x,t.translate,t.scale,t.originPoint),wS(n.y,i.translate,i.scale,i.originPoint)}const u7=.999999999999,c7=1.0000000000001;function bB(n,t,i,s=!1){const u=i.length;if(!u)return;t.x=t.y=1;let c,f;for(let p=0;p<u;p++){c=i[p],f=c.projectionDelta;const{visualElement:m}=c.options;m&&m.props.style&&m.props.style.display==="contents"||(s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&xh(n,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),f&&(t.x*=f.x.scale,t.y*=f.y.scale,o7(n,f)),s&&Tc(c.latestValues)&&xh(n,c.latestValues))}t.x<c7&&t.x>u7&&(t.x=1),t.y<c7&&t.y>u7&&(t.y=1)}function _h(n,t){n.min=n.min+t,n.max=n.max+t}function f7(n,t,i,s,u=.5){const c=Cn(n.min,n.max,u);wS(n,t,i,c,s)}function xh(n,t){f7(n.x,t.x,t.scaleX,t.scale,t.originX),f7(n.y,t.y,t.scaleY,t.scale,t.originY)}function h7(n,t){return i7(SB(n.getBoundingClientRect(),t))}function EB(n,t,i){const s=h7(n,i),{scroll:u}=t;return u&&(_h(s.x,u.offset.x),_h(s.y,u.offset.y)),s}const d7=()=>({translate:0,scale:1,origin:0,originPoint:0}),Dh=()=>({x:d7(),y:d7()}),p7=()=>({min:0,max:0}),fa=()=>({x:p7(),y:p7()}),US={current:null},m7={current:!1};function TB(){if(m7.current=!0,!!wv)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),t=()=>US.current=n.matches;n.addEventListener("change",t),t()}else US.current=!1}const CB=new WeakMap;function _B(n,t,i){for(const s in t){const u=t[s],c=i[s];if(Ia(u))n.addValue(s,u);else if(Ia(c))n.addValue(s,Th(u,{owner:n}));else if(c!==u)if(n.hasValue(s)){const f=n.getValue(s);f.liveStyle===!0?f.jump(u):f.hasAnimated||f.set(u)}else{const f=n.getStaticValue(s);n.addValue(s,Th(f!==void 0?f:u,{owner:n}))}}for(const s in i)t[s]===void 0&&n.removeValue(s);return t}const g7=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class xB{scrapeMotionValuesFromProps(t,i,s){return{}}constructor({parent:t,props:i,presenceContext:s,reducedMotionConfig:u,blockInitialAnimation:c,visualState:f},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=pS,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=Ai.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,hn.render(this.render,!1,!0))};const{latestValues:m,renderState:S}=f;this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=S,this.parent=t,this.props=i,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=u,this.options=p,this.blockInitialAnimation=!!c,this.isControllingVariants=dg(i),this.isVariantNode=X8(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:b,..._}=this.scrapeMotionValuesFromProps(i,{},this);for(const x in _){const D=_[x];m[x]!==void 0&&Ia(D)&&D.set(m[x])}}mount(t){this.current=t,CB.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(m7.current||TB(),this.shouldReduceMotion=US.current),process.env.NODE_ENV!=="production"&&Pv(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Fo(this.notifyUpdate),Fo(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const i=this.features[t];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,i){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=Eh.has(t);s&&this.onBindTransform&&this.onBindTransform();const u=i.on("change",f=>{this.latestValues[t]=f,this.props.onUpdate&&hn.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let c;window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,i)),this.valueSubscriptions.set(t,()=>{u(),c&&c(),i.owner&&i.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ch){const i=Ch[t];if(!i)continue;const{isEnabled:s,Feature:u}=i;if(!this.features[t]&&u&&s(this.props)&&(this.features[t]=new u(this)),this.features[t]){const c=this.features[t];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fa()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,i){this.latestValues[t]=i}update(t,i){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let s=0;s<g7.length;s++){const u=g7[s];this.propEventSubscriptions[u]&&(this.propEventSubscriptions[u](),delete this.propEventSubscriptions[u]);const c="on"+u,f=t[c];f&&(this.propEventSubscriptions[u]=this.on(u,f))}this.prevMotionValues=_B(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(t),()=>i.variantChildren.delete(t)}addValue(t,i){const s=this.values.get(t);i!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,i),this.values.set(t,i),this.latestValues[t]=i.get())}removeValue(t){this.values.delete(t);const i=this.valueSubscriptions.get(t);i&&(i(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,i){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&i!==void 0&&(s=Th(i===null?void 0:i,{owner:this}),this.addValue(t,s)),s}readValue(t,i){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Ab(s)||Nb(s))?s=parseFloat(s):!GU(s)&&Io.test(i)&&(s=N8(t,i)),this.setBaseTarget(t,Ia(s)?s.get():s)),Ia(s)?s.get():s}setBaseTarget(t,i){this.baseTarget[t]=i}getBaseTarget(t){const{initial:i}=this.props;let s;if(typeof i=="string"||typeof i=="object"){const c=MS(this.props,i,this.presenceContext?.custom);c&&(s=c[t])}if(i&&s!==void 0)return s;const u=this.getBaseTargetFromProps(this.props,t);return u!==void 0&&!Ia(u)?u:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,i){return this.events[t]||(this.events[t]=new Lv),this.events[t].add(i)}notify(t,...i){this.events[t]&&this.events[t].notify(...i)}scheduleRenderMicrotask(){SS.render(this.render)}}class y7 extends xB{constructor(){super(...arguments),this.KeyframeResolver=DU}sortInstanceNodePosition(t,i){return t.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(t,i){return t.style?t.style[i]:void 0}removeValueFromRenderState(t,{vars:i,style:s}){delete i[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ia(t)&&(this.childSubscription=t.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function v7(n,{style:t,vars:i},s,u){const c=n.style;let f;for(f in t)c[f]=t[f];u?.applyProjectionStyles(c,s);for(f in i)c.setProperty(f,i[f])}function DB(n){return window.getComputedStyle(n)}class AB extends y7{constructor(){super(...arguments),this.type="html",this.renderInstance=v7}readValueFromInstance(t,i){if(Eh.has(i))return this.projection?.isProjecting?uS(i):Kw(t,i);{const s=DB(t),u=(Qb(i)?s.getPropertyValue(i):s[i])||0;return typeof u=="string"?u.trim():u}}measureInstanceViewportBox(t,{transformPagePoint:i}){return h7(t,i)}build(t,i,s){xS(t,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,i,s){return NS(t,i,s)}}const S7=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function MB(n,t,i,s){v7(n,t,void 0,s);for(const u in t.attrs)n.setAttribute(S7.has(u)?u:OS(u),t.attrs[u])}class NB extends y7{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fa}getBaseTargetFromProps(t,i){return t[i]}readValueFromInstance(t,i){if(Eh.has(i)){const s=M8(i);return s&&s.default||0}return i=S7.has(i)?i:OS(i),t.getAttribute(i)}scrapeMotionValuesFromProps(t,i,s){return t7(t,i,s)}build(t,i,s){F8(t,i,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,i,s,u){MB(t,i,s,u)}mount(t){this.isSVGTag=I8(t.tagName),super.mount(t)}}const OB=(n,t)=>t.isSVG??AS(n)?new NB(t):new AB(t,{allowProjection:n!==H.Fragment});function Ah(n,t,i){const s=n.getProps();return MS(s,t,i!==void 0?i:s.custom,n)}const BS=n=>Array.isArray(n);function RB(n,t,i){n.hasValue(t)?n.getValue(t).set(i):n.addValue(t,Th(i))}function zB(n){return BS(n)?n[n.length-1]||0:n}function HB(n,t){const i=Ah(n,t);let{transitionEnd:s={},transition:u={},...c}=i||{};c={...c,...s};for(const f in c){const p=zB(c[f]);RB(n,f,p)}}function wB(n){return!!(Ia(n)&&n.add)}function VS(n,t){const i=n.getValue("willChange");if(wB(i))return i.add(t);if(!i&&jr.WillChange){const s=new jr.WillChange("auto");n.addValue("willChange",s),s.add(t)}}function b7(n){return n.props[e7]}const UB=n=>n!==null;function BB(n,{repeat:t,repeatType:i="loop"},s){const u=n.filter(UB),c=t&&i!=="loop"&&t%2===1?0:u.length-1;return u[c]}const VB={type:"spring",stiffness:500,damping:25,restSpeed:10},GB=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),jB={type:"keyframes",duration:.8},LB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PB=(n,{keyframes:t})=>t.length>2?jB:Eh.has(n)?n.startsWith("scale")?GB(t[1]):VB:LB;function YB({when:n,delay:t,delayChildren:i,staggerChildren:s,staggerDirection:u,repeat:c,repeatType:f,repeatDelay:p,from:m,elapsed:S,...b}){return!!Object.keys(b).length}const GS=(n,t,i,s={},u,c)=>f=>{const p=gS(s,n)||{},m=p.delay||s.delay||0;let{elapsed:S=0}=s;S=S-ol(m);const b={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:t.getVelocity(),...p,delay:-S,onUpdate:x=>{t.set(x),p.onUpdate&&p.onUpdate(x)},onComplete:()=>{f(),p.onComplete&&p.onComplete()},name:n,motionValue:t,element:c?void 0:u};YB(p)||Object.assign(b,PB(n,b)),b.duration&&(b.duration=ol(b.duration)),b.repeatDelay&&(b.repeatDelay=ol(b.repeatDelay)),b.from!==void 0&&(b.keyframes[0]=b.from);let _=!1;if((b.type===!1||b.duration===0&&!b.repeatDelay)&&(mS(b),b.delay===0&&(_=!0)),(jr.instantAnimations||jr.skipAnimations)&&(_=!0,mS(b),b.delay=0),b.allowFlatten=!p.type&&!p.ease,_&&!c&&t.get()!==void 0){const x=BB(b.keyframes,p);if(x!==void 0){hn.update(()=>{b.onUpdate(x),b.onComplete()});return}}return p.isSync?new lS(b):new pU(b)};function qB({protectedKeys:n,needsAnimating:t},i){const s=n.hasOwnProperty(i)&&t[i]!==!0;return t[i]=!1,s}function E7(n,t,{delay:i=0,transitionOverride:s,type:u}={}){let{transition:c=n.getDefaultTransition(),transitionEnd:f,...p}=t;s&&(c=s);const m=[],S=u&&n.animationState&&n.animationState.getState()[u];for(const b in p){const _=n.getValue(b,n.latestValues[b]??null),x=p[b];if(x===void 0||S&&qB(S,b))continue;const D={delay:i,...gS(c||{},b)},A=_.get();if(A!==void 0&&!_.isAnimating&&!Array.isArray(x)&&x===A&&!D.velocity)continue;let N=!1;if(window.MotionHandoffAnimation){const O=b7(n);if(O){const U=window.MotionHandoffAnimation(O,b,hn);U!==null&&(D.startTime=U,N=!0)}}VS(n,b),_.start(GS(b,_,x,n.shouldReduceMotion&&C8.has(b)?{type:!1}:D,n,N));const R=_.animation;R&&m.push(R)}return f&&Promise.all(m).then(()=>{hn.update(()=>{f&&HB(n,f)})}),m}function T7(n,t,i,s=0,u=1){const c=Array.from(n).sort((S,b)=>S.sortNodePosition(b)).indexOf(t),f=n.size,p=(f-1)*s;return typeof i=="function"?i(c,f):u===1?c*s:p-c*s}function jS(n,t,i={}){const s=Ah(n,t,i.type==="exit"?n.presenceContext?.custom:void 0);let{transition:u=n.getDefaultTransition()||{}}=s||{};i.transitionOverride&&(u=i.transitionOverride);const c=s?()=>Promise.all(E7(n,s,i)):()=>Promise.resolve(),f=n.variantChildren&&n.variantChildren.size?(m=0)=>{const{delayChildren:S=0,staggerChildren:b,staggerDirection:_}=u;return XB(n,t,m,S,b,_,i)}:()=>Promise.resolve(),{when:p}=u;if(p){const[m,S]=p==="beforeChildren"?[c,f]:[f,c];return m().then(()=>S())}else return Promise.all([c(),f(i.delay)])}function XB(n,t,i=0,s=0,u=0,c=1,f){const p=[];for(const m of n.variantChildren)m.notify("AnimationStart",t),p.push(jS(m,t,{...f,delay:i+(typeof s=="function"?0:s)+T7(n.variantChildren,m,s,u,c)}).then(()=>m.notify("AnimationComplete",t)));return Promise.all(p)}function KB(n,t,i={}){n.notify("AnimationStart",t);let s;if(Array.isArray(t)){const u=t.map(c=>jS(n,c,i));s=Promise.all(u)}else if(typeof t=="string")s=jS(n,t,i);else{const u=typeof t=="function"?Ah(n,t,i.custom):t;s=Promise.all(E7(n,u,i))}return s.then(()=>{n.notify("AnimationComplete",t)})}function C7(n,t){if(!Array.isArray(t))return!1;const i=t.length;if(i!==n.length)return!1;for(let s=0;s<i;s++)if(t[s]!==n[s])return!1;return!0}const QB=CS.length;function _7(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?_7(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const t={};for(let i=0;i<QB;i++){const s=CS[i],u=n.props[s];(S0(u)||u===!1)&&(t[s]=u)}return t}const ZB=[...TS].reverse(),JB=TS.length;function FB(n){return t=>Promise.all(t.map(({animation:i,options:s})=>KB(n,i,s)))}function kB(n){let t=FB(n),i=x7(),s=!0;const u=m=>(S,b)=>{const _=Ah(n,b,m==="exit"?n.presenceContext?.custom:void 0);if(_){const{transition:x,transitionEnd:D,...A}=_;S={...S,...A,...D}}return S};function c(m){t=m(n)}function f(m){const{props:S}=n,b=_7(n.parent)||{},_=[],x=new Set;let D={},A=1/0;for(let R=0;R<JB;R++){const O=ZB[R],U=i[O],j=S[O]!==void 0?S[O]:b[O],V=S0(j),J=O===m?U.isActive:null;J===!1&&(A=R);let $=j===b[O]&&j!==S[O]&&V;if($&&s&&n.manuallyAnimateOnMount&&($=!1),U.protectedKeys={...D},!U.isActive&&J===null||!j&&!U.prevProp||hg(j)||typeof j=="boolean")continue;const st=IB(U.prevProp,j);let I=st||O===m&&U.isActive&&!$&&V||R>A&&V,et=!1;const nt=Array.isArray(j)?j:[j];let bt=nt.reduce(u(O),{});J===!1&&(bt={});const{prevResolvedValues:rt={}}=U,dt={...rt,...bt},pt=F=>{I=!0,x.has(F)&&(et=!0,x.delete(F)),U.needsAnimating[F]=!0;const K=n.getValue(F);K&&(K.liveStyle=!1)};for(const F in dt){const K=bt[F],at=rt[F];if(D.hasOwnProperty(F))continue;let St=!1;BS(K)&&BS(at)?St=!C7(K,at):St=K!==at,St?K!=null?pt(F):x.add(F):K!==void 0&&x.has(F)?pt(F):U.protectedKeys[F]=!0}U.prevProp=j,U.prevResolvedValues=bt,U.isActive&&(D={...D,...bt}),s&&n.blockInitialAnimation&&(I=!1);const tt=$&&st;I&&(!tt||et)&&_.push(...nt.map(F=>{const K={type:O};if(typeof F=="string"&&s&&!tt&&n.manuallyAnimateOnMount&&n.parent){const{parent:at}=n,St=Ah(at,F);if(at.enteringChildren&&St){const{delayChildren:W}=St.transition||{};K.delay=T7(at.enteringChildren,n,W)}}return{animation:F,options:K}}))}if(x.size){const R={};if(typeof S.initial!="boolean"){const O=Ah(n,Array.isArray(S.initial)?S.initial[0]:S.initial);O&&O.transition&&(R.transition=O.transition)}x.forEach(O=>{const U=n.getBaseTarget(O),j=n.getValue(O);j&&(j.liveStyle=!0),R[O]=U??null}),_.push({animation:R})}let N=!!_.length;return s&&(S.initial===!1||S.initial===S.animate)&&!n.manuallyAnimateOnMount&&(N=!1),s=!1,N?t(_):Promise.resolve()}function p(m,S){if(i[m].isActive===S)return Promise.resolve();n.variantChildren?.forEach(_=>_.animationState?.setActive(m,S)),i[m].isActive=S;const b=f(m);for(const _ in i)i[_].protectedKeys={};return b}return{animateChanges:f,setActive:p,setAnimateFunction:c,getState:()=>i,reset:()=>{i=x7()}}}function IB(n,t){return typeof t=="string"?t!==n:Array.isArray(t)?!C7(t,n):!1}function Cc(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function x7(){return{animate:Cc(!0),whileInView:Cc(),whileHover:Cc(),whileTap:Cc(),whileDrag:Cc(),whileFocus:Cc(),exit:Cc()}}class $o{constructor(t){this.isMounted=!1,this.node=t}update(){}}class WB extends $o{constructor(t){super(t),t.animationState||(t.animationState=kB(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();hg(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:i}=this.node.prevProps||{};t!==i&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let $B=0;class tV extends $o{constructor(){super(...arguments),this.id=$B++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const u=this.node.animationState.setActive("exit",!t);i&&!t&&u.then(()=>{i(this.id)})}mount(){const{register:t,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const eV={animation:{Feature:WB},exit:{Feature:tV}};function T0(n,t,i,s={passive:!0}){return n.addEventListener(t,i,s),()=>n.removeEventListener(t,i)}function C0(n){return{point:{x:n.pageX,y:n.pageY}}}const nV=n=>t=>bS(t)&&n(t,C0(t));function _0(n,t,i,s){return T0(n,t,nV(i),s)}const D7=1e-4,aV=1-D7,iV=1+D7,A7=.01,sV=0-A7,lV=0+A7;function hi(n){return n.max-n.min}function rV(n,t,i){return Math.abs(n-t)<=i}function M7(n,t,i,s=.5){n.origin=s,n.originPoint=Cn(t.min,t.max,n.origin),n.scale=hi(i)/hi(t),n.translate=Cn(i.min,i.max,n.origin)-n.originPoint,(n.scale>=aV&&n.scale<=iV||isNaN(n.scale))&&(n.scale=1),(n.translate>=sV&&n.translate<=lV||isNaN(n.translate))&&(n.translate=0)}function x0(n,t,i,s){M7(n.x,t.x,i.x,s?s.originX:void 0),M7(n.y,t.y,i.y,s?s.originY:void 0)}function N7(n,t,i){n.min=i.min+t.min,n.max=n.min+hi(t)}function oV(n,t,i){N7(n.x,t.x,i.x),N7(n.y,t.y,i.y)}function O7(n,t,i){n.min=t.min-i.min,n.max=n.min+hi(t)}function gg(n,t,i){O7(n.x,t.x,i.x),O7(n.y,t.y,i.y)}function xs(n){return[n("x"),n("y")]}const R7=({current:n})=>n?n.ownerDocument.defaultView:null,z7=(n,t)=>Math.abs(n-t);function uV(n,t){const i=z7(n.x,t.x),s=z7(n.y,t.y);return Math.sqrt(i**2+s**2)}class H7{constructor(t,i,{transformPagePoint:s,contextWindow:u=window,dragSnapToOrigin:c=!1,distanceThreshold:f=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=PS(this.lastMoveEventInfo,this.history),D=this.startEvent!==null,A=uV(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!D&&!A)return;const{point:N}=x,{timestamp:R}=wa;this.history.push({...N,timestamp:R});const{onStart:O,onMove:U}=this.handlers;D||(O&&O(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),U&&U(this.lastMoveEvent,x)},this.handlePointerMove=(x,D)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=LS(D,this.transformPagePoint),hn.update(this.updatePoint,!0)},this.handlePointerUp=(x,D)=>{this.end();const{onEnd:A,onSessionEnd:N,resumeAnimation:R}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&R&&R(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const O=PS(x.type==="pointercancel"?this.lastMoveEventInfo:LS(D,this.transformPagePoint),this.history);this.startEvent&&A&&A(x,O),N&&N(x,O)},!bS(t))return;this.dragSnapToOrigin=c,this.handlers=i,this.transformPagePoint=s,this.distanceThreshold=f,this.contextWindow=u||window;const p=C0(t),m=LS(p,this.transformPagePoint),{point:S}=m,{timestamp:b}=wa;this.history=[{...S,timestamp:b}];const{onSessionStart:_}=i;_&&_(t,PS(m,this.history)),this.removeListeners=f0(_0(this.contextWindow,"pointermove",this.handlePointerMove),_0(this.contextWindow,"pointerup",this.handlePointerUp),_0(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Fo(this.updatePoint)}}function LS(n,t){return t?{point:t(n.point)}:n}function w7(n,t){return{x:n.x-t.x,y:n.y-t.y}}function PS({point:n},t){return{point:n,delta:w7(n,U7(t)),offset:w7(n,cV(t)),velocity:fV(t,.1)}}function cV(n){return n[0]}function U7(n){return n[n.length-1]}function fV(n,t){if(n.length<2)return{x:0,y:0};let i=n.length-1,s=null;const u=U7(n);for(;i>=0&&(s=n[i],!(u.timestamp-s.timestamp>ol(t)));)i--;if(!s)return{x:0,y:0};const c=_s(u.timestamp-s.timestamp);if(c===0)return{x:0,y:0};const f={x:(u.x-s.x)/c,y:(u.y-s.y)/c};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}function hV(n,{min:t,max:i},s){return t!==void 0&&n<t?n=s?Cn(t,n,s.min):Math.max(n,t):i!==void 0&&n>i&&(n=s?Cn(i,n,s.max):Math.min(n,i)),n}function B7(n,t,i){return{min:t!==void 0?n.min+t:void 0,max:i!==void 0?n.max+i-(n.max-n.min):void 0}}function dV(n,{top:t,left:i,bottom:s,right:u}){return{x:B7(n.x,i,u),y:B7(n.y,t,s)}}function V7(n,t){let i=t.min-n.min,s=t.max-n.max;return t.max-t.min<n.max-n.min&&([i,s]=[s,i]),{min:i,max:s}}function pV(n,t){return{x:V7(n.x,t.x),y:V7(n.y,t.y)}}function mV(n,t){let i=.5;const s=hi(n),u=hi(t);return u>s?i=h0(t.min,t.max-s,n.min):s>u&&(i=h0(n.min,n.max-u,t.min)),Vr(0,1,i)}function gV(n,t){const i={};return t.min!==void 0&&(i.min=t.min-n.min),t.max!==void 0&&(i.max=t.max-n.min),i}const YS=.35;function yV(n=YS){return n===!1?n=0:n===!0&&(n=YS),{x:G7(n,"left","right"),y:G7(n,"top","bottom")}}function G7(n,t,i){return{min:j7(n,t),max:j7(n,i)}}function j7(n,t){return typeof n=="number"?n:n[t]||0}const vV=new WeakMap;class SV{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fa(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:i=!1,distanceThreshold:s}={}){const{presenceContext:u}=this.visualElement;if(u&&u.isPresent===!1)return;const c=_=>{i?(this.stopAnimation(),this.snapToCursor(C0(_).point)):this.pauseAnimation()},f=(_,x)=>{this.stopAnimation();const{drag:D,dragPropagation:A,onDragStart:N}=this.getProps();if(D&&!A&&(this.openDragLock&&this.openDragLock(),this.openDragLock=RU(D),!this.openDragLock))return;this.latestPointerEvent=_,this.latestPanInfo=x,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),xs(O=>{let U=this.getAxisMotionValue(O).get()||0;if(kl.test(U)){const{projection:j}=this.visualElement;if(j&&j.layout){const V=j.layout.layoutBox[O];V&&(U=hi(V)*(parseFloat(U)/100))}}this.originPoint[O]=U}),N&&hn.postRender(()=>N(_,x)),VS(this.visualElement,"transform");const{animationState:R}=this.visualElement;R&&R.setActive("whileDrag",!0)},p=(_,x)=>{this.latestPointerEvent=_,this.latestPanInfo=x;const{dragPropagation:D,dragDirectionLock:A,onDirectionLock:N,onDrag:R}=this.getProps();if(!D&&!this.openDragLock)return;const{offset:O}=x;if(A&&this.currentDirection===null){this.currentDirection=bV(O),this.currentDirection!==null&&N&&N(this.currentDirection);return}this.updateAxis("x",x.point,O),this.updateAxis("y",x.point,O),this.visualElement.render(),R&&R(_,x)},m=(_,x)=>{this.latestPointerEvent=_,this.latestPanInfo=x,this.stop(_,x),this.latestPointerEvent=null,this.latestPanInfo=null},S=()=>xs(_=>this.getAnimationState(_)==="paused"&&this.getAxisMotionValue(_).animation?.play()),{dragSnapToOrigin:b}=this.getProps();this.panSession=new H7(t,{onSessionStart:c,onStart:f,onMove:p,onSessionEnd:m,resumeAnimation:S},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:b,distanceThreshold:s,contextWindow:R7(this.visualElement)})}stop(t,i){const s=t||this.latestPointerEvent,u=i||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!u||!s)return;const{velocity:f}=u;this.startAnimation(f);const{onDragEnd:p}=this.getProps();p&&hn.postRender(()=>p(s,u))}cancel(){this.isDragging=!1;const{projection:t,animationState:i}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(t,i,s){const{drag:u}=this.getProps();if(!s||!yg(t,u,this.currentDirection))return;const c=this.getAxisMotionValue(t);let f=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(f=hV(f,this.constraints[t],this.elastic[t])),c.set(f)}resolveConstraints(){const{dragConstraints:t,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,u=this.constraints;t&&E0(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=dV(s.layoutBox,t):this.constraints=!1,this.elastic=yV(i),u!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&xs(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=gV(s.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!E0(t))return!1;const s=t.current;Gr(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:u}=this.visualElement;if(!u||!u.layout)return!1;const c=EB(s,u.root,this.visualElement.getTransformPagePoint());let f=pV(u.layout.layoutBox,c);if(i){const p=i(vB(f));this.hasMutatedConstraints=!!p,p&&(f=i7(p))}return f}startAnimation(t){const{drag:i,dragMomentum:s,dragElastic:u,dragTransition:c,dragSnapToOrigin:f,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},S=xs(b=>{if(!yg(b,i,this.currentDirection))return;let _=m&&m[b]||{};f&&(_={min:0,max:0});const x=u?200:1e6,D=u?40:1e7,A={type:"inertia",velocity:s?t[b]:0,bounceStiffness:x,bounceDamping:D,timeConstant:750,restDelta:1,restSpeed:10,...c,..._};return this.startAxisValueAnimation(b,A)});return Promise.all(S).then(p)}startAxisValueAnimation(t,i){const s=this.getAxisMotionValue(t);return VS(this.visualElement,t),s.start(GS(t,s,0,i,this.visualElement,!1))}stopAnimation(){xs(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){xs(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const i=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),u=s[i];return u||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){xs(i=>{const{drag:s}=this.getProps();if(!yg(i,s,this.currentDirection))return;const{projection:u}=this.visualElement,c=this.getAxisMotionValue(i);if(u&&u.layout){const{min:f,max:p}=u.layout.layoutBox[i],m=c.get()||0;c.set(t[i]-Cn(f,p,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:i}=this.getProps(),{projection:s}=this.visualElement;if(!E0(i)||!s||!this.constraints)return;this.stopAnimation();const u={x:0,y:0};xs(f=>{const p=this.getAxisMotionValue(f);if(p&&this.constraints!==!1){const m=p.get();u[f]=mV({min:m,max:m},this.constraints[f])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),xs(f=>{if(!yg(f,t,null))return;const p=this.getAxisMotionValue(f),{min:m,max:S}=this.constraints[f];p.set(Cn(m,S,u[f]))})}addListeners(){if(!this.visualElement.current)return;vV.set(this.visualElement,this);const t=this.visualElement.current,i=_0(t,"pointerdown",m=>{const{drag:S,dragListener:b=!0}=this.getProps();S&&b&&!B8(m.target)&&this.start(m)}),s=()=>{const{dragConstraints:m}=this.getProps();E0(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:u}=this.visualElement,c=u.addEventListener("measure",s);u&&!u.layout&&(u.root&&u.root.updateScroll(),u.updateLayout()),hn.read(s);const f=T0(window,"resize",()=>this.scalePositionWithinConstraints()),p=u.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:S})=>{this.isDragging&&S&&(xs(b=>{const _=this.getAxisMotionValue(b);_&&(this.originPoint[b]+=m[b].translate,_.set(_.get()+m[b].translate))}),this.visualElement.render())}));return()=>{f(),i(),c(),p&&p()}}getProps(){const t=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:s=!1,dragPropagation:u=!1,dragConstraints:c=!1,dragElastic:f=YS,dragMomentum:p=!0}=t;return{...t,drag:i,dragDirectionLock:s,dragPropagation:u,dragConstraints:c,dragElastic:f,dragMomentum:p}}}function yg(n,t,i){return(t===!0||t===n)&&(i===null||i===n)}function bV(n,t=10){let i=null;return Math.abs(n.y)>t?i="y":Math.abs(n.x)>t&&(i="x"),i}class EV extends $o{constructor(t){super(t),this.removeGroupControls=Cs,this.removeListeners=Cs,this.controls=new SV(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Cs}update(){const{dragControls:t}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};t!==i&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const L7=n=>(t,i)=>{n&&hn.postRender(()=>n(t,i))};class TV extends $o{constructor(){super(...arguments),this.removePointerDownListener=Cs}onPointerDown(t){this.session=new H7(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:R7(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:i,onPan:s,onPanEnd:u}=this.node.getProps();return{onSessionStart:L7(t),onStart:L7(i),onMove:s,onEnd:(c,f)=>{delete this.session,u&&hn.postRender(()=>u(c,f))}}}mount(){this.removePointerDownListener=_0(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const vg={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let qS=!1;class CV extends H.Component{componentDidMount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:s,layoutId:u}=this.props,{projection:c}=t;c&&(i.group&&i.group.add(c),s&&s.register&&u&&s.register(c),qS&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,onExitComplete:()=>this.safeToRemove()})),vg.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:i,visualElement:s,drag:u,isPresent:c}=this.props,{projection:f}=s;return f&&(f.isPresent=c,qS=!0,u||t.layoutDependency!==i||i===void 0||t.isPresent!==c?f.willUpdate():this.safeToRemove(),t.isPresent!==c&&(c?f.promote():f.relegate()||hn.postRender(()=>{const p=f.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),SS.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:s}=this.props,{projection:u}=t;qS=!0,u&&(u.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(u),s&&s.deregister&&s.deregister(u))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function P7(n){const[t,i]=jU(),s=H.useContext(Db);return X.jsx(CV,{...n,layoutGroup:s,switchLayoutGroup:H.useContext(n7),isPresent:t,safeToRemove:i})}function _V(n,t,i){const s=Ia(n)?n:Th(n);return s.start(GS("",s,t,i)),s.animation}const xV=(n,t)=>n.depth-t.depth;class DV{constructor(){this.children=[],this.isDirty=!1}add(t){Bv(this.children,t),this.isDirty=!0}remove(t){Vv(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(xV),this.isDirty=!1,this.children.forEach(t)}}function AV(n,t){const i=Ai.now(),s=({timestamp:u})=>{const c=u-i;c>=t&&(Fo(s),n(c-t))};return hn.setup(s,!0),()=>Fo(s)}const Y7=["TopLeft","TopRight","BottomLeft","BottomRight"],MV=Y7.length,q7=n=>typeof n=="string"?parseFloat(n):n,X7=n=>typeof n=="number"||wt.test(n);function NV(n,t,i,s,u,c){u?(n.opacity=Cn(0,i.opacity??1,OV(s)),n.opacityExit=Cn(t.opacity??1,0,RV(s))):c&&(n.opacity=Cn(t.opacity??1,i.opacity??1,s));for(let f=0;f<MV;f++){const p=`border${Y7[f]}Radius`;let m=K7(t,p),S=K7(i,p);if(m===void 0&&S===void 0)continue;m||(m=0),S||(S=0),m===0||S===0||X7(m)===X7(S)?(n[p]=Math.max(Cn(q7(m),q7(S),s),0),(kl.test(S)||kl.test(m))&&(n[p]+="%")):n[p]=S}(t.rotate||i.rotate)&&(n.rotate=Cn(t.rotate||0,i.rotate||0,s))}function K7(n,t){return n[t]!==void 0?n[t]:n.borderRadius}const OV=Q7(0,.5,Gb),RV=Q7(.5,.95,Cs);function Q7(n,t,i){return s=>s<n?0:s>t?1:i(h0(n,t,s))}function Z7(n,t){n.min=t.min,n.max=t.max}function cl(n,t){Z7(n.x,t.x),Z7(n.y,t.y)}function J7(n,t){n.translate=t.translate,n.scale=t.scale,n.originPoint=t.originPoint,n.origin=t.origin}function F7(n,t,i,s,u){return n-=t,n=mg(n,1/i,s),u!==void 0&&(n=mg(n,1/u,s)),n}function zV(n,t=0,i=1,s=.5,u,c=n,f=n){if(kl.test(t)&&(t=parseFloat(t),t=Cn(f.min,f.max,t/100)-f.min),typeof t!="number")return;let p=Cn(c.min,c.max,s);n===c&&(p-=t),n.min=F7(n.min,t,i,p,u),n.max=F7(n.max,t,i,p,u)}function k7(n,t,[i,s,u],c,f){zV(n,t[i],t[s],t[u],t.scale,c,f)}const HV=["x","scaleX","originX"],wV=["y","scaleY","originY"];function I7(n,t,i,s){k7(n.x,t,HV,i?i.x:void 0,s?s.x:void 0),k7(n.y,t,wV,i?i.y:void 0,s?s.y:void 0)}function W7(n){return n.translate===0&&n.scale===1}function $7(n){return W7(n.x)&&W7(n.y)}function t9(n,t){return n.min===t.min&&n.max===t.max}function UV(n,t){return t9(n.x,t.x)&&t9(n.y,t.y)}function e9(n,t){return Math.round(n.min)===Math.round(t.min)&&Math.round(n.max)===Math.round(t.max)}function n9(n,t){return e9(n.x,t.x)&&e9(n.y,t.y)}function a9(n){return hi(n.x)/hi(n.y)}function i9(n,t){return n.translate===t.translate&&n.scale===t.scale&&n.originPoint===t.originPoint}class BV{constructor(){this.members=[]}add(t){Bv(this.members,t),t.scheduleRender()}remove(t){if(Vv(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(t){const i=this.members.findIndex(u=>t===u);if(i===0)return!1;let s;for(let u=i;u>=0;u--){const c=this.members[u];if(c.isPresent!==!1){s=c;break}}return s?(this.promote(s),!0):!1}promote(t,i){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,i&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:u}=t.options;u===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:i,resumingFrom:s}=t;i.onExitComplete&&i.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function VV(n,t,i){let s="";const u=n.x.translate/t.x,c=n.y.translate/t.y,f=i?.z||0;if((u||c||f)&&(s=`translate3d(${u}px, ${c}px, ${f}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),i){const{transformPerspective:S,rotate:b,rotateX:_,rotateY:x,skewX:D,skewY:A}=i;S&&(s=`perspective(${S}px) ${s}`),b&&(s+=`rotate(${b}deg) `),_&&(s+=`rotateX(${_}deg) `),x&&(s+=`rotateY(${x}deg) `),D&&(s+=`skewX(${D}deg) `),A&&(s+=`skewY(${A}deg) `)}const p=n.x.scale*t.x,m=n.y.scale*t.y;return(p!==1||m!==1)&&(s+=`scale(${p}, ${m})`),s||"none"}const XS=["","X","Y","Z"],GV=1e3;let jV=0;function KS(n,t,i,s){const{latestValues:u}=t;u[n]&&(i[n]=u[n],t.setStaticValue(n,0),s&&(s[n]=0))}function s9(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:t}=n.options;if(!t)return;const i=b7(t);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:u,layoutId:c}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",hn,!(u||c))}const{parent:s}=n;s&&!s.hasCheckedOptimisedAppear&&s9(s)}function l9({attachResizeListener:n,defaultParent:t,measureScroll:i,checkIsScrollRoot:s,resetTransform:u}){return class{constructor(f={},p=t?.()){this.id=jV++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(YV),this.nodes.forEach(QV),this.nodes.forEach(ZV),this.nodes.forEach(qV)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new DV)}addEventListener(f,p){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new Lv),this.eventHandlers.get(f).add(p)}notifyListeners(f,...p){const m=this.eventHandlers.get(f);m&&m.notify(...p)}hasListeners(f){return this.eventHandlers.has(f)}mount(f){if(this.instance)return;this.isSVG=j8(f)&&!BU(f),this.instance=f;const{layoutId:p,layout:m,visualElement:S}=this.options;if(S&&!S.current&&S.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(m||p)&&(this.isLayoutDirty=!0),n){let b,_=0;const x=()=>this.root.updateBlockedByResize=!1;hn.read(()=>{_=window.innerWidth}),n(f,()=>{const D=window.innerWidth;D!==_&&(_=D,this.root.updateBlockedByResize=!0,b&&b(),b=AV(x,250),vg.hasAnimatedSinceResize&&(vg.hasAnimatedSinceResize=!1,this.nodes.forEach(u9)))})}p&&this.root.registerSharedNode(p,this),this.options.animate!==!1&&S&&(p||m)&&this.addEventListener("didUpdate",({delta:b,hasLayoutChanged:_,hasRelativeLayoutChanged:x,layout:D})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=this.options.transition||S.getDefaultTransition()||WV,{onLayoutAnimationStart:N,onLayoutAnimationComplete:R}=S.getProps(),O=!this.targetLayout||!n9(this.targetLayout,D),U=!_&&x;if(this.options.layoutRoot||this.resumeFrom||U||_&&(O||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const j={...gS(A,"layout"),onPlay:N,onComplete:R};(S.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j),this.setAnimationOrigin(b,U)}else _||u9(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=D})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Fo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(JV),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&s9(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let b=0;b<this.path.length;b++){const _=this.path[b];_.shouldResetTransform=!0,_.updateScroll("snapshot"),_.options.layoutRoot&&_.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const S=this.getTransformTemplate();this.prevTransformTemplateValue=S?S(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(r9);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(o9);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(KV),this.nodes.forEach(LV),this.nodes.forEach(PV)):this.nodes.forEach(o9),this.clearAllSnapshots();const p=Ai.now();wa.delta=Vr(0,1e3/60,p-wa.timestamp),wa.timestamp=p,wa.isProcessing=!0,Xv.update.process(wa),Xv.preRender.process(wa),Xv.render.process(wa),wa.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,SS.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(XV),this.sharedNodes.forEach(FV)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,hn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){hn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!hi(this.snapshot.measuredBox.x)&&!hi(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=fa(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(p=!1),p&&this.instance){const m=s(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!u)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!$7(this.projectionDelta),m=this.getTransformTemplate(),S=m?m(this.latestValues,""):void 0,b=S!==this.prevTransformTemplateValue;f&&this.instance&&(p||Tc(this.latestValues)||b)&&(u(this.instance,S),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return f&&(m=this.removeTransform(m)),$V(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:f}=this.options;if(!f)return fa();const p=f.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(tG))){const{scroll:S}=this.root;S&&(_h(p.x,S.offset.x),_h(p.y,S.offset.y))}return p}removeElementScroll(f){const p=fa();if(cl(p,f),this.scroll?.wasRoot)return p;for(let m=0;m<this.path.length;m++){const S=this.path[m],{scroll:b,options:_}=S;S!==this.root&&b&&_.layoutScroll&&(b.wasRoot&&cl(p,f),_h(p.x,b.offset.x),_h(p.y,b.offset.y))}return p}applyTransform(f,p=!1){const m=fa();cl(m,f);for(let S=0;S<this.path.length;S++){const b=this.path[S];!p&&b.options.layoutScroll&&b.scroll&&b!==b.root&&xh(m,{x:-b.scroll.offset.x,y:-b.scroll.offset.y}),Tc(b.latestValues)&&xh(m,b.latestValues)}return Tc(this.latestValues)&&xh(m,this.latestValues),m}removeTransform(f){const p=fa();cl(p,f);for(let m=0;m<this.path.length;m++){const S=this.path[m];if(!S.instance||!Tc(S.latestValues))continue;HS(S.latestValues)&&S.updateSnapshot();const b=fa(),_=S.measurePageBox();cl(b,_),I7(p,S.latestValues,S.snapshot?S.snapshot.layoutBox:void 0,b)}return Tc(this.latestValues)&&I7(p,this.latestValues),p}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==wa.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){const p=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=p.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=p.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=p.isSharedProjectionDirty);const m=!!this.resumingFrom||this!==p;if(!(f||m&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:b,layoutId:_}=this.options;if(!this.layout||!(b||_))return;this.resolvedRelativeTargetAt=wa.timestamp;const x=this.getClosestProjectingParent();x&&this.linkedParentVersion!==x.layoutVersion&&!x.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(x&&x.layout?this.createRelativeTarget(x,this.layout.layoutBox,x.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=fa(),this.targetWithTransforms=fa()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),oV(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):cl(this.target,this.layout.layoutBox),o7(this.target,this.targetDelta)):cl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?this.createRelativeTarget(x,this.target,x.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||HS(this.parent.latestValues)||s7(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(f,p,m){this.relativeParent=f,this.linkedParentVersion=f.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fa(),this.relativeTargetOrigin=fa(),gg(this.relativeTargetOrigin,p,m),cl(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const f=this.getLead(),p=!!this.resumingFrom||this!==f;let m=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(m=!1),p&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(m=!1),this.resolvedRelativeTargetAt===wa.timestamp&&(m=!1),m)return;const{layout:S,layoutId:b}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(S||b))return;cl(this.layoutCorrected,this.layout.layoutBox);const _=this.treeScale.x,x=this.treeScale.y;bB(this.layoutCorrected,this.treeScale,this.path,p),f.layout&&!f.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(f.target=f.layout.layoutBox,f.targetWithTransforms=fa());const{target:D}=f;if(!D){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(J7(this.prevProjectionDelta.x,this.projectionDelta.x),J7(this.prevProjectionDelta.y,this.projectionDelta.y)),x0(this.projectionDelta,this.layoutCorrected,D,this.latestValues),(this.treeScale.x!==_||this.treeScale.y!==x||!i9(this.projectionDelta.x,this.prevProjectionDelta.x)||!i9(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",D))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){if(this.options.visualElement?.scheduleRender(),f){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Dh(),this.projectionDelta=Dh(),this.projectionDeltaWithTransform=Dh()}setAnimationOrigin(f,p=!1){const m=this.snapshot,S=m?m.latestValues:{},b={...this.latestValues},_=Dh();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const x=fa(),D=m?m.source:void 0,A=this.layout?this.layout.source:void 0,N=D!==A,R=this.getStack(),O=!R||R.members.length<=1,U=!!(N&&!O&&this.options.crossfade===!0&&!this.path.some(IV));this.animationProgress=0;let j;this.mixTargetDelta=V=>{const J=V/1e3;c9(_.x,f.x,J),c9(_.y,f.y,J),this.setTargetDelta(_),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gg(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),kV(this.relativeTarget,this.relativeTargetOrigin,x,J),j&&UV(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=fa()),cl(j,this.relativeTarget)),N&&(this.animationValues=b,NV(b,S,this.latestValues,J,U,O)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=J},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Fo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=hn.update(()=>{vg.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Th(0)),this.currentAnimation=_V(this.motionValue,[0,1e3],{...f,velocity:0,isSync:!0,onUpdate:p=>{this.mixTargetDelta(p),f.onUpdate&&f.onUpdate(p)},onStop:()=>{},onComplete:()=>{f.onComplete&&f.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(GV),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:p,target:m,layout:S,latestValues:b}=f;if(!(!p||!m||!S)){if(this!==f&&this.layout&&S&&m9(this.options.animationType,this.layout.layoutBox,S.layoutBox)){m=this.target||fa();const _=hi(this.layout.layoutBox.x);m.x.min=f.target.x.min,m.x.max=m.x.min+_;const x=hi(this.layout.layoutBox.y);m.y.min=f.target.y.min,m.y.max=m.y.min+x}cl(p,m),xh(p,b),x0(this.projectionDeltaWithTransform,this.layoutCorrected,p,b)}}registerSharedNode(f,p){this.sharedNodes.has(f)||this.sharedNodes.set(f,new BV),this.sharedNodes.get(f).add(p);const S=p.options.initialPromotionConfig;p.promote({transition:S?S.transition:void 0,preserveFollowOpacity:S&&S.shouldPreserveFollowOpacity?S.shouldPreserveFollowOpacity(p):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){const{layoutId:f}=this.options;return f?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:f}=this.options;return f?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:p,preserveFollowOpacity:m}={}){const S=this.getStack();S&&S.promote(this,m),f&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let p=!1;const{latestValues:m}=f;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const S={};m.z&&KS("z",f,S,this.animationValues);for(let b=0;b<XS.length;b++)KS(`rotate${XS[b]}`,f,S,this.animationValues),KS(`skew${XS[b]}`,f,S,this.animationValues);f.render();for(const b in S)f.setStaticValue(b,S[b]),this.animationValues&&(this.animationValues[b]=S[b]);f.scheduleRender()}applyProjectionStyles(f,p){if(!this.instance||this.isSVG)return;if(!this.isVisible){f.visibility="hidden";return}const m=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,f.visibility="",f.opacity="",f.pointerEvents=pg(p?.pointerEvents)||"",f.transform=m?m(this.latestValues,""):"none";return}const S=this.getLead();if(!this.projectionDelta||!this.layout||!S.target){this.options.layoutId&&(f.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,f.pointerEvents=pg(p?.pointerEvents)||""),this.hasProjected&&!Tc(this.latestValues)&&(f.transform=m?m({},""):"none",this.hasProjected=!1);return}f.visibility="";const b=S.animationValues||S.latestValues;this.applyTransformsToTarget();let _=VV(this.projectionDeltaWithTransform,this.treeScale,b);m&&(_=m(b,_)),f.transform=_;const{x,y:D}=this.projectionDelta;f.transformOrigin=`${x.origin*100}% ${D.origin*100}% 0`,S.animationValues?f.opacity=S===this?b.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:b.opacityExit:f.opacity=S===this?b.opacity!==void 0?b.opacity:"":b.opacityExit!==void 0?b.opacityExit:0;for(const A in _S){if(b[A]===void 0)continue;const{correct:N,applyTo:R,isCSSVariable:O}=_S[A],U=_==="none"?b[A]:N(b[A],S);if(R){const j=R.length;for(let V=0;V<j;V++)f[R[V]]=U}else O?this.options.visualElement.renderState.vars[A]=U:f[A]=U}this.options.layoutId&&(f.pointerEvents=S===this?pg(p?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>f.currentAnimation?.stop()),this.root.nodes.forEach(r9),this.root.sharedNodes.clear()}}}function LV(n){n.updateLayout()}function PV(n){const t=n.resumeFrom?.snapshot||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=n.layout,{animationType:u}=n.options,c=t.source!==n.layout.source;u==="size"?xs(b=>{const _=c?t.measuredBox[b]:t.layoutBox[b],x=hi(_);_.min=i[b].min,_.max=_.min+x}):m9(u,t.layoutBox,i)&&xs(b=>{const _=c?t.measuredBox[b]:t.layoutBox[b],x=hi(i[b]);_.max=_.min+x,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[b].max=n.relativeTarget[b].min+x)});const f=Dh();x0(f,i,t.layoutBox);const p=Dh();c?x0(p,n.applyTransform(s,!0),t.measuredBox):x0(p,i,t.layoutBox);const m=!$7(f);let S=!1;if(!n.resumeFrom){const b=n.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:_,layout:x}=b;if(_&&x){const D=fa();gg(D,t.layoutBox,_.layoutBox);const A=fa();gg(A,i,x.layoutBox),n9(D,A)||(S=!0),b.options.layoutRoot&&(n.relativeTarget=A,n.relativeTargetOrigin=D,n.relativeParent=b)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:p,layoutDelta:f,hasLayoutChanged:m,hasRelativeLayoutChanged:S})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function YV(n){n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function qV(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function XV(n){n.clearSnapshot()}function r9(n){n.clearMeasurements()}function o9(n){n.isLayoutDirty=!1}function KV(n){const{visualElement:t}=n.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),n.resetTransform()}function u9(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function QV(n){n.resolveTargetDelta()}function ZV(n){n.calcProjection()}function JV(n){n.resetSkewAndRotation()}function FV(n){n.removeLeadSnapshot()}function c9(n,t,i){n.translate=Cn(t.translate,0,i),n.scale=Cn(t.scale,1,i),n.origin=t.origin,n.originPoint=t.originPoint}function f9(n,t,i,s){n.min=Cn(t.min,i.min,s),n.max=Cn(t.max,i.max,s)}function kV(n,t,i,s){f9(n.x,t.x,i.x,s),f9(n.y,t.y,i.y,s)}function IV(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const WV={duration:.45,ease:[.4,0,.1,1]},h9=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),d9=h9("applewebkit/")&&!h9("chrome/")?Math.round:Cs;function p9(n){n.min=d9(n.min),n.max=d9(n.max)}function $V(n){p9(n.x),p9(n.y)}function m9(n,t,i){return n==="position"||n==="preserve-aspect"&&!rV(a9(t),a9(i),.2)}function tG(n){return n!==n.root&&n.scroll?.wasRoot}const eG=l9({attachResizeListener:(n,t)=>T0(n,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),QS={current:void 0},g9=l9({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!QS.current){const n=new eG({});n.mount(window),n.setOptions({layoutScroll:!0}),QS.current=n}return QS.current},resetTransform:(n,t)=>{n.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),nG={pan:{Feature:TV},drag:{Feature:EV,ProjectionNode:g9,MeasureLayout:P7}};function y9(n,t,i){const{props:s}=n;n.animationState&&s.whileHover&&n.animationState.setActive("whileHover",i==="Start");const u="onHover"+i,c=s[u];c&&hn.postRender(()=>c(t,C0(t)))}class aG extends $o{mount(){const{current:t}=this.node;t&&(this.unmount=zU(t,(i,s)=>(y9(this.node,s,"Start"),u=>y9(this.node,u,"End"))))}unmount(){}}class iG extends $o{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=f0(T0(this.node.current,"focus",()=>this.onFocus()),T0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function v9(n,t,i){const{props:s}=n;if(n.current instanceof HTMLButtonElement&&n.current.disabled)return;n.animationState&&s.whileTap&&n.animationState.setActive("whileTap",i==="Start");const u="onTap"+(i==="End"?"":i),c=s[u];c&&hn.postRender(()=>c(t,C0(t)))}class sG extends $o{mount(){const{current:t}=this.node;t&&(this.unmount=UU(t,(i,s)=>(v9(this.node,s,"Start"),(u,{success:c})=>v9(this.node,u,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ZS=new WeakMap,JS=new WeakMap,lG=n=>{const t=ZS.get(n.target);t&&t(n)},rG=n=>{n.forEach(lG)};function oG({root:n,...t}){const i=n||document;JS.has(i)||JS.set(i,{});const s=JS.get(i),u=JSON.stringify(t);return s[u]||(s[u]=new IntersectionObserver(rG,{root:n,...t})),s[u]}function uG(n,t,i){const s=oG(t);return ZS.set(n,i),s.observe(n),()=>{ZS.delete(n),s.unobserve(n)}}const cG={some:0,all:1};class fG extends $o{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:i,margin:s,amount:u="some",once:c}=t,f={root:i?i.current:void 0,rootMargin:s,threshold:typeof u=="number"?u:cG[u]},p=m=>{const{isIntersecting:S}=m;if(this.isInView===S||(this.isInView=S,c&&!S&&this.hasEnteredView))return;S&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",S);const{onViewportEnter:b,onViewportLeave:_}=this.node.getProps(),x=S?b:_;x&&x(m)};return uG(this.node.current,f,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:i}=this.node;["amount","margin","root"].some(hG(t,i))&&this.startObserver()}unmount(){}}function hG({viewport:n={}},{viewport:t={}}={}){return i=>n[i]!==t[i]}const dG={...eV,...{inView:{Feature:fG},tap:{Feature:sG},focus:{Feature:iG},hover:{Feature:aG}},...nG,...{layout:{ProjectionNode:g9,MeasureLayout:P7}}},S9=yB(dG,OB),b9=({visible:n,target:t,appendTo:i=document.body,unmountWhenHidden:s=!1,transitionDuration:u=400,showTransitionOptions:c="easeInOut",hideTransitionOptions:f="linear",approveText:p="DONE",shown:m,hidden:S,isClickedWithin:b,children:_})=>{const[x,D]=H.useState(-1),[A,N]=H.useState(-1),[R,O]=H.useState(n),[U,j]=H.useState(!0),V=H.useRef(100),J=H.useRef(101),$=H.useRef(void 0),st=H.useRef(void 0),I=H.useRef(void 0),et=H.useRef(!1),nt=u/1e3;H.useEffect(()=>{t&&($.current=xb(t));const gt=bb("zIndex",Tt=>Tt==="auto"||Tt==="-1"?!1:parseInt(Tt)>100).map(Tt=>parseInt(Tt,10));gt.length>0&&(V.current=Math.max(...gt)+1,J.current=Math.max(...gt)+2),j(!1),O(n)},[n,t]);const bt=gt=>{st.current=gt},rt=()=>{N(V.current),D(J.current),et.current=!0},dt=()=>{if(!st.current)return;m?.();let gt;$.current&&(gt=[$.current]);const Tt=Pt=>{Pt?b?.():(j(!1),O(!1))};I.current=Cb(st.current,Tt,gt)},pt=()=>{I.current&&_b(I.current)},tt=()=>{N(-1),D(-1),S?.()},w=Q1(()=>{R?rt():pt()}),F=Q1(()=>{R?dt():tt(),j(!0)}),K={opacity:.5},at={opacity:0},St={opacity:1,pointerEvents:"auto"},W={opacity:0,pointerEvents:"none"};return et.current&&!R&&s===!0&&U?null:vT.createPortal(X.jsxs("div",{children:[X.jsx(S9.div,{className:"bsc:fixed bsc:left-0 bsc:top-0 bsc:h-full bsc:w-full bsc:bg-mono-dark-1",style:{zIndex:A},initial:!1,animate:R?K:at}),X.jsxs(S9.div,{ref:gt=>{gt&&bt(gt)},className:"dark:bsc-border-mono-light-1 bsc:fixed bsc:bottom-0 bsc:left-0 bsc:w-full bsc:bg-white bsc:dark:border-t bsc:dark:border-solid bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1",style:{zIndex:x},initial:!1,animate:R?St:W,transition:{duration:nt,ease:R?c:f},onAnimationStart:w,onAnimationComplete:F,children:[X.jsx("div",{className:"bsc:w-full",children:_}),X.jsx(X.Fragment,{children:X.jsx(Ql,{buttonType:"primary",fullWidth:!0,onClick:()=>O(!1),className:"bsc:text-xs bsc:font-bold",children:p})})]})]}),i)};var E9=(n=>(n[n.TopLeft=0]="TopLeft",n[n.TopRight=1]="TopRight",n[n.BottomLeft=2]="BottomLeft",n[n.BottomRight=3]="BottomRight",n))(E9||{}),T9=(n=>(n[n.TopLeft=0]="TopLeft",n[n.TopRight=1]="TopRight",n[n.BottomLeft=2]="BottomLeft",n[n.BottomRight=3]="BottomRight",n))(T9||{});class dn{static positionToTarget(t,i=2){const s=t.getBoundingClientRect();let u=0,c=0;const f=window.scrollY;switch(i){case 2:u=s.top+s.height+f,c=s.left;break;case 0:u=s.top+f,c=s.left;break;case 3:u=s.top+s.height+f,c=s.left+s.width;break;case 1:u=s.top+f,c=s.left+s.width}return{top:u,left:c}}static positionElementToTarget(t,i,s=0,u=2){let{left:c,top:f}=dn.positionToTarget(i,u);const p=t.getBoundingClientRect();switch(s){case 0:break;case 1:c=c-p.width;break;case 2:f=f-p.height;break;case 3:f=f-p.height,c=c-p.width;break}return{top:f,left:c}}static canPositionElementOnScreenWithTarget(t,i){const s=dn.getScreenDimensions(),u=t.getBoundingClientRect(),c=dn.positionElementToTarget(t,i,0,2);if(c.left+u.width<s.width&&c.top+u.height<s.height||dn.positionElementToTarget(t,i,1,3).left>=0&&c.top+u.height<s.height)return!0;const p=dn.positionElementToTarget(t,i,2,0);if(p.left+u.width<s.width&&p.top>=0)return!0;const m=dn.positionElementToTarget(t,i,3,1);return m.left>=0&&m.top>=0}static canPositionElementOnScreen(t){const i=dn.getScreenDimensions(),s=t.getBoundingClientRect();return s.width<=i.width&&s.height<=i.height}static positionElementToTargetOnScreen(t,i,s=0,u=2){const{left:c,top:f}=dn.positionElementToTarget(t,i,s,u),p=t.getBoundingClientRect(),m=dn.determineOffScreenLocation(p);if(m){if(s===0&&u===2){if(m.right&&!m.bottom)return dn.positionElementToTarget(t,i,1,3);if(m.bottom&&!m.right)return dn.positionElementToTarget(t,i,2,0);if(m.right&&m.bottom)return dn.positionElementToTarget(t,i,3,1)}else if(s===1&&u===3){if(m.left&&!m.bottom)return dn.positionElementToTarget(t,i,0,2);if(m.bottom&&!m.left)return dn.positionElementToTarget(t,i,3,1);if(m.left&&m.bottom)return dn.positionElementToTarget(t,i,2,0)}}return{top:f,left:c}}static determineOffScreenLocation(t){const i=dn.getScreenDimensions(),s={left:t.left<0,top:t.top<0,right:t.left+t.width>i.width,bottom:t.top+t.height>i.height};return s.left||s.top||s.right||s.bottom?s:void 0}static getScreenDimensions(){return{width:window.innerWidth,height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}}const C9=({visible:n,target:t,targetPosition:i=E9.BottomLeft,elementAlignment:s=T9.TopLeft,shouldTargetCloseOverlay:u=!0,shouldMatchTargetWidth:c=!1,shouldScrollCloseOverlay:f=!1,shouldCheckZIndex:p=!1,shouldRemainOnScreen:m=!1,unmountWhenHidden:S=!1,transitionDuration:b=400,showTransitionOptions:_="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:x="linear",shown:D,hidden:A,isClickedWithin:N,markupCreated:R,children:O})=>{const[U,j]=H.useState(-1),[V,J]=H.useState(n),[$,st]=H.useState(!1),I=H.useRef(!1),et=H.useRef(100),nt=H.useRef({left:0,top:0,width:0}),bt=H.useRef(void 0),rt=H.useRef(void 0),dt=H.useRef(void 0),pt=H.useRef(void 0),tt=H.useRef(void 0),w=H.useRef(void 0),F=H.useRef(!1),K=j4();H.useEffect(()=>(m===!0&&(w.current=new ResizeObserver(at)),()=>{m===!0&&(rt.current&&w.current?.unobserve(rt.current),w.current?.disconnect())}),[]),H.useEffect(()=>{if(t&&(bt.current=xb(t),f)){const Be=K?.isValidScrollableElement;dt.current=Sb(bt.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,Be),dt.current.tagName.toLowerCase()==="html"&&(dt.current=document)}if(p){const Be=bb("zIndex",At=>parseInt(At)>=100).map(At=>parseInt(At));Be.length>0&&(et.current=Math.max(...Be)+1)}n!==void 0&&J(n)},[t,n,f,p]);const at=Be=>{if(rt.current){const At=dn.getScreenDimensions(),ue=Be[Be.length-1].target,ta=ue.getBoundingClientRect(),ea=dn.determineOffScreenLocation(ta);if(ea){if(bt.current&&dn.canPositionElementOnScreenWithTarget(ue,bt.current)){const An=dn.positionElementToTargetOnScreen(rt.current,bt.current,s,i);nt.current={...nt.current,...An}}else ea.right?nt.current.left=At.width-ta.width:ea.left&&(nt.current.left=0),ea.bottom?nt.current.top=At.height-ta.height:ea.top&&(nt.current.top=0);St()}}},St=s0(()=>{I.current=!I.current,st(I.current)},20),W=()=>{j(et.current)},gt=()=>{if(!rt.current)return;D?.();let Be;!u&&bt.current&&(Be=[bt.current]);const At=ue=>{ue?N?.():J(!1)};pt.current=Cb(rt.current,At,Be),f&&(tt.current=uR(ue=>rt.current&&DH(ue,rt.current)&&J(!1),100,{leading:!0}),dt.current&&dt.current.addEventListener("scroll",tt.current)),F.current=!0},Tt=()=>{dt.current&&tt.current&&(dt.current.removeEventListener("scroll",tt.current),tt.current=void 0),pt.current&&_b(pt.current)},Pt=()=>{j(-1),A?.()},le=Be=>{if(m===!0&&rt.current&&w.current?.unobserve(rt.current),rt.current=Be,R?.(Be),bt.current){const At=dn.positionElementToTarget(rt.current,bt.current,s,i);nt.current={...At,width:bt.current.offsetWidth},m===!0&&(dn.canPositionElementOnScreenWithTarget(rt.current,bt.current)||dn.canPositionElementOnScreen(rt.current))&&w.current?.observe(rt.current)}},xn=Q1(()=>{V?W():Tt()}),xe=Q1(()=>{V?gt():Pt()}),Dn=H.useMemo(()=>V?{transition:`opacity ${b}ms ${_}`,pointerEvents:"auto",opacity:1}:{transition:`opacity ${b}ms ${x}`,pointerEvents:"none",opacity:0},[V]),ln=H.useMemo(()=>{const Be={top:`${nt.current.top}px`,left:`${nt.current.left}px`,zIndex:U};return c&&(Be.width=`${nt.current.width}px`),Be},[$,U,c]);return F.current&&!V&&S===!0?null:X.jsx("div",{onTransitionStart:xn,onTransitionEnd:xe,children:X.jsx("div",{className:"bsc:fixed bsc:border! bsc:border-solid! bsc:border-black bsc:bg-white bsc:shadow bsc:dark:border-mono-light-1 bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1",style:{...ln,...Dn},ref:Be=>{Be&&le(Be)},children:O})})};let Sg;const pG=new Uint8Array(16);function mG(){if(!Sg&&(Sg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Sg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Sg(pG)}const Ua=[];for(let n=0;n<256;++n)Ua.push((n+256).toString(16).slice(1));function gG(n,t=0){return Ua[n[t+0]]+Ua[n[t+1]]+Ua[n[t+2]]+Ua[n[t+3]]+"-"+Ua[n[t+4]]+Ua[n[t+5]]+"-"+Ua[n[t+6]]+Ua[n[t+7]]+"-"+Ua[n[t+8]]+Ua[n[t+9]]+"-"+Ua[n[t+10]]+Ua[n[t+11]]+Ua[n[t+12]]+Ua[n[t+13]]+Ua[n[t+14]]+Ua[n[t+15]]}const _9={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function yG(n,t,i){if(_9.randomUUID&&!n)return _9.randomUUID();n=n||{};const s=n.random||(n.rng||mG)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,gG(s)}class D0{static create(t){const i=[];let s=0;for(let u=0,c=t.formatParts.length;u<c;u++){const f=t.formatParts[u],p=s,m=p+f.characterCount;i.push({startPosition:p,endPosition:m,...f}),s=m}return i}}class vG{instanceCollection;formatPartList;inputSlotCollection;currentPartIndex=0;currentPartIndices=[];currentCursorPosition=0;highlightCursorPosition=0;currentCursorStartPosition=-1;currentCursorEndPosition=-1;inputElement;inputSelection=null;inputRange;textNode;constructor(t,i){this.instanceCollection=A0.getInstance(),this.formatPartList=D0.create(t),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(i,t)}get isSelection(){return this.inputRange!==void 0&&this.inputRange.startOffset!==this.inputRange.endOffset}get isAllSelected(){const t=this.inputSlotCollection.getLastSlot();return this.isSelection&&this.inputRange?.startOffset===0&&this.inputRange.endOffset===t.endPosition}getCursorPosition(){return this.currentCursorPosition}getCursorStartPosition(){return this.currentCursorStartPosition}getCursorEndPosition(){return this.currentCursorEndPosition}getCurrentPartIndex(){return this.currentPartIndex}getCurrentPartIndices(){return this.currentPartIndices}setInputElement(t){this.inputElement=t}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition>-1?this.currentCursorPosition:this.highlightCursorPosition)}setCursorPosition(t){this.setCursorSelection(t)}setCursorSelection(t,i){if(this.createInputRangeSelection(),this.inputRange&&this.textNode){let s,u,c=!0;i===void 0?(s=t,u=t):t<i?(s=t,u=i):(c=!1,s=i,u=t),this.inputRange.setStart(this.textNode,s),this.inputRange.setEnd(this.textNode,u),this.currentPartIndices=[],s===u?(this.currentCursorPosition=u,this.highlightCursorPosition=u,this.currentCursorStartPosition=-1,this.currentCursorEndPosition=-1,this.setPartIndexByCursorPosition()):(c?this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1?this.highlightCursorPosition=u:this.currentCursorStartPosition!==s?this.highlightCursorPosition=s:this.currentCursorEndPosition!==u&&(this.highlightCursorPosition=u):this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1?this.highlightCursorPosition=s:this.currentCursorStartPosition!==u?this.highlightCursorPosition=u:this.currentCursorEndPosition!==s&&(this.highlightCursorPosition=s),this.currentCursorStartPosition=s,this.currentCursorEndPosition=u,this.currentCursorPosition=-1,this.setPartIndexByHighlightPosition(),this.setPartIndicesByCursorPositions())}}findCursorPosition(){const t=window.getSelection(),i=t?.getRangeAt(0);if(this.inputElement&&t&&i){const s=document.createTreeWalker(this.inputElement,NodeFilter.SHOW_TEXT,p=>{const m=document.createRange();return m.selectNodeContents(p),m.compareBoundaryPoints(Range.END_TO_END,i)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let u=0;for(;s.nextNode();)u+=s.currentNode.textContent?.length||0;i.startContainer.nodeType===Node.TEXT_NODE&&(u+=i.startOffset);const c=this.inputSlotCollection.getLastSlotWithData(),f=c.startPosition+c.partText.length;t.anchorOffset===t.focusOffset?this.setCursorSelection(u>f?f:u):this.setCursorSelection(t.anchorOffset,t.focusOffset)}}isAtLastPart(){return this.currentPartIndex===this.formatPartList.length-1}moveHome(){const t=this.inputSlotCollection.getFirstSlot();this.setCursorSelection(t.startPosition)}moveEnd(){const t=this.inputSlotCollection.getLastSlotWithData(),i=t.startPosition+t.partText.length;this.setCursorSelection(i)}moveCursorLeft(){if(this.updateCursorPosition(),this.currentCursorPosition>0&&!this.isSelection){const t=this.currentCursorPosition-1;let i=this.formatPartList[this.currentPartIndex];if(t>=i.startPosition&&t<=i.endPosition)this.setCursorSelection(t);else for(let s=this.currentPartIndex-1;s>=0;s--)if(i=this.formatPartList[s],t>=i.startPosition&&t<=i.endPosition){i.isSeparator?this.setCursorSelection(this.formatPartList[s-1].endPosition):this.setCursorSelection(t);break}}else this.isSelection?this.setCursorSelection(this.currentCursorPosition):this.moveHome()}moveCursorRight(){this.updateCursorPosition(!1);const t=this.inputSlotCollection.getLastSlotWithData(),i=t.startPosition+t.partText.length;if(this.currentCursorPosition<i&&!this.isSelection){const s=this.currentCursorPosition+1;let u=this.formatPartList[this.currentPartIndex];if(s>=u.startPosition&&s<=u.endPosition)this.setCursorSelection(s);else for(let c=this.currentPartIndex+1,f=this.formatPartList.length;c<f;c++)if(u=this.formatPartList[c],s>=u.startPosition&&s<=u.endPosition){u.isSeparator?this.setCursorSelection(this.formatPartList[c+1].startPosition):this.setCursorSelection(s);break}}else this.setCursorSelection(this.currentCursorPosition)}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const t=this.findNextEditablePart();t&&(this.currentPartIndex=t.partIndex,this.setCursorSelection(t.startPosition))}}moveToPreviousInputPart(){if(this.currentPartIndex>0){const t=this.findPreviousEditablePart();t&&(this.currentPartIndex=t.partIndex,this.setCursorSelection(t.endPosition))}}highlightAll(){const t=this.formatPartList[this.formatPartList.length-1].endPosition;this.setCursorSelection(0,t)}moveHighlightLeft(){this.updateHighlightPositions();const t=this.highlightCursorPosition>this.currentCursorStartPosition;if(this.currentCursorStartPosition>0||t){let i=t?this.currentCursorStartPosition:this.currentCursorStartPosition-1,s=t?this.highlightCursorPosition-1:this.currentCursorEndPosition,u=this.formatPartList[this.currentPartIndex];if(i>=u.startPosition&&i<=u.endPosition||t&&s>=u.startPosition&&s<=u.endPosition)this.setCursorSelection(i,s);else for(let c=this.currentPartIndex-1;c>=0;c--)if(u=this.formatPartList[c],i>=u.startPosition&&i<=u.endPosition||t&&s>=u.startPosition&&s<=u.endPosition){u.isSeparator?(t?s=this.formatPartList[c-1].endPosition:i=this.formatPartList[c-1].endPosition,this.setCursorSelection(i,s)):this.setCursorSelection(i,s);break}}}moveHighlightRight(){this.updateHighlightPositions();const t=this.inputSlotCollection.getLastSlotWithData(),i=t.startPosition+t.partText.length,s=this.highlightCursorPosition<this.currentCursorEndPosition;if(this.currentCursorEndPosition<i||s){let u=s?this.highlightCursorPosition+1:this.currentCursorStartPosition,c=s?this.currentCursorEndPosition:this.currentCursorEndPosition+1,f=this.formatPartList[this.currentPartIndex];if(c>=f.startPosition&&c<=f.endPosition||s&&u>=f.startPosition&&u<=f.endPosition)this.setCursorSelection(u,c);else for(let p=this.currentPartIndex+1,m=this.formatPartList.length;p<m;p++)if(f=this.formatPartList[p],c>=f.startPosition&&c<=f.endPosition||s&&u>=f.startPosition&&u<=f.endPosition){f.isSeparator?(s?u=this.formatPartList[p+1].startPosition:c=this.formatPartList[p+1].startPosition,this.setCursorSelection(u,c)):this.setCursorSelection(u,c);break}}}updateHighlightPositions(){this.currentCursorStartPosition===-1&&this.currentCursorEndPosition===-1&&this.currentCursorPosition>-1&&(this.currentCursorStartPosition=this.currentCursorPosition,this.currentCursorEndPosition=this.currentCursorPosition,this.highlightCursorPosition=this.currentCursorPosition)}updateCursorPosition(t=!0){this.currentCursorPosition===-1&&this.currentCursorStartPosition>-1&&this.currentCursorEndPosition>-1&&(t?this.currentCursorPosition=this.currentCursorStartPosition:this.currentCursorPosition=this.currentCursorEndPosition)}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let t=0;t<this.formatPartList.length;t++){const i=this.formatPartList[t];if(this.currentCursorPosition>=i.startPosition&&this.currentCursorPosition<=i.endPosition){if(i.isSeparator){this.currentCursorPosition=this.formatPartList[t+1].startPosition,this.currentPartIndex=t+1;break}this.currentPartIndex=t;break}}}setPartIndexByHighlightPosition(){for(let t=0;t<this.formatPartList.length;t++){const i=this.formatPartList[t];if(this.highlightCursorPosition>=i.startPosition&&this.highlightCursorPosition<=i.endPosition){if(i.isSeparator){this.highlightCursorPosition=this.formatPartList[t+1].startPosition,this.currentPartIndex=t+1;break}this.currentPartIndex=t;break}}}setPartIndicesByCursorPositions(){for(let t=0,i=this.formatPartList.length;t<i;t++){const s=this.formatPartList[t];s.isSeparator||(s.startPosition>=this.currentCursorStartPosition&&s.startPosition<=this.currentCursorEndPosition||s.endPosition>=this.currentCursorStartPosition&&s.endPosition<=this.currentCursorEndPosition||s.startPosition<this.currentCursorStartPosition&&s.endPosition>this.currentCursorEndPosition)&&this.currentPartIndices.push(t)}}createInputRangeSelection(){this.inputElement&&(this.inputSelection=window.getSelection(),this.inputRange=document.createRange(),this.inputSelection?.removeAllRanges(),this.inputRange.selectNodeContents(this.inputElement),this.inputRange.collapse(!0),this.inputSelection?.addRange(this.inputRange),this.inputElement.firstChild&&(this.textNode=this.inputElement.firstChild))}}class SG{static create(t){const i=[];for(let s=0,u=t.length;s<u;s++){const c=t[s];c.isSeparator||i.push({partIndex:s,partText:"",isComplete:!1,...c})}return i}}class bG{inputSlots;constructor(t){this.inputSlots=SG.create(D0.create(t))}clearAllSlots(){for(let t=0,i=this.inputSlots.length;t<i;t++)this.inputSlots[t].partText=""}getSlot(t){return this.inputSlots.find(i=>i.partIndex===t)}getSlots(t){return this.inputSlots.filter(i=>t.includes(i.partIndex))}getSlotsFromCursorPosition(t){let i=-1;for(let s=0,u=this.inputSlots.length;s<u;s++){const c=this.inputSlots[s];if(t>=c.startPosition&&t<=c.endPosition){i=c.partIndex;break}}return i>-1?this.inputSlots.filter(s=>s.partIndex>=i):void 0}getFirstSlot(){return this.inputSlots[0]}getLastSlot(){return this.inputSlots[this.inputSlots.length-1]}getNextSlot(t){const i=this.inputSlots.findIndex(s=>s.partIndex===t);if(i>-1&&i+1<this.inputSlots.length)return this.inputSlots[i+1]}getPreviousSlot(t){const i=this.inputSlots.findIndex(s=>s.partIndex===t);if(i>-1&&i-1>=0)return this.inputSlots[i-1]}getLastSlotWithData(){const t=this.inputSlots.findIndex(s=>!s.isComplete);let i=t;for(let s=t+1,u=this.inputSlots.length;s<u;s++)this.inputSlots[s].partText.length>0&&(i=s);return this.inputSlots[i>-1?i:0]}allSlotsCompleted(){return this.inputSlots.every(t=>t.isComplete)}allSlotsEmpty(){return this.inputSlots.every(t=>t.partText.length===0)}}class A0{static instance;static getInstance(){return this.instance||(this.instance=new EG),this.instance}}class EG{navigatorInstances;inputSlotInstances;constructor(){this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(t,i){return this.navigatorInstances[t]||(this.navigatorInstances[t]=new vG(i,t)),this.navigatorInstances[t]}getInputSlotInstance(t,i){return this.inputSlotInstances[t]||(this.inputSlotInstances[t]=new bG(i)),this.inputSlotInstances[t]}removeInstances(t){this.navigatorInstances[t]&&delete this.navigatorInstances[t],this.inputSlotInstances[t]&&delete this.inputSlotInstances[t]}}class FS{instanceCollection;formatPartList;inputSlotCollection;inputElement;constructor(t,i){this.instanceCollection=A0.getInstance(),this.formatPartList=D0.create(t),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(i,t)}setInputElement(t){this.inputElement=t}render(){let t="";for(let i=0,s=this.formatPartList.length;i<s;i++){const u=this.formatPartList[i];if(u.isSeparator)t+=u.inputText;else{const c=this.inputSlotCollection.getSlot(i);c&&(t+=c.partText+c.inputText?.repeat(c.characterCount-c.partText.length))}}this.inputElement&&(this.inputElement.innerHTML=t)}}var Il=(n=>(n[n.Text=0]="Text",n[n.Numeric=1]="Numeric",n))(Il||{});class x9{numberKeys=["0","1","2","3","4","5","6","7","8","9"];movementKeys=["ArrowLeft","ArrowRight","Home","End","a"];editingKeys=["Backspace","Delete"];ignoreKeys=["Shift","Alt","Control","Fn","Meta"];isNumberKey(t){return this.numberKeys.includes(t)}isMovementKey(t){return this.movementKeys.includes(t.key)}isEditingKey(t){return this.editingKeys.includes(t.key)}isIgnoreKey(t){return this.ignoreKeys.includes(t.key)}}class TG{_currentIndex=0;index=0;formatParts;get currentIndex(){return this._currentIndex}constructor(t){this.formatParts=D0.create(t)}hasNext(){return this.index<this.formatParts.length}next(){if(this.index<this.formatParts.length)return this._currentIndex=this.index++,this.formatParts[this._currentIndex]}peek(){if(this.index<this.formatParts.length)return this.formatParts[this.index]}reset(){this.index=0}}class CG{formatParts;constructor(t){this.formatParts=D0.create(t)}getUniqueSeparators(){const t=[],i=this.formatParts.filter(s=>s.isSeparator);for(let s=0,u=i.length;s<u;s++){const c=i[s];c.inputText&&!t.includes(c.inputText)&&t.push(c.inputText)}return t}}class D9{constructor(t,i){this.format=t,this.instanceCollection=A0.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(i,t),this.formatNavigator=this.instanceCollection.getNavigatorInstance(i,t),this.keyTypeChecker=new x9,this.formatRenderer=new FS(t,i),this.formatPartList=new TG(t),this.partEntryList=new CG(t)}instanceCollection;inputSlotCollection;formatNavigator;keyTypeChecker;formatRenderer;formatPartList;partEntryList;setInputElement(t){this.formatRenderer.setInputElement(t)}processKeyPress(t){if(this.keyTypeChecker.isEditingKey(t)){this.processEditRules(t);return}this.formatNavigator.isSelection?(this.processSelectionEditRules(),setTimeout(()=>this.processInputRules(t))):this.processInputRules(t)}processInputValue(t){this.inputSlotCollection.clearAllSlots(),this.formatPartList.reset();let i=0;for(;this.formatPartList.hasNext();){const s=this.formatPartList.next();if(s&&!s.isSeparator)if(this.formatPartList.peek()?.isSeparator===!0){const u=this.formatPartList.currentIndex,c=this.formatPartList.next();if(c&&c.inputText){const f=t.indexOf(c.inputText,i),p=this.inputSlotCollection.getSlot(u);if(p&&f>-1){const m=f-i>p.characterCount?i+p.characterCount:f;p.partText=t.substring(i,m),this.processSlotRules(p),i=f+c.characterCount}}}else{const u=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);u&&(u.partText=t.substring(i,i+u.characterCount),this.processSlotRules(u))}}}processPastedValue(t,i=!1){i&&this.processSelectionEditRules();const s=this.formatNavigator.getCursorPosition(),u=this.inputSlotCollection.getSlotsFromCursorPosition(s);if(u){const c=s-u[0].startPosition,f=u[0].partText.substring(0,c);let p=u[0].partText.substring(c);u[0].partText="";for(let _=1,x=u.length;_<x;_++)p+=u[_].partText,u[_].partText="";const m=this.removeSeparatorsFromValue(t),S=f+m+p;let b=0;for(let _=0,x=u.length;_<x;_++){const D=u[_];D.partText=S.substring(b,D.characterCount+b),b+=D.characterCount,this.processSlotRules(D)}}}removeSeparatorsFromValue(t){let i=t;const s=this.partEntryList.getUniqueSeparators();for(let u=0,c=s.length;u<c;u++){const f=s[u];i=i.replaceAll(f,"")}return i}processEditRules(t){this.formatNavigator.isSelection?this.processSelectionEditRules():this.processNonSelectionEditRules(t)}processNonSelectionEditRules(t){const i=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!i)return;const s=this.formatNavigator.getCursorPosition(),u=s-i.startPosition,c=this.format.deleteShiftsFormatPart||!1;switch(t.key){case"Backspace":{if(!(i.startPosition===s))i.partText=i.partText.substring(0,u-1)+i.partText.substring(u),c&&this.shiftFormatParts(i),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(i,!0);else{this.processSlotRules(i,!0);const p=this.inputSlotCollection.getPreviousSlot(i.partIndex);p&&(p.partText=p.partText.substring(0,p.partText.length-1),c&&this.shiftFormatParts(p),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(p.startPosition+p.partText.length),this.processSlotRules(p,!0))}break}case"Delete":i.partText=i.partText.substring(0,u)+i.partText.substring(u+1),c&&this.shiftFormatParts(i),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(i,!0);break}}processSelectionEditRules(){const t=this.inputSlotCollection.getSlots(this.formatNavigator.getCurrentPartIndices());if(t.length<=0)return;const i=this.formatNavigator.getCursorStartPosition(),s=this.formatNavigator.getCursorEndPosition();for(let u=0,c=t.length;u<c;u++){const f=t[u];f.startPosition>=i&&f.endPosition<=s?f.partText="":f.startPosition>=i&&f.endPosition>s?f.partText=f.partText.substring(s-f.startPosition):f.startPosition<i&&f.endPosition<=s?f.partText=f.partText.substring(0,i-f.startPosition):f.startPosition<i&&f.endPosition>s&&(f.partText=f.partText.substring(0,i-f.startPosition)+f.partText.substring(s-f.startPosition))}this.formatRenderer.render(),this.formatNavigator.setCursorPosition(i);for(let u=0,c=t.length;u<c;u++)this.processSlotRules(t[u])}shiftFormatParts(t){let i=t,s;for(;(s=this.inputSlotCollection.getNextSlot(i.partIndex))!==void 0;){const u=s.partText.substring(0,1);s.partText=s.partText.substring(1),i.partText=i.partText+u,i=s}}processInputRules(t){const i=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!i)return;const{key:s}=t,u=i.characterCount,c=i.partText;if(i.valueType===Il.Numeric){if(!this.keyTypeChecker.isNumberKey(s))return;const f=i.maximumValue,p=i.exceedingMaximumValueCausesTab||!1,m=i.padWithZeros||!1,S=parseInt(this.createNewValue(i,s));if(f&&S>f)if(p){m&&(i.partText=i.partText.padStart(u,"0")),i.isComplete=!0;const b=this.inputSlotCollection.getNextSlot(i.partIndex);b&&!b.isComplete&&(b.partText=s),this.formatRenderer.render(),b&&this.formatNavigator.setCursorPosition(b.isComplete?b.startPosition:b.startPosition+1)}else return;else c.length+1===u?(this.addToInputSlot(s),i.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):c.length+1<u&&(this.addToInputSlot(s),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else c.length+1===u?(this.addToInputSlot(s),i.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):(this.addToInputSlot(s),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}addToInputSlot(t){const i=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());i&&(i.partText=this.createNewValue(i,t))}createNewValue(t,i){const s=t.partText,u=this.formatNavigator.getCursorPosition();if(u>=t.startPosition+t.partText.length)return s+i;{const c=u-t.startPosition;return s.substring(0,c)+i+s.substring(c)}}processSlotRules(t,i=!1){const s=t.characterCount,u=t.allCharactersRequired||!1;if(t.valueType===Il.Numeric){const c=t.minimumValue,f=t.maximumValue;if(u)t.isComplete=t.partText.length===s;else if(c!==void 0&&f!==void 0){const p=t.padWithZeros||!1,m=parseInt(t.partText);t.isComplete=m>=c&&m<=f,t.isComplete&&p&&!i&&(t.partText=t.partText.padStart(s,"0"))}else t.isComplete=t.partText.length>0}else u?t.isComplete=t.partText.length===s:t.isComplete=t.partText.length>0}}class _G{constructor(t,i){this.format=t,this.instanceCollection=A0.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(i,t),this.ruleProcessor=new D9(t,i),this.keyTypeChecker=new x9,this.formatRenderer=new FS(t,i)}instanceCollection;formatNavigator;ruleProcessor;keyTypeChecker;formatRenderer;setInputElement(t){this.ruleProcessor.setInputElement(t),this.formatRenderer.setInputElement(t)}processMovementKey(t){const{key:i,metaKey:s,ctrlKey:u,shiftKey:c}=t;switch(i){case"ArrowLeft":c?this.formatNavigator.moveHighlightLeft():s?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":c?this.formatNavigator.moveHighlightRight():s?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break;case"a":(s||u)&&this.formatNavigator.highlightAll();break}}processKeyPress(t){return this.keyTypeChecker.isIgnoreKey(t)?!1:this.keyTypeChecker.isMovementKey(t)?(this.processMovementKey(t),!1):(this.ruleProcessor.processKeyPress(t),!0)}}class xG{constructor(t,i=""){this.inputValue=i,this.instanceId=yG(),this.instanceCollection=A0.getInstance(),this.keyProcessor=new _G(t,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,t),this.formatRenderer=new FS(t,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,t),this.inputRuleProcessor=new D9(t,this.instanceId)}instanceId;instanceCollection;keyProcessor;formatNavigator;formatRenderer;inputSlotCollection;inputRuleProcessor;previousOutputValue="";inputElementSet=!1;isInputFocused=!1;inputElement;onFormatChange;inputElementCreated(t){this.keyProcessor.setInputElement(t),this.formatNavigator.setInputElement(t),this.formatRenderer.setInputElement(t),this.inputElement=t,this.inputElementSet=!0,this.inputElementSet&&this.inputValue.length>0&&this.inputValuePassed(this.inputValue)}inputFocused(){this.isInputFocused=!0,this.formatRenderer.render(),setTimeout(()=>this.formatNavigator.findCursorPosition())}inputBlurred(){this.isInputFocused=!1}inputValuePassed(t){this.inputValue=t,this.inputElementSet&&(this.inputValue.length>0?this.inputRuleProcessor.processInputValue(t):(this.inputSlotCollection.clearAllSlots(),this.previousOutputValue=void 0),this.renderFormat())}pastedValue(t){t.length>0&&(this.formatNavigator.isSelection?this.formatNavigator.isAllSelected?this.inputValuePassed(t):this.inputRuleProcessor.processPastedValue(t,!0):this.inputValue.length===0?this.inputValuePassed(t):this.inputRuleProcessor.processPastedValue(t),this.renderFormat(!0))}registerFormatChangeEvent(t){this.onFormatChange=t}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(t){if(t.key!=="Tab"){if(!(t.key==="c"&&(t.ctrlKey||t.metaKey))&&!(t.key==="x"&&(t.ctrlKey||t.metaKey))&&!(t.key==="v"&&(t.ctrlKey||t.metaKey)))t.preventDefault(),t.stopPropagation();else return;this.keyProcessor.processKeyPress(t)&&this.inputElement&&this.onFormatChange&&(this.inputSlotCollection.allSlotsCompleted()&&this.previousOutputValue!==this.inputElement.innerHTML?(this.previousOutputValue=this.inputElement.innerHTML,this.onFormatChange(this.inputElement.innerHTML)):this.inputSlotCollection.allSlotsEmpty()&&this.previousOutputValue!==void 0&&(this.previousOutputValue=void 0,this.onFormatChange()))}}dispose(){this.instanceCollection.removeInstances(this.instanceId)}renderFormat(t=!1){setTimeout(()=>{this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=this.inputElement?.innerHTML),t&&this.inputElement?.innerHTML&&this.onFormatChange&&this.onFormatChange(this.inputElement.innerHTML)})}}const DG=(n,t)=>{const{value:i="",format:s,readOnly:u=!1,debounceTime:c=800,fillContainer:f=!0,leftElement:p,rightElement:m,className:S,leftElementClassName:b,rightElementClassName:_,isSingleLine:x=!1,allowSingleLineScroll:D=!1,isInputValid:A,onChange:N,onFocus:R,onBlur:O,onElementCreate:U,onLeftElementClick:j,onRightElementClick:V}=n,[J,$]=H.useState(!0),st=H.useRef(void 0),I=H.useRef(void 0),et=H.useRef(void 0),nt=H.useRef(!1);H.useEffect(()=>(document.addEventListener("mouseup",w),()=>{et.current?.dispose(),document.removeEventListener("mouseup",w)}),[]),H.useEffect(()=>{et.current?.inputValuePassed(i)},[i]),H.useEffect(()=>{et.current?.dispose(),s&&(et.current=new xG(s,i),I.current&&et.current?.inputElementCreated(I.current),et.current?.registerFormatChangeEvent(bt))},[s]);const bt=H.useCallback(gt=>{A?A(gt)?($(!0),N?.(gt)):$(!1):N?.(gt)},[N]),rt=H.useCallback(gt=>{et.current?.inputFocused(),R?.(gt)},[R]),dt=H.useCallback(gt=>{et.current?.inputBlurred(),O?.(gt)},[O]),pt=H.useCallback(()=>{nt.current=!0},[]),tt=H.useCallback(()=>{if(nt.current)nt.current=!1,et.current?.mouseUpHandler();else{const gt=new MouseEvent("mouseup");document.dispatchEvent(gt)}},[]),w=H.useCallback(()=>{nt.current&&(nt.current=!1,et.current?.mouseUpHandler())},[]),F=H.useCallback(gt=>{et.current?.keyDownHandler(gt)},[]),K=H.useCallback(gt=>{gt.preventDefault(),gt.stopPropagation();const Tt=gt.clipboardData?.getData("text/plain");Tt&&et.current?.pastedValue(Tt)},[]),at=H.useCallback(gt=>{st.current?.inputElement?.removeEventListener("keydown",F),st.current?.inputElement?.removeEventListener("mousedown",pt),st.current?.inputElement?.removeEventListener("mouseup",tt),st.current?.inputElement?.removeEventListener("paste",K),st.current=gt,st.current?.inputElement?.addEventListener("keydown",F),st.current?.inputElement?.addEventListener("mousedown",pt),st.current?.inputElement?.addEventListener("mouseup",tt),st.current?.inputElement?.addEventListener("paste",K),I.current=st.current?.inputElement},[]),St=H.useCallback(()=>{st.current?.focus()},[]);H.useImperativeHandle(t,()=>({focus:St}));const W=Se(S,{"bsc:border-error!":!J});return X.jsx($1,{ref:gt=>{gt&&at(gt)},readOnly:u,debounceTime:c,fillContainer:f,leftElement:p,rightElement:m,className:W,leftElementClassName:b,rightElementClassName:_,isSingleLine:x,allowSingleLineScroll:D,onFocus:rt,onBlur:dt,onElementCreate:U,onLeftElementClick:j,onRightElementClick:V})},A9=H.forwardRef(DG),kS=H.createContext(void 0);function M9(n,t,i=!0){const s=db(n),u=rb(n),c=rz(n);let f=Dv(u)-(t.options?.weekStartsOn||0);f=f===-1?6:f;const p=Dv(c)-(t.options?.weekStartsOn||0),m=gR({start:u,end:c}),S=s+f>35?6:5,b=N9(S,7,{dayValue:null,isCurrent:!0});let _=1;for(let x=0,D=S;x<D;x++){for(let A=x>0?0:f;A<7;A++){const N=m[_-1];if(N.setHours(n.getHours(),n.getMinutes(),n.getSeconds()),b[x][A].dayValue=N,++_>s)break}if(_>s)break}if(f>0&&i)for(let x=0;x<f;x++)b[0][x].dayValue=iH(u,f-x),b[0][x].isCurrent=!1;if(p>-1&&i)for(let x=6;x>p;x--)b[S-1][x].dayValue=ph(c,x-p),b[S-1][x].isCurrent=!1;return b}function N9(n,t,i){const s=[];for(let u=0,c=n;u<c;u++){const f=[];for(let p=0,m=t;p<m;p++){const S=AG(i)?i:{...i};f.push(S)}s.push(f)}return s}function AG(n){const t=typeof n;return t==="string"||t==="number"||t==="boolean"||n instanceof Date}function MG(n){const t=sH(new Date,n.options?.weekStartsOn||0),i=[];for(let s=0;s<7;s++)i.push(ph(t,s).toLocaleDateString(n.code,{weekday:"short"}));return i}function NG(n){const t=new Date(Date.UTC(2020,0,1)),i=[[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}]];let s=0;for(let u=0;u<3;u++)for(let c=0;c<4;c++)i[u][c]={monthNumber:s,monthName:Zo(t,s++).toLocaleDateString(n.code,{month:"short"})};return i}function OG(n,t){const i=new Date(n.getTime()),s=Math.floor(i.getFullYear()/10)*10;i.setFullYear(s);const u=yR({start:i,end:r0(i,9)}),c=N9(3,4,"");let f=0;for(let p=0;p<3;p++)for(let m=0;m<4&&(c[p][m]=u[f++].toLocaleDateString(t.code,{year:"numeric"}),f!==u.length);m++);return c}function RG(n){const t=new Date;return t.setHours(0,0,0,0),t.toLocaleTimeString(n.code)}function zG(n,t,i){return n.getTime()>=t.getTime()&&n.getTime()<=i.getTime()}function M0(n,t){const i=lH(n);if(isNaN(i.valueOf())){let s=Fl(n,"P pp",new Date,{locale:t});return!isNaN(s.valueOf())||(s=Fl(n,"Pp",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P HH:mm",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P hh:mm a..aaa",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P HH:mm:ss",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P hh:mm:ss a..aaa",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"P p",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"pp",new Date,{locale:t}),!isNaN(s.valueOf()))||(s=Fl(n,"p",new Date,{locale:t}),!isNaN(s.valueOf()))?s:void 0}return i}function IS(n,t){const i=n.split("-");if(i.length!==2)return;const s=M0(i[0].trim(),t);if(!s)return;const u=M0(i[1].trim(),t);if(u)return[s,u]}var Qe=(n=>(n[n.DateTime=0]="DateTime",n[n.DateOnly=1]="DateOnly",n[n.TimeOnly=2]="TimeOnly",n[n.DateRange=3]="DateRange",n))(Qe||{}),Ta=(n=>(n[n.DaySelector=0]="DaySelector",n[n.MonthSelector=1]="MonthSelector",n[n.YearSelector=2]="YearSelector",n[n.TimeSelector=3]="TimeSelector",n[n.DateRangeSelector=4]="DateRangeSelector",n))(Ta||{}),Mh=(n=>(n[n.Day=0]="Day",n[n.Month=1]="Month",n[n.Year=2]="Year",n[n.Range=3]="Range",n))(Mh||{}),N0=(n=>(n[n.Short=0]="Short",n[n.Medium=1]="Medium",n[n.Long=2]="Long",n))(N0||{}),Gn=(n=>(n[n.TwelveHour=0]="TwelveHour",n[n.TwentyFourHour=1]="TwentyFourHour",n))(Gn||{}),tu=(n=>(n[n.Normal=0]="Normal",n[n.Range=1]="Range",n))(tu||{}),bg=(n=>(n[n.Right=0]="Right",n[n.Left=1]="Left",n[n.None=2]="None",n))(bg||{}),pe=(n=>(n[n.SetDateSelector=0]="SetDateSelector",n[n.SetViewDate=1]="SetViewDate",n[n.SetSelectedDate=2]="SetSelectedDate",n[n.SetSelectedDateRange=3]="SetSelectedDateRange",n[n.SetSelectedStartDate=4]="SetSelectedStartDate",n[n.SetSelectedEndDate=5]="SetSelectedEndDate",n[n.SetTimeFormat=6]="SetTimeFormat",n[n.ClearDates=7]="ClearDates",n[n.InitializeDates=8]="InitializeDates",n))(pe||{});const HG=(n,t)=>{switch(t.type){case 0:return t.dateSelector!==void 0?{...n,currentSelector:t.dateSelector,currentViewDate:t.viewDate||n.currentViewDate}:{...n};case 1:return{...n,currentViewDate:t.viewDate||new Date,dateInitialized:!0};case 2:return{...n,selectedDate:t.selectedDate||n.selectedDate,currentViewDate:t.viewDate||n.currentViewDate};case 3:return{...n,selectedStartDate:t.selectedStartDate||n.selectedStartDate,selectedEndDate:t.selectedEndDate||n.selectedEndDate};case 4:return{...n,selectedStartDate:t.selectedStartDate,selectedEndDate:void 0};case 5:return{...n,selectedEndDate:t.selectedEndDate};case 6:return{...n,timeFormat:t.timeFormat||n.timeFormat};case 7:return{currentSelector:n.currentSelector,currentViewDate:n.currentViewDate,timeFormat:n.timeFormat,dateInitialized:!0};case 8:{const i={...n,currentViewDate:wG(t.initialDate),dateInitialized:!0};return Array.isArray(t.initialDate)?{...i,selectedStartDate:t.initialDate[0],selectedEndDate:t.initialDate[1]}:{...i,selectedDate:t.initialDate}}default:return{...n,currentSelector:Ta.DaySelector}}};function wG(n){return n?Array.isArray(n)?n[0]:n:new Date}const WS=(n,t,i)=>{const s=H.useCallback(m=>{i({type:pe.SetViewDate,viewDate:Zo(t,m)})},[t]),u=H.useCallback(m=>{i({type:pe.SetViewDate,viewDate:Ov(t,m)})},[t]),c=H.useCallback(m=>{i({type:pe.SetViewDate,viewDate:r0(t,m)})},[t]),f=H.useCallback(m=>{i({type:pe.SetViewDate,viewDate:Rv(t,m)})},[t]),p=H.useCallback(m=>{i({type:pe.SetDateSelector,dateSelector:m})},[]);return{...n,incrementViewMonths:s,decrementViewMonths:u,incrementViewYears:c,decrementViewYears:f,setDateSelector:p}},Eg=({viewDate:n,selectedDate:t,selectedStartDate:i,selectedEndDate:s,selectionMode:u=tu.Normal,locale:c,onDateSelected:f,selectableDate:p,isValidDate:m,dispatcher:S})=>{const[b,_]=H.useState(!1),[x,D]=H.useState(),[A,N]=H.useState(),[R,O]=H.useState(),[U,j]=H.useState(),V=H.useRef(void 0),J=H.useRef(void 0),$=H.useContext(kS),st=H.useMemo(()=>$.calendarTemplate,[$.calendarTemplate]);H.useEffect(()=>{V.current=c,J.current=MG(V.current),_(!0)},[]),H.useEffect(()=>{n&&V.current&&O(M9(n,V.current,u===tu.Normal))},[n,b]),H.useEffect(()=>{j(t?new Date(t.getFullYear(),t.getMonth(),t.getDate()):void 0)},[t]),H.useEffect(()=>{D(i?new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,0).getTime():void 0),N(s?new Date(s.getFullYear(),s.getMonth(),s.getDate(),23,59,59).getTime():void 0)},[i,s]),H.useEffect(()=>{V.current&&c&&(V.current=c,O(M9(n,V.current,u===tu.Normal)))},[c]);const I=pt=>{if(u===tu.Normal)S?.({type:pe.SetSelectedDate,selectedDate:pt,viewDate:pt}),f?.(pt);else{if(!f)throw new Error("Range selection mode requires onDateSelected to be set");!i||oz(pt,i)?f(pt):i&&!s?f(pt,{setEndDate:!0}):i&&s&&f(pt)}},et=pt=>U?.toLocaleDateString()===pt.toLocaleDateString(),nt=pt=>{if(x&&A){const tt=pt.getTime();return tt>=x&&tt<=A}return!1},bt=WS({viewDate:n,selectedDate:t,selectedStartDate:i,selectedEndDate:s,selectionMode:u,locale:c,weekDays:J.current,monthMatrix:R,selectableDate:p,isValidDate:m,onDateClicked:I,isSelectedDate:et,isInSelectedDateRange:nt},n,S),dt=st||((pt,tt)=>X.jsx("div",{className:"bc-dt-calendar bsc:w-full",children:tt}));return X.jsx(vc,{props:bt,template:dt,children:X.jsxs("div",{className:"bc-dt-day-row bsc:grid bsc:min-w-[329px] bsc:grid-cols-7 bsc:gap-3",children:[J.current?.map((pt,tt)=>X.jsx("div",{className:"bc-dt-day-cell bsc:text-center bsc:font-bold",children:pt},tt)),R?.map((pt,tt)=>pt.map((w,F)=>{const K=w.dayValue!==null&&(p===void 0||p(w.dayValue)),at=Se("bsc:text-center bsc:py-1 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",{"bsc:text-gray-3":!w.isCurrent,"bsc:bg-primary-1 bsc:text-white bsc:dark:bg-mono-light-1 bsc:dark:text-mono-dark-1":w&&w.dayValue&&(U&&et(w.dayValue)||x&&!A&&lb(x,w.dayValue)||x&&A&&nt(w.dayValue)),"bsc:cursor-pointer":K,"bsc:text-error bsc:cursor-not-allowed":!K,"bsc:bg-primary-5 bsc:dark:bg-mono-light-3 bsc:dark:text-mono-dark-1":w.dayValue&&aH(w.dayValue)&&!(et(w.dayValue)||nt(w.dayValue))},"bc-dt-date-cell");return X.jsx("div",{className:at,onClick:()=>w&&w.dayValue&&K&&(m===void 0||m(w.dayValue))&&I(w.dayValue),children:w.dayValue?.getDate().toLocaleString(V.current?.code)},tt.toString()+F.toString())}))]})})},Tg=({title:n,scrollerType:t,onTitleClicked:i,onMovePrevious:s,onMoveNext:u,viewDate:c,dispatcher:f})=>{const m=H.useContext(kS).dateScrollerTemplate,S=WS({title:n,scrollerType:t,onTitleClicked:i,onMovePrevious:s,onMoveNext:u},c,f),b="bsc:bg-transparent bsc:cursor-pointer bsc:focus:outline-hidden bsc:hover:bg-primary-1! bsc:hover:text-white! bsc:dark:hover:bg-mono-light-3!",x=m||((D,A)=>X.jsx("div",{className:"bc-dt-scroller bsc:flex bsc:w-full bsc:flex-row bsc:items-center bsc:px-2 bsc:py-1",children:A}));return X.jsxs(vc,{props:S,template:x,children:[X.jsx("div",{className:"bc-dt-scroller-left bsc:shrink bsc:cursor-pointer",children:X.jsx(Ql,{className:b,onClick:s,children:X.jsx(Ts,{icon:"chevronLeft",size:ka.Regular})})}),X.jsx("div",{className:"bc-dt-scroller-title bsc:grow bsc:cursor-pointer bsc:text-center bsc:hover:text-primary-2 bsc:dark:hover:text-mono-light-3",onClick:i,children:n}),X.jsx("div",{className:"bc-dt-scroller-right bsc:shrink bsc:cursor-pointer",children:X.jsx(Ql,{className:b,onClick:u,children:X.jsx(Ts,{icon:"chevronRight",size:ka.Regular})})})]})},UG=({selectedDate:n,viewDate:t,locale:i,showTimeSelector:s,selectableDate:u,isValidDate:c,onChange:f,dispatcher:p})=>{const m=()=>{t&&p({type:pe.SetViewDate,viewDate:Ov(t,1)})},S=()=>{t&&p({type:pe.SetViewDate,viewDate:Zo(t,1)})},b=()=>{p({type:pe.SetDateSelector,dateSelector:Ta.MonthSelector})},_=()=>{p({type:pe.SetDateSelector,dateSelector:Ta.TimeSelector})},x=()=>t?t.toLocaleDateString(i.code,{month:"long",year:"numeric"}):"";return X.jsxs("div",{className:"bc-dt-day-selector bsc:p-2",children:[X.jsx(Tg,{title:x(),scrollerType:Mh.Day,onTitleClicked:b,onMovePrevious:m,onMoveNext:S,viewDate:t,dispatcher:p}),X.jsx(Eg,{viewDate:t,selectedDate:n,locale:i,selectableDate:u,isValidDate:c,onDateSelected:f,dispatcher:p}),s&&X.jsx("div",{className:"bc-dt-time-value-wrapper bsc:flex bsc:w-full bsc:flex-row bsc:justify-center bsc:p-2",children:X.jsx("div",{className:"bc-dt-time-value bsc:cursor-pointer bsc:p-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:bg-mono-dark-1 bsc:dark:text-mono-light-1 bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-2",onClick:_,children:n?.toLocaleTimeString(i.code)||RG(i)})})]})},BG=({viewDate:n,locale:t,dateSelection:i=Qe.DateTime,dispatcher:s})=>{const u=H.useRef(NG(t)),c=()=>{const b=Rv(n,1);s({type:pe.SetViewDate,viewDate:b})},f=()=>{const b=r0(n,1);s({type:pe.SetViewDate,viewDate:b})},p=b=>{s({type:pe.SetDateSelector,dateSelector:i!==Qe.DateRange?Ta.DaySelector:Ta.DateRangeSelector,viewDate:TH(n,b)})},m=()=>n.toLocaleDateString(t.code,{year:"numeric"}),S=()=>{s({type:pe.SetDateSelector,dateSelector:Ta.YearSelector})};return X.jsxs("div",{className:"bc-dt-month-selector bsc:p-2",style:{minWidth:"20rem"},children:[X.jsx(Tg,{title:m(),scrollerType:Mh.Month,onTitleClicked:S,onMovePrevious:c,onMoveNext:f,viewDate:n,dispatcher:s}),X.jsx("div",{className:"bc-dt-month-grid bsc:grid bsc:w-full bsc:grid-cols-4 bsc:gap-4",children:u.current.map((b,_)=>b.map((x,D)=>X.jsx("div",{className:"bc-dt-month-cell bsc:cursor-pointer bsc:text-center bsc:py-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",onClick:()=>p(x.monthNumber),children:x.monthName},_.toString()+D.toString())))})]})},VG=({viewDate:n,selectedStartDate:t,selectedEndDate:i,locale:s,onChange:u,dispatcher:c})=>{const f=ng("screen and (max-device-width: 40rem)"),p=Zo(n,1),m=(D,A)=>{!A||!A.setEndDate?c({type:pe.SetSelectedStartDate,selectedStartDate:D}):(c({type:pe.SetSelectedEndDate,selectedEndDate:D}),t&&u&&u([t,D]))},S=()=>{c({type:pe.SetDateSelector,dateSelector:Ta.MonthSelector})},b=()=>f?`${n.toLocaleDateString(s.code,{month:"long"})} ${n.toLocaleDateString(s.code,{year:"numeric"})}`:`${n.toLocaleDateString(s.code,{month:"long"})} ${n.toLocaleDateString(s.code,{year:"numeric"})} - ${p.toLocaleDateString(s.code,{month:"long"})} ${p.toLocaleDateString(s.code,{year:"numeric"})}`,_=()=>{n&&c({type:pe.SetViewDate,viewDate:Ov(n,1)})},x=()=>{n&&c({type:pe.SetViewDate,viewDate:Zo(n,1)})};return X.jsxs("div",{className:"bc-dt-range-selector bsc:flex bsc:flex-col",children:[X.jsx("div",{className:"bc-dt-range-scroller-wrapper bsc:shrink",children:X.jsx(Tg,{title:b(),scrollerType:Mh.Range,onTitleClicked:S,onMovePrevious:_,onMoveNext:x,viewDate:n,dispatcher:c})}),X.jsx("div",{className:"bsc-flex-grow",children:X.jsx(Hv,{mobileMarkup:X.jsx("div",{className:"bc-dt-range-calendar bsc:px-2 bsc:py-1",children:X.jsx(Eg,{viewDate:n,selectedStartDate:t,selectedEndDate:i,selectionMode:tu.Range,onDateSelected:m,locale:s,dispatcher:c})}),aboveMobileMarkup:X.jsxs("div",{className:"bc-dt-range-wrapper bsc:flex bsc:flex-row bsc:px-2 bsc:py-1",children:[X.jsx("div",{className:"bc-dt-range-calendar-1 bsc:border-r bsc:border-solid bsc:border-gray-3 bsc:pr-4",children:X.jsx(Eg,{viewDate:n,selectedStartDate:t,selectedEndDate:i,selectionMode:tu.Range,onDateSelected:m,locale:s,dispatcher:c})}),X.jsx("div",{className:"bc-dt-range-calendar-2 bsc:pl-4",children:X.jsx(Eg,{viewDate:p,selectedStartDate:t,selectedEndDate:i,selectionMode:tu.Range,onDateSelected:m,locale:s,dispatcher:c})})]})})})]})},GG=({viewDate:n,showDateSelector:t,locale:i,timeFormat:s=Gn.TwelveHour,timeConstraints:u,onChange:c,dispatcher:f})=>{const p=H.useRef(s===Gn.TwelveHour?11:23),m=H.useRef(s===Gn.TwelveHour?["12","01","02","03","04","05","06","07","08","09","10","11"]:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]),S=H.useRef(xH(0,59,pt=>pt.toString().padStart(2,"0"))),b=H.useRef(["AM","PM"]),_=H.useRef(iR(n)),x=pt=>pt>11?pt-12:pt,[D,A]=H.useState(x(n.getHours())),[N,R]=H.useState(n.getMinutes()),[O,U]=H.useState(n.getHours()<=12?0:1),j=H.useRef(n.toLocaleDateString(i.code));H.useEffect(()=>{const pt=n.getHours(),tt=n.getMinutes();if(pt!==D&&A(s===Gn.TwelveHour?x(pt):pt),tt!==N&&R(tt),s===Gn.TwelveHour){const w=pt<=11?0:1;w!==O&&U(w)}},[n]);const V=()=>{const pt=u?.hours?.step||1,tt=D<p.current?D+pt:0;A(tt),et(tt,N,O)},J=()=>{const pt=u?.hours?.step||1,tt=D>0?D-pt:p.current;A(tt),et(tt,N,O)},$=()=>{const pt=u?.minutes?.step||1,tt=N+pt<(u?.minutes?.max||59)?N+pt:u?.minutes?.min||0;R(tt),et(D,tt,O)},st=()=>{const pt=u?.minutes?.step||1,tt=N-pt>=(u?.minutes?.min||0)?N-pt:(u?.minutes?.max||60)-pt;R(tt),et(D,tt,O)},I=()=>{const pt=O===0?1:0;U(pt),et(D,N,pt)},et=(pt,tt,w)=>{const F=s===Gn.TwelveHour&&w===1?pt+12:pt;_.current.setHours(F,tt),f({type:pe.SetSelectedDate,selectedDate:_.current,viewDate:_.current}),c?.(_.current)},nt=()=>{f({type:pe.SetDateSelector,dateSelector:Ta.DaySelector})},bt=Se("bsc:w-full bsc:grid bsc:grid-rows-3 bsc:gap-4 bsc:items-center bc-dt-time-grid",{"bsc:grid-cols-4":s===Gn.TwelveHour,"bsc:grid-cols-3":s===Gn.TwentyFourHour}),rt=Se("bsc:text-center bsc:cursor-pointer bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:text-mono-light-1 bsc:dark:hover:bg-mono-light-1 bsc:dark:hover:text-mono-dark-1 bc-dt-time-date-value",{"bsc:col-span-4":s===Gn.TwelveHour,"bsc:col-span-3":s===Gn.TwentyFourHour}),dt="bsc-bg-transparent bsc:p-2 bsc:cursor-pointer bsc:focus:outline-hidden bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-1 bsc:dark:hover:text-mono-dark-1";return X.jsx("div",{className:"bc-dt-time-selector bsc:flex bsc:flex-row bsc:justify-center bsc:p-2",style:{minWidth:s===Gn.TwelveHour?"15rem":"11rem"},children:X.jsxs("div",{className:bt,children:[t&&X.jsx("div",{className:rt,onClick:nt,children:j.current}),X.jsx("div",{className:"bc-dt-time-hour-increase bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:V,children:X.jsx(Ts,{icon:"chevronUp",size:ka.Regular})})}),X.jsx("div",{}),X.jsx("div",{className:"bc-dt-time-minute-increase bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:$,children:X.jsx(Ts,{icon:"chevronUp",size:ka.Regular})})}),s===Gn.TwelveHour&&X.jsx("div",{className:"bc-dt-time-meridian-increase bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:I,children:X.jsx(Ts,{icon:"chevronUp",size:ka.Regular})})}),X.jsx("div",{className:"bc-dt-time-hour-value bsc:text-center",children:m.current[D]}),X.jsx("div",{className:"bc-dt-time-separator bsc:text-center",children:":"}),X.jsx("div",{className:"bc-dt-time-minute-value bsc:text-center",children:S.current[N]}),s===Gn.TwelveHour&&X.jsx("div",{className:"bc-dt-time-meridian-value bsc:text-center",children:b.current[O]}),X.jsx("div",{className:"bc-dt-time-hour-decrease bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:J,children:X.jsx(Ts,{icon:"chevronDown",size:ka.Regular})})}),X.jsx("div",{}),X.jsx("div",{className:"bc-dt-time-minute-decrease bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:st,children:X.jsx(Ts,{icon:"chevronDown",size:ka.Regular})})}),s===Gn.TwelveHour&&X.jsx("div",{className:"bc-dt-time-meridian-decrease bsc:cursor-pointer bsc:text-center",children:X.jsx(Ql,{className:dt,onClick:I,children:X.jsx(Ts,{icon:"chevronDown",size:ka.Regular})})})]})})},jG=({viewDate:n,locale:t,dispatcher:i})=>{const s=OG(n,t),u=()=>{const m=Rv(n,10);i({type:pe.SetViewDate,viewDate:m})},c=()=>{const m=r0(n,10);i({type:pe.SetViewDate,viewDate:m})},f=m=>{const S=parseInt(m);i({type:pe.SetDateSelector,dateSelector:Ta.MonthSelector,viewDate:CH(n,S)})},p=()=>`${s[0][0].toString()} - ${s[2][1].toString()}`;return X.jsxs("div",{className:"bc-dt-year-selector bsc:p-2",style:{minWidth:"20rem"},children:[X.jsx(Tg,{title:p(),scrollerType:Mh.Year,onMovePrevious:u,onMoveNext:c,viewDate:n,dispatcher:i}),X.jsx("div",{className:"bc-dt-year-wrapper bsc:w-full",children:X.jsx("div",{className:"bc-dt-year-grid bsc:grid bsc:grid-cols-4 bsc:gap-4",children:s.map((m,S)=>m.map((b,_)=>b.length>0?X.jsx("div",{className:"bc-dt-year-cell bsc:cursor-pointer bsc:text-center bsc:py-2 bsc:hover:bg-primary-2 bsc:hover:text-white bsc:dark:hover:bg-mono-light-2 bsc:dark:hover:text-mono-dark-1",onClick:()=>f(b),children:b},S.toString()+_.toString()):X.jsx("div",{},S.toString()+_.toString())))})})]})};class LG{constructor(t,i){this.dateSelection=t;const s=2023,u=12,c=20,p=new Date(s,u-1,c).toLocaleDateString(i,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=p.replace(`${s}`,"YYYY").replace(`${u}`,"MM").replace(`${c}`,"DD");const m=new Date,S=18,b=24,_=37,x=317;m.setHours(S,b,_,x);const D=m.toLocaleTimeString(i);this.use24HourTime=D.startsWith("18"),this.timeFormat=D.replace(`${this.use24HourTime?S:"6"}`,"HH").replace(`${b}`,"MM").replace(`${_}`,"SS").replace(`${x}`,"LLL"),this.createDateParts()}dateFormat;timeFormat;use24HourTime;monthPart;dayPart;yearPart;twelveHourPart;twentyFourHourPart;minutePart;meridianPart;get is24HourTime(){return this.use24HourTime}createInputFormat(){const t={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case Qe.DateOnly:return this.createDateFormat(t);case Qe.TimeOnly:return this.createTimeFormat(t);case Qe.DateRange:return this.createDateRangeFormat(t);case Qe.DateTime:return this.createDateTimeFormat(t)}}createDateFormat(t){return this.dateFormat.startsWith("MM")?t.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.formatParts.push(...this.createDayMonthYearFormatParts()):t.formatParts.push(...this.createYearMonthDayFormatParts()),t}createTimeFormat(t){return this.use24HourTime?t.formatParts.push(...this.createTwentyFourHourFormatParts()):t.formatParts.push(...this.createTwelveHourFormatParts()),t}createDateRangeFormat(t){const i=[];this.dateFormat.startsWith("MM")?i.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?i.push(...this.createDayMonthYearFormatParts()):i.push(...this.createYearMonthDayFormatParts());const s={characterCount:3,placeholder:" - ",inputText:" - ",isSeparator:!0};return t.formatParts.push(...i,s,...i),t}createDateTimeFormat(t){this.dateFormat.startsWith("MM")?t.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.formatParts.push(...this.createDayMonthYearFormatParts()):t.formatParts.push(...this.createYearMonthDayFormatParts());const i={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return t.formatParts.push(i),this.use24HourTime?t.formatParts.push(...this.createTwentyFourHourFormatParts()):t.formatParts.push(...this.createTwelveHourFormatParts()),t}createMonthDayYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("MM",""),i=t.indexOf("DD"),s=t.substring(0,i);t=t.replace(s,"").replace("DD","");const u={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};i=t.indexOf("YYYY"),s=t.substring(0,i);const c={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};return[this.monthPart,u,this.dayPart,c,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("DD",""),i=t.indexOf("MM"),s=t.substring(0,i);t=t.replace(s,"").replace("MM","");const u={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};i=t.indexOf("YYYY"),s=t.substring(0,i);const c={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};return[this.dayPart,u,this.monthPart,c,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let t=this.dateFormat.replace("YYYY",""),i=t.indexOf("MM"),s=t.substring(0,i);t=t.replace(s,"").replace("MM","");const u={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};i=t.indexOf("DD"),s=t.substring(0,i);const c={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};return[this.yearPart,u,this.monthPart,c,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const t=this.timeFormat.replace("HH",""),i=t.indexOf("MM"),s=t.substring(0,i),u={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0},c={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,u,this.minutePart,c,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const t=this.timeFormat.replace("HH",""),i=t.indexOf("MM"),s=t.substring(0,i),u={characterCount:s.length,placeholder:s,inputText:s,isSeparator:!0};return[this.twentyFourHourPart,u,this.minutePart]}return[]}createDateParts(){this.monthPart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Il.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.dayPart={characterCount:2,placeholder:"D",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Il.Numeric,minimumValue:1,maximumValue:31,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.yearPart={characterCount:4,placeholder:"Y",inputText:"_",isSeparator:!1,allCharactersRequired:!0,valueType:Il.Numeric},this.twelveHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Il.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.twentyFourHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Il.Numeric,minimumValue:0,maximumValue:23,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.minutePart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Il.Numeric,minimumValue:0,maximumValue:59,exceedingMaximumValueCausesError:!0,padWithZeros:!0},this.meridianPart={characterCount:2,inputText:"_",isSeparator:!1,valueType:Il.Text,possibleValues:["AM","PM"]}}}const PG=(n,t)=>{const[i,s]=H.useState(),u=H.useRef(void 0);return H.useEffect(()=>{t&&!i&&(u.current=new LG(n,t),s(u.current.createInputFormat()))},[t]),[i,u.current?.is24HourTime]},YG=({value:n,readOnly:t=!1,label:i,useDefaultDateValue:s=!1,useFormattedInput:u=!1,allowClear:c=!1,closeSelector:f=!1,locale:p,className:m,dateSelection:S=Qe.DateTime,dateFormat:b,timeConstraints:_,icon:x,iconPosition:D=bg.Right,inputElement:A,selectableDate:N,isValidDate:R,onChange:O,onError:U,calendarTemplate:j,dateScrollerTemplate:V,inputTemplate:J,wrapperTemplate:$})=>{const[st,I]=H.useState(!1),[et,nt]=H.useState(),[bt,rt]=H.useState(),[dt,pt,tt]=OD(S),w=H.useRef(void 0),F=H.useRef(!1),K=H.useRef(p||_H()),at=H.useRef(void 0),St=H.useRef(void 0),W=H.useRef(void 0),gt=H.useRef(null),Tt=H.useRef(null),[Pt,le]=PG(S,et),xn=yT.useDateLocale(K.current),xe=H.useRef({calendarTemplate:j,dateScrollerTemplate:V});H.useEffect(()=>{nt(xn.code),at.current=xn;const Ht=ln();ue(n||s?{type:pe.InitializeDates,initialDate:Array.isArray(Ht)?Ht[0]:Ht}:{type:pe.SetViewDate,viewDate:Array.isArray(Ht)?Ht[0]:Ht})},[xn]),H.useEffect(()=>{if(n){const Ht=ln();ue({type:pe.InitializeDates,initialDate:Ht})}else ue({type:pe.ClearDates})},[n,at.current]),H.useEffect(()=>{le&&ue({type:pe.SetTimeFormat,timeFormat:le?Gn.TwentyFourHour:Gn.TwelveHour})},[le]),H.useEffect(()=>{A&&(St.current=A)},[A]),H.useEffect(()=>{ue({type:pe.SetDateSelector,dateSelector:Dn()})},[dt]);const Dn=H.useCallback(()=>tt.current===Qe.TimeOnly?Ta.TimeSelector:tt.current===Qe.DateTime||tt.current===Qe.DateOnly?Ta.DaySelector:Ta.DateRangeSelector,[]),ln=()=>{const Ht=new Date;return Ht.setHours(0,0,0,0),n?typeof n=="string"?tt.current!==Qe.DateRange?M0(n,at.current):IS(n,at.current):n:Ht},Be={currentSelector:Dn(),currentViewDate:new Date,timeFormat:Gn.TwelveHour,dateInitialized:!1},[At,ue]=H.useReducer(HG,Be),ta=()=>{Mi(),I(!0)},ea=H.useMemo(()=>s0(()=>{I(!1)},250),[]),An=H.useMemo(()=>s0(()=>{ea.cancel()},5),[ea]),Ba=Ht=>{const ge=Ht.target.innerText;Ji(ge)},pn=Ht=>{if(Ht){const ge=tt.current!==Qe.DateRange?M0(Ht,at.current):IS(Ht,at.current);if(ge)if(R){const qr=Array.isArray(ge)?ge.every(Wl=>R(Wl)):R(ge);return!qr&&U&&U(ge),qr}else return!0;else return!1}else return!0},ha=Ht=>{Ji(Ht||"")},Ji=Ht=>{const ge=tt.current!==Qe.DateRange?M0(Ht,at.current):IS(Ht,at.current);ge?(Array.isArray(ge)?(zG(ge[0],rb(At.currentViewDate),mR(Zo(At.currentViewDate,1)))||ue({type:pe.SetViewDate,viewDate:ge[0]}),ue({type:pe.SetSelectedDateRange,selectedStartDate:ge[0],selectedEndDate:ge[1]})):ue({type:pe.SetSelectedDate,selectedDate:ge,viewDate:ge}),O?.(ge)):Ht===""&&(ue({type:pe.ClearDates}),O?.())},di=Ht=>{tt.current===Qe.DateOnly&&f===!0&&I(!1),O?.(Ht)},Fi=()=>{Mi(),I(!st),Tt.current?Tt.current.focus():gt.current&>.current.focus()},Mn=()=>{ue({type:pe.ClearDates}),I(!1),O?.()},rn=(Ht,ge)=>{(!St.current||w.current!==ge)&&(St.current=Ht,w.current=ge,F.current=!0)},Mi=()=>{(!W.current||F.current)&&St.current&&(W.current=St.current,rt(St.current),F.current=!1)},Ut=()=>{I(!1),ue({type:pe.SetDateSelector,dateSelector:Dn()})},Ae=()=>{switch(b){case N0.Short:return"short";case N0.Medium:return"medium";case N0.Long:return"long";default:return}},jn=()=>{const Ht=Ae();switch(tt.current){case Qe.DateTime:return At.selectedDate?Ht?At.selectedDate.toLocaleString(at.current?.code,{dateStyle:Ht,timeStyle:Ht}):At.selectedDate.toLocaleString(at.current?.code):"";case Qe.DateOnly:return At.selectedDate?Ht?At.selectedDate.toLocaleDateString(at.current?.code,{dateStyle:Ht}):At.selectedDate.toLocaleDateString(at.current?.code):"";case Qe.TimeOnly:return At.selectedDate?Ht?At.selectedDate.toLocaleTimeString(at.current?.code,{timeStyle:Ht,hour12:At.timeFormat===Gn.TwelveHour,hourCycle:At.timeFormat===Gn.TwentyFourHour?"h23":void 0}):At.selectedDate.toLocaleTimeString(at.current?.code,{hour12:At.timeFormat===Gn.TwelveHour,hourCycle:At.timeFormat===Gn.TwentyFourHour?"h23":void 0}):"";case Qe.DateRange:return At.selectedStartDate&&At.selectedEndDate?Ht?`${At.selectedStartDate.toLocaleDateString(at.current?.code,{dateStyle:Ht})} - ${At.selectedEndDate.toLocaleDateString(at.current?.code,{dateStyle:Ht})}`:`${At.selectedStartDate.toLocaleDateString(at.current?.code)} - ${At.selectedEndDate.toLocaleDateString(at.current?.code)}`:"";default:return At.selectedDate?Ht?At.selectedDate.toLocaleString(at.current?.code,{dateStyle:Ht,timeStyle:Ht}):At.selectedDate.toLocaleString(at.current?.code):""}},Va=dt===Qe.DateTime||dt===Qe.DateOnly||dt===Qe.DateRange,ke=dt===Qe.DateTime||dt===Qe.TimeOnly,mn=D===bg.None?{}:D===bg.Right?{rightElement:X.jsxs("div",{className:"bsc:flex bsc:text-black bsc:dark:text-mono-light-1",children:[c&&!t&&X.jsx("div",{children:X.jsx(Ts,{icon:"close",size:ka.Small,className:"bsc:cursor-pointer bsc:text-sm",onClick:Mn})}),X.jsx("div",{className:"bsc:ml-2",onClick:t?void 0:Fi,children:x||X.jsx(Ts,{icon:"calendar",size:ka.Small,className:t?void 0:"bsc:cursor-pointer"})})]}),rightElementClassName:"bsc:justify-center"}:{leftElement:X.jsxs("div",{className:"bsc:flex bsc:text-black bsc:dark:text-mono-light-1",children:[X.jsx("div",{className:"bsc:mr-2",onClick:t?void 0:Fi,children:x||X.jsx(Ts,{icon:"calendar",size:ka.Small,className:t?void 0:"bsc:cursor-pointer"})}),c&&!t&&X.jsx("div",{children:X.jsx(Ts,{icon:"close",size:ka.Small,className:"bsc:cursor-pointer bsc:text-sm",onClick:Mn})})]}),leftElementClassName:"bsc:justify-center"},eu={setDateSelector:Ht=>pt(Ht)},nu=$||((Ht,ge)=>X.jsx(X.Fragment,{children:ge})),da=()=>X.jsx(vc,{props:eu,template:nu,children:X.jsxs(X.Fragment,{children:[At.currentSelector===Ta.DaySelector&&Va&&At.dateInitialized&&at.current&&X.jsx(UG,{selectedDate:At.selectedDate,viewDate:At.currentViewDate,locale:at.current,showTimeSelector:tt.current===Qe.DateTime,selectableDate:N,isValidDate:R,dispatcher:ue,onChange:di}),At.currentSelector===Ta.MonthSelector&&Va&&At.dateInitialized&&at.current&&X.jsx(BG,{viewDate:At.currentViewDate,locale:at.current,dateSelection:tt.current,dispatcher:ue}),At.currentSelector===Ta.YearSelector&&Va&&At.dateInitialized&&at.current&&X.jsx(jG,{viewDate:At.currentViewDate,locale:at.current,dispatcher:ue}),At.currentSelector===Ta.TimeSelector&&ke&&At.dateInitialized&&at.current&&X.jsx(GG,{viewDate:At.currentViewDate,showDateSelector:tt.current===Qe.DateTime,locale:at.current,timeFormat:At.timeFormat,timeConstraints:_,onChange:O,dispatcher:ue}),At.currentSelector===Ta.DateRangeSelector&&Va&&At.dateInitialized&&at.current&&X.jsx(VG,{viewDate:At.currentViewDate,selectedStartDate:At.selectedStartDate,selectedEndDate:At.selectedEndDate,locale:at.current,onChange:O,dispatcher:ue})]})}),Pr=WS({label:i,readOnly:t,allowClear:c,getValue:jn,onFocus:ta,onInput:Ba,iconPosition:D,iconElement:mn.rightElement||mn.leftElement},At.currentViewDate,ue),Yr=J||((Ht,ge)=>X.jsx(X.Fragment,{children:ge})),au=Se("bsc:text-left",{"bc-read-only bsc:bg-gray-4 bsc:dark:bg-mono-dark-3":t,"bsc:bg-white bsc:dark:bg-mono-dark-1":!t},"bc-dt-input",m);return X.jsx(kS.Provider,{value:xe.current,children:X.jsxs("div",{className:"bc-date-time",children:[i&&X.jsx(wr,{label:i,readOnly:t,className:"bc-dt-label"}),X.jsx(Hv,{mobileMarkup:X.jsxs(X.Fragment,{children:[X.jsx(vc,{props:Pr,template:Yr,children:X.jsx($1,{ref:gt,value:jn(),readOnly:t,inputMode:"none",className:au,onFocus:ta,onElementCreate:Ht=>rn(Ht,!1),...mn})}),X.jsx(b9,{visible:st,target:bt,hidden:Ut,unmountWhenHidden:!0,children:da()})]}),aboveMobileMarkup:X.jsxs(X.Fragment,{children:[X.jsx(vc,{props:Pr,template:Yr,children:u===!1?X.jsx($1,{ref:gt,value:jn(),readOnly:t,className:au,onFocus:ta,onBlur:ea,onInput:Ba,onElementCreate:Ht=>rn(Ht,!1),...mn}):X.jsx(A9,{ref:Tt,value:jn(),readOnly:t,className:au,format:Pt,isInputValid:pn,onFocus:ta,onBlur:ea,onChange:ha,onElementCreate:Ht=>rn(Ht,!0),...mn})}),X.jsx(C9,{visible:st,target:bt,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:Ut,isClickedWithin:An,unmountWhenHidden:!1,children:da()})]})})]})})};var $S,O9;function qG(){if(O9)return $S;O9=1;function n(D,A){var N,R;if(typeof A=="function")R=A(D),R!==void 0&&(D=R);else if(Array.isArray(A))for(N=0;N<A.length;N++)R=A[N](D),R!==void 0&&(D=R);return D}function t(D,A){return D[0]==="-"&&Array.isArray(A)&&/^-\d+$/.test(D)?A.length+parseInt(D,10):D}function i(D){return/^\d+$/.test(D)}function s(D){return Object.prototype.toString.call(D)==="[object Object]"}function u(D){return Object(D)===D}function c(D){return Object.keys(D).length===0}var f=["__proto__","prototype","constructor"],p=function(D){return f.indexOf(D)===-1};function m(D,A){D.indexOf("[")>=0&&(D=D.replace(/\[/g,A).replace(/]/g,""));var N=D.split(A),R=N.filter(p);if(R.length!==N.length)throw Error("Refusing to update blacklisted property "+D);return N}var S=Object.prototype.hasOwnProperty;function b(D,A,N,R){if(!(this instanceof b))return new b(D,A,N,R);typeof A>"u"&&(A=!1),typeof N>"u"&&(N=!0),typeof R>"u"&&(R=!0),this.separator=D||".",this.override=A,this.useArray=N,this.useBrackets=R,this.keepArray=!1,this.cleanup=[]}var _=new b(".",!1,!0,!0);function x(D){return function(){return _[D].apply(_,arguments)}}return b.prototype._fill=function(D,A,N,R){var O=D.shift();if(D.length>0){if(A[O]=A[O]||(this.useArray&&i(D[0])?[]:{}),!u(A[O]))if(this.override)A[O]={};else{if(!(u(N)&&c(N)))throw new Error("Trying to redefine `"+O+"` which is a "+typeof A[O]);return}this._fill(D,A[O],N,R)}else{if(!this.override&&u(A[O])&&!c(A[O])){if(!(u(N)&&c(N)))throw new Error("Trying to redefine non-empty obj['"+O+"']");return}A[O]=n(N,R)}},b.prototype.object=function(D,A){var N=this;return Object.keys(D).forEach(function(R){var O=A===void 0?null:A[R],U=m(R,N.separator).join(N.separator);U.indexOf(N.separator)!==-1?(N._fill(U.split(N.separator),D,D[R],O),delete D[R]):D[R]=n(D[R],O)}),D},b.prototype.str=function(D,A,N,R){var O=m(D,this.separator).join(this.separator);return D.indexOf(this.separator)!==-1?this._fill(O.split(this.separator),N,A,R):N[D]=n(A,R),N},b.prototype.pick=function(D,A,N,R){var O,U,j,V,J;for(U=m(D,this.separator),O=0;O<U.length;O++)if(V=t(U[O],A),A&&typeof A=="object"&&V in A){if(O===U.length-1)return N?(j=A[V],R&&Array.isArray(A)?A.splice(V,1):delete A[V],Array.isArray(A)&&(J=U.slice(0,-1).join("."),this.cleanup.indexOf(J)===-1&&this.cleanup.push(J)),j):A[V];A=A[V]}else return;return N&&Array.isArray(A)&&(A=A.filter(function($){return $!==void 0})),A},b.prototype.delete=function(D,A){return this.remove(D,A,!0)},b.prototype.remove=function(D,A,N){var R;if(this.cleanup=[],Array.isArray(D)){for(R=0;R<D.length;R++)this.pick(D[R],A,!0,N);return N||this._cleanup(A),A}else return this.pick(D,A,!0,N)},b.prototype._cleanup=function(D){var A,N,R,O;if(this.cleanup.length){for(N=0;N<this.cleanup.length;N++)R=this.cleanup[N].split("."),O=R.splice(0,-1).join("."),A=O?this.pick(O,D):D,A=A[R[0]].filter(function(U){return U!==void 0}),this.set(this.cleanup[N],A,D);this.cleanup=[]}},b.prototype.del=b.prototype.remove,b.prototype.move=function(D,A,N,R,O){return typeof R=="function"||Array.isArray(R)?this.set(A,n(this.pick(D,N,!0),R),N,O):(O=R,this.set(A,this.pick(D,N,!0),N,O)),N},b.prototype.transfer=function(D,A,N,R,O,U){return typeof O=="function"||Array.isArray(O)?this.set(A,n(this.pick(D,N,!0),O),R,U):(U=O,this.set(A,this.pick(D,N,!0),R,U)),R},b.prototype.copy=function(D,A,N,R,O,U){return typeof O=="function"||Array.isArray(O)?this.set(A,n(JSON.parse(JSON.stringify(this.pick(D,N,!1))),O),R,U):(U=O,this.set(A,this.pick(D,N,!1),R,U)),R},b.prototype.set=function(D,A,N,R){var O,U,j,V;if(typeof A>"u")return N;for(j=m(D,this.separator),O=0;O<j.length;O++){if(V=j[O],O===j.length-1)if(R&&s(A)&&s(N[V]))for(U in A)S.call(A,U)&&(N[V][U]=A[U]);else if(R&&Array.isArray(N[V])&&Array.isArray(A))for(var J=0;J<A.length;J++)N[j[O]].push(A[J]);else N[V]=A;else(!S.call(N,V)||!s(N[V])&&!Array.isArray(N[V]))&&(/^\d+$/.test(j[O+1])?N[V]=[]:N[V]={});N=N[V]}return N},b.prototype.transform=function(D,A,N){return A=A||{},N=N||{},Object.keys(D).forEach((function(R){this.set(D[R],this.pick(R,A),N)}).bind(this)),N},b.prototype.dot=function(D,A,N){A=A||{},N=N||[];var R=Array.isArray(D);return Object.keys(D).forEach((function(O){var U=R&&this.useBrackets?"["+O+"]":O;if(u(D[O])&&(s(D[O])&&!c(D[O])||Array.isArray(D[O])&&!this.keepArray&&D[O].length!==0))if(R&&this.useBrackets){var j=N[N.length-1]||"";return this.dot(D[O],A,N.slice(0,-1).concat(j+U))}else return this.dot(D[O],A,N.concat(U));else R&&this.useBrackets?A[N.join(this.separator).concat("["+O+"]")]=D[O]:A[N.concat(U).join(this.separator)]=D[O]}).bind(this)),A},b.pick=x("pick"),b.move=x("move"),b.transfer=x("transfer"),b.transform=x("transform"),b.copy=x("copy"),b.object=x("object"),b.str=x("str"),b.set=x("set"),b.delete=x("delete"),b.del=b.remove=x("remove"),b.dot=x("dot"),["override","overwrite"].forEach(function(D){Object.defineProperty(b,D,{get:function(){return _.override},set:function(A){_.override=!!A}})}),["useArray","keepArray","useBrackets"].forEach(function(D){Object.defineProperty(b,D,{get:function(){return _[D]},set:function(A){_[D]=A}})}),b._process=n,$S=b,$S}var XG=qG();const R9=X2(XG),KG=({name:n,label:t,value:i,data:s,textField:u,valueField:c,readOnly:f=!1,orientation:p=Za.Horizontal,isMultiSelect:m=!1,className:S,onChange:b,itemTemplate:_})=>{const[x,D]=H.useState(),[A,N]=H.useState([]),R=tv(()=>s,[s]),O=H.useId();H.useEffect(()=>{if(m){const rt=Array.isArray(i)?i.map(dt=>dt.toString()):i?[String(i)]:void 0;N(rt??[])}else i&&D(i.toString())},[i]);const U=rt=>m?A.findIndex(dt=>dt===rt)>-1:x===rt,j=rt=>{const dt=rt.toString();if(m){const pt=U(dt);let tt;pt?tt=A.filter(w=>w!=dt):tt=[...A,dt],N(tt),b?.({name:n,value:tt})}else dt!==x&&(D(dt),b?.({name:n,value:dt}))},V=rt=>{Array.isArray(rt?.value)?N(rt?.value??[]):D(rt?.value),b?.(rt)},J=kp(nh.FocusWithin),$=H.useCallback((rt,dt)=>X.jsx(X.Fragment,{children:dt}),[]),st=_||$,I=(rt,dt,pt)=>{const tt=`element_${O}_${dt}`,w=R9.pick(u,rt),F=String(R9.pick(c,rt)),K=dt===0,at=dt===pt.length-1,St=Se("bc-group-button-item bsc:cursor-pointer bsc:border-solid bsc:p-2 bsc:font-medium",{"bsc:has-data-checked:bg-primary-1 bsc:dark:has-data-checked:bg-mono-light-1 bsc:has-data-checked:text-white bsc:dark:has-data-checked:text-mono-dark-1 bsc:dark:text-mono-light-1 bsc:text-gray-2 bsc:border-gray-3 bsc:dark:border-mono-light-2":!f,"bc-read-only bsc:has-data-checked:bg-primary-4 bsc:dark:has-data-checked:bg-mono-light-3 bsc:has-data-checked:text-gray-5 bsc:dark:has-data-checked:text-mono-dark-3 bsc:dark:text-mono-light-3 bsc:text-gray-3 bsc:border-gray-4 bsc:dark:border-mono-light-3 bsc:pointer-events-none":f,"bsc:border-t bsc:border-l bsc:border-b bsc:rounded-l-md bsc:pl-2":K&&p===Za.Horizontal,"bsc:border-t bsc:border-r bsc:border-l bsc:border-b bsc:rounded-r-md bsc:pr-2":at&&p===Za.Horizontal,"bsc:border-t bsc:border-b":!K&&!at&&p===Za.Horizontal,"bsc:border-l":!K&&p===Za.Horizontal,"bsc:border-l bsc:border-r bsc:border-t bsc:rounded-t-md":K&&p===Za.Vertical,"bsc:border bsc:rounded-b-md":at&&p===Za.Vertical,"bsc:border-t bsc:border-l bsc:border-r":!K&&!at&&p===Za.Vertical},J),W={itemId:tt,selectedValue:m?A:x,itemText:w,itemValue:F,itemData:rt,itemStyles:St,isSelected:U(F),isFirstItem:K,isLastItem:at,onItemChanged:j};return m?X.jsx(vc,{props:W,template:st,children:X.jsx(rh,{className:St,children:X.jsx(c6,{value:F,className:"bsc:block bsc:w-full bsc:cursor-pointer",children:w})})},tt):X.jsx(vc,{props:W,template:st,children:X.jsx(rh,{className:St,children:X.jsx(y6,{value:F,className:"bsc:block bsc:w-full bsc:cursor-pointer",children:w})})},tt)},et=Se("bsc:flex bsc:flex-col bsc:gap-2",S),nt=Se("bsc:flex",{"bsc:flex-col bsc:w-max":p===Za.Vertical}),bt=rt=>m?X.jsx(d6,{name:n,value:A,readOnly:f,onChange:V,className:nt,children:rt.map(I)}):X.jsx(g6,{name:n,value:x,readOnly:f,onChange:V,className:nt,children:rt.map(I)});return X.jsxs(rh,{className:et,children:[t&&X.jsx(wr,{label:t,readOnly:f}),R&&bt(R)]})},QG=H.memo(KG),ZG=({name:n,label:t,value:i,data:s,textField:u,valueField:c,readOnly:f=!1,labelLocation:p=Es.Right,orientation:m=Za.Vertical,className:S,useAnimation:b,onChange:_})=>{const x=tv(()=>s,[s]),D=H.useId(),A=hv(b),N=kp(nh.FocusWithin),R=Se("bc-radio-container bsc:flex bsc:flex-col bsc:gap-1",S),O=Se("bc-radio-wrapper bsc:flex bsc:gap-1",{"bsc:flex-col":m===Za.Vertical,"bsc:*:pr-2":m===Za.Horizontal}),U=Se("bc-radio-item-wrapper bsc:flex bsc:items-center bsc:*:cursor-pointer",{"bc-read-only":f}),j=Se("bc-radio-item bsc:group bsc:relative bsc:*:size-[21px] bsc:rounded-full",{"bsc:ml-2":p===Es.Left,"bsc:mr-2":p===Es.Right,"bc-read-only":f},N),V=Se("bc-radio-item-svg bsc:stroke-2 bsc:fill-none bsc:rounded-full bsc:stroke-gray-1 bsc:dark:stroke-mono-light-2 bsc:group-data-read-only:stroke-gray-4 bsc:dark:group-data-read-only:stroke-mono-light-3"),J=Se("bsc:group-data-checked:fill-primary-1 bsc:dark:group-data-checked:fill-mono-light-2 bsc:group-data-checked:group-data-read-only:fill-primary-4 bsc:dark:group-data-checked:group-data-read-only:fill-mono-light-3",{"bsc:group-data-checked:animate-bounce":!f&&A}),$=Se("bsc:invisible bsc:group-data-checked:visible bsc:group-data-checked:fill-white bsc:dark:group-data-checked:fill-mono-dark-1",{"bsc:group-data-checked:animate-bounce":!f&&A}),st=(I,et)=>{const nt=I[u],bt=I[c];return X.jsxs(rh,{className:U,children:[p===Es.Left&&X.jsx(wr,{label:nt,readOnly:f}),X.jsx(y6,{value:bt,className:j,children:X.jsxs("svg",{viewBox:"0 0 30 30",preserveAspectRatio:"xMidYMid meet",className:V,children:[X.jsx("circle",{cx:15,cy:15,r:15,className:J}),X.jsx("circle",{cx:"50%",cy:"50%",r:7,className:$})]})}),p===Es.Right&&X.jsx(wr,{label:nt,readOnly:f})]},`radio_${D}_item${et}`)};return X.jsxs("div",{className:R,children:[t&&X.jsx(wr,{label:t,readOnly:f}),X.jsx(g6,{name:n,value:i,readOnly:f,onChange:_,className:O,children:x&&x.map(st)})]})},JG=H.memo(ZG),FG=({name:n,label:t,value:i,checked:s=!1,readOnly:u=!1,useAnimation:c,className:f,onChange:p})=>{const m=hv(c),S=Se("bc-toggle-wrapper bsc:flex bsc:flex-col",f),b=kp(nh.FocusWithin),_=Se("bc-toggle-container bsc:group bsc:flex bsc:mt-0.5 bsc:relative bsc:w-[60px] bsc:h-[26px] bsc:rounded-full bsc:[transition:background-color_1s]",{"bsc:cursor-pointer bsc:bg-gray-3 bsc:dark:bg-mono-dark-3 bsc:has-checked:bg-primary-1 bsc:dark:has-checked:bg-mono-light-2":!u,"bc-read-only bsc:pointer-events-none bsc:bg-gray-4 bsc:dark:bg-mono-dark-2 bsc:has-checked:bg-primary-4 bsc:dark:has-checked:bg-mono-light-3":u},b),x=Se("bc-toggle-switch bsc:absolute bsc:rounded-full bsc:dark:border bsc:dark:border-solid bsc:dark:border-mono-dark-1 bsc:group-data-toggled:translate-x-[35px] bsc:w-[18px] bsc:h-[18px] bsc:top-[4px] bsc:left-[4px]",{"bsc:bg-white bsc:cursor-pointer":!u,"bc-read-only bsc:bg-gray-5 bsc:pointer-events-none":u,"bsc:[transition:0.3s]":!u&&m});return X.jsxs(rh,{className:S,children:[t&&X.jsx(wr,{label:t,readOnly:u}),X.jsx(SA,{name:n,value:i,toggled:s,onChange:p,className:_,children:X.jsx("div",{className:x})})]})},kG=H.memo(FG);$t.AvatarEditor=RD,$t.BeeSoftProvider=zD,$t.Button=Ql,$t.Checkbox=v6,$t.CheckboxGroup=TA,$t.ContentEditableInput=$1,$t.DateFormatType=N0,$t.DateScrollerType=Mh,$t.DateSelectionType=Qe,$t.DateTime=YG,$t.FormGroupItemOrientation=Za,$t.FormattedInput=A9,$t.GroupButton=QG,$t.MediaQuery=Hv,$t.MobileOverlayPanel=b9,$t.OverlayPanel=C9,$t.RadioButton=JG,$t.SelectionLabelLocation=Es,$t.Toggle=kG,$t.applyBeeSoftTheme=OH,$t.createBeeSoftTheme=RH,Object.defineProperty($t,Symbol.toStringTag,{value:"Module"})}));
|