diff --git a/invokeai/frontend/dist/assets/index-7d7a19f3.js b/invokeai/frontend/dist/assets/index-762ec810.js similarity index 54% rename from invokeai/frontend/dist/assets/index-7d7a19f3.js rename to invokeai/frontend/dist/assets/index-762ec810.js index 2a5169cebd..161f55e3e0 100644 --- a/invokeai/frontend/dist/assets/index-7d7a19f3.js +++ b/invokeai/frontend/dist/assets/index-762ec810.js @@ -1,4 +1,4 @@ -function _j(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var So=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function C7(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g={},KQ={get exports(){return g},set exports(e){g=e}},G3={},S={},YQ={get exports(){return S},set exports(e){S=e}},Qt={};/** +function kj(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var So=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function C7(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g={},YQ={get exports(){return g},set exports(e){g=e}},G3={},S={},XQ={get exports(){return S},set exports(e){S=e}},Jt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function _j(e,t){for(var n=0;n0?Ui(a0,--ea):0,Dm--,ri===10&&(Dm=1,K3--),ri}function ka(){return ri=ea2||ey(ri)>3?"":" "}function MJ(e,t){for(;--t&&ka()&&!(ri<48||ri>102||ri>57&&ri<65||ri>70&&ri<97););return qy(e,Ox()+(t<6&&Vl()==32&&ka()==32))}function y6(e){for(;ka();)switch(ri){case e:return ea;case 34:case 39:e!==34&&e!==39&&y6(ri);break;case 40:e===41&&y6(e);break;case 92:ka();break}return ea}function LJ(e,t){for(;ka()&&e+ri!==47+10;)if(e+ri===42+42&&Vl()===47)break;return"/*"+qy(t,ea-1)+"*"+q3(e===47?e:ka())}function AJ(e){for(;!ey(Vl());)ka();return qy(e,ea)}function OJ(e){return $j(Ix("",null,null,null,[""],e=Nj(e),0,[0],e))}function Ix(e,t,n,r,i,o,a,s,l){for(var u=0,d=0,p=a,m=0,y=0,b=0,w=1,E=1,_=1,k=0,T="",L=i,O=o,D=r,I=T;E;)switch(b=k,k=ka()){case 40:if(b!=108&&Ui(I,p-1)==58){v6(I+=kn(Rx(k),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:I+=Rx(k);break;case 9:case 10:case 13:case 32:I+=TJ(b);break;case 92:I+=MJ(Ox()-1,7);continue;case 47:switch(Vl()){case 42:case 47:mb(RJ(LJ(ka(),Ox()),t,n),l);break;default:I+="/"}break;case 123*w:s[u++]=Il(I)*_;case 125*w:case 59:case 0:switch(k){case 0:case 125:E=0;case 59+d:y>0&&Il(I)-p&&mb(y>32?ET(I+";",r,n,p-1):ET(kn(I," ","")+";",r,n,p-2),l);break;case 59:I+=";";default:if(mb(D=kT(I,t,n,u,d,i,s,T,L=[],O=[],p),o),k===123)if(d===0)Ix(I,t,D,D,L,o,p,s,O);else switch(m===99&&Ui(I,3)===110?100:m){case 100:case 109:case 115:Ix(e,D,D,r&&mb(kT(e,D,D,0,0,i,s,T,i,L=[],p),O),i,O,p,s,r?L:O);break;default:Ix(I,D,D,D,[""],O,0,s,O)}}u=d=y=0,w=_=1,T=I="",p=a;break;case 58:p=1+Il(I),y=b;default:if(w<1){if(k==123)--w;else if(k==125&&w++==0&&PJ()==125)continue}switch(I+=q3(k),k*w){case 38:_=d>0?1:(I+="\f",-1);break;case 44:s[u++]=(Il(I)-1)*_,_=1;break;case 64:Vl()===45&&(I+=Rx(ka())),m=Vl(),d=p=Il(T=I+=AJ(Ox())),k++;break;case 45:b===45&&Il(I)==2&&(w=0)}}return o}function kT(e,t,n,r,i,o,a,s,l,u,d){for(var p=i-1,m=i===0?o:[""],y=L7(m),b=0,w=0,E=0;b0?m[_]+" "+k:kn(k,/&\f/g,m[_])))&&(l[E++]=T);return Y3(e,t,n,i===0?T7:s,l,u,d)}function RJ(e,t,n){return Y3(e,t,n,Rj,q3(EJ()),J1(e,2,-2),0)}function ET(e,t,n,r){return Y3(e,t,n,M7,J1(e,0,r),J1(e,r+1,-1),r)}function dm(e,t){for(var n="",r=L7(e),i=0;i6)switch(Ui(e,t+1)){case 109:if(Ui(e,t+4)!==45)break;case 102:return kn(e,/(.+:)(.+)-([^]+)/,"$1"+bn+"$2-$3$1"+bS+(Ui(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~v6(e,"stretch")?Bj(kn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ui(e,t+1)!==115)break;case 6444:switch(Ui(e,Il(e)-3-(~v6(e,"!important")&&10))){case 107:return kn(e,":",":"+bn)+e;case 101:return kn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+bn+(Ui(e,14)===45?"inline-":"")+"box$3$1"+bn+"$2$3$1"+no+"$2box$3")+e}break;case 5936:switch(Ui(e,t+11)){case 114:return bn+e+no+kn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return bn+e+no+kn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return bn+e+no+kn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return bn+e+no+e+e}return e}var HJ=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case M7:t.return=Bj(t.value,t.length);break;case Ij:return dm([Lv(t,{value:kn(t.value,"@","@"+bn)})],i);case T7:if(t.length)return kJ(t.props,function(o){switch(_J(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return dm([Lv(t,{props:[kn(o,/:(read-\w+)/,":"+bS+"$1")]})],i);case"::placeholder":return dm([Lv(t,{props:[kn(o,/:(plac\w+)/,":"+bn+"input-$1")]}),Lv(t,{props:[kn(o,/:(plac\w+)/,":"+bS+"$1")]}),Lv(t,{props:[kn(o,/:(plac\w+)/,no+"input-$1")]})],i)}return""})}},WJ=[HJ],zj=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var E=w.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var i=t.stylisPlugins||WJ,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(w){for(var E=w.getAttribute("data-emotion").split(" "),_=1;_0?Vi(a0,--ea):0,Dm--,ri===10&&(Dm=1,K3--),ri}function Ea(){return ri=ea2||ey(ri)>3?"":" "}function LJ(e,t){for(;--t&&Ea()&&!(ri<48||ri>102||ri>57&&ri<65||ri>70&&ri<97););return qy(e,Ox()+(t<6&&Ul()==32&&Ea()==32))}function y6(e){for(;Ea();)switch(ri){case e:return ea;case 34:case 39:e!==34&&e!==39&&y6(ri);break;case 40:e===41&&y6(e);break;case 92:Ea();break}return ea}function AJ(e,t){for(;Ea()&&e+ri!==47+10;)if(e+ri===42+42&&Ul()===47)break;return"/*"+qy(t,ea-1)+"*"+q3(e===47?e:Ea())}function OJ(e){for(;!ey(Ul());)Ea();return qy(e,ea)}function RJ(e){return Fj(Ix("",null,null,null,[""],e=$j(e),0,[0],e))}function Ix(e,t,n,r,i,o,a,s,l){for(var u=0,d=0,p=a,m=0,y=0,b=0,w=1,E=1,_=1,k=0,T="",L=i,O=o,D=r,I=T;E;)switch(b=k,k=Ea()){case 40:if(b!=108&&Vi(I,p-1)==58){v6(I+=kn(Rx(k),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:I+=Rx(k);break;case 9:case 10:case 13:case 32:I+=MJ(b);break;case 92:I+=LJ(Ox()-1,7);continue;case 47:switch(Ul()){case 42:case 47:mb(IJ(AJ(Ea(),Ox()),t,n),l);break;default:I+="/"}break;case 123*w:s[u++]=Il(I)*_;case 125*w:case 59:case 0:switch(k){case 0:case 125:E=0;case 59+d:y>0&&Il(I)-p&&mb(y>32?PT(I+";",r,n,p-1):PT(kn(I," ","")+";",r,n,p-2),l);break;case 59:I+=";";default:if(mb(D=ET(I,t,n,u,d,i,s,T,L=[],O=[],p),o),k===123)if(d===0)Ix(I,t,D,D,L,o,p,s,O);else switch(m===99&&Vi(I,3)===110?100:m){case 100:case 109:case 115:Ix(e,D,D,r&&mb(ET(e,D,D,0,0,i,s,T,i,L=[],p),O),i,O,p,s,r?L:O);break;default:Ix(I,D,D,D,[""],O,0,s,O)}}u=d=y=0,w=_=1,T=I="",p=a;break;case 58:p=1+Il(I),y=b;default:if(w<1){if(k==123)--w;else if(k==125&&w++==0&&TJ()==125)continue}switch(I+=q3(k),k*w){case 38:_=d>0?1:(I+="\f",-1);break;case 44:s[u++]=(Il(I)-1)*_,_=1;break;case 64:Ul()===45&&(I+=Rx(Ea())),m=Ul(),d=p=Il(T=I+=OJ(Ox())),k++;break;case 45:b===45&&Il(I)==2&&(w=0)}}return o}function ET(e,t,n,r,i,o,a,s,l,u,d){for(var p=i-1,m=i===0?o:[""],y=L7(m),b=0,w=0,E=0;b0?m[_]+" "+k:kn(k,/&\f/g,m[_])))&&(l[E++]=T);return Y3(e,t,n,i===0?T7:s,l,u,d)}function IJ(e,t,n){return Y3(e,t,n,Ij,q3(PJ()),J1(e,2,-2),0)}function PT(e,t,n,r){return Y3(e,t,n,M7,J1(e,0,r),J1(e,r+1,-1),r)}function dm(e,t){for(var n="",r=L7(e),i=0;i6)switch(Vi(e,t+1)){case 109:if(Vi(e,t+4)!==45)break;case 102:return kn(e,/(.+:)(.+)-([^]+)/,"$1"+bn+"$2-$3$1"+bS+(Vi(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~v6(e,"stretch")?zj(kn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Vi(e,t+1)!==115)break;case 6444:switch(Vi(e,Il(e)-3-(~v6(e,"!important")&&10))){case 107:return kn(e,":",":"+bn)+e;case 101:return kn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+bn+(Vi(e,14)===45?"inline-":"")+"box$3$1"+bn+"$2$3$1"+no+"$2box$3")+e}break;case 5936:switch(Vi(e,t+11)){case 114:return bn+e+no+kn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return bn+e+no+kn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return bn+e+no+kn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return bn+e+no+e+e}return e}var WJ=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case M7:t.return=zj(t.value,t.length);break;case Dj:return dm([Lv(t,{value:kn(t.value,"@","@"+bn)})],i);case T7:if(t.length)return EJ(t.props,function(o){switch(kJ(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return dm([Lv(t,{props:[kn(o,/:(read-\w+)/,":"+bS+"$1")]})],i);case"::placeholder":return dm([Lv(t,{props:[kn(o,/:(plac\w+)/,":"+bn+"input-$1")]}),Lv(t,{props:[kn(o,/:(plac\w+)/,":"+bS+"$1")]}),Lv(t,{props:[kn(o,/:(plac\w+)/,no+"input-$1")]})],i)}return""})}},UJ=[WJ],Hj=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var E=w.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var i=t.stylisPlugins||UJ,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(w){for(var E=w.getAttribute("data-emotion").split(" "),_=1;_=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var tee={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},nee=/[A-Z]|^ms/g,ree=/_EMO_([^_]+?)_([^]*?)_EMO_/g,qj=function(t){return t.charCodeAt(1)===45},MT=function(t){return t!=null&&typeof t!="boolean"},u5=Fj(function(e){return qj(e)?e:e.replace(nee,"-$&").toLowerCase()}),LT=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(ree,function(r,i,o){return Dl={name:i,styles:o,next:Dl},i})}return tee[t]!==1&&!qj(t)&&typeof n=="number"&&n!==0?n+"px":n};function ty(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Dl={name:n.name,styles:n.styles,next:Dl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Dl={name:r.name,styles:r.styles,next:Dl},r=r.next;var i=n.styles+";";return i}return iee(e,t,n)}case"function":{if(e!==void 0){var o=Dl,a=n(e);return Dl=o,ty(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function iee(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var nee={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ree=/[A-Z]|^ms/g,iee=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Kj=function(t){return t.charCodeAt(1)===45},LT=function(t){return t!=null&&typeof t!="boolean"},u5=Bj(function(e){return Kj(e)?e:e.replace(ree,"-$&").toLowerCase()}),AT=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(iee,function(r,i,o){return Dl={name:i,styles:o,next:Dl},i})}return nee[t]!==1&&!Kj(t)&&typeof n=="number"&&n!==0?n+"px":n};function ty(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Dl={name:n.name,styles:n.styles,next:Dl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Dl={name:r.name,styles:r.styles,next:Dl},r=r.next;var i=n.styles+";";return i}return oee(e,t,n)}case"function":{if(e!==void 0){var o=Dl,a=n(e);return Dl=o,ty(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function oee(e,t,n){var r="";if(Array.isArray(n))for(var i=0;ig.jsx(aw,{styles:Zj}),hee=()=>g.jsx(aw,{styles:` +`,hee=()=>g.jsx(aw,{styles:Qj}),pee=()=>g.jsx(aw,{styles:` html { line-height: 1.5; -webkit-text-size-adjust: 100%; @@ -320,8 +320,8 @@ function _j(e,t){for(var n=0;n>>1,Ee=q[fe];if(0>>1;fei(Ae,ee))Sei(Qe,Ae)?(q[fe]=Qe,q[Se]=ee,fe=Se):(q[fe]=Ae,q[xe]=ee,fe=xe);else if(Sei(Qe,ee))q[fe]=Qe,q[Se]=ee,fe=Se;else break e}}return X}function i(q,X){var ee=q.sortIndex-X.sortIndex;return ee!==0?ee:q.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],d=1,p=null,m=3,y=!1,b=!1,w=!1,E=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(q){for(var X=n(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=q)r(u),X.sortIndex=X.expirationTime,t(l,X);else break;X=n(u)}}function L(q){if(w=!1,T(q),!b)if(n(l)!==null)b=!0,Y(O);else{var X=n(u);X!==null&&Q(L,X.startTime-q)}}function O(q,X){b=!1,w&&(w=!1,_(N),N=-1),y=!0;var ee=m;try{for(T(X),p=n(l);p!==null&&(!(p.expirationTime>X)||q&&!K());){var fe=p.callback;if(typeof fe=="function"){p.callback=null,m=p.priorityLevel;var Ee=fe(p.expirationTime<=X);X=e.unstable_now(),typeof Ee=="function"?p.callback=Ee:p===n(l)&&r(l),T(X)}else r(l);p=n(l)}if(p!==null)var we=!0;else{var xe=n(u);xe!==null&&Q(L,xe.startTime-X),we=!1}return we}finally{p=null,m=ee,y=!1}}var D=!1,I=null,N=-1,V=5,B=-1;function K(){return!(e.unstable_now()-Bq||125fe?(q.sortIndex=ee,t(u,q),n(l)===null&&q===n(u)&&(w?(_(N),N=-1):w=!0,Q(L,ee-fe))):(q.sortIndex=Ee,t(l,q),b||y||(b=!0,Y(O))),q},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(q){var X=m;return function(){var ee=m;m=X;try{return q.apply(this,arguments)}finally{m=ee}}}})(Jj);(function(e){e.exports=Jj})(yee);/** + */(function(e){function t(q,X){var ee=q.length;q.push(X);e:for(;0>>1,ke=q[fe];if(0>>1;fei(Le,ee))Sei(Qe,Le)?(q[fe]=Qe,q[Se]=ee,fe=Se):(q[fe]=Le,q[xe]=ee,fe=xe);else if(Sei(Qe,ee))q[fe]=Qe,q[Se]=ee,fe=Se;else break e}}return X}function i(q,X){var ee=q.sortIndex-X.sortIndex;return ee!==0?ee:q.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],d=1,p=null,m=3,y=!1,b=!1,w=!1,E=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(q){for(var X=n(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=q)r(u),X.sortIndex=X.expirationTime,t(l,X);else break;X=n(u)}}function L(q){if(w=!1,T(q),!b)if(n(l)!==null)b=!0,Y(O);else{var X=n(u);X!==null&&Q(L,X.startTime-q)}}function O(q,X){b=!1,w&&(w=!1,_(N),N=-1),y=!0;var ee=m;try{for(T(X),p=n(l);p!==null&&(!(p.expirationTime>X)||q&&!K());){var fe=p.callback;if(typeof fe=="function"){p.callback=null,m=p.priorityLevel;var ke=fe(p.expirationTime<=X);X=e.unstable_now(),typeof ke=="function"?p.callback=ke:p===n(l)&&r(l),T(X)}else r(l);p=n(l)}if(p!==null)var we=!0;else{var xe=n(u);xe!==null&&Q(L,xe.startTime-X),we=!1}return we}finally{p=null,m=ee,y=!1}}var D=!1,I=null,N=-1,U=5,B=-1;function K(){return!(e.unstable_now()-Bq||125fe?(q.sortIndex=ee,t(u,q),n(l)===null&&q===n(u)&&(w?(_(N),N=-1):w=!0,Q(L,ee-fe))):(q.sortIndex=ke,t(l,q),b||y||(b=!0,Y(O))),q},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(q){var X=m;return function(){var ee=m;m=X;try{return q.apply(this,arguments)}finally{m=ee}}}})(eN);(function(e){e.exports=eN})(bee);/** * @license React * react-dom.production.min.js * @@ -337,14 +337,14 @@ function _j(e,t){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x6=Object.prototype.hasOwnProperty,bee=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,RT={},IT={};function xee(e){return x6.call(IT,e)?!0:x6.call(RT,e)?!1:bee.test(e)?IT[e]=!0:(RT[e]=!0,!1)}function See(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function wee(e,t,n,r){if(t===null||typeof t>"u"||See(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function To(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Ki={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ki[e]=new To(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ki[t]=new To(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ki[e]=new To(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ki[e]=new To(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ki[e]=new To(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ki[e]=new To(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ki[e]=new To(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ki[e]=new To(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ki[e]=new To(e,5,!1,e.toLowerCase(),null,!1,!1)});var D7=/[\-:]([a-z])/g;function j7(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(D7,j7);Ki[t]=new To(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(D7,j7);Ki[t]=new To(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(D7,j7);Ki[t]=new To(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ki[e]=new To(e,1,!1,e.toLowerCase(),null,!1,!1)});Ki.xlinkHref=new To("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ki[e]=new To(e,1,!1,e.toLowerCase(),null,!0,!0)});function N7(e,t,n,r){var i=Ki.hasOwnProperty(t)?Ki[t]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x6=Object.prototype.hasOwnProperty,xee=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,IT={},DT={};function See(e){return x6.call(DT,e)?!0:x6.call(IT,e)?!1:xee.test(e)?DT[e]=!0:(IT[e]=!0,!1)}function wee(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Cee(e,t,n,r){if(t===null||typeof t>"u"||wee(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function To(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Ki={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ki[e]=new To(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ki[t]=new To(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ki[e]=new To(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ki[e]=new To(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ki[e]=new To(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ki[e]=new To(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ki[e]=new To(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ki[e]=new To(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ki[e]=new To(e,5,!1,e.toLowerCase(),null,!1,!1)});var D7=/[\-:]([a-z])/g;function j7(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(D7,j7);Ki[t]=new To(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(D7,j7);Ki[t]=new To(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(D7,j7);Ki[t]=new To(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ki[e]=new To(e,1,!1,e.toLowerCase(),null,!1,!1)});Ki.xlinkHref=new To("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ki[e]=new To(e,1,!1,e.toLowerCase(),null,!0,!0)});function N7(e,t,n,r){var i=Ki.hasOwnProperty(t)?Ki[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` -`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{d5=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?r1(e):""}function Cee(e){switch(e.tag){case 5:return r1(e.type);case 16:return r1("Lazy");case 13:return r1("Suspense");case 19:return r1("SuspenseList");case 0:case 2:case 15:return e=f5(e.type,!1),e;case 11:return e=f5(e.type.render,!1),e;case 1:return e=f5(e.type,!0),e;default:return""}}function _6(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case zg:return"Fragment";case Bg:return"Portal";case S6:return"Profiler";case $7:return"StrictMode";case w6:return"Suspense";case C6:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case rN:return(e.displayName||"Context")+".Consumer";case nN:return(e._context.displayName||"Context")+".Provider";case F7:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B7:return t=e.displayName||null,t!==null?t:_6(e.type)||"Memo";case hd:t=e._payload,e=e._init;try{return _6(e(t))}catch{}}return null}function _ee(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _6(t);case 8:return t===$7?"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 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vd(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function oN(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kee(e){var t=oN(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yb(e){e._valueTracker||(e._valueTracker=kee(e))}function aN(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=oN(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function xS(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function k6(e,t){var n=t.checked;return Pr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function jT(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vd(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function sN(e,t){t=t.checked,t!=null&&N7(e,"checked",t,!1)}function E6(e,t){sN(e,t);var n=Vd(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?P6(e,t.type,n):t.hasOwnProperty("defaultValue")&&P6(e,t.type,Vd(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function NT(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function P6(e,t,n){(t!=="number"||xS(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var i1=Array.isArray;function fm(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=bb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function iy(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var w1={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Eee=["Webkit","ms","Moz","O"];Object.keys(w1).forEach(function(e){Eee.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),w1[t]=w1[e]})});function dN(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||w1.hasOwnProperty(e)&&w1[e]?(""+t).trim():t+"px"}function fN(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=dN(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Pee=Pr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function L6(e,t){if(t){if(Pee[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Be(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Be(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Be(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Be(62))}}function A6(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var O6=null;function z7(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var R6=null,hm=null,pm=null;function BT(e){if(e=Xy(e)){if(typeof R6!="function")throw Error(Be(280));var t=e.stateNode;t&&(t=dw(t),R6(e.stateNode,e.type,t))}}function hN(e){hm?pm?pm.push(e):pm=[e]:hm=e}function pN(){if(hm){var e=hm,t=pm;if(pm=hm=null,BT(e),t)for(e=0;e>>=0,e===0?32:31-($ee(e)/Fee|0)|0}var xb=64,Sb=4194304;function o1(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function _S(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=o1(s):(o&=a,o!==0&&(r=o1(o)))}else a=n&~i,a!==0?r=o1(a):o!==0&&(r=o1(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ky(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Gs(t),e[t]=n}function Wee(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=_1),YT=String.fromCharCode(32),XT=!1;function IN(e,t){switch(e){case"keyup":return vte.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function DN(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hg=!1;function bte(e,t){switch(e){case"compositionend":return DN(t);case"keypress":return t.which!==32?null:(XT=!0,YT);case"textInput":return e=t.data,e===YT&&XT?null:e;default:return null}}function xte(e,t){if(Hg)return e==="compositionend"||!Y7&&IN(e,t)?(e=ON(),jx=G7=Sd=null,Hg=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=eM(n)}}function FN(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?FN(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function BN(){for(var e=window,t=xS();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=xS(e.document)}return t}function X7(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Mte(e){var t=BN(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&FN(n.ownerDocument.documentElement,n)){if(r!==null&&X7(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=tM(n,o);var a=tM(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Wg=null,F6=null,E1=null,B6=!1;function nM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;B6||Wg==null||Wg!==xS(r)||(r=Wg,"selectionStart"in r&&X7(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),E1&&cy(E1,r)||(E1=r,r=PS(F6,"onSelect"),0Gg||(e.current=G6[Gg],G6[Gg]=null,Gg--)}function nr(e,t){Gg++,G6[Gg]=e.current,e.current=t}var Ud={},lo=of(Ud),Ko=of(!1),Hh=Ud;function Nm(e,t){var n=e.type.contextTypes;if(!n)return Ud;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yo(e){return e=e.childContextTypes,e!=null}function MS(){cr(Ko),cr(lo)}function uM(e,t,n){if(lo.current!==Ud)throw Error(Be(168));nr(lo,t),nr(Ko,n)}function YN(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Be(108,_ee(e)||"Unknown",i));return Pr({},n,r)}function LS(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ud,Hh=lo.current,nr(lo,e),nr(Ko,Ko.current),!0}function cM(e,t,n){var r=e.stateNode;if(!r)throw Error(Be(169));n?(e=YN(e,t,Hh),r.__reactInternalMemoizedMergedChildContext=e,cr(Ko),cr(lo),nr(lo,e)):cr(Ko),nr(Ko,n)}var ju=null,fw=!1,E5=!1;function XN(e){ju===null?ju=[e]:ju.push(e)}function zte(e){fw=!0,XN(e)}function af(){if(!E5&&ju!==null){E5=!0;var e=0,t=In;try{var n=ju;for(In=1;e>=a,i-=a,Fu=1<<32-Gs(t)+i|n<N?(V=I,I=null):V=I.sibling;var B=m(_,I,T[N],L);if(B===null){I===null&&(I=V);break}e&&I&&B.alternate===null&&t(_,I),k=o(B,k,N),D===null?O=B:D.sibling=B,D=B,I=V}if(N===T.length)return n(_,I),yr&&uh(_,N),O;if(I===null){for(;NN?(V=I,I=null):V=I.sibling;var K=m(_,I,B.value,L);if(K===null){I===null&&(I=V);break}e&&I&&K.alternate===null&&t(_,I),k=o(K,k,N),D===null?O=K:D.sibling=K,D=K,I=V}if(B.done)return n(_,I),yr&&uh(_,N),O;if(I===null){for(;!B.done;N++,B=T.next())B=p(_,B.value,L),B!==null&&(k=o(B,k,N),D===null?O=B:D.sibling=B,D=B);return yr&&uh(_,N),O}for(I=r(_,I);!B.done;N++,B=T.next())B=y(I,_,N,B.value,L),B!==null&&(e&&B.alternate!==null&&I.delete(B.key===null?N:B.key),k=o(B,k,N),D===null?O=B:D.sibling=B,D=B);return e&&I.forEach(function(ne){return t(_,ne)}),yr&&uh(_,N),O}function E(_,k,T,L){if(typeof T=="object"&&T!==null&&T.type===zg&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case vb:e:{for(var O=T.key,D=k;D!==null;){if(D.key===O){if(O=T.type,O===zg){if(D.tag===7){n(_,D.sibling),k=i(D,T.props.children),k.return=_,_=k;break e}}else if(D.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===hd&&vM(O)===D.type){n(_,D.sibling),k=i(D,T.props),k.ref=jv(_,D,T),k.return=_,_=k;break e}n(_,D);break}else t(_,D);D=D.sibling}T.type===zg?(k=Lh(T.props.children,_.mode,L,T.key),k.return=_,_=k):(L=Vx(T.type,T.key,T.props,null,_.mode,L),L.ref=jv(_,k,T),L.return=_,_=L)}return a(_);case Bg:e:{for(D=T.key;k!==null;){if(k.key===D)if(k.tag===4&&k.stateNode.containerInfo===T.containerInfo&&k.stateNode.implementation===T.implementation){n(_,k.sibling),k=i(k,T.children||[]),k.return=_,_=k;break e}else{n(_,k);break}else t(_,k);k=k.sibling}k=I5(T,_.mode,L),k.return=_,_=k}return a(_);case hd:return D=T._init,E(_,k,D(T._payload),L)}if(i1(T))return b(_,k,T,L);if(Av(T))return w(_,k,T,L);Tb(_,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,k!==null&&k.tag===6?(n(_,k.sibling),k=i(k,T),k.return=_,_=k):(n(_,k),k=R5(T,_.mode,L),k.return=_,_=k),a(_)):n(_,k)}return E}var Fm=i$(!0),o$=i$(!1),Zy={},ql=of(Zy),py=of(Zy),gy=of(Zy);function _h(e){if(e===Zy)throw Error(Be(174));return e}function o9(e,t){switch(nr(gy,t),nr(py,e),nr(ql,Zy),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:M6(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=M6(t,e)}cr(ql),nr(ql,t)}function Bm(){cr(ql),cr(py),cr(gy)}function a$(e){_h(gy.current);var t=_h(ql.current),n=M6(t,e.type);t!==n&&(nr(py,e),nr(ql,n))}function a9(e){py.current===e&&(cr(ql),cr(py))}var kr=of(0);function jS(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var P5=[];function s9(){for(var e=0;en?n:4,e(!0);var r=T5.transition;T5.transition={};try{e(!1),t()}finally{In=n,T5.transition=r}}function w$(){return as().memoizedState}function Ute(e,t,n){var r=Dd(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},C$(e))_$(t,n);else if(n=e$(e,t,n,r),n!==null){var i=_o();qs(n,e,r,i),k$(n,t,r)}}function Gte(e,t,n){var r=Dd(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(C$(e))_$(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Zs(s,a)){var l=t.interleaved;l===null?(i.next=i,r9(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=e$(e,t,i,r),n!==null&&(i=_o(),qs(n,e,r,i),k$(n,t,r))}}function C$(e){var t=e.alternate;return e===Er||t!==null&&t===Er}function _$(e,t){P1=NS=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function k$(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,W7(e,n)}}var $S={readContext:os,useCallback:eo,useContext:eo,useEffect:eo,useImperativeHandle:eo,useInsertionEffect:eo,useLayoutEffect:eo,useMemo:eo,useReducer:eo,useRef:eo,useState:eo,useDebugValue:eo,useDeferredValue:eo,useTransition:eo,useMutableSource:eo,useSyncExternalStore:eo,useId:eo,unstable_isNewReconciler:!1},qte={readContext:os,useCallback:function(e,t){return Ll().memoizedState=[e,t===void 0?null:t],e},useContext:os,useEffect:bM,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bx(4194308,4,v$.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bx(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bx(4,2,e,t)},useMemo:function(e,t){var n=Ll();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ll();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ute.bind(null,Er,e),[r.memoizedState,e]},useRef:function(e){var t=Ll();return e={current:e},t.memoizedState=e},useState:yM,useDebugValue:f9,useDeferredValue:function(e){return Ll().memoizedState=e},useTransition:function(){var e=yM(!1),t=e[0];return e=Vte.bind(null,e[1]),Ll().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Er,i=Ll();if(yr){if(n===void 0)throw Error(Be(407));n=n()}else{if(n=t(),Ai===null)throw Error(Be(349));Vh&30||u$(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,bM(d$.bind(null,r,o,e),[e]),r.flags|=2048,yy(9,c$.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ll(),t=Ai.identifierPrefix;if(yr){var n=Bu,r=Fu;n=(r&~(1<<32-Gs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=my++,0")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{d5=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?r1(e):""}function _ee(e){switch(e.tag){case 5:return r1(e.type);case 16:return r1("Lazy");case 13:return r1("Suspense");case 19:return r1("SuspenseList");case 0:case 2:case 15:return e=f5(e.type,!1),e;case 11:return e=f5(e.type.render,!1),e;case 1:return e=f5(e.type,!0),e;default:return""}}function _6(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case zg:return"Fragment";case Bg:return"Portal";case S6:return"Profiler";case $7:return"StrictMode";case w6:return"Suspense";case C6:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case iN:return(e.displayName||"Context")+".Consumer";case rN:return(e._context.displayName||"Context")+".Provider";case F7:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B7:return t=e.displayName||null,t!==null?t:_6(e.type)||"Memo";case hd:t=e._payload,e=e._init;try{return _6(e(t))}catch{}}return null}function kee(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _6(t);case 8:return t===$7?"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 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ud(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function aN(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Eee(e){var t=aN(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yb(e){e._valueTracker||(e._valueTracker=Eee(e))}function sN(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=aN(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function xS(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function k6(e,t){var n=t.checked;return Pr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function NT(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ud(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function lN(e,t){t=t.checked,t!=null&&N7(e,"checked",t,!1)}function E6(e,t){lN(e,t);var n=Ud(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?P6(e,t.type,n):t.hasOwnProperty("defaultValue")&&P6(e,t.type,Ud(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function $T(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function P6(e,t,n){(t!=="number"||xS(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var i1=Array.isArray;function fm(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=bb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function iy(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var w1={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Pee=["Webkit","ms","Moz","O"];Object.keys(w1).forEach(function(e){Pee.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),w1[t]=w1[e]})});function fN(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||w1.hasOwnProperty(e)&&w1[e]?(""+t).trim():t+"px"}function hN(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=fN(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Tee=Pr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function L6(e,t){if(t){if(Tee[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ze(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ze(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ze(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ze(62))}}function A6(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var O6=null;function z7(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var R6=null,hm=null,pm=null;function zT(e){if(e=Xy(e)){if(typeof R6!="function")throw Error(ze(280));var t=e.stateNode;t&&(t=dw(t),R6(e.stateNode,e.type,t))}}function pN(e){hm?pm?pm.push(e):pm=[e]:hm=e}function gN(){if(hm){var e=hm,t=pm;if(pm=hm=null,zT(e),t)for(e=0;e>>=0,e===0?32:31-(Fee(e)/Bee|0)|0}var xb=64,Sb=4194304;function o1(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function _S(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=o1(s):(o&=a,o!==0&&(r=o1(o)))}else a=n&~i,a!==0?r=o1(a):o!==0&&(r=o1(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ky(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Gs(t),e[t]=n}function Uee(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=_1),XT=String.fromCharCode(32),ZT=!1;function DN(e,t){switch(e){case"keyup":return yte.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jN(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hg=!1;function xte(e,t){switch(e){case"compositionend":return jN(t);case"keypress":return t.which!==32?null:(ZT=!0,XT);case"textInput":return e=t.data,e===XT&&ZT?null:e;default:return null}}function Ste(e,t){if(Hg)return e==="compositionend"||!Y7&&DN(e,t)?(e=RN(),jx=G7=Sd=null,Hg=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=tM(n)}}function BN(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?BN(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zN(){for(var e=window,t=xS();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=xS(e.document)}return t}function X7(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Lte(e){var t=zN(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&BN(n.ownerDocument.documentElement,n)){if(r!==null&&X7(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=nM(n,o);var a=nM(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Wg=null,F6=null,E1=null,B6=!1;function rM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;B6||Wg==null||Wg!==xS(r)||(r=Wg,"selectionStart"in r&&X7(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),E1&&cy(E1,r)||(E1=r,r=PS(F6,"onSelect"),0Gg||(e.current=G6[Gg],G6[Gg]=null,Gg--)}function nr(e,t){Gg++,G6[Gg]=e.current,e.current=t}var Vd={},lo=of(Vd),Ko=of(!1),Hh=Vd;function Nm(e,t){var n=e.type.contextTypes;if(!n)return Vd;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yo(e){return e=e.childContextTypes,e!=null}function MS(){cr(Ko),cr(lo)}function cM(e,t,n){if(lo.current!==Vd)throw Error(ze(168));nr(lo,t),nr(Ko,n)}function XN(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ze(108,kee(e)||"Unknown",i));return Pr({},n,r)}function LS(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vd,Hh=lo.current,nr(lo,e),nr(Ko,Ko.current),!0}function dM(e,t,n){var r=e.stateNode;if(!r)throw Error(ze(169));n?(e=XN(e,t,Hh),r.__reactInternalMemoizedMergedChildContext=e,cr(Ko),cr(lo),nr(lo,e)):cr(Ko),nr(Ko,n)}var ju=null,fw=!1,E5=!1;function ZN(e){ju===null?ju=[e]:ju.push(e)}function Hte(e){fw=!0,ZN(e)}function af(){if(!E5&&ju!==null){E5=!0;var e=0,t=In;try{var n=ju;for(In=1;e>=a,i-=a,Fu=1<<32-Gs(t)+i|n<N?(U=I,I=null):U=I.sibling;var B=m(_,I,T[N],L);if(B===null){I===null&&(I=U);break}e&&I&&B.alternate===null&&t(_,I),k=o(B,k,N),D===null?O=B:D.sibling=B,D=B,I=U}if(N===T.length)return n(_,I),yr&&uh(_,N),O;if(I===null){for(;NN?(U=I,I=null):U=I.sibling;var K=m(_,I,B.value,L);if(K===null){I===null&&(I=U);break}e&&I&&K.alternate===null&&t(_,I),k=o(K,k,N),D===null?O=K:D.sibling=K,D=K,I=U}if(B.done)return n(_,I),yr&&uh(_,N),O;if(I===null){for(;!B.done;N++,B=T.next())B=p(_,B.value,L),B!==null&&(k=o(B,k,N),D===null?O=B:D.sibling=B,D=B);return yr&&uh(_,N),O}for(I=r(_,I);!B.done;N++,B=T.next())B=y(I,_,N,B.value,L),B!==null&&(e&&B.alternate!==null&&I.delete(B.key===null?N:B.key),k=o(B,k,N),D===null?O=B:D.sibling=B,D=B);return e&&I.forEach(function(ne){return t(_,ne)}),yr&&uh(_,N),O}function E(_,k,T,L){if(typeof T=="object"&&T!==null&&T.type===zg&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case vb:e:{for(var O=T.key,D=k;D!==null;){if(D.key===O){if(O=T.type,O===zg){if(D.tag===7){n(_,D.sibling),k=i(D,T.props.children),k.return=_,_=k;break e}}else if(D.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===hd&&yM(O)===D.type){n(_,D.sibling),k=i(D,T.props),k.ref=jv(_,D,T),k.return=_,_=k;break e}n(_,D);break}else t(_,D);D=D.sibling}T.type===zg?(k=Lh(T.props.children,_.mode,L,T.key),k.return=_,_=k):(L=Ux(T.type,T.key,T.props,null,_.mode,L),L.ref=jv(_,k,T),L.return=_,_=L)}return a(_);case Bg:e:{for(D=T.key;k!==null;){if(k.key===D)if(k.tag===4&&k.stateNode.containerInfo===T.containerInfo&&k.stateNode.implementation===T.implementation){n(_,k.sibling),k=i(k,T.children||[]),k.return=_,_=k;break e}else{n(_,k);break}else t(_,k);k=k.sibling}k=I5(T,_.mode,L),k.return=_,_=k}return a(_);case hd:return D=T._init,E(_,k,D(T._payload),L)}if(i1(T))return b(_,k,T,L);if(Av(T))return w(_,k,T,L);Tb(_,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,k!==null&&k.tag===6?(n(_,k.sibling),k=i(k,T),k.return=_,_=k):(n(_,k),k=R5(T,_.mode,L),k.return=_,_=k),a(_)):n(_,k)}return E}var Fm=o$(!0),a$=o$(!1),Zy={},ql=of(Zy),py=of(Zy),gy=of(Zy);function _h(e){if(e===Zy)throw Error(ze(174));return e}function o9(e,t){switch(nr(gy,t),nr(py,e),nr(ql,Zy),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:M6(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=M6(t,e)}cr(ql),nr(ql,t)}function Bm(){cr(ql),cr(py),cr(gy)}function s$(e){_h(gy.current);var t=_h(ql.current),n=M6(t,e.type);t!==n&&(nr(py,e),nr(ql,n))}function a9(e){py.current===e&&(cr(ql),cr(py))}var kr=of(0);function jS(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var P5=[];function s9(){for(var e=0;en?n:4,e(!0);var r=T5.transition;T5.transition={};try{e(!1),t()}finally{In=n,T5.transition=r}}function C$(){return as().memoizedState}function Gte(e,t,n){var r=Dd(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_$(e))k$(t,n);else if(n=t$(e,t,n,r),n!==null){var i=_o();qs(n,e,r,i),E$(n,t,r)}}function qte(e,t,n){var r=Dd(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_$(e))k$(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Zs(s,a)){var l=t.interleaved;l===null?(i.next=i,r9(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=t$(e,t,i,r),n!==null&&(i=_o(),qs(n,e,r,i),E$(n,t,r))}}function _$(e){var t=e.alternate;return e===Er||t!==null&&t===Er}function k$(e,t){P1=NS=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function E$(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,W7(e,n)}}var $S={readContext:os,useCallback:eo,useContext:eo,useEffect:eo,useImperativeHandle:eo,useInsertionEffect:eo,useLayoutEffect:eo,useMemo:eo,useReducer:eo,useRef:eo,useState:eo,useDebugValue:eo,useDeferredValue:eo,useTransition:eo,useMutableSource:eo,useSyncExternalStore:eo,useId:eo,unstable_isNewReconciler:!1},Kte={readContext:os,useCallback:function(e,t){return Ll().memoizedState=[e,t===void 0?null:t],e},useContext:os,useEffect:xM,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bx(4194308,4,y$.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bx(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bx(4,2,e,t)},useMemo:function(e,t){var n=Ll();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ll();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Gte.bind(null,Er,e),[r.memoizedState,e]},useRef:function(e){var t=Ll();return e={current:e},t.memoizedState=e},useState:bM,useDebugValue:f9,useDeferredValue:function(e){return Ll().memoizedState=e},useTransition:function(){var e=bM(!1),t=e[0];return e=Vte.bind(null,e[1]),Ll().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Er,i=Ll();if(yr){if(n===void 0)throw Error(ze(407));n=n()}else{if(n=t(),Ai===null)throw Error(ze(349));Uh&30||c$(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,xM(f$.bind(null,r,o,e),[e]),r.flags|=2048,yy(9,d$.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ll(),t=Ai.identifierPrefix;if(yr){var n=Bu,r=Fu;n=(r&~(1<<32-Gs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=my++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[jl]=t,e[hy]=r,I$(e,t,!1,!1),t.stateNode=e;e:{switch(a=A6(n,r),n){case"dialog":ir("cancel",e),ir("close",e),i=r;break;case"iframe":case"object":case"embed":ir("load",e),i=r;break;case"video":case"audio":for(i=0;iHm&&(t.flags|=128,r=!0,Nv(o,!1),t.lanes=4194304)}else{if(!r)if(e=jS(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Nv(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!yr)return to(t),null}else 2*Zr()-o.renderingStartTime>Hm&&n!==1073741824&&(t.flags|=128,r=!0,Nv(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Zr(),t.sibling=null,n=kr.current,nr(kr,r?n&1|2:n&1),t):(to(t),null);case 22:case 23:return y9(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Sa&1073741824&&(to(t),t.subtreeFlags&6&&(t.flags|=8192)):to(t),null;case 24:return null;case 25:return null}throw Error(Be(156,t.tag))}function tne(e,t){switch(Q7(t),t.tag){case 1:return Yo(t.type)&&MS(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bm(),cr(Ko),cr(lo),s9(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return a9(t),null;case 13:if(cr(kr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Be(340));$m()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return cr(kr),null;case 4:return Bm(),null;case 10:return n9(t.type._context),null;case 22:case 23:return y9(),null;case 24:return null;default:return null}}var Lb=!1,io=!1,nne=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Xg(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$r(e,t,r)}else n.current=null}function i_(e,t,n){try{n()}catch(r){$r(e,t,r)}}var TM=!1;function rne(e,t){if(z6=kS,e=BN(),X7(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,d=0,p=e,m=null;t:for(;;){for(var y;p!==n||i!==0&&p.nodeType!==3||(s=a+i),p!==o||r!==0&&p.nodeType!==3||(l=a+r),p.nodeType===3&&(a+=p.nodeValue.length),(y=p.firstChild)!==null;)m=p,p=y;for(;;){if(p===e)break t;if(m===n&&++u===i&&(s=a),m===o&&++d===r&&(l=a),(y=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=y}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(H6={focusedElem:e,selectionRange:n},kS=!1,dt=t;dt!==null;)if(t=dt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,dt=e;else for(;dt!==null;){t=dt;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var w=b.memoizedProps,E=b.memoizedState,_=t.stateNode,k=_.getSnapshotBeforeUpdate(t.elementType===t.type?w:Bs(t.type,w),E);_.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Be(163))}}catch(L){$r(t,t.return,L)}if(e=t.sibling,e!==null){e.return=t.return,dt=e;break}dt=t.return}return b=TM,TM=!1,b}function T1(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&i_(t,n,o)}i=i.next}while(i!==r)}}function gw(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function o_(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function N$(e){var t=e.alternate;t!==null&&(e.alternate=null,N$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jl],delete t[hy],delete t[U6],delete t[Fte],delete t[Bte])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $$(e){return e.tag===5||e.tag===3||e.tag===4}function MM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$$(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(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function a_(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=TS));else if(r!==4&&(e=e.child,e!==null))for(a_(e,t,n),e=e.sibling;e!==null;)a_(e,t,n),e=e.sibling}function s_(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(s_(e,t,n),e=e.sibling;e!==null;)s_(e,t,n),e=e.sibling}var Wi=null,zs=!1;function od(e,t,n){for(n=n.child;n!==null;)F$(e,t,n),n=n.sibling}function F$(e,t,n){if(Gl&&typeof Gl.onCommitFiberUnmount=="function")try{Gl.onCommitFiberUnmount(sw,n)}catch{}switch(n.tag){case 5:io||Xg(n,t);case 6:var r=Wi,i=zs;Wi=null,od(e,t,n),Wi=r,zs=i,Wi!==null&&(zs?(e=Wi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Wi.removeChild(n.stateNode));break;case 18:Wi!==null&&(zs?(e=Wi,n=n.stateNode,e.nodeType===8?k5(e.parentNode,n):e.nodeType===1&&k5(e,n),ly(e)):k5(Wi,n.stateNode));break;case 4:r=Wi,i=zs,Wi=n.stateNode.containerInfo,zs=!0,od(e,t,n),Wi=r,zs=i;break;case 0:case 11:case 14:case 15:if(!io&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&i_(n,t,a),i=i.next}while(i!==r)}od(e,t,n);break;case 1:if(!io&&(Xg(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){$r(n,t,s)}od(e,t,n);break;case 21:od(e,t,n);break;case 22:n.mode&1?(io=(r=io)||n.memoizedState!==null,od(e,t,n),io=r):od(e,t,n);break;default:od(e,t,n)}}function LM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new nne),t.forEach(function(r){var i=fne.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Is(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Zr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*one(r/1960))-r,10e?16:e,wd===null)var r=!1;else{if(e=wd,wd=null,zS=0,un&6)throw Error(Be(331));var i=un;for(un|=4,dt=e.current;dt!==null;){var o=dt,a=o.child;if(dt.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lZr()-m9?Mh(e,0):g9|=n),Xo(e,t)}function q$(e,t){t===0&&(e.mode&1?(t=Sb,Sb<<=1,!(Sb&130023424)&&(Sb=4194304)):t=1);var n=_o();e=ec(e,t),e!==null&&(Ky(e,t,n),Xo(e,n))}function dne(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),q$(e,n)}function fne(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Be(314))}r!==null&&r.delete(t),q$(e,n)}var K$;K$=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ko.current)qo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qo=!1,Jte(e,t,n);qo=!!(e.flags&131072)}else qo=!1,yr&&t.flags&1048576&&ZN(t,OS,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zx(e,t),e=t.pendingProps;var i=Nm(t,lo.current);mm(t,n),i=u9(null,t,r,e,i,n);var o=c9();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yo(r)?(o=!0,LS(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i9(t),i.updater=hw,t.stateNode=i,i._reactInternals=t,Z6(t,r,e,n),t=e_(null,t,r,!0,o,n)):(t.tag=0,yr&&o&&Z7(t),xo(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zx(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=pne(r),e=Bs(r,e),i){case 0:t=J6(null,t,r,e,n);break e;case 1:t=kM(null,t,r,e,n);break e;case 11:t=CM(null,t,r,e,n);break e;case 14:t=_M(null,t,r,Bs(r.type,e),n);break e}throw Error(Be(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bs(r,i),J6(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bs(r,i),kM(e,t,r,i,n);case 3:e:{if(A$(t),e===null)throw Error(Be(387));r=t.pendingProps,o=t.memoizedState,i=o.element,t$(e,t),DS(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=zm(Error(Be(423)),t),t=EM(e,t,r,n,i);break e}else if(r!==i){i=zm(Error(Be(424)),t),t=EM(e,t,r,n,i);break e}else for(_a=Od(t.stateNode.containerInfo.firstChild),Ea=t,yr=!0,Ws=null,n=o$(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($m(),r===i){t=tc(e,t,n);break e}xo(e,t,r,n)}t=t.child}return t;case 5:return a$(t),e===null&&K6(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,W6(r,i)?a=null:o!==null&&W6(r,o)&&(t.flags|=32),L$(e,t),xo(e,t,a,n),t.child;case 6:return e===null&&K6(t),null;case 13:return O$(e,t,n);case 4:return o9(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fm(t,null,r,n):xo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bs(r,i),CM(e,t,r,i,n);case 7:return xo(e,t,t.pendingProps,n),t.child;case 8:return xo(e,t,t.pendingProps.children,n),t.child;case 12:return xo(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,nr(RS,r._currentValue),r._currentValue=a,o!==null)if(Zs(o.value,a)){if(o.children===i.children&&!Ko.current){t=tc(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Wu(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Y6(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Be(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Y6(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}xo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,mm(t,n),i=os(i),r=r(i),t.flags|=1,xo(e,t,r,n),t.child;case 14:return r=t.type,i=Bs(r,t.pendingProps),i=Bs(r.type,i),_M(e,t,r,i,n);case 15:return T$(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bs(r,i),zx(e,t),t.tag=1,Yo(r)?(e=!0,LS(t)):e=!1,mm(t,n),r$(t,r,i),Z6(t,r,i,n),e_(null,t,r,!0,e,n);case 19:return R$(e,t,n);case 22:return M$(e,t,n)}throw Error(Be(156,t.tag))};function Y$(e,t){return SN(e,t)}function hne(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function es(e,t,n,r){return new hne(e,t,n,r)}function x9(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pne(e){if(typeof e=="function")return x9(e)?1:0;if(e!=null){if(e=e.$$typeof,e===F7)return 11;if(e===B7)return 14}return 2}function jd(e,t){var n=e.alternate;return n===null?(n=es(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Vx(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")x9(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case zg:return Lh(n.children,i,o,t);case $7:a=8,i|=8;break;case S6:return e=es(12,n,t,i|2),e.elementType=S6,e.lanes=o,e;case w6:return e=es(13,n,t,i),e.elementType=w6,e.lanes=o,e;case C6:return e=es(19,n,t,i),e.elementType=C6,e.lanes=o,e;case iN:return vw(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case nN:a=10;break e;case rN:a=9;break e;case F7:a=11;break e;case B7:a=14;break e;case hd:a=16,r=null;break e}throw Error(Be(130,e==null?e:typeof e,""))}return t=es(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Lh(e,t,n,r){return e=es(7,e,r,t),e.lanes=n,e}function vw(e,t,n,r){return e=es(22,e,r,t),e.elementType=iN,e.lanes=n,e.stateNode={isHidden:!1},e}function R5(e,t,n){return e=es(6,e,null,t),e.lanes=n,e}function I5(e,t,n){return t=es(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function gne(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=p5(0),this.expirationTimes=p5(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=p5(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function S9(e,t,n,r,i,o,a,s,l){return e=new gne(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=es(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},i9(o),e}function mne(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Ra})(vee);const Rb=C7(Xs);var[J$,Sne]=Pn({strict:!1,name:"PortalContext"}),k9="chakra-portal",wne=".chakra-portal",Cne=e=>g.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),_ne=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=S.useState(null),o=S.useRef(null),[,a]=S.useState({});S.useEffect(()=>a({}),[]);const s=Sne(),l=mee();Ul(()=>{if(!r)return;const d=r.ownerDocument,p=t?s??d.body:d.body;if(!p)return;o.current=d.createElement("div"),o.current.className=k9,p.appendChild(o.current),a({});const m=o.current;return()=>{p.contains(m)&&p.removeChild(m)}},[r]);const u=l!=null&&l.zIndex?g.jsx(Cne,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return o.current?Xs.createPortal(g.jsx(J$,{value:o.current,children:u}),o.current):g.jsx("span",{ref:d=>{d&&i(d)}})},kne=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=S.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=k9),l},[i]),[,s]=S.useState({});return Ul(()=>s({}),[]),Ul(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?Xs.createPortal(g.jsx(J$,{value:r?a:null,children:t}),a):null};function u0(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?g.jsx(kne,{containerRef:n,...r}):g.jsx(_ne,{...r})}u0.className=k9;u0.selector=wne;u0.displayName="Portal";function Qy(){const e=S.useContext(ny);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}var E9=S.createContext({});E9.displayName="ColorModeContext";function Jy(){const e=S.useContext(E9);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var Ib={light:"chakra-ui-light",dark:"chakra-ui-dark"};function Ene(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i==null||i()},setClassName(r){document.body.classList.add(r?Ib.dark:Ib.light),document.body.classList.remove(r?Ib.light:Ib.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var i;return((i=n.query().matches)!=null?i:r==="dark")?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var Pne="chakra-ui-color-mode";function Tne(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var Mne=Tne(Pne),$M=()=>{};function FM(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function eF(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=Mne}=e,s=i==="dark"?"dark":"light",[l,u]=S.useState(()=>FM(a,s)),[d,p]=S.useState(()=>FM(a)),{getSystemTheme:m,setClassName:y,setDataset:b,addListener:w}=S.useMemo(()=>Ene({preventTransition:o}),[o]),E=i==="system"&&!l?d:l,_=S.useCallback(L=>{const O=L==="system"?m():L;u(O),y(O==="dark"),b(O),a.set(O)},[a,m,y,b]);Ul(()=>{i==="system"&&p(m())},[]),S.useEffect(()=>{const L=a.get();if(L){_(L);return}if(i==="system"){_("system");return}_(s)},[a,s,i,_]);const k=S.useCallback(()=>{_(E==="dark"?"light":"dark")},[E,_]);S.useEffect(()=>{if(r)return w(_)},[r,w,_]);const T=S.useMemo(()=>({colorMode:t??E,toggleColorMode:t?$M:k,setColorMode:t?$M:_,forced:t!==void 0}),[E,k,_,t]);return g.jsx(E9.Provider,{value:T,children:n})}eF.displayName="ColorModeProvider";function tF(){const e=Jy(),t=Qy();return{...e,theme:t}}var xt=(...e)=>e.filter(Boolean).join(" ");function Lne(){return!1}function ko(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var e2=e=>{const{condition:t,message:n}=e;t&&Lne()&&console.warn(n)};function ts(e,...t){return Ane(e)?e(...t):e}var Ane=e=>typeof e=="function",Bt=e=>e?"":void 0,Vu=e=>e?!0:void 0;function ht(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function ww(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var VS={},One={get exports(){return VS},set exports(e){VS=e}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",p="[object Date]",m="[object Error]",y="[object Function]",b="[object GeneratorFunction]",w="[object Map]",E="[object Number]",_="[object Null]",k="[object Object]",T="[object Proxy]",L="[object RegExp]",O="[object Set]",D="[object String]",I="[object Undefined]",N="[object WeakMap]",V="[object ArrayBuffer]",B="[object DataView]",K="[object Float32Array]",ne="[object Float64Array]",z="[object Int8Array]",$="[object Int16Array]",H="[object Int32Array]",Y="[object Uint8Array]",Q="[object Uint8ClampedArray]",q="[object Uint16Array]",X="[object Uint32Array]",ee=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Ee=/^(?:0|[1-9]\d*)$/,we={};we[K]=we[ne]=we[z]=we[$]=we[H]=we[Y]=we[Q]=we[q]=we[X]=!0,we[s]=we[l]=we[V]=we[d]=we[B]=we[p]=we[m]=we[y]=we[w]=we[E]=we[k]=we[L]=we[O]=we[D]=we[N]=!1;var xe=typeof So=="object"&&So&&So.Object===Object&&So,Ae=typeof self=="object"&&self&&self.Object===Object&&self,Se=xe||Ae||Function("return this")(),Qe=t&&!t.nodeType&&t,Ye=Qe&&!0&&e&&!e.nodeType&&e,nt=Ye&&Ye.exports===Qe,vt=nt&&xe.process,Ce=function(){try{var G=Ye&&Ye.require&&Ye.require("util").types;return G||vt&&vt.binding&&vt.binding("util")}catch{}}(),et=Ce&&Ce.isTypedArray;function yt(G,re,pe){switch(pe.length){case 0:return G.call(re);case 1:return G.call(re,pe[0]);case 2:return G.call(re,pe[0],pe[1]);case 3:return G.call(re,pe[0],pe[1],pe[2])}return G.apply(re,pe)}function ze(G,re){for(var pe=-1,ot=Array(G);++pe-1}function E0(G,re){var pe=this.__data__,ot=xs(pe,G);return ot<0?(++this.size,pe.push([G,re])):pe[ot][1]=re,this}na.prototype.clear=mf,na.prototype.delete=k0,na.prototype.get=xc,na.prototype.has=vf,na.prototype.set=E0;function nl(G){var re=-1,pe=G==null?0:G.length;for(this.clear();++re1?pe[Ht-1]:void 0,St=Ht>2?pe[2]:void 0;for(mn=G.length>3&&typeof mn=="function"?(Ht--,mn):void 0,St&&Pp(pe[0],pe[1],St)&&(mn=Ht<3?void 0:mn,Ht=1),re=Object(re);++ot-1&&G%1==0&&G0){if(++re>=i)return arguments[0]}else re=0;return G.apply(void 0,arguments)}}function kc(G){if(G!=null){try{return Ne.call(G)}catch{}try{return G+""}catch{}}return""}function Na(G,re){return G===re||G!==G&&re!==re}var wf=pu(function(){return arguments}())?pu:function(G){return Xn(G)&&Ue.call(G,"callee")&&!zr.call(G,"callee")},vu=Array.isArray;function Gt(G){return G!=null&&Mp(G.length)&&!Pc(G)}function Tp(G){return Xn(G)&&Gt(G)}var Ec=vs||F0;function Pc(G){if(!aa(G))return!1;var re=il(G);return re==y||re==b||re==u||re==T}function Mp(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=a}function aa(G){var re=typeof G;return G!=null&&(re=="object"||re=="function")}function Xn(G){return G!=null&&typeof G=="object"}function Cf(G){if(!Xn(G)||il(G)!=k)return!1;var re=Ge(G);if(re===null)return!0;var pe=Ue.call(re,"constructor")&&re.constructor;return typeof pe=="function"&&pe instanceof pe&&Ne.call(pe)==bt}var Lp=et?at(et):wc;function _f(G){return ci(G,Ap(G))}function Ap(G){return Gt(G)?j0(G,!0):ol(G)}var cn=Ss(function(G,re,pe,ot){ra(G,re,pe,ot)});function qt(G){return function(){return G}}function Op(G){return G}function F0(){return!1}e.exports=cn})(One,VS);const Bl=VS;var Rne=e=>/!(important)?$/.test(e),BM=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,Ine=(e,t)=>n=>{const r=String(t),i=Rne(r),o=BM(r),a=e?`${e}.${o}`:o;let s=ko(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=BM(s),i?`${s} !important`:s};function P9(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{var s;const l=Ine(t,o)(a);let u=(s=n==null?void 0:n(l,a))!=null?s:l;return r&&(u=r(u,a)),u}}var Db=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Ds(e,t){return n=>{const r={property:n,scale:e};return r.transform=P9({scale:e,transform:t}),r}}var Dne=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function jne(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:Dne(t),transform:n?P9({scale:n,compose:r}):r}}var nF=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function Nne(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...nF].join(" ")}function $ne(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...nF].join(" ")}var Fne={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},Bne={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function zne(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var Hne={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},f_={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},Wne=new Set(Object.values(f_)),rF=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Vne=e=>e.trim();function Une(e,t){if(e==null||rF.has(e))return e;const r=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=r==null?void 0:r[1],o=r==null?void 0:r[2];if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(Vne).filter(Boolean);if((l==null?void 0:l.length)===0)return e;const u=s in f_?f_[s]:s;l.unshift(u);const d=l.map(p=>{if(Wne.has(p))return p;const m=p.indexOf(" "),[y,b]=m!==-1?[p.substr(0,m),p.substr(m+1)]:[p],w=iF(b)?b:b&&b.split(" "),E=`colors.${y}`,_=E in t.__cssMap?t.__cssMap[E].varRef:y;return w?[_,...Array.isArray(w)?w:[w]].join(" "):_});return`${a}(${d.join(", ")})`}var iF=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),Gne=(e,t)=>Une(e,t??{});function qne(e){return/^var\(--.+\)$/.test(e)}var Kne=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Pl=e=>t=>`${e}(${t})`,ln={filter(e){return e!=="auto"?e:Fne},backdropFilter(e){return e!=="auto"?e:Bne},ring(e){return zne(ln.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?Nne():e==="auto-gpu"?$ne():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=Kne(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(qne(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:Gne,blur:Pl("blur"),opacity:Pl("opacity"),brightness:Pl("brightness"),contrast:Pl("contrast"),dropShadow:Pl("drop-shadow"),grayscale:Pl("grayscale"),hueRotate:Pl("hue-rotate"),invert:Pl("invert"),saturate:Pl("saturate"),sepia:Pl("sepia"),bgImage(e){return e==null||iF(e)||rF.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=Hne[e])!=null?t:{},i={flexDirection:e};return n&&(i[n]=1),r&&(i[r]=1),i}},oe={borderWidths:Ds("borderWidths"),borderStyles:Ds("borderStyles"),colors:Ds("colors"),borders:Ds("borders"),radii:Ds("radii",ln.px),space:Ds("space",Db(ln.vh,ln.px)),spaceT:Ds("space",Db(ln.vh,ln.px)),degreeT(e){return{property:e,transform:ln.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:P9({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Ds("sizes",Db(ln.vh,ln.px)),sizesT:Ds("sizes",Db(ln.vh,ln.fraction)),shadows:Ds("shadows"),logical:jne,blur:Ds("blur",ln.blur)},Ux={background:oe.colors("background"),backgroundColor:oe.colors("backgroundColor"),backgroundImage:oe.propT("backgroundImage",ln.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:ln.bgClip},bgSize:oe.prop("backgroundSize"),bgPosition:oe.prop("backgroundPosition"),bg:oe.colors("background"),bgColor:oe.colors("backgroundColor"),bgPos:oe.prop("backgroundPosition"),bgRepeat:oe.prop("backgroundRepeat"),bgAttachment:oe.prop("backgroundAttachment"),bgGradient:oe.propT("backgroundImage",ln.gradient),bgClip:{transform:ln.bgClip}};Object.assign(Ux,{bgImage:Ux.backgroundImage,bgImg:Ux.backgroundImage});var yn={border:oe.borders("border"),borderWidth:oe.borderWidths("borderWidth"),borderStyle:oe.borderStyles("borderStyle"),borderColor:oe.colors("borderColor"),borderRadius:oe.radii("borderRadius"),borderTop:oe.borders("borderTop"),borderBlockStart:oe.borders("borderBlockStart"),borderTopLeftRadius:oe.radii("borderTopLeftRadius"),borderStartStartRadius:oe.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:oe.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:oe.radii("borderTopRightRadius"),borderStartEndRadius:oe.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:oe.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:oe.borders("borderRight"),borderInlineEnd:oe.borders("borderInlineEnd"),borderBottom:oe.borders("borderBottom"),borderBlockEnd:oe.borders("borderBlockEnd"),borderBottomLeftRadius:oe.radii("borderBottomLeftRadius"),borderBottomRightRadius:oe.radii("borderBottomRightRadius"),borderLeft:oe.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:oe.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:oe.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:oe.borders(["borderLeft","borderRight"]),borderInline:oe.borders("borderInline"),borderY:oe.borders(["borderTop","borderBottom"]),borderBlock:oe.borders("borderBlock"),borderTopWidth:oe.borderWidths("borderTopWidth"),borderBlockStartWidth:oe.borderWidths("borderBlockStartWidth"),borderTopColor:oe.colors("borderTopColor"),borderBlockStartColor:oe.colors("borderBlockStartColor"),borderTopStyle:oe.borderStyles("borderTopStyle"),borderBlockStartStyle:oe.borderStyles("borderBlockStartStyle"),borderBottomWidth:oe.borderWidths("borderBottomWidth"),borderBlockEndWidth:oe.borderWidths("borderBlockEndWidth"),borderBottomColor:oe.colors("borderBottomColor"),borderBlockEndColor:oe.colors("borderBlockEndColor"),borderBottomStyle:oe.borderStyles("borderBottomStyle"),borderBlockEndStyle:oe.borderStyles("borderBlockEndStyle"),borderLeftWidth:oe.borderWidths("borderLeftWidth"),borderInlineStartWidth:oe.borderWidths("borderInlineStartWidth"),borderLeftColor:oe.colors("borderLeftColor"),borderInlineStartColor:oe.colors("borderInlineStartColor"),borderLeftStyle:oe.borderStyles("borderLeftStyle"),borderInlineStartStyle:oe.borderStyles("borderInlineStartStyle"),borderRightWidth:oe.borderWidths("borderRightWidth"),borderInlineEndWidth:oe.borderWidths("borderInlineEndWidth"),borderRightColor:oe.colors("borderRightColor"),borderInlineEndColor:oe.colors("borderInlineEndColor"),borderRightStyle:oe.borderStyles("borderRightStyle"),borderInlineEndStyle:oe.borderStyles("borderInlineEndStyle"),borderTopRadius:oe.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:oe.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:oe.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:oe.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(yn,{rounded:yn.borderRadius,roundedTop:yn.borderTopRadius,roundedTopLeft:yn.borderTopLeftRadius,roundedTopRight:yn.borderTopRightRadius,roundedTopStart:yn.borderStartStartRadius,roundedTopEnd:yn.borderStartEndRadius,roundedBottom:yn.borderBottomRadius,roundedBottomLeft:yn.borderBottomLeftRadius,roundedBottomRight:yn.borderBottomRightRadius,roundedBottomStart:yn.borderEndStartRadius,roundedBottomEnd:yn.borderEndEndRadius,roundedLeft:yn.borderLeftRadius,roundedRight:yn.borderRightRadius,roundedStart:yn.borderInlineStartRadius,roundedEnd:yn.borderInlineEndRadius,borderStart:yn.borderInlineStart,borderEnd:yn.borderInlineEnd,borderTopStartRadius:yn.borderStartStartRadius,borderTopEndRadius:yn.borderStartEndRadius,borderBottomStartRadius:yn.borderEndStartRadius,borderBottomEndRadius:yn.borderEndEndRadius,borderStartRadius:yn.borderInlineStartRadius,borderEndRadius:yn.borderInlineEndRadius,borderStartWidth:yn.borderInlineStartWidth,borderEndWidth:yn.borderInlineEndWidth,borderStartColor:yn.borderInlineStartColor,borderEndColor:yn.borderInlineEndColor,borderStartStyle:yn.borderInlineStartStyle,borderEndStyle:yn.borderInlineEndStyle});var Yne={color:oe.colors("color"),textColor:oe.colors("color"),fill:oe.colors("fill"),stroke:oe.colors("stroke")},h_={boxShadow:oe.shadows("boxShadow"),mixBlendMode:!0,blendMode:oe.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:oe.prop("backgroundBlendMode"),opacity:!0};Object.assign(h_,{shadow:h_.boxShadow});var Xne={filter:{transform:ln.filter},blur:oe.blur("--chakra-blur"),brightness:oe.propT("--chakra-brightness",ln.brightness),contrast:oe.propT("--chakra-contrast",ln.contrast),hueRotate:oe.degreeT("--chakra-hue-rotate"),invert:oe.propT("--chakra-invert",ln.invert),saturate:oe.propT("--chakra-saturate",ln.saturate),dropShadow:oe.propT("--chakra-drop-shadow",ln.dropShadow),backdropFilter:{transform:ln.backdropFilter},backdropBlur:oe.blur("--chakra-backdrop-blur"),backdropBrightness:oe.propT("--chakra-backdrop-brightness",ln.brightness),backdropContrast:oe.propT("--chakra-backdrop-contrast",ln.contrast),backdropHueRotate:oe.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:oe.propT("--chakra-backdrop-invert",ln.invert),backdropSaturate:oe.propT("--chakra-backdrop-saturate",ln.saturate)},US={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:ln.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:oe.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:oe.space("gap"),rowGap:oe.space("rowGap"),columnGap:oe.space("columnGap")};Object.assign(US,{flexDir:US.flexDirection});var oF={gridGap:oe.space("gridGap"),gridColumnGap:oe.space("gridColumnGap"),gridRowGap:oe.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},Zne={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:ln.outline},outlineOffset:!0,outlineColor:oe.colors("outlineColor")},qa={width:oe.sizesT("width"),inlineSize:oe.sizesT("inlineSize"),height:oe.sizes("height"),blockSize:oe.sizes("blockSize"),boxSize:oe.sizes(["width","height"]),minWidth:oe.sizes("minWidth"),minInlineSize:oe.sizes("minInlineSize"),minHeight:oe.sizes("minHeight"),minBlockSize:oe.sizes("minBlockSize"),maxWidth:oe.sizes("maxWidth"),maxInlineSize:oe.sizes("maxInlineSize"),maxHeight:oe.sizes("maxHeight"),maxBlockSize:oe.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minWQuery)!=null?i:`@media screen and (min-width: ${e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.maxWQuery)!=null?i:`@media screen and (max-width: ${e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:oe.propT("float",ln.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(qa,{w:qa.width,h:qa.height,minW:qa.minWidth,maxW:qa.maxWidth,minH:qa.minHeight,maxH:qa.maxHeight,overscroll:qa.overscrollBehavior,overscrollX:qa.overscrollBehaviorX,overscrollY:qa.overscrollBehaviorY});var Qne={listStyleType:!0,listStylePosition:!0,listStylePos:oe.prop("listStylePosition"),listStyleImage:!0,listStyleImg:oe.prop("listStyleImage")};function Jne(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},tre=ere(Jne),nre={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},rre={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},D5=(e,t,n)=>{const r={},i=tre(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},ire={srOnly:{transform(e){return e===!0?nre:e==="focusable"?rre:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>D5(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>D5(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>D5(t,e,n)}},A1={position:!0,pos:oe.prop("position"),zIndex:oe.prop("zIndex","zIndices"),inset:oe.spaceT("inset"),insetX:oe.spaceT(["left","right"]),insetInline:oe.spaceT("insetInline"),insetY:oe.spaceT(["top","bottom"]),insetBlock:oe.spaceT("insetBlock"),top:oe.spaceT("top"),insetBlockStart:oe.spaceT("insetBlockStart"),bottom:oe.spaceT("bottom"),insetBlockEnd:oe.spaceT("insetBlockEnd"),left:oe.spaceT("left"),insetInlineStart:oe.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:oe.spaceT("right"),insetInlineEnd:oe.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(A1,{insetStart:A1.insetInlineStart,insetEnd:A1.insetInlineEnd});var ore={ring:{transform:ln.ring},ringColor:oe.colors("--chakra-ring-color"),ringOffset:oe.prop("--chakra-ring-offset-width"),ringOffsetColor:oe.colors("--chakra-ring-offset-color"),ringInset:oe.prop("--chakra-ring-inset")},or={margin:oe.spaceT("margin"),marginTop:oe.spaceT("marginTop"),marginBlockStart:oe.spaceT("marginBlockStart"),marginRight:oe.spaceT("marginRight"),marginInlineEnd:oe.spaceT("marginInlineEnd"),marginBottom:oe.spaceT("marginBottom"),marginBlockEnd:oe.spaceT("marginBlockEnd"),marginLeft:oe.spaceT("marginLeft"),marginInlineStart:oe.spaceT("marginInlineStart"),marginX:oe.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:oe.spaceT("marginInline"),marginY:oe.spaceT(["marginTop","marginBottom"]),marginBlock:oe.spaceT("marginBlock"),padding:oe.space("padding"),paddingTop:oe.space("paddingTop"),paddingBlockStart:oe.space("paddingBlockStart"),paddingRight:oe.space("paddingRight"),paddingBottom:oe.space("paddingBottom"),paddingBlockEnd:oe.space("paddingBlockEnd"),paddingLeft:oe.space("paddingLeft"),paddingInlineStart:oe.space("paddingInlineStart"),paddingInlineEnd:oe.space("paddingInlineEnd"),paddingX:oe.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:oe.space("paddingInline"),paddingY:oe.space(["paddingTop","paddingBottom"]),paddingBlock:oe.space("paddingBlock")};Object.assign(or,{m:or.margin,mt:or.marginTop,mr:or.marginRight,me:or.marginInlineEnd,marginEnd:or.marginInlineEnd,mb:or.marginBottom,ml:or.marginLeft,ms:or.marginInlineStart,marginStart:or.marginInlineStart,mx:or.marginX,my:or.marginY,p:or.padding,pt:or.paddingTop,py:or.paddingY,px:or.paddingX,pb:or.paddingBottom,pl:or.paddingLeft,ps:or.paddingInlineStart,paddingStart:or.paddingInlineStart,pr:or.paddingRight,pe:or.paddingInlineEnd,paddingEnd:or.paddingInlineEnd});var are={textDecorationColor:oe.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:oe.shadows("textShadow")},sre={clipPath:!0,transform:oe.propT("transform",ln.transform),transformOrigin:!0,translateX:oe.spaceT("--chakra-translate-x"),translateY:oe.spaceT("--chakra-translate-y"),skewX:oe.degreeT("--chakra-skew-x"),skewY:oe.degreeT("--chakra-skew-y"),scaleX:oe.prop("--chakra-scale-x"),scaleY:oe.prop("--chakra-scale-y"),scale:oe.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:oe.degreeT("--chakra-rotate")},lre={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:oe.prop("transitionDuration","transition.duration"),transitionProperty:oe.prop("transitionProperty","transition.property"),transitionTimingFunction:oe.prop("transitionTimingFunction","transition.easing")},ure={fontFamily:oe.prop("fontFamily","fonts"),fontSize:oe.prop("fontSize","fontSizes",ln.px),fontWeight:oe.prop("fontWeight","fontWeights"),lineHeight:oe.prop("lineHeight","lineHeights"),letterSpacing:oe.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},cre={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:oe.spaceT("scrollMargin"),scrollMarginTop:oe.spaceT("scrollMarginTop"),scrollMarginBottom:oe.spaceT("scrollMarginBottom"),scrollMarginLeft:oe.spaceT("scrollMarginLeft"),scrollMarginRight:oe.spaceT("scrollMarginRight"),scrollMarginX:oe.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:oe.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:oe.spaceT("scrollPadding"),scrollPaddingTop:oe.spaceT("scrollPaddingTop"),scrollPaddingBottom:oe.spaceT("scrollPaddingBottom"),scrollPaddingLeft:oe.spaceT("scrollPaddingLeft"),scrollPaddingRight:oe.spaceT("scrollPaddingRight"),scrollPaddingX:oe.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:oe.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function aF(e){return ko(e)&&e.reference?e.reference:String(e)}var Cw=(e,...t)=>t.map(aF).join(` ${e} `).replace(/calc/g,""),zM=(...e)=>`calc(${Cw("+",...e)})`,HM=(...e)=>`calc(${Cw("-",...e)})`,p_=(...e)=>`calc(${Cw("*",...e)})`,WM=(...e)=>`calc(${Cw("/",...e)})`,VM=e=>{const t=aF(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:p_(t,-1)},bh=Object.assign(e=>({add:(...t)=>bh(zM(e,...t)),subtract:(...t)=>bh(HM(e,...t)),multiply:(...t)=>bh(p_(e,...t)),divide:(...t)=>bh(WM(e,...t)),negate:()=>bh(VM(e)),toString:()=>e.toString()}),{add:zM,subtract:HM,multiply:p_,divide:WM,negate:VM});function dre(e,t="-"){return e.replace(/\s+/g,t)}function fre(e){const t=dre(e.toString());return pre(hre(t))}function hre(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function pre(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function gre(e,t=""){return[t,e].filter(Boolean).join("-")}function mre(e,t){return`var(${e}${t?`, ${t}`:""})`}function vre(e,t=""){return fre(`--${gre(e,t)}`)}function gn(e,t,n){const r=vre(e,n);return{variable:r,reference:mre(r,t)}}function yre(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function bre(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function g_(e){if(e==null)return e;const{unitless:t}=bre(e);return t||typeof e=="number"?`${e}px`:e}var sF=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,T9=e=>Object.fromEntries(Object.entries(e).sort(sF));function UM(e){const t=T9(e);return Object.assign(Object.values(t),t)}function xre(e){const t=Object.keys(T9(e));return new Set(t)}function GM(e){var t;if(!e)return e;e=(t=g_(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function s1(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${g_(e)})`),t&&n.push("and",`(max-width: ${g_(t)})`),n.join(" ")}function Sre(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=UM(e),r=Object.entries(e).sort(sF).map(([a,s],l,u)=>{var d;let[,p]=(d=u[l+1])!=null?d:[];return p=parseFloat(p)>0?GM(p):void 0,{_minW:GM(s),breakpoint:a,minW:s,maxW:p,maxWQuery:s1(null,p),minWQuery:s1(s),minMaxQuery:s1(s,p)}}),i=xre(e),o=Array.from(i.values());return{keys:i,normalized:n,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>i.has(l))},asObject:T9(e),asArray:UM(e),details:r,get(a){return r.find(s=>s.breakpoint===a)},media:[null,...n.map(a=>s1(a)).slice(1)],toArrayValue(a){if(!ko(a))throw new Error("toArrayValue: value must be an object");const s=o.map(l=>{var u;return(u=a[l])!=null?u:null});for(;yre(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const d=o[u];return d!=null&&l!=null&&(s[d]=l),s},{})}}}var zi={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},ad=e=>lF(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Au=e=>lF(t=>e(t,"~ &"),"[data-peer]",".peer"),lF=(e,...t)=>t.map(e).join(", "),_w={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:ad(zi.hover),_peerHover:Au(zi.hover),_groupFocus:ad(zi.focus),_peerFocus:Au(zi.focus),_groupFocusVisible:ad(zi.focusVisible),_peerFocusVisible:Au(zi.focusVisible),_groupActive:ad(zi.active),_peerActive:Au(zi.active),_groupDisabled:ad(zi.disabled),_peerDisabled:Au(zi.disabled),_groupInvalid:ad(zi.invalid),_peerInvalid:Au(zi.invalid),_groupChecked:ad(zi.checked),_peerChecked:Au(zi.checked),_groupFocusWithin:ad(zi.focusWithin),_peerFocusWithin:Au(zi.focusWithin),_peerPlaceholderShown:Au(zi.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},wre=Object.keys(_w);function qM(e,t){return gn(String(e).replace(/\./g,"-"),void 0,t)}function Cre(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=qM(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const m=i.split("."),[y,...b]=m,w=`${y}.-${b.join(".")}`,E=bh.negate(s),_=bh.negate(u);r[w]={value:E,var:l,varRef:_}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const d=m=>{const b=[String(i).split(".")[0],m].join(".");if(!e[b])return m;const{reference:E}=qM(b,t==null?void 0:t.cssVarPrefix);return E},p=ko(s)?s:{default:s};n=Bl(n,Object.entries(p).reduce((m,[y,b])=>{var w,E;const _=d(b);if(y==="default")return m[l]=_,m;const k=(E=(w=_w)==null?void 0:w[y])!=null?E:y;return m[k]={[l]:_},m},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function _re(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function kre(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var Ere=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function Pre(e){return kre(e,Ere)}function Tre(e){return e.semanticTokens}function Mre(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function Lre({tokens:e,semanticTokens:t}){var n,r;const i=Object.entries((n=m_(e))!=null?n:{}).map(([a,s])=>[a,{isSemantic:!1,value:s}]),o=Object.entries((r=m_(t,1))!=null?r:{}).map(([a,s])=>[a,{isSemantic:!0,value:s}]);return Object.fromEntries([...i,...o])}function m_(e,t=1/0){return!ko(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(ko(i)||Array.isArray(i)?Object.entries(m_(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function Are(e){var t;const n=Mre(e),r=Pre(n),i=Tre(n),o=Lre({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=Cre(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:Sre(n.breakpoints)}),n}var M9=Bl({},Ux,yn,Yne,US,qa,Xne,ore,Zne,oF,ire,A1,h_,or,cre,ure,are,sre,Qne,lre),Ore=Object.assign({},or,qa,US,oF,A1),uF=Object.keys(Ore),Rre=[...Object.keys(M9),...wre],Ire={...M9,..._w},Dre=e=>e in Ire,jre=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=ts(e[a],t);if(s==null)continue;if(s=ko(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!$re(t),Bre=(e,t)=>{var n,r;if(t==null)return t;const i=l=>{var u,d;return(d=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:d.varRef},o=l=>{var u;return(u=i(l))!=null?u:l},[a,s]=Nre(t);return t=(r=(n=i(a))!=null?n:o(s))!=null?r:o(t),t};function zre(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s,l,u;const d=ts(o,r),p=jre(d)(r);let m={};for(let y in p){const b=p[y];let w=ts(b,r);y in n&&(y=n[y]),Fre(y,w)&&(w=Bre(r,w));let E=t[y];if(E===!0&&(E={property:y}),ko(w)){m[y]=(s=m[y])!=null?s:{},m[y]=Bl({},m[y],i(w,!0));continue}let _=(u=(l=E==null?void 0:E.transform)==null?void 0:l.call(E,w,r,d))!=null?u:w;_=E!=null&&E.processResult?i(_,!0):_;const k=ts(E==null?void 0:E.property,r);if(!a&&(E!=null&&E.static)){const T=ts(E.static,r);m=Bl({},m,T)}if(k&&Array.isArray(k)){for(const T of k)m[T]=_;continue}if(k){k==="&"&&ko(_)?m=Bl({},m,_):m[k]=_;continue}if(ko(_)){m=Bl({},m,_);continue}m[y]=_}return m};return i}var cF=e=>t=>zre({theme:t,pseudos:_w,configs:M9})(e);function dr(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function Hre(e,t){if(Array.isArray(e))return e;if(ko(e))return t(e);if(e!=null)return[e]}function Wre(e,t){for(let n=t+1;n{Bl(u,{[T]:m?k[T]:{[_]:k[T]}})});continue}if(!y){m?Bl(u,k):u[_]=k;continue}u[_]=k}}return u}}function Ure(e){return t=>{var n;const{variant:r,size:i,theme:o}=t,a=Vre(o);return Bl({},ts((n=e.baseStyle)!=null?n:{},t),a(e,"sizes",i,t),a(e,"variants",r,t))}}function Gre(e,t,n){var r,i,o;return(o=(i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)!=null?o:n}function fr(e){return _re(e,["styleConfig","size","variant","colorScheme"])}var qre={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Kre=qre,Yre={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Xre=Yre,Zre={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},Qre=Zre,Jre={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},eie=Jre,tie={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},nie=tie,rie={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},iie={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},oie={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},aie={property:rie,easing:iie,duration:oie},sie=aie,lie={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},uie=lie,cie={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},die=cie,fie={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},dF=fie,fF={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},hie={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},pie={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},gie={...fF,...hie,container:pie},hF=gie,mie={breakpoints:Xre,zIndices:Kre,radii:eie,blur:uie,colors:Qre,...dF,sizes:hF,shadows:nie,space:fF,borders:die,transition:sie};function En(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function i(...d){r();for(const p of d)t[p]=l(p);return En(e,t)}function o(...d){for(const p of d)p in t||(t[p]=l(p));return En(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([p,m])=>[p,m.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([p,m])=>[p,m.className]))}function l(d){const y=`chakra-${(["container","root"].includes(d??"")?[e]:[e,d]).filter(Boolean).join("__")}`;return{className:y,selector:`.${y}`,toString:()=>d}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var vie=En("accordion").parts("root","container","button","panel").extend("icon"),yie=En("alert").parts("title","description","container").extend("icon","spinner"),bie=En("avatar").parts("label","badge","container").extend("excessLabel","group"),xie=En("breadcrumb").parts("link","item","container").extend("separator");En("button").parts();var Sie=En("checkbox").parts("control","icon","container").extend("label");En("progress").parts("track","filledTrack").extend("label");var wie=En("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Cie=En("editable").parts("preview","input","textarea"),_ie=En("form").parts("container","requiredIndicator","helperText"),kie=En("formError").parts("text","icon"),Eie=En("input").parts("addon","field","element"),Pie=En("list").parts("container","item","icon"),Tie=En("menu").parts("button","list","item").extend("groupTitle","command","divider"),Mie=En("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Lie=En("numberinput").parts("root","field","stepperGroup","stepper");En("pininput").parts("field");var Aie=En("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Oie=En("progress").parts("label","filledTrack","track"),Rie=En("radio").parts("container","control","label"),Iie=En("select").parts("field","icon"),Die=En("slider").parts("container","track","thumb","filledTrack","mark"),jie=En("stat").parts("container","label","helpText","number","icon"),Nie=En("switch").parts("container","track","thumb"),$ie=En("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),Fie=En("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),Bie=En("tag").parts("container","label","closeButton"),zie=En("card").parts("container","header","body","footer");function kh(e,t,n){return Math.min(Math.max(e,n),t)}class Hie extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var l1=Hie;function L9(e){if(typeof e!="string")throw new l1(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=Xie.test(e)?Uie(e):e;const n=Gie.exec(t);if(n){const a=Array.from(n).slice(1);return[...a.slice(0,3).map(s=>parseInt(xy(s,2),16)),parseInt(xy(a[3]||"f",2),16)/255]}const r=qie.exec(t);if(r){const a=Array.from(r).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,16)),parseInt(a[3]||"ff",16)/255]}const i=Kie.exec(t);if(i){const a=Array.from(i).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,10)),parseFloat(a[3]||"1")]}const o=Yie.exec(t);if(o){const[a,s,l,u]=Array.from(o).slice(1).map(parseFloat);if(kh(0,100,s)!==s)throw new l1(e);if(kh(0,100,l)!==l)throw new l1(e);return[...Zie(a,s,l),Number.isNaN(u)?1:u]}throw new l1(e)}function Wie(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const KM=e=>parseInt(e.replace(/_/g,""),36),Vie="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=KM(t.substring(0,3)),r=KM(t.substring(3)).toString(16);let i="";for(let o=0;o<6-r.length;o++)i+="0";return e[n]=`${i}${r}`,e},{});function Uie(e){const t=e.toLowerCase().trim(),n=Vie[Wie(t)];if(!n)throw new l1(e);return`#${n}`}const xy=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),Gie=new RegExp(`^#${xy("([a-f0-9])",3)}([a-f0-9])?$`,"i"),qie=new RegExp(`^#${xy("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),Kie=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${xy(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),Yie=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,Xie=/^[a-z]+$/i,YM=e=>Math.round(e*255),Zie=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(YM);const i=(e%360+360)%360/60,o=(1-Math.abs(2*r-1))*(t/100),a=o*(1-Math.abs(i%2-1));let s=0,l=0,u=0;i>=0&&i<1?(s=o,l=a):i>=1&&i<2?(s=a,l=o):i>=2&&i<3?(l=o,u=a):i>=3&&i<4?(l=a,u=o):i>=4&&i<5?(s=a,u=o):i>=5&&i<6&&(s=o,u=a);const d=r-o/2,p=s+d,m=l+d,y=u+d;return[p,m,y].map(YM)};function Qie(e,t,n,r){return`rgba(${kh(0,255,e).toFixed()}, ${kh(0,255,t).toFixed()}, ${kh(0,255,n).toFixed()}, ${parseFloat(kh(0,1,r).toFixed(3))})`}function Jie(e,t){const[n,r,i,o]=L9(e);return Qie(n,r,i,o-t)}function eoe(e){const[t,n,r,i]=L9(e);let o=a=>{const s=kh(0,255,a).toString(16);return s.length===1?`0${s}`:s};return`#${o(t)}${o(n)}${o(r)}${i<1?o(Math.round(i*255)):""}`}function toe(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,wo=(e,t,n)=>{const r=toe(e,`colors.${t}`,t);try{return eoe(r),r}catch{return n??"#000000"}},roe=e=>{const[t,n,r]=L9(e);return(t*299+n*587+r*114)/1e3},ioe=e=>t=>{const n=wo(t,e);return roe(n)<128?"dark":"light"},ooe=e=>t=>ioe(e)(t)==="dark",Wm=(e,t)=>n=>{const r=wo(n,e);return Jie(r,1-t)};function XM(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( +`+o.stack}return{value:e,source:t,stack:i,digest:null}}function A5(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Q6(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Zte=typeof WeakMap=="function"?WeakMap:Map;function P$(e,t,n){n=Wu(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){BS||(BS=!0,l_=r),Q6(e,t)},n}function T$(e,t,n){n=Wu(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Q6(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Q6(e,t),typeof r!="function"&&(Id===null?Id=new Set([this]):Id.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function SM(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Zte;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=dne.bind(null,e,t,n),t.then(e,e))}function wM(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function CM(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Wu(-1,1),t.tag=2,Rd(n,t,1))),n.lanes|=1),e)}var Qte=dc.ReactCurrentOwner,qo=!1;function xo(e,t,n,r){t.child=e===null?a$(t,null,n,r):Fm(t,e.child,n,r)}function _M(e,t,n,r,i){n=n.render;var o=t.ref;return mm(t,i),r=u9(e,t,n,r,o,i),n=c9(),e!==null&&!qo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,tc(e,t,i)):(yr&&n&&Z7(t),t.flags|=1,xo(e,t,r,i),t.child)}function kM(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!x9(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,M$(e,t,o,r,i)):(e=Ux(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:cy,n(a,r)&&e.ref===t.ref)return tc(e,t,i)}return t.flags|=1,e=jd(o,r),e.ref=t.ref,e.return=t,t.child=e}function M$(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(cy(o,r)&&e.ref===t.ref)if(qo=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(qo=!0);else return t.lanes=e.lanes,tc(e,t,i)}return J6(e,t,n,r,i)}function L$(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},nr(Zg,Sa),Sa|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,nr(Zg,Sa),Sa|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,nr(Zg,Sa),Sa|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,nr(Zg,Sa),Sa|=r;return xo(e,t,i,n),t.child}function A$(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function J6(e,t,n,r,i){var o=Yo(n)?Hh:lo.current;return o=Nm(t,o),mm(t,i),n=u9(e,t,n,r,o,i),r=c9(),e!==null&&!qo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,tc(e,t,i)):(yr&&r&&Z7(t),t.flags|=1,xo(e,t,n,i),t.child)}function EM(e,t,n,r,i){if(Yo(n)){var o=!0;LS(t)}else o=!1;if(mm(t,i),t.stateNode===null)zx(e,t),i$(t,n,r),Z6(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=os(u):(u=Yo(n)?Hh:lo.current,u=Nm(t,u));var d=n.getDerivedStateFromProps,p=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";p||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==u)&&vM(t,a,r,u),pd=!1;var m=t.memoizedState;a.state=m,DS(t,r,a,i),l=t.memoizedState,s!==r||m!==l||Ko.current||pd?(typeof d=="function"&&(X6(t,n,d,r),l=t.memoizedState),(s=pd||mM(t,n,s,r,m,l,u))?(p||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,n$(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Bs(t.type,s),a.props=u,p=t.pendingProps,m=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=os(l):(l=Yo(n)?Hh:lo.current,l=Nm(t,l));var y=n.getDerivedStateFromProps;(d=typeof y=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==p||m!==l)&&vM(t,a,r,l),pd=!1,m=t.memoizedState,a.state=m,DS(t,r,a,i);var b=t.memoizedState;s!==p||m!==b||Ko.current||pd?(typeof y=="function"&&(X6(t,n,y,r),b=t.memoizedState),(u=pd||mM(t,n,u,r,m,b,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,b,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,b,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),a.props=r,a.state=b,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return e_(e,t,n,r,o,i)}function e_(e,t,n,r,i,o){A$(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&dM(t,n,!1),tc(e,t,o);r=t.stateNode,Qte.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Fm(t,e.child,null,o),t.child=Fm(t,null,s,o)):xo(e,t,s,o),t.memoizedState=r.state,i&&dM(t,n,!0),t.child}function O$(e){var t=e.stateNode;t.pendingContext?cM(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cM(e,t.context,!1),o9(e,t.containerInfo)}function PM(e,t,n,r,i){return $m(),J7(i),t.flags|=256,xo(e,t,n,r),t.child}var t_={dehydrated:null,treeContext:null,retryLane:0};function n_(e){return{baseLanes:e,cachePool:null,transitions:null}}function R$(e,t,n){var r=t.pendingProps,i=kr.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),nr(kr,i&1),e===null)return K6(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=vw(a,r,0,null),e=Lh(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=n_(n),t.memoizedState=t_,e):h9(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Jte(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=jd(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=jd(s,o):(o=Lh(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?n_(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=t_,r}return o=e.child,e=o.sibling,r=jd(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function h9(e,t){return t=vw({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Mb(e,t,n,r){return r!==null&&J7(r),Fm(t,e.child,null,n),e=h9(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jte(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=A5(Error(ze(422))),Mb(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=vw({mode:"visible",children:r.children},i,0,null),o=Lh(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Fm(t,e.child,null,a),t.child.memoizedState=n_(a),t.memoizedState=t_,o);if(!(t.mode&1))return Mb(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(ze(419)),r=A5(o,r,void 0),Mb(e,t,a,r)}if(s=(a&e.childLanes)!==0,qo||s){if(r=Ai,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,ec(e,i),qs(r,e,i,-1))}return b9(),r=A5(Error(ze(421))),Mb(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=fne.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,ka=Od(i.nextSibling),Pa=t,yr=!0,Ws=null,e!==null&&(Ya[Xa++]=Fu,Ya[Xa++]=Bu,Ya[Xa++]=Wh,Fu=e.id,Bu=e.overflow,Wh=t),t=h9(t,r.children),t.flags|=4096,t)}function TM(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Y6(e.return,t,n)}function O5(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function I$(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(xo(e,t,r.children,n),r=kr.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&TM(e,n,t);else if(e.tag===19)TM(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(nr(kr,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&jS(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),O5(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&jS(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}O5(t,!0,n,null,o);break;case"together":O5(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zx(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Vh|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ze(153));if(t.child!==null){for(e=t.child,n=jd(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=jd(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ene(e,t,n){switch(t.tag){case 3:O$(t),$m();break;case 5:s$(t);break;case 1:Yo(t.type)&&LS(t);break;case 4:o9(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;nr(RS,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(nr(kr,kr.current&1),t.flags|=128,null):n&t.child.childLanes?R$(e,t,n):(nr(kr,kr.current&1),e=tc(e,t,n),e!==null?e.sibling:null);nr(kr,kr.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return I$(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),nr(kr,kr.current),r)break;return null;case 22:case 23:return t.lanes=0,L$(e,t,n)}return tc(e,t,n)}var D$,r_,j$,N$;D$=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};r_=function(){};j$=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,_h(ql.current);var o=null;switch(n){case"input":i=k6(e,i),r=k6(e,r),o=[];break;case"select":i=Pr({},i,{value:void 0}),r=Pr({},r,{value:void 0}),o=[];break;case"textarea":i=T6(e,i),r=T6(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=TS)}L6(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ry.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ry.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ir("scroll",e),o||s===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};N$=function(e,t,n,r){n!==r&&(t.flags|=4)};function Nv(e,t){if(!yr)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function to(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function tne(e,t,n){var r=t.pendingProps;switch(Q7(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return to(t),null;case 1:return Yo(t.type)&&MS(),to(t),null;case 3:return r=t.stateNode,Bm(),cr(Ko),cr(lo),s9(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Pb(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ws!==null&&(d_(Ws),Ws=null))),r_(e,t),to(t),null;case 5:a9(t);var i=_h(gy.current);if(n=t.type,e!==null&&t.stateNode!=null)j$(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ze(166));return to(t),null}if(e=_h(ql.current),Pb(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[jl]=t,r[hy]=o,e=(t.mode&1)!==0,n){case"dialog":ir("cancel",r),ir("close",r);break;case"iframe":case"object":case"embed":ir("load",r);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[jl]=t,e[hy]=r,D$(e,t,!1,!1),t.stateNode=e;e:{switch(a=A6(n,r),n){case"dialog":ir("cancel",e),ir("close",e),i=r;break;case"iframe":case"object":case"embed":ir("load",e),i=r;break;case"video":case"audio":for(i=0;iHm&&(t.flags|=128,r=!0,Nv(o,!1),t.lanes=4194304)}else{if(!r)if(e=jS(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Nv(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!yr)return to(t),null}else 2*Zr()-o.renderingStartTime>Hm&&n!==1073741824&&(t.flags|=128,r=!0,Nv(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Zr(),t.sibling=null,n=kr.current,nr(kr,r?n&1|2:n&1),t):(to(t),null);case 22:case 23:return y9(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Sa&1073741824&&(to(t),t.subtreeFlags&6&&(t.flags|=8192)):to(t),null;case 24:return null;case 25:return null}throw Error(ze(156,t.tag))}function nne(e,t){switch(Q7(t),t.tag){case 1:return Yo(t.type)&&MS(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bm(),cr(Ko),cr(lo),s9(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return a9(t),null;case 13:if(cr(kr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ze(340));$m()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return cr(kr),null;case 4:return Bm(),null;case 10:return n9(t.type._context),null;case 22:case 23:return y9(),null;case 24:return null;default:return null}}var Lb=!1,io=!1,rne=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Xg(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$r(e,t,r)}else n.current=null}function i_(e,t,n){try{n()}catch(r){$r(e,t,r)}}var MM=!1;function ine(e,t){if(z6=kS,e=zN(),X7(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,d=0,p=e,m=null;t:for(;;){for(var y;p!==n||i!==0&&p.nodeType!==3||(s=a+i),p!==o||r!==0&&p.nodeType!==3||(l=a+r),p.nodeType===3&&(a+=p.nodeValue.length),(y=p.firstChild)!==null;)m=p,p=y;for(;;){if(p===e)break t;if(m===n&&++u===i&&(s=a),m===o&&++d===r&&(l=a),(y=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=y}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(H6={focusedElem:e,selectionRange:n},kS=!1,dt=t;dt!==null;)if(t=dt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,dt=e;else for(;dt!==null;){t=dt;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var w=b.memoizedProps,E=b.memoizedState,_=t.stateNode,k=_.getSnapshotBeforeUpdate(t.elementType===t.type?w:Bs(t.type,w),E);_.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ze(163))}}catch(L){$r(t,t.return,L)}if(e=t.sibling,e!==null){e.return=t.return,dt=e;break}dt=t.return}return b=MM,MM=!1,b}function T1(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&i_(t,n,o)}i=i.next}while(i!==r)}}function gw(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function o_(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function $$(e){var t=e.alternate;t!==null&&(e.alternate=null,$$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jl],delete t[hy],delete t[V6],delete t[Bte],delete t[zte])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function F$(e){return e.tag===5||e.tag===3||e.tag===4}function LM(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||F$(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(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function a_(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=TS));else if(r!==4&&(e=e.child,e!==null))for(a_(e,t,n),e=e.sibling;e!==null;)a_(e,t,n),e=e.sibling}function s_(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(s_(e,t,n),e=e.sibling;e!==null;)s_(e,t,n),e=e.sibling}var Wi=null,zs=!1;function od(e,t,n){for(n=n.child;n!==null;)B$(e,t,n),n=n.sibling}function B$(e,t,n){if(Gl&&typeof Gl.onCommitFiberUnmount=="function")try{Gl.onCommitFiberUnmount(sw,n)}catch{}switch(n.tag){case 5:io||Xg(n,t);case 6:var r=Wi,i=zs;Wi=null,od(e,t,n),Wi=r,zs=i,Wi!==null&&(zs?(e=Wi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Wi.removeChild(n.stateNode));break;case 18:Wi!==null&&(zs?(e=Wi,n=n.stateNode,e.nodeType===8?k5(e.parentNode,n):e.nodeType===1&&k5(e,n),ly(e)):k5(Wi,n.stateNode));break;case 4:r=Wi,i=zs,Wi=n.stateNode.containerInfo,zs=!0,od(e,t,n),Wi=r,zs=i;break;case 0:case 11:case 14:case 15:if(!io&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&i_(n,t,a),i=i.next}while(i!==r)}od(e,t,n);break;case 1:if(!io&&(Xg(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){$r(n,t,s)}od(e,t,n);break;case 21:od(e,t,n);break;case 22:n.mode&1?(io=(r=io)||n.memoizedState!==null,od(e,t,n),io=r):od(e,t,n);break;default:od(e,t,n)}}function AM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new rne),t.forEach(function(r){var i=hne.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Is(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Zr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ane(r/1960))-r,10e?16:e,wd===null)var r=!1;else{if(e=wd,wd=null,zS=0,un&6)throw Error(ze(331));var i=un;for(un|=4,dt=e.current;dt!==null;){var o=dt,a=o.child;if(dt.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lZr()-m9?Mh(e,0):g9|=n),Xo(e,t)}function K$(e,t){t===0&&(e.mode&1?(t=Sb,Sb<<=1,!(Sb&130023424)&&(Sb=4194304)):t=1);var n=_o();e=ec(e,t),e!==null&&(Ky(e,t,n),Xo(e,n))}function fne(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),K$(e,n)}function hne(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ze(314))}r!==null&&r.delete(t),K$(e,n)}var Y$;Y$=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ko.current)qo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qo=!1,ene(e,t,n);qo=!!(e.flags&131072)}else qo=!1,yr&&t.flags&1048576&&QN(t,OS,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zx(e,t),e=t.pendingProps;var i=Nm(t,lo.current);mm(t,n),i=u9(null,t,r,e,i,n);var o=c9();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yo(r)?(o=!0,LS(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i9(t),i.updater=hw,t.stateNode=i,i._reactInternals=t,Z6(t,r,e,n),t=e_(null,t,r,!0,o,n)):(t.tag=0,yr&&o&&Z7(t),xo(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zx(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=gne(r),e=Bs(r,e),i){case 0:t=J6(null,t,r,e,n);break e;case 1:t=EM(null,t,r,e,n);break e;case 11:t=_M(null,t,r,e,n);break e;case 14:t=kM(null,t,r,Bs(r.type,e),n);break e}throw Error(ze(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bs(r,i),J6(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bs(r,i),EM(e,t,r,i,n);case 3:e:{if(O$(t),e===null)throw Error(ze(387));r=t.pendingProps,o=t.memoizedState,i=o.element,n$(e,t),DS(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=zm(Error(ze(423)),t),t=PM(e,t,r,n,i);break e}else if(r!==i){i=zm(Error(ze(424)),t),t=PM(e,t,r,n,i);break e}else for(ka=Od(t.stateNode.containerInfo.firstChild),Pa=t,yr=!0,Ws=null,n=a$(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($m(),r===i){t=tc(e,t,n);break e}xo(e,t,r,n)}t=t.child}return t;case 5:return s$(t),e===null&&K6(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,W6(r,i)?a=null:o!==null&&W6(r,o)&&(t.flags|=32),A$(e,t),xo(e,t,a,n),t.child;case 6:return e===null&&K6(t),null;case 13:return R$(e,t,n);case 4:return o9(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fm(t,null,r,n):xo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bs(r,i),_M(e,t,r,i,n);case 7:return xo(e,t,t.pendingProps,n),t.child;case 8:return xo(e,t,t.pendingProps.children,n),t.child;case 12:return xo(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,nr(RS,r._currentValue),r._currentValue=a,o!==null)if(Zs(o.value,a)){if(o.children===i.children&&!Ko.current){t=tc(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Wu(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Y6(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(ze(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Y6(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}xo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,mm(t,n),i=os(i),r=r(i),t.flags|=1,xo(e,t,r,n),t.child;case 14:return r=t.type,i=Bs(r,t.pendingProps),i=Bs(r.type,i),kM(e,t,r,i,n);case 15:return M$(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bs(r,i),zx(e,t),t.tag=1,Yo(r)?(e=!0,LS(t)):e=!1,mm(t,n),i$(t,r,i),Z6(t,r,i,n),e_(null,t,r,!0,e,n);case 19:return I$(e,t,n);case 22:return L$(e,t,n)}throw Error(ze(156,t.tag))};function X$(e,t){return wN(e,t)}function pne(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function es(e,t,n,r){return new pne(e,t,n,r)}function x9(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gne(e){if(typeof e=="function")return x9(e)?1:0;if(e!=null){if(e=e.$$typeof,e===F7)return 11;if(e===B7)return 14}return 2}function jd(e,t){var n=e.alternate;return n===null?(n=es(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ux(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")x9(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case zg:return Lh(n.children,i,o,t);case $7:a=8,i|=8;break;case S6:return e=es(12,n,t,i|2),e.elementType=S6,e.lanes=o,e;case w6:return e=es(13,n,t,i),e.elementType=w6,e.lanes=o,e;case C6:return e=es(19,n,t,i),e.elementType=C6,e.lanes=o,e;case oN:return vw(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rN:a=10;break e;case iN:a=9;break e;case F7:a=11;break e;case B7:a=14;break e;case hd:a=16,r=null;break e}throw Error(ze(130,e==null?e:typeof e,""))}return t=es(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Lh(e,t,n,r){return e=es(7,e,r,t),e.lanes=n,e}function vw(e,t,n,r){return e=es(22,e,r,t),e.elementType=oN,e.lanes=n,e.stateNode={isHidden:!1},e}function R5(e,t,n){return e=es(6,e,null,t),e.lanes=n,e}function I5(e,t,n){return t=es(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function mne(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=p5(0),this.expirationTimes=p5(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=p5(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function S9(e,t,n,r,i,o,a,s,l){return e=new mne(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=es(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},i9(o),e}function vne(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Ia})(yee);const Rb=C7(Xs);var[eF,wne]=Pn({strict:!1,name:"PortalContext"}),k9="chakra-portal",Cne=".chakra-portal",_ne=e=>g.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),kne=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=S.useState(null),o=S.useRef(null),[,a]=S.useState({});S.useEffect(()=>a({}),[]);const s=wne(),l=vee();Vl(()=>{if(!r)return;const d=r.ownerDocument,p=t?s??d.body:d.body;if(!p)return;o.current=d.createElement("div"),o.current.className=k9,p.appendChild(o.current),a({});const m=o.current;return()=>{p.contains(m)&&p.removeChild(m)}},[r]);const u=l!=null&&l.zIndex?g.jsx(_ne,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return o.current?Xs.createPortal(g.jsx(eF,{value:o.current,children:u}),o.current):g.jsx("span",{ref:d=>{d&&i(d)}})},Ene=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=S.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=k9),l},[i]),[,s]=S.useState({});return Vl(()=>s({}),[]),Vl(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?Xs.createPortal(g.jsx(eF,{value:r?a:null,children:t}),a):null};function u0(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?g.jsx(Ene,{containerRef:n,...r}):g.jsx(kne,{...r})}u0.className=k9;u0.selector=Cne;u0.displayName="Portal";function Qy(){const e=S.useContext(ny);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}var E9=S.createContext({});E9.displayName="ColorModeContext";function Jy(){const e=S.useContext(E9);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var Ib={light:"chakra-ui-light",dark:"chakra-ui-dark"};function Pne(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i==null||i()},setClassName(r){document.body.classList.add(r?Ib.dark:Ib.light),document.body.classList.remove(r?Ib.light:Ib.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var i;return((i=n.query().matches)!=null?i:r==="dark")?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var Tne="chakra-ui-color-mode";function Mne(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var Lne=Mne(Tne),FM=()=>{};function BM(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function tF(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=Lne}=e,s=i==="dark"?"dark":"light",[l,u]=S.useState(()=>BM(a,s)),[d,p]=S.useState(()=>BM(a)),{getSystemTheme:m,setClassName:y,setDataset:b,addListener:w}=S.useMemo(()=>Pne({preventTransition:o}),[o]),E=i==="system"&&!l?d:l,_=S.useCallback(L=>{const O=L==="system"?m():L;u(O),y(O==="dark"),b(O),a.set(O)},[a,m,y,b]);Vl(()=>{i==="system"&&p(m())},[]),S.useEffect(()=>{const L=a.get();if(L){_(L);return}if(i==="system"){_("system");return}_(s)},[a,s,i,_]);const k=S.useCallback(()=>{_(E==="dark"?"light":"dark")},[E,_]);S.useEffect(()=>{if(r)return w(_)},[r,w,_]);const T=S.useMemo(()=>({colorMode:t??E,toggleColorMode:t?FM:k,setColorMode:t?FM:_,forced:t!==void 0}),[E,k,_,t]);return g.jsx(E9.Provider,{value:T,children:n})}tF.displayName="ColorModeProvider";function nF(){const e=Jy(),t=Qy();return{...e,theme:t}}var xt=(...e)=>e.filter(Boolean).join(" ");function Ane(){return!1}function ko(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var e2=e=>{const{condition:t,message:n}=e;t&&Ane()&&console.warn(n)};function ts(e,...t){return One(e)?e(...t):e}var One=e=>typeof e=="function",Bt=e=>e?"":void 0,Uu=e=>e?!0:void 0;function ht(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function ww(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var US={},Rne={get exports(){return US},set exports(e){US=e}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",p="[object Date]",m="[object Error]",y="[object Function]",b="[object GeneratorFunction]",w="[object Map]",E="[object Number]",_="[object Null]",k="[object Object]",T="[object Proxy]",L="[object RegExp]",O="[object Set]",D="[object String]",I="[object Undefined]",N="[object WeakMap]",U="[object ArrayBuffer]",B="[object DataView]",K="[object Float32Array]",ne="[object Float64Array]",z="[object Int8Array]",$="[object Int16Array]",H="[object Int32Array]",Y="[object Uint8Array]",Q="[object Uint8ClampedArray]",q="[object Uint16Array]",X="[object Uint32Array]",ee=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,ke=/^(?:0|[1-9]\d*)$/,we={};we[K]=we[ne]=we[z]=we[$]=we[H]=we[Y]=we[Q]=we[q]=we[X]=!0,we[s]=we[l]=we[U]=we[d]=we[B]=we[p]=we[m]=we[y]=we[w]=we[E]=we[k]=we[L]=we[O]=we[D]=we[N]=!1;var xe=typeof So=="object"&&So&&So.Object===Object&&So,Le=typeof self=="object"&&self&&self.Object===Object&&self,Se=xe||Le||Function("return this")(),Qe=t&&!t.nodeType&&t,Xe=Qe&&!0&&e&&!e.nodeType&&e,tt=Xe&&Xe.exports===Qe,yt=tt&&xe.process,Be=function(){try{var G=Xe&&Xe.require&&Xe.require("util").types;return G||yt&&yt.binding&&yt.binding("util")}catch{}}(),Ae=Be&&Be.isTypedArray;function bt(G,re,pe){switch(pe.length){case 0:return G.call(re);case 1:return G.call(re,pe[0]);case 2:return G.call(re,pe[0],pe[1]);case 3:return G.call(re,pe[0],pe[1],pe[2])}return G.apply(re,pe)}function Fe(G,re){for(var pe=-1,ot=Array(G);++pe-1}function E0(G,re){var pe=this.__data__,ot=xs(pe,G);return ot<0?(++this.size,pe.push([G,re])):pe[ot][1]=re,this}na.prototype.clear=mf,na.prototype.delete=k0,na.prototype.get=xc,na.prototype.has=vf,na.prototype.set=E0;function nl(G){var re=-1,pe=G==null?0:G.length;for(this.clear();++re1?pe[Ht-1]:void 0,St=Ht>2?pe[2]:void 0;for(mn=G.length>3&&typeof mn=="function"?(Ht--,mn):void 0,St&&Pp(pe[0],pe[1],St)&&(mn=Ht<3?void 0:mn,Ht=1),re=Object(re);++ot-1&&G%1==0&&G0){if(++re>=i)return arguments[0]}else re=0;return G.apply(void 0,arguments)}}function kc(G){if(G!=null){try{return He.call(G)}catch{}try{return G+""}catch{}}return""}function $a(G,re){return G===re||G!==G&&re!==re}var wf=pu(function(){return arguments}())?pu:function(G){return Xn(G)&&Ue.call(G,"callee")&&!zr.call(G,"callee")},vu=Array.isArray;function Gt(G){return G!=null&&Mp(G.length)&&!Pc(G)}function Tp(G){return Xn(G)&&Gt(G)}var Ec=vs||F0;function Pc(G){if(!aa(G))return!1;var re=il(G);return re==y||re==b||re==u||re==T}function Mp(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=a}function aa(G){var re=typeof G;return G!=null&&(re=="object"||re=="function")}function Xn(G){return G!=null&&typeof G=="object"}function Cf(G){if(!Xn(G)||il(G)!=k)return!1;var re=qe(G);if(re===null)return!0;var pe=Ue.call(re,"constructor")&&re.constructor;return typeof pe=="function"&&pe instanceof pe&&He.call(pe)==vt}var Lp=Ae?at(Ae):wc;function _f(G){return ci(G,Ap(G))}function Ap(G){return Gt(G)?j0(G,!0):ol(G)}var cn=Ss(function(G,re,pe,ot){ra(G,re,pe,ot)});function qt(G){return function(){return G}}function Op(G){return G}function F0(){return!1}e.exports=cn})(Rne,US);const Bl=US;var Ine=e=>/!(important)?$/.test(e),zM=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,Dne=(e,t)=>n=>{const r=String(t),i=Ine(r),o=zM(r),a=e?`${e}.${o}`:o;let s=ko(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=zM(s),i?`${s} !important`:s};function P9(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{var s;const l=Dne(t,o)(a);let u=(s=n==null?void 0:n(l,a))!=null?s:l;return r&&(u=r(u,a)),u}}var Db=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Ds(e,t){return n=>{const r={property:n,scale:e};return r.transform=P9({scale:e,transform:t}),r}}var jne=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function Nne(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:jne(t),transform:n?P9({scale:n,compose:r}):r}}var rF=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function $ne(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...rF].join(" ")}function Fne(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...rF].join(" ")}var Bne={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},zne={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function Hne(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var Wne={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},f_={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},Une=new Set(Object.values(f_)),iF=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Vne=e=>e.trim();function Gne(e,t){if(e==null||iF.has(e))return e;const r=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=r==null?void 0:r[1],o=r==null?void 0:r[2];if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(Vne).filter(Boolean);if((l==null?void 0:l.length)===0)return e;const u=s in f_?f_[s]:s;l.unshift(u);const d=l.map(p=>{if(Une.has(p))return p;const m=p.indexOf(" "),[y,b]=m!==-1?[p.substr(0,m),p.substr(m+1)]:[p],w=oF(b)?b:b&&b.split(" "),E=`colors.${y}`,_=E in t.__cssMap?t.__cssMap[E].varRef:y;return w?[_,...Array.isArray(w)?w:[w]].join(" "):_});return`${a}(${d.join(", ")})`}var oF=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),qne=(e,t)=>Gne(e,t??{});function Kne(e){return/^var\(--.+\)$/.test(e)}var Yne=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Pl=e=>t=>`${e}(${t})`,ln={filter(e){return e!=="auto"?e:Bne},backdropFilter(e){return e!=="auto"?e:zne},ring(e){return Hne(ln.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?$ne():e==="auto-gpu"?Fne():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=Yne(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(Kne(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:qne,blur:Pl("blur"),opacity:Pl("opacity"),brightness:Pl("brightness"),contrast:Pl("contrast"),dropShadow:Pl("drop-shadow"),grayscale:Pl("grayscale"),hueRotate:Pl("hue-rotate"),invert:Pl("invert"),saturate:Pl("saturate"),sepia:Pl("sepia"),bgImage(e){return e==null||oF(e)||iF.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=Wne[e])!=null?t:{},i={flexDirection:e};return n&&(i[n]=1),r&&(i[r]=1),i}},oe={borderWidths:Ds("borderWidths"),borderStyles:Ds("borderStyles"),colors:Ds("colors"),borders:Ds("borders"),radii:Ds("radii",ln.px),space:Ds("space",Db(ln.vh,ln.px)),spaceT:Ds("space",Db(ln.vh,ln.px)),degreeT(e){return{property:e,transform:ln.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:P9({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Ds("sizes",Db(ln.vh,ln.px)),sizesT:Ds("sizes",Db(ln.vh,ln.fraction)),shadows:Ds("shadows"),logical:Nne,blur:Ds("blur",ln.blur)},Vx={background:oe.colors("background"),backgroundColor:oe.colors("backgroundColor"),backgroundImage:oe.propT("backgroundImage",ln.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:ln.bgClip},bgSize:oe.prop("backgroundSize"),bgPosition:oe.prop("backgroundPosition"),bg:oe.colors("background"),bgColor:oe.colors("backgroundColor"),bgPos:oe.prop("backgroundPosition"),bgRepeat:oe.prop("backgroundRepeat"),bgAttachment:oe.prop("backgroundAttachment"),bgGradient:oe.propT("backgroundImage",ln.gradient),bgClip:{transform:ln.bgClip}};Object.assign(Vx,{bgImage:Vx.backgroundImage,bgImg:Vx.backgroundImage});var yn={border:oe.borders("border"),borderWidth:oe.borderWidths("borderWidth"),borderStyle:oe.borderStyles("borderStyle"),borderColor:oe.colors("borderColor"),borderRadius:oe.radii("borderRadius"),borderTop:oe.borders("borderTop"),borderBlockStart:oe.borders("borderBlockStart"),borderTopLeftRadius:oe.radii("borderTopLeftRadius"),borderStartStartRadius:oe.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:oe.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:oe.radii("borderTopRightRadius"),borderStartEndRadius:oe.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:oe.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:oe.borders("borderRight"),borderInlineEnd:oe.borders("borderInlineEnd"),borderBottom:oe.borders("borderBottom"),borderBlockEnd:oe.borders("borderBlockEnd"),borderBottomLeftRadius:oe.radii("borderBottomLeftRadius"),borderBottomRightRadius:oe.radii("borderBottomRightRadius"),borderLeft:oe.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:oe.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:oe.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:oe.borders(["borderLeft","borderRight"]),borderInline:oe.borders("borderInline"),borderY:oe.borders(["borderTop","borderBottom"]),borderBlock:oe.borders("borderBlock"),borderTopWidth:oe.borderWidths("borderTopWidth"),borderBlockStartWidth:oe.borderWidths("borderBlockStartWidth"),borderTopColor:oe.colors("borderTopColor"),borderBlockStartColor:oe.colors("borderBlockStartColor"),borderTopStyle:oe.borderStyles("borderTopStyle"),borderBlockStartStyle:oe.borderStyles("borderBlockStartStyle"),borderBottomWidth:oe.borderWidths("borderBottomWidth"),borderBlockEndWidth:oe.borderWidths("borderBlockEndWidth"),borderBottomColor:oe.colors("borderBottomColor"),borderBlockEndColor:oe.colors("borderBlockEndColor"),borderBottomStyle:oe.borderStyles("borderBottomStyle"),borderBlockEndStyle:oe.borderStyles("borderBlockEndStyle"),borderLeftWidth:oe.borderWidths("borderLeftWidth"),borderInlineStartWidth:oe.borderWidths("borderInlineStartWidth"),borderLeftColor:oe.colors("borderLeftColor"),borderInlineStartColor:oe.colors("borderInlineStartColor"),borderLeftStyle:oe.borderStyles("borderLeftStyle"),borderInlineStartStyle:oe.borderStyles("borderInlineStartStyle"),borderRightWidth:oe.borderWidths("borderRightWidth"),borderInlineEndWidth:oe.borderWidths("borderInlineEndWidth"),borderRightColor:oe.colors("borderRightColor"),borderInlineEndColor:oe.colors("borderInlineEndColor"),borderRightStyle:oe.borderStyles("borderRightStyle"),borderInlineEndStyle:oe.borderStyles("borderInlineEndStyle"),borderTopRadius:oe.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:oe.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:oe.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:oe.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(yn,{rounded:yn.borderRadius,roundedTop:yn.borderTopRadius,roundedTopLeft:yn.borderTopLeftRadius,roundedTopRight:yn.borderTopRightRadius,roundedTopStart:yn.borderStartStartRadius,roundedTopEnd:yn.borderStartEndRadius,roundedBottom:yn.borderBottomRadius,roundedBottomLeft:yn.borderBottomLeftRadius,roundedBottomRight:yn.borderBottomRightRadius,roundedBottomStart:yn.borderEndStartRadius,roundedBottomEnd:yn.borderEndEndRadius,roundedLeft:yn.borderLeftRadius,roundedRight:yn.borderRightRadius,roundedStart:yn.borderInlineStartRadius,roundedEnd:yn.borderInlineEndRadius,borderStart:yn.borderInlineStart,borderEnd:yn.borderInlineEnd,borderTopStartRadius:yn.borderStartStartRadius,borderTopEndRadius:yn.borderStartEndRadius,borderBottomStartRadius:yn.borderEndStartRadius,borderBottomEndRadius:yn.borderEndEndRadius,borderStartRadius:yn.borderInlineStartRadius,borderEndRadius:yn.borderInlineEndRadius,borderStartWidth:yn.borderInlineStartWidth,borderEndWidth:yn.borderInlineEndWidth,borderStartColor:yn.borderInlineStartColor,borderEndColor:yn.borderInlineEndColor,borderStartStyle:yn.borderInlineStartStyle,borderEndStyle:yn.borderInlineEndStyle});var Xne={color:oe.colors("color"),textColor:oe.colors("color"),fill:oe.colors("fill"),stroke:oe.colors("stroke")},h_={boxShadow:oe.shadows("boxShadow"),mixBlendMode:!0,blendMode:oe.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:oe.prop("backgroundBlendMode"),opacity:!0};Object.assign(h_,{shadow:h_.boxShadow});var Zne={filter:{transform:ln.filter},blur:oe.blur("--chakra-blur"),brightness:oe.propT("--chakra-brightness",ln.brightness),contrast:oe.propT("--chakra-contrast",ln.contrast),hueRotate:oe.degreeT("--chakra-hue-rotate"),invert:oe.propT("--chakra-invert",ln.invert),saturate:oe.propT("--chakra-saturate",ln.saturate),dropShadow:oe.propT("--chakra-drop-shadow",ln.dropShadow),backdropFilter:{transform:ln.backdropFilter},backdropBlur:oe.blur("--chakra-backdrop-blur"),backdropBrightness:oe.propT("--chakra-backdrop-brightness",ln.brightness),backdropContrast:oe.propT("--chakra-backdrop-contrast",ln.contrast),backdropHueRotate:oe.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:oe.propT("--chakra-backdrop-invert",ln.invert),backdropSaturate:oe.propT("--chakra-backdrop-saturate",ln.saturate)},VS={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:ln.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:oe.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:oe.space("gap"),rowGap:oe.space("rowGap"),columnGap:oe.space("columnGap")};Object.assign(VS,{flexDir:VS.flexDirection});var aF={gridGap:oe.space("gridGap"),gridColumnGap:oe.space("gridColumnGap"),gridRowGap:oe.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},Qne={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:ln.outline},outlineOffset:!0,outlineColor:oe.colors("outlineColor")},Ka={width:oe.sizesT("width"),inlineSize:oe.sizesT("inlineSize"),height:oe.sizes("height"),blockSize:oe.sizes("blockSize"),boxSize:oe.sizes(["width","height"]),minWidth:oe.sizes("minWidth"),minInlineSize:oe.sizes("minInlineSize"),minHeight:oe.sizes("minHeight"),minBlockSize:oe.sizes("minBlockSize"),maxWidth:oe.sizes("maxWidth"),maxInlineSize:oe.sizes("maxInlineSize"),maxHeight:oe.sizes("maxHeight"),maxBlockSize:oe.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minWQuery)!=null?i:`@media screen and (min-width: ${e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.maxWQuery)!=null?i:`@media screen and (max-width: ${e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:oe.propT("float",ln.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Ka,{w:Ka.width,h:Ka.height,minW:Ka.minWidth,maxW:Ka.maxWidth,minH:Ka.minHeight,maxH:Ka.maxHeight,overscroll:Ka.overscrollBehavior,overscrollX:Ka.overscrollBehaviorX,overscrollY:Ka.overscrollBehaviorY});var Jne={listStyleType:!0,listStylePosition:!0,listStylePos:oe.prop("listStylePosition"),listStyleImage:!0,listStyleImg:oe.prop("listStyleImage")};function ere(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},nre=tre(ere),rre={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},ire={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},D5=(e,t,n)=>{const r={},i=nre(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},ore={srOnly:{transform(e){return e===!0?rre:e==="focusable"?ire:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>D5(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>D5(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>D5(t,e,n)}},A1={position:!0,pos:oe.prop("position"),zIndex:oe.prop("zIndex","zIndices"),inset:oe.spaceT("inset"),insetX:oe.spaceT(["left","right"]),insetInline:oe.spaceT("insetInline"),insetY:oe.spaceT(["top","bottom"]),insetBlock:oe.spaceT("insetBlock"),top:oe.spaceT("top"),insetBlockStart:oe.spaceT("insetBlockStart"),bottom:oe.spaceT("bottom"),insetBlockEnd:oe.spaceT("insetBlockEnd"),left:oe.spaceT("left"),insetInlineStart:oe.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:oe.spaceT("right"),insetInlineEnd:oe.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(A1,{insetStart:A1.insetInlineStart,insetEnd:A1.insetInlineEnd});var are={ring:{transform:ln.ring},ringColor:oe.colors("--chakra-ring-color"),ringOffset:oe.prop("--chakra-ring-offset-width"),ringOffsetColor:oe.colors("--chakra-ring-offset-color"),ringInset:oe.prop("--chakra-ring-inset")},or={margin:oe.spaceT("margin"),marginTop:oe.spaceT("marginTop"),marginBlockStart:oe.spaceT("marginBlockStart"),marginRight:oe.spaceT("marginRight"),marginInlineEnd:oe.spaceT("marginInlineEnd"),marginBottom:oe.spaceT("marginBottom"),marginBlockEnd:oe.spaceT("marginBlockEnd"),marginLeft:oe.spaceT("marginLeft"),marginInlineStart:oe.spaceT("marginInlineStart"),marginX:oe.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:oe.spaceT("marginInline"),marginY:oe.spaceT(["marginTop","marginBottom"]),marginBlock:oe.spaceT("marginBlock"),padding:oe.space("padding"),paddingTop:oe.space("paddingTop"),paddingBlockStart:oe.space("paddingBlockStart"),paddingRight:oe.space("paddingRight"),paddingBottom:oe.space("paddingBottom"),paddingBlockEnd:oe.space("paddingBlockEnd"),paddingLeft:oe.space("paddingLeft"),paddingInlineStart:oe.space("paddingInlineStart"),paddingInlineEnd:oe.space("paddingInlineEnd"),paddingX:oe.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:oe.space("paddingInline"),paddingY:oe.space(["paddingTop","paddingBottom"]),paddingBlock:oe.space("paddingBlock")};Object.assign(or,{m:or.margin,mt:or.marginTop,mr:or.marginRight,me:or.marginInlineEnd,marginEnd:or.marginInlineEnd,mb:or.marginBottom,ml:or.marginLeft,ms:or.marginInlineStart,marginStart:or.marginInlineStart,mx:or.marginX,my:or.marginY,p:or.padding,pt:or.paddingTop,py:or.paddingY,px:or.paddingX,pb:or.paddingBottom,pl:or.paddingLeft,ps:or.paddingInlineStart,paddingStart:or.paddingInlineStart,pr:or.paddingRight,pe:or.paddingInlineEnd,paddingEnd:or.paddingInlineEnd});var sre={textDecorationColor:oe.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:oe.shadows("textShadow")},lre={clipPath:!0,transform:oe.propT("transform",ln.transform),transformOrigin:!0,translateX:oe.spaceT("--chakra-translate-x"),translateY:oe.spaceT("--chakra-translate-y"),skewX:oe.degreeT("--chakra-skew-x"),skewY:oe.degreeT("--chakra-skew-y"),scaleX:oe.prop("--chakra-scale-x"),scaleY:oe.prop("--chakra-scale-y"),scale:oe.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:oe.degreeT("--chakra-rotate")},ure={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:oe.prop("transitionDuration","transition.duration"),transitionProperty:oe.prop("transitionProperty","transition.property"),transitionTimingFunction:oe.prop("transitionTimingFunction","transition.easing")},cre={fontFamily:oe.prop("fontFamily","fonts"),fontSize:oe.prop("fontSize","fontSizes",ln.px),fontWeight:oe.prop("fontWeight","fontWeights"),lineHeight:oe.prop("lineHeight","lineHeights"),letterSpacing:oe.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},dre={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:oe.spaceT("scrollMargin"),scrollMarginTop:oe.spaceT("scrollMarginTop"),scrollMarginBottom:oe.spaceT("scrollMarginBottom"),scrollMarginLeft:oe.spaceT("scrollMarginLeft"),scrollMarginRight:oe.spaceT("scrollMarginRight"),scrollMarginX:oe.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:oe.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:oe.spaceT("scrollPadding"),scrollPaddingTop:oe.spaceT("scrollPaddingTop"),scrollPaddingBottom:oe.spaceT("scrollPaddingBottom"),scrollPaddingLeft:oe.spaceT("scrollPaddingLeft"),scrollPaddingRight:oe.spaceT("scrollPaddingRight"),scrollPaddingX:oe.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:oe.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function sF(e){return ko(e)&&e.reference?e.reference:String(e)}var Cw=(e,...t)=>t.map(sF).join(` ${e} `).replace(/calc/g,""),HM=(...e)=>`calc(${Cw("+",...e)})`,WM=(...e)=>`calc(${Cw("-",...e)})`,p_=(...e)=>`calc(${Cw("*",...e)})`,UM=(...e)=>`calc(${Cw("/",...e)})`,VM=e=>{const t=sF(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:p_(t,-1)},bh=Object.assign(e=>({add:(...t)=>bh(HM(e,...t)),subtract:(...t)=>bh(WM(e,...t)),multiply:(...t)=>bh(p_(e,...t)),divide:(...t)=>bh(UM(e,...t)),negate:()=>bh(VM(e)),toString:()=>e.toString()}),{add:HM,subtract:WM,multiply:p_,divide:UM,negate:VM});function fre(e,t="-"){return e.replace(/\s+/g,t)}function hre(e){const t=fre(e.toString());return gre(pre(t))}function pre(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function gre(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function mre(e,t=""){return[t,e].filter(Boolean).join("-")}function vre(e,t){return`var(${e}${t?`, ${t}`:""})`}function yre(e,t=""){return hre(`--${mre(e,t)}`)}function gn(e,t,n){const r=yre(e,n);return{variable:r,reference:vre(r,t)}}function bre(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function xre(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function g_(e){if(e==null)return e;const{unitless:t}=xre(e);return t||typeof e=="number"?`${e}px`:e}var lF=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,T9=e=>Object.fromEntries(Object.entries(e).sort(lF));function GM(e){const t=T9(e);return Object.assign(Object.values(t),t)}function Sre(e){const t=Object.keys(T9(e));return new Set(t)}function qM(e){var t;if(!e)return e;e=(t=g_(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function s1(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${g_(e)})`),t&&n.push("and",`(max-width: ${g_(t)})`),n.join(" ")}function wre(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=GM(e),r=Object.entries(e).sort(lF).map(([a,s],l,u)=>{var d;let[,p]=(d=u[l+1])!=null?d:[];return p=parseFloat(p)>0?qM(p):void 0,{_minW:qM(s),breakpoint:a,minW:s,maxW:p,maxWQuery:s1(null,p),minWQuery:s1(s),minMaxQuery:s1(s,p)}}),i=Sre(e),o=Array.from(i.values());return{keys:i,normalized:n,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>i.has(l))},asObject:T9(e),asArray:GM(e),details:r,get(a){return r.find(s=>s.breakpoint===a)},media:[null,...n.map(a=>s1(a)).slice(1)],toArrayValue(a){if(!ko(a))throw new Error("toArrayValue: value must be an object");const s=o.map(l=>{var u;return(u=a[l])!=null?u:null});for(;bre(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const d=o[u];return d!=null&&l!=null&&(s[d]=l),s},{})}}}var zi={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},ad=e=>uF(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Au=e=>uF(t=>e(t,"~ &"),"[data-peer]",".peer"),uF=(e,...t)=>t.map(e).join(", "),_w={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:ad(zi.hover),_peerHover:Au(zi.hover),_groupFocus:ad(zi.focus),_peerFocus:Au(zi.focus),_groupFocusVisible:ad(zi.focusVisible),_peerFocusVisible:Au(zi.focusVisible),_groupActive:ad(zi.active),_peerActive:Au(zi.active),_groupDisabled:ad(zi.disabled),_peerDisabled:Au(zi.disabled),_groupInvalid:ad(zi.invalid),_peerInvalid:Au(zi.invalid),_groupChecked:ad(zi.checked),_peerChecked:Au(zi.checked),_groupFocusWithin:ad(zi.focusWithin),_peerFocusWithin:Au(zi.focusWithin),_peerPlaceholderShown:Au(zi.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},Cre=Object.keys(_w);function KM(e,t){return gn(String(e).replace(/\./g,"-"),void 0,t)}function _re(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=KM(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const m=i.split("."),[y,...b]=m,w=`${y}.-${b.join(".")}`,E=bh.negate(s),_=bh.negate(u);r[w]={value:E,var:l,varRef:_}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const d=m=>{const b=[String(i).split(".")[0],m].join(".");if(!e[b])return m;const{reference:E}=KM(b,t==null?void 0:t.cssVarPrefix);return E},p=ko(s)?s:{default:s};n=Bl(n,Object.entries(p).reduce((m,[y,b])=>{var w,E;const _=d(b);if(y==="default")return m[l]=_,m;const k=(E=(w=_w)==null?void 0:w[y])!=null?E:y;return m[k]={[l]:_},m},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function kre(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Ere(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var Pre=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function Tre(e){return Ere(e,Pre)}function Mre(e){return e.semanticTokens}function Lre(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function Are({tokens:e,semanticTokens:t}){var n,r;const i=Object.entries((n=m_(e))!=null?n:{}).map(([a,s])=>[a,{isSemantic:!1,value:s}]),o=Object.entries((r=m_(t,1))!=null?r:{}).map(([a,s])=>[a,{isSemantic:!0,value:s}]);return Object.fromEntries([...i,...o])}function m_(e,t=1/0){return!ko(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(ko(i)||Array.isArray(i)?Object.entries(m_(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function Ore(e){var t;const n=Lre(e),r=Tre(n),i=Mre(n),o=Are({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=_re(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:wre(n.breakpoints)}),n}var M9=Bl({},Vx,yn,Xne,VS,Ka,Zne,are,Qne,aF,ore,A1,h_,or,dre,cre,sre,lre,Jne,ure),Rre=Object.assign({},or,Ka,VS,aF,A1),cF=Object.keys(Rre),Ire=[...Object.keys(M9),...Cre],Dre={...M9,..._w},jre=e=>e in Dre,Nre=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=ts(e[a],t);if(s==null)continue;if(s=ko(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!Fre(t),zre=(e,t)=>{var n,r;if(t==null)return t;const i=l=>{var u,d;return(d=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:d.varRef},o=l=>{var u;return(u=i(l))!=null?u:l},[a,s]=$re(t);return t=(r=(n=i(a))!=null?n:o(s))!=null?r:o(t),t};function Hre(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s,l,u;const d=ts(o,r),p=Nre(d)(r);let m={};for(let y in p){const b=p[y];let w=ts(b,r);y in n&&(y=n[y]),Bre(y,w)&&(w=zre(r,w));let E=t[y];if(E===!0&&(E={property:y}),ko(w)){m[y]=(s=m[y])!=null?s:{},m[y]=Bl({},m[y],i(w,!0));continue}let _=(u=(l=E==null?void 0:E.transform)==null?void 0:l.call(E,w,r,d))!=null?u:w;_=E!=null&&E.processResult?i(_,!0):_;const k=ts(E==null?void 0:E.property,r);if(!a&&(E!=null&&E.static)){const T=ts(E.static,r);m=Bl({},m,T)}if(k&&Array.isArray(k)){for(const T of k)m[T]=_;continue}if(k){k==="&"&&ko(_)?m=Bl({},m,_):m[k]=_;continue}if(ko(_)){m=Bl({},m,_);continue}m[y]=_}return m};return i}var dF=e=>t=>Hre({theme:t,pseudos:_w,configs:M9})(e);function dr(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function Wre(e,t){if(Array.isArray(e))return e;if(ko(e))return t(e);if(e!=null)return[e]}function Ure(e,t){for(let n=t+1;n{Bl(u,{[T]:m?k[T]:{[_]:k[T]}})});continue}if(!y){m?Bl(u,k):u[_]=k;continue}u[_]=k}}return u}}function Gre(e){return t=>{var n;const{variant:r,size:i,theme:o}=t,a=Vre(o);return Bl({},ts((n=e.baseStyle)!=null?n:{},t),a(e,"sizes",i,t),a(e,"variants",r,t))}}function qre(e,t,n){var r,i,o;return(o=(i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)!=null?o:n}function fr(e){return kre(e,["styleConfig","size","variant","colorScheme"])}var Kre={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Yre=Kre,Xre={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Zre=Xre,Qre={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},Jre=Qre,eie={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},tie=eie,nie={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},rie=nie,iie={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},oie={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},aie={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},sie={property:iie,easing:oie,duration:aie},lie=sie,uie={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},cie=uie,die={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},fie=die,hie={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},fF=hie,hF={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},pie={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},gie={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},mie={...hF,...pie,container:gie},pF=mie,vie={breakpoints:Zre,zIndices:Yre,radii:tie,blur:cie,colors:Jre,...fF,sizes:pF,shadows:rie,space:hF,borders:fie,transition:lie};function En(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function i(...d){r();for(const p of d)t[p]=l(p);return En(e,t)}function o(...d){for(const p of d)p in t||(t[p]=l(p));return En(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([p,m])=>[p,m.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([p,m])=>[p,m.className]))}function l(d){const y=`chakra-${(["container","root"].includes(d??"")?[e]:[e,d]).filter(Boolean).join("__")}`;return{className:y,selector:`.${y}`,toString:()=>d}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var yie=En("accordion").parts("root","container","button","panel").extend("icon"),bie=En("alert").parts("title","description","container").extend("icon","spinner"),xie=En("avatar").parts("label","badge","container").extend("excessLabel","group"),Sie=En("breadcrumb").parts("link","item","container").extend("separator");En("button").parts();var wie=En("checkbox").parts("control","icon","container").extend("label");En("progress").parts("track","filledTrack").extend("label");var Cie=En("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),_ie=En("editable").parts("preview","input","textarea"),kie=En("form").parts("container","requiredIndicator","helperText"),Eie=En("formError").parts("text","icon"),Pie=En("input").parts("addon","field","element"),Tie=En("list").parts("container","item","icon"),Mie=En("menu").parts("button","list","item").extend("groupTitle","command","divider"),Lie=En("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Aie=En("numberinput").parts("root","field","stepperGroup","stepper");En("pininput").parts("field");var Oie=En("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Rie=En("progress").parts("label","filledTrack","track"),Iie=En("radio").parts("container","control","label"),Die=En("select").parts("field","icon"),jie=En("slider").parts("container","track","thumb","filledTrack","mark"),Nie=En("stat").parts("container","label","helpText","number","icon"),$ie=En("switch").parts("container","track","thumb"),Fie=En("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),Bie=En("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),zie=En("tag").parts("container","label","closeButton"),Hie=En("card").parts("container","header","body","footer");function kh(e,t,n){return Math.min(Math.max(e,n),t)}class Wie extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var l1=Wie;function L9(e){if(typeof e!="string")throw new l1(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=Zie.test(e)?Gie(e):e;const n=qie.exec(t);if(n){const a=Array.from(n).slice(1);return[...a.slice(0,3).map(s=>parseInt(xy(s,2),16)),parseInt(xy(a[3]||"f",2),16)/255]}const r=Kie.exec(t);if(r){const a=Array.from(r).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,16)),parseInt(a[3]||"ff",16)/255]}const i=Yie.exec(t);if(i){const a=Array.from(i).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,10)),parseFloat(a[3]||"1")]}const o=Xie.exec(t);if(o){const[a,s,l,u]=Array.from(o).slice(1).map(parseFloat);if(kh(0,100,s)!==s)throw new l1(e);if(kh(0,100,l)!==l)throw new l1(e);return[...Qie(a,s,l),Number.isNaN(u)?1:u]}throw new l1(e)}function Uie(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const YM=e=>parseInt(e.replace(/_/g,""),36),Vie="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=YM(t.substring(0,3)),r=YM(t.substring(3)).toString(16);let i="";for(let o=0;o<6-r.length;o++)i+="0";return e[n]=`${i}${r}`,e},{});function Gie(e){const t=e.toLowerCase().trim(),n=Vie[Uie(t)];if(!n)throw new l1(e);return`#${n}`}const xy=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),qie=new RegExp(`^#${xy("([a-f0-9])",3)}([a-f0-9])?$`,"i"),Kie=new RegExp(`^#${xy("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),Yie=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${xy(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),Xie=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,Zie=/^[a-z]+$/i,XM=e=>Math.round(e*255),Qie=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(XM);const i=(e%360+360)%360/60,o=(1-Math.abs(2*r-1))*(t/100),a=o*(1-Math.abs(i%2-1));let s=0,l=0,u=0;i>=0&&i<1?(s=o,l=a):i>=1&&i<2?(s=a,l=o):i>=2&&i<3?(l=o,u=a):i>=3&&i<4?(l=a,u=o):i>=4&&i<5?(s=a,u=o):i>=5&&i<6&&(s=o,u=a);const d=r-o/2,p=s+d,m=l+d,y=u+d;return[p,m,y].map(XM)};function Jie(e,t,n,r){return`rgba(${kh(0,255,e).toFixed()}, ${kh(0,255,t).toFixed()}, ${kh(0,255,n).toFixed()}, ${parseFloat(kh(0,1,r).toFixed(3))})`}function eoe(e,t){const[n,r,i,o]=L9(e);return Jie(n,r,i,o-t)}function toe(e){const[t,n,r,i]=L9(e);let o=a=>{const s=kh(0,255,a).toString(16);return s.length===1?`0${s}`:s};return`#${o(t)}${o(n)}${o(r)}${i<1?o(Math.round(i*255)):""}`}function noe(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,wo=(e,t,n)=>{const r=noe(e,`colors.${t}`,t);try{return toe(r),r}catch{return n??"#000000"}},ioe=e=>{const[t,n,r]=L9(e);return(t*299+n*587+r*114)/1e3},ooe=e=>t=>{const n=wo(t,e);return ioe(n)<128?"dark":"light"},aoe=e=>t=>ooe(e)(t)==="dark",Wm=(e,t)=>n=>{const r=wo(n,e);return eoe(r,1-t)};function ZM(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( 45deg, ${t} 25%, transparent 25%, @@ -353,12 +353,12 @@ Error generating stack: `+o.message+` ${t} 75%, transparent 75%, transparent - )`,backgroundSize:`${e} ${e}`}}var aoe=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function soe(e){const t=aoe();return!e||noe(e)?t:e.string&&e.colors?uoe(e.string,e.colors):e.string&&!e.colors?loe(e.string):e.colors&&!e.string?coe(e.colors):t}function loe(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function uoe(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function A9(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function pF(e){return ko(e)&&e.reference?e.reference:String(e)}var kw=(e,...t)=>t.map(pF).join(` ${e} `).replace(/calc/g,""),ZM=(...e)=>`calc(${kw("+",...e)})`,QM=(...e)=>`calc(${kw("-",...e)})`,v_=(...e)=>`calc(${kw("*",...e)})`,JM=(...e)=>`calc(${kw("/",...e)})`,eL=e=>{const t=pF(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:v_(t,-1)},Nu=Object.assign(e=>({add:(...t)=>Nu(ZM(e,...t)),subtract:(...t)=>Nu(QM(e,...t)),multiply:(...t)=>Nu(v_(e,...t)),divide:(...t)=>Nu(JM(e,...t)),negate:()=>Nu(eL(e)),toString:()=>e.toString()}),{add:ZM,subtract:QM,multiply:v_,divide:JM,negate:eL});function doe(e){return!Number.isInteger(parseFloat(e.toString()))}function foe(e,t="-"){return e.replace(/\s+/g,t)}function gF(e){const t=foe(e.toString());return t.includes("\\.")?e:doe(e)?t.replace(".","\\."):e}function hoe(e,t=""){return[t,gF(e)].filter(Boolean).join("-")}function poe(e,t){return`var(${gF(e)}${t?`, ${t}`:""})`}function goe(e,t=""){return`--${hoe(e,t)}`}function yi(e,t){const n=goe(e,t==null?void 0:t.prefix);return{variable:n,reference:poe(n,moe(t==null?void 0:t.fallback))}}function moe(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:voe,definePartsStyle:Gx}=dr(Nie.keys),O1=yi("switch-track-width"),Ah=yi("switch-track-height"),j5=yi("switch-track-diff"),yoe=Nu.subtract(O1,Ah),y_=yi("switch-thumb-x"),Fv=yi("switch-bg"),boe=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[O1.reference],height:[Ah.reference],transitionProperty:"common",transitionDuration:"fast",[Fv.variable]:"colors.gray.300",_dark:{[Fv.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[Fv.variable]:`colors.${t}.500`,_dark:{[Fv.variable]:`colors.${t}.200`}},bg:Fv.reference}},xoe={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Ah.reference],height:[Ah.reference],_checked:{transform:`translateX(${y_.reference})`}},Soe=Gx(e=>({container:{[j5.variable]:yoe,[y_.variable]:j5.reference,_rtl:{[y_.variable]:Nu(j5).negate().toString()}},track:boe(e),thumb:xoe})),woe={sm:Gx({container:{[O1.variable]:"1.375rem",[Ah.variable]:"sizes.3"}}),md:Gx({container:{[O1.variable]:"1.875rem",[Ah.variable]:"sizes.4"}}),lg:Gx({container:{[O1.variable]:"2.875rem",[Ah.variable]:"sizes.6"}})},Coe=voe({baseStyle:Soe,sizes:woe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:_oe,definePartsStyle:ym}=dr($ie.keys),koe=ym({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),GS={"&[data-is-numeric=true]":{textAlign:"end"}},Eoe=ym(e=>{const{colorScheme:t}=e;return{th:{color:wt("gray.600","gray.400")(e),borderBottom:"1px",borderColor:wt(`${t}.100`,`${t}.700`)(e),...GS},td:{borderBottom:"1px",borderColor:wt(`${t}.100`,`${t}.700`)(e),...GS},caption:{color:wt("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Poe=ym(e=>{const{colorScheme:t}=e;return{th:{color:wt("gray.600","gray.400")(e),borderBottom:"1px",borderColor:wt(`${t}.100`,`${t}.700`)(e),...GS},td:{borderBottom:"1px",borderColor:wt(`${t}.100`,`${t}.700`)(e),...GS},caption:{color:wt("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:wt(`${t}.100`,`${t}.700`)(e)},td:{background:wt(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Toe={simple:Eoe,striped:Poe,unstyled:{}},Moe={sm:ym({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:ym({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:ym({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},Loe=_oe({baseStyle:koe,variants:Toe,sizes:Moe,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Go=gn("tabs-color"),Vs=gn("tabs-bg"),jb=gn("tabs-border-color"),{defineMultiStyleConfig:Aoe,definePartsStyle:Kl}=dr(Fie.keys),Ooe=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},Roe=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},Ioe=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},Doe={p:4},joe=Kl(e=>({root:Ooe(e),tab:Roe(e),tablist:Ioe(e),tabpanel:Doe})),Noe={sm:Kl({tab:{py:1,px:4,fontSize:"sm"}}),md:Kl({tab:{fontSize:"md",py:2,px:4}}),lg:Kl({tab:{fontSize:"lg",py:3,px:4}})},$oe=Kl(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Go.variable]:`colors.${t}.600`,_dark:{[Go.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Vs.variable]:"colors.gray.200",_dark:{[Vs.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Go.reference,bg:Vs.reference}}}),Foe=Kl(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[jb.variable]:"transparent",_selected:{[Go.variable]:`colors.${t}.600`,[jb.variable]:"colors.white",_dark:{[Go.variable]:`colors.${t}.300`,[jb.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:jb.reference},color:Go.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),Boe=Kl(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Vs.variable]:"colors.gray.50",_dark:{[Vs.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Vs.variable]:"colors.white",[Go.variable]:`colors.${t}.600`,_dark:{[Vs.variable]:"colors.gray.800",[Go.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Go.reference,bg:Vs.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),zoe=Kl(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:wo(n,`${t}.700`),bg:wo(n,`${t}.100`)}}}}),Hoe=Kl(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Go.variable]:"colors.gray.600",_dark:{[Go.variable]:"inherit"},_selected:{[Go.variable]:"colors.white",[Vs.variable]:`colors.${t}.600`,_dark:{[Go.variable]:"colors.gray.800",[Vs.variable]:`colors.${t}.300`}},color:Go.reference,bg:Vs.reference}}}),Woe=Kl({}),Voe={line:$oe,enclosed:Foe,"enclosed-colored":Boe,"soft-rounded":zoe,"solid-rounded":Hoe,unstyled:Woe},Uoe=Aoe({baseStyle:joe,sizes:Noe,variants:Voe,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),Goe={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},bm=gn("badge-bg"),zl=gn("badge-color"),qoe=e=>{const{colorScheme:t,theme:n}=e,r=Wm(`${t}.500`,.6)(n);return{[bm.variable]:`colors.${t}.500`,[zl.variable]:"colors.white",_dark:{[bm.variable]:r,[zl.variable]:"colors.whiteAlpha.800"},bg:bm.reference,color:zl.reference}},Koe=e=>{const{colorScheme:t,theme:n}=e,r=Wm(`${t}.200`,.16)(n);return{[bm.variable]:`colors.${t}.100`,[zl.variable]:`colors.${t}.800`,_dark:{[bm.variable]:r,[zl.variable]:`colors.${t}.200`},bg:bm.reference,color:zl.reference}},Yoe=e=>{const{colorScheme:t,theme:n}=e,r=Wm(`${t}.200`,.8)(n);return{[zl.variable]:`colors.${t}.500`,_dark:{[zl.variable]:r},color:zl.reference,boxShadow:`inset 0 0 0px 1px ${zl.reference}`}},Xoe={solid:qoe,subtle:Koe,outline:Yoe},R1={baseStyle:Goe,variants:Xoe,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:Zoe,definePartsStyle:Oh}=dr(Bie.keys),Qoe={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},Joe={lineHeight:1.2,overflow:"visible"},eae={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},tae=Oh({container:Qoe,label:Joe,closeButton:eae}),nae={sm:Oh({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Oh({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:Oh({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},rae={subtle:Oh(e=>{var t;return{container:(t=R1.variants)==null?void 0:t.subtle(e)}}),solid:Oh(e=>{var t;return{container:(t=R1.variants)==null?void 0:t.solid(e)}}),outline:Oh(e=>{var t;return{container:(t=R1.variants)==null?void 0:t.outline(e)}})},iae=Zoe({variants:rae,baseStyle:tae,sizes:nae,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:zu,defineMultiStyleConfig:oae}=dr(Eie.keys),aae=zu({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),sd={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},sae={lg:zu({field:sd.lg,addon:sd.lg}),md:zu({field:sd.md,addon:sd.md}),sm:zu({field:sd.sm,addon:sd.sm}),xs:zu({field:sd.xs,addon:sd.xs})};function O9(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||wt("blue.500","blue.300")(e),errorBorderColor:n||wt("red.500","red.300")(e)}}var lae=zu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=O9(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:wt("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:wo(t,r),boxShadow:`0 0 0 1px ${wo(t,r)}`},_focusVisible:{zIndex:1,borderColor:wo(t,n),boxShadow:`0 0 0 1px ${wo(t,n)}`}},addon:{border:"1px solid",borderColor:wt("inherit","whiteAlpha.50")(e),bg:wt("gray.100","whiteAlpha.300")(e)}}}),uae=zu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=O9(e);return{field:{border:"2px solid",borderColor:"transparent",bg:wt("gray.100","whiteAlpha.50")(e),_hover:{bg:wt("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:wo(t,r)},_focusVisible:{bg:"transparent",borderColor:wo(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:wt("gray.100","whiteAlpha.50")(e)}}}),cae=zu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=O9(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:wo(t,r),boxShadow:`0px 1px 0px 0px ${wo(t,r)}`},_focusVisible:{borderColor:wo(t,n),boxShadow:`0px 1px 0px 0px ${wo(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),dae=zu({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),fae={outline:lae,filled:uae,flushed:cae,unstyled:dae},xn=oae({baseStyle:aae,sizes:sae,variants:fae,defaultProps:{size:"md",variant:"outline"}}),tL,hae={...(tL=xn.baseStyle)==null?void 0:tL.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},nL,rL,pae={outline:e=>{var t,n;return(n=(t=xn.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=xn.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=xn.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(rL=(nL=xn.variants)==null?void 0:nL.unstyled.field)!=null?rL:{}},iL,oL,aL,sL,lL,uL,cL,dL,gae={xs:(oL=(iL=xn.sizes)==null?void 0:iL.xs.field)!=null?oL:{},sm:(sL=(aL=xn.sizes)==null?void 0:aL.sm.field)!=null?sL:{},md:(uL=(lL=xn.sizes)==null?void 0:lL.md.field)!=null?uL:{},lg:(dL=(cL=xn.sizes)==null?void 0:cL.lg.field)!=null?dL:{}},mae={baseStyle:hae,sizes:gae,variants:pae,defaultProps:{size:"md",variant:"outline"}},Nb=yi("tooltip-bg"),N5=yi("tooltip-fg"),vae=yi("popper-arrow-bg"),yae={bg:Nb.reference,color:N5.reference,[Nb.variable]:"colors.gray.700",[N5.variable]:"colors.whiteAlpha.900",_dark:{[Nb.variable]:"colors.gray.300",[N5.variable]:"colors.gray.900"},[vae.variable]:Nb.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},bae={baseStyle:yae},{defineMultiStyleConfig:xae,definePartsStyle:u1}=dr(Oie.keys),Sae=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=wt(XM(),XM("1rem","rgba(0,0,0,0.1)"))(e),a=wt(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( + )`,backgroundSize:`${e} ${e}`}}var soe=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function loe(e){const t=soe();return!e||roe(e)?t:e.string&&e.colors?coe(e.string,e.colors):e.string&&!e.colors?uoe(e.string):e.colors&&!e.string?doe(e.colors):t}function uoe(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function coe(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function A9(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function gF(e){return ko(e)&&e.reference?e.reference:String(e)}var kw=(e,...t)=>t.map(gF).join(` ${e} `).replace(/calc/g,""),QM=(...e)=>`calc(${kw("+",...e)})`,JM=(...e)=>`calc(${kw("-",...e)})`,v_=(...e)=>`calc(${kw("*",...e)})`,eL=(...e)=>`calc(${kw("/",...e)})`,tL=e=>{const t=gF(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:v_(t,-1)},Nu=Object.assign(e=>({add:(...t)=>Nu(QM(e,...t)),subtract:(...t)=>Nu(JM(e,...t)),multiply:(...t)=>Nu(v_(e,...t)),divide:(...t)=>Nu(eL(e,...t)),negate:()=>Nu(tL(e)),toString:()=>e.toString()}),{add:QM,subtract:JM,multiply:v_,divide:eL,negate:tL});function foe(e){return!Number.isInteger(parseFloat(e.toString()))}function hoe(e,t="-"){return e.replace(/\s+/g,t)}function mF(e){const t=hoe(e.toString());return t.includes("\\.")?e:foe(e)?t.replace(".","\\."):e}function poe(e,t=""){return[t,mF(e)].filter(Boolean).join("-")}function goe(e,t){return`var(${mF(e)}${t?`, ${t}`:""})`}function moe(e,t=""){return`--${poe(e,t)}`}function yi(e,t){const n=moe(e,t==null?void 0:t.prefix);return{variable:n,reference:goe(n,voe(t==null?void 0:t.fallback))}}function voe(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:yoe,definePartsStyle:Gx}=dr($ie.keys),O1=yi("switch-track-width"),Ah=yi("switch-track-height"),j5=yi("switch-track-diff"),boe=Nu.subtract(O1,Ah),y_=yi("switch-thumb-x"),Fv=yi("switch-bg"),xoe=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[O1.reference],height:[Ah.reference],transitionProperty:"common",transitionDuration:"fast",[Fv.variable]:"colors.gray.300",_dark:{[Fv.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[Fv.variable]:`colors.${t}.500`,_dark:{[Fv.variable]:`colors.${t}.200`}},bg:Fv.reference}},Soe={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Ah.reference],height:[Ah.reference],_checked:{transform:`translateX(${y_.reference})`}},woe=Gx(e=>({container:{[j5.variable]:boe,[y_.variable]:j5.reference,_rtl:{[y_.variable]:Nu(j5).negate().toString()}},track:xoe(e),thumb:Soe})),Coe={sm:Gx({container:{[O1.variable]:"1.375rem",[Ah.variable]:"sizes.3"}}),md:Gx({container:{[O1.variable]:"1.875rem",[Ah.variable]:"sizes.4"}}),lg:Gx({container:{[O1.variable]:"2.875rem",[Ah.variable]:"sizes.6"}})},_oe=yoe({baseStyle:woe,sizes:Coe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:koe,definePartsStyle:ym}=dr(Fie.keys),Eoe=ym({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),GS={"&[data-is-numeric=true]":{textAlign:"end"}},Poe=ym(e=>{const{colorScheme:t}=e;return{th:{color:wt("gray.600","gray.400")(e),borderBottom:"1px",borderColor:wt(`${t}.100`,`${t}.700`)(e),...GS},td:{borderBottom:"1px",borderColor:wt(`${t}.100`,`${t}.700`)(e),...GS},caption:{color:wt("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Toe=ym(e=>{const{colorScheme:t}=e;return{th:{color:wt("gray.600","gray.400")(e),borderBottom:"1px",borderColor:wt(`${t}.100`,`${t}.700`)(e),...GS},td:{borderBottom:"1px",borderColor:wt(`${t}.100`,`${t}.700`)(e),...GS},caption:{color:wt("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:wt(`${t}.100`,`${t}.700`)(e)},td:{background:wt(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Moe={simple:Poe,striped:Toe,unstyled:{}},Loe={sm:ym({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:ym({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:ym({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},Aoe=koe({baseStyle:Eoe,variants:Moe,sizes:Loe,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Go=gn("tabs-color"),Us=gn("tabs-bg"),jb=gn("tabs-border-color"),{defineMultiStyleConfig:Ooe,definePartsStyle:Kl}=dr(Bie.keys),Roe=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},Ioe=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},Doe=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},joe={p:4},Noe=Kl(e=>({root:Roe(e),tab:Ioe(e),tablist:Doe(e),tabpanel:joe})),$oe={sm:Kl({tab:{py:1,px:4,fontSize:"sm"}}),md:Kl({tab:{fontSize:"md",py:2,px:4}}),lg:Kl({tab:{fontSize:"lg",py:3,px:4}})},Foe=Kl(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Go.variable]:`colors.${t}.600`,_dark:{[Go.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Us.variable]:"colors.gray.200",_dark:{[Us.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Go.reference,bg:Us.reference}}}),Boe=Kl(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[jb.variable]:"transparent",_selected:{[Go.variable]:`colors.${t}.600`,[jb.variable]:"colors.white",_dark:{[Go.variable]:`colors.${t}.300`,[jb.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:jb.reference},color:Go.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),zoe=Kl(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Us.variable]:"colors.gray.50",_dark:{[Us.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Us.variable]:"colors.white",[Go.variable]:`colors.${t}.600`,_dark:{[Us.variable]:"colors.gray.800",[Go.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Go.reference,bg:Us.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),Hoe=Kl(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:wo(n,`${t}.700`),bg:wo(n,`${t}.100`)}}}}),Woe=Kl(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Go.variable]:"colors.gray.600",_dark:{[Go.variable]:"inherit"},_selected:{[Go.variable]:"colors.white",[Us.variable]:`colors.${t}.600`,_dark:{[Go.variable]:"colors.gray.800",[Us.variable]:`colors.${t}.300`}},color:Go.reference,bg:Us.reference}}}),Uoe=Kl({}),Voe={line:Foe,enclosed:Boe,"enclosed-colored":zoe,"soft-rounded":Hoe,"solid-rounded":Woe,unstyled:Uoe},Goe=Ooe({baseStyle:Noe,sizes:$oe,variants:Voe,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),qoe={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},bm=gn("badge-bg"),zl=gn("badge-color"),Koe=e=>{const{colorScheme:t,theme:n}=e,r=Wm(`${t}.500`,.6)(n);return{[bm.variable]:`colors.${t}.500`,[zl.variable]:"colors.white",_dark:{[bm.variable]:r,[zl.variable]:"colors.whiteAlpha.800"},bg:bm.reference,color:zl.reference}},Yoe=e=>{const{colorScheme:t,theme:n}=e,r=Wm(`${t}.200`,.16)(n);return{[bm.variable]:`colors.${t}.100`,[zl.variable]:`colors.${t}.800`,_dark:{[bm.variable]:r,[zl.variable]:`colors.${t}.200`},bg:bm.reference,color:zl.reference}},Xoe=e=>{const{colorScheme:t,theme:n}=e,r=Wm(`${t}.200`,.8)(n);return{[zl.variable]:`colors.${t}.500`,_dark:{[zl.variable]:r},color:zl.reference,boxShadow:`inset 0 0 0px 1px ${zl.reference}`}},Zoe={solid:Koe,subtle:Yoe,outline:Xoe},R1={baseStyle:qoe,variants:Zoe,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:Qoe,definePartsStyle:Oh}=dr(zie.keys),Joe={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},eae={lineHeight:1.2,overflow:"visible"},tae={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},nae=Oh({container:Joe,label:eae,closeButton:tae}),rae={sm:Oh({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Oh({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:Oh({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},iae={subtle:Oh(e=>{var t;return{container:(t=R1.variants)==null?void 0:t.subtle(e)}}),solid:Oh(e=>{var t;return{container:(t=R1.variants)==null?void 0:t.solid(e)}}),outline:Oh(e=>{var t;return{container:(t=R1.variants)==null?void 0:t.outline(e)}})},oae=Qoe({variants:iae,baseStyle:nae,sizes:rae,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:zu,defineMultiStyleConfig:aae}=dr(Pie.keys),sae=zu({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),sd={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},lae={lg:zu({field:sd.lg,addon:sd.lg}),md:zu({field:sd.md,addon:sd.md}),sm:zu({field:sd.sm,addon:sd.sm}),xs:zu({field:sd.xs,addon:sd.xs})};function O9(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||wt("blue.500","blue.300")(e),errorBorderColor:n||wt("red.500","red.300")(e)}}var uae=zu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=O9(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:wt("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:wo(t,r),boxShadow:`0 0 0 1px ${wo(t,r)}`},_focusVisible:{zIndex:1,borderColor:wo(t,n),boxShadow:`0 0 0 1px ${wo(t,n)}`}},addon:{border:"1px solid",borderColor:wt("inherit","whiteAlpha.50")(e),bg:wt("gray.100","whiteAlpha.300")(e)}}}),cae=zu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=O9(e);return{field:{border:"2px solid",borderColor:"transparent",bg:wt("gray.100","whiteAlpha.50")(e),_hover:{bg:wt("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:wo(t,r)},_focusVisible:{bg:"transparent",borderColor:wo(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:wt("gray.100","whiteAlpha.50")(e)}}}),dae=zu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=O9(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:wo(t,r),boxShadow:`0px 1px 0px 0px ${wo(t,r)}`},_focusVisible:{borderColor:wo(t,n),boxShadow:`0px 1px 0px 0px ${wo(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),fae=zu({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),hae={outline:uae,filled:cae,flushed:dae,unstyled:fae},xn=aae({baseStyle:sae,sizes:lae,variants:hae,defaultProps:{size:"md",variant:"outline"}}),nL,pae={...(nL=xn.baseStyle)==null?void 0:nL.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},rL,iL,gae={outline:e=>{var t,n;return(n=(t=xn.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=xn.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=xn.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(iL=(rL=xn.variants)==null?void 0:rL.unstyled.field)!=null?iL:{}},oL,aL,sL,lL,uL,cL,dL,fL,mae={xs:(aL=(oL=xn.sizes)==null?void 0:oL.xs.field)!=null?aL:{},sm:(lL=(sL=xn.sizes)==null?void 0:sL.sm.field)!=null?lL:{},md:(cL=(uL=xn.sizes)==null?void 0:uL.md.field)!=null?cL:{},lg:(fL=(dL=xn.sizes)==null?void 0:dL.lg.field)!=null?fL:{}},vae={baseStyle:pae,sizes:mae,variants:gae,defaultProps:{size:"md",variant:"outline"}},Nb=yi("tooltip-bg"),N5=yi("tooltip-fg"),yae=yi("popper-arrow-bg"),bae={bg:Nb.reference,color:N5.reference,[Nb.variable]:"colors.gray.700",[N5.variable]:"colors.whiteAlpha.900",_dark:{[Nb.variable]:"colors.gray.300",[N5.variable]:"colors.gray.900"},[yae.variable]:Nb.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},xae={baseStyle:bae},{defineMultiStyleConfig:Sae,definePartsStyle:u1}=dr(Rie.keys),wae=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=wt(ZM(),ZM("1rem","rgba(0,0,0,0.1)"))(e),a=wt(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( to right, transparent 0%, ${wo(n,a)} 50%, transparent 100% - )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},wae={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Cae=e=>({bg:wt("gray.100","whiteAlpha.300")(e)}),_ae=e=>({transitionProperty:"common",transitionDuration:"slow",...Sae(e)}),kae=u1(e=>({label:wae,filledTrack:_ae(e),track:Cae(e)})),Eae={xs:u1({track:{h:"1"}}),sm:u1({track:{h:"2"}}),md:u1({track:{h:"3"}}),lg:u1({track:{h:"4"}})},Pae=xae({sizes:Eae,baseStyle:kae,defaultProps:{size:"md",colorScheme:"blue"}}),Tae=e=>typeof e=="function";function Eo(e,...t){return Tae(e)?e(...t):e}var{definePartsStyle:qx,defineMultiStyleConfig:Mae}=dr(Sie.keys),I1=gn("checkbox-size"),Lae=e=>{const{colorScheme:t}=e;return{w:I1.reference,h:I1.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:wt(`${t}.500`,`${t}.200`)(e),borderColor:wt(`${t}.500`,`${t}.200`)(e),color:wt("white","gray.900")(e),_hover:{bg:wt(`${t}.600`,`${t}.300`)(e),borderColor:wt(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:wt("gray.200","transparent")(e),bg:wt("gray.200","whiteAlpha.300")(e),color:wt("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:wt(`${t}.500`,`${t}.200`)(e),borderColor:wt(`${t}.500`,`${t}.200`)(e),color:wt("white","gray.900")(e)},_disabled:{bg:wt("gray.100","whiteAlpha.100")(e),borderColor:wt("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:wt("red.500","red.300")(e)}}},Aae={_disabled:{cursor:"not-allowed"}},Oae={userSelect:"none",_disabled:{opacity:.4}},Rae={transitionProperty:"transform",transitionDuration:"normal"},Iae=qx(e=>({icon:Rae,container:Aae,control:Eo(Lae,e),label:Oae})),Dae={sm:qx({control:{[I1.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:qx({control:{[I1.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:qx({control:{[I1.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},qS=Mae({baseStyle:Iae,sizes:Dae,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:jae,definePartsStyle:Kx}=dr(Rie.keys),Nae=e=>{var t;const n=(t=Eo(qS.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},$ae=Kx(e=>{var t,n,r,i;return{label:(n=(t=qS).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=qS).baseStyle)==null?void 0:i.call(r,e).container,control:Nae(e)}}),Fae={md:Kx({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:Kx({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:Kx({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},Bae=jae({baseStyle:$ae,sizes:Fae,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:zae,definePartsStyle:Hae}=dr(Iie.keys),$b=gn("select-bg"),fL,Wae={...(fL=xn.baseStyle)==null?void 0:fL.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:$b.reference,[$b.variable]:"colors.white",_dark:{[$b.variable]:"colors.gray.700"},"> option, > optgroup":{bg:$b.reference}},Vae={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},Uae=Hae({field:Wae,icon:Vae}),Fb={paddingInlineEnd:"8"},hL,pL,gL,mL,vL,yL,bL,xL,Gae={lg:{...(hL=xn.sizes)==null?void 0:hL.lg,field:{...(pL=xn.sizes)==null?void 0:pL.lg.field,...Fb}},md:{...(gL=xn.sizes)==null?void 0:gL.md,field:{...(mL=xn.sizes)==null?void 0:mL.md.field,...Fb}},sm:{...(vL=xn.sizes)==null?void 0:vL.sm,field:{...(yL=xn.sizes)==null?void 0:yL.sm.field,...Fb}},xs:{...(bL=xn.sizes)==null?void 0:bL.xs,field:{...(xL=xn.sizes)==null?void 0:xL.xs.field,...Fb},icon:{insetEnd:"1"}}},qae=zae({baseStyle:Uae,sizes:Gae,variants:xn.variants,defaultProps:xn.defaultProps}),$5=gn("skeleton-start-color"),F5=gn("skeleton-end-color"),Kae={[$5.variable]:"colors.gray.100",[F5.variable]:"colors.gray.400",_dark:{[$5.variable]:"colors.gray.800",[F5.variable]:"colors.gray.600"},background:$5.reference,borderColor:F5.reference,opacity:.7,borderRadius:"sm"},Yae={baseStyle:Kae},B5=gn("skip-link-bg"),Xae={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[B5.variable]:"colors.white",_dark:{[B5.variable]:"colors.gray.700"},bg:B5.reference}},Zae={baseStyle:Xae},{defineMultiStyleConfig:Qae,definePartsStyle:Ew}=dr(Die.keys),Sy=gn("slider-thumb-size"),wy=gn("slider-track-size"),bd=gn("slider-bg"),Jae=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...A9({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},ese=e=>({...A9({orientation:e.orientation,horizontal:{h:wy.reference},vertical:{w:wy.reference}}),overflow:"hidden",borderRadius:"sm",[bd.variable]:"colors.gray.200",_dark:{[bd.variable]:"colors.whiteAlpha.200"},_disabled:{[bd.variable]:"colors.gray.300",_dark:{[bd.variable]:"colors.whiteAlpha.300"}},bg:bd.reference}),tse=e=>{const{orientation:t}=e;return{...A9({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:Sy.reference,h:Sy.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},nse=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[bd.variable]:`colors.${t}.500`,_dark:{[bd.variable]:`colors.${t}.200`},bg:bd.reference}},rse=Ew(e=>({container:Jae(e),track:ese(e),thumb:tse(e),filledTrack:nse(e)})),ise=Ew({container:{[Sy.variable]:"sizes.4",[wy.variable]:"sizes.1"}}),ose=Ew({container:{[Sy.variable]:"sizes.3.5",[wy.variable]:"sizes.1"}}),ase=Ew({container:{[Sy.variable]:"sizes.2.5",[wy.variable]:"sizes.0.5"}}),sse={lg:ise,md:ose,sm:ase},lse=Qae({baseStyle:rse,sizes:sse,defaultProps:{size:"md",colorScheme:"blue"}}),xh=yi("spinner-size"),use={width:[xh.reference],height:[xh.reference]},cse={xs:{[xh.variable]:"sizes.3"},sm:{[xh.variable]:"sizes.4"},md:{[xh.variable]:"sizes.6"},lg:{[xh.variable]:"sizes.8"},xl:{[xh.variable]:"sizes.12"}},dse={baseStyle:use,sizes:cse,defaultProps:{size:"md"}},{defineMultiStyleConfig:fse,definePartsStyle:mF}=dr(jie.keys),hse={fontWeight:"medium"},pse={opacity:.8,marginBottom:"2"},gse={verticalAlign:"baseline",fontWeight:"semibold"},mse={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},vse=mF({container:{},label:hse,helpText:pse,number:gse,icon:mse}),yse={md:mF({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},bse=fse({baseStyle:vse,sizes:yse,defaultProps:{size:"md"}}),z5=gn("kbd-bg"),xse={[z5.variable]:"colors.gray.100",_dark:{[z5.variable]:"colors.whiteAlpha.100"},bg:z5.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Sse={baseStyle:xse},wse={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Cse={baseStyle:wse},{defineMultiStyleConfig:_se,definePartsStyle:kse}=dr(Pie.keys),Ese={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Pse=kse({icon:Ese}),Tse=_se({baseStyle:Pse}),{defineMultiStyleConfig:Mse,definePartsStyle:Lse}=dr(Tie.keys),Rl=gn("menu-bg"),H5=gn("menu-shadow"),Ase={[Rl.variable]:"#fff",[H5.variable]:"shadows.sm",_dark:{[Rl.variable]:"colors.gray.700",[H5.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:Rl.reference,boxShadow:H5.reference},Ose={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Rl.variable]:"colors.gray.100",_dark:{[Rl.variable]:"colors.whiteAlpha.100"}},_active:{[Rl.variable]:"colors.gray.200",_dark:{[Rl.variable]:"colors.whiteAlpha.200"}},_expanded:{[Rl.variable]:"colors.gray.100",_dark:{[Rl.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Rl.reference},Rse={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},Ise={opacity:.6},Dse={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},jse={transitionProperty:"common",transitionDuration:"normal"},Nse=Lse({button:jse,list:Ase,item:Ose,groupTitle:Rse,command:Ise,divider:Dse}),$se=Mse({baseStyle:Nse}),{defineMultiStyleConfig:Fse,definePartsStyle:b_}=dr(Mie.keys),Bse={bg:"blackAlpha.600",zIndex:"modal"},zse=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},Hse=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:wt("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:wt("lg","dark-lg")(e)}},Wse={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Vse={position:"absolute",top:"2",insetEnd:"3"},Use=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},Gse={px:"6",py:"4"},qse=b_(e=>({overlay:Bse,dialogContainer:Eo(zse,e),dialog:Eo(Hse,e),header:Wse,closeButton:Vse,body:Eo(Use,e),footer:Gse}));function js(e){return b_(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var Kse={xs:js("xs"),sm:js("sm"),md:js("md"),lg:js("lg"),xl:js("xl"),"2xl":js("2xl"),"3xl":js("3xl"),"4xl":js("4xl"),"5xl":js("5xl"),"6xl":js("6xl"),full:js("full")},Yse=Fse({baseStyle:qse,sizes:Kse,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Xse,definePartsStyle:vF}=dr(Lie.keys),R9=yi("number-input-stepper-width"),yF=yi("number-input-input-padding"),Zse=Nu(R9).add("0.5rem").toString(),W5=yi("number-input-bg"),V5=yi("number-input-color"),U5=yi("number-input-border-color"),Qse={[R9.variable]:"sizes.6",[yF.variable]:Zse},Jse=e=>{var t,n;return(n=(t=Eo(xn.baseStyle,e))==null?void 0:t.field)!=null?n:{}},ele={width:R9.reference},tle={borderStart:"1px solid",borderStartColor:U5.reference,color:V5.reference,bg:W5.reference,[V5.variable]:"colors.chakra-body-text",[U5.variable]:"colors.chakra-border-color",_dark:{[V5.variable]:"colors.whiteAlpha.800",[U5.variable]:"colors.whiteAlpha.300"},_active:{[W5.variable]:"colors.gray.200",_dark:{[W5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},nle=vF(e=>{var t;return{root:Qse,field:(t=Eo(Jse,e))!=null?t:{},stepperGroup:ele,stepper:tle}});function Bb(e){var t,n,r;const i=(t=xn.sizes)==null?void 0:t[e],o={lg:"md",md:"md",sm:"sm",xs:"sm"},a=(r=(n=i.field)==null?void 0:n.fontSize)!=null?r:"md",s=dF.fontSizes[a];return vF({field:{...i.field,paddingInlineEnd:yF.reference,verticalAlign:"top"},stepper:{fontSize:Nu(s).multiply(.75).toString(),_first:{borderTopEndRadius:o[e]},_last:{borderBottomEndRadius:o[e],mt:"-1px",borderTopWidth:1}}})}var rle={xs:Bb("xs"),sm:Bb("sm"),md:Bb("md"),lg:Bb("lg")},ile=Xse({baseStyle:nle,sizes:rle,variants:xn.variants,defaultProps:xn.defaultProps}),SL,ole={...(SL=xn.baseStyle)==null?void 0:SL.field,textAlign:"center"},ale={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},wL,CL,sle={outline:e=>{var t,n,r;return(r=(n=Eo((t=xn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=Eo((t=xn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=Eo((t=xn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(CL=(wL=xn.variants)==null?void 0:wL.unstyled.field)!=null?CL:{}},lle={baseStyle:ole,sizes:ale,variants:sle,defaultProps:xn.defaultProps},{defineMultiStyleConfig:ule,definePartsStyle:cle}=dr(Aie.keys),zb=yi("popper-bg"),dle=yi("popper-arrow-bg"),_L=yi("popper-arrow-shadow-color"),fle={zIndex:10},hle={[zb.variable]:"colors.white",bg:zb.reference,[dle.variable]:zb.reference,[_L.variable]:"colors.gray.200",_dark:{[zb.variable]:"colors.gray.700",[_L.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},ple={px:3,py:2,borderBottomWidth:"1px"},gle={px:3,py:2},mle={px:3,py:2,borderTopWidth:"1px"},vle={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},yle=cle({popper:fle,content:hle,header:ple,body:gle,footer:mle,closeButton:vle}),ble=ule({baseStyle:yle}),{definePartsStyle:x_,defineMultiStyleConfig:xle}=dr(wie.keys),G5=gn("drawer-bg"),q5=gn("drawer-box-shadow");function bg(e){return x_(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var Sle={bg:"blackAlpha.600",zIndex:"overlay"},wle={display:"flex",zIndex:"modal",justifyContent:"center"},Cle=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[G5.variable]:"colors.white",[q5.variable]:"shadows.lg",_dark:{[G5.variable]:"colors.gray.700",[q5.variable]:"shadows.dark-lg"},bg:G5.reference,boxShadow:q5.reference}},_le={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},kle={position:"absolute",top:"2",insetEnd:"3"},Ele={px:"6",py:"2",flex:"1",overflow:"auto"},Ple={px:"6",py:"4"},Tle=x_(e=>({overlay:Sle,dialogContainer:wle,dialog:Eo(Cle,e),header:_le,closeButton:kle,body:Ele,footer:Ple})),Mle={xs:bg("xs"),sm:bg("md"),md:bg("lg"),lg:bg("2xl"),xl:bg("4xl"),full:bg("full")},Lle=xle({baseStyle:Tle,sizes:Mle,defaultProps:{size:"xs"}}),{definePartsStyle:Ale,defineMultiStyleConfig:Ole}=dr(Cie.keys),Rle={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},Ile={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},Dle={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},jle=Ale({preview:Rle,input:Ile,textarea:Dle}),Nle=Ole({baseStyle:jle}),{definePartsStyle:$le,defineMultiStyleConfig:Fle}=dr(_ie.keys),xm=gn("form-control-color"),Ble={marginStart:"1",[xm.variable]:"colors.red.500",_dark:{[xm.variable]:"colors.red.300"},color:xm.reference},zle={mt:"2",[xm.variable]:"colors.gray.600",_dark:{[xm.variable]:"colors.whiteAlpha.600"},color:xm.reference,lineHeight:"normal",fontSize:"sm"},Hle=$le({container:{width:"100%",position:"relative"},requiredIndicator:Ble,helperText:zle}),Wle=Fle({baseStyle:Hle}),{definePartsStyle:Vle,defineMultiStyleConfig:Ule}=dr(kie.keys),Sm=gn("form-error-color"),Gle={[Sm.variable]:"colors.red.500",_dark:{[Sm.variable]:"colors.red.300"},color:Sm.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},qle={marginEnd:"0.5em",[Sm.variable]:"colors.red.500",_dark:{[Sm.variable]:"colors.red.300"},color:Sm.reference},Kle=Vle({text:Gle,icon:qle}),Yle=Ule({baseStyle:Kle}),Xle={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},Zle={baseStyle:Xle},Qle={fontFamily:"heading",fontWeight:"bold"},Jle={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},eue={baseStyle:Qle,sizes:Jle,defaultProps:{size:"xl"}},{defineMultiStyleConfig:tue,definePartsStyle:nue}=dr(xie.keys),rue={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},iue=nue({link:rue}),oue=tue({baseStyle:iue}),aue={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},bF=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:wt("inherit","whiteAlpha.900")(e),_hover:{bg:wt("gray.100","whiteAlpha.200")(e)},_active:{bg:wt("gray.200","whiteAlpha.300")(e)}};const r=Wm(`${t}.200`,.12)(n),i=Wm(`${t}.200`,.24)(n);return{color:wt(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:wt(`${t}.50`,r)(e)},_active:{bg:wt(`${t}.100`,i)(e)}}},sue=e=>{const{colorScheme:t}=e,n=wt("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...Eo(bF,e)}},lue={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},uue=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=wt("gray.100","whiteAlpha.200")(e);return{bg:l,_hover:{bg:wt("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:wt("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:i="white",hoverBg:o=`${n}.600`,activeBg:a=`${n}.700`}=(t=lue[n])!=null?t:{},s=wt(r,`${n}.200`)(e);return{bg:s,color:wt(i,"gray.800")(e),_hover:{bg:wt(o,`${n}.300`)(e),_disabled:{bg:s}},_active:{bg:wt(a,`${n}.400`)(e)}}},cue=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:wt(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:wt(`${t}.700`,`${t}.500`)(e)}}},due={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},fue={ghost:bF,outline:sue,solid:uue,link:cue,unstyled:due},hue={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},pue={baseStyle:aue,variants:fue,sizes:hue,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Rh,defineMultiStyleConfig:gue}=dr(zie.keys),KS=gn("card-bg"),Uu=gn("card-padding"),xF=gn("card-shadow"),Yx=gn("card-radius"),SF=gn("card-border-width","0"),wF=gn("card-border-color"),mue=Rh({container:{[KS.variable]:"colors.chakra-body-bg",backgroundColor:KS.reference,boxShadow:xF.reference,borderRadius:Yx.reference,color:"chakra-body-text",borderWidth:SF.reference,borderColor:wF.reference},body:{padding:Uu.reference,flex:"1 1 0%"},header:{padding:Uu.reference},footer:{padding:Uu.reference}}),vue={sm:Rh({container:{[Yx.variable]:"radii.base",[Uu.variable]:"space.3"}}),md:Rh({container:{[Yx.variable]:"radii.md",[Uu.variable]:"space.5"}}),lg:Rh({container:{[Yx.variable]:"radii.xl",[Uu.variable]:"space.7"}})},yue={elevated:Rh({container:{[xF.variable]:"shadows.base",_dark:{[KS.variable]:"colors.gray.700"}}}),outline:Rh({container:{[SF.variable]:"1px",[wF.variable]:"colors.chakra-border-color"}}),filled:Rh({container:{[KS.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[Uu.variable]:0},header:{[Uu.variable]:0},footer:{[Uu.variable]:0}}},bue=gue({baseStyle:mue,variants:yue,sizes:vue,defaultProps:{variant:"elevated",size:"md"}}),D1=yi("close-button-size"),Bv=yi("close-button-bg"),xue={w:[D1.reference],h:[D1.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[Bv.variable]:"colors.blackAlpha.100",_dark:{[Bv.variable]:"colors.whiteAlpha.100"}},_active:{[Bv.variable]:"colors.blackAlpha.200",_dark:{[Bv.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:Bv.reference},Sue={lg:{[D1.variable]:"sizes.10",fontSize:"md"},md:{[D1.variable]:"sizes.8",fontSize:"xs"},sm:{[D1.variable]:"sizes.6",fontSize:"2xs"}},wue={baseStyle:xue,sizes:Sue,defaultProps:{size:"md"}},{variants:Cue,defaultProps:_ue}=R1,kue={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Eue={baseStyle:kue,variants:Cue,defaultProps:_ue},Pue={w:"100%",mx:"auto",maxW:"prose",px:"4"},Tue={baseStyle:Pue},Mue={opacity:.6,borderColor:"inherit"},Lue={borderStyle:"solid"},Aue={borderStyle:"dashed"},Oue={solid:Lue,dashed:Aue},Rue={baseStyle:Mue,variants:Oue,defaultProps:{variant:"solid"}},{definePartsStyle:Iue,defineMultiStyleConfig:Due}=dr(vie.keys),jue={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},Nue={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},$ue={pt:"2",px:"4",pb:"5"},Fue={fontSize:"1.25em"},Bue=Iue({container:jue,button:Nue,panel:$ue,icon:Fue}),zue=Due({baseStyle:Bue}),{definePartsStyle:t2,defineMultiStyleConfig:Hue}=dr(yie.keys),Pa=gn("alert-fg"),nc=gn("alert-bg"),Wue=t2({container:{bg:nc.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Pa.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:Pa.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function I9(e){const{theme:t,colorScheme:n}=e,r=Wm(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var Vue=t2(e=>{const{colorScheme:t}=e,n=I9(e);return{container:{[Pa.variable]:`colors.${t}.500`,[nc.variable]:n.light,_dark:{[Pa.variable]:`colors.${t}.200`,[nc.variable]:n.dark}}}}),Uue=t2(e=>{const{colorScheme:t}=e,n=I9(e);return{container:{[Pa.variable]:`colors.${t}.500`,[nc.variable]:n.light,_dark:{[Pa.variable]:`colors.${t}.200`,[nc.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:Pa.reference}}}),Gue=t2(e=>{const{colorScheme:t}=e,n=I9(e);return{container:{[Pa.variable]:`colors.${t}.500`,[nc.variable]:n.light,_dark:{[Pa.variable]:`colors.${t}.200`,[nc.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:Pa.reference}}}),que=t2(e=>{const{colorScheme:t}=e;return{container:{[Pa.variable]:"colors.white",[nc.variable]:`colors.${t}.500`,_dark:{[Pa.variable]:"colors.gray.900",[nc.variable]:`colors.${t}.200`},color:Pa.reference}}}),Kue={subtle:Vue,"left-accent":Uue,"top-accent":Gue,solid:que},Yue=Hue({baseStyle:Wue,variants:Kue,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:CF,defineMultiStyleConfig:Xue}=dr(bie.keys),wm=gn("avatar-border-color"),K5=gn("avatar-bg"),Zue={borderRadius:"full",border:"0.2em solid",[wm.variable]:"white",_dark:{[wm.variable]:"colors.gray.800"},borderColor:wm.reference},Que={[K5.variable]:"colors.gray.200",_dark:{[K5.variable]:"colors.whiteAlpha.400"},bgColor:K5.reference},kL=gn("avatar-background"),Jue=e=>{const{name:t,theme:n}=e,r=t?soe({string:t}):"colors.gray.400",i=ooe(r)(n);let o="white";return i||(o="gray.800"),{bg:kL.reference,"&:not([data-loaded])":{[kL.variable]:r},color:o,[wm.variable]:"colors.white",_dark:{[wm.variable]:"colors.gray.800"},borderColor:wm.reference,verticalAlign:"top"}},ece=CF(e=>({badge:Eo(Zue,e),excessLabel:Eo(Que,e),container:Eo(Jue,e)}));function ld(e){const t=e!=="100%"?hF[e]:void 0;return CF({container:{width:e,height:e,fontSize:`calc(${t??e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t??e} / 2.5)`,lineHeight:e!=="100%"?t??e:void 0}})}var tce={"2xs":ld(4),xs:ld(6),sm:ld(8),md:ld(12),lg:ld(16),xl:ld(24),"2xl":ld(32),full:ld("100%")},nce=Xue({baseStyle:ece,sizes:tce,defaultProps:{size:"md"}}),rce={Accordion:zue,Alert:Yue,Avatar:nce,Badge:R1,Breadcrumb:oue,Button:pue,Checkbox:qS,CloseButton:wue,Code:Eue,Container:Tue,Divider:Rue,Drawer:Lle,Editable:Nle,Form:Wle,FormError:Yle,FormLabel:Zle,Heading:eue,Input:xn,Kbd:Sse,Link:Cse,List:Tse,Menu:$se,Modal:Yse,NumberInput:ile,PinInput:lle,Popover:ble,Progress:Pae,Radio:Bae,Select:qae,Skeleton:Yae,SkipLink:Zae,Slider:lse,Spinner:dse,Stat:bse,Switch:Coe,Table:Loe,Tabs:Uoe,Tag:iae,Textarea:mae,Tooltip:bae,Card:bue},ice={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},oce={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},ace="ltr",sce={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},lce={semanticTokens:ice,direction:ace,...mie,components:rce,styles:oce,config:sce};function uce(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var cce=uce();function dce(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function fce(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},_F=hce(fce);function kF(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var EF=e=>kF(e,t=>t!=null);function pce(e){return typeof e=="function"}function PF(e,...t){return pce(e)?e(...t):e}function gce(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}const TF=1/60*1e3,mce=typeof performance<"u"?()=>performance.now():()=>Date.now(),MF=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(mce()),TF);function vce(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const p=d&&i,m=p?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),p&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=vce(()=>Cy=!0),e),{}),bce=n2.reduce((e,t)=>{const n=Pw[t];return e[t]=(r,i=!1,o=!1)=>(Cy||wce(),n.schedule(r,i,o)),e},{}),xce=n2.reduce((e,t)=>(e[t]=Pw[t].cancel,e),{});n2.reduce((e,t)=>(e[t]=()=>Pw[t].process(Cm),e),{});const Sce=e=>Pw[e].process(Cm),LF=e=>{Cy=!1,Cm.delta=S_?TF:Math.max(Math.min(e-Cm.timestamp,yce),1),Cm.timestamp=e,w_=!0,n2.forEach(Sce),w_=!1,Cy&&(S_=!1,MF(LF))},wce=()=>{Cy=!0,S_=!0,w_||MF(LF)},EL=()=>Cm;var Cce=typeof Element<"u",_ce=typeof Map=="function",kce=typeof Set=="function",Ece=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Xx(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Xx(e[r],t[r]))return!1;return!0}var o;if(_ce&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!Xx(r.value[1],t.get(r.value[0])))return!1;return!0}if(kce&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Ece&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(Cce&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!Xx(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var Pce=function(t,n){try{return Xx(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function AF(e,t={}){var n;const{styleConfig:r,...i}=t,{theme:o,colorMode:a}=tF(),s=e?_F(o,`components.${e}`):void 0,l=r||s,u=Bl({theme:o,colorMode:a},(n=l==null?void 0:l.defaultProps)!=null?n:{},EF(dce(i,["children"]))),d=S.useRef({});if(l){const m=Ure(l)(u);Pce(d.current,m)||(d.current=m)}return d.current}function au(e,t={}){return AF(e,t)}function Yi(e,t={}){return AF(e,t)}var Tce=new Set([...Rre,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),Mce=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function Lce(e){return Mce.has(e)||!Tce.has(e)}function Ace(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Oce(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i in n&&delete n[i],n[i]=r[i]);return n}var Rce=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Ice=Fj(function(e){return Rce.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Dce=Ice,jce=function(t){return t!=="theme"},PL=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Dce:jce},TL=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},Nce=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Uj(n,r,i),aee(function(){return Gj(n,r,i)}),null},$ce=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=TL(t,n,r),l=s||PL(i),u=!l("as");return function(){var d=arguments,p=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&p.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)p.push.apply(p,d);else{p.push(d[0][0]);for(var m=d.length,y=1;yt=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=kF(a,(p,m)=>Dre(m)),l=PF(e,t),u=Oce({},i,l,EF(s),o),d=cF(u)(t.theme);return r?[d,r]:d};function Y5(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=Lce);const i=zce({baseStyle:n}),o=Bce(e,r)(i);return qe.forwardRef(function(l,u){const{colorMode:d,forced:p}=Jy();return qe.createElement(o,{ref:u,"data-theme":p?d:void 0,...l})})}function Hce(){const e=new Map;return new Proxy(Y5,{apply(t,n,r){return Y5(...r)},get(t,n){return e.has(n)||e.set(n,Y5(n)),e.get(n)}})}var $e=Hce();function Xe(e){return S.forwardRef(e)}function Wce(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=S.createContext(void 0);i.displayName=r;function o(){var a;const s=S.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}function Vce(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=S.useMemo(()=>Are(n),[n]);return g.jsxs(cee,{theme:i,children:[g.jsx(Uce,{root:t}),r]})}function Uce({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return g.jsx(aw,{styles:n=>({[t]:n.__cssVars})})}Wce({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function Gce(){const{colorMode:e}=Jy();return g.jsx(aw,{styles:t=>{const n=_F(t,"styles.global"),r=PF(n,{theme:t,colorMode:e});return r?cF(r)(t):void 0}})}var OF=S.createContext({getDocument(){return document},getWindow(){return window}});OF.displayName="EnvironmentContext";function RF(e){const{children:t,environment:n,disabled:r}=e,i=S.useRef(null),o=S.useMemo(()=>n||{getDocument:()=>{var s,l;return(l=(s=i.current)==null?void 0:s.ownerDocument)!=null?l:document},getWindow:()=>{var s,l;return(l=(s=i.current)==null?void 0:s.ownerDocument.defaultView)!=null?l:window}},[n]),a=!r||!n;return g.jsxs(OF.Provider,{value:o,children:[t,a&&g.jsx("span",{id:"__chakra_env",hidden:!0,ref:i})]})}RF.displayName="EnvironmentProvider";var qce=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s,disableEnvironment:l}=e,u=g.jsx(RF,{environment:a,disabled:l,children:t});return g.jsx(Vce,{theme:o,cssVarsRoot:s,children:g.jsxs(eF,{colorModeManager:n,options:o.config,children:[i?g.jsx(hee,{}):g.jsx(fee,{}),g.jsx(Gce,{}),r?g.jsx(Qj,{zIndex:r,children:u}):u]})})},Kce=(e,t)=>e.find(n=>n.id===t);function LL(e,t){const n=IF(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function IF(e,t){for(const[n,r]of Object.entries(e))if(Kce(r,t))return n}function Yce(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function Xce(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}function Qr(e,t=[]){const n=S.useRef(e);return S.useEffect(()=>{n.current=e}),S.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Zce(e,t){const n=Qr(e);S.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function rc(e,t){const n=S.useRef(!1),r=S.useRef(!1);S.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),S.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const DF=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Tw=S.createContext({});function Qce(){return S.useContext(Tw).visualElement}const r2=S.createContext(null),Mw=typeof document<"u",XS=Mw?S.useLayoutEffect:S.useEffect,jF=S.createContext({strict:!1});function Jce(e,t,n,r){const i=Qce(),o=S.useContext(jF),a=S.useContext(r2),s=S.useContext(DF).reducedMotion,l=S.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return S.useInsertionEffect(()=>{u&&u.update(n,a)}),XS(()=>{u&&u.render()}),S.useEffect(()=>{u&&u.updateFeatures()}),(window.HandoffAppearAnimations?XS:S.useEffect)(()=>{u&&u.animationState&&u.animationState.animateChanges()}),u}function Qg(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ede(e,t,n){return S.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Qg(n)&&(n.current=r))},[t])}function _y(e){return typeof e=="string"||Array.isArray(e)}function Lw(e){return typeof e=="object"&&typeof e.start=="function"}const tde=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Aw(e){return Lw(e.animate)||tde.some(t=>_y(e[t]))}function NF(e){return Boolean(Aw(e)||e.variants)}function nde(e,t){if(Aw(e)){const{initial:n,animate:r}=e;return{initial:n===!1||_y(n)?n:void 0,animate:_y(r)?r:void 0}}return e.inherit!==!1?t:{}}function rde(e){const{initial:t,animate:n}=nde(e,S.useContext(Tw));return S.useMemo(()=>({initial:t,animate:n}),[AL(t),AL(n)])}function AL(e){return Array.isArray(e)?e.join(" "):e}const OL={animation:["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],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"]},ky={};for(const e in OL)ky[e]={isEnabled:t=>OL[e].some(n=>!!t[n])};function ide(e){for(const t in e)ky[t]={...ky[t],...e[t]}}function D9(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const j1={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let ode=1;function ade(){return D9(()=>{if(j1.hasEverUpdated)return ode++})}const j9=S.createContext({}),$F=S.createContext({}),sde=Symbol.for("motionComponentSymbol");function lde({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&ide(e);function o(s,l){let u;const d={...S.useContext(DF),...s,layoutId:ude(s)},{isStatic:p}=d,m=rde(s),y=p?void 0:ade(),b=r(s,p);if(!p&&Mw){m.visualElement=Jce(i,b,d,t);const w=S.useContext($F),E=S.useContext(jF).strict;m.visualElement&&(u=m.visualElement.loadFeatures(d,E,e,y,w))}return S.createElement(Tw.Provider,{value:m},u&&m.visualElement?S.createElement(u,{visualElement:m.visualElement,...d}):null,n(i,s,y,ede(b,m.visualElement,l),b,p,m.visualElement))}const a=S.forwardRef(o);return a[sde]=i,a}function ude({layoutId:e}){const t=S.useContext(j9).id;return t&&e!==void 0?t+"-"+e:e}function cde(e){function t(r,i={}){return lde(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const dde=["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 N9(e){return typeof e!="string"||e.includes("-")?!1:!!(dde.indexOf(e)>-1||/[A-Z]/.test(e))}const ZS={};function fde(e){Object.assign(ZS,e)}const Ow=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],c0=new Set(Ow);function FF(e,{layout:t,layoutId:n}){return c0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ZS[e]||e==="opacity")}const ta=e=>Boolean(e&&e.getVelocity),hde={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pde=Ow.length;function gde(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let a=0;at&&typeof e=="number"?t.transform(e):e,Vm=(e,t,n)=>Math.min(Math.max(n,e),t),np={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},N1={...np,transform:e=>Vm(0,1,e)},Hb={...np,default:1},$1=e=>Math.round(e*1e5)/1e5,Ey=/(-)?([\d]*\.?[\d])+/g,C_=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,vde=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function i2(e){return typeof e=="string"}const o2=e=>({test:t=>i2(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),cd=o2("deg"),Yl=o2("%"),Pt=o2("px"),yde=o2("vh"),bde=o2("vw"),RL={...Yl,parse:e=>Yl.parse(e)/100,transform:e=>Yl.transform(e*100)},IL={...np,transform:Math.round},zF={borderWidth:Pt,borderTopWidth:Pt,borderRightWidth:Pt,borderBottomWidth:Pt,borderLeftWidth:Pt,borderRadius:Pt,radius:Pt,borderTopLeftRadius:Pt,borderTopRightRadius:Pt,borderBottomRightRadius:Pt,borderBottomLeftRadius:Pt,width:Pt,maxWidth:Pt,height:Pt,maxHeight:Pt,size:Pt,top:Pt,right:Pt,bottom:Pt,left:Pt,padding:Pt,paddingTop:Pt,paddingRight:Pt,paddingBottom:Pt,paddingLeft:Pt,margin:Pt,marginTop:Pt,marginRight:Pt,marginBottom:Pt,marginLeft:Pt,rotate:cd,rotateX:cd,rotateY:cd,rotateZ:cd,scale:Hb,scaleX:Hb,scaleY:Hb,scaleZ:Hb,skew:cd,skewX:cd,skewY:cd,distance:Pt,translateX:Pt,translateY:Pt,translateZ:Pt,x:Pt,y:Pt,z:Pt,perspective:Pt,transformPerspective:Pt,opacity:N1,originX:RL,originY:RL,originZ:Pt,zIndex:IL,fillOpacity:N1,strokeOpacity:N1,numOctaves:IL};function $9(e,t,n,r){const{style:i,vars:o,transform:a,transformOrigin:s}=e;let l=!1,u=!1,d=!0;for(const p in t){const m=t[p];if(BF(p)){o[p]=m;continue}const y=zF[p],b=mde(m,y);if(c0.has(p)){if(l=!0,a[p]=b,!d)continue;m!==(y.default||0)&&(d=!1)}else p.startsWith("origin")?(u=!0,s[p]=b):i[p]=b}if(t.transform||(l||r?i.transform=gde(e.transform,n,d,r):i.transform&&(i.transform="none")),u){const{originX:p="50%",originY:m="50%",originZ:y=0}=s;i.transformOrigin=`${p} ${m} ${y}`}}const F9=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function HF(e,t,n){for(const r in t)!ta(t[r])&&!FF(r,n)&&(e[r]=t[r])}function xde({transformTemplate:e},t,n){return S.useMemo(()=>{const r=F9();return $9(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function Sde(e,t,n){const r=e.style||{},i={};return HF(i,r,e),Object.assign(i,xde(e,t,n)),e.transformValues?e.transformValues(i):i}function wde(e,t,n){const r={},i=Sde(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const Cde=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function QS(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||Cde.has(e)}let WF=e=>!QS(e);function _de(e){e&&(WF=t=>t.startsWith("on")?!QS(t):e(t))}try{_de(require("@emotion/is-prop-valid").default)}catch{}function kde(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(WF(i)||n===!0&&QS(i)||!t&&!QS(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function DL(e,t,n){return typeof e=="string"?e:Pt.transform(t+n*e)}function Ede(e,t,n){const r=DL(t,e.x,e.width),i=DL(n,e.y,e.height);return`${r} ${i}`}const Pde={offset:"stroke-dashoffset",array:"stroke-dasharray"},Tde={offset:"strokeDashoffset",array:"strokeDasharray"};function Mde(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?Pde:Tde;e[o.offset]=Pt.transform(-r);const a=Pt.transform(t),s=Pt.transform(n);e[o.array]=`${a} ${s}`}function B9(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,d,p){if($9(e,l,u,p),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:y,dimensions:b}=e;m.transform&&(b&&(y.transform=m.transform),delete m.transform),b&&(r!==void 0||i!==void 0||y.transform)&&(y.transformOrigin=Ede(b,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),o!==void 0&&Mde(m,o,a,s,!1)}const VF=()=>({...F9(),attrs:{}}),z9=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Lde(e,t,n,r){const i=S.useMemo(()=>{const o=VF();return B9(o,t,{enableHardwareAcceleration:!1},z9(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};HF(o,e.style,e),i.style={...o,...i.style}}return i}function Ade(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const u=(N9(n)?Lde:wde)(r,a,s,n),p={...kde(r,typeof n=="string",e),...u,ref:o},{children:m}=r,y=S.useMemo(()=>ta(m)?m.get():m,[m]);return i&&(p["data-projection-id"]=i),S.createElement(n,{...p,children:y})}}const H9=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function UF(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const GF=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 qF(e,t,n,r){UF(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(GF.has(i)?i:H9(i),t.attrs[i])}function W9(e,t){const{style:n}=e,r={};for(const i in n)(ta(n[i])||t.style&&ta(t.style[i])||FF(i,e))&&(r[i]=n[i]);return r}function KF(e,t){const n=W9(e,t);for(const r in e)if(ta(e[r])||ta(t[r])){const i=r==="x"||r==="y"?"attr"+r.toUpperCase():r;n[i]=e[r]}return n}function V9(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}const JS=e=>Array.isArray(e),Ode=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Rde=e=>JS(e)?e[e.length-1]||0:e;function Zx(e){const t=ta(e)?e.get():e;return Ode(t)?t.toValue():t}function Ide({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:Dde(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const YF=e=>(t,n)=>{const r=S.useContext(Tw),i=S.useContext(r2),o=()=>Ide(e,t,r,i);return n?o():D9(o)};function Dde(e,t,n,r){const i={},o=r(e,{});for(const m in o)i[m]=Zx(o[m]);let{initial:a,animate:s}=e;const l=Aw(e),u=NF(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const p=d?s:a;return p&&typeof p!="boolean"&&!Lw(p)&&(Array.isArray(p)?p:[p]).forEach(y=>{const b=V9(e,y);if(!b)return;const{transitionEnd:w,transition:E,..._}=b;for(const k in _){let T=_[k];if(Array.isArray(T)){const L=d?T.length-1:0;T=T[L]}T!==null&&(i[k]=T)}for(const k in w)i[k]=w[k]}),i}const jde={useVisualState:YF({scrapeMotionValuesFromProps:KF,createRenderState:VF,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}B9(n,r,{enableHardwareAcceleration:!1},z9(t.tagName),e.transformTemplate),qF(t,n)}})},Nde={useVisualState:YF({scrapeMotionValuesFromProps:W9,createRenderState:F9})};function $de(e,{forwardMotionProps:t=!1},n,r){return{...N9(e)?jde:Nde,preloadedFeatures:n,useRender:Ade(t),createVisualElement:r,Component:e}}function Hu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const XF=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Rw(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const Fde=e=>t=>XF(t)&&e(t,Rw(t));function Gu(e,t,n,r){return Hu(e,t,Fde(n),r)}var tr;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(tr||(tr={}));const Bde=(e,t)=>n=>t(e(n)),Nd=(...e)=>e.reduce(Bde);function ZF(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const jL=ZF("dragHorizontal"),NL=ZF("dragVertical");function QF(e){let t=!1;if(e==="y")t=NL();else if(e==="x")t=jL();else{const n=jL(),r=NL();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function JF(){const e=QF(!0);return e?(e(),!1):!0}let sf=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};function $L(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(o,a)=>{if(o.type==="touch"||JF())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive(tr.Hover,t),s[r]&&s[r](o,a)};return Gu(e.current,n,i,{passive:!e.getProps()[r]})}class zde extends sf{mount(){this.unmount=Nd($L(this.node,!0),$L(this.node,!1))}unmount(){}}class Hde extends sf{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(tr.Focus,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(tr.Focus,!1),this.isActive=!1)}mount(){this.unmount=Nd(Hu(this.node.current,"focus",()=>this.onFocus()),Hu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const eB=(e,t)=>t?e===t?!0:eB(e,t.parentElement):!1,Xl=e=>e;function X5(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Rw(n))}class Wde extends sf{constructor(){super(...arguments),this.removeStartListeners=Xl,this.removeEndListeners=Xl,this.removeAccessibleListeners=Xl,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),o=Gu(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:d}=this.node.getProps();eB(this.node.current,s.target)?u&&u(s,l):d&&d(s,l)},{passive:!(r.onTap||r.onPointerUp)}),a=Gu(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=Nd(o,a),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=o=>{if(o.key!=="Enter"||this.isPressing)return;const a=s=>{s.key!=="Enter"||!this.checkPressEnd()||X5("up",this.node.getProps().onTap)};this.removeEndListeners(),this.removeEndListeners=Hu(this.node.current,"keyup",a),X5("down",(s,l)=>{this.startPress(s,l)})},n=Hu(this.node.current,"keydown",t),r=()=>{this.isPressing&&X5("cancel",(o,a)=>this.cancelPress(o,a))},i=Hu(this.node.current,"blur",r);this.removeAccessibleListeners=Nd(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive(tr.Tap,!0),r&&r(t,n)}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive(tr.Tap,!1),!JF()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&r(t,n)}mount(){const t=this.node.getProps(),n=Gu(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Hu(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Nd(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const __=new WeakMap,Z5=new WeakMap,Vde=e=>{const t=__.get(e.target);t&&t(e)},Ude=e=>{e.forEach(Vde)};function Gde({root:e,...t}){const n=e||document;Z5.has(n)||Z5.set(n,{});const r=Z5.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Ude,{root:e,...t})),r[i]}function qde(e,t,n){const r=Gde(t);return __.set(e,n),r.observe(e),()=>{__.delete(e),r.unobserve(e)}}const Kde={some:0,all:1};class Yde extends sf{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}viewportFallback(){requestAnimationFrame(()=>{this.hasEnteredView=!0;const{onViewportEnter:t}=this.node.getProps();t&&t(null),this.node.animationState&&this.node.animationState.setActive(tr.InView,!0)})}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o,fallback:a=!0}=t;if(typeof IntersectionObserver>"u"){a&&this.viewportFallback();return}const s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Kde[i]},l=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(tr.InView,d);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),y=d?p:m;y&&y(u)};return qde(this.node.current,s,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Xde(t,n))&&this.startObserver()}unmount(){}}function Xde({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Zde={inView:{Feature:Yde},tap:{Feature:Wde},focus:{Feature:Hde},hover:{Feature:zde}};function tB(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r/^\-?\d*\.?\d+$/.test(e),Jde=e=>/^0[^.\s]+$/.test(e),qu={delta:0,timestamp:0},nB=1/60*1e3,efe=typeof performance<"u"?()=>performance.now():()=>Date.now(),rB=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(efe()),nB);function tfe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const p=d&&i,m=p?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),p&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=tfe(()=>Py=!0),e),{}),so=a2.reduce((e,t)=>{const n=Iw[t];return e[t]=(r,i=!1,o=!1)=>(Py||ife(),n.schedule(r,i,o)),e},{}),Gd=a2.reduce((e,t)=>(e[t]=Iw[t].cancel,e),{}),Q5=a2.reduce((e,t)=>(e[t]=()=>Iw[t].process(qu),e),{}),rfe=e=>Iw[e].process(qu),iB=e=>{Py=!1,qu.delta=k_?nB:Math.max(Math.min(e-qu.timestamp,nfe),1),qu.timestamp=e,E_=!0,a2.forEach(rfe),E_=!1,Py&&(k_=!1,rB(iB))},ife=()=>{Py=!0,k_=!0,E_||rB(iB)};function U9(e,t){e.indexOf(t)===-1&&e.push(t)}function G9(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class q9{constructor(){this.subscriptions=[]}add(t){return U9(this.subscriptions,t),()=>G9(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class afe{constructor(t,n={}){this.version="9.0.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,i=!0)=>{this.prev=this.current,this.current=r;const{delta:o,timestamp:a}=qu;this.lastUpdated!==a&&(this.timeDelta=o,this.lastUpdated=a,so.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>so.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=ofe(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new q9);const r=this.events[t].add(n);return t==="change"?()=>{r(),so.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?K9(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Um(e,t){return new afe(e,t)}const Y9=(e,t)=>n=>Boolean(i2(n)&&vde.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),oB=(e,t,n)=>r=>{if(!i2(r))return r;const[i,o,a,s]=r.match(Ey);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},sfe=e=>Vm(0,255,e),J5={...np,transform:e=>Math.round(sfe(e))},Eh={test:Y9("rgb","red"),parse:oB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+J5.transform(e)+", "+J5.transform(t)+", "+J5.transform(n)+", "+$1(N1.transform(r))+")"};function lfe(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const P_={test:Y9("#"),parse:lfe,transform:Eh.transform},Jg={test:Y9("hsl","hue"),parse:oB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Yl.transform($1(t))+", "+Yl.transform($1(n))+", "+$1(N1.transform(r))+")"},bo={test:e=>Eh.test(e)||P_.test(e)||Jg.test(e),parse:e=>Eh.test(e)?Eh.parse(e):Jg.test(e)?Jg.parse(e):P_.parse(e),transform:e=>i2(e)?e:e.hasOwnProperty("red")?Eh.transform(e):Jg.transform(e)},aB="${c}",sB="${n}";function ufe(e){var t,n;return isNaN(e)&&i2(e)&&(((t=e.match(Ey))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(C_))===null||n===void 0?void 0:n.length)||0)>0}function e3(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0,r=0;const i=e.match(C_);i&&(n=i.length,e=e.replace(C_,aB),t.push(...i.map(bo.parse)));const o=e.match(Ey);return o&&(r=o.length,e=e.replace(Ey,sB),t.push(...o.map(np.parse))),{values:t,numColors:n,numNumbers:r,tokenised:e}}function lB(e){return e3(e).values}function uB(e){const{values:t,numColors:n,tokenised:r}=e3(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function dfe(e){const t=lB(e);return uB(e)(t.map(cfe))}const qd={test:ufe,parse:lB,createTransformer:uB,getAnimatableNone:dfe},ffe=new Set(["brightness","contrast","saturate","opacity"]);function hfe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ey)||[];if(!r)return e;const i=n.replace(r,"");let o=ffe.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const pfe=/([a-z-]*)\(.*?\)/g,T_={...qd,getAnimatableNone:e=>{const t=e.match(pfe);return t?t.map(hfe).join(" "):e}},gfe={...zF,color:bo,backgroundColor:bo,outlineColor:bo,fill:bo,stroke:bo,borderColor:bo,borderTopColor:bo,borderRightColor:bo,borderBottomColor:bo,borderLeftColor:bo,filter:T_,WebkitFilter:T_},X9=e=>gfe[e];function Z9(e,t){let n=X9(e);return n!==T_&&(n=qd),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const cB=e=>t=>t.test(e),mfe={test:e=>e==="auto",parse:e=>e},dB=[np,Pt,Yl,cd,bde,yde,mfe],zv=e=>dB.find(cB(e)),vfe=[...dB,bo,qd],yfe=e=>vfe.find(cB(e));function bfe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function xfe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Dw(e,t,n){const r=e.getProps();return V9(r,t,n!==void 0?n:r.custom,bfe(e),xfe(e))}function Sfe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Um(n))}function wfe(e,t){const n=Dw(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=Rde(o[a]);Sfe(e,a,s)}}function Cfe(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;se*1e3,Mfe={current:!1},Q9=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,J9=e=>t=>1-e(1-t),e8=e=>e*e,Lfe=J9(e8),t8=Q9(e8),Fr=(e,t,n)=>-n*e+n*t+e;function eC(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Afe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=eC(l,s,e+1/3),o=eC(l,s,e),a=eC(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const tC=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},Ofe=[P_,Eh,Jg],Rfe=e=>Ofe.find(t=>t.test(e));function FL(e){const t=Rfe(e);let n=t.parse(e);return t===Jg&&(n=Afe(n)),n}const fB=(e,t)=>{const n=FL(e),r=FL(t),i={...n};return o=>(i.red=tC(n.red,r.red,o),i.green=tC(n.green,r.green,o),i.blue=tC(n.blue,r.blue,o),i.alpha=Fr(n.alpha,r.alpha,o),Eh.transform(i))};function hB(e,t){return typeof e=="number"?n=>Fr(e,t,n):bo.test(e)?fB(e,t):gB(e,t)}const pB=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>hB(o,t[a]));return o=>{for(let a=0;a{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=hB(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}},gB=(e,t)=>{const n=qd.createTransformer(t),r=e3(e),i=e3(t);return r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?Nd(pB(r.values,i.values),n):a=>`${a>0?t:e}`},r3=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},BL=(e,t)=>n=>Fr(e,t,n);function Dfe(e){return typeof e=="number"?BL:typeof e=="string"?bo.test(e)?fB:gB:Array.isArray(e)?pB:typeof e=="object"?Ife:BL}function jfe(e,t,n){const r=[],i=n||Dfe(e[0]),o=e.length-1;for(let a=0;ae[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=jfe(t,r,i),s=a.length,l=u=>{let d=0;if(s>1)for(;dl(Vm(e[0],e[o-1],u)):l}const vB=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Nfe=1e-7,$fe=12;function Ffe(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=vB(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>Nfe&&++s<$fe);return a}function yB(e,t,n,r){if(e===t&&n===r)return Xl;const i=o=>Ffe(o,0,1,e,n);return o=>o===0||o===1?o:vB(i(o),t,r)}const bB=e=>1-Math.sin(Math.acos(e)),n8=J9(bB),Bfe=Q9(n8),xB=yB(.33,1.53,.69,.99),r8=J9(xB),zfe=Q9(r8),Hfe=e=>(e*=2)<1?.5*r8(e):.5*(2-Math.pow(2,-10*(e-1))),Wfe={linear:Xl,easeIn:e8,easeInOut:t8,easeOut:Lfe,circIn:bB,circInOut:Bfe,circOut:n8,backIn:r8,backInOut:zfe,backOut:xB,anticipate:Hfe},zL=e=>{if(Array.isArray(e)){n3(e.length===4);const[t,n,r,i]=e;return yB(t,n,r,i)}else if(typeof e=="string")return Wfe[e];return e},Vfe=e=>Array.isArray(e)&&typeof e[0]!="number";function Ufe(e,t){return e.map(()=>t||t8).splice(0,e.length-1)}function Gfe(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function qfe(e,t){return e.map(n=>n*t)}function M_({keyframes:e,ease:t=t8,times:n,duration:r=300}){e=[...e];const i=Vfe(t)?t.map(zL):zL(t),o={done:!1,value:e[0]},a=qfe(n&&n.length===e.length?n:Gfe(e),r);function s(){return mB(a,e,{ease:Array.isArray(i)?i:Ufe(e,i)})}let l=s();return{next:u=>(o.value=l(u),o.done=u>=r,o),flipTarget:()=>{e.reverse(),l=s()}}}const nC=.001,Kfe=.01,HL=10,Yfe=.05,Xfe=1;function Zfe({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;Tfe(e<=HL*1e3);let a=1-t;a=Vm(Yfe,Xfe,a),e=Vm(Kfe,HL,e/1e3),a<1?(i=u=>{const d=u*a,p=d*e,m=d-n,y=L_(u,a),b=Math.exp(-p);return nC-m/y*b},o=u=>{const p=u*a*e,m=p*n+n,y=Math.pow(a,2)*Math.pow(u,2)*e,b=Math.exp(-p),w=L_(Math.pow(u,2),a);return(-i(u)+nC>0?-1:1)*((m-y)*b)/w}):(i=u=>{const d=Math.exp(-u*e),p=(u-n)*e+1;return-nC+d*p},o=u=>{const d=Math.exp(-u*e),p=(n-u)*(e*e);return d*p});const s=5/e,l=Jfe(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const Qfe=12;function Jfe(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function nhe(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!WL(e,the)&&WL(e,ehe)){const n=Zfe(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}const rhe=5;function SB({keyframes:e,restDelta:t,restSpeed:n,...r}){let i=e[0],o=e[e.length-1];const a={done:!1,value:i},{stiffness:s,damping:l,mass:u,velocity:d,duration:p,isResolvedFromDuration:m}=nhe(r);let y=ihe,b=d?-(d/1e3):0;const w=l/(2*Math.sqrt(s*u));function E(){const _=o-i,k=Math.sqrt(s/u)/1e3,T=Math.abs(_)<5;if(n||(n=T?.01:2),t||(t=T?.005:.5),w<1){const L=L_(k,w);y=O=>{const D=Math.exp(-w*k*O);return o-D*((b+w*k*_)/L*Math.sin(L*O)+_*Math.cos(L*O))}}else if(w===1)y=L=>o-Math.exp(-k*L)*(_+(b+k*_)*L);else{const L=k*Math.sqrt(w*w-1);y=O=>{const D=Math.exp(-w*k*O),I=Math.min(L*O,300);return o-D*((b+w*k*_)*Math.sinh(I)+L*_*Math.cosh(I))/L}}}return E(),{next:_=>{const k=y(_);if(m)a.done=_>=p;else{let T=b;if(_!==0)if(w<1){const D=Math.max(0,_-rhe);T=K9(k-y(D),_-D)}else T=0;const L=Math.abs(T)<=n,O=Math.abs(o-k)<=t;a.done=L&&O}return a.value=a.done?o:k,a},flipTarget:()=>{b=-b,[i,o]=[o,i],E()}}}SB.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const ihe=e=>0;function ohe({keyframes:e=[0],velocity:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a=e[0],s={done:!1,value:a};let l=n*t;const u=a+l,d=o===void 0?u:o(u);return d!==u&&(l=d-a),{next:p=>{const m=-l*Math.exp(-p/r);return s.done=!(m>i||m<-i),s.value=s.done?d:d+m,s},flipTarget:()=>{}}}const ahe={decay:ohe,keyframes:M_,tween:M_,spring:SB};function wB(e,t,n=0){return e-t-n}function she(e,t=0,n=0,r=!0){return r?wB(t+-e,t,n):t-(e-t)+n}function lhe(e,t,n,r){return r?e>=t+n:e<=-n}const uhe=e=>{const t=({delta:n})=>e(n);return{start:()=>so.update(t,!0),stop:()=>Gd.update(t)}};function i3({duration:e,driver:t=uhe,elapsed:n=0,repeat:r=0,repeatType:i="loop",repeatDelay:o=0,keyframes:a,autoplay:s=!0,onPlay:l,onStop:u,onComplete:d,onRepeat:p,onUpdate:m,type:y="keyframes",...b}){const w=n;let E,_=0,k=e,T=!1,L=!0,O;const D=ahe[a.length>2?"keyframes":y]||M_,I=a[0],N=a[a.length-1];let V={done:!1,value:I};const{needsInterpolation:B}=D;B&&B(I,N)&&(O=mB([0,100],[I,N],{clamp:!1}),a=[0,100]);const K=D({...b,duration:e,keyframes:a});function ne(){_++,i==="reverse"?(L=_%2===0,n=she(n,k,o,L)):(n=wB(n,k,o),i==="mirror"&&K.flipTarget()),T=!1,p&&p()}function z(){E&&E.stop(),d&&d()}function $(Y){L||(Y=-Y),n+=Y,T||(V=K.next(Math.max(0,n)),O&&(V.value=O(V.value)),T=L?V.done:n<=0),m&&m(V.value),T&&(_===0&&(k=k!==void 0?k:n),_{u&&u(),E&&E.stop()},set currentTime(Y){n=w,$(Y)},sample:Y=>{n=w;const Q=e&&typeof e=="number"?Math.max(e*.5,50):50;let q=0;for($(0);q<=Y;){const X=Y-q;$(Math.min(X,Q)),q+=Q}return V}}}function che(e){return!e||Array.isArray(e)||typeof e=="string"&&CB[e]}const c1=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,CB={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:c1([0,.65,.55,1]),circOut:c1([.55,0,1,.45]),backIn:c1([.31,.01,.66,-.59]),backOut:c1([.33,1.53,.69,.99])};function dhe(e){if(e)return Array.isArray(e)?c1(e):CB[e]}function fhe(e,t,n,{delay:r=0,duration:i,repeat:o=0,repeatType:a="loop",ease:s,times:l}={}){return e.animate({[t]:n,offset:l},{delay:r,duration:i,easing:dhe(s),fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"})}const VL={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},rC={},_B={};for(const e in VL)_B[e]=()=>(rC[e]===void 0&&(rC[e]=VL[e]()),rC[e]);function hhe(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const phe=new Set(["opacity"]),Wb=10;function ghe(e,t,{onUpdate:n,onComplete:r,...i}){if(!(_B.waapi()&&phe.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0))return!1;let{keyframes:a,duration:s=300,elapsed:l=0,ease:u}=i;if(i.type==="spring"||!che(i.ease)){if(i.repeat===1/0)return;const p=i3({...i,elapsed:0});let m={done:!1,value:a[0]};const y=[];let b=0;for(;!m.done&&b<2e4;)m=p.sample(b),y.push(m.value),b+=Wb;a=y,s=b-Wb,u="linear"}const d=fhe(e.owner.current,t,a,{...i,delay:-l,duration:s,ease:u});return d.onfinish=()=>{e.set(hhe(a,i)),so.update(()=>d.cancel()),r&&r()},{get currentTime(){return d.currentTime||0},set currentTime(p){d.currentTime=p},stop:()=>{const{currentTime:p}=d;if(p){const m=i3({...i,autoplay:!1});e.setWithVelocity(m.sample(p-Wb).value,m.sample(p).value,Wb)}so.update(()=>d.cancel())}}}function kB(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Gd.read(r),e(o-t))};return so.read(r,!0),()=>Gd.read(r)}function mhe({keyframes:e,elapsed:t,onUpdate:n,onComplete:r}){const i=()=>{n&&n(e[e.length-1]),r&&r()};return t?{stop:kB(i,-t)}:i()}function vhe({keyframes:e,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:d,onUpdate:p,onComplete:m,onStop:y}){const b=e[0];let w;function E(L){return n!==void 0&&Lr}function _(L){return n===void 0?r:r===void 0||Math.abs(n-L){p&&p(O),L.onUpdate&&L.onUpdate(O)},onComplete:m,onStop:y})}function T(L){k({type:"spring",stiffness:a,damping:s,restDelta:l,...L})}if(E(b))T({velocity:t,keyframes:[b,_(b)]});else{let L=i*t+b;typeof u<"u"&&(L=u(L));const O=_(L),D=O===n?-1:1;let I,N;const V=B=>{I=N,N=B,t=K9(B-I,qu.delta),(D===1&&B>O||D===-1&&Bw&&w.stop()}}const nh=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Vb=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),iC=()=>({type:"keyframes",ease:"linear",duration:.3}),yhe={type:"keyframes",duration:.8},UL={x:nh,y:nh,z:nh,rotate:nh,rotateX:nh,rotateY:nh,rotateZ:nh,scaleX:Vb,scaleY:Vb,scale:Vb,opacity:iC,backgroundColor:iC,color:iC,default:Vb},bhe=(e,{keyframes:t})=>t.length>2?yhe:(UL[e]||UL.default)(t[1]),A_=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&qd.test(t)&&!t.startsWith("url("));function xhe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:u,...d}){return!!Object.keys(d).length}function GL(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function qL(e){return typeof e=="number"?0:Z9("",e)}function EB(e,t){return e[t]||e.default||e}function She(e,t,n,r){const i=A_(t,n);let o=r.from!==void 0?r.from:e.get();return o==="none"&&i&&typeof n=="string"?o=Z9(t,n):GL(o)&&typeof n=="string"?o=qL(n):!Array.isArray(n)&&GL(n)&&typeof o=="string"&&(n=qL(o)),Array.isArray(n)?(n[0]===null&&(n[0]=o),n):[o,n]}const i8=(e,t,n,r={})=>i=>{const o=EB(r,e)||{},a=o.delay||r.delay||0;let{elapsed:s=0}=r;s=s-Qx(a);const l=She(t,e,n,o),u=l[0],d=l[l.length-1],p=A_(e,u),m=A_(e,d);let y={keyframes:l,velocity:t.getVelocity(),...o,elapsed:s,onUpdate:b=>{t.set(b),o.onUpdate&&o.onUpdate(b)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(!p||!m||Mfe.current||o.type===!1)return mhe(y);if(o.type==="inertia")return vhe(y);if(xhe(o)||(y={...y,...bhe(e,y)}),y.duration&&(y.duration=Qx(y.duration)),y.repeatDelay&&(y.repeatDelay=Qx(y.repeatDelay)),t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const b=ghe(t,e,y);if(b)return b}return i3(y)};function whe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>O_(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=O_(e,t,n);else{const i=typeof t=="function"?Dw(e,t,n.custom):t;r=PB(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))}function O_(e,t,n={}){const r=Dw(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>PB(e,r,n):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:p}=i;return Che(e,t,u+l,d,p,n)}:()=>Promise.resolve(),{when:s}=i;if(s){const[l,u]=s==="beforeChildren"?[o,a]:[a,o];return l().then(u)}else return Promise.all([o(),a(n.delay)])}function PB(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...s}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(o=r);const u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const p in s){const m=e.getValue(p),y=s[p];if(!m||y===void 0||d&&khe(d,p))continue;const b={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!m.hasAnimated){const E=e.getProps()[Pfe];E&&(b.elapsed=window.HandoffAppearAnimations(E,p,m,so))}let w=m.start(i8(p,m,y,e.shouldReduceMotion&&c0.has(p)?{type:!1}:b));t3(l)&&(l.add(p),w=w.then(()=>l.remove(p))),u.push(w)}return Promise.all(u).then(()=>{a&&wfe(e,a)})}function Che(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(_he).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(O_(u,t,{...o,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function _he(e,t){return e.sortNodePosition(t)}function khe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const o8=[tr.Animate,tr.InView,tr.Focus,tr.Hover,tr.Tap,tr.Drag,tr.Exit],Ehe=[...o8].reverse(),Phe=o8.length;function The(e){return t=>Promise.all(t.map(({animation:n,options:r})=>whe(e,n,r)))}function Mhe(e){let t=The(e);const n=Ahe();let r=!0;const i=(l,u)=>{const d=Dw(e,u);if(d){const{transition:p,transitionEnd:m,...y}=d;l={...l,...y,...m}}return l};function o(l){t=l(e)}function a(l,u){const d=e.getProps(),p=e.getVariantContext(!0)||{},m=[],y=new Set;let b={},w=1/0;for(let _=0;_w&&O;const B=Array.isArray(L)?L:[L];let K=B.reduce(i,{});D===!1&&(K={});const{prevResolvedValues:ne={}}=T,z={...ne,...K},$=H=>{V=!0,y.delete(H),T.needsAnimating[H]=!0};for(const H in z){const Y=K[H],Q=ne[H];b.hasOwnProperty(H)||(Y!==Q?JS(Y)&&JS(Q)?!tB(Y,Q)||N?$(H):T.protectedKeys[H]=!0:Y!==void 0?$(H):y.add(H):Y!==void 0&&y.has(H)?$(H):T.protectedKeys[H]=!0)}T.prevProp=L,T.prevResolvedValues=K,T.isActive&&(b={...b,...K}),r&&e.blockInitialAnimation&&(V=!1),V&&!I&&m.push(...B.map(H=>({animation:H,options:{type:k,...l}})))}if(y.size){const _={};y.forEach(k=>{const T=e.getBaseTarget(k);T!==void 0&&(_[k]=T)}),m.push({animation:_})}let E=Boolean(m.length);return r&&d.initial===!1&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,E?t(m):Promise.resolve()}function s(l,u,d){if(n[l].isActive===u)return Promise.resolve();e.variantChildren&&e.variantChildren.forEach(m=>{m.animationState&&m.animationState.setActive(l,u)}),n[l].isActive=u;const p=a(d,l);for(const m in n)n[m].protectedKeys={};return p}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function Lhe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!tB(t,e):!1}function rh(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ahe(){return{[tr.Animate]:rh(!0),[tr.InView]:rh(),[tr.Hover]:rh(),[tr.Tap]:rh(),[tr.Drag]:rh(),[tr.Focus]:rh(),[tr.Exit]:rh()}}class Ohe extends sf{constructor(t){super(t),t.animationState||(t.animationState=Mhe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),Lw(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let Rhe=0;class Ihe extends sf{constructor(){super(...arguments),this.id=Rhe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const o=this.node.animationState.setActive(tr.Exit,!t,{custom:r??this.node.getProps().custom});n&&!t&&o.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const Dhe={animation:{Feature:Ohe},exit:{Feature:Ihe}},KL=(e,t)=>Math.abs(e-t);function jhe(e,t){const n=KL(e.x,t.x),r=KL(e.y,t.y);return Math.sqrt(n**2+r**2)}class TB{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=aC(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,p=jhe(u.offset,{x:0,y:0})>=3;if(!d&&!p)return;const{point:m}=u,{timestamp:y}=qu;this.history.push({...m,timestamp:y});const{onStart:b,onMove:w}=this.handlers;d||(b&&b(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=oC(d,this.transformPagePoint),so.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:p,onSessionEnd:m}=this.handlers,y=aC(u.type==="pointercancel"?this.lastMoveEventInfo:oC(d,this.transformPagePoint),this.history);this.startEvent&&p&&p(u,y),m&&m(u,y)},!XF(t))return;this.handlers=n,this.transformPagePoint=r;const i=Rw(t),o=oC(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=qu;this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,aC(o,this.history)),this.removeListeners=Nd(Gu(window,"pointermove",this.handlePointerMove),Gu(window,"pointerup",this.handlePointerUp),Gu(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Gd.update(this.updatePoint)}}function oC(e,t){return t?{point:t(e.point)}:e}function YL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function aC({point:e},t){return{point:e,delta:YL(e,MB(t)),offset:YL(e,Nhe(t)),velocity:$he(t,.1)}}function Nhe(e){return e[0]}function MB(e){return e[e.length-1]}function $he(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=MB(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Qx(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function La(e){return e.max-e.min}function R_(e,t=0,n=.01){return Math.abs(e-t)<=n}function XL(e,t,n,r=.5){e.origin=r,e.originPoint=Fr(t.min,t.max,e.origin),e.scale=La(n)/La(t),(R_(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Fr(n.min,n.max,e.origin)-e.originPoint,(R_(e.translate)||isNaN(e.translate))&&(e.translate=0)}function F1(e,t,n,r){XL(e.x,t.x,n.x,r?r.originX:void 0),XL(e.y,t.y,n.y,r?r.originY:void 0)}function ZL(e,t,n){e.min=n.min+t.min,e.max=e.min+La(t)}function Fhe(e,t,n){ZL(e.x,t.x,n.x),ZL(e.y,t.y,n.y)}function QL(e,t,n){e.min=t.min-n.min,e.max=e.min+La(t)}function B1(e,t,n){QL(e.x,t.x,n.x),QL(e.y,t.y,n.y)}function Bhe(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Fr(n,e,r.max):Math.min(e,n)),e}function JL(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function zhe(e,{top:t,left:n,bottom:r,right:i}){return{x:JL(e.x,n,i),y:JL(e.y,t,r)}}function eA(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=r3(t.min,t.max-r,e.min):r>i&&(n=r3(e.min,e.max-i,t.min)),Vm(0,1,n)}function Vhe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const I_=.35;function Uhe(e=I_){return e===!1?e=0:e===!0&&(e=I_),{x:tA(e,"left","right"),y:tA(e,"top","bottom")}}function tA(e,t,n){return{min:nA(e,t),max:nA(e,n)}}function nA(e,t){return typeof e=="number"?e:e[t]||0}const rA=()=>({translate:0,scale:1,origin:0,originPoint:0}),z1=()=>({x:rA(),y:rA()}),iA=()=>({min:0,max:0}),gi=()=>({x:iA(),y:iA()});function Al(e){return[e("x"),e("y")]}function LB({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ghe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function qhe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function sC(e){return e===void 0||e===1}function D_({scale:e,scaleX:t,scaleY:n}){return!sC(e)||!sC(t)||!sC(n)}function dh(e){return D_(e)||AB(e)||e.z||e.rotate||e.rotateX||e.rotateY}function AB(e){return oA(e.x)||oA(e.y)}function oA(e){return e&&e!=="0%"}function o3(e,t,n){const r=e-n,i=t*r;return n+i}function aA(e,t,n,r,i){return i!==void 0&&(e=o3(e,i,r)),o3(e,n,r)+t}function j_(e,t=0,n=1,r,i){e.min=aA(e.min,t,n,r,i),e.max=aA(e.max,t,n,r,i)}function OB(e,{x:t,y:n}){j_(e.x,t.translate,t.scale,t.originPoint),j_(e.y,n.translate,n.scale,n.originPoint)}function Khe(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,a;for(let s=0;s1.0000000000001||e<.999999999999?e:1}function gd(e,t){e.min=e.min+t,e.max=e.max+t}function lA(e,t,[n,r,i]){const o=t[i]!==void 0?t[i]:.5,a=Fr(e.min,e.max,o);j_(e,t[n],t[r],a,t.scale)}const Yhe=["x","scaleX","originX"],Xhe=["y","scaleY","originY"];function em(e,t){lA(e.x,t,Yhe),lA(e.y,t,Xhe)}function RB(e,t){return LB(qhe(e.getBoundingClientRect(),t))}function Zhe(e,t,n){const r=RB(e,n),{scroll:i}=t;return i&&(gd(r.x,i.offset.x),gd(r.y,i.offset.y)),r}const Qhe=new WeakMap;class Jhe{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=gi(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=l=>{this.stopAnimation(),n&&this.snapToCursor(Rw(l,"page").point)},o=(l,u)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=QF(d),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Al(b=>{let w=this.getAxisMotionValue(b).get()||0;if(Yl.test(w)){const{projection:E}=this.visualElement;if(E&&E.layout){const _=E.layout.layoutBox[b];_&&(w=La(_)*(parseFloat(w)/100))}}this.originPoint[b]=w}),m&&m(l,u);const{animationState:y}=this.visualElement;y&&y.setActive(tr.Drag,!0)},a=(l,u)=>{const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:b}=u;if(p&&this.currentDirection===null){this.currentDirection=epe(b),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",u.point,b),this.updateAxis("y",u.point,b),this.visualElement.render(),y&&y(l,u)},s=(l,u)=>this.stop(l,u);this.panSession=new TB(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:s},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&o(t,n)}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive(tr.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Ub(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Bhe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Qg(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=zhe(r.layoutBox,t):this.constraints=!1,this.elastic=Uhe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Al(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Vhe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Qg(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Zhe(r,i.root,this.visualElement.getTransformPagePoint());let a=Hhe(i.layout.layoutBox,o);if(n){const s=n(Ghe(a));this.hasMutatedConstraints=!!s,s&&(a=LB(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Al(d=>{if(!Ub(d,n,this.currentDirection))return;let p=l&&l[d]||{};a&&(p={min:0,max:0});const m=i?200:1e6,y=i?40:1e7,b={type:"inertia",velocity:r?t[d]:0,bounceStiffness:m,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...o,...p};return this.startAxisValueAnimation(d,b)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(i8(t,r,0,n))}stopAnimation(){Al(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Al(n=>{const{drag:r}=this.getProps();if(!Ub(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-Fr(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Qg(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Al(a=>{const s=this.getAxisMotionValue(a);if(s){const l=s.get();i[a]=Whe({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Al(a=>{if(!Ub(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(Fr(l,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;Qhe.set(this.visualElement,this);const t=this.visualElement.current,n=Gu(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Qg(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),r();const a=Hu(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Al(d=>{const p=this.getAxisMotionValue(d);p&&(this.originPoint[d]+=l[d].translate,p.set(p.get()+l[d].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=I_,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function Ub(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function epe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class tpe extends sf{constructor(t){super(t),this.removeGroupControls=Xl,this.removeListeners=Xl,this.controls=new Jhe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xl}unmount(){this.removeGroupControls(),this.removeListeners()}}class npe extends sf{constructor(){super(...arguments),this.removePointerDownListener=Xl}onPointerDown(t){this.session=new TB(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:t,onStart:n,onMove:r,onEnd:(o,a)=>{delete this.session,i&&i(o,a)}}}mount(){this.removePointerDownListener=Gu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function IB(){const e=S.useContext(r2);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=S.useId();return S.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function rpe(){return ipe(S.useContext(r2))}function ipe(e){return e===null?!0:e.isPresent}function uA(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Hv={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Pt.test(e))e=parseFloat(e);else return e;const n=uA(e,t.target.x),r=uA(e,t.target.y);return`${n}% ${r}%`}};function N_(e){return typeof e=="string"&&e.startsWith("var(--")}const DB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function ope(e){const t=DB.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function $_(e,t,n=1){const[r,i]=ope(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():N_(i)?$_(i,t,n+1):i}function ape(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!N_(o))return;const a=$_(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!N_(o))continue;const a=$_(o,r);a&&(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const cA="_$css",spe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(DB,y=>(o.push(y),cA)));const a=qd.parse(e);if(a.length>5)return r;const s=qd.createTransformer(e),l=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=d;const p=Fr(u,d,.5);typeof a[2+l]=="number"&&(a[2+l]/=p),typeof a[3+l]=="number"&&(a[3+l]/=p);let m=s(a);if(i){let y=0;m=m.replace(cA,()=>{const b=o[y];return y++,b})}return m}};class lpe extends qe.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;fde(upe),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),j1.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||so.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function jB(e){const[t,n]=IB(),r=S.useContext(j9);return qe.createElement(lpe,{...e,layoutGroup:r,switchLayoutGroup:S.useContext($F),isPresent:t,safeToRemove:n})}const upe={borderRadius:{...Hv,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Hv,borderTopRightRadius:Hv,borderBottomLeftRadius:Hv,borderBottomRightRadius:Hv,boxShadow:spe};function cpe(e,t,n={}){const r=ta(e)?e:Um(e);return r.start(i8("",r,t,n)),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const NB=["TopLeft","TopRight","BottomLeft","BottomRight"],dpe=NB.length,dA=e=>typeof e=="string"?parseFloat(e):e,fA=e=>typeof e=="number"||Pt.test(e);function fpe(e,t,n,r,i,o){i?(e.opacity=Fr(0,n.opacity!==void 0?n.opacity:1,hpe(r)),e.opacityExit=Fr(t.opacity!==void 0?t.opacity:1,0,ppe(r))):o&&(e.opacity=Fr(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(r3(e,t,r))}function pA(e,t){e.min=t.min,e.max=t.max}function Ns(e,t){pA(e.x,t.x),pA(e.y,t.y)}function gA(e,t,n,r,i){return e-=t,e=o3(e,1/n,r),i!==void 0&&(e=o3(e,1/i,r)),e}function gpe(e,t=0,n=1,r=.5,i,o=e,a=e){if(Yl.test(t)&&(t=parseFloat(t),t=Fr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=Fr(o.min,o.max,r);e===o&&(s-=t),e.min=gA(e.min,t,n,s,i),e.max=gA(e.max,t,n,s,i)}function mA(e,t,[n,r,i],o,a){gpe(e,t[n],t[r],t[i],t.scale,o,a)}const mpe=["x","scaleX","originX"],vpe=["y","scaleY","originY"];function vA(e,t,n,r){mA(e.x,t,mpe,n?n.x:void 0,r?r.x:void 0),mA(e.y,t,vpe,n?n.y:void 0,r?r.y:void 0)}function yA(e){return e.translate===0&&e.scale===1}function FB(e){return yA(e.x)&&yA(e.y)}function BB(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function bA(e){return La(e.x)/La(e.y)}class ype{constructor(){this.members=[]}add(t){U9(this.members,t),t.scheduleRender()}remove(t){if(G9(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function xA(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:d}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),d&&(r+=`rotateY(${d}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const bpe=(e,t)=>e.depth-t.depth;class xpe{constructor(){this.children=[],this.isDirty=!1}add(t){U9(this.children,t),this.isDirty=!0}remove(t){G9(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(bpe),this.isDirty=!1,this.children.forEach(t)}}const SA=["","X","Y","Z"],wA=1e3;let Spe=0;function zB({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t==null?void 0:t()){this.id=Spe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(_pe),this.nodes.forEach(Ppe),this.nodes.forEach(Tpe)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let u=0;uthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=kB(m,250),j1.hasAnimatedSinceResize&&(j1.hasAnimatedSinceResize=!1,this.nodes.forEach(_A))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:m,hasRelativeTargetChanged:y,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||Rpe,{onLayoutAnimationStart:E,onLayoutAnimationComplete:_}=d.getProps(),k=!this.targetLayout||!BB(this.targetLayout,b)||y,T=!m&&y;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||T||m&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,T);const L={...EB(w,"layout"),onPlay:E,onComplete:_};(d.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else!m&&this.animationProgress===0&&_A(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Gd.preRender(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(Mpe),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const L=T/1e3;kA(p.x,a.x,L),kA(p.y,a.y,L),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(B1(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ape(this.relativeTarget,this.relativeTargetOrigin,m,L)),w&&(this.animationValues=d,fpe(d,u,this.latestValues,L,k,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Gd.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=so.update(()=>{j1.hasAnimatedSinceResize=!0,this.currentAnimation=cpe(0,wA,{...a,onUpdate:s=>{this.mixTargetDelta(s),a.onUpdate&&a.onUpdate(s)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(wA),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:d}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&HB(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||gi();const p=La(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+p;const m=La(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+m}Ns(s,l),em(s,d),F1(this.projectionDeltaWithTransform,this.layoutCorrected,s,d)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new ype),this.sharedNodes.get(a).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let d=0;d{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(CA),this.root.sharedNodes.clear()}}}function wpe(e){e.updateLayout()}function Cpe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,a=n.source!==e.layout.source;o==="size"?Al(p=>{const m=a?n.measuredBox[p]:n.layoutBox[p],y=La(m);m.min=r[p].min,m.max=m.min+y}):HB(o,n.layoutBox,r)&&Al(p=>{const m=a?n.measuredBox[p]:n.layoutBox[p],y=La(r[p]);m.max=m.min+y});const s=z1();F1(s,r,n.layoutBox);const l=z1();a?F1(l,e.applyTransform(i,!0),n.measuredBox):F1(l,r,n.layoutBox);const u=!FB(s);let d=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:y}=p;if(m&&y){const b=gi();B1(b,n.layoutBox,m.layoutBox);const w=gi();B1(w,r,y.layoutBox),BB(b,w)||(d=!0),p.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=b,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function _pe(e){e.isProjectionDirty||(e.isProjectionDirty=Boolean(e.parent&&e.parent.isProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=Boolean(e.parent&&e.parent.isTransformDirty))}function kpe(e){e.clearSnapshot()}function CA(e){e.clearMeasurements()}function Epe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function _A(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Ppe(e){e.resolveTargetDelta()}function Tpe(e){e.calcProjection()}function Mpe(e){e.resetRotation()}function Lpe(e){e.removeLeadSnapshot()}function kA(e,t,n){e.translate=Fr(t.translate,0,n),e.scale=Fr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function EA(e,t,n,r){e.min=Fr(t.min,n.min,r),e.max=Fr(t.max,n.max,r)}function Ape(e,t,n,r){EA(e.x,t.x,n.x,r),EA(e.y,t.y,n.y,r)}function Ope(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Rpe={duration:.45,ease:[.4,0,.1,1]};function Ipe(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function PA(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function Dpe(e){PA(e.x),PA(e.y)}function HB(e,t,n){return e==="position"||e==="preserve-aspect"&&!R_(bA(t),bA(n),.2)}const jpe=zB({attachResizeListener:(e,t)=>Hu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lC={current:void 0},WB=zB({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lC.current){const e=new jpe(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),lC.current=e}return lC.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),Npe={pan:{Feature:npe},drag:{Feature:tpe,ProjectionNode:WB,MeasureLayout:jB}},$pe=new Set(["width","height","top","left","right","bottom","x","y"]),VB=e=>$pe.has(e),Fpe=e=>Object.keys(e).some(VB),TA=e=>e===np||e===Pt;var MA;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(MA||(MA={}));const LA=(e,t)=>parseFloat(e.split(", ")[t]),AA=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return LA(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?LA(o[1],e):0}},Bpe=new Set(["x","y","z"]),zpe=Ow.filter(e=>!Bpe.has(e));function Hpe(e){const t=[];return zpe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const OA={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:AA(4,13),y:AA(5,14)},Wpe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=OA[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const d=t.getValue(u);d&&d.jump(s[u]),e[u]=OA[u](l,o)}),e},Vpe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(VB);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let d=n[l],p=zv(d);const m=t[l];let y;if(JS(m)){const b=m.length,w=m[0]===null?1:0;d=m[w],p=zv(d);for(let E=w;E=0?window.pageYOffset:null,u=Wpe(t,e,s);return o.length&&o.forEach(([d,p])=>{e.getValue(d).set(p)}),e.render(),Mw&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function Upe(e,t,n,r){return Fpe(t)?Vpe(e,t,n,r):{target:t,transitionEnd:r}}const Gpe=(e,t,n,r)=>{const i=ape(e,t,r);return t=i.target,r=i.transitionEnd,Upe(e,t,n,r)},F_={current:null},UB={current:!1};function qpe(){if(UB.current=!0,!!Mw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>F_.current=e.matches;e.addListener(t),t()}else F_.current=!1}function Kpe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(ta(o))e.addValue(i,o),t3(r)&&r.add(i);else if(ta(a))e.addValue(i,Um(o,{owner:e})),t3(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,Um(s!==void 0?s:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const GB=Object.keys(ky),Ype=GB.length,RA=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Xpe{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,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.scheduleRender=()=>so.render(this.render,!1,!0);const{latestValues:s,renderState:l}=o;this.latestValues=s,this.baseTarget={...s},this.initialValues=n.initial?{...s}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.isControllingVariants=Aw(n),this.isVariantNode=NF(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{});for(const p in d){const m=d[p];s[p]!==void 0&&ta(m)&&(m.set(s[p],!1),t3(u)&&u.add(p))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),UB.current||qpe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:F_.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Gd.update(this.notifyUpdate),Gd.render(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=c0.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&so.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,i,o,a){let s,l;for(let u=0;uthis.scheduleRender(),animationType:typeof d=="string"?d:"both",initialPromotionConfig:a,layoutScroll:y,layoutRoot:b})}return l}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update(this.props,this.prevProps):(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):gi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Um(n,{owner:this}),this.addValue(t,r)),r}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=V9(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!ta(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new q9),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}const qB=["initial",...o8],Zpe=qB.length;class KB extends Xpe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=kfe(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){Cfe(this,r,a);const s=Gpe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function Qpe(e){return window.getComputedStyle(e)}class Jpe extends KB{readValueFromInstance(t,n){if(c0.has(n)){const r=X9(n);return r&&r.default||0}else{const r=Qpe(t),i=(BF(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return RB(t,n)}build(t,n,r,i){$9(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return W9(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ta(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){UF(t,n,r,i)}}class ege extends KB{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(c0.has(n)){const r=X9(n);return r&&r.default||0}return n=GF.has(n)?n:H9(n),t.getAttribute(n)}measureInstanceViewportBox(){return gi()}scrapeMotionValuesFromProps(t,n){return KF(t,n)}build(t,n,r,i){B9(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){qF(t,n,r,i)}mount(t){this.isSVGTag=z9(t.tagName),super.mount(t)}}const tge=(e,t)=>N9(e)?new ege(t,{enableHardwareAcceleration:!1}):new Jpe(t,{enableHardwareAcceleration:!0}),nge={layout:{ProjectionNode:WB,MeasureLayout:jB}},rge={...Dhe,...Zde,...Npe,...nge},su=cde((e,t)=>$de(e,t,rge,tge));function YB(){const e=S.useRef(!1);return XS(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ige(){const e=YB(),[t,n]=S.useState(0),r=S.useCallback(()=>{e.current&&n(t+1)},[t]);return[S.useCallback(()=>so.postRender(r),[r]),t]}class oge extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function age({children:e,isPresent:t}){const n=S.useId(),r=S.useRef(null),i=S.useRef({width:0,height:0,top:0,left:0});return S.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` + )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},Cae={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},_ae=e=>({bg:wt("gray.100","whiteAlpha.300")(e)}),kae=e=>({transitionProperty:"common",transitionDuration:"slow",...wae(e)}),Eae=u1(e=>({label:Cae,filledTrack:kae(e),track:_ae(e)})),Pae={xs:u1({track:{h:"1"}}),sm:u1({track:{h:"2"}}),md:u1({track:{h:"3"}}),lg:u1({track:{h:"4"}})},Tae=Sae({sizes:Pae,baseStyle:Eae,defaultProps:{size:"md",colorScheme:"blue"}}),Mae=e=>typeof e=="function";function Eo(e,...t){return Mae(e)?e(...t):e}var{definePartsStyle:qx,defineMultiStyleConfig:Lae}=dr(wie.keys),I1=gn("checkbox-size"),Aae=e=>{const{colorScheme:t}=e;return{w:I1.reference,h:I1.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:wt(`${t}.500`,`${t}.200`)(e),borderColor:wt(`${t}.500`,`${t}.200`)(e),color:wt("white","gray.900")(e),_hover:{bg:wt(`${t}.600`,`${t}.300`)(e),borderColor:wt(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:wt("gray.200","transparent")(e),bg:wt("gray.200","whiteAlpha.300")(e),color:wt("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:wt(`${t}.500`,`${t}.200`)(e),borderColor:wt(`${t}.500`,`${t}.200`)(e),color:wt("white","gray.900")(e)},_disabled:{bg:wt("gray.100","whiteAlpha.100")(e),borderColor:wt("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:wt("red.500","red.300")(e)}}},Oae={_disabled:{cursor:"not-allowed"}},Rae={userSelect:"none",_disabled:{opacity:.4}},Iae={transitionProperty:"transform",transitionDuration:"normal"},Dae=qx(e=>({icon:Iae,container:Oae,control:Eo(Aae,e),label:Rae})),jae={sm:qx({control:{[I1.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:qx({control:{[I1.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:qx({control:{[I1.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},qS=Lae({baseStyle:Dae,sizes:jae,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Nae,definePartsStyle:Kx}=dr(Iie.keys),$ae=e=>{var t;const n=(t=Eo(qS.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Fae=Kx(e=>{var t,n,r,i;return{label:(n=(t=qS).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=qS).baseStyle)==null?void 0:i.call(r,e).container,control:$ae(e)}}),Bae={md:Kx({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:Kx({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:Kx({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},zae=Nae({baseStyle:Fae,sizes:Bae,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Hae,definePartsStyle:Wae}=dr(Die.keys),$b=gn("select-bg"),hL,Uae={...(hL=xn.baseStyle)==null?void 0:hL.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:$b.reference,[$b.variable]:"colors.white",_dark:{[$b.variable]:"colors.gray.700"},"> option, > optgroup":{bg:$b.reference}},Vae={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},Gae=Wae({field:Uae,icon:Vae}),Fb={paddingInlineEnd:"8"},pL,gL,mL,vL,yL,bL,xL,SL,qae={lg:{...(pL=xn.sizes)==null?void 0:pL.lg,field:{...(gL=xn.sizes)==null?void 0:gL.lg.field,...Fb}},md:{...(mL=xn.sizes)==null?void 0:mL.md,field:{...(vL=xn.sizes)==null?void 0:vL.md.field,...Fb}},sm:{...(yL=xn.sizes)==null?void 0:yL.sm,field:{...(bL=xn.sizes)==null?void 0:bL.sm.field,...Fb}},xs:{...(xL=xn.sizes)==null?void 0:xL.xs,field:{...(SL=xn.sizes)==null?void 0:SL.xs.field,...Fb},icon:{insetEnd:"1"}}},Kae=Hae({baseStyle:Gae,sizes:qae,variants:xn.variants,defaultProps:xn.defaultProps}),$5=gn("skeleton-start-color"),F5=gn("skeleton-end-color"),Yae={[$5.variable]:"colors.gray.100",[F5.variable]:"colors.gray.400",_dark:{[$5.variable]:"colors.gray.800",[F5.variable]:"colors.gray.600"},background:$5.reference,borderColor:F5.reference,opacity:.7,borderRadius:"sm"},Xae={baseStyle:Yae},B5=gn("skip-link-bg"),Zae={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[B5.variable]:"colors.white",_dark:{[B5.variable]:"colors.gray.700"},bg:B5.reference}},Qae={baseStyle:Zae},{defineMultiStyleConfig:Jae,definePartsStyle:Ew}=dr(jie.keys),Sy=gn("slider-thumb-size"),wy=gn("slider-track-size"),bd=gn("slider-bg"),ese=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...A9({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},tse=e=>({...A9({orientation:e.orientation,horizontal:{h:wy.reference},vertical:{w:wy.reference}}),overflow:"hidden",borderRadius:"sm",[bd.variable]:"colors.gray.200",_dark:{[bd.variable]:"colors.whiteAlpha.200"},_disabled:{[bd.variable]:"colors.gray.300",_dark:{[bd.variable]:"colors.whiteAlpha.300"}},bg:bd.reference}),nse=e=>{const{orientation:t}=e;return{...A9({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:Sy.reference,h:Sy.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},rse=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[bd.variable]:`colors.${t}.500`,_dark:{[bd.variable]:`colors.${t}.200`},bg:bd.reference}},ise=Ew(e=>({container:ese(e),track:tse(e),thumb:nse(e),filledTrack:rse(e)})),ose=Ew({container:{[Sy.variable]:"sizes.4",[wy.variable]:"sizes.1"}}),ase=Ew({container:{[Sy.variable]:"sizes.3.5",[wy.variable]:"sizes.1"}}),sse=Ew({container:{[Sy.variable]:"sizes.2.5",[wy.variable]:"sizes.0.5"}}),lse={lg:ose,md:ase,sm:sse},use=Jae({baseStyle:ise,sizes:lse,defaultProps:{size:"md",colorScheme:"blue"}}),xh=yi("spinner-size"),cse={width:[xh.reference],height:[xh.reference]},dse={xs:{[xh.variable]:"sizes.3"},sm:{[xh.variable]:"sizes.4"},md:{[xh.variable]:"sizes.6"},lg:{[xh.variable]:"sizes.8"},xl:{[xh.variable]:"sizes.12"}},fse={baseStyle:cse,sizes:dse,defaultProps:{size:"md"}},{defineMultiStyleConfig:hse,definePartsStyle:vF}=dr(Nie.keys),pse={fontWeight:"medium"},gse={opacity:.8,marginBottom:"2"},mse={verticalAlign:"baseline",fontWeight:"semibold"},vse={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},yse=vF({container:{},label:pse,helpText:gse,number:mse,icon:vse}),bse={md:vF({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},xse=hse({baseStyle:yse,sizes:bse,defaultProps:{size:"md"}}),z5=gn("kbd-bg"),Sse={[z5.variable]:"colors.gray.100",_dark:{[z5.variable]:"colors.whiteAlpha.100"},bg:z5.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},wse={baseStyle:Sse},Cse={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},_se={baseStyle:Cse},{defineMultiStyleConfig:kse,definePartsStyle:Ese}=dr(Tie.keys),Pse={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Tse=Ese({icon:Pse}),Mse=kse({baseStyle:Tse}),{defineMultiStyleConfig:Lse,definePartsStyle:Ase}=dr(Mie.keys),Rl=gn("menu-bg"),H5=gn("menu-shadow"),Ose={[Rl.variable]:"#fff",[H5.variable]:"shadows.sm",_dark:{[Rl.variable]:"colors.gray.700",[H5.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:Rl.reference,boxShadow:H5.reference},Rse={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Rl.variable]:"colors.gray.100",_dark:{[Rl.variable]:"colors.whiteAlpha.100"}},_active:{[Rl.variable]:"colors.gray.200",_dark:{[Rl.variable]:"colors.whiteAlpha.200"}},_expanded:{[Rl.variable]:"colors.gray.100",_dark:{[Rl.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Rl.reference},Ise={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},Dse={opacity:.6},jse={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},Nse={transitionProperty:"common",transitionDuration:"normal"},$se=Ase({button:Nse,list:Ose,item:Rse,groupTitle:Ise,command:Dse,divider:jse}),Fse=Lse({baseStyle:$se}),{defineMultiStyleConfig:Bse,definePartsStyle:b_}=dr(Lie.keys),zse={bg:"blackAlpha.600",zIndex:"modal"},Hse=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},Wse=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:wt("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:wt("lg","dark-lg")(e)}},Use={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Vse={position:"absolute",top:"2",insetEnd:"3"},Gse=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},qse={px:"6",py:"4"},Kse=b_(e=>({overlay:zse,dialogContainer:Eo(Hse,e),dialog:Eo(Wse,e),header:Use,closeButton:Vse,body:Eo(Gse,e),footer:qse}));function js(e){return b_(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var Yse={xs:js("xs"),sm:js("sm"),md:js("md"),lg:js("lg"),xl:js("xl"),"2xl":js("2xl"),"3xl":js("3xl"),"4xl":js("4xl"),"5xl":js("5xl"),"6xl":js("6xl"),full:js("full")},Xse=Bse({baseStyle:Kse,sizes:Yse,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Zse,definePartsStyle:yF}=dr(Aie.keys),R9=yi("number-input-stepper-width"),bF=yi("number-input-input-padding"),Qse=Nu(R9).add("0.5rem").toString(),W5=yi("number-input-bg"),U5=yi("number-input-color"),V5=yi("number-input-border-color"),Jse={[R9.variable]:"sizes.6",[bF.variable]:Qse},ele=e=>{var t,n;return(n=(t=Eo(xn.baseStyle,e))==null?void 0:t.field)!=null?n:{}},tle={width:R9.reference},nle={borderStart:"1px solid",borderStartColor:V5.reference,color:U5.reference,bg:W5.reference,[U5.variable]:"colors.chakra-body-text",[V5.variable]:"colors.chakra-border-color",_dark:{[U5.variable]:"colors.whiteAlpha.800",[V5.variable]:"colors.whiteAlpha.300"},_active:{[W5.variable]:"colors.gray.200",_dark:{[W5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},rle=yF(e=>{var t;return{root:Jse,field:(t=Eo(ele,e))!=null?t:{},stepperGroup:tle,stepper:nle}});function Bb(e){var t,n,r;const i=(t=xn.sizes)==null?void 0:t[e],o={lg:"md",md:"md",sm:"sm",xs:"sm"},a=(r=(n=i.field)==null?void 0:n.fontSize)!=null?r:"md",s=fF.fontSizes[a];return yF({field:{...i.field,paddingInlineEnd:bF.reference,verticalAlign:"top"},stepper:{fontSize:Nu(s).multiply(.75).toString(),_first:{borderTopEndRadius:o[e]},_last:{borderBottomEndRadius:o[e],mt:"-1px",borderTopWidth:1}}})}var ile={xs:Bb("xs"),sm:Bb("sm"),md:Bb("md"),lg:Bb("lg")},ole=Zse({baseStyle:rle,sizes:ile,variants:xn.variants,defaultProps:xn.defaultProps}),wL,ale={...(wL=xn.baseStyle)==null?void 0:wL.field,textAlign:"center"},sle={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},CL,_L,lle={outline:e=>{var t,n,r;return(r=(n=Eo((t=xn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=Eo((t=xn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=Eo((t=xn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(_L=(CL=xn.variants)==null?void 0:CL.unstyled.field)!=null?_L:{}},ule={baseStyle:ale,sizes:sle,variants:lle,defaultProps:xn.defaultProps},{defineMultiStyleConfig:cle,definePartsStyle:dle}=dr(Oie.keys),zb=yi("popper-bg"),fle=yi("popper-arrow-bg"),kL=yi("popper-arrow-shadow-color"),hle={zIndex:10},ple={[zb.variable]:"colors.white",bg:zb.reference,[fle.variable]:zb.reference,[kL.variable]:"colors.gray.200",_dark:{[zb.variable]:"colors.gray.700",[kL.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},gle={px:3,py:2,borderBottomWidth:"1px"},mle={px:3,py:2},vle={px:3,py:2,borderTopWidth:"1px"},yle={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},ble=dle({popper:hle,content:ple,header:gle,body:mle,footer:vle,closeButton:yle}),xle=cle({baseStyle:ble}),{definePartsStyle:x_,defineMultiStyleConfig:Sle}=dr(Cie.keys),G5=gn("drawer-bg"),q5=gn("drawer-box-shadow");function bg(e){return x_(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var wle={bg:"blackAlpha.600",zIndex:"overlay"},Cle={display:"flex",zIndex:"modal",justifyContent:"center"},_le=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[G5.variable]:"colors.white",[q5.variable]:"shadows.lg",_dark:{[G5.variable]:"colors.gray.700",[q5.variable]:"shadows.dark-lg"},bg:G5.reference,boxShadow:q5.reference}},kle={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Ele={position:"absolute",top:"2",insetEnd:"3"},Ple={px:"6",py:"2",flex:"1",overflow:"auto"},Tle={px:"6",py:"4"},Mle=x_(e=>({overlay:wle,dialogContainer:Cle,dialog:Eo(_le,e),header:kle,closeButton:Ele,body:Ple,footer:Tle})),Lle={xs:bg("xs"),sm:bg("md"),md:bg("lg"),lg:bg("2xl"),xl:bg("4xl"),full:bg("full")},Ale=Sle({baseStyle:Mle,sizes:Lle,defaultProps:{size:"xs"}}),{definePartsStyle:Ole,defineMultiStyleConfig:Rle}=dr(_ie.keys),Ile={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},Dle={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},jle={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},Nle=Ole({preview:Ile,input:Dle,textarea:jle}),$le=Rle({baseStyle:Nle}),{definePartsStyle:Fle,defineMultiStyleConfig:Ble}=dr(kie.keys),xm=gn("form-control-color"),zle={marginStart:"1",[xm.variable]:"colors.red.500",_dark:{[xm.variable]:"colors.red.300"},color:xm.reference},Hle={mt:"2",[xm.variable]:"colors.gray.600",_dark:{[xm.variable]:"colors.whiteAlpha.600"},color:xm.reference,lineHeight:"normal",fontSize:"sm"},Wle=Fle({container:{width:"100%",position:"relative"},requiredIndicator:zle,helperText:Hle}),Ule=Ble({baseStyle:Wle}),{definePartsStyle:Vle,defineMultiStyleConfig:Gle}=dr(Eie.keys),Sm=gn("form-error-color"),qle={[Sm.variable]:"colors.red.500",_dark:{[Sm.variable]:"colors.red.300"},color:Sm.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},Kle={marginEnd:"0.5em",[Sm.variable]:"colors.red.500",_dark:{[Sm.variable]:"colors.red.300"},color:Sm.reference},Yle=Vle({text:qle,icon:Kle}),Xle=Gle({baseStyle:Yle}),Zle={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},Qle={baseStyle:Zle},Jle={fontFamily:"heading",fontWeight:"bold"},eue={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},tue={baseStyle:Jle,sizes:eue,defaultProps:{size:"xl"}},{defineMultiStyleConfig:nue,definePartsStyle:rue}=dr(Sie.keys),iue={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},oue=rue({link:iue}),aue=nue({baseStyle:oue}),sue={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},xF=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:wt("inherit","whiteAlpha.900")(e),_hover:{bg:wt("gray.100","whiteAlpha.200")(e)},_active:{bg:wt("gray.200","whiteAlpha.300")(e)}};const r=Wm(`${t}.200`,.12)(n),i=Wm(`${t}.200`,.24)(n);return{color:wt(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:wt(`${t}.50`,r)(e)},_active:{bg:wt(`${t}.100`,i)(e)}}},lue=e=>{const{colorScheme:t}=e,n=wt("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...Eo(xF,e)}},uue={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},cue=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=wt("gray.100","whiteAlpha.200")(e);return{bg:l,_hover:{bg:wt("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:wt("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:i="white",hoverBg:o=`${n}.600`,activeBg:a=`${n}.700`}=(t=uue[n])!=null?t:{},s=wt(r,`${n}.200`)(e);return{bg:s,color:wt(i,"gray.800")(e),_hover:{bg:wt(o,`${n}.300`)(e),_disabled:{bg:s}},_active:{bg:wt(a,`${n}.400`)(e)}}},due=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:wt(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:wt(`${t}.700`,`${t}.500`)(e)}}},fue={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},hue={ghost:xF,outline:lue,solid:cue,link:due,unstyled:fue},pue={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},gue={baseStyle:sue,variants:hue,sizes:pue,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Rh,defineMultiStyleConfig:mue}=dr(Hie.keys),KS=gn("card-bg"),Vu=gn("card-padding"),SF=gn("card-shadow"),Yx=gn("card-radius"),wF=gn("card-border-width","0"),CF=gn("card-border-color"),vue=Rh({container:{[KS.variable]:"colors.chakra-body-bg",backgroundColor:KS.reference,boxShadow:SF.reference,borderRadius:Yx.reference,color:"chakra-body-text",borderWidth:wF.reference,borderColor:CF.reference},body:{padding:Vu.reference,flex:"1 1 0%"},header:{padding:Vu.reference},footer:{padding:Vu.reference}}),yue={sm:Rh({container:{[Yx.variable]:"radii.base",[Vu.variable]:"space.3"}}),md:Rh({container:{[Yx.variable]:"radii.md",[Vu.variable]:"space.5"}}),lg:Rh({container:{[Yx.variable]:"radii.xl",[Vu.variable]:"space.7"}})},bue={elevated:Rh({container:{[SF.variable]:"shadows.base",_dark:{[KS.variable]:"colors.gray.700"}}}),outline:Rh({container:{[wF.variable]:"1px",[CF.variable]:"colors.chakra-border-color"}}),filled:Rh({container:{[KS.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[Vu.variable]:0},header:{[Vu.variable]:0},footer:{[Vu.variable]:0}}},xue=mue({baseStyle:vue,variants:bue,sizes:yue,defaultProps:{variant:"elevated",size:"md"}}),D1=yi("close-button-size"),Bv=yi("close-button-bg"),Sue={w:[D1.reference],h:[D1.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[Bv.variable]:"colors.blackAlpha.100",_dark:{[Bv.variable]:"colors.whiteAlpha.100"}},_active:{[Bv.variable]:"colors.blackAlpha.200",_dark:{[Bv.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:Bv.reference},wue={lg:{[D1.variable]:"sizes.10",fontSize:"md"},md:{[D1.variable]:"sizes.8",fontSize:"xs"},sm:{[D1.variable]:"sizes.6",fontSize:"2xs"}},Cue={baseStyle:Sue,sizes:wue,defaultProps:{size:"md"}},{variants:_ue,defaultProps:kue}=R1,Eue={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Pue={baseStyle:Eue,variants:_ue,defaultProps:kue},Tue={w:"100%",mx:"auto",maxW:"prose",px:"4"},Mue={baseStyle:Tue},Lue={opacity:.6,borderColor:"inherit"},Aue={borderStyle:"solid"},Oue={borderStyle:"dashed"},Rue={solid:Aue,dashed:Oue},Iue={baseStyle:Lue,variants:Rue,defaultProps:{variant:"solid"}},{definePartsStyle:Due,defineMultiStyleConfig:jue}=dr(yie.keys),Nue={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},$ue={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Fue={pt:"2",px:"4",pb:"5"},Bue={fontSize:"1.25em"},zue=Due({container:Nue,button:$ue,panel:Fue,icon:Bue}),Hue=jue({baseStyle:zue}),{definePartsStyle:t2,defineMultiStyleConfig:Wue}=dr(bie.keys),Ta=gn("alert-fg"),nc=gn("alert-bg"),Uue=t2({container:{bg:nc.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Ta.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:Ta.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function I9(e){const{theme:t,colorScheme:n}=e,r=Wm(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var Vue=t2(e=>{const{colorScheme:t}=e,n=I9(e);return{container:{[Ta.variable]:`colors.${t}.500`,[nc.variable]:n.light,_dark:{[Ta.variable]:`colors.${t}.200`,[nc.variable]:n.dark}}}}),Gue=t2(e=>{const{colorScheme:t}=e,n=I9(e);return{container:{[Ta.variable]:`colors.${t}.500`,[nc.variable]:n.light,_dark:{[Ta.variable]:`colors.${t}.200`,[nc.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:Ta.reference}}}),que=t2(e=>{const{colorScheme:t}=e,n=I9(e);return{container:{[Ta.variable]:`colors.${t}.500`,[nc.variable]:n.light,_dark:{[Ta.variable]:`colors.${t}.200`,[nc.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:Ta.reference}}}),Kue=t2(e=>{const{colorScheme:t}=e;return{container:{[Ta.variable]:"colors.white",[nc.variable]:`colors.${t}.500`,_dark:{[Ta.variable]:"colors.gray.900",[nc.variable]:`colors.${t}.200`},color:Ta.reference}}}),Yue={subtle:Vue,"left-accent":Gue,"top-accent":que,solid:Kue},Xue=Wue({baseStyle:Uue,variants:Yue,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:_F,defineMultiStyleConfig:Zue}=dr(xie.keys),wm=gn("avatar-border-color"),K5=gn("avatar-bg"),Que={borderRadius:"full",border:"0.2em solid",[wm.variable]:"white",_dark:{[wm.variable]:"colors.gray.800"},borderColor:wm.reference},Jue={[K5.variable]:"colors.gray.200",_dark:{[K5.variable]:"colors.whiteAlpha.400"},bgColor:K5.reference},EL=gn("avatar-background"),ece=e=>{const{name:t,theme:n}=e,r=t?loe({string:t}):"colors.gray.400",i=aoe(r)(n);let o="white";return i||(o="gray.800"),{bg:EL.reference,"&:not([data-loaded])":{[EL.variable]:r},color:o,[wm.variable]:"colors.white",_dark:{[wm.variable]:"colors.gray.800"},borderColor:wm.reference,verticalAlign:"top"}},tce=_F(e=>({badge:Eo(Que,e),excessLabel:Eo(Jue,e),container:Eo(ece,e)}));function ld(e){const t=e!=="100%"?pF[e]:void 0;return _F({container:{width:e,height:e,fontSize:`calc(${t??e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t??e} / 2.5)`,lineHeight:e!=="100%"?t??e:void 0}})}var nce={"2xs":ld(4),xs:ld(6),sm:ld(8),md:ld(12),lg:ld(16),xl:ld(24),"2xl":ld(32),full:ld("100%")},rce=Zue({baseStyle:tce,sizes:nce,defaultProps:{size:"md"}}),ice={Accordion:Hue,Alert:Xue,Avatar:rce,Badge:R1,Breadcrumb:aue,Button:gue,Checkbox:qS,CloseButton:Cue,Code:Pue,Container:Mue,Divider:Iue,Drawer:Ale,Editable:$le,Form:Ule,FormError:Xle,FormLabel:Qle,Heading:tue,Input:xn,Kbd:wse,Link:_se,List:Mse,Menu:Fse,Modal:Xse,NumberInput:ole,PinInput:ule,Popover:xle,Progress:Tae,Radio:zae,Select:Kae,Skeleton:Xae,SkipLink:Qae,Slider:use,Spinner:fse,Stat:xse,Switch:_oe,Table:Aoe,Tabs:Goe,Tag:oae,Textarea:vae,Tooltip:xae,Card:xue},oce={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},ace={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},sce="ltr",lce={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},uce={semanticTokens:oce,direction:sce,...vie,components:ice,styles:ace,config:lce};function cce(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var dce=cce();function fce(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function hce(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},kF=pce(hce);function EF(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var PF=e=>EF(e,t=>t!=null);function gce(e){return typeof e=="function"}function TF(e,...t){return gce(e)?e(...t):e}function mce(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}const MF=1/60*1e3,vce=typeof performance<"u"?()=>performance.now():()=>Date.now(),LF=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(vce()),MF);function yce(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const p=d&&i,m=p?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),p&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=yce(()=>Cy=!0),e),{}),xce=n2.reduce((e,t)=>{const n=Pw[t];return e[t]=(r,i=!1,o=!1)=>(Cy||Cce(),n.schedule(r,i,o)),e},{}),Sce=n2.reduce((e,t)=>(e[t]=Pw[t].cancel,e),{});n2.reduce((e,t)=>(e[t]=()=>Pw[t].process(Cm),e),{});const wce=e=>Pw[e].process(Cm),AF=e=>{Cy=!1,Cm.delta=S_?MF:Math.max(Math.min(e-Cm.timestamp,bce),1),Cm.timestamp=e,w_=!0,n2.forEach(wce),w_=!1,Cy&&(S_=!1,LF(AF))},Cce=()=>{Cy=!0,S_=!0,w_||LF(AF)},PL=()=>Cm;var _ce=typeof Element<"u",kce=typeof Map=="function",Ece=typeof Set=="function",Pce=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Xx(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Xx(e[r],t[r]))return!1;return!0}var o;if(kce&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!Xx(r.value[1],t.get(r.value[0])))return!1;return!0}if(Ece&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Pce&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(_ce&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!Xx(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var Tce=function(t,n){try{return Xx(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function OF(e,t={}){var n;const{styleConfig:r,...i}=t,{theme:o,colorMode:a}=nF(),s=e?kF(o,`components.${e}`):void 0,l=r||s,u=Bl({theme:o,colorMode:a},(n=l==null?void 0:l.defaultProps)!=null?n:{},PF(fce(i,["children"]))),d=S.useRef({});if(l){const m=Gre(l)(u);Tce(d.current,m)||(d.current=m)}return d.current}function au(e,t={}){return OF(e,t)}function Yi(e,t={}){return OF(e,t)}var Mce=new Set([...Ire,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),Lce=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function Ace(e){return Lce.has(e)||!Mce.has(e)}function Oce(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Rce(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i in n&&delete n[i],n[i]=r[i]);return n}var Ice=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Dce=Bj(function(e){return Ice.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),jce=Dce,Nce=function(t){return t!=="theme"},TL=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?jce:Nce},ML=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},$ce=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Gj(n,r,i),see(function(){return qj(n,r,i)}),null},Fce=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=ML(t,n,r),l=s||TL(i),u=!l("as");return function(){var d=arguments,p=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&p.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)p.push.apply(p,d);else{p.push(d[0][0]);for(var m=d.length,y=1;yt=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=EF(a,(p,m)=>jre(m)),l=TF(e,t),u=Rce({},i,l,PF(s),o),d=dF(u)(t.theme);return r?[d,r]:d};function Y5(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=Ace);const i=Hce({baseStyle:n}),o=zce(e,r)(i);return Ke.forwardRef(function(l,u){const{colorMode:d,forced:p}=Jy();return Ke.createElement(o,{ref:u,"data-theme":p?d:void 0,...l})})}function Wce(){const e=new Map;return new Proxy(Y5,{apply(t,n,r){return Y5(...r)},get(t,n){return e.has(n)||e.set(n,Y5(n)),e.get(n)}})}var Ne=Wce();function Ze(e){return S.forwardRef(e)}function Uce(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=S.createContext(void 0);i.displayName=r;function o(){var a;const s=S.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}function Vce(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=S.useMemo(()=>Ore(n),[n]);return g.jsxs(dee,{theme:i,children:[g.jsx(Gce,{root:t}),r]})}function Gce({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return g.jsx(aw,{styles:n=>({[t]:n.__cssVars})})}Uce({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function qce(){const{colorMode:e}=Jy();return g.jsx(aw,{styles:t=>{const n=kF(t,"styles.global"),r=TF(n,{theme:t,colorMode:e});return r?dF(r)(t):void 0}})}var RF=S.createContext({getDocument(){return document},getWindow(){return window}});RF.displayName="EnvironmentContext";function IF(e){const{children:t,environment:n,disabled:r}=e,i=S.useRef(null),o=S.useMemo(()=>n||{getDocument:()=>{var s,l;return(l=(s=i.current)==null?void 0:s.ownerDocument)!=null?l:document},getWindow:()=>{var s,l;return(l=(s=i.current)==null?void 0:s.ownerDocument.defaultView)!=null?l:window}},[n]),a=!r||!n;return g.jsxs(RF.Provider,{value:o,children:[t,a&&g.jsx("span",{id:"__chakra_env",hidden:!0,ref:i})]})}IF.displayName="EnvironmentProvider";var Kce=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s,disableEnvironment:l}=e,u=g.jsx(IF,{environment:a,disabled:l,children:t});return g.jsx(Vce,{theme:o,cssVarsRoot:s,children:g.jsxs(tF,{colorModeManager:n,options:o.config,children:[i?g.jsx(pee,{}):g.jsx(hee,{}),g.jsx(qce,{}),r?g.jsx(Jj,{zIndex:r,children:u}):u]})})},Yce=(e,t)=>e.find(n=>n.id===t);function AL(e,t){const n=DF(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function DF(e,t){for(const[n,r]of Object.entries(e))if(Yce(r,t))return n}function Xce(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function Zce(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}function Qr(e,t=[]){const n=S.useRef(e);return S.useEffect(()=>{n.current=e}),S.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Qce(e,t){const n=Qr(e);S.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function rc(e,t){const n=S.useRef(!1),r=S.useRef(!1);S.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),S.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const jF=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Tw=S.createContext({});function Jce(){return S.useContext(Tw).visualElement}const r2=S.createContext(null),Mw=typeof document<"u",XS=Mw?S.useLayoutEffect:S.useEffect,NF=S.createContext({strict:!1});function ede(e,t,n,r){const i=Jce(),o=S.useContext(NF),a=S.useContext(r2),s=S.useContext(jF).reducedMotion,l=S.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return S.useInsertionEffect(()=>{u&&u.update(n,a)}),XS(()=>{u&&u.render()}),S.useEffect(()=>{u&&u.updateFeatures()}),(window.HandoffAppearAnimations?XS:S.useEffect)(()=>{u&&u.animationState&&u.animationState.animateChanges()}),u}function Qg(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function tde(e,t,n){return S.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Qg(n)&&(n.current=r))},[t])}function _y(e){return typeof e=="string"||Array.isArray(e)}function Lw(e){return typeof e=="object"&&typeof e.start=="function"}const nde=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Aw(e){return Lw(e.animate)||nde.some(t=>_y(e[t]))}function $F(e){return Boolean(Aw(e)||e.variants)}function rde(e,t){if(Aw(e)){const{initial:n,animate:r}=e;return{initial:n===!1||_y(n)?n:void 0,animate:_y(r)?r:void 0}}return e.inherit!==!1?t:{}}function ide(e){const{initial:t,animate:n}=rde(e,S.useContext(Tw));return S.useMemo(()=>({initial:t,animate:n}),[OL(t),OL(n)])}function OL(e){return Array.isArray(e)?e.join(" "):e}const RL={animation:["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],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"]},ky={};for(const e in RL)ky[e]={isEnabled:t=>RL[e].some(n=>!!t[n])};function ode(e){for(const t in e)ky[t]={...ky[t],...e[t]}}function D9(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const j1={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let ade=1;function sde(){return D9(()=>{if(j1.hasEverUpdated)return ade++})}const j9=S.createContext({}),FF=S.createContext({}),lde=Symbol.for("motionComponentSymbol");function ude({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&ode(e);function o(s,l){let u;const d={...S.useContext(jF),...s,layoutId:cde(s)},{isStatic:p}=d,m=ide(s),y=p?void 0:sde(),b=r(s,p);if(!p&&Mw){m.visualElement=ede(i,b,d,t);const w=S.useContext(FF),E=S.useContext(NF).strict;m.visualElement&&(u=m.visualElement.loadFeatures(d,E,e,y,w))}return S.createElement(Tw.Provider,{value:m},u&&m.visualElement?S.createElement(u,{visualElement:m.visualElement,...d}):null,n(i,s,y,tde(b,m.visualElement,l),b,p,m.visualElement))}const a=S.forwardRef(o);return a[lde]=i,a}function cde({layoutId:e}){const t=S.useContext(j9).id;return t&&e!==void 0?t+"-"+e:e}function dde(e){function t(r,i={}){return ude(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const fde=["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 N9(e){return typeof e!="string"||e.includes("-")?!1:!!(fde.indexOf(e)>-1||/[A-Z]/.test(e))}const ZS={};function hde(e){Object.assign(ZS,e)}const Ow=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],c0=new Set(Ow);function BF(e,{layout:t,layoutId:n}){return c0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ZS[e]||e==="opacity")}const ta=e=>Boolean(e&&e.getVelocity),pde={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},gde=Ow.length;function mde(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let a=0;at&&typeof e=="number"?t.transform(e):e,Um=(e,t,n)=>Math.min(Math.max(n,e),t),np={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},N1={...np,transform:e=>Um(0,1,e)},Hb={...np,default:1},$1=e=>Math.round(e*1e5)/1e5,Ey=/(-)?([\d]*\.?[\d])+/g,C_=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,yde=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function i2(e){return typeof e=="string"}const o2=e=>({test:t=>i2(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),cd=o2("deg"),Yl=o2("%"),Pt=o2("px"),bde=o2("vh"),xde=o2("vw"),IL={...Yl,parse:e=>Yl.parse(e)/100,transform:e=>Yl.transform(e*100)},DL={...np,transform:Math.round},HF={borderWidth:Pt,borderTopWidth:Pt,borderRightWidth:Pt,borderBottomWidth:Pt,borderLeftWidth:Pt,borderRadius:Pt,radius:Pt,borderTopLeftRadius:Pt,borderTopRightRadius:Pt,borderBottomRightRadius:Pt,borderBottomLeftRadius:Pt,width:Pt,maxWidth:Pt,height:Pt,maxHeight:Pt,size:Pt,top:Pt,right:Pt,bottom:Pt,left:Pt,padding:Pt,paddingTop:Pt,paddingRight:Pt,paddingBottom:Pt,paddingLeft:Pt,margin:Pt,marginTop:Pt,marginRight:Pt,marginBottom:Pt,marginLeft:Pt,rotate:cd,rotateX:cd,rotateY:cd,rotateZ:cd,scale:Hb,scaleX:Hb,scaleY:Hb,scaleZ:Hb,skew:cd,skewX:cd,skewY:cd,distance:Pt,translateX:Pt,translateY:Pt,translateZ:Pt,x:Pt,y:Pt,z:Pt,perspective:Pt,transformPerspective:Pt,opacity:N1,originX:IL,originY:IL,originZ:Pt,zIndex:DL,fillOpacity:N1,strokeOpacity:N1,numOctaves:DL};function $9(e,t,n,r){const{style:i,vars:o,transform:a,transformOrigin:s}=e;let l=!1,u=!1,d=!0;for(const p in t){const m=t[p];if(zF(p)){o[p]=m;continue}const y=HF[p],b=vde(m,y);if(c0.has(p)){if(l=!0,a[p]=b,!d)continue;m!==(y.default||0)&&(d=!1)}else p.startsWith("origin")?(u=!0,s[p]=b):i[p]=b}if(t.transform||(l||r?i.transform=mde(e.transform,n,d,r):i.transform&&(i.transform="none")),u){const{originX:p="50%",originY:m="50%",originZ:y=0}=s;i.transformOrigin=`${p} ${m} ${y}`}}const F9=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function WF(e,t,n){for(const r in t)!ta(t[r])&&!BF(r,n)&&(e[r]=t[r])}function Sde({transformTemplate:e},t,n){return S.useMemo(()=>{const r=F9();return $9(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function wde(e,t,n){const r=e.style||{},i={};return WF(i,r,e),Object.assign(i,Sde(e,t,n)),e.transformValues?e.transformValues(i):i}function Cde(e,t,n){const r={},i=wde(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const _de=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function QS(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||_de.has(e)}let UF=e=>!QS(e);function kde(e){e&&(UF=t=>t.startsWith("on")?!QS(t):e(t))}try{kde(require("@emotion/is-prop-valid").default)}catch{}function Ede(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(UF(i)||n===!0&&QS(i)||!t&&!QS(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function jL(e,t,n){return typeof e=="string"?e:Pt.transform(t+n*e)}function Pde(e,t,n){const r=jL(t,e.x,e.width),i=jL(n,e.y,e.height);return`${r} ${i}`}const Tde={offset:"stroke-dashoffset",array:"stroke-dasharray"},Mde={offset:"strokeDashoffset",array:"strokeDasharray"};function Lde(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?Tde:Mde;e[o.offset]=Pt.transform(-r);const a=Pt.transform(t),s=Pt.transform(n);e[o.array]=`${a} ${s}`}function B9(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,d,p){if($9(e,l,u,p),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:y,dimensions:b}=e;m.transform&&(b&&(y.transform=m.transform),delete m.transform),b&&(r!==void 0||i!==void 0||y.transform)&&(y.transformOrigin=Pde(b,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),o!==void 0&&Lde(m,o,a,s,!1)}const VF=()=>({...F9(),attrs:{}}),z9=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ade(e,t,n,r){const i=S.useMemo(()=>{const o=VF();return B9(o,t,{enableHardwareAcceleration:!1},z9(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};WF(o,e.style,e),i.style={...o,...i.style}}return i}function Ode(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const u=(N9(n)?Ade:Cde)(r,a,s,n),p={...Ede(r,typeof n=="string",e),...u,ref:o},{children:m}=r,y=S.useMemo(()=>ta(m)?m.get():m,[m]);return i&&(p["data-projection-id"]=i),S.createElement(n,{...p,children:y})}}const H9=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function GF(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const qF=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 KF(e,t,n,r){GF(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(qF.has(i)?i:H9(i),t.attrs[i])}function W9(e,t){const{style:n}=e,r={};for(const i in n)(ta(n[i])||t.style&&ta(t.style[i])||BF(i,e))&&(r[i]=n[i]);return r}function YF(e,t){const n=W9(e,t);for(const r in e)if(ta(e[r])||ta(t[r])){const i=r==="x"||r==="y"?"attr"+r.toUpperCase():r;n[i]=e[r]}return n}function U9(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}const JS=e=>Array.isArray(e),Rde=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Ide=e=>JS(e)?e[e.length-1]||0:e;function Zx(e){const t=ta(e)?e.get():e;return Rde(t)?t.toValue():t}function Dde({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:jde(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const XF=e=>(t,n)=>{const r=S.useContext(Tw),i=S.useContext(r2),o=()=>Dde(e,t,r,i);return n?o():D9(o)};function jde(e,t,n,r){const i={},o=r(e,{});for(const m in o)i[m]=Zx(o[m]);let{initial:a,animate:s}=e;const l=Aw(e),u=$F(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const p=d?s:a;return p&&typeof p!="boolean"&&!Lw(p)&&(Array.isArray(p)?p:[p]).forEach(y=>{const b=U9(e,y);if(!b)return;const{transitionEnd:w,transition:E,..._}=b;for(const k in _){let T=_[k];if(Array.isArray(T)){const L=d?T.length-1:0;T=T[L]}T!==null&&(i[k]=T)}for(const k in w)i[k]=w[k]}),i}const Nde={useVisualState:XF({scrapeMotionValuesFromProps:YF,createRenderState:VF,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}B9(n,r,{enableHardwareAcceleration:!1},z9(t.tagName),e.transformTemplate),KF(t,n)}})},$de={useVisualState:XF({scrapeMotionValuesFromProps:W9,createRenderState:F9})};function Fde(e,{forwardMotionProps:t=!1},n,r){return{...N9(e)?Nde:$de,preloadedFeatures:n,useRender:Ode(t),createVisualElement:r,Component:e}}function Hu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const ZF=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Rw(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const Bde=e=>t=>ZF(t)&&e(t,Rw(t));function Gu(e,t,n,r){return Hu(e,t,Bde(n),r)}var tr;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(tr||(tr={}));const zde=(e,t)=>n=>t(e(n)),Nd=(...e)=>e.reduce(zde);function QF(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const NL=QF("dragHorizontal"),$L=QF("dragVertical");function JF(e){let t=!1;if(e==="y")t=$L();else if(e==="x")t=NL();else{const n=NL(),r=$L();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function eB(){const e=JF(!0);return e?(e(),!1):!0}let sf=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};function FL(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(o,a)=>{if(o.type==="touch"||eB())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive(tr.Hover,t),s[r]&&s[r](o,a)};return Gu(e.current,n,i,{passive:!e.getProps()[r]})}class Hde extends sf{mount(){this.unmount=Nd(FL(this.node,!0),FL(this.node,!1))}unmount(){}}class Wde extends sf{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(tr.Focus,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(tr.Focus,!1),this.isActive=!1)}mount(){this.unmount=Nd(Hu(this.node.current,"focus",()=>this.onFocus()),Hu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const tB=(e,t)=>t?e===t?!0:tB(e,t.parentElement):!1,Xl=e=>e;function X5(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Rw(n))}class Ude extends sf{constructor(){super(...arguments),this.removeStartListeners=Xl,this.removeEndListeners=Xl,this.removeAccessibleListeners=Xl,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),o=Gu(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:d}=this.node.getProps();tB(this.node.current,s.target)?u&&u(s,l):d&&d(s,l)},{passive:!(r.onTap||r.onPointerUp)}),a=Gu(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=Nd(o,a),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=o=>{if(o.key!=="Enter"||this.isPressing)return;const a=s=>{s.key!=="Enter"||!this.checkPressEnd()||X5("up",this.node.getProps().onTap)};this.removeEndListeners(),this.removeEndListeners=Hu(this.node.current,"keyup",a),X5("down",(s,l)=>{this.startPress(s,l)})},n=Hu(this.node.current,"keydown",t),r=()=>{this.isPressing&&X5("cancel",(o,a)=>this.cancelPress(o,a))},i=Hu(this.node.current,"blur",r);this.removeAccessibleListeners=Nd(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive(tr.Tap,!0),r&&r(t,n)}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive(tr.Tap,!1),!eB()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&r(t,n)}mount(){const t=this.node.getProps(),n=Gu(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Hu(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Nd(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const __=new WeakMap,Z5=new WeakMap,Vde=e=>{const t=__.get(e.target);t&&t(e)},Gde=e=>{e.forEach(Vde)};function qde({root:e,...t}){const n=e||document;Z5.has(n)||Z5.set(n,{});const r=Z5.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Gde,{root:e,...t})),r[i]}function Kde(e,t,n){const r=qde(t);return __.set(e,n),r.observe(e),()=>{__.delete(e),r.unobserve(e)}}const Yde={some:0,all:1};class Xde extends sf{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}viewportFallback(){requestAnimationFrame(()=>{this.hasEnteredView=!0;const{onViewportEnter:t}=this.node.getProps();t&&t(null),this.node.animationState&&this.node.animationState.setActive(tr.InView,!0)})}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o,fallback:a=!0}=t;if(typeof IntersectionObserver>"u"){a&&this.viewportFallback();return}const s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Yde[i]},l=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(tr.InView,d);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),y=d?p:m;y&&y(u)};return Kde(this.node.current,s,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Zde(t,n))&&this.startObserver()}unmount(){}}function Zde({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Qde={inView:{Feature:Xde},tap:{Feature:Ude},focus:{Feature:Wde},hover:{Feature:Hde}};function nB(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r/^\-?\d*\.?\d+$/.test(e),efe=e=>/^0[^.\s]+$/.test(e),qu={delta:0,timestamp:0},rB=1/60*1e3,tfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),iB=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(tfe()),rB);function nfe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const p=d&&i,m=p?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),p&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=nfe(()=>Py=!0),e),{}),so=a2.reduce((e,t)=>{const n=Iw[t];return e[t]=(r,i=!1,o=!1)=>(Py||ofe(),n.schedule(r,i,o)),e},{}),Gd=a2.reduce((e,t)=>(e[t]=Iw[t].cancel,e),{}),Q5=a2.reduce((e,t)=>(e[t]=()=>Iw[t].process(qu),e),{}),ife=e=>Iw[e].process(qu),oB=e=>{Py=!1,qu.delta=k_?rB:Math.max(Math.min(e-qu.timestamp,rfe),1),qu.timestamp=e,E_=!0,a2.forEach(ife),E_=!1,Py&&(k_=!1,iB(oB))},ofe=()=>{Py=!0,k_=!0,E_||iB(oB)};function V9(e,t){e.indexOf(t)===-1&&e.push(t)}function G9(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class q9{constructor(){this.subscriptions=[]}add(t){return V9(this.subscriptions,t),()=>G9(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class sfe{constructor(t,n={}){this.version="9.0.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,i=!0)=>{this.prev=this.current,this.current=r;const{delta:o,timestamp:a}=qu;this.lastUpdated!==a&&(this.timeDelta=o,this.lastUpdated=a,so.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>so.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=afe(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new q9);const r=this.events[t].add(n);return t==="change"?()=>{r(),so.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?K9(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Vm(e,t){return new sfe(e,t)}const Y9=(e,t)=>n=>Boolean(i2(n)&&yde.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),aB=(e,t,n)=>r=>{if(!i2(r))return r;const[i,o,a,s]=r.match(Ey);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},lfe=e=>Um(0,255,e),J5={...np,transform:e=>Math.round(lfe(e))},Eh={test:Y9("rgb","red"),parse:aB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+J5.transform(e)+", "+J5.transform(t)+", "+J5.transform(n)+", "+$1(N1.transform(r))+")"};function ufe(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const P_={test:Y9("#"),parse:ufe,transform:Eh.transform},Jg={test:Y9("hsl","hue"),parse:aB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Yl.transform($1(t))+", "+Yl.transform($1(n))+", "+$1(N1.transform(r))+")"},bo={test:e=>Eh.test(e)||P_.test(e)||Jg.test(e),parse:e=>Eh.test(e)?Eh.parse(e):Jg.test(e)?Jg.parse(e):P_.parse(e),transform:e=>i2(e)?e:e.hasOwnProperty("red")?Eh.transform(e):Jg.transform(e)},sB="${c}",lB="${n}";function cfe(e){var t,n;return isNaN(e)&&i2(e)&&(((t=e.match(Ey))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(C_))===null||n===void 0?void 0:n.length)||0)>0}function e3(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0,r=0;const i=e.match(C_);i&&(n=i.length,e=e.replace(C_,sB),t.push(...i.map(bo.parse)));const o=e.match(Ey);return o&&(r=o.length,e=e.replace(Ey,lB),t.push(...o.map(np.parse))),{values:t,numColors:n,numNumbers:r,tokenised:e}}function uB(e){return e3(e).values}function cB(e){const{values:t,numColors:n,tokenised:r}=e3(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function ffe(e){const t=uB(e);return cB(e)(t.map(dfe))}const qd={test:cfe,parse:uB,createTransformer:cB,getAnimatableNone:ffe},hfe=new Set(["brightness","contrast","saturate","opacity"]);function pfe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ey)||[];if(!r)return e;const i=n.replace(r,"");let o=hfe.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const gfe=/([a-z-]*)\(.*?\)/g,T_={...qd,getAnimatableNone:e=>{const t=e.match(gfe);return t?t.map(pfe).join(" "):e}},mfe={...HF,color:bo,backgroundColor:bo,outlineColor:bo,fill:bo,stroke:bo,borderColor:bo,borderTopColor:bo,borderRightColor:bo,borderBottomColor:bo,borderLeftColor:bo,filter:T_,WebkitFilter:T_},X9=e=>mfe[e];function Z9(e,t){let n=X9(e);return n!==T_&&(n=qd),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const dB=e=>t=>t.test(e),vfe={test:e=>e==="auto",parse:e=>e},fB=[np,Pt,Yl,cd,xde,bde,vfe],zv=e=>fB.find(dB(e)),yfe=[...fB,bo,qd],bfe=e=>yfe.find(dB(e));function xfe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function Sfe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Dw(e,t,n){const r=e.getProps();return U9(r,t,n!==void 0?n:r.custom,xfe(e),Sfe(e))}function wfe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Vm(n))}function Cfe(e,t){const n=Dw(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=Ide(o[a]);wfe(e,a,s)}}function _fe(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;se*1e3,Lfe={current:!1},Q9=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,J9=e=>t=>1-e(1-t),e8=e=>e*e,Afe=J9(e8),t8=Q9(e8),Fr=(e,t,n)=>-n*e+n*t+e;function eC(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ofe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=eC(l,s,e+1/3),o=eC(l,s,e),a=eC(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const tC=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},Rfe=[P_,Eh,Jg],Ife=e=>Rfe.find(t=>t.test(e));function BL(e){const t=Ife(e);let n=t.parse(e);return t===Jg&&(n=Ofe(n)),n}const hB=(e,t)=>{const n=BL(e),r=BL(t),i={...n};return o=>(i.red=tC(n.red,r.red,o),i.green=tC(n.green,r.green,o),i.blue=tC(n.blue,r.blue,o),i.alpha=Fr(n.alpha,r.alpha,o),Eh.transform(i))};function pB(e,t){return typeof e=="number"?n=>Fr(e,t,n):bo.test(e)?hB(e,t):mB(e,t)}const gB=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>pB(o,t[a]));return o=>{for(let a=0;a{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=pB(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}},mB=(e,t)=>{const n=qd.createTransformer(t),r=e3(e),i=e3(t);return r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?Nd(gB(r.values,i.values),n):a=>`${a>0?t:e}`},r3=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},zL=(e,t)=>n=>Fr(e,t,n);function jfe(e){return typeof e=="number"?zL:typeof e=="string"?bo.test(e)?hB:mB:Array.isArray(e)?gB:typeof e=="object"?Dfe:zL}function Nfe(e,t,n){const r=[],i=n||jfe(e[0]),o=e.length-1;for(let a=0;ae[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Nfe(t,r,i),s=a.length,l=u=>{let d=0;if(s>1)for(;dl(Um(e[0],e[o-1],u)):l}const yB=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,$fe=1e-7,Ffe=12;function Bfe(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=yB(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>$fe&&++sBfe(o,0,1,e,n);return o=>o===0||o===1?o:yB(i(o),t,r)}const xB=e=>1-Math.sin(Math.acos(e)),n8=J9(xB),zfe=Q9(n8),SB=bB(.33,1.53,.69,.99),r8=J9(SB),Hfe=Q9(r8),Wfe=e=>(e*=2)<1?.5*r8(e):.5*(2-Math.pow(2,-10*(e-1))),Ufe={linear:Xl,easeIn:e8,easeInOut:t8,easeOut:Afe,circIn:xB,circInOut:zfe,circOut:n8,backIn:r8,backInOut:Hfe,backOut:SB,anticipate:Wfe},HL=e=>{if(Array.isArray(e)){n3(e.length===4);const[t,n,r,i]=e;return bB(t,n,r,i)}else if(typeof e=="string")return Ufe[e];return e},Vfe=e=>Array.isArray(e)&&typeof e[0]!="number";function Gfe(e,t){return e.map(()=>t||t8).splice(0,e.length-1)}function qfe(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function Kfe(e,t){return e.map(n=>n*t)}function M_({keyframes:e,ease:t=t8,times:n,duration:r=300}){e=[...e];const i=Vfe(t)?t.map(HL):HL(t),o={done:!1,value:e[0]},a=Kfe(n&&n.length===e.length?n:qfe(e),r);function s(){return vB(a,e,{ease:Array.isArray(i)?i:Gfe(e,i)})}let l=s();return{next:u=>(o.value=l(u),o.done=u>=r,o),flipTarget:()=>{e.reverse(),l=s()}}}const nC=.001,Yfe=.01,WL=10,Xfe=.05,Zfe=1;function Qfe({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;Mfe(e<=WL*1e3);let a=1-t;a=Um(Xfe,Zfe,a),e=Um(Yfe,WL,e/1e3),a<1?(i=u=>{const d=u*a,p=d*e,m=d-n,y=L_(u,a),b=Math.exp(-p);return nC-m/y*b},o=u=>{const p=u*a*e,m=p*n+n,y=Math.pow(a,2)*Math.pow(u,2)*e,b=Math.exp(-p),w=L_(Math.pow(u,2),a);return(-i(u)+nC>0?-1:1)*((m-y)*b)/w}):(i=u=>{const d=Math.exp(-u*e),p=(u-n)*e+1;return-nC+d*p},o=u=>{const d=Math.exp(-u*e),p=(n-u)*(e*e);return d*p});const s=5/e,l=ehe(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const Jfe=12;function ehe(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function rhe(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!UL(e,nhe)&&UL(e,the)){const n=Qfe(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}const ihe=5;function wB({keyframes:e,restDelta:t,restSpeed:n,...r}){let i=e[0],o=e[e.length-1];const a={done:!1,value:i},{stiffness:s,damping:l,mass:u,velocity:d,duration:p,isResolvedFromDuration:m}=rhe(r);let y=ohe,b=d?-(d/1e3):0;const w=l/(2*Math.sqrt(s*u));function E(){const _=o-i,k=Math.sqrt(s/u)/1e3,T=Math.abs(_)<5;if(n||(n=T?.01:2),t||(t=T?.005:.5),w<1){const L=L_(k,w);y=O=>{const D=Math.exp(-w*k*O);return o-D*((b+w*k*_)/L*Math.sin(L*O)+_*Math.cos(L*O))}}else if(w===1)y=L=>o-Math.exp(-k*L)*(_+(b+k*_)*L);else{const L=k*Math.sqrt(w*w-1);y=O=>{const D=Math.exp(-w*k*O),I=Math.min(L*O,300);return o-D*((b+w*k*_)*Math.sinh(I)+L*_*Math.cosh(I))/L}}}return E(),{next:_=>{const k=y(_);if(m)a.done=_>=p;else{let T=b;if(_!==0)if(w<1){const D=Math.max(0,_-ihe);T=K9(k-y(D),_-D)}else T=0;const L=Math.abs(T)<=n,O=Math.abs(o-k)<=t;a.done=L&&O}return a.value=a.done?o:k,a},flipTarget:()=>{b=-b,[i,o]=[o,i],E()}}}wB.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const ohe=e=>0;function ahe({keyframes:e=[0],velocity:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a=e[0],s={done:!1,value:a};let l=n*t;const u=a+l,d=o===void 0?u:o(u);return d!==u&&(l=d-a),{next:p=>{const m=-l*Math.exp(-p/r);return s.done=!(m>i||m<-i),s.value=s.done?d:d+m,s},flipTarget:()=>{}}}const she={decay:ahe,keyframes:M_,tween:M_,spring:wB};function CB(e,t,n=0){return e-t-n}function lhe(e,t=0,n=0,r=!0){return r?CB(t+-e,t,n):t-(e-t)+n}function uhe(e,t,n,r){return r?e>=t+n:e<=-n}const che=e=>{const t=({delta:n})=>e(n);return{start:()=>so.update(t,!0),stop:()=>Gd.update(t)}};function i3({duration:e,driver:t=che,elapsed:n=0,repeat:r=0,repeatType:i="loop",repeatDelay:o=0,keyframes:a,autoplay:s=!0,onPlay:l,onStop:u,onComplete:d,onRepeat:p,onUpdate:m,type:y="keyframes",...b}){const w=n;let E,_=0,k=e,T=!1,L=!0,O;const D=she[a.length>2?"keyframes":y]||M_,I=a[0],N=a[a.length-1];let U={done:!1,value:I};const{needsInterpolation:B}=D;B&&B(I,N)&&(O=vB([0,100],[I,N],{clamp:!1}),a=[0,100]);const K=D({...b,duration:e,keyframes:a});function ne(){_++,i==="reverse"?(L=_%2===0,n=lhe(n,k,o,L)):(n=CB(n,k,o),i==="mirror"&&K.flipTarget()),T=!1,p&&p()}function z(){E&&E.stop(),d&&d()}function $(Y){L||(Y=-Y),n+=Y,T||(U=K.next(Math.max(0,n)),O&&(U.value=O(U.value)),T=L?U.done:n<=0),m&&m(U.value),T&&(_===0&&(k=k!==void 0?k:n),_{u&&u(),E&&E.stop()},set currentTime(Y){n=w,$(Y)},sample:Y=>{n=w;const Q=e&&typeof e=="number"?Math.max(e*.5,50):50;let q=0;for($(0);q<=Y;){const X=Y-q;$(Math.min(X,Q)),q+=Q}return U}}}function dhe(e){return!e||Array.isArray(e)||typeof e=="string"&&_B[e]}const c1=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,_B={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:c1([0,.65,.55,1]),circOut:c1([.55,0,1,.45]),backIn:c1([.31,.01,.66,-.59]),backOut:c1([.33,1.53,.69,.99])};function fhe(e){if(e)return Array.isArray(e)?c1(e):_B[e]}function hhe(e,t,n,{delay:r=0,duration:i,repeat:o=0,repeatType:a="loop",ease:s,times:l}={}){return e.animate({[t]:n,offset:l},{delay:r,duration:i,easing:fhe(s),fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"})}const VL={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},rC={},kB={};for(const e in VL)kB[e]=()=>(rC[e]===void 0&&(rC[e]=VL[e]()),rC[e]);function phe(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const ghe=new Set(["opacity"]),Wb=10;function mhe(e,t,{onUpdate:n,onComplete:r,...i}){if(!(kB.waapi()&&ghe.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0))return!1;let{keyframes:a,duration:s=300,elapsed:l=0,ease:u}=i;if(i.type==="spring"||!dhe(i.ease)){if(i.repeat===1/0)return;const p=i3({...i,elapsed:0});let m={done:!1,value:a[0]};const y=[];let b=0;for(;!m.done&&b<2e4;)m=p.sample(b),y.push(m.value),b+=Wb;a=y,s=b-Wb,u="linear"}const d=hhe(e.owner.current,t,a,{...i,delay:-l,duration:s,ease:u});return d.onfinish=()=>{e.set(phe(a,i)),so.update(()=>d.cancel()),r&&r()},{get currentTime(){return d.currentTime||0},set currentTime(p){d.currentTime=p},stop:()=>{const{currentTime:p}=d;if(p){const m=i3({...i,autoplay:!1});e.setWithVelocity(m.sample(p-Wb).value,m.sample(p).value,Wb)}so.update(()=>d.cancel())}}}function EB(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Gd.read(r),e(o-t))};return so.read(r,!0),()=>Gd.read(r)}function vhe({keyframes:e,elapsed:t,onUpdate:n,onComplete:r}){const i=()=>{n&&n(e[e.length-1]),r&&r()};return t?{stop:EB(i,-t)}:i()}function yhe({keyframes:e,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:d,onUpdate:p,onComplete:m,onStop:y}){const b=e[0];let w;function E(L){return n!==void 0&&Lr}function _(L){return n===void 0?r:r===void 0||Math.abs(n-L){p&&p(O),L.onUpdate&&L.onUpdate(O)},onComplete:m,onStop:y})}function T(L){k({type:"spring",stiffness:a,damping:s,restDelta:l,...L})}if(E(b))T({velocity:t,keyframes:[b,_(b)]});else{let L=i*t+b;typeof u<"u"&&(L=u(L));const O=_(L),D=O===n?-1:1;let I,N;const U=B=>{I=N,N=B,t=K9(B-I,qu.delta),(D===1&&B>O||D===-1&&Bw&&w.stop()}}const nh=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Ub=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),iC=()=>({type:"keyframes",ease:"linear",duration:.3}),bhe={type:"keyframes",duration:.8},GL={x:nh,y:nh,z:nh,rotate:nh,rotateX:nh,rotateY:nh,rotateZ:nh,scaleX:Ub,scaleY:Ub,scale:Ub,opacity:iC,backgroundColor:iC,color:iC,default:Ub},xhe=(e,{keyframes:t})=>t.length>2?bhe:(GL[e]||GL.default)(t[1]),A_=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&qd.test(t)&&!t.startsWith("url("));function She({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:u,...d}){return!!Object.keys(d).length}function qL(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function KL(e){return typeof e=="number"?0:Z9("",e)}function PB(e,t){return e[t]||e.default||e}function whe(e,t,n,r){const i=A_(t,n);let o=r.from!==void 0?r.from:e.get();return o==="none"&&i&&typeof n=="string"?o=Z9(t,n):qL(o)&&typeof n=="string"?o=KL(n):!Array.isArray(n)&&qL(n)&&typeof o=="string"&&(n=KL(o)),Array.isArray(n)?(n[0]===null&&(n[0]=o),n):[o,n]}const i8=(e,t,n,r={})=>i=>{const o=PB(r,e)||{},a=o.delay||r.delay||0;let{elapsed:s=0}=r;s=s-Qx(a);const l=whe(t,e,n,o),u=l[0],d=l[l.length-1],p=A_(e,u),m=A_(e,d);let y={keyframes:l,velocity:t.getVelocity(),...o,elapsed:s,onUpdate:b=>{t.set(b),o.onUpdate&&o.onUpdate(b)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(!p||!m||Lfe.current||o.type===!1)return vhe(y);if(o.type==="inertia")return yhe(y);if(She(o)||(y={...y,...xhe(e,y)}),y.duration&&(y.duration=Qx(y.duration)),y.repeatDelay&&(y.repeatDelay=Qx(y.repeatDelay)),t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const b=mhe(t,e,y);if(b)return b}return i3(y)};function Che(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>O_(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=O_(e,t,n);else{const i=typeof t=="function"?Dw(e,t,n.custom):t;r=TB(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))}function O_(e,t,n={}){const r=Dw(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>TB(e,r,n):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:p}=i;return _he(e,t,u+l,d,p,n)}:()=>Promise.resolve(),{when:s}=i;if(s){const[l,u]=s==="beforeChildren"?[o,a]:[a,o];return l().then(u)}else return Promise.all([o(),a(n.delay)])}function TB(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...s}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(o=r);const u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const p in s){const m=e.getValue(p),y=s[p];if(!m||y===void 0||d&&Ehe(d,p))continue;const b={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!m.hasAnimated){const E=e.getProps()[Tfe];E&&(b.elapsed=window.HandoffAppearAnimations(E,p,m,so))}let w=m.start(i8(p,m,y,e.shouldReduceMotion&&c0.has(p)?{type:!1}:b));t3(l)&&(l.add(p),w=w.then(()=>l.remove(p))),u.push(w)}return Promise.all(u).then(()=>{a&&Cfe(e,a)})}function _he(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(khe).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(O_(u,t,{...o,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function khe(e,t){return e.sortNodePosition(t)}function Ehe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const o8=[tr.Animate,tr.InView,tr.Focus,tr.Hover,tr.Tap,tr.Drag,tr.Exit],Phe=[...o8].reverse(),The=o8.length;function Mhe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Che(e,n,r)))}function Lhe(e){let t=Mhe(e);const n=Ohe();let r=!0;const i=(l,u)=>{const d=Dw(e,u);if(d){const{transition:p,transitionEnd:m,...y}=d;l={...l,...y,...m}}return l};function o(l){t=l(e)}function a(l,u){const d=e.getProps(),p=e.getVariantContext(!0)||{},m=[],y=new Set;let b={},w=1/0;for(let _=0;_w&&O;const B=Array.isArray(L)?L:[L];let K=B.reduce(i,{});D===!1&&(K={});const{prevResolvedValues:ne={}}=T,z={...ne,...K},$=H=>{U=!0,y.delete(H),T.needsAnimating[H]=!0};for(const H in z){const Y=K[H],Q=ne[H];b.hasOwnProperty(H)||(Y!==Q?JS(Y)&&JS(Q)?!nB(Y,Q)||N?$(H):T.protectedKeys[H]=!0:Y!==void 0?$(H):y.add(H):Y!==void 0&&y.has(H)?$(H):T.protectedKeys[H]=!0)}T.prevProp=L,T.prevResolvedValues=K,T.isActive&&(b={...b,...K}),r&&e.blockInitialAnimation&&(U=!1),U&&!I&&m.push(...B.map(H=>({animation:H,options:{type:k,...l}})))}if(y.size){const _={};y.forEach(k=>{const T=e.getBaseTarget(k);T!==void 0&&(_[k]=T)}),m.push({animation:_})}let E=Boolean(m.length);return r&&d.initial===!1&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,E?t(m):Promise.resolve()}function s(l,u,d){if(n[l].isActive===u)return Promise.resolve();e.variantChildren&&e.variantChildren.forEach(m=>{m.animationState&&m.animationState.setActive(l,u)}),n[l].isActive=u;const p=a(d,l);for(const m in n)n[m].protectedKeys={};return p}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function Ahe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!nB(t,e):!1}function rh(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ohe(){return{[tr.Animate]:rh(!0),[tr.InView]:rh(),[tr.Hover]:rh(),[tr.Tap]:rh(),[tr.Drag]:rh(),[tr.Focus]:rh(),[tr.Exit]:rh()}}class Rhe extends sf{constructor(t){super(t),t.animationState||(t.animationState=Lhe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),Lw(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let Ihe=0;class Dhe extends sf{constructor(){super(...arguments),this.id=Ihe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const o=this.node.animationState.setActive(tr.Exit,!t,{custom:r??this.node.getProps().custom});n&&!t&&o.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const jhe={animation:{Feature:Rhe},exit:{Feature:Dhe}},YL=(e,t)=>Math.abs(e-t);function Nhe(e,t){const n=YL(e.x,t.x),r=YL(e.y,t.y);return Math.sqrt(n**2+r**2)}class MB{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=aC(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,p=Nhe(u.offset,{x:0,y:0})>=3;if(!d&&!p)return;const{point:m}=u,{timestamp:y}=qu;this.history.push({...m,timestamp:y});const{onStart:b,onMove:w}=this.handlers;d||(b&&b(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=oC(d,this.transformPagePoint),so.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:p,onSessionEnd:m}=this.handlers,y=aC(u.type==="pointercancel"?this.lastMoveEventInfo:oC(d,this.transformPagePoint),this.history);this.startEvent&&p&&p(u,y),m&&m(u,y)},!ZF(t))return;this.handlers=n,this.transformPagePoint=r;const i=Rw(t),o=oC(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=qu;this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,aC(o,this.history)),this.removeListeners=Nd(Gu(window,"pointermove",this.handlePointerMove),Gu(window,"pointerup",this.handlePointerUp),Gu(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Gd.update(this.updatePoint)}}function oC(e,t){return t?{point:t(e.point)}:e}function XL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function aC({point:e},t){return{point:e,delta:XL(e,LB(t)),offset:XL(e,$he(t)),velocity:Fhe(t,.1)}}function $he(e){return e[0]}function LB(e){return e[e.length-1]}function Fhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=LB(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Qx(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Aa(e){return e.max-e.min}function R_(e,t=0,n=.01){return Math.abs(e-t)<=n}function ZL(e,t,n,r=.5){e.origin=r,e.originPoint=Fr(t.min,t.max,e.origin),e.scale=Aa(n)/Aa(t),(R_(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Fr(n.min,n.max,e.origin)-e.originPoint,(R_(e.translate)||isNaN(e.translate))&&(e.translate=0)}function F1(e,t,n,r){ZL(e.x,t.x,n.x,r?r.originX:void 0),ZL(e.y,t.y,n.y,r?r.originY:void 0)}function QL(e,t,n){e.min=n.min+t.min,e.max=e.min+Aa(t)}function Bhe(e,t,n){QL(e.x,t.x,n.x),QL(e.y,t.y,n.y)}function JL(e,t,n){e.min=t.min-n.min,e.max=e.min+Aa(t)}function B1(e,t,n){JL(e.x,t.x,n.x),JL(e.y,t.y,n.y)}function zhe(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Fr(n,e,r.max):Math.min(e,n)),e}function eA(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Hhe(e,{top:t,left:n,bottom:r,right:i}){return{x:eA(e.x,n,i),y:eA(e.y,t,r)}}function tA(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=r3(t.min,t.max-r,e.min):r>i&&(n=r3(e.min,e.max-i,t.min)),Um(0,1,n)}function Vhe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const I_=.35;function Ghe(e=I_){return e===!1?e=0:e===!0&&(e=I_),{x:nA(e,"left","right"),y:nA(e,"top","bottom")}}function nA(e,t,n){return{min:rA(e,t),max:rA(e,n)}}function rA(e,t){return typeof e=="number"?e:e[t]||0}const iA=()=>({translate:0,scale:1,origin:0,originPoint:0}),z1=()=>({x:iA(),y:iA()}),oA=()=>({min:0,max:0}),gi=()=>({x:oA(),y:oA()});function Al(e){return[e("x"),e("y")]}function AB({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function qhe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Khe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function sC(e){return e===void 0||e===1}function D_({scale:e,scaleX:t,scaleY:n}){return!sC(e)||!sC(t)||!sC(n)}function dh(e){return D_(e)||OB(e)||e.z||e.rotate||e.rotateX||e.rotateY}function OB(e){return aA(e.x)||aA(e.y)}function aA(e){return e&&e!=="0%"}function o3(e,t,n){const r=e-n,i=t*r;return n+i}function sA(e,t,n,r,i){return i!==void 0&&(e=o3(e,i,r)),o3(e,n,r)+t}function j_(e,t=0,n=1,r,i){e.min=sA(e.min,t,n,r,i),e.max=sA(e.max,t,n,r,i)}function RB(e,{x:t,y:n}){j_(e.x,t.translate,t.scale,t.originPoint),j_(e.y,n.translate,n.scale,n.originPoint)}function Yhe(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,a;for(let s=0;s1.0000000000001||e<.999999999999?e:1}function gd(e,t){e.min=e.min+t,e.max=e.max+t}function uA(e,t,[n,r,i]){const o=t[i]!==void 0?t[i]:.5,a=Fr(e.min,e.max,o);j_(e,t[n],t[r],a,t.scale)}const Xhe=["x","scaleX","originX"],Zhe=["y","scaleY","originY"];function em(e,t){uA(e.x,t,Xhe),uA(e.y,t,Zhe)}function IB(e,t){return AB(Khe(e.getBoundingClientRect(),t))}function Qhe(e,t,n){const r=IB(e,n),{scroll:i}=t;return i&&(gd(r.x,i.offset.x),gd(r.y,i.offset.y)),r}const Jhe=new WeakMap;class epe{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=gi(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=l=>{this.stopAnimation(),n&&this.snapToCursor(Rw(l,"page").point)},o=(l,u)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=JF(d),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Al(b=>{let w=this.getAxisMotionValue(b).get()||0;if(Yl.test(w)){const{projection:E}=this.visualElement;if(E&&E.layout){const _=E.layout.layoutBox[b];_&&(w=Aa(_)*(parseFloat(w)/100))}}this.originPoint[b]=w}),m&&m(l,u);const{animationState:y}=this.visualElement;y&&y.setActive(tr.Drag,!0)},a=(l,u)=>{const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:b}=u;if(p&&this.currentDirection===null){this.currentDirection=tpe(b),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",u.point,b),this.updateAxis("y",u.point,b),this.visualElement.render(),y&&y(l,u)},s=(l,u)=>this.stop(l,u);this.panSession=new MB(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:s},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&o(t,n)}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive(tr.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Vb(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=zhe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Qg(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Hhe(r.layoutBox,t):this.constraints=!1,this.elastic=Ghe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Al(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Vhe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Qg(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Qhe(r,i.root,this.visualElement.getTransformPagePoint());let a=Whe(i.layout.layoutBox,o);if(n){const s=n(qhe(a));this.hasMutatedConstraints=!!s,s&&(a=AB(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Al(d=>{if(!Vb(d,n,this.currentDirection))return;let p=l&&l[d]||{};a&&(p={min:0,max:0});const m=i?200:1e6,y=i?40:1e7,b={type:"inertia",velocity:r?t[d]:0,bounceStiffness:m,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...o,...p};return this.startAxisValueAnimation(d,b)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(i8(t,r,0,n))}stopAnimation(){Al(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Al(n=>{const{drag:r}=this.getProps();if(!Vb(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-Fr(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Qg(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Al(a=>{const s=this.getAxisMotionValue(a);if(s){const l=s.get();i[a]=Uhe({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Al(a=>{if(!Vb(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(Fr(l,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;Jhe.set(this.visualElement,this);const t=this.visualElement.current,n=Gu(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Qg(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),r();const a=Hu(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Al(d=>{const p=this.getAxisMotionValue(d);p&&(this.originPoint[d]+=l[d].translate,p.set(p.get()+l[d].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=I_,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function Vb(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function tpe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class npe extends sf{constructor(t){super(t),this.removeGroupControls=Xl,this.removeListeners=Xl,this.controls=new epe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xl}unmount(){this.removeGroupControls(),this.removeListeners()}}class rpe extends sf{constructor(){super(...arguments),this.removePointerDownListener=Xl}onPointerDown(t){this.session=new MB(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:t,onStart:n,onMove:r,onEnd:(o,a)=>{delete this.session,i&&i(o,a)}}}mount(){this.removePointerDownListener=Gu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function DB(){const e=S.useContext(r2);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=S.useId();return S.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function ipe(){return ope(S.useContext(r2))}function ope(e){return e===null?!0:e.isPresent}function cA(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Hv={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Pt.test(e))e=parseFloat(e);else return e;const n=cA(e,t.target.x),r=cA(e,t.target.y);return`${n}% ${r}%`}};function N_(e){return typeof e=="string"&&e.startsWith("var(--")}const jB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function ape(e){const t=jB.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function $_(e,t,n=1){const[r,i]=ape(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():N_(i)?$_(i,t,n+1):i}function spe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!N_(o))return;const a=$_(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!N_(o))continue;const a=$_(o,r);a&&(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const dA="_$css",lpe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(jB,y=>(o.push(y),dA)));const a=qd.parse(e);if(a.length>5)return r;const s=qd.createTransformer(e),l=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=d;const p=Fr(u,d,.5);typeof a[2+l]=="number"&&(a[2+l]/=p),typeof a[3+l]=="number"&&(a[3+l]/=p);let m=s(a);if(i){let y=0;m=m.replace(dA,()=>{const b=o[y];return y++,b})}return m}};class upe extends Ke.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;hde(cpe),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),j1.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||so.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function NB(e){const[t,n]=DB(),r=S.useContext(j9);return Ke.createElement(upe,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(FF),isPresent:t,safeToRemove:n})}const cpe={borderRadius:{...Hv,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Hv,borderTopRightRadius:Hv,borderBottomLeftRadius:Hv,borderBottomRightRadius:Hv,boxShadow:lpe};function dpe(e,t,n={}){const r=ta(e)?e:Vm(e);return r.start(i8("",r,t,n)),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const $B=["TopLeft","TopRight","BottomLeft","BottomRight"],fpe=$B.length,fA=e=>typeof e=="string"?parseFloat(e):e,hA=e=>typeof e=="number"||Pt.test(e);function hpe(e,t,n,r,i,o){i?(e.opacity=Fr(0,n.opacity!==void 0?n.opacity:1,ppe(r)),e.opacityExit=Fr(t.opacity!==void 0?t.opacity:1,0,gpe(r))):o&&(e.opacity=Fr(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(r3(e,t,r))}function gA(e,t){e.min=t.min,e.max=t.max}function Ns(e,t){gA(e.x,t.x),gA(e.y,t.y)}function mA(e,t,n,r,i){return e-=t,e=o3(e,1/n,r),i!==void 0&&(e=o3(e,1/i,r)),e}function mpe(e,t=0,n=1,r=.5,i,o=e,a=e){if(Yl.test(t)&&(t=parseFloat(t),t=Fr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=Fr(o.min,o.max,r);e===o&&(s-=t),e.min=mA(e.min,t,n,s,i),e.max=mA(e.max,t,n,s,i)}function vA(e,t,[n,r,i],o,a){mpe(e,t[n],t[r],t[i],t.scale,o,a)}const vpe=["x","scaleX","originX"],ype=["y","scaleY","originY"];function yA(e,t,n,r){vA(e.x,t,vpe,n?n.x:void 0,r?r.x:void 0),vA(e.y,t,ype,n?n.y:void 0,r?r.y:void 0)}function bA(e){return e.translate===0&&e.scale===1}function BB(e){return bA(e.x)&&bA(e.y)}function zB(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function xA(e){return Aa(e.x)/Aa(e.y)}class bpe{constructor(){this.members=[]}add(t){V9(this.members,t),t.scheduleRender()}remove(t){if(G9(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function SA(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:d}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),d&&(r+=`rotateY(${d}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const xpe=(e,t)=>e.depth-t.depth;class Spe{constructor(){this.children=[],this.isDirty=!1}add(t){V9(this.children,t),this.isDirty=!0}remove(t){G9(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(xpe),this.isDirty=!1,this.children.forEach(t)}}const wA=["","X","Y","Z"],CA=1e3;let wpe=0;function HB({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t==null?void 0:t()){this.id=wpe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(kpe),this.nodes.forEach(Tpe),this.nodes.forEach(Mpe)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let u=0;uthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=EB(m,250),j1.hasAnimatedSinceResize&&(j1.hasAnimatedSinceResize=!1,this.nodes.forEach(kA))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:m,hasRelativeTargetChanged:y,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||Ipe,{onLayoutAnimationStart:E,onLayoutAnimationComplete:_}=d.getProps(),k=!this.targetLayout||!zB(this.targetLayout,b)||y,T=!m&&y;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||T||m&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,T);const L={...PB(w,"layout"),onPlay:E,onComplete:_};(d.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else!m&&this.animationProgress===0&&kA(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Gd.preRender(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(Lpe),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const L=T/1e3;EA(p.x,a.x,L),EA(p.y,a.y,L),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(B1(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ope(this.relativeTarget,this.relativeTargetOrigin,m,L)),w&&(this.animationValues=d,hpe(d,u,this.latestValues,L,k,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Gd.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=so.update(()=>{j1.hasAnimatedSinceResize=!0,this.currentAnimation=dpe(0,CA,{...a,onUpdate:s=>{this.mixTargetDelta(s),a.onUpdate&&a.onUpdate(s)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(CA),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:d}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&WB(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||gi();const p=Aa(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+p;const m=Aa(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+m}Ns(s,l),em(s,d),F1(this.projectionDeltaWithTransform,this.layoutCorrected,s,d)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new bpe),this.sharedNodes.get(a).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let d=0;d{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(_A),this.root.sharedNodes.clear()}}}function Cpe(e){e.updateLayout()}function _pe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,a=n.source!==e.layout.source;o==="size"?Al(p=>{const m=a?n.measuredBox[p]:n.layoutBox[p],y=Aa(m);m.min=r[p].min,m.max=m.min+y}):WB(o,n.layoutBox,r)&&Al(p=>{const m=a?n.measuredBox[p]:n.layoutBox[p],y=Aa(r[p]);m.max=m.min+y});const s=z1();F1(s,r,n.layoutBox);const l=z1();a?F1(l,e.applyTransform(i,!0),n.measuredBox):F1(l,r,n.layoutBox);const u=!BB(s);let d=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:y}=p;if(m&&y){const b=gi();B1(b,n.layoutBox,m.layoutBox);const w=gi();B1(w,r,y.layoutBox),zB(b,w)||(d=!0),p.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=b,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function kpe(e){e.isProjectionDirty||(e.isProjectionDirty=Boolean(e.parent&&e.parent.isProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=Boolean(e.parent&&e.parent.isTransformDirty))}function Epe(e){e.clearSnapshot()}function _A(e){e.clearMeasurements()}function Ppe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function kA(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Tpe(e){e.resolveTargetDelta()}function Mpe(e){e.calcProjection()}function Lpe(e){e.resetRotation()}function Ape(e){e.removeLeadSnapshot()}function EA(e,t,n){e.translate=Fr(t.translate,0,n),e.scale=Fr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function PA(e,t,n,r){e.min=Fr(t.min,n.min,r),e.max=Fr(t.max,n.max,r)}function Ope(e,t,n,r){PA(e.x,t.x,n.x,r),PA(e.y,t.y,n.y,r)}function Rpe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Ipe={duration:.45,ease:[.4,0,.1,1]};function Dpe(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function TA(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function jpe(e){TA(e.x),TA(e.y)}function WB(e,t,n){return e==="position"||e==="preserve-aspect"&&!R_(xA(t),xA(n),.2)}const Npe=HB({attachResizeListener:(e,t)=>Hu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lC={current:void 0},UB=HB({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lC.current){const e=new Npe(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),lC.current=e}return lC.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),$pe={pan:{Feature:rpe},drag:{Feature:npe,ProjectionNode:UB,MeasureLayout:NB}},Fpe=new Set(["width","height","top","left","right","bottom","x","y"]),VB=e=>Fpe.has(e),Bpe=e=>Object.keys(e).some(VB),MA=e=>e===np||e===Pt;var LA;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(LA||(LA={}));const AA=(e,t)=>parseFloat(e.split(", ")[t]),OA=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return AA(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?AA(o[1],e):0}},zpe=new Set(["x","y","z"]),Hpe=Ow.filter(e=>!zpe.has(e));function Wpe(e){const t=[];return Hpe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const RA={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:OA(4,13),y:OA(5,14)},Upe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=RA[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const d=t.getValue(u);d&&d.jump(s[u]),e[u]=RA[u](l,o)}),e},Vpe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(VB);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let d=n[l],p=zv(d);const m=t[l];let y;if(JS(m)){const b=m.length,w=m[0]===null?1:0;d=m[w],p=zv(d);for(let E=w;E=0?window.pageYOffset:null,u=Upe(t,e,s);return o.length&&o.forEach(([d,p])=>{e.getValue(d).set(p)}),e.render(),Mw&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function Gpe(e,t,n,r){return Bpe(t)?Vpe(e,t,n,r):{target:t,transitionEnd:r}}const qpe=(e,t,n,r)=>{const i=spe(e,t,r);return t=i.target,r=i.transitionEnd,Gpe(e,t,n,r)},F_={current:null},GB={current:!1};function Kpe(){if(GB.current=!0,!!Mw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>F_.current=e.matches;e.addListener(t),t()}else F_.current=!1}function Ype(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(ta(o))e.addValue(i,o),t3(r)&&r.add(i);else if(ta(a))e.addValue(i,Vm(o,{owner:e})),t3(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,Vm(s!==void 0?s:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const qB=Object.keys(ky),Xpe=qB.length,IA=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Zpe{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,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.scheduleRender=()=>so.render(this.render,!1,!0);const{latestValues:s,renderState:l}=o;this.latestValues=s,this.baseTarget={...s},this.initialValues=n.initial?{...s}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.isControllingVariants=Aw(n),this.isVariantNode=$F(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{});for(const p in d){const m=d[p];s[p]!==void 0&&ta(m)&&(m.set(s[p],!1),t3(u)&&u.add(p))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),GB.current||Kpe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:F_.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Gd.update(this.notifyUpdate),Gd.render(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=c0.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&so.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,i,o,a){let s,l;for(let u=0;uthis.scheduleRender(),animationType:typeof d=="string"?d:"both",initialPromotionConfig:a,layoutScroll:y,layoutRoot:b})}return l}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update(this.props,this.prevProps):(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):gi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Vm(n,{owner:this}),this.addValue(t,r)),r}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=U9(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!ta(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new q9),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}const KB=["initial",...o8],Qpe=KB.length;class YB extends Zpe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=Efe(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){_fe(this,r,a);const s=qpe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function Jpe(e){return window.getComputedStyle(e)}class ege extends YB{readValueFromInstance(t,n){if(c0.has(n)){const r=X9(n);return r&&r.default||0}else{const r=Jpe(t),i=(zF(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return IB(t,n)}build(t,n,r,i){$9(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return W9(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ta(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){GF(t,n,r,i)}}class tge extends YB{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(c0.has(n)){const r=X9(n);return r&&r.default||0}return n=qF.has(n)?n:H9(n),t.getAttribute(n)}measureInstanceViewportBox(){return gi()}scrapeMotionValuesFromProps(t,n){return YF(t,n)}build(t,n,r,i){B9(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){KF(t,n,r,i)}mount(t){this.isSVGTag=z9(t.tagName),super.mount(t)}}const nge=(e,t)=>N9(e)?new tge(t,{enableHardwareAcceleration:!1}):new ege(t,{enableHardwareAcceleration:!0}),rge={layout:{ProjectionNode:UB,MeasureLayout:NB}},ige={...jhe,...Qde,...$pe,...rge},su=dde((e,t)=>Fde(e,t,ige,nge));function XB(){const e=S.useRef(!1);return XS(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function oge(){const e=XB(),[t,n]=S.useState(0),r=S.useCallback(()=>{e.current&&n(t+1)},[t]);return[S.useCallback(()=>so.postRender(r),[r]),t]}class age extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function sge({children:e,isPresent:t}){const n=S.useId(),r=S.useRef(null),i=S.useRef({width:0,height:0,top:0,left:0});return S.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${o}px !important; @@ -366,9 +366,9 @@ Error generating stack: `+o.message+` top: ${s}px !important; left: ${l}px !important; } - `),()=>{document.head.removeChild(u)}},[t]),S.createElement(oge,{isPresent:t,childRef:r,sizeRef:i},S.cloneElement(e,{ref:r}))}const uC=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=D9(sge),l=S.useId(),u=S.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:d=>{s.set(d,!0);for(const p of s.values())if(!p)return;r&&r()},register:d=>(s.set(d,!1),()=>s.delete(d))}),o?void 0:[n]);return S.useMemo(()=>{s.forEach((d,p)=>s.set(p,!1))},[n]),S.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=S.createElement(age,{isPresent:n},e)),S.createElement(r2.Provider,{value:u},e)};function sge(){return new Map}function lge(e){return S.useEffect(()=>()=>e(),[])}const jg=e=>e.key||"";function uge(e,t){e.forEach(n=>{const r=jg(n);t.set(r,n)})}function cge(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const rp=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait");let[s]=ige();const l=S.useContext(j9).forceRender;l&&(s=l);const u=YB(),d=cge(e);let p=d;const m=new Set,y=S.useRef(p),b=S.useRef(new Map).current,w=S.useRef(!0);if(XS(()=>{w.current=!1,uge(d,b),y.current=p}),lge(()=>{w.current=!0,b.clear(),m.clear()}),w.current)return S.createElement(S.Fragment,null,p.map(T=>S.createElement(uC,{key:jg(T),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},T)));p=[...p];const E=y.current.map(jg),_=d.map(jg),k=E.length;for(let T=0;T{if(_.indexOf(T)!==-1)return;const L=b.get(T);if(!L)return;const O=E.indexOf(T),D=()=>{b.delete(T),m.delete(T);const I=y.current.findIndex(N=>N.key===T);if(y.current.splice(I,1),!m.size){if(y.current=d,u.current===!1)return;s(),r&&r()}};p.splice(O,0,S.createElement(uC,{key:jg(L),isPresent:!1,onExitComplete:D,custom:t,presenceAffectsLayout:o,mode:a},L))}),p=p.map(T=>{const L=T.key;return m.has(L)?T:S.createElement(uC,{key:jg(T),isPresent:!0,presenceAffectsLayout:o,mode:a},T)}),S.createElement(S.Fragment,null,m.size?p:p.map(T=>S.cloneElement(T)))};var Nl=function(){return Nl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function B_(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},ZB=S.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=dge,toastSpacing:d="0.5rem"}=e,[p,m]=S.useState(s),y=rpe();rc(()=>{y||r==null||r()},[y]),rc(()=>{m(s)},[s]);const b=()=>m(null),w=()=>m(s),E=()=>{y&&i()};S.useEffect(()=>{y&&o&&i()},[y,o,i]),Zce(E,p);const _=S.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:d,...l}),[l,d]),k=S.useMemo(()=>Yce(a),[a]);return g.jsx(su.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:w,custom:{position:a},style:k,children:g.jsx($e.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:_,children:ts(n,{id:t,onClose:E})})})});ZB.displayName="ToastComponent";function fge(e,t){var n;const r=e??"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=o==null?void 0:o[t])!=null?n:r}var DA={path:g.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[g.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),g.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),g.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Da=Xe((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,d=xt("chakra-icon",s),p=au("Icon",e),m={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l,...p},y={ref:t,focusable:o,className:d,__css:m},b=r??DA.viewBox;if(n&&typeof n!="string")return g.jsx($e.svg,{as:n,...y,...u});const w=a??DA.path;return g.jsx($e.svg,{verticalAlign:"middle",viewBox:b,...y,...u,children:w})});Da.displayName="Icon";function fc(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=S.Children.toArray(e.path),a=Xe((s,l)=>g.jsx(Da,{ref:l,viewBox:t,...i,...s,children:o.length?o:g.jsx("path",{fill:"currentColor",d:n})}));return a.displayName=r,a}function hge(e){return g.jsx(Da,{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function pge(e){return g.jsx(Da,{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function jA(e){return g.jsx(Da,{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var gge=nf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),h0=Xe((e,t)=>{const n=au("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=fr(e),u=xt("chakra-spinner",s),d={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${gge} ${o} linear infinite`,...n};return g.jsx($e.div,{ref:t,__css:d,className:u,...l,children:r&&g.jsx($e.span,{srOnly:!0,children:r})})});h0.displayName="Spinner";var[mge,vge]=Pn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[yge,a8]=Pn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),QB={info:{icon:pge,colorScheme:"blue"},warning:{icon:jA,colorScheme:"orange"},success:{icon:hge,colorScheme:"green"},error:{icon:jA,colorScheme:"red"},loading:{icon:h0,colorScheme:"blue"}};function bge(e){return QB[e].colorScheme}function xge(e){return QB[e].icon}var JB=Xe(function(t,n){const i={display:"inline",...a8().description};return g.jsx($e.div,{ref:n,...t,className:xt("chakra-alert__desc",t.className),__css:i})});JB.displayName="AlertDescription";function ez(e){const{status:t}=vge(),n=xge(t),r=a8(),i=t==="loading"?r.spinner:r.icon;return g.jsx($e.span,{display:"inherit",...e,className:xt("chakra-alert__icon",e.className),__css:i,children:e.children||g.jsx(n,{h:"100%",w:"100%"})})}ez.displayName="AlertIcon";var tz=Xe(function(t,n){const r=a8();return g.jsx($e.div,{ref:n,...t,className:xt("chakra-alert__title",t.className),__css:r.title})});tz.displayName="AlertTitle";var nz=Xe(function(t,n){var r;const{status:i="info",addRole:o=!0,...a}=fr(t),s=(r=t.colorScheme)!=null?r:bge(i),l=Yi("Alert",{...t,colorScheme:s}),u={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return g.jsx(mge,{value:{status:i},children:g.jsx(yge,{value:l,children:g.jsx($e.div,{role:o?"alert":void 0,ref:n,...a,className:xt("chakra-alert",t.className),__css:u})})})});nz.displayName="Alert";function Sge(e){return g.jsx(Da,{focusable:"false","aria-hidden":!0,...e,children:g.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var s8=Xe(function(t,n){const r=au("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=fr(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return g.jsx($e.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s,children:i||g.jsx(Sge,{width:"1em",height:"1em"})})});s8.displayName="CloseButton";var wge={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},$l=Cge(wge);function Cge(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=_ge(i,o),{position:s,id:l}=a;return r(u=>{var d,p;const y=s.includes("top")?[a,...(d=u[s])!=null?d:[]]:[...(p=u[s])!=null?p:[],a];return{...u,[s]:y}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=LL(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:rz(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(d=>({...d,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=IF(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(LL($l.getState(),i).position)}}var NA=0;function _ge(e,t={}){var n,r;NA+=1;const i=(n=t.id)!=null?n:NA,o=(r=t.position)!=null?r:"bottom";return{id:i,message:e,position:o,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>$l.removeToast(String(i),o),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var kge=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return g.jsxs(nz,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",children:[g.jsx(ez,{children:l}),g.jsxs($e.div,{flex:"1",maxWidth:"100%",children:[i&&g.jsx(tz,{id:u==null?void 0:u.title,children:i}),s&&g.jsx(JB,{id:u==null?void 0:u.description,display:"block",children:s})]}),o&&g.jsx(s8,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1})]})};function rz(e={}){const{render:t,toastComponent:n=kge}=e;return i=>typeof t=="function"?t({...i,...e}):g.jsx(n,{...i,...e})}function Ege(e,t){const n=i=>{var o;return{...t,...i,position:fge((o=i==null?void 0:i.position)!=null?o:t==null?void 0:t.position,e)}},r=i=>{const o=n(i),a=rz(o);return $l.notify(a,o)};return r.update=(i,o)=>{$l.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...ts(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...ts(o.error,s)}))},r.closeAll=$l.closeAll,r.close=$l.close,r.isActive=$l.isActive,r}var[Pge,Tge]=Pn({name:"ToastOptionsContext",strict:!1}),Mge=e=>{const t=S.useSyncExternalStore($l.subscribe,$l.getState,$l.getState),{motionVariants:n,component:r=ZB,portalProps:i}=e,a=Object.keys(t).map(s=>{const l=t[s];return g.jsx("ul",{role:"region","aria-live":"polite",id:`chakra-toast-manager-${s}`,style:Xce(s),children:g.jsx(rp,{initial:!1,children:l.map(u=>g.jsx(r,{motionVariants:n,...u},u.id))})},s)});return g.jsx(u0,{...i,children:a})};function s2(e){const{theme:t}=tF(),n=Tge();return S.useMemo(()=>Ege(t.direction,{...n,...e}),[e,t.direction,n])}var Lge=e=>function({children:n,theme:r=e,toastOptions:i,...o}){return g.jsxs(qce,{theme:r,...o,children:[g.jsx(Pge,{value:i==null?void 0:i.defaultOptions,children:n}),g.jsx(Mge,{...i})]})},Age=Lge(lce),Oge=Object.defineProperty,Rge=(e,t,n)=>t in e?Oge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nr=(e,t,n)=>(Rge(e,typeof t!="symbol"?t+"":t,n),n);function $A(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var Ige=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function FA(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function BA(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var z_=typeof window<"u"?S.useLayoutEffect:S.useEffect,a3=e=>e,Dge=class{constructor(){Nr(this,"descendants",new Map),Nr(this,"register",e=>{if(e!=null)return Ige(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),Nr(this,"unregister",e=>{this.descendants.delete(e);const t=$A(Array.from(this.descendants.keys()));this.assignIndex(t)}),Nr(this,"destroy",()=>{this.descendants.clear()}),Nr(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),Nr(this,"count",()=>this.descendants.size),Nr(this,"enabledCount",()=>this.enabledValues().length),Nr(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),Nr(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),Nr(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),Nr(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),Nr(this,"first",()=>this.item(0)),Nr(this,"firstEnabled",()=>this.enabledItem(0)),Nr(this,"last",()=>this.item(this.descendants.size-1)),Nr(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),Nr(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),Nr(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),Nr(this,"next",(e,t=!0)=>{const n=FA(e,this.count(),t);return this.item(n)}),Nr(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=FA(r,this.enabledCount(),t);return this.enabledItem(i)}),Nr(this,"prev",(e,t=!0)=>{const n=BA(e,this.count()-1,t);return this.item(n)}),Nr(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=BA(r,this.enabledCount()-1,t);return this.enabledItem(i)}),Nr(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=$A(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function jge(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Rn(...e){return t=>{e.forEach(n=>{jge(n,t)})}}function Nge(...e){return S.useMemo(()=>Rn(...e),e)}function $ge(){const e=S.useRef(new Dge);return z_(()=>()=>e.current.destroy()),e.current}var[Fge,iz]=Pn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function Bge(e){const t=iz(),[n,r]=S.useState(-1),i=S.useRef(null);z_(()=>()=>{i.current&&t.unregister(i.current)},[]),z_(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=a3(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:Rn(o,i)}}function l8(){return[a3(Fge),()=>a3(iz()),()=>$ge(),i=>Bge(i)]}var[zge,jw]=Pn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[Hge,u8]=Pn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[Wge,fNe,Vge,Uge]=l8(),tm=Xe(function(t,n){const{getButtonProps:r}=u8(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...jw().button};return g.jsx($e.button,{...i,className:xt("chakra-accordion__button",t.className),__css:a})});tm.displayName="AccordionButton";function c8(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(m,y)=>m!==y}=e,o=Qr(r),a=Qr(i),[s,l]=S.useState(n),u=t!==void 0,d=u?t:s,p=Qr(m=>{const b=typeof m=="function"?m(d):m;a(d,b)&&(u||l(b),o(b))},[u,o,d,a]);return[d,p]}function Gge(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;Yge(e),Xge(e);const s=Vge(),[l,u]=S.useState(-1);S.useEffect(()=>()=>{u(-1)},[]);const[d,p]=c8({value:r,defaultValue(){return i?n??[]:n??-1},onChange:t});return{index:d,setIndex:p,htmlProps:a,getAccordionItemProps:y=>{let b=!1;return y!==null&&(b=Array.isArray(d)?d.includes(y):d===y),{isOpen:b,onChange:E=>{if(y!==null)if(i&&Array.isArray(d)){const _=E?d.concat(y):d.filter(k=>k!==y);p(_)}else E?p(y):o&&p(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[qge,d8]=Pn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function Kge(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=d8(),s=S.useRef(null),l=S.useId(),u=r??l,d=`accordion-button-${u}`,p=`accordion-panel-${u}`;Zge(e);const{register:m,index:y,descendants:b}=Uge({disabled:t&&!n}),{isOpen:w,onChange:E}=o(y===-1?null:y);Qge({isOpen:w,isDisabled:t});const _=()=>{E==null||E(!0)},k=()=>{E==null||E(!1)},T=S.useCallback(()=>{E==null||E(!w),a(y)},[y,a,w,E]),L=S.useCallback(N=>{const B={ArrowDown:()=>{const K=b.nextEnabled(y);K==null||K.node.focus()},ArrowUp:()=>{const K=b.prevEnabled(y);K==null||K.node.focus()},Home:()=>{const K=b.firstEnabled();K==null||K.node.focus()},End:()=>{const K=b.lastEnabled();K==null||K.node.focus()}}[N.key];B&&(N.preventDefault(),B(N))},[b,y]),O=S.useCallback(()=>{a(y)},[a,y]),D=S.useCallback(function(V={},B=null){return{...V,type:"button",ref:Rn(m,s,B),id:d,disabled:!!t,"aria-expanded":!!w,"aria-controls":p,onClick:ht(V.onClick,T),onFocus:ht(V.onFocus,O),onKeyDown:ht(V.onKeyDown,L)}},[d,t,w,T,O,L,p,m]),I=S.useCallback(function(V={},B=null){return{...V,ref:B,role:"region",id:p,"aria-labelledby":d,hidden:!w}},[d,w,p]);return{isOpen:w,isDisabled:t,isFocusable:n,onOpen:_,onClose:k,getButtonProps:D,getPanelProps:I,htmlProps:i}}function Yge(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;e2({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function Xge(e){e2({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function Zge(e){e2({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. - `})}function Qge(e){e2({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function nm(e){const{isOpen:t,isDisabled:n}=u8(),{reduceMotion:r}=d8(),i=xt("chakra-accordion__icon",e.className),o=jw(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return g.jsx(Da,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e,children:g.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}nm.displayName="AccordionIcon";var rm=Xe(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=Kge(t),l={...jw().container,overflowAnchor:"none"},u=S.useMemo(()=>a,[a]);return g.jsx(Hge,{value:u,children:g.jsx($e.div,{ref:n,...o,className:xt("chakra-accordion__item",i),__css:l,children:typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r})})});rm.displayName="AccordionItem";var im={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Ih={enter:{duration:.2,ease:im.easeOut},exit:{duration:.1,ease:im.easeIn}},Ku={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},Jge=e=>e!=null&&parseInt(e.toString(),10)>0,zA={exit:{height:{duration:.2,ease:im.ease},opacity:{duration:.3,ease:im.ease}},enter:{height:{duration:.3,ease:im.ease},opacity:{duration:.4,ease:im.ease}}},eme={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:Jge(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(o=n==null?void 0:n.exit)!=null?o:Ku.exit(zA.exit,i)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(o=n==null?void 0:n.enter)!=null?o:Ku.enter(zA.enter,i)}}},oz=S.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:d,...p}=e,[m,y]=S.useState(!1);S.useEffect(()=>{const k=setTimeout(()=>{y(!0)});return()=>clearTimeout(k)},[]),e2({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,w={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:d==null?void 0:d.enter,exit:r?d==null?void 0:d.exit:{...d==null?void 0:d.exit,display:b?"block":"none"}}},E=r?n:!0,_=n||r?"enter":"exit";return g.jsx(rp,{initial:!1,custom:w,children:E&&g.jsx(su.div,{ref:t,...p,className:xt("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:w,variants:eme,initial:r?"exit":!1,animate:_,exit:"exit"})})});oz.displayName="Collapse";var tme={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Ku.enter(Ih.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:Ku.exit(Ih.exit,n),transitionEnd:t==null?void 0:t.exit}}},az={initial:"exit",animate:"enter",exit:"exit",variants:tme},nme=S.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,d=i||r?"enter":"exit",p=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return g.jsx(rp,{custom:m,children:p&&g.jsx(su.div,{ref:n,className:xt("chakra-fade",o),custom:m,...az,animate:d,...u})})});nme.displayName="Fade";var rme={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(o=n==null?void 0:n.exit)!=null?o:Ku.exit(Ih.exit,i)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Ku.enter(Ih.enter,n),transitionEnd:e==null?void 0:e.enter}}},sz={initial:"exit",animate:"enter",exit:"exit",variants:rme},ime=S.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:d,...p}=t,m=r?i&&r:!0,y=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:d};return g.jsx(rp,{custom:b,children:m&&g.jsx(su.div,{ref:n,className:xt("chakra-offset-slide",s),...sz,animate:y,custom:b,...p})})});ime.displayName="ScaleFade";var ome={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,x:e,y:t,transition:(o=n==null?void 0:n.exit)!=null?o:Ku.exit(Ih.exit,i),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Ku.enter(Ih.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{var a;const s={x:t,y:e};return{opacity:0,transition:(a=n==null?void 0:n.exit)!=null?a:Ku.exit(Ih.exit,o),...i?{...s,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...s,...r==null?void 0:r.exit}}}}},H_={initial:"initial",animate:"enter",exit:"exit",variants:ome},ame=S.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:d,delay:p,...m}=t,y=r?i&&r:!0,b=i||r?"enter":"exit",w={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:d,delay:p};return g.jsx(rp,{custom:w,children:y&&g.jsx(su.div,{ref:n,className:xt("chakra-offset-slide",a),custom:w,...H_,animate:b,...m})})});ame.displayName="SlideFade";var om=Xe(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=d8(),{getPanelProps:s,isOpen:l}=u8(),u=s(o,n),d=xt("chakra-accordion__panel",r),p=jw();a||delete u.hidden;const m=g.jsx($e.div,{...u,__css:p.panel,className:d});return a?m:g.jsx(oz,{in:l,...i,children:m})});om.displayName="AccordionPanel";var f8=Xe(function({children:t,reduceMotion:n,...r},i){const o=Yi("Accordion",r),a=fr(r),{htmlProps:s,descendants:l,...u}=Gge(a),d=S.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return g.jsx(Wge,{value:l,children:g.jsx(qge,{value:d,children:g.jsx(zge,{value:o,children:g.jsx($e.div,{ref:i,...s,className:xt("chakra-accordion",r.className),__css:o.root,children:t})})})})});f8.displayName="Accordion";var W_=Xe(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return g.jsx("img",{width:r,height:i,ref:n,alt:o,...a})});W_.displayName="NativeImage";function sme(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,d]=S.useState("pending");S.useEffect(()=>{d(n?"loading":"pending")},[n]);const p=S.useRef(),m=S.useCallback(()=>{if(!n)return;y();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=w=>{y(),d("loaded"),i==null||i(w)},b.onerror=w=>{y(),d("failed"),o==null||o(w)},p.current=b},[n,a,r,s,i,o,t]),y=()=>{p.current&&(p.current.onload=null,p.current.onerror=null,p.current=null)};return Ul(()=>{if(!l)return u==="loading"&&m(),()=>{y()}},[u,m,l]),l?"loaded":u}var lme=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function ume(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var Nw=Xe(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:d,crossOrigin:p,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:y,...b}=t,w=r!==void 0||i!==void 0,E=u!=null||d||!w,_=sme({...t,ignoreFallback:E}),k=lme(_,m),T={ref:n,objectFit:l,objectPosition:s,...E?b:ume(b,["onError","onLoad"])};return k?i||g.jsx($e.img,{as:W_,className:"chakra-image__placeholder",src:r,...T}):g.jsx($e.img,{as:W_,src:o,srcSet:a,crossOrigin:p,loading:u,referrerPolicy:y,className:"chakra-image",...T})});Nw.displayName="Image";function h8(e){return S.Children.toArray(e).filter(t=>S.isValidElement(t))}var[cme,dme]=Pn({strict:!1,name:"ButtonGroupContext"}),fme={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},hme={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Gi=Xe(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,orientation:d="horizontal",...p}=t,m=xt("chakra-button__group",a),y=S.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let b={display:"inline-flex",...l?fme[d]:hme[d](s)};const w=d==="vertical";return g.jsx(cme,{value:y,children:g.jsx($e.div,{ref:n,role:"group",__css:b,className:m,"data-attached":l?"":void 0,"data-orientation":d,flexDir:w?"column":void 0,...p})})});Gi.displayName="ButtonGroup";function pme(e){const[t,n]=S.useState(!e);return{ref:S.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}function V_(e){const{children:t,className:n,...r}=e,i=S.isValidElement(t)?S.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=xt("chakra-button__icon",n);return g.jsx($e.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o,children:i})}V_.displayName="ButtonIcon";function s3(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=g.jsx(h0,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=xt("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",d=S.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return g.jsx($e.div,{className:l,...s,__css:d,children:i})}s3.displayName="ButtonSpinner";var ss=Xe((e,t)=>{const n=dme(),r=au("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:d,iconSpacing:p="0.5rem",type:m,spinner:y,spinnerPlacement:b="start",className:w,as:E,..._}=fr(e),k=S.useMemo(()=>{const D={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:D}}},[r,n]),{ref:T,type:L}=pme(E),O={rightIcon:u,leftIcon:l,iconSpacing:p,children:s};return g.jsxs($e.button,{ref:Nge(t,T),as:E,type:m??L,"data-active":Bt(a),"data-loading":Bt(o),__css:k,className:xt("chakra-button",w),..._,disabled:i||o,children:[o&&b==="start"&&g.jsx(s3,{className:"chakra-button__spinner--start",label:d,placement:"start",spacing:p,children:y}),o?d||g.jsx($e.span,{opacity:0,children:g.jsx(HA,{...O})}):g.jsx(HA,{...O}),o&&b==="end"&&g.jsx(s3,{className:"chakra-button__spinner--end",label:d,placement:"end",spacing:p,children:y})]})});ss.displayName="Button";function HA(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return g.jsxs(g.Fragment,{children:[t&&g.jsx(V_,{marginEnd:i,children:t}),r,n&&g.jsx(V_,{marginStart:i,children:n})]})}var ls=Xe((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=S.isValidElement(s)?S.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return g.jsx(ss,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a,children:l})});ls.displayName="IconButton";var[hNe,gme]=Pn({name:"CheckboxGroupContext",strict:!1});function mme(e){return g.jsx($e.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:g.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function vme(e){return g.jsx($e.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:g.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function yme(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?vme:mme;return n||t?g.jsx($e.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:g.jsx(i,{...r})}):null}var[bme,lz]=Pn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[xme,ip]=Pn({strict:!1,name:"FormControlContext"});function Sme(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=S.useId(),l=t||`field-${s}`,u=`${l}-label`,d=`${l}-feedback`,p=`${l}-helptext`,[m,y]=S.useState(!1),[b,w]=S.useState(!1),[E,_]=S.useState(!1),k=S.useCallback((I={},N=null)=>({id:p,...I,ref:Rn(N,V=>{V&&w(!0)})}),[p]),T=S.useCallback((I={},N=null)=>{var V,B;return{...I,ref:N,"data-focus":Bt(E),"data-disabled":Bt(i),"data-invalid":Bt(r),"data-readonly":Bt(o),id:(V=I.id)!=null?V:u,htmlFor:(B=I.htmlFor)!=null?B:l}},[l,i,E,r,o,u]),L=S.useCallback((I={},N=null)=>({id:d,...I,ref:Rn(N,V=>{V&&y(!0)}),"aria-live":"polite"}),[d]),O=S.useCallback((I={},N=null)=>({...I,...a,ref:N,role:"group"}),[a]),D=S.useCallback((I={},N=null)=>({...I,ref:N,role:"presentation","aria-hidden":!0,children:I.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!E,onFocus:()=>_(!0),onBlur:()=>_(!1),hasFeedbackText:m,setHasFeedbackText:y,hasHelpText:b,setHasHelpText:w,id:l,labelId:u,feedbackId:d,helpTextId:p,htmlProps:a,getHelpTextProps:k,getErrorMessageProps:L,getRootProps:O,getLabelProps:T,getRequiredIndicatorProps:D}}var sn=Xe(function(t,n){const r=Yi("Form",t),i=fr(t),{getRootProps:o,htmlProps:a,...s}=Sme(i),l=xt("chakra-form-control",t.className);return g.jsx(xme,{value:s,children:g.jsx(bme,{value:r,children:g.jsx($e.div,{...o({},n),className:l,__css:r.container})})})});sn.displayName="FormControl";var sr=Xe(function(t,n){const r=ip(),i=lz(),o=xt("chakra-form__helper-text",t.className);return g.jsx($e.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});sr.displayName="FormHelperText";var[wme,Cme]=Pn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),lr=Xe((e,t)=>{const n=Yi("FormError",e),r=fr(e),i=ip();return i!=null&&i.isInvalid?g.jsx(wme,{value:n,children:g.jsx($e.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:xt("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})}):null});lr.displayName="FormErrorMessage";var _me=Xe((e,t)=>{const n=Cme(),r=ip();if(!(r!=null&&r.isInvalid))return null;const i=xt("chakra-form__error-icon",e.className);return g.jsx(Da,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i,children:g.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})});_me.displayName="FormErrorIcon";var Sn=Xe(function(t,n){var r;const i=au("FormLabel",t),o=fr(t),{className:a,children:s,requiredIndicator:l=g.jsx(uz,{}),optionalIndicator:u=null,...d}=o,p=ip(),m=(r=p==null?void 0:p.getLabelProps(d,n))!=null?r:{ref:n,...d};return g.jsxs($e.label,{...m,className:xt("chakra-form__label",o.className),__css:{display:"block",textAlign:"start",...i},children:[s,p!=null&&p.isRequired?l:u]})});Sn.displayName="FormLabel";var uz=Xe(function(t,n){const r=ip(),i=lz();if(!(r!=null&&r.isRequired))return null;const o=xt("chakra-form__required-indicator",t.className);return g.jsx($e.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});uz.displayName="RequiredIndicator";function p8(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=g8(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":Vu(n),"aria-required":Vu(i),"aria-readonly":Vu(r)}}function g8(e){var t,n,r;const i=ip(),{id:o,disabled:a,readOnly:s,required:l,isRequired:u,isInvalid:d,isReadOnly:p,isDisabled:m,onFocus:y,onBlur:b,...w}=e,E=e["aria-describedby"]?[e["aria-describedby"]]:[];return i!=null&&i.hasFeedbackText&&(i!=null&&i.isInvalid)&&E.push(i.feedbackId),i!=null&&i.hasHelpText&&E.push(i.helpTextId),{...w,"aria-describedby":E.join(" ")||void 0,id:o??(i==null?void 0:i.id),isDisabled:(t=a??m)!=null?t:i==null?void 0:i.isDisabled,isReadOnly:(n=s??p)!=null?n:i==null?void 0:i.isReadOnly,isRequired:(r=l??u)!=null?r:i==null?void 0:i.isRequired,isInvalid:d??(i==null?void 0:i.isInvalid),onFocus:ht(i==null?void 0:i.onFocus,y),onBlur:ht(i==null?void 0:i.onBlur,b)}}var kme={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},WA=!1,l2=null,qh=!1,U_=!1,G_=new Set;function m8(e,t){G_.forEach(n=>n(e,t))}var Eme=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function Pme(e){return!(e.metaKey||!Eme&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function VA(e){qh=!0,Pme(e)&&(l2="keyboard",m8("keyboard",e))}function xg(e){if(l2="pointer",e.type==="mousedown"||e.type==="pointerdown"){qh=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;m8("pointer",e)}}function Tme(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function Mme(e){Tme(e)&&(qh=!0,l2="virtual")}function Lme(e){e.target===window||e.target===document||(!qh&&!U_&&(l2="virtual",m8("virtual",e)),qh=!1,U_=!1)}function Ame(){qh=!1,U_=!0}function UA(){return l2!=="pointer"}function Ome(){if(typeof window>"u"||WA)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){qh=!0,e.apply(this,n)},document.addEventListener("keydown",VA,!0),document.addEventListener("keyup",VA,!0),document.addEventListener("click",Mme,!0),window.addEventListener("focus",Lme,!0),window.addEventListener("blur",Ame,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",xg,!0),document.addEventListener("pointermove",xg,!0),document.addEventListener("pointerup",xg,!0)):(document.addEventListener("mousedown",xg,!0),document.addEventListener("mousemove",xg,!0),document.addEventListener("mouseup",xg,!0)),WA=!0}function cz(e){Ome(),e(UA());const t=()=>e(UA());return G_.add(t),()=>{G_.delete(t)}}function Rme(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function dz(e={}){const t=g8(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:d,isChecked:p,isFocusable:m,onChange:y,isIndeterminate:b,name:w,value:E,tabIndex:_=void 0,"aria-label":k,"aria-labelledby":T,"aria-invalid":L,...O}=e,D=Rme(O,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),I=Qr(y),N=Qr(s),V=Qr(l),[B,K]=S.useState(!1),[ne,z]=S.useState(!1),[$,H]=S.useState(!1),[Y,Q]=S.useState(!1);S.useEffect(()=>cz(K),[]);const q=S.useRef(null),[X,ee]=S.useState(!0),[fe,Ee]=S.useState(!!d),we=p!==void 0,xe=we?p:fe,Ae=S.useCallback(ze=>{if(r||n){ze.preventDefault();return}we||Ee(xe?ze.target.checked:b?!0:ze.target.checked),I==null||I(ze)},[r,n,xe,we,b,I]);Ul(()=>{q.current&&(q.current.indeterminate=Boolean(b))},[b]),rc(()=>{n&&z(!1)},[n,z]),Ul(()=>{const ze=q.current;ze!=null&&ze.form&&(ze.form.onreset=()=>{Ee(!!d)})},[]);const Se=n&&!m,Qe=S.useCallback(ze=>{ze.key===" "&&Q(!0)},[Q]),Ye=S.useCallback(ze=>{ze.key===" "&&Q(!1)},[Q]);Ul(()=>{if(!q.current)return;q.current.checked!==xe&&Ee(q.current.checked)},[q.current]);const nt=S.useCallback((ze={},at=null)=>{const jt=gt=>{ne&>.preventDefault(),Q(!0)};return{...ze,ref:at,"data-active":Bt(Y),"data-hover":Bt($),"data-checked":Bt(xe),"data-focus":Bt(ne),"data-focus-visible":Bt(ne&&B),"data-indeterminate":Bt(b),"data-disabled":Bt(n),"data-invalid":Bt(o),"data-readonly":Bt(r),"aria-hidden":!0,onMouseDown:ht(ze.onMouseDown,jt),onMouseUp:ht(ze.onMouseUp,()=>Q(!1)),onMouseEnter:ht(ze.onMouseEnter,()=>H(!0)),onMouseLeave:ht(ze.onMouseLeave,()=>H(!1))}},[Y,xe,n,ne,B,$,b,o,r]),vt=S.useCallback((ze={},at=null)=>({...D,...ze,ref:Rn(at,jt=>{jt&&ee(jt.tagName==="LABEL")}),onClick:ht(ze.onClick,()=>{var jt;X||((jt=q.current)==null||jt.click(),requestAnimationFrame(()=>{var gt;(gt=q.current)==null||gt.focus()}))}),"data-disabled":Bt(n),"data-checked":Bt(xe),"data-invalid":Bt(o)}),[D,n,xe,o,X]),Ce=S.useCallback((ze={},at=null)=>({...ze,ref:Rn(q,at),type:"checkbox",name:w,value:E,id:a,tabIndex:_,onChange:ht(ze.onChange,Ae),onBlur:ht(ze.onBlur,N,()=>z(!1)),onFocus:ht(ze.onFocus,V,()=>z(!0)),onKeyDown:ht(ze.onKeyDown,Qe),onKeyUp:ht(ze.onKeyUp,Ye),required:i,checked:xe,disabled:Se,readOnly:r,"aria-label":k,"aria-labelledby":T,"aria-invalid":L?Boolean(L):o,"aria-describedby":u,"aria-disabled":n,style:kme}),[w,E,a,Ae,N,V,Qe,Ye,i,xe,Se,r,k,T,L,o,u,n,_]),et=S.useCallback((ze={},at=null)=>({...ze,ref:at,onMouseDown:ht(ze.onMouseDown,GA),onTouchStart:ht(ze.onTouchStart,GA),"data-disabled":Bt(n),"data-checked":Bt(xe),"data-invalid":Bt(o)}),[xe,n,o]);return{state:{isInvalid:o,isFocused:ne,isChecked:xe,isActive:Y,isHovered:$,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:vt,getCheckboxProps:nt,getInputProps:Ce,getLabelProps:et,htmlProps:D}}function GA(e){e.preventDefault(),e.stopPropagation()}var Ime={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},Dme={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},jme=nf({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),Nme=nf({from:{opacity:0},to:{opacity:1}}),$me=nf({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),fz=Xe(function(t,n){const r=gme(),i={...r,...t},o=Yi("Checkbox",i),a=fr(t),{spacing:s="0.5rem",className:l,children:u,iconColor:d,iconSize:p,icon:m=g.jsx(yme,{}),isChecked:y,isDisabled:b=r==null?void 0:r.isDisabled,onChange:w,inputProps:E,..._}=a;let k=y;r!=null&&r.value&&a.value&&(k=r.value.includes(a.value));let T=w;r!=null&&r.onChange&&a.value&&(T=ww(r.onChange,w));const{state:L,getInputProps:O,getCheckboxProps:D,getLabelProps:I,getRootProps:N}=dz({..._,isDisabled:b,isChecked:k,onChange:T}),V=S.useMemo(()=>({animation:L.isIndeterminate?`${Nme} 20ms linear, ${$me} 200ms linear`:`${jme} 200ms linear`,fontSize:p,color:d,...o.icon}),[d,p,,L.isIndeterminate,o.icon]),B=S.cloneElement(m,{__css:V,isIndeterminate:L.isIndeterminate,isChecked:L.isChecked});return g.jsxs($e.label,{__css:{...Dme,...o.container},className:xt("chakra-checkbox",l),...N(),children:[g.jsx("input",{className:"chakra-checkbox__input",...O(E,n)}),g.jsx($e.span,{__css:{...Ime,...o.control},className:"chakra-checkbox__control",...D(),children:B}),u&&g.jsx($e.span,{className:"chakra-checkbox__label",...I(),__css:{marginStart:s,...o.label},children:u})]})});fz.displayName="Checkbox";function Fme(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function v8(e,t){let n=Fme(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function q_(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function qA(e,t,n){return(e-t)*100/(n-t)}function Bme(e,t,n){return(n-t)*e+t}function KA(e,t,n){const r=Math.round((e-t)/n)*n+t,i=q_(n);return v8(r,i)}function Jx(e,t,n){return e==null?e:(n{var B;return r==null?"":(B=cC(r,o,n))!=null?B:""}),m=typeof i<"u",y=m?i:d,b=hz(dd(y),o),w=n??b,E=S.useCallback(B=>{B!==y&&(m||p(B.toString()),u==null||u(B.toString(),dd(B)))},[u,m,y]),_=S.useCallback(B=>{let K=B;return l&&(K=Jx(K,a,s)),v8(K,w)},[w,l,s,a]),k=S.useCallback((B=o)=>{let K;y===""?K=dd(B):K=dd(y)+B,K=_(K),E(K)},[_,o,E,y]),T=S.useCallback((B=o)=>{let K;y===""?K=dd(-B):K=dd(y)-B,K=_(K),E(K)},[_,o,E,y]),L=S.useCallback(()=>{var B;let K;r==null?K="":K=(B=cC(r,o,n))!=null?B:a,E(K)},[r,n,o,E,a]),O=S.useCallback(B=>{var K;const ne=(K=cC(B,o,w))!=null?K:a;E(ne)},[w,o,E,a]),D=dd(y);return{isOutOfRange:D>s||D{const o=typeof e=="function"?e():e??document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e??document;o==null||o.removeEventListener(t,i,r)}}function Hme(e){return"current"in e}var pz=()=>typeof window<"u";function Wme(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var Vme=e=>pz()&&e.test(navigator.vendor),Ume=e=>pz()&&e.test(Wme()),Gme=()=>Ume(/mac|iphone|ipad|ipod/i),qme=()=>Gme()&&Vme(/apple/i);function Kme(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var o,a;return(a=(o=t.current)==null?void 0:o.ownerDocument)!=null?a:document};Dh(i,"pointerdown",o=>{if(!qme()||!r)return;const a=o.target,l=(n??[t]).some(u=>{const d=Hme(u)?u.current:u;return(d==null?void 0:d.contains(a))||d===a});i().activeElement!==a&&l&&(o.preventDefault(),a.focus())})}function y8(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var An={},Yme={get exports(){return An},set exports(e){An=e}},Xme="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zme=Xme,Qme=Zme;function gz(){}function mz(){}mz.resetWarningCache=gz;var Jme=function(){function e(r,i,o,a,s,l){if(l!==Qme){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:mz,resetWarningCache:gz};return n.PropTypes=n,n};Yme.exports=Jme();var K_="data-focus-lock",vz="data-focus-lock-disabled",e0e="data-no-focus-lock",t0e="data-autofocus-inside",n0e="data-no-autofocus";function r0e(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function i0e(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function yz(e,t){return i0e(t||null,function(n){return e.forEach(function(r){return r0e(r,n)})})}var dC={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function bz(e){return e}function xz(e,t){t===void 0&&(t=bz);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var d=a;a=[],d.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function b8(e,t){return t===void 0&&(t=bz),xz(e,t)}function Sz(e){e===void 0&&(e={});var t=xz(null);return t.options=Nl({async:!0,ssr:!1},e),t}var wz=function(e){var t=e.sideCar,n=XB(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,Nl({},n))};wz.isSideCarExport=!0;function o0e(e,t){return e.useMedium(t),wz}var Cz=b8({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),_z=b8(),a0e=b8(),s0e=Sz({async:!0}),l0e=[],x8=S.forwardRef(function(t,n){var r,i=S.useState(),o=i[0],a=i[1],s=S.useRef(),l=S.useRef(!1),u=S.useRef(null),d=t.children,p=t.disabled,m=t.noFocusGuards,y=t.persistentFocus,b=t.crossFrame,w=t.autoFocus;t.allowTextSelection;var E=t.group,_=t.className,k=t.whiteList,T=t.hasPositiveIndices,L=t.shards,O=L===void 0?l0e:L,D=t.as,I=D===void 0?"div":D,N=t.lockProps,V=N===void 0?{}:N,B=t.sideCar,K=t.returnFocus,ne=t.focusOptions,z=t.onActivation,$=t.onDeactivation,H=S.useState({}),Y=H[0],Q=S.useCallback(function(){u.current=u.current||document&&document.activeElement,s.current&&z&&z(s.current),l.current=!0},[z]),q=S.useCallback(function(){l.current=!1,$&&$(s.current)},[$]);S.useEffect(function(){p||(u.current=null)},[]);var X=S.useCallback(function(Qe){var Ye=u.current;if(Ye&&Ye.focus){var nt=typeof K=="function"?K(Ye):K;if(nt){var vt=typeof nt=="object"?nt:void 0;u.current=null,Qe?Promise.resolve().then(function(){return Ye.focus(vt)}):Ye.focus(vt)}}},[K]),ee=S.useCallback(function(Qe){l.current&&Cz.useMedium(Qe)},[]),fe=_z.useMedium,Ee=S.useCallback(function(Qe){s.current!==Qe&&(s.current=Qe,a(Qe))},[]),we=pn((r={},r[vz]=p&&"disabled",r[K_]=E,r),V),xe=m!==!0,Ae=xe&&m!=="tail",Se=yz([n,Ee]);return S.createElement(S.Fragment,null,xe&&[S.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:p?-1:0,style:dC}),T?S.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:p?-1:1,style:dC}):null],!p&&S.createElement(B,{id:Y,sideCar:s0e,observed:o,disabled:p,persistentFocus:y,crossFrame:b,autoFocus:w,whiteList:k,shards:O,onActivation:Q,onDeactivation:q,returnFocus:X,focusOptions:ne}),S.createElement(I,pn({ref:Se},we,{className:_,onBlur:fe,onFocus:ee}),d),Ae&&S.createElement("div",{"data-focus-guard":!0,tabIndex:p?-1:0,style:dC}))});x8.propTypes={};x8.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const kz=x8;function l3(e,t){return l3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},l3(e,t)}function S8(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,l3(e,t)}function Ks(e){return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ks(e)}function u0e(e,t){if(Ks(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ks(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ez(e){var t=u0e(e,"string");return Ks(t)==="symbol"?t:String(t)}function fs(e,t,n){return t=Ez(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c0e(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var o=[],a;function s(){a=e(o.map(function(u){return u.props})),t(a)}var l=function(u){S8(d,u);function d(){return u.apply(this,arguments)||this}d.peek=function(){return a};var p=d.prototype;return p.componentDidMount=function(){o.push(this),s()},p.componentDidUpdate=function(){s()},p.componentWillUnmount=function(){var y=o.indexOf(this);o.splice(y,1),s()},p.render=function(){return qe.createElement(i,this.props)},d}(S.PureComponent);return fs(l,"displayName","SideEffect("+n(i)+")"),l}}var lu=function(e){for(var t=Array(e.length),n=0;n=0}).sort(y0e)},b0e=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],C8=b0e.join(","),x0e="".concat(C8,", [data-focus-guard]"),jz=function(e,t){return lu((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?x0e:C8)?[r]:[],jz(r))},[])},S0e=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?$w([e.contentDocument.body],t):[e]},$w=function(e,t){return e.reduce(function(n,r){var i,o=jz(r,t),a=(i=[]).concat.apply(i,o.map(function(s){return S0e(s,t)}));return n.concat(a,r.parentNode?lu(r.parentNode.querySelectorAll(C8)).filter(function(s){return s===r}):[])},[])},w0e=function(e){var t=e.querySelectorAll("[".concat(t0e,"]"));return lu(t).map(function(n){return $w([n])}).reduce(function(n,r){return n.concat(r)},[])},_8=function(e,t){return lu(e).filter(function(n){return Lz(t,n)}).filter(function(n){return g0e(n)})},YA=function(e,t){return t===void 0&&(t=new Map),lu(e).filter(function(n){return Az(t,n)})},Y_=function(e,t,n){return Dz(_8($w(e,n),t),!0,n)},XA=function(e,t){return Dz(_8($w(e),t),!1)},C0e=function(e,t){return _8(w0e(e),t)},_m=function(e,t){return e.shadowRoot?_m(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:lu(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var i=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return i?_m(i,t):!1}return _m(n,t)})},_0e=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},Nz=function(e){return e.parentNode?Nz(e.parentNode):e},k8=function(e){var t=u3(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(K_);return n.push.apply(n,i?_0e(lu(Nz(r).querySelectorAll("[".concat(K_,'="').concat(i,'"]:not([').concat(vz,'="disabled"])')))):[r]),n},[])},k0e=function(e){try{return e()}catch{return}},Ty=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Ty(t.shadowRoot):t instanceof HTMLIFrameElement&&k0e(function(){return t.contentWindow.document})?Ty(t.contentWindow.document):t}},E0e=function(e,t){return e===t},P0e=function(e,t){return Boolean(lu(e.querySelectorAll("iframe")).some(function(n){return E0e(n,t)}))},$z=function(e,t){return t===void 0&&(t=Ty(Pz(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:k8(e).some(function(n){return _m(n,t)||P0e(n,t)})},T0e=function(e){e===void 0&&(e=document);var t=Ty(e);return t?lu(e.querySelectorAll("[".concat(e0e,"]"))).some(function(n){return _m(n,t)}):!1},M0e=function(e,t){return t.filter(Iz).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},E8=function(e,t){return Iz(e)&&e.name?M0e(e,t):e},L0e=function(e){var t=new Set;return e.forEach(function(n){return t.add(E8(n,e))}),e.filter(function(n){return t.has(n)})},ZA=function(e){return e[0]&&e.length>1?E8(e[0],e):e[0]},QA=function(e,t){return e.length>1?e.indexOf(E8(e[t],e)):t},Fz="NEW_FOCUS",A0e=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=w8(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,d=r?e.indexOf(r):-1,p=l-u,m=t.indexOf(o),y=t.indexOf(a),b=L0e(t),w=n!==void 0?b.indexOf(n):-1,E=w-(r?b.indexOf(r):l),_=QA(e,0),k=QA(e,i-1);if(l===-1||d===-1)return Fz;if(!p&&d>=0)return d;if(l<=m&&s&&Math.abs(p)>1)return k;if(l>=y&&s&&Math.abs(p)>1)return _;if(p&&Math.abs(E)>1)return d;if(l<=m)return k;if(l>y)return _;if(p)return Math.abs(p)>1?d:(i+d+p)%i}},O0e=function(e){return function(t){var n,r=(n=Oz(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},R0e=function(e,t,n){var r=e.map(function(o){var a=o.node;return a}),i=YA(r.filter(O0e(n)));return i&&i.length?ZA(i):ZA(YA(t))},X_=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&X_(e.parentNode.host||e.parentNode,t),t},fC=function(e,t){for(var n=X_(e),r=X_(t),i=0;i=0)return o}return!1},Bz=function(e,t,n){var r=u3(e),i=u3(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=fC(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=fC(o,l);u&&(!a||_m(u,a)?a=u:a=fC(u,a))})}),a},I0e=function(e,t){return e.reduce(function(n,r){return n.concat(C0e(r,t))},[])},D0e=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(v0e)},j0e=function(e,t){var n=Ty(u3(e).length>0?document:Pz(e).ownerDocument),r=k8(e).filter(c3),i=Bz(n||e,e,r),o=new Map,a=XA(r,o),s=Y_(r,o).filter(function(y){var b=y.node;return c3(b)});if(!(!s[0]&&(s=a,!s[0]))){var l=XA([i],o).map(function(y){var b=y.node;return b}),u=D0e(l,s),d=u.map(function(y){var b=y.node;return b}),p=A0e(d,l,n,t);if(p===Fz){var m=R0e(a,d,I0e(r,o));if(m)return{node:m};console.warn("focus-lock: cannot find any node to move focus into");return}return p===void 0?p:u[p]}},N0e=function(e){var t=k8(e).filter(c3),n=Bz(e,e,t),r=new Map,i=Y_([n],r,!0),o=Y_(t,r).filter(function(a){var s=a.node;return c3(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:w8(s)}})},$0e=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},hC=0,pC=!1,zz=function(e,t,n){n===void 0&&(n={});var r=j0e(e,t);if(!pC&&r){if(hC>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),pC=!0,setTimeout(function(){pC=!1},1);return}hC++,$0e(r.node,n.focusOptions),hC--}};function Hz(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var F0e=function(){return document&&document.activeElement===document.body},B0e=function(){return F0e()||T0e()},km=null,am=null,Em=null,My=!1,z0e=function(){return!0},H0e=function(t){return(km.whiteList||z0e)(t)},W0e=function(t,n){Em={observerNode:t,portaledElement:n}},V0e=function(t){return Em&&Em.portaledElement===t};function JA(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var U0e=function(t){return t&&"current"in t?t.current:t},G0e=function(t){return t?Boolean(My):My==="meanwhile"},q0e=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},K0e=function(t,n){return n.some(function(r){return q0e(t,r,r)})},d3=function(){var t=!1;if(km){var n=km,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||Em&&Em.portaledElement,d=document&&document.activeElement;if(u){var p=[u].concat(a.map(U0e).filter(Boolean));if((!d||H0e(d))&&(i||G0e(s)||!B0e()||!am&&o)&&(u&&!($z(p)||d&&K0e(d,p)||V0e(d))&&(document&&!am&&d&&!o?(d.blur&&d.blur(),document.body.focus()):(t=zz(p,am,{focusOptions:l}),Em={})),My=!1,am=document&&document.activeElement),document){var m=document&&document.activeElement,y=N0e(p),b=y.map(function(w){var E=w.node;return E}).indexOf(m);b>-1&&(y.filter(function(w){var E=w.guard,_=w.node;return E&&_.dataset.focusAutoGuard}).forEach(function(w){var E=w.node;return E.removeAttribute("tabIndex")}),JA(b,y.length,1,y),JA(b,-1,-1,y))}}}return t},Wz=function(t){d3()&&t&&(t.stopPropagation(),t.preventDefault())},P8=function(){return Hz(d3)},Y0e=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||W0e(r,n)},X0e=function(){return null},Vz=function(){My="just",setTimeout(function(){My="meanwhile"},0)},Z0e=function(){document.addEventListener("focusin",Wz),document.addEventListener("focusout",P8),window.addEventListener("blur",Vz)},Q0e=function(){document.removeEventListener("focusin",Wz),document.removeEventListener("focusout",P8),window.removeEventListener("blur",Vz)};function J0e(e){return e.filter(function(t){var n=t.disabled;return!n})}function eve(e){var t=e.slice(-1)[0];t&&!km&&Z0e();var n=km,r=n&&t&&t.id===n.id;km=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(am=null,(!r||n.observed!==t.observed)&&t.onActivation(),d3(),Hz(d3)):(Q0e(),am=null)}Cz.assignSyncMedium(Y0e);_z.assignMedium(P8);a0e.assignMedium(function(e){return e({moveFocusInside:zz,focusInside:$z})});const tve=c0e(J0e,eve)(X0e);var Uz=S.forwardRef(function(t,n){return S.createElement(kz,pn({sideCar:tve,ref:n},t))}),Gz=kz.propTypes||{};Gz.sideCar;y8(Gz,["sideCar"]);Uz.propTypes={};const eO=Uz;function qz(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Kz(e){var t;if(!qz(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function nve(e){var t,n;return(n=(t=Yz(e))==null?void 0:t.defaultView)!=null?n:window}function Yz(e){return qz(e)?e.ownerDocument:document}function rve(e){return Yz(e).activeElement}var Xz=e=>e.hasAttribute("tabindex"),ive=e=>Xz(e)&&e.tabIndex===-1;function ove(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function Zz(e){return e.parentElement&&Zz(e.parentElement)?!0:e.hidden}function ave(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function Qz(e){if(!Kz(e)||Zz(e)||ove(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():ave(e)?!0:Xz(e)}function sve(e){return e?Kz(e)&&Qz(e)&&!ive(e):!1}var lve=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],uve=lve.join(),cve=e=>e.offsetWidth>0&&e.offsetHeight>0;function Jz(e){const t=Array.from(e.querySelectorAll(uve));return t.unshift(e),t.filter(n=>Qz(n)&&cve(n))}var tO,dve=(tO=eO.default)!=null?tO:eO,eH=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,d=S.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&Jz(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),p=S.useCallback(()=>{var y;(y=n==null?void 0:n.current)==null||y.focus()},[n]),m=i&&!n;return g.jsx(dve,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:d,onDeactivation:p,returnFocus:m,children:o})};eH.displayName="FocusLock";var fve=cce?S.useLayoutEffect:S.useEffect;function nO(e,t=[]){const n=S.useRef(e);return fve(()=>{n.current=e}),S.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function hve(e,t){const n=S.useId();return S.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function pve(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Kd(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=nO(n),a=nO(t),[s,l]=S.useState(e.defaultIsOpen||!1),[u,d]=pve(r,s),p=hve(i,"disclosure"),m=S.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),y=S.useCallback(()=>{u||l(!0),o==null||o()},[u,o]),b=S.useCallback(()=>{(d?m:y)()},[d,y,m]);return{isOpen:!!d,onOpen:y,onClose:m,onToggle:b,isControlled:u,getButtonProps:(w={})=>({...w,"aria-expanded":d,"aria-controls":p,onClick:gce(w.onClick,b)}),getDisclosureProps:(w={})=>({...w,hidden:!d,id:p})}}var T8=Xe(function(t,n){const{htmlSize:r,...i}=t,o=Yi("Input",i),a=fr(i),s=p8(a),l=xt("chakra-input",t.className);return g.jsx($e.input,{size:r,...s,__css:o.field,ref:n,className:l})});T8.displayName="Input";T8.id="Input";var[gve,tH]=Pn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),M8=Xe(function(t,n){const r=Yi("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=fr(t),u=h8(i),p=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return g.jsx(gve,{value:r,children:g.jsx($e.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...p},...l,children:u})})});M8.displayName="List";var mve=Xe((e,t)=>{const{as:n,...r}=e;return g.jsx(M8,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});mve.displayName="OrderedList";var nH=Xe(function(t,n){const{as:r,...i}=t;return g.jsx(M8,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});nH.displayName="UnorderedList";var d1=Xe(function(t,n){const r=tH();return g.jsx($e.li,{ref:n,...t,__css:r.item})});d1.displayName="ListItem";var vve=Xe(function(t,n){const r=tH();return g.jsx(Da,{ref:n,role:"presentation",...t,__css:r.icon})});vve.displayName="ListIcon";function rH(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):ko(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var iH=$e("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});iH.displayName="Spacer";var It=Xe(function(t,n){const r=au("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=fr(t),u=Ace({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return g.jsx($e.p,{ref:n,className:xt("chakra-text",t.className),...u,...l,__css:r})});It.displayName="Text";var oH=e=>g.jsx($e.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});oH.displayName="StackItem";var Z_="& > *:not(style) ~ *:not(style)";function yve(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[Z_]:rH(n,i=>r[i])}}function bve(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":rH(n,i=>r[i])}}var L8=Xe((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:d,shouldWrapChildren:p,...m}=e,y=n?"row":r??"column",b=S.useMemo(()=>yve({direction:y,spacing:a}),[y,a]),w=S.useMemo(()=>bve({spacing:a,direction:y}),[a,y]),E=!!u,_=!p&&!E,k=S.useMemo(()=>{const L=h8(l);return _?L:L.map((O,D)=>{const I=typeof O.key<"u"?O.key:D,N=D+1===L.length,B=p?g.jsx(oH,{children:O},I):O;if(!E)return B;const K=S.cloneElement(u,{__css:w}),ne=N?null:K;return g.jsxs(S.Fragment,{children:[B,ne]},I)})},[u,w,E,_,p,l]),T=xt("chakra-stack",d);return g.jsx($e.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:b.flexDirection,flexWrap:s,className:T,__css:E?{}:{[Z_]:b[Z_]},...m,children:k})});L8.displayName="Stack";var hn=Xe((e,t)=>g.jsx(L8,{align:"center",...e,direction:"column",ref:t}));hn.displayName="VStack";var u2=Xe((e,t)=>g.jsx(L8,{align:"center",...e,direction:"row",ref:t}));u2.displayName="HStack";var jh=Xe(function(t,n){const r=au("Heading",t),{className:i,...o}=fr(t);return g.jsx($e.h2,{ref:n,className:xt("chakra-heading",t.className),...o,__css:r})});jh.displayName="Heading";var ao=$e("div");ao.displayName="Box";var aH=Xe(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return g.jsx(ao,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});aH.displayName="Square";var xve=Xe(function(t,n){const{size:r,...i}=t;return g.jsx(aH,{size:r,ref:n,borderRadius:"9999px",...i})});xve.displayName="Circle";var Nh=Xe(function(t,n){const r=au("Link",t),{className:i,isExternal:o,...a}=fr(t);return g.jsx($e.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:xt("chakra-link",i),...a,__css:r})});Nh.displayName="Link";var sH=$e("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});sH.displayName="Center";var Sve={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Xe(function(t,n){const{axis:r="both",...i}=t;return g.jsx($e.div,{ref:n,__css:Sve[r],...i,position:"absolute"})});var ke=Xe(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...d}=t,p={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return g.jsx($e.div,{ref:n,__css:p,...d})});ke.displayName="Flex";function wve(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function Cve(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,i]=S.useState([]),o=S.useRef(),a=()=>{o.current&&(clearTimeout(o.current),o.current=null)},s=()=>{a(),o.current=setTimeout(()=>{i([]),o.current=null},t)};S.useEffect(()=>a,[]);function l(u){return d=>{if(d.key==="Backspace"){const p=[...r];p.pop(),i(p);return}if(wve(d)){const p=r.concat(d.key);n(d)&&(d.preventDefault(),d.stopPropagation()),i(p),u(p.join("")),s()}}}return l}function _ve(e,t,n,r){if(t==null)return r;if(!r)return e.find(a=>n(a).toLowerCase().startsWith(t.toLowerCase()));const i=e.filter(o=>n(o).toLowerCase().startsWith(t.toLowerCase()));if(i.length>0){let o;return i.includes(r)?(o=i.indexOf(r)+1,o===i.length&&(o=0),i[o]):(o=e.indexOf(i[0]),e[o])}return r}function kve(){const e=S.useRef(new Map),t=e.current,n=S.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=S.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return S.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function gC(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function lH(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:d,tabIndex:p,onMouseOver:m,onMouseLeave:y,...b}=e,[w,E]=S.useState(!0),[_,k]=S.useState(!1),T=kve(),L=Q=>{Q&&Q.tagName!=="BUTTON"&&E(!1)},O=w?p:p||0,D=n&&!r,I=S.useCallback(Q=>{if(n){Q.stopPropagation(),Q.preventDefault();return}Q.currentTarget.focus(),l==null||l(Q)},[n,l]),N=S.useCallback(Q=>{_&&gC(Q)&&(Q.preventDefault(),Q.stopPropagation(),k(!1),T.remove(document,"keyup",N,!1))},[_,T]),V=S.useCallback(Q=>{if(u==null||u(Q),n||Q.defaultPrevented||Q.metaKey||!gC(Q.nativeEvent)||w)return;const q=i&&Q.key==="Enter";o&&Q.key===" "&&(Q.preventDefault(),k(!0)),q&&(Q.preventDefault(),Q.currentTarget.click()),T.add(document,"keyup",N,!1)},[n,w,u,i,o,T,N]),B=S.useCallback(Q=>{if(d==null||d(Q),n||Q.defaultPrevented||Q.metaKey||!gC(Q.nativeEvent)||w)return;o&&Q.key===" "&&(Q.preventDefault(),k(!1),Q.currentTarget.click())},[o,w,n,d]),K=S.useCallback(Q=>{Q.button===0&&(k(!1),T.remove(document,"mouseup",K,!1))},[T]),ne=S.useCallback(Q=>{if(Q.button!==0)return;if(n){Q.stopPropagation(),Q.preventDefault();return}w||k(!0),Q.currentTarget.focus({preventScroll:!0}),T.add(document,"mouseup",K,!1),a==null||a(Q)},[n,w,a,T,K]),z=S.useCallback(Q=>{Q.button===0&&(w||k(!1),s==null||s(Q))},[s,w]),$=S.useCallback(Q=>{if(n){Q.preventDefault();return}m==null||m(Q)},[n,m]),H=S.useCallback(Q=>{_&&(Q.preventDefault(),k(!1)),y==null||y(Q)},[_,y]),Y=Rn(t,L);return w?{...b,ref:Y,type:"button","aria-disabled":D?void 0:n,disabled:D,onClick:I,onMouseDown:a,onMouseUp:s,onKeyUp:d,onKeyDown:u,onMouseOver:m,onMouseLeave:y}:{...b,ref:Y,role:"button","data-active":Bt(_),"aria-disabled":n?"true":void 0,tabIndex:D?void 0:O,onClick:I,onMouseDown:ne,onMouseUp:z,onKeyUp:B,onKeyDown:V,onMouseOver:$,onMouseLeave:H}}function Eve(e){const t=e.current;if(!t)return!1;const n=rve(t);return!n||t.contains(n)?!1:!!sve(n)}function uH(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;rc(()=>{if(!o||Eve(e))return;const a=(i==null?void 0:i.current)||e.current;a&&requestAnimationFrame(()=>{a.focus()})},[o,e,i])}var Pve={preventScroll:!0,shouldFocus:!1};function Tve(e,t=Pve){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=Mve(e)?e.current:e,s=i&&o,l=S.useRef(s),u=S.useRef(o);Ul(()=>{!u.current&&o&&(l.current=s),u.current=o},[o,s]);const d=S.useCallback(()=>{if(!(!o||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var p;(p=n.current)==null||p.focus({preventScroll:r})});else{const p=Jz(a);p.length>0&&requestAnimationFrame(()=>{p[0].focus({preventScroll:r})})}},[o,r,a,n]);rc(()=>{d()},[d]),Dh(a,"transitionend",d)}function Mve(e){return"current"in e}var Sg=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),ii={arrowShadowColor:Sg("--popper-arrow-shadow-color"),arrowSize:Sg("--popper-arrow-size","8px"),arrowSizeHalf:Sg("--popper-arrow-size-half"),arrowBg:Sg("--popper-arrow-bg"),transformOrigin:Sg("--popper-transform-origin"),arrowOffset:Sg("--popper-arrow-offset")};function Lve(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var Ave={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},Ove=e=>Ave[e],rO={scroll:!0,resize:!0};function Rve(e){let t;return typeof e=="object"?t={enabled:!0,options:{...rO,...e}}:t={enabled:e,options:rO},t}var Ive={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},Dve={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{iO(e)},effect:({state:e})=>()=>{iO(e)}},iO=e=>{e.elements.popper.style.setProperty(ii.transformOrigin.var,Ove(e.placement))},jve={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{Nve(e)}},Nve=e=>{var t;if(!e.placement)return;const n=$ve(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:ii.arrowSize.varRef,height:ii.arrowSize.varRef,zIndex:-1});const r={[ii.arrowSizeHalf.var]:`calc(${ii.arrowSize.varRef} / 2)`,[ii.arrowOffset.var]:`calc(${ii.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},$ve=e=>{if(e.startsWith("top"))return{property:"bottom",value:ii.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:ii.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:ii.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:ii.arrowOffset.varRef}},Fve={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{oO(e)},effect:({state:e})=>()=>{oO(e)}},oO=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=Lve(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:ii.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},Bve={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},zve={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function Hve(e,t="ltr"){var n,r;const i=((n=Bve[e])==null?void 0:n[t])||e;return t==="ltr"?i:(r=zve[e])!=null?r:i}var Zo="top",us="bottom",cs="right",Qo="left",A8="auto",c2=[Zo,us,cs,Qo],Gm="start",Ly="end",Wve="clippingParents",cH="viewport",Wv="popper",Vve="reference",aO=c2.reduce(function(e,t){return e.concat([t+"-"+Gm,t+"-"+Ly])},[]),dH=[].concat(c2,[A8]).reduce(function(e,t){return e.concat([t,t+"-"+Gm,t+"-"+Ly])},[]),Uve="beforeRead",Gve="read",qve="afterRead",Kve="beforeMain",Yve="main",Xve="afterMain",Zve="beforeWrite",Qve="write",Jve="afterWrite",e1e=[Uve,Gve,qve,Kve,Yve,Xve,Zve,Qve,Jve];function nu(e){return e?(e.nodeName||"").toLowerCase():null}function hs(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Kh(e){var t=hs(e).Element;return e instanceof t||e instanceof Element}function is(e){var t=hs(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function O8(e){if(typeof ShadowRoot>"u")return!1;var t=hs(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function t1e(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!is(o)||!nu(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function n1e(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!is(i)||!nu(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const r1e={name:"applyStyles",enabled:!0,phase:"write",fn:t1e,effect:n1e,requires:["computeStyles"]};function Zl(e){return e.split("-")[0]}var $h=Math.max,f3=Math.min,qm=Math.round;function Q_(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function fH(){return!/^((?!chrome|android).)*safari/i.test(Q_())}function Km(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&is(e)&&(i=e.offsetWidth>0&&qm(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&qm(r.height)/e.offsetHeight||1);var a=Kh(e)?hs(e):window,s=a.visualViewport,l=!fH()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,d=(r.top+(l&&s?s.offsetTop:0))/o,p=r.width/i,m=r.height/o;return{width:p,height:m,top:d,right:u+p,bottom:d+m,left:u,x:u,y:d}}function R8(e){var t=Km(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function hH(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&O8(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ic(e){return hs(e).getComputedStyle(e)}function i1e(e){return["table","td","th"].indexOf(nu(e))>=0}function lf(e){return((Kh(e)?e.ownerDocument:e.document)||window.document).documentElement}function Fw(e){return nu(e)==="html"?e:e.assignedSlot||e.parentNode||(O8(e)?e.host:null)||lf(e)}function sO(e){return!is(e)||ic(e).position==="fixed"?null:e.offsetParent}function o1e(e){var t=/firefox/i.test(Q_()),n=/Trident/i.test(Q_());if(n&&is(e)){var r=ic(e);if(r.position==="fixed")return null}var i=Fw(e);for(O8(i)&&(i=i.host);is(i)&&["html","body"].indexOf(nu(i))<0;){var o=ic(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function d2(e){for(var t=hs(e),n=sO(e);n&&i1e(n)&&ic(n).position==="static";)n=sO(n);return n&&(nu(n)==="html"||nu(n)==="body"&&ic(n).position==="static")?t:n||o1e(e)||t}function I8(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function H1(e,t,n){return $h(e,f3(t,n))}function a1e(e,t,n){var r=H1(e,t,n);return r>n?n:r}function pH(){return{top:0,right:0,bottom:0,left:0}}function gH(e){return Object.assign({},pH(),e)}function mH(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var s1e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,gH(typeof t!="number"?t:mH(t,c2))};function l1e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Zl(n.placement),l=I8(s),u=[Qo,cs].indexOf(s)>=0,d=u?"height":"width";if(!(!o||!a)){var p=s1e(i.padding,n),m=R8(o),y=l==="y"?Zo:Qo,b=l==="y"?us:cs,w=n.rects.reference[d]+n.rects.reference[l]-a[l]-n.rects.popper[d],E=a[l]-n.rects.reference[l],_=d2(o),k=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,T=w/2-E/2,L=p[y],O=k-m[d]-p[b],D=k/2-m[d]/2+T,I=H1(L,D,O),N=l;n.modifiersData[r]=(t={},t[N]=I,t.centerOffset=I-D,t)}}function u1e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||hH(t.elements.popper,i)&&(t.elements.arrow=i))}const c1e={name:"arrow",enabled:!0,phase:"main",fn:l1e,effect:u1e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ym(e){return e.split("-")[1]}var d1e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function f1e(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:qm(t*i)/i||0,y:qm(n*i)/i||0}}function lO(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,p=e.isFixed,m=a.x,y=m===void 0?0:m,b=a.y,w=b===void 0?0:b,E=typeof d=="function"?d({x:y,y:w}):{x:y,y:w};y=E.x,w=E.y;var _=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),T=Qo,L=Zo,O=window;if(u){var D=d2(n),I="clientHeight",N="clientWidth";if(D===hs(n)&&(D=lf(n),ic(D).position!=="static"&&s==="absolute"&&(I="scrollHeight",N="scrollWidth")),D=D,i===Zo||(i===Qo||i===cs)&&o===Ly){L=us;var V=p&&D===O&&O.visualViewport?O.visualViewport.height:D[I];w-=V-r.height,w*=l?1:-1}if(i===Qo||(i===Zo||i===us)&&o===Ly){T=cs;var B=p&&D===O&&O.visualViewport?O.visualViewport.width:D[N];y-=B-r.width,y*=l?1:-1}}var K=Object.assign({position:s},u&&d1e),ne=d===!0?f1e({x:y,y:w}):{x:y,y:w};if(y=ne.x,w=ne.y,l){var z;return Object.assign({},K,(z={},z[L]=k?"0":"",z[T]=_?"0":"",z.transform=(O.devicePixelRatio||1)<=1?"translate("+y+"px, "+w+"px)":"translate3d("+y+"px, "+w+"px, 0)",z))}return Object.assign({},K,(t={},t[L]=k?w+"px":"",t[T]=_?y+"px":"",t.transform="",t))}function h1e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Zl(t.placement),variation:Ym(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,lO(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,lO(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const p1e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:h1e,data:{}};var Gb={passive:!0};function g1e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=hs(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,Gb)}),s&&l.addEventListener("resize",n.update,Gb),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,Gb)}),s&&l.removeEventListener("resize",n.update,Gb)}}const m1e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:g1e,data:{}};var v1e={left:"right",right:"left",bottom:"top",top:"bottom"};function eS(e){return e.replace(/left|right|bottom|top/g,function(t){return v1e[t]})}var y1e={start:"end",end:"start"};function uO(e){return e.replace(/start|end/g,function(t){return y1e[t]})}function D8(e){var t=hs(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function j8(e){return Km(lf(e)).left+D8(e).scrollLeft}function b1e(e,t){var n=hs(e),r=lf(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=fH();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+j8(e),y:l}}function x1e(e){var t,n=lf(e),r=D8(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=$h(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=$h(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+j8(e),l=-r.scrollTop;return ic(i||n).direction==="rtl"&&(s+=$h(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function N8(e){var t=ic(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function vH(e){return["html","body","#document"].indexOf(nu(e))>=0?e.ownerDocument.body:is(e)&&N8(e)?e:vH(Fw(e))}function W1(e,t){var n;t===void 0&&(t=[]);var r=vH(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=hs(r),a=i?[o].concat(o.visualViewport||[],N8(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(W1(Fw(a)))}function J_(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function S1e(e,t){var n=Km(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function cO(e,t,n){return t===cH?J_(b1e(e,n)):Kh(t)?S1e(t,n):J_(x1e(lf(e)))}function w1e(e){var t=W1(Fw(e)),n=["absolute","fixed"].indexOf(ic(e).position)>=0,r=n&&is(e)?d2(e):e;return Kh(r)?t.filter(function(i){return Kh(i)&&hH(i,r)&&nu(i)!=="body"}):[]}function C1e(e,t,n,r){var i=t==="clippingParents"?w1e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var d=cO(e,u,r);return l.top=$h(d.top,l.top),l.right=f3(d.right,l.right),l.bottom=f3(d.bottom,l.bottom),l.left=$h(d.left,l.left),l},cO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function yH(e){var t=e.reference,n=e.element,r=e.placement,i=r?Zl(r):null,o=r?Ym(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Zo:l={x:a,y:t.y-n.height};break;case us:l={x:a,y:t.y+t.height};break;case cs:l={x:t.x+t.width,y:s};break;case Qo:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?I8(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case Gm:l[u]=l[u]-(t[d]/2-n[d]/2);break;case Ly:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function Ay(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?Wve:s,u=n.rootBoundary,d=u===void 0?cH:u,p=n.elementContext,m=p===void 0?Wv:p,y=n.altBoundary,b=y===void 0?!1:y,w=n.padding,E=w===void 0?0:w,_=gH(typeof E!="number"?E:mH(E,c2)),k=m===Wv?Vve:Wv,T=e.rects.popper,L=e.elements[b?k:m],O=C1e(Kh(L)?L:L.contextElement||lf(e.elements.popper),l,d,a),D=Km(e.elements.reference),I=yH({reference:D,element:T,strategy:"absolute",placement:i}),N=J_(Object.assign({},T,I)),V=m===Wv?N:D,B={top:O.top-V.top+_.top,bottom:V.bottom-O.bottom+_.bottom,left:O.left-V.left+_.left,right:V.right-O.right+_.right},K=e.modifiersData.offset;if(m===Wv&&K){var ne=K[i];Object.keys(B).forEach(function(z){var $=[cs,us].indexOf(z)>=0?1:-1,H=[Zo,us].indexOf(z)>=0?"y":"x";B[z]+=ne[H]*$})}return B}function _1e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?dH:l,d=Ym(r),p=d?s?aO:aO.filter(function(b){return Ym(b)===d}):c2,m=p.filter(function(b){return u.indexOf(b)>=0});m.length===0&&(m=p);var y=m.reduce(function(b,w){return b[w]=Ay(e,{placement:w,boundary:i,rootBoundary:o,padding:a})[Zl(w)],b},{});return Object.keys(y).sort(function(b,w){return y[b]-y[w]})}function k1e(e){if(Zl(e)===A8)return[];var t=eS(e);return[uO(e),t,uO(t)]}function E1e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,d=n.boundary,p=n.rootBoundary,m=n.altBoundary,y=n.flipVariations,b=y===void 0?!0:y,w=n.allowedAutoPlacements,E=t.options.placement,_=Zl(E),k=_===E,T=l||(k||!b?[eS(E)]:k1e(E)),L=[E].concat(T).reduce(function(xe,Ae){return xe.concat(Zl(Ae)===A8?_1e(t,{placement:Ae,boundary:d,rootBoundary:p,padding:u,flipVariations:b,allowedAutoPlacements:w}):Ae)},[]),O=t.rects.reference,D=t.rects.popper,I=new Map,N=!0,V=L[0],B=0;B=0,H=$?"width":"height",Y=Ay(t,{placement:K,boundary:d,rootBoundary:p,altBoundary:m,padding:u}),Q=$?z?cs:Qo:z?us:Zo;O[H]>D[H]&&(Q=eS(Q));var q=eS(Q),X=[];if(o&&X.push(Y[ne]<=0),s&&X.push(Y[Q]<=0,Y[q]<=0),X.every(function(xe){return xe})){V=K,N=!1;break}I.set(K,X)}if(N)for(var ee=b?3:1,fe=function(Ae){var Se=L.find(function(Qe){var Ye=I.get(Qe);if(Ye)return Ye.slice(0,Ae).every(function(nt){return nt})});if(Se)return V=Se,"break"},Ee=ee;Ee>0;Ee--){var we=fe(Ee);if(we==="break")break}t.placement!==V&&(t.modifiersData[r]._skip=!0,t.placement=V,t.reset=!0)}}const P1e={name:"flip",enabled:!0,phase:"main",fn:E1e,requiresIfExists:["offset"],data:{_skip:!1}};function dO(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function fO(e){return[Zo,cs,us,Qo].some(function(t){return e[t]>=0})}function T1e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Ay(t,{elementContext:"reference"}),s=Ay(t,{altBoundary:!0}),l=dO(a,r),u=dO(s,i,o),d=fO(l),p=fO(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}const M1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:T1e};function L1e(e,t,n){var r=Zl(e),i=[Qo,Zo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Qo,cs].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function A1e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=dH.reduce(function(d,p){return d[p]=L1e(p,t.rects,o),d},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const O1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:A1e};function R1e(e){var t=e.state,n=e.name;t.modifiersData[n]=yH({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const I1e={name:"popperOffsets",enabled:!0,phase:"read",fn:R1e,data:{}};function D1e(e){return e==="x"?"y":"x"}function j1e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,p=n.padding,m=n.tether,y=m===void 0?!0:m,b=n.tetherOffset,w=b===void 0?0:b,E=Ay(t,{boundary:l,rootBoundary:u,padding:p,altBoundary:d}),_=Zl(t.placement),k=Ym(t.placement),T=!k,L=I8(_),O=D1e(L),D=t.modifiersData.popperOffsets,I=t.rects.reference,N=t.rects.popper,V=typeof w=="function"?w(Object.assign({},t.rects,{placement:t.placement})):w,B=typeof V=="number"?{mainAxis:V,altAxis:V}:Object.assign({mainAxis:0,altAxis:0},V),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,ne={x:0,y:0};if(D){if(o){var z,$=L==="y"?Zo:Qo,H=L==="y"?us:cs,Y=L==="y"?"height":"width",Q=D[L],q=Q+E[$],X=Q-E[H],ee=y?-N[Y]/2:0,fe=k===Gm?I[Y]:N[Y],Ee=k===Gm?-N[Y]:-I[Y],we=t.elements.arrow,xe=y&&we?R8(we):{width:0,height:0},Ae=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:pH(),Se=Ae[$],Qe=Ae[H],Ye=H1(0,I[Y],xe[Y]),nt=T?I[Y]/2-ee-Ye-Se-B.mainAxis:fe-Ye-Se-B.mainAxis,vt=T?-I[Y]/2+ee+Ye+Qe+B.mainAxis:Ee+Ye+Qe+B.mainAxis,Ce=t.elements.arrow&&d2(t.elements.arrow),et=Ce?L==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,yt=(z=K==null?void 0:K[L])!=null?z:0,ze=Q+nt-yt-et,at=Q+vt-yt,jt=H1(y?f3(q,ze):q,Q,y?$h(X,at):X);D[L]=jt,ne[L]=jt-Q}if(s){var gt,Jt=L==="x"?Zo:Qo,on=L==="x"?us:cs,se=D[O],Ie=O==="y"?"height":"width",Ne=se+E[Jt],Ue=se-E[on],be=[Zo,Qo].indexOf(_)!==-1,je=(gt=K==null?void 0:K[O])!=null?gt:0,bt=be?Ne:se-I[Ie]-N[Ie]-je+B.altAxis,Dt=be?se+I[Ie]+N[Ie]-je-B.altAxis:Ue,Me=y&&be?a1e(bt,se,Dt):H1(y?bt:Ne,se,y?Dt:Ue);D[O]=Me,ne[O]=Me-se}t.modifiersData[r]=ne}}const N1e={name:"preventOverflow",enabled:!0,phase:"main",fn:j1e,requiresIfExists:["offset"]};function $1e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function F1e(e){return e===hs(e)||!is(e)?D8(e):$1e(e)}function B1e(e){var t=e.getBoundingClientRect(),n=qm(t.width)/e.offsetWidth||1,r=qm(t.height)/e.offsetHeight||1;return n!==1||r!==1}function z1e(e,t,n){n===void 0&&(n=!1);var r=is(t),i=is(t)&&B1e(t),o=lf(t),a=Km(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((nu(t)!=="body"||N8(o))&&(s=F1e(t)),is(t)?(l=Km(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=j8(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function H1e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function W1e(e){var t=H1e(e);return e1e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function V1e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function U1e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var hO={placement:"bottom",modifiers:[],strategy:"absolute"};function pO(){for(var e=arguments.length,t=new Array(e),n=0;n{}),T=S.useCallback(()=>{var B;!t||!b.current||!w.current||((B=k.current)==null||B.call(k),E.current=K1e(b.current,w.current,{placement:_,modifiers:[Fve,jve,Dve,{...Ive,enabled:!!m},{name:"eventListeners",...Rve(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!p,options:{boundary:d}},...n??[]],strategy:i}),E.current.forceUpdate(),k.current=E.current.destroy)},[_,t,n,m,a,o,s,l,u,p,d,i]);S.useEffect(()=>()=>{var B;!b.current&&!w.current&&((B=E.current)==null||B.destroy(),E.current=null)},[]);const L=S.useCallback(B=>{b.current=B,T()},[T]),O=S.useCallback((B={},K=null)=>({...B,ref:Rn(L,K)}),[L]),D=S.useCallback(B=>{w.current=B,T()},[T]),I=S.useCallback((B={},K=null)=>({...B,ref:Rn(D,K),style:{...B.style,position:i,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[i,D,m]),N=S.useCallback((B={},K=null)=>{const{size:ne,shadowColor:z,bg:$,style:H,...Y}=B;return{...Y,ref:K,"data-popper-arrow":"",style:Y1e(B)}},[]),V=S.useCallback((B={},K=null)=>({...B,ref:K,"data-popper-arrow-inner":""}),[]);return{update(){var B;(B=E.current)==null||B.update()},forceUpdate(){var B;(B=E.current)==null||B.forceUpdate()},transformOrigin:ii.transformOrigin.varRef,referenceRef:L,popperRef:D,getPopperProps:I,getArrowProps:N,getArrowInnerProps:V,getReferenceProps:O}}function Y1e(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function F8(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=Qr(n),a=Qr(t),[s,l]=S.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,d=r!==void 0,p=S.useId(),m=i??`disclosure-${p}`,y=S.useCallback(()=>{d||l(!1),a==null||a()},[d,a]),b=S.useCallback(()=>{d||l(!0),o==null||o()},[d,o]),w=S.useCallback(()=>{u?y():b()},[u,b,y]);function E(k={}){return{...k,"aria-expanded":u,"aria-controls":m,onClick(T){var L;(L=k.onClick)==null||L.call(k,T),w()}}}function _(k={}){return{...k,hidden:!u,id:m}}return{isOpen:u,onOpen:b,onClose:y,onToggle:w,isControlled:d,getButtonProps:E,getDisclosureProps:_}}function X1e(e){const{ref:t,handler:n,enabled:r=!0}=e,i=Qr(n),a=S.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;S.useEffect(()=>{if(!r)return;const s=p=>{mC(p,t)&&(a.isPointerDown=!0)},l=p=>{if(a.ignoreEmulatedMouseEvents){a.ignoreEmulatedMouseEvents=!1;return}a.isPointerDown&&n&&mC(p,t)&&(a.isPointerDown=!1,i(p))},u=p=>{a.ignoreEmulatedMouseEvents=!0,n&&a.isPointerDown&&mC(p,t)&&(a.isPointerDown=!1,i(p))},d=bH(t.current);return d.addEventListener("mousedown",s,!0),d.addEventListener("mouseup",l,!0),d.addEventListener("touchstart",s,!0),d.addEventListener("touchend",u,!0),()=>{d.removeEventListener("mousedown",s,!0),d.removeEventListener("mouseup",l,!0),d.removeEventListener("touchstart",s,!0),d.removeEventListener("touchend",u,!0)}},[n,t,i,a,r])}function mC(e,t){var n;const r=e.target;return e.button>0||r&&!bH(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function bH(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function xH(e){const{isOpen:t,ref:n}=e,[r,i]=S.useState(t),[o,a]=S.useState(!1);return S.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),Dh(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=nve(n.current),d=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(d)}}}function B8(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var[Z1e,Q1e,J1e,eye]=l8(),[tye,f2]=Pn({strict:!1,name:"MenuContext"});function nye(e,...t){const n=S.useId(),r=e||n;return S.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}function SH(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function gO(e){return SH(e).activeElement===e}function rye(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:i,autoSelect:o=!0,isLazy:a,isOpen:s,defaultIsOpen:l,onClose:u,onOpen:d,placement:p="bottom-start",lazyBehavior:m="unmount",direction:y,computePositionOnMount:b=!1,...w}=e,E=S.useRef(null),_=S.useRef(null),k=J1e(),T=S.useCallback(()=>{requestAnimationFrame(()=>{var we;(we=E.current)==null||we.focus({preventScroll:!1})})},[]),L=S.useCallback(()=>{const we=setTimeout(()=>{var xe;if(i)(xe=i.current)==null||xe.focus();else{const Ae=k.firstEnabled();Ae&&z(Ae.index)}});q.current.add(we)},[k,i]),O=S.useCallback(()=>{const we=setTimeout(()=>{const xe=k.lastEnabled();xe&&z(xe.index)});q.current.add(we)},[k]),D=S.useCallback(()=>{d==null||d(),o?L():T()},[o,L,T,d]),{isOpen:I,onOpen:N,onClose:V,onToggle:B}=F8({isOpen:s,defaultIsOpen:l,onClose:u,onOpen:D});X1e({enabled:I&&r,ref:E,handler:we=>{var xe;(xe=_.current)!=null&&xe.contains(we.target)||V()}});const K=$8({...w,enabled:I||b,placement:p,direction:y}),[ne,z]=S.useState(-1);rc(()=>{I||z(-1)},[I]),uH(E,{focusRef:_,visible:I,shouldFocus:!0});const $=xH({isOpen:I,ref:E}),[H,Y]=nye(t,"menu-button","menu-list"),Q=S.useCallback(()=>{N(),T()},[N,T]),q=S.useRef(new Set([]));cye(()=>{q.current.forEach(we=>clearTimeout(we)),q.current.clear()});const X=S.useCallback(()=>{N(),L()},[L,N]),ee=S.useCallback(()=>{N(),O()},[N,O]),fe=S.useCallback(()=>{var we,xe;const Ae=SH(E.current),Se=(we=E.current)==null?void 0:we.contains(Ae.activeElement);if(!(I&&!Se))return;const Ye=(xe=k.item(ne))==null?void 0:xe.node;Ye==null||Ye.focus()},[I,ne,k]),Ee=S.useRef(null);return{openAndFocusMenu:Q,openAndFocusFirstItem:X,openAndFocusLastItem:ee,onTransitionEnd:fe,unstable__animationState:$,descendants:k,popper:K,buttonId:H,menuId:Y,forceUpdate:K.forceUpdate,orientation:"vertical",isOpen:I,onToggle:B,onOpen:N,onClose:V,menuRef:E,buttonRef:_,focusedIndex:ne,closeOnSelect:n,closeOnBlur:r,autoSelect:o,setFocusedIndex:z,isLazy:a,lazyBehavior:m,initialFocusRef:i,rafId:Ee}}function iye(e={},t=null){const n=f2(),{onToggle:r,popper:i,openAndFocusFirstItem:o,openAndFocusLastItem:a}=n,s=S.useCallback(l=>{const u=l.key,p={Enter:o,ArrowDown:o,ArrowUp:a}[u];p&&(l.preventDefault(),l.stopPropagation(),p(l))},[o,a]);return{...e,ref:Rn(n.buttonRef,t,i.referenceRef),id:n.buttonId,"data-active":Bt(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:ht(e.onClick,r),onKeyDown:ht(e.onKeyDown,s)}}function ek(e){var t;return lye(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function oye(e={},t=null){const n=f2();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");const{focusedIndex:r,setFocusedIndex:i,menuRef:o,isOpen:a,onClose:s,menuId:l,isLazy:u,lazyBehavior:d,unstable__animationState:p}=n,m=Q1e(),y=Cve({preventDefault:_=>_.key!==" "&&ek(_.target)}),b=S.useCallback(_=>{const k=_.key,L={Tab:D=>D.preventDefault(),Escape:s,ArrowDown:()=>{const D=m.nextEnabled(r);D&&i(D.index)},ArrowUp:()=>{const D=m.prevEnabled(r);D&&i(D.index)}}[k];if(L){_.preventDefault(),L(_);return}const O=y(D=>{const I=_ve(m.values(),D,N=>{var V,B;return(B=(V=N==null?void 0:N.node)==null?void 0:V.textContent)!=null?B:""},m.item(r));if(I){const N=m.indexOf(I.node);i(N)}});ek(_.target)&&O(_)},[m,r,y,s,i]),w=S.useRef(!1);a&&(w.current=!0);const E=B8({wasSelected:w.current,enabled:u,mode:d,isSelected:p.present});return{...e,ref:Rn(o,t),children:E?e.children:null,tabIndex:-1,role:"menu",id:l,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:ht(e.onKeyDown,b)}}function aye(e={}){const{popper:t,isOpen:n}=f2();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function sye(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onClick:o,onFocus:a,isDisabled:s,isFocusable:l,closeOnSelect:u,type:d,...p}=e,m=f2(),{setFocusedIndex:y,focusedIndex:b,closeOnSelect:w,onClose:E,menuRef:_,isOpen:k,menuId:T,rafId:L}=m,O=S.useRef(null),D=`${T}-menuitem-${S.useId()}`,{index:I,register:N}=eye({disabled:s&&!l}),V=S.useCallback(Q=>{n==null||n(Q),!s&&y(I)},[y,I,s,n]),B=S.useCallback(Q=>{r==null||r(Q),O.current&&!gO(O.current)&&V(Q)},[V,r]),K=S.useCallback(Q=>{i==null||i(Q),!s&&y(-1)},[y,s,i]),ne=S.useCallback(Q=>{o==null||o(Q),ek(Q.currentTarget)&&(u??w)&&E()},[E,o,w,u]),z=S.useCallback(Q=>{a==null||a(Q),y(I)},[y,a,I]),$=I===b,H=s&&!l;rc(()=>{k&&($&&!H&&O.current?(L.current&&cancelAnimationFrame(L.current),L.current=requestAnimationFrame(()=>{var Q;(Q=O.current)==null||Q.focus(),L.current=null})):_.current&&!gO(_.current)&&_.current.focus())},[$,H,_,k]);const Y=lH({onClick:ne,onFocus:z,onMouseEnter:V,onMouseMove:B,onMouseLeave:K,ref:Rn(N,O,t),isDisabled:s,isFocusable:l});return{...p,...Y,type:d??Y.type,id:D,role:"menuitem",tabIndex:$?0:-1}}function lye(e){var t;if(!uye(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function uye(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function cye(e,t=[]){return S.useEffect(()=>()=>e(),t)}var[dye,Bw]=Pn({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),wH=e=>{const{children:t}=e,n=Yi("Menu",e),r=fr(e),{direction:i}=Qy(),{descendants:o,...a}=rye({...r,direction:i}),s=S.useMemo(()=>a,[a]),{isOpen:l,onClose:u,forceUpdate:d}=s;return g.jsx(Z1e,{value:o,children:g.jsx(tye,{value:s,children:g.jsx(dye,{value:n,children:ts(t,{isOpen:l,onClose:u,forceUpdate:d})})})})};wH.displayName="Menu";var CH=Xe((e,t)=>{const n=Bw();return g.jsx($e.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});CH.displayName="MenuCommand";var fye=Xe((e,t)=>{const{type:n,...r}=e,i=Bw(),o=r.as||n?n??void 0:"button",a=S.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...i.item}),[i.item]);return g.jsx($e.button,{ref:t,type:o,...r,__css:a})}),_H=e=>{const{className:t,children:n,...r}=e,i=S.Children.only(n),o=S.isValidElement(i)?S.cloneElement(i,{focusable:"false","aria-hidden":!0,className:xt("chakra-menu__icon",i.props.className)}):null,a=xt("chakra-menu__icon-wrapper",t);return g.jsx($e.span,{className:a,...r,__css:{flexShrink:0},children:o})};_H.displayName="MenuIcon";var kH=Xe((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:i,commandSpacing:o="0.75rem",children:a,...s}=e,l=sye(s,t),d=n||i?g.jsx("span",{style:{pointerEvents:"none",flex:1},children:a}):a;return g.jsxs(fye,{...l,className:xt("chakra-menu__menuitem",l.className),children:[n&&g.jsx(_H,{fontSize:"0.8em",marginEnd:r,children:n}),d,i&&g.jsx(CH,{marginStart:o,children:i})]})});kH.displayName="MenuItem";var hye={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},pye=$e(su.div),EH=Xe(function(t,n){var r,i;const{rootProps:o,motionProps:a,...s}=t,{isOpen:l,onTransitionEnd:u,unstable__animationState:d}=f2(),p=oye(s,n),m=aye(o),y=Bw();return g.jsx($e.div,{...m,__css:{zIndex:(i=t.zIndex)!=null?i:(r=y.list)==null?void 0:r.zIndex},children:g.jsx(pye,{variants:hye,initial:!1,animate:l?"enter":"exit",__css:{outline:0,...y.list},...a,className:xt("chakra-menu__menu-list",p.className),...p,onUpdate:u,onAnimationComplete:ww(d.onComplete,p.onAnimationComplete)})})});EH.displayName="MenuList";var gye=Xe((e,t)=>{const n=Bw();return g.jsx($e.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),PH=Xe((e,t)=>{const{children:n,as:r,...i}=e,o=iye(i,t),a=r||gye;return g.jsx(a,{...o,className:xt("chakra-menu__menu-button",e.className),children:g.jsx($e.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});PH.displayName="MenuButton";var mye={slideInBottom:{...H_,custom:{offsetY:16,reverse:!0}},slideInRight:{...H_,custom:{offsetX:16,reverse:!0}},scale:{...sz,custom:{initialScale:.95,reverse:!0}},none:{}},vye=$e(su.section),yye=e=>mye[e||"none"],TH=S.forwardRef((e,t)=>{const{preset:n,motionProps:r=yye(n),...i}=e;return g.jsx(vye,{ref:t,...r,...i})});TH.displayName="ModalTransition";var bye=Object.defineProperty,xye=(e,t,n)=>t in e?bye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sye=(e,t,n)=>(xye(e,typeof t!="symbol"?t+"":t,n),n),wye=class{constructor(){Sye(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},tk=new wye;function MH(e,t){const[n,r]=S.useState(0);return S.useEffect(()=>{const i=e.current;if(i){if(t){const o=tk.add(i);r(o)}return()=>{tk.remove(i),r(0)}}},[t,e]),n}var Cye=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wg=new WeakMap,qb=new WeakMap,Kb={},vC=0,LH=function(e){return e&&(e.host||LH(e.parentNode))},_ye=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=LH(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},kye=function(e,t,n,r){var i=_ye(t,Array.isArray(e)?e:[e]);Kb[n]||(Kb[n]=new WeakMap);var o=Kb[n],a=[],s=new Set,l=new Set(i),u=function(p){!p||s.has(p)||(s.add(p),u(p.parentNode))};i.forEach(u);var d=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(m){if(s.has(m))d(m);else{var y=m.getAttribute(r),b=y!==null&&y!=="false",w=(wg.get(m)||0)+1,E=(o.get(m)||0)+1;wg.set(m,w),o.set(m,E),a.push(m),w===1&&b&&qb.set(m,!0),E===1&&m.setAttribute(n,"true"),b||m.setAttribute(r,"true")}})};return d(t),s.clear(),vC++,function(){a.forEach(function(p){var m=wg.get(p)-1,y=o.get(p)-1;wg.set(p,m),o.set(p,y),m||(qb.has(p)||p.removeAttribute(r),qb.delete(p)),y||p.removeAttribute(n)}),vC--,vC||(wg=new WeakMap,wg=new WeakMap,qb=new WeakMap,Kb={})}},AH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||Cye(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),kye(r,i,n,"aria-hidden")):function(){return null}};function Eye(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=S.useRef(null),d=S.useRef(null),[p,m,y]=Tye(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Pye(u,t&&a),MH(u,t);const b=S.useRef(null),w=S.useCallback(N=>{b.current=N.target},[]),E=S.useCallback(N=>{N.key==="Escape"&&(N.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[_,k]=S.useState(!1),[T,L]=S.useState(!1),O=S.useCallback((N={},V=null)=>({role:"dialog",...N,ref:Rn(V,u),id:p,tabIndex:-1,"aria-modal":!0,"aria-labelledby":_?m:void 0,"aria-describedby":T?y:void 0,onClick:ht(N.onClick,B=>B.stopPropagation())}),[y,T,p,m,_]),D=S.useCallback(N=>{N.stopPropagation(),b.current===N.target&&tk.isTopModal(u.current)&&(i&&(n==null||n()),s==null||s())},[n,i,s]),I=S.useCallback((N={},V=null)=>({...N,ref:Rn(V,d),onClick:ht(N.onClick,D),onKeyDown:ht(N.onKeyDown,E),onMouseDown:ht(N.onMouseDown,w)}),[E,w,D]);return{isOpen:t,onClose:n,headerId:m,bodyId:y,setBodyMounted:L,setHeaderMounted:k,dialogRef:u,overlayRef:d,getDialogProps:O,getDialogContainerProps:I}}function Pye(e,t){const n=e.current;S.useEffect(()=>{if(!(!e.current||!t))return AH(e.current)},[t,e,n])}function Tye(e,...t){const n=S.useId(),r=e||n;return S.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[Mye,p0]=Pn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Lye,Yh]=Pn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Yd=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:i,trapFocus:o,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:d,preserveScrollBarGap:p,motionPreset:m,lockFocusAcrossFrames:y,onCloseComplete:b}=t,w=Yi("Modal",t),_={...Eye(t),autoFocus:i,trapFocus:o,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:d,preserveScrollBarGap:p,motionPreset:m,lockFocusAcrossFrames:y};return g.jsx(Lye,{value:_,children:g.jsx(Mye,{value:w,children:g.jsx(rp,{onExitComplete:b,children:_.isOpen&&g.jsx(u0,{...n,children:r})})})})};Yd.displayName="Modal";var tS="right-scroll-bar-position",nS="width-before-scroll-bar",Aye="with-scroll-bars-hidden",Oye="--removed-body-scroll-bar-size",OH=Sz(),yC=function(){},zw=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:yC,onWheelCapture:yC,onTouchMoveCapture:yC}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,m=e.sideCar,y=e.noIsolation,b=e.inert,w=e.allowPinchZoom,E=e.as,_=E===void 0?"div":E,k=XB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),T=m,L=yz([n,t]),O=Nl(Nl({},k),i);return S.createElement(S.Fragment,null,d&&S.createElement(T,{sideCar:OH,removeScrollBar:u,shards:p,noIsolation:y,inert:b,setCallbacks:o,allowPinchZoom:!!w,lockRef:n}),a?S.cloneElement(S.Children.only(s),Nl(Nl({},O),{ref:L})):S.createElement(_,Nl({},O,{className:l,ref:L}),s))});zw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zw.classNames={fullWidth:nS,zeroRight:tS};var mO,Rye=function(){if(mO)return mO;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Iye(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Rye();return t&&e.setAttribute("nonce",t),e}function Dye(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jye(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Nye=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Iye())&&(Dye(t,n),jye(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$ye=function(){var e=Nye();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},RH=function(){var e=$ye(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Fye={left:0,top:0,right:0,gap:0},bC=function(e){return parseInt(e||"",10)||0},Bye=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[bC(n),bC(r),bC(i)]},zye=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Fye;var t=Bye(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Hye=RH(),Wye=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` - .`.concat(Aye,` { + `),()=>{document.head.removeChild(u)}},[t]),S.createElement(age,{isPresent:t,childRef:r,sizeRef:i},S.cloneElement(e,{ref:r}))}const uC=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=D9(lge),l=S.useId(),u=S.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:d=>{s.set(d,!0);for(const p of s.values())if(!p)return;r&&r()},register:d=>(s.set(d,!1),()=>s.delete(d))}),o?void 0:[n]);return S.useMemo(()=>{s.forEach((d,p)=>s.set(p,!1))},[n]),S.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=S.createElement(sge,{isPresent:n},e)),S.createElement(r2.Provider,{value:u},e)};function lge(){return new Map}function uge(e){return S.useEffect(()=>()=>e(),[])}const jg=e=>e.key||"";function cge(e,t){e.forEach(n=>{const r=jg(n);t.set(r,n)})}function dge(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const rp=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait");let[s]=oge();const l=S.useContext(j9).forceRender;l&&(s=l);const u=XB(),d=dge(e);let p=d;const m=new Set,y=S.useRef(p),b=S.useRef(new Map).current,w=S.useRef(!0);if(XS(()=>{w.current=!1,cge(d,b),y.current=p}),uge(()=>{w.current=!0,b.clear(),m.clear()}),w.current)return S.createElement(S.Fragment,null,p.map(T=>S.createElement(uC,{key:jg(T),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},T)));p=[...p];const E=y.current.map(jg),_=d.map(jg),k=E.length;for(let T=0;T{if(_.indexOf(T)!==-1)return;const L=b.get(T);if(!L)return;const O=E.indexOf(T),D=()=>{b.delete(T),m.delete(T);const I=y.current.findIndex(N=>N.key===T);if(y.current.splice(I,1),!m.size){if(y.current=d,u.current===!1)return;s(),r&&r()}};p.splice(O,0,S.createElement(uC,{key:jg(L),isPresent:!1,onExitComplete:D,custom:t,presenceAffectsLayout:o,mode:a},L))}),p=p.map(T=>{const L=T.key;return m.has(L)?T:S.createElement(uC,{key:jg(T),isPresent:!0,presenceAffectsLayout:o,mode:a},T)}),S.createElement(S.Fragment,null,m.size?p:p.map(T=>S.cloneElement(T)))};var Nl=function(){return Nl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function B_(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},QB=S.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=fge,toastSpacing:d="0.5rem"}=e,[p,m]=S.useState(s),y=ipe();rc(()=>{y||r==null||r()},[y]),rc(()=>{m(s)},[s]);const b=()=>m(null),w=()=>m(s),E=()=>{y&&i()};S.useEffect(()=>{y&&o&&i()},[y,o,i]),Qce(E,p);const _=S.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:d,...l}),[l,d]),k=S.useMemo(()=>Xce(a),[a]);return g.jsx(su.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:w,custom:{position:a},style:k,children:g.jsx(Ne.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:_,children:ts(n,{id:t,onClose:E})})})});QB.displayName="ToastComponent";function hge(e,t){var n;const r=e??"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=o==null?void 0:o[t])!=null?n:r}var jA={path:g.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[g.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),g.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),g.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},ja=Ze((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,d=xt("chakra-icon",s),p=au("Icon",e),m={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l,...p},y={ref:t,focusable:o,className:d,__css:m},b=r??jA.viewBox;if(n&&typeof n!="string")return g.jsx(Ne.svg,{as:n,...y,...u});const w=a??jA.path;return g.jsx(Ne.svg,{verticalAlign:"middle",viewBox:b,...y,...u,children:w})});ja.displayName="Icon";function fc(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=S.Children.toArray(e.path),a=Ze((s,l)=>g.jsx(ja,{ref:l,viewBox:t,...i,...s,children:o.length?o:g.jsx("path",{fill:"currentColor",d:n})}));return a.displayName=r,a}function pge(e){return g.jsx(ja,{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function gge(e){return g.jsx(ja,{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function NA(e){return g.jsx(ja,{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var mge=nf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),h0=Ze((e,t)=>{const n=au("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=fr(e),u=xt("chakra-spinner",s),d={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${mge} ${o} linear infinite`,...n};return g.jsx(Ne.div,{ref:t,__css:d,className:u,...l,children:r&&g.jsx(Ne.span,{srOnly:!0,children:r})})});h0.displayName="Spinner";var[vge,yge]=Pn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[bge,a8]=Pn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),JB={info:{icon:gge,colorScheme:"blue"},warning:{icon:NA,colorScheme:"orange"},success:{icon:pge,colorScheme:"green"},error:{icon:NA,colorScheme:"red"},loading:{icon:h0,colorScheme:"blue"}};function xge(e){return JB[e].colorScheme}function Sge(e){return JB[e].icon}var ez=Ze(function(t,n){const i={display:"inline",...a8().description};return g.jsx(Ne.div,{ref:n,...t,className:xt("chakra-alert__desc",t.className),__css:i})});ez.displayName="AlertDescription";function tz(e){const{status:t}=yge(),n=Sge(t),r=a8(),i=t==="loading"?r.spinner:r.icon;return g.jsx(Ne.span,{display:"inherit",...e,className:xt("chakra-alert__icon",e.className),__css:i,children:e.children||g.jsx(n,{h:"100%",w:"100%"})})}tz.displayName="AlertIcon";var nz=Ze(function(t,n){const r=a8();return g.jsx(Ne.div,{ref:n,...t,className:xt("chakra-alert__title",t.className),__css:r.title})});nz.displayName="AlertTitle";var rz=Ze(function(t,n){var r;const{status:i="info",addRole:o=!0,...a}=fr(t),s=(r=t.colorScheme)!=null?r:xge(i),l=Yi("Alert",{...t,colorScheme:s}),u={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return g.jsx(vge,{value:{status:i},children:g.jsx(bge,{value:l,children:g.jsx(Ne.div,{role:o?"alert":void 0,ref:n,...a,className:xt("chakra-alert",t.className),__css:u})})})});rz.displayName="Alert";function wge(e){return g.jsx(ja,{focusable:"false","aria-hidden":!0,...e,children:g.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var s8=Ze(function(t,n){const r=au("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=fr(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return g.jsx(Ne.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s,children:i||g.jsx(wge,{width:"1em",height:"1em"})})});s8.displayName="CloseButton";var Cge={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},$l=_ge(Cge);function _ge(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=kge(i,o),{position:s,id:l}=a;return r(u=>{var d,p;const y=s.includes("top")?[a,...(d=u[s])!=null?d:[]]:[...(p=u[s])!=null?p:[],a];return{...u,[s]:y}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=AL(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:iz(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(d=>({...d,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=DF(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(AL($l.getState(),i).position)}}var $A=0;function kge(e,t={}){var n,r;$A+=1;const i=(n=t.id)!=null?n:$A,o=(r=t.position)!=null?r:"bottom";return{id:i,message:e,position:o,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>$l.removeToast(String(i),o),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var Ege=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return g.jsxs(rz,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",children:[g.jsx(tz,{children:l}),g.jsxs(Ne.div,{flex:"1",maxWidth:"100%",children:[i&&g.jsx(nz,{id:u==null?void 0:u.title,children:i}),s&&g.jsx(ez,{id:u==null?void 0:u.description,display:"block",children:s})]}),o&&g.jsx(s8,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1})]})};function iz(e={}){const{render:t,toastComponent:n=Ege}=e;return i=>typeof t=="function"?t({...i,...e}):g.jsx(n,{...i,...e})}function Pge(e,t){const n=i=>{var o;return{...t,...i,position:hge((o=i==null?void 0:i.position)!=null?o:t==null?void 0:t.position,e)}},r=i=>{const o=n(i),a=iz(o);return $l.notify(a,o)};return r.update=(i,o)=>{$l.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...ts(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...ts(o.error,s)}))},r.closeAll=$l.closeAll,r.close=$l.close,r.isActive=$l.isActive,r}var[Tge,Mge]=Pn({name:"ToastOptionsContext",strict:!1}),Lge=e=>{const t=S.useSyncExternalStore($l.subscribe,$l.getState,$l.getState),{motionVariants:n,component:r=QB,portalProps:i}=e,a=Object.keys(t).map(s=>{const l=t[s];return g.jsx("ul",{role:"region","aria-live":"polite",id:`chakra-toast-manager-${s}`,style:Zce(s),children:g.jsx(rp,{initial:!1,children:l.map(u=>g.jsx(r,{motionVariants:n,...u},u.id))})},s)});return g.jsx(u0,{...i,children:a})};function s2(e){const{theme:t}=nF(),n=Mge();return S.useMemo(()=>Pge(t.direction,{...n,...e}),[e,t.direction,n])}var Age=e=>function({children:n,theme:r=e,toastOptions:i,...o}){return g.jsxs(Kce,{theme:r,...o,children:[g.jsx(Tge,{value:i==null?void 0:i.defaultOptions,children:n}),g.jsx(Lge,{...i})]})},Oge=Age(uce),Rge=Object.defineProperty,Ige=(e,t,n)=>t in e?Rge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nr=(e,t,n)=>(Ige(e,typeof t!="symbol"?t+"":t,n),n);function FA(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var Dge=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function BA(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function zA(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var z_=typeof window<"u"?S.useLayoutEffect:S.useEffect,a3=e=>e,jge=class{constructor(){Nr(this,"descendants",new Map),Nr(this,"register",e=>{if(e!=null)return Dge(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),Nr(this,"unregister",e=>{this.descendants.delete(e);const t=FA(Array.from(this.descendants.keys()));this.assignIndex(t)}),Nr(this,"destroy",()=>{this.descendants.clear()}),Nr(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),Nr(this,"count",()=>this.descendants.size),Nr(this,"enabledCount",()=>this.enabledValues().length),Nr(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),Nr(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),Nr(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),Nr(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),Nr(this,"first",()=>this.item(0)),Nr(this,"firstEnabled",()=>this.enabledItem(0)),Nr(this,"last",()=>this.item(this.descendants.size-1)),Nr(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),Nr(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),Nr(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),Nr(this,"next",(e,t=!0)=>{const n=BA(e,this.count(),t);return this.item(n)}),Nr(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=BA(r,this.enabledCount(),t);return this.enabledItem(i)}),Nr(this,"prev",(e,t=!0)=>{const n=zA(e,this.count()-1,t);return this.item(n)}),Nr(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=zA(r,this.enabledCount()-1,t);return this.enabledItem(i)}),Nr(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=FA(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function Nge(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Rn(...e){return t=>{e.forEach(n=>{Nge(n,t)})}}function $ge(...e){return S.useMemo(()=>Rn(...e),e)}function Fge(){const e=S.useRef(new jge);return z_(()=>()=>e.current.destroy()),e.current}var[Bge,oz]=Pn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function zge(e){const t=oz(),[n,r]=S.useState(-1),i=S.useRef(null);z_(()=>()=>{i.current&&t.unregister(i.current)},[]),z_(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=a3(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:Rn(o,i)}}function l8(){return[a3(Bge),()=>a3(oz()),()=>Fge(),i=>zge(i)]}var[Hge,jw]=Pn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[Wge,u8]=Pn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[Uge,hNe,Vge,Gge]=l8(),tm=Ze(function(t,n){const{getButtonProps:r}=u8(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...jw().button};return g.jsx(Ne.button,{...i,className:xt("chakra-accordion__button",t.className),__css:a})});tm.displayName="AccordionButton";function c8(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(m,y)=>m!==y}=e,o=Qr(r),a=Qr(i),[s,l]=S.useState(n),u=t!==void 0,d=u?t:s,p=Qr(m=>{const b=typeof m=="function"?m(d):m;a(d,b)&&(u||l(b),o(b))},[u,o,d,a]);return[d,p]}function qge(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;Xge(e),Zge(e);const s=Vge(),[l,u]=S.useState(-1);S.useEffect(()=>()=>{u(-1)},[]);const[d,p]=c8({value:r,defaultValue(){return i?n??[]:n??-1},onChange:t});return{index:d,setIndex:p,htmlProps:a,getAccordionItemProps:y=>{let b=!1;return y!==null&&(b=Array.isArray(d)?d.includes(y):d===y),{isOpen:b,onChange:E=>{if(y!==null)if(i&&Array.isArray(d)){const _=E?d.concat(y):d.filter(k=>k!==y);p(_)}else E?p(y):o&&p(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[Kge,d8]=Pn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function Yge(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=d8(),s=S.useRef(null),l=S.useId(),u=r??l,d=`accordion-button-${u}`,p=`accordion-panel-${u}`;Qge(e);const{register:m,index:y,descendants:b}=Gge({disabled:t&&!n}),{isOpen:w,onChange:E}=o(y===-1?null:y);Jge({isOpen:w,isDisabled:t});const _=()=>{E==null||E(!0)},k=()=>{E==null||E(!1)},T=S.useCallback(()=>{E==null||E(!w),a(y)},[y,a,w,E]),L=S.useCallback(N=>{const B={ArrowDown:()=>{const K=b.nextEnabled(y);K==null||K.node.focus()},ArrowUp:()=>{const K=b.prevEnabled(y);K==null||K.node.focus()},Home:()=>{const K=b.firstEnabled();K==null||K.node.focus()},End:()=>{const K=b.lastEnabled();K==null||K.node.focus()}}[N.key];B&&(N.preventDefault(),B(N))},[b,y]),O=S.useCallback(()=>{a(y)},[a,y]),D=S.useCallback(function(U={},B=null){return{...U,type:"button",ref:Rn(m,s,B),id:d,disabled:!!t,"aria-expanded":!!w,"aria-controls":p,onClick:ht(U.onClick,T),onFocus:ht(U.onFocus,O),onKeyDown:ht(U.onKeyDown,L)}},[d,t,w,T,O,L,p,m]),I=S.useCallback(function(U={},B=null){return{...U,ref:B,role:"region",id:p,"aria-labelledby":d,hidden:!w}},[d,w,p]);return{isOpen:w,isDisabled:t,isFocusable:n,onOpen:_,onClose:k,getButtonProps:D,getPanelProps:I,htmlProps:i}}function Xge(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;e2({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function Zge(e){e2({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function Qge(e){e2({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. + `})}function Jge(e){e2({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function nm(e){const{isOpen:t,isDisabled:n}=u8(),{reduceMotion:r}=d8(),i=xt("chakra-accordion__icon",e.className),o=jw(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return g.jsx(ja,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e,children:g.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}nm.displayName="AccordionIcon";var rm=Ze(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=Yge(t),l={...jw().container,overflowAnchor:"none"},u=S.useMemo(()=>a,[a]);return g.jsx(Wge,{value:u,children:g.jsx(Ne.div,{ref:n,...o,className:xt("chakra-accordion__item",i),__css:l,children:typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r})})});rm.displayName="AccordionItem";var im={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Ih={enter:{duration:.2,ease:im.easeOut},exit:{duration:.1,ease:im.easeIn}},Ku={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},eme=e=>e!=null&&parseInt(e.toString(),10)>0,HA={exit:{height:{duration:.2,ease:im.ease},opacity:{duration:.3,ease:im.ease}},enter:{height:{duration:.3,ease:im.ease},opacity:{duration:.4,ease:im.ease}}},tme={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:eme(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(o=n==null?void 0:n.exit)!=null?o:Ku.exit(HA.exit,i)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(o=n==null?void 0:n.enter)!=null?o:Ku.enter(HA.enter,i)}}},az=S.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:d,...p}=e,[m,y]=S.useState(!1);S.useEffect(()=>{const k=setTimeout(()=>{y(!0)});return()=>clearTimeout(k)},[]),e2({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,w={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:d==null?void 0:d.enter,exit:r?d==null?void 0:d.exit:{...d==null?void 0:d.exit,display:b?"block":"none"}}},E=r?n:!0,_=n||r?"enter":"exit";return g.jsx(rp,{initial:!1,custom:w,children:E&&g.jsx(su.div,{ref:t,...p,className:xt("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:w,variants:tme,initial:r?"exit":!1,animate:_,exit:"exit"})})});az.displayName="Collapse";var nme={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Ku.enter(Ih.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:Ku.exit(Ih.exit,n),transitionEnd:t==null?void 0:t.exit}}},sz={initial:"exit",animate:"enter",exit:"exit",variants:nme},rme=S.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,d=i||r?"enter":"exit",p=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return g.jsx(rp,{custom:m,children:p&&g.jsx(su.div,{ref:n,className:xt("chakra-fade",o),custom:m,...sz,animate:d,...u})})});rme.displayName="Fade";var ime={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(o=n==null?void 0:n.exit)!=null?o:Ku.exit(Ih.exit,i)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Ku.enter(Ih.enter,n),transitionEnd:e==null?void 0:e.enter}}},lz={initial:"exit",animate:"enter",exit:"exit",variants:ime},ome=S.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:d,...p}=t,m=r?i&&r:!0,y=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:d};return g.jsx(rp,{custom:b,children:m&&g.jsx(su.div,{ref:n,className:xt("chakra-offset-slide",s),...lz,animate:y,custom:b,...p})})});ome.displayName="ScaleFade";var ame={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,x:e,y:t,transition:(o=n==null?void 0:n.exit)!=null?o:Ku.exit(Ih.exit,i),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Ku.enter(Ih.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{var a;const s={x:t,y:e};return{opacity:0,transition:(a=n==null?void 0:n.exit)!=null?a:Ku.exit(Ih.exit,o),...i?{...s,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...s,...r==null?void 0:r.exit}}}}},H_={initial:"initial",animate:"enter",exit:"exit",variants:ame},sme=S.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:d,delay:p,...m}=t,y=r?i&&r:!0,b=i||r?"enter":"exit",w={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:d,delay:p};return g.jsx(rp,{custom:w,children:y&&g.jsx(su.div,{ref:n,className:xt("chakra-offset-slide",a),custom:w,...H_,animate:b,...m})})});sme.displayName="SlideFade";var om=Ze(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=d8(),{getPanelProps:s,isOpen:l}=u8(),u=s(o,n),d=xt("chakra-accordion__panel",r),p=jw();a||delete u.hidden;const m=g.jsx(Ne.div,{...u,__css:p.panel,className:d});return a?m:g.jsx(az,{in:l,...i,children:m})});om.displayName="AccordionPanel";var f8=Ze(function({children:t,reduceMotion:n,...r},i){const o=Yi("Accordion",r),a=fr(r),{htmlProps:s,descendants:l,...u}=qge(a),d=S.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return g.jsx(Uge,{value:l,children:g.jsx(Kge,{value:d,children:g.jsx(Hge,{value:o,children:g.jsx(Ne.div,{ref:i,...s,className:xt("chakra-accordion",r.className),__css:o.root,children:t})})})})});f8.displayName="Accordion";var W_=Ze(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return g.jsx("img",{width:r,height:i,ref:n,alt:o,...a})});W_.displayName="NativeImage";function lme(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,d]=S.useState("pending");S.useEffect(()=>{d(n?"loading":"pending")},[n]);const p=S.useRef(),m=S.useCallback(()=>{if(!n)return;y();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=w=>{y(),d("loaded"),i==null||i(w)},b.onerror=w=>{y(),d("failed"),o==null||o(w)},p.current=b},[n,a,r,s,i,o,t]),y=()=>{p.current&&(p.current.onload=null,p.current.onerror=null,p.current=null)};return Vl(()=>{if(!l)return u==="loading"&&m(),()=>{y()}},[u,m,l]),l?"loaded":u}var ume=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function cme(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var Nw=Ze(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:d,crossOrigin:p,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:y,...b}=t,w=r!==void 0||i!==void 0,E=u!=null||d||!w,_=lme({...t,ignoreFallback:E}),k=ume(_,m),T={ref:n,objectFit:l,objectPosition:s,...E?b:cme(b,["onError","onLoad"])};return k?i||g.jsx(Ne.img,{as:W_,className:"chakra-image__placeholder",src:r,...T}):g.jsx(Ne.img,{as:W_,src:o,srcSet:a,crossOrigin:p,loading:u,referrerPolicy:y,className:"chakra-image",...T})});Nw.displayName="Image";function h8(e){return S.Children.toArray(e).filter(t=>S.isValidElement(t))}var[dme,fme]=Pn({strict:!1,name:"ButtonGroupContext"}),hme={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},pme={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Gi=Ze(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,orientation:d="horizontal",...p}=t,m=xt("chakra-button__group",a),y=S.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let b={display:"inline-flex",...l?hme[d]:pme[d](s)};const w=d==="vertical";return g.jsx(dme,{value:y,children:g.jsx(Ne.div,{ref:n,role:"group",__css:b,className:m,"data-attached":l?"":void 0,"data-orientation":d,flexDir:w?"column":void 0,...p})})});Gi.displayName="ButtonGroup";function gme(e){const[t,n]=S.useState(!e);return{ref:S.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}function U_(e){const{children:t,className:n,...r}=e,i=S.isValidElement(t)?S.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=xt("chakra-button__icon",n);return g.jsx(Ne.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o,children:i})}U_.displayName="ButtonIcon";function s3(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=g.jsx(h0,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=xt("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",d=S.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return g.jsx(Ne.div,{className:l,...s,__css:d,children:i})}s3.displayName="ButtonSpinner";var ss=Ze((e,t)=>{const n=fme(),r=au("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:d,iconSpacing:p="0.5rem",type:m,spinner:y,spinnerPlacement:b="start",className:w,as:E,..._}=fr(e),k=S.useMemo(()=>{const D={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:D}}},[r,n]),{ref:T,type:L}=gme(E),O={rightIcon:u,leftIcon:l,iconSpacing:p,children:s};return g.jsxs(Ne.button,{ref:$ge(t,T),as:E,type:m??L,"data-active":Bt(a),"data-loading":Bt(o),__css:k,className:xt("chakra-button",w),..._,disabled:i||o,children:[o&&b==="start"&&g.jsx(s3,{className:"chakra-button__spinner--start",label:d,placement:"start",spacing:p,children:y}),o?d||g.jsx(Ne.span,{opacity:0,children:g.jsx(WA,{...O})}):g.jsx(WA,{...O}),o&&b==="end"&&g.jsx(s3,{className:"chakra-button__spinner--end",label:d,placement:"end",spacing:p,children:y})]})});ss.displayName="Button";function WA(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return g.jsxs(g.Fragment,{children:[t&&g.jsx(U_,{marginEnd:i,children:t}),r,n&&g.jsx(U_,{marginStart:i,children:n})]})}var ls=Ze((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=S.isValidElement(s)?S.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return g.jsx(ss,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a,children:l})});ls.displayName="IconButton";var[pNe,mme]=Pn({name:"CheckboxGroupContext",strict:!1});function vme(e){return g.jsx(Ne.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:g.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function yme(e){return g.jsx(Ne.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:g.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function bme(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?yme:vme;return n||t?g.jsx(Ne.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:g.jsx(i,{...r})}):null}var[xme,uz]=Pn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Sme,ip]=Pn({strict:!1,name:"FormControlContext"});function wme(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=S.useId(),l=t||`field-${s}`,u=`${l}-label`,d=`${l}-feedback`,p=`${l}-helptext`,[m,y]=S.useState(!1),[b,w]=S.useState(!1),[E,_]=S.useState(!1),k=S.useCallback((I={},N=null)=>({id:p,...I,ref:Rn(N,U=>{U&&w(!0)})}),[p]),T=S.useCallback((I={},N=null)=>{var U,B;return{...I,ref:N,"data-focus":Bt(E),"data-disabled":Bt(i),"data-invalid":Bt(r),"data-readonly":Bt(o),id:(U=I.id)!=null?U:u,htmlFor:(B=I.htmlFor)!=null?B:l}},[l,i,E,r,o,u]),L=S.useCallback((I={},N=null)=>({id:d,...I,ref:Rn(N,U=>{U&&y(!0)}),"aria-live":"polite"}),[d]),O=S.useCallback((I={},N=null)=>({...I,...a,ref:N,role:"group"}),[a]),D=S.useCallback((I={},N=null)=>({...I,ref:N,role:"presentation","aria-hidden":!0,children:I.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!E,onFocus:()=>_(!0),onBlur:()=>_(!1),hasFeedbackText:m,setHasFeedbackText:y,hasHelpText:b,setHasHelpText:w,id:l,labelId:u,feedbackId:d,helpTextId:p,htmlProps:a,getHelpTextProps:k,getErrorMessageProps:L,getRootProps:O,getLabelProps:T,getRequiredIndicatorProps:D}}var sn=Ze(function(t,n){const r=Yi("Form",t),i=fr(t),{getRootProps:o,htmlProps:a,...s}=wme(i),l=xt("chakra-form-control",t.className);return g.jsx(Sme,{value:s,children:g.jsx(xme,{value:r,children:g.jsx(Ne.div,{...o({},n),className:l,__css:r.container})})})});sn.displayName="FormControl";var sr=Ze(function(t,n){const r=ip(),i=uz(),o=xt("chakra-form__helper-text",t.className);return g.jsx(Ne.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});sr.displayName="FormHelperText";var[Cme,_me]=Pn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),lr=Ze((e,t)=>{const n=Yi("FormError",e),r=fr(e),i=ip();return i!=null&&i.isInvalid?g.jsx(Cme,{value:n,children:g.jsx(Ne.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:xt("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})}):null});lr.displayName="FormErrorMessage";var kme=Ze((e,t)=>{const n=_me(),r=ip();if(!(r!=null&&r.isInvalid))return null;const i=xt("chakra-form__error-icon",e.className);return g.jsx(ja,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i,children:g.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})});kme.displayName="FormErrorIcon";var Sn=Ze(function(t,n){var r;const i=au("FormLabel",t),o=fr(t),{className:a,children:s,requiredIndicator:l=g.jsx(cz,{}),optionalIndicator:u=null,...d}=o,p=ip(),m=(r=p==null?void 0:p.getLabelProps(d,n))!=null?r:{ref:n,...d};return g.jsxs(Ne.label,{...m,className:xt("chakra-form__label",o.className),__css:{display:"block",textAlign:"start",...i},children:[s,p!=null&&p.isRequired?l:u]})});Sn.displayName="FormLabel";var cz=Ze(function(t,n){const r=ip(),i=uz();if(!(r!=null&&r.isRequired))return null;const o=xt("chakra-form__required-indicator",t.className);return g.jsx(Ne.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});cz.displayName="RequiredIndicator";function p8(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=g8(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":Uu(n),"aria-required":Uu(i),"aria-readonly":Uu(r)}}function g8(e){var t,n,r;const i=ip(),{id:o,disabled:a,readOnly:s,required:l,isRequired:u,isInvalid:d,isReadOnly:p,isDisabled:m,onFocus:y,onBlur:b,...w}=e,E=e["aria-describedby"]?[e["aria-describedby"]]:[];return i!=null&&i.hasFeedbackText&&(i!=null&&i.isInvalid)&&E.push(i.feedbackId),i!=null&&i.hasHelpText&&E.push(i.helpTextId),{...w,"aria-describedby":E.join(" ")||void 0,id:o??(i==null?void 0:i.id),isDisabled:(t=a??m)!=null?t:i==null?void 0:i.isDisabled,isReadOnly:(n=s??p)!=null?n:i==null?void 0:i.isReadOnly,isRequired:(r=l??u)!=null?r:i==null?void 0:i.isRequired,isInvalid:d??(i==null?void 0:i.isInvalid),onFocus:ht(i==null?void 0:i.onFocus,y),onBlur:ht(i==null?void 0:i.onBlur,b)}}var Eme={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},UA=!1,l2=null,qh=!1,V_=!1,G_=new Set;function m8(e,t){G_.forEach(n=>n(e,t))}var Pme=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function Tme(e){return!(e.metaKey||!Pme&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function VA(e){qh=!0,Tme(e)&&(l2="keyboard",m8("keyboard",e))}function xg(e){if(l2="pointer",e.type==="mousedown"||e.type==="pointerdown"){qh=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;m8("pointer",e)}}function Mme(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function Lme(e){Mme(e)&&(qh=!0,l2="virtual")}function Ame(e){e.target===window||e.target===document||(!qh&&!V_&&(l2="virtual",m8("virtual",e)),qh=!1,V_=!1)}function Ome(){qh=!1,V_=!0}function GA(){return l2!=="pointer"}function Rme(){if(typeof window>"u"||UA)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){qh=!0,e.apply(this,n)},document.addEventListener("keydown",VA,!0),document.addEventListener("keyup",VA,!0),document.addEventListener("click",Lme,!0),window.addEventListener("focus",Ame,!0),window.addEventListener("blur",Ome,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",xg,!0),document.addEventListener("pointermove",xg,!0),document.addEventListener("pointerup",xg,!0)):(document.addEventListener("mousedown",xg,!0),document.addEventListener("mousemove",xg,!0),document.addEventListener("mouseup",xg,!0)),UA=!0}function dz(e){Rme(),e(GA());const t=()=>e(GA());return G_.add(t),()=>{G_.delete(t)}}function Ime(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function fz(e={}){const t=g8(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:d,isChecked:p,isFocusable:m,onChange:y,isIndeterminate:b,name:w,value:E,tabIndex:_=void 0,"aria-label":k,"aria-labelledby":T,"aria-invalid":L,...O}=e,D=Ime(O,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),I=Qr(y),N=Qr(s),U=Qr(l),[B,K]=S.useState(!1),[ne,z]=S.useState(!1),[$,H]=S.useState(!1),[Y,Q]=S.useState(!1);S.useEffect(()=>dz(K),[]);const q=S.useRef(null),[X,ee]=S.useState(!0),[fe,ke]=S.useState(!!d),we=p!==void 0,xe=we?p:fe,Le=S.useCallback(Fe=>{if(r||n){Fe.preventDefault();return}we||ke(xe?Fe.target.checked:b?!0:Fe.target.checked),I==null||I(Fe)},[r,n,xe,we,b,I]);Vl(()=>{q.current&&(q.current.indeterminate=Boolean(b))},[b]),rc(()=>{n&&z(!1)},[n,z]),Vl(()=>{const Fe=q.current;Fe!=null&&Fe.form&&(Fe.form.onreset=()=>{ke(!!d)})},[]);const Se=n&&!m,Qe=S.useCallback(Fe=>{Fe.key===" "&&Q(!0)},[Q]),Xe=S.useCallback(Fe=>{Fe.key===" "&&Q(!1)},[Q]);Vl(()=>{if(!q.current)return;q.current.checked!==xe&&ke(q.current.checked)},[q.current]);const tt=S.useCallback((Fe={},at=null)=>{const jt=mt=>{ne&&mt.preventDefault(),Q(!0)};return{...Fe,ref:at,"data-active":Bt(Y),"data-hover":Bt($),"data-checked":Bt(xe),"data-focus":Bt(ne),"data-focus-visible":Bt(ne&&B),"data-indeterminate":Bt(b),"data-disabled":Bt(n),"data-invalid":Bt(o),"data-readonly":Bt(r),"aria-hidden":!0,onMouseDown:ht(Fe.onMouseDown,jt),onMouseUp:ht(Fe.onMouseUp,()=>Q(!1)),onMouseEnter:ht(Fe.onMouseEnter,()=>H(!0)),onMouseLeave:ht(Fe.onMouseLeave,()=>H(!1))}},[Y,xe,n,ne,B,$,b,o,r]),yt=S.useCallback((Fe={},at=null)=>({...D,...Fe,ref:Rn(at,jt=>{jt&&ee(jt.tagName==="LABEL")}),onClick:ht(Fe.onClick,()=>{var jt;X||((jt=q.current)==null||jt.click(),requestAnimationFrame(()=>{var mt;(mt=q.current)==null||mt.focus()}))}),"data-disabled":Bt(n),"data-checked":Bt(xe),"data-invalid":Bt(o)}),[D,n,xe,o,X]),Be=S.useCallback((Fe={},at=null)=>({...Fe,ref:Rn(q,at),type:"checkbox",name:w,value:E,id:a,tabIndex:_,onChange:ht(Fe.onChange,Le),onBlur:ht(Fe.onBlur,N,()=>z(!1)),onFocus:ht(Fe.onFocus,U,()=>z(!0)),onKeyDown:ht(Fe.onKeyDown,Qe),onKeyUp:ht(Fe.onKeyUp,Xe),required:i,checked:xe,disabled:Se,readOnly:r,"aria-label":k,"aria-labelledby":T,"aria-invalid":L?Boolean(L):o,"aria-describedby":u,"aria-disabled":n,style:Eme}),[w,E,a,Le,N,U,Qe,Xe,i,xe,Se,r,k,T,L,o,u,n,_]),Ae=S.useCallback((Fe={},at=null)=>({...Fe,ref:at,onMouseDown:ht(Fe.onMouseDown,qA),onTouchStart:ht(Fe.onTouchStart,qA),"data-disabled":Bt(n),"data-checked":Bt(xe),"data-invalid":Bt(o)}),[xe,n,o]);return{state:{isInvalid:o,isFocused:ne,isChecked:xe,isActive:Y,isHovered:$,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:yt,getCheckboxProps:tt,getInputProps:Be,getLabelProps:Ae,htmlProps:D}}function qA(e){e.preventDefault(),e.stopPropagation()}var Dme={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},jme={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},Nme=nf({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),$me=nf({from:{opacity:0},to:{opacity:1}}),Fme=nf({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),hz=Ze(function(t,n){const r=mme(),i={...r,...t},o=Yi("Checkbox",i),a=fr(t),{spacing:s="0.5rem",className:l,children:u,iconColor:d,iconSize:p,icon:m=g.jsx(bme,{}),isChecked:y,isDisabled:b=r==null?void 0:r.isDisabled,onChange:w,inputProps:E,..._}=a;let k=y;r!=null&&r.value&&a.value&&(k=r.value.includes(a.value));let T=w;r!=null&&r.onChange&&a.value&&(T=ww(r.onChange,w));const{state:L,getInputProps:O,getCheckboxProps:D,getLabelProps:I,getRootProps:N}=fz({..._,isDisabled:b,isChecked:k,onChange:T}),U=S.useMemo(()=>({animation:L.isIndeterminate?`${$me} 20ms linear, ${Fme} 200ms linear`:`${Nme} 200ms linear`,fontSize:p,color:d,...o.icon}),[d,p,,L.isIndeterminate,o.icon]),B=S.cloneElement(m,{__css:U,isIndeterminate:L.isIndeterminate,isChecked:L.isChecked});return g.jsxs(Ne.label,{__css:{...jme,...o.container},className:xt("chakra-checkbox",l),...N(),children:[g.jsx("input",{className:"chakra-checkbox__input",...O(E,n)}),g.jsx(Ne.span,{__css:{...Dme,...o.control},className:"chakra-checkbox__control",...D(),children:B}),u&&g.jsx(Ne.span,{className:"chakra-checkbox__label",...I(),__css:{marginStart:s,...o.label},children:u})]})});hz.displayName="Checkbox";function Bme(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function v8(e,t){let n=Bme(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function q_(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function KA(e,t,n){return(e-t)*100/(n-t)}function zme(e,t,n){return(n-t)*e+t}function YA(e,t,n){const r=Math.round((e-t)/n)*n+t,i=q_(n);return v8(r,i)}function Jx(e,t,n){return e==null?e:(n{var B;return r==null?"":(B=cC(r,o,n))!=null?B:""}),m=typeof i<"u",y=m?i:d,b=pz(dd(y),o),w=n??b,E=S.useCallback(B=>{B!==y&&(m||p(B.toString()),u==null||u(B.toString(),dd(B)))},[u,m,y]),_=S.useCallback(B=>{let K=B;return l&&(K=Jx(K,a,s)),v8(K,w)},[w,l,s,a]),k=S.useCallback((B=o)=>{let K;y===""?K=dd(B):K=dd(y)+B,K=_(K),E(K)},[_,o,E,y]),T=S.useCallback((B=o)=>{let K;y===""?K=dd(-B):K=dd(y)-B,K=_(K),E(K)},[_,o,E,y]),L=S.useCallback(()=>{var B;let K;r==null?K="":K=(B=cC(r,o,n))!=null?B:a,E(K)},[r,n,o,E,a]),O=S.useCallback(B=>{var K;const ne=(K=cC(B,o,w))!=null?K:a;E(ne)},[w,o,E,a]),D=dd(y);return{isOutOfRange:D>s||D{const o=typeof e=="function"?e():e??document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e??document;o==null||o.removeEventListener(t,i,r)}}function Wme(e){return"current"in e}var gz=()=>typeof window<"u";function Ume(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var Vme=e=>gz()&&e.test(navigator.vendor),Gme=e=>gz()&&e.test(Ume()),qme=()=>Gme(/mac|iphone|ipad|ipod/i),Kme=()=>qme()&&Vme(/apple/i);function Yme(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var o,a;return(a=(o=t.current)==null?void 0:o.ownerDocument)!=null?a:document};Dh(i,"pointerdown",o=>{if(!Kme()||!r)return;const a=o.target,l=(n??[t]).some(u=>{const d=Wme(u)?u.current:u;return(d==null?void 0:d.contains(a))||d===a});i().activeElement!==a&&l&&(o.preventDefault(),a.focus())})}function y8(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var An={},Xme={get exports(){return An},set exports(e){An=e}},Zme="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Qme=Zme,Jme=Qme;function mz(){}function vz(){}vz.resetWarningCache=mz;var e0e=function(){function e(r,i,o,a,s,l){if(l!==Jme){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:vz,resetWarningCache:mz};return n.PropTypes=n,n};Xme.exports=e0e();var K_="data-focus-lock",yz="data-focus-lock-disabled",t0e="data-no-focus-lock",n0e="data-autofocus-inside",r0e="data-no-autofocus";function i0e(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function o0e(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function bz(e,t){return o0e(t||null,function(n){return e.forEach(function(r){return i0e(r,n)})})}var dC={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function xz(e){return e}function Sz(e,t){t===void 0&&(t=xz);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var d=a;a=[],d.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function b8(e,t){return t===void 0&&(t=xz),Sz(e,t)}function wz(e){e===void 0&&(e={});var t=Sz(null);return t.options=Nl({async:!0,ssr:!1},e),t}var Cz=function(e){var t=e.sideCar,n=ZB(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,Nl({},n))};Cz.isSideCarExport=!0;function a0e(e,t){return e.useMedium(t),Cz}var _z=b8({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),kz=b8(),s0e=b8(),l0e=wz({async:!0}),u0e=[],x8=S.forwardRef(function(t,n){var r,i=S.useState(),o=i[0],a=i[1],s=S.useRef(),l=S.useRef(!1),u=S.useRef(null),d=t.children,p=t.disabled,m=t.noFocusGuards,y=t.persistentFocus,b=t.crossFrame,w=t.autoFocus;t.allowTextSelection;var E=t.group,_=t.className,k=t.whiteList,T=t.hasPositiveIndices,L=t.shards,O=L===void 0?u0e:L,D=t.as,I=D===void 0?"div":D,N=t.lockProps,U=N===void 0?{}:N,B=t.sideCar,K=t.returnFocus,ne=t.focusOptions,z=t.onActivation,$=t.onDeactivation,H=S.useState({}),Y=H[0],Q=S.useCallback(function(){u.current=u.current||document&&document.activeElement,s.current&&z&&z(s.current),l.current=!0},[z]),q=S.useCallback(function(){l.current=!1,$&&$(s.current)},[$]);S.useEffect(function(){p||(u.current=null)},[]);var X=S.useCallback(function(Qe){var Xe=u.current;if(Xe&&Xe.focus){var tt=typeof K=="function"?K(Xe):K;if(tt){var yt=typeof tt=="object"?tt:void 0;u.current=null,Qe?Promise.resolve().then(function(){return Xe.focus(yt)}):Xe.focus(yt)}}},[K]),ee=S.useCallback(function(Qe){l.current&&_z.useMedium(Qe)},[]),fe=kz.useMedium,ke=S.useCallback(function(Qe){s.current!==Qe&&(s.current=Qe,a(Qe))},[]),we=pn((r={},r[yz]=p&&"disabled",r[K_]=E,r),U),xe=m!==!0,Le=xe&&m!=="tail",Se=bz([n,ke]);return S.createElement(S.Fragment,null,xe&&[S.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:p?-1:0,style:dC}),T?S.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:p?-1:1,style:dC}):null],!p&&S.createElement(B,{id:Y,sideCar:l0e,observed:o,disabled:p,persistentFocus:y,crossFrame:b,autoFocus:w,whiteList:k,shards:O,onActivation:Q,onDeactivation:q,returnFocus:X,focusOptions:ne}),S.createElement(I,pn({ref:Se},we,{className:_,onBlur:fe,onFocus:ee}),d),Le&&S.createElement("div",{"data-focus-guard":!0,tabIndex:p?-1:0,style:dC}))});x8.propTypes={};x8.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const Ez=x8;function l3(e,t){return l3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},l3(e,t)}function S8(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,l3(e,t)}function Ks(e){return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ks(e)}function c0e(e,t){if(Ks(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ks(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pz(e){var t=c0e(e,"string");return Ks(t)==="symbol"?t:String(t)}function fs(e,t,n){return t=Pz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d0e(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var o=[],a;function s(){a=e(o.map(function(u){return u.props})),t(a)}var l=function(u){S8(d,u);function d(){return u.apply(this,arguments)||this}d.peek=function(){return a};var p=d.prototype;return p.componentDidMount=function(){o.push(this),s()},p.componentDidUpdate=function(){s()},p.componentWillUnmount=function(){var y=o.indexOf(this);o.splice(y,1),s()},p.render=function(){return Ke.createElement(i,this.props)},d}(S.PureComponent);return fs(l,"displayName","SideEffect("+n(i)+")"),l}}var lu=function(e){for(var t=Array(e.length),n=0;n=0}).sort(b0e)},x0e=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],C8=x0e.join(","),S0e="".concat(C8,", [data-focus-guard]"),Nz=function(e,t){return lu((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?S0e:C8)?[r]:[],Nz(r))},[])},w0e=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?$w([e.contentDocument.body],t):[e]},$w=function(e,t){return e.reduce(function(n,r){var i,o=Nz(r,t),a=(i=[]).concat.apply(i,o.map(function(s){return w0e(s,t)}));return n.concat(a,r.parentNode?lu(r.parentNode.querySelectorAll(C8)).filter(function(s){return s===r}):[])},[])},C0e=function(e){var t=e.querySelectorAll("[".concat(n0e,"]"));return lu(t).map(function(n){return $w([n])}).reduce(function(n,r){return n.concat(r)},[])},_8=function(e,t){return lu(e).filter(function(n){return Az(t,n)}).filter(function(n){return m0e(n)})},XA=function(e,t){return t===void 0&&(t=new Map),lu(e).filter(function(n){return Oz(t,n)})},Y_=function(e,t,n){return jz(_8($w(e,n),t),!0,n)},ZA=function(e,t){return jz(_8($w(e),t),!1)},_0e=function(e,t){return _8(C0e(e),t)},_m=function(e,t){return e.shadowRoot?_m(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:lu(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var i=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return i?_m(i,t):!1}return _m(n,t)})},k0e=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},$z=function(e){return e.parentNode?$z(e.parentNode):e},k8=function(e){var t=u3(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(K_);return n.push.apply(n,i?k0e(lu($z(r).querySelectorAll("[".concat(K_,'="').concat(i,'"]:not([').concat(yz,'="disabled"])')))):[r]),n},[])},E0e=function(e){try{return e()}catch{return}},Ty=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Ty(t.shadowRoot):t instanceof HTMLIFrameElement&&E0e(function(){return t.contentWindow.document})?Ty(t.contentWindow.document):t}},P0e=function(e,t){return e===t},T0e=function(e,t){return Boolean(lu(e.querySelectorAll("iframe")).some(function(n){return P0e(n,t)}))},Fz=function(e,t){return t===void 0&&(t=Ty(Tz(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:k8(e).some(function(n){return _m(n,t)||T0e(n,t)})},M0e=function(e){e===void 0&&(e=document);var t=Ty(e);return t?lu(e.querySelectorAll("[".concat(t0e,"]"))).some(function(n){return _m(n,t)}):!1},L0e=function(e,t){return t.filter(Dz).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},E8=function(e,t){return Dz(e)&&e.name?L0e(e,t):e},A0e=function(e){var t=new Set;return e.forEach(function(n){return t.add(E8(n,e))}),e.filter(function(n){return t.has(n)})},QA=function(e){return e[0]&&e.length>1?E8(e[0],e):e[0]},JA=function(e,t){return e.length>1?e.indexOf(E8(e[t],e)):t},Bz="NEW_FOCUS",O0e=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=w8(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,d=r?e.indexOf(r):-1,p=l-u,m=t.indexOf(o),y=t.indexOf(a),b=A0e(t),w=n!==void 0?b.indexOf(n):-1,E=w-(r?b.indexOf(r):l),_=JA(e,0),k=JA(e,i-1);if(l===-1||d===-1)return Bz;if(!p&&d>=0)return d;if(l<=m&&s&&Math.abs(p)>1)return k;if(l>=y&&s&&Math.abs(p)>1)return _;if(p&&Math.abs(E)>1)return d;if(l<=m)return k;if(l>y)return _;if(p)return Math.abs(p)>1?d:(i+d+p)%i}},R0e=function(e){return function(t){var n,r=(n=Rz(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},I0e=function(e,t,n){var r=e.map(function(o){var a=o.node;return a}),i=XA(r.filter(R0e(n)));return i&&i.length?QA(i):QA(XA(t))},X_=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&X_(e.parentNode.host||e.parentNode,t),t},fC=function(e,t){for(var n=X_(e),r=X_(t),i=0;i=0)return o}return!1},zz=function(e,t,n){var r=u3(e),i=u3(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=fC(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=fC(o,l);u&&(!a||_m(u,a)?a=u:a=fC(u,a))})}),a},D0e=function(e,t){return e.reduce(function(n,r){return n.concat(_0e(r,t))},[])},j0e=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(y0e)},N0e=function(e,t){var n=Ty(u3(e).length>0?document:Tz(e).ownerDocument),r=k8(e).filter(c3),i=zz(n||e,e,r),o=new Map,a=ZA(r,o),s=Y_(r,o).filter(function(y){var b=y.node;return c3(b)});if(!(!s[0]&&(s=a,!s[0]))){var l=ZA([i],o).map(function(y){var b=y.node;return b}),u=j0e(l,s),d=u.map(function(y){var b=y.node;return b}),p=O0e(d,l,n,t);if(p===Bz){var m=I0e(a,d,D0e(r,o));if(m)return{node:m};console.warn("focus-lock: cannot find any node to move focus into");return}return p===void 0?p:u[p]}},$0e=function(e){var t=k8(e).filter(c3),n=zz(e,e,t),r=new Map,i=Y_([n],r,!0),o=Y_(t,r).filter(function(a){var s=a.node;return c3(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:w8(s)}})},F0e=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},hC=0,pC=!1,Hz=function(e,t,n){n===void 0&&(n={});var r=N0e(e,t);if(!pC&&r){if(hC>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),pC=!0,setTimeout(function(){pC=!1},1);return}hC++,F0e(r.node,n.focusOptions),hC--}};function Wz(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var B0e=function(){return document&&document.activeElement===document.body},z0e=function(){return B0e()||M0e()},km=null,am=null,Em=null,My=!1,H0e=function(){return!0},W0e=function(t){return(km.whiteList||H0e)(t)},U0e=function(t,n){Em={observerNode:t,portaledElement:n}},V0e=function(t){return Em&&Em.portaledElement===t};function eO(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var G0e=function(t){return t&&"current"in t?t.current:t},q0e=function(t){return t?Boolean(My):My==="meanwhile"},K0e=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},Y0e=function(t,n){return n.some(function(r){return K0e(t,r,r)})},d3=function(){var t=!1;if(km){var n=km,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||Em&&Em.portaledElement,d=document&&document.activeElement;if(u){var p=[u].concat(a.map(G0e).filter(Boolean));if((!d||W0e(d))&&(i||q0e(s)||!z0e()||!am&&o)&&(u&&!(Fz(p)||d&&Y0e(d,p)||V0e(d))&&(document&&!am&&d&&!o?(d.blur&&d.blur(),document.body.focus()):(t=Hz(p,am,{focusOptions:l}),Em={})),My=!1,am=document&&document.activeElement),document){var m=document&&document.activeElement,y=$0e(p),b=y.map(function(w){var E=w.node;return E}).indexOf(m);b>-1&&(y.filter(function(w){var E=w.guard,_=w.node;return E&&_.dataset.focusAutoGuard}).forEach(function(w){var E=w.node;return E.removeAttribute("tabIndex")}),eO(b,y.length,1,y),eO(b,-1,-1,y))}}}return t},Uz=function(t){d3()&&t&&(t.stopPropagation(),t.preventDefault())},P8=function(){return Wz(d3)},X0e=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||U0e(r,n)},Z0e=function(){return null},Vz=function(){My="just",setTimeout(function(){My="meanwhile"},0)},Q0e=function(){document.addEventListener("focusin",Uz),document.addEventListener("focusout",P8),window.addEventListener("blur",Vz)},J0e=function(){document.removeEventListener("focusin",Uz),document.removeEventListener("focusout",P8),window.removeEventListener("blur",Vz)};function eve(e){return e.filter(function(t){var n=t.disabled;return!n})}function tve(e){var t=e.slice(-1)[0];t&&!km&&Q0e();var n=km,r=n&&t&&t.id===n.id;km=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(am=null,(!r||n.observed!==t.observed)&&t.onActivation(),d3(),Wz(d3)):(J0e(),am=null)}_z.assignSyncMedium(X0e);kz.assignMedium(P8);s0e.assignMedium(function(e){return e({moveFocusInside:Hz,focusInside:Fz})});const nve=d0e(eve,tve)(Z0e);var Gz=S.forwardRef(function(t,n){return S.createElement(Ez,pn({sideCar:nve,ref:n},t))}),qz=Ez.propTypes||{};qz.sideCar;y8(qz,["sideCar"]);Gz.propTypes={};const tO=Gz;function Kz(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Yz(e){var t;if(!Kz(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function rve(e){var t,n;return(n=(t=Xz(e))==null?void 0:t.defaultView)!=null?n:window}function Xz(e){return Kz(e)?e.ownerDocument:document}function ive(e){return Xz(e).activeElement}var Zz=e=>e.hasAttribute("tabindex"),ove=e=>Zz(e)&&e.tabIndex===-1;function ave(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function Qz(e){return e.parentElement&&Qz(e.parentElement)?!0:e.hidden}function sve(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function Jz(e){if(!Yz(e)||Qz(e)||ave(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():sve(e)?!0:Zz(e)}function lve(e){return e?Yz(e)&&Jz(e)&&!ove(e):!1}var uve=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],cve=uve.join(),dve=e=>e.offsetWidth>0&&e.offsetHeight>0;function eH(e){const t=Array.from(e.querySelectorAll(cve));return t.unshift(e),t.filter(n=>Jz(n)&&dve(n))}var nO,fve=(nO=tO.default)!=null?nO:tO,tH=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,d=S.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&eH(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),p=S.useCallback(()=>{var y;(y=n==null?void 0:n.current)==null||y.focus()},[n]),m=i&&!n;return g.jsx(fve,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:d,onDeactivation:p,returnFocus:m,children:o})};tH.displayName="FocusLock";var hve=dce?S.useLayoutEffect:S.useEffect;function rO(e,t=[]){const n=S.useRef(e);return hve(()=>{n.current=e}),S.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function pve(e,t){const n=S.useId();return S.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function gve(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Kd(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=rO(n),a=rO(t),[s,l]=S.useState(e.defaultIsOpen||!1),[u,d]=gve(r,s),p=pve(i,"disclosure"),m=S.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),y=S.useCallback(()=>{u||l(!0),o==null||o()},[u,o]),b=S.useCallback(()=>{(d?m:y)()},[d,y,m]);return{isOpen:!!d,onOpen:y,onClose:m,onToggle:b,isControlled:u,getButtonProps:(w={})=>({...w,"aria-expanded":d,"aria-controls":p,onClick:mce(w.onClick,b)}),getDisclosureProps:(w={})=>({...w,hidden:!d,id:p})}}var T8=Ze(function(t,n){const{htmlSize:r,...i}=t,o=Yi("Input",i),a=fr(i),s=p8(a),l=xt("chakra-input",t.className);return g.jsx(Ne.input,{size:r,...s,__css:o.field,ref:n,className:l})});T8.displayName="Input";T8.id="Input";var[mve,nH]=Pn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),M8=Ze(function(t,n){const r=Yi("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=fr(t),u=h8(i),p=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return g.jsx(mve,{value:r,children:g.jsx(Ne.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...p},...l,children:u})})});M8.displayName="List";var vve=Ze((e,t)=>{const{as:n,...r}=e;return g.jsx(M8,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});vve.displayName="OrderedList";var rH=Ze(function(t,n){const{as:r,...i}=t;return g.jsx(M8,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});rH.displayName="UnorderedList";var d1=Ze(function(t,n){const r=nH();return g.jsx(Ne.li,{ref:n,...t,__css:r.item})});d1.displayName="ListItem";var yve=Ze(function(t,n){const r=nH();return g.jsx(ja,{ref:n,role:"presentation",...t,__css:r.icon})});yve.displayName="ListIcon";function iH(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):ko(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var oH=Ne("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});oH.displayName="Spacer";var Dt=Ze(function(t,n){const r=au("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=fr(t),u=Oce({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return g.jsx(Ne.p,{ref:n,className:xt("chakra-text",t.className),...u,...l,__css:r})});Dt.displayName="Text";var aH=e=>g.jsx(Ne.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});aH.displayName="StackItem";var Z_="& > *:not(style) ~ *:not(style)";function bve(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[Z_]:iH(n,i=>r[i])}}function xve(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":iH(n,i=>r[i])}}var L8=Ze((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:d,shouldWrapChildren:p,...m}=e,y=n?"row":r??"column",b=S.useMemo(()=>bve({direction:y,spacing:a}),[y,a]),w=S.useMemo(()=>xve({spacing:a,direction:y}),[a,y]),E=!!u,_=!p&&!E,k=S.useMemo(()=>{const L=h8(l);return _?L:L.map((O,D)=>{const I=typeof O.key<"u"?O.key:D,N=D+1===L.length,B=p?g.jsx(aH,{children:O},I):O;if(!E)return B;const K=S.cloneElement(u,{__css:w}),ne=N?null:K;return g.jsxs(S.Fragment,{children:[B,ne]},I)})},[u,w,E,_,p,l]),T=xt("chakra-stack",d);return g.jsx(Ne.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:b.flexDirection,flexWrap:s,className:T,__css:E?{}:{[Z_]:b[Z_]},...m,children:k})});L8.displayName="Stack";var hn=Ze((e,t)=>g.jsx(L8,{align:"center",...e,direction:"column",ref:t}));hn.displayName="VStack";var u2=Ze((e,t)=>g.jsx(L8,{align:"center",...e,direction:"row",ref:t}));u2.displayName="HStack";var jh=Ze(function(t,n){const r=au("Heading",t),{className:i,...o}=fr(t);return g.jsx(Ne.h2,{ref:n,className:xt("chakra-heading",t.className),...o,__css:r})});jh.displayName="Heading";var ao=Ne("div");ao.displayName="Box";var sH=Ze(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return g.jsx(ao,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});sH.displayName="Square";var Sve=Ze(function(t,n){const{size:r,...i}=t;return g.jsx(sH,{size:r,ref:n,borderRadius:"9999px",...i})});Sve.displayName="Circle";var Nh=Ze(function(t,n){const r=au("Link",t),{className:i,isExternal:o,...a}=fr(t);return g.jsx(Ne.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:xt("chakra-link",i),...a,__css:r})});Nh.displayName="Link";var lH=Ne("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});lH.displayName="Center";var wve={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Ze(function(t,n){const{axis:r="both",...i}=t;return g.jsx(Ne.div,{ref:n,__css:wve[r],...i,position:"absolute"})});var _e=Ze(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...d}=t,p={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return g.jsx(Ne.div,{ref:n,__css:p,...d})});_e.displayName="Flex";function Cve(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function _ve(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,i]=S.useState([]),o=S.useRef(),a=()=>{o.current&&(clearTimeout(o.current),o.current=null)},s=()=>{a(),o.current=setTimeout(()=>{i([]),o.current=null},t)};S.useEffect(()=>a,[]);function l(u){return d=>{if(d.key==="Backspace"){const p=[...r];p.pop(),i(p);return}if(Cve(d)){const p=r.concat(d.key);n(d)&&(d.preventDefault(),d.stopPropagation()),i(p),u(p.join("")),s()}}}return l}function kve(e,t,n,r){if(t==null)return r;if(!r)return e.find(a=>n(a).toLowerCase().startsWith(t.toLowerCase()));const i=e.filter(o=>n(o).toLowerCase().startsWith(t.toLowerCase()));if(i.length>0){let o;return i.includes(r)?(o=i.indexOf(r)+1,o===i.length&&(o=0),i[o]):(o=e.indexOf(i[0]),e[o])}return r}function Eve(){const e=S.useRef(new Map),t=e.current,n=S.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=S.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return S.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function gC(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function uH(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:d,tabIndex:p,onMouseOver:m,onMouseLeave:y,...b}=e,[w,E]=S.useState(!0),[_,k]=S.useState(!1),T=Eve(),L=Q=>{Q&&Q.tagName!=="BUTTON"&&E(!1)},O=w?p:p||0,D=n&&!r,I=S.useCallback(Q=>{if(n){Q.stopPropagation(),Q.preventDefault();return}Q.currentTarget.focus(),l==null||l(Q)},[n,l]),N=S.useCallback(Q=>{_&&gC(Q)&&(Q.preventDefault(),Q.stopPropagation(),k(!1),T.remove(document,"keyup",N,!1))},[_,T]),U=S.useCallback(Q=>{if(u==null||u(Q),n||Q.defaultPrevented||Q.metaKey||!gC(Q.nativeEvent)||w)return;const q=i&&Q.key==="Enter";o&&Q.key===" "&&(Q.preventDefault(),k(!0)),q&&(Q.preventDefault(),Q.currentTarget.click()),T.add(document,"keyup",N,!1)},[n,w,u,i,o,T,N]),B=S.useCallback(Q=>{if(d==null||d(Q),n||Q.defaultPrevented||Q.metaKey||!gC(Q.nativeEvent)||w)return;o&&Q.key===" "&&(Q.preventDefault(),k(!1),Q.currentTarget.click())},[o,w,n,d]),K=S.useCallback(Q=>{Q.button===0&&(k(!1),T.remove(document,"mouseup",K,!1))},[T]),ne=S.useCallback(Q=>{if(Q.button!==0)return;if(n){Q.stopPropagation(),Q.preventDefault();return}w||k(!0),Q.currentTarget.focus({preventScroll:!0}),T.add(document,"mouseup",K,!1),a==null||a(Q)},[n,w,a,T,K]),z=S.useCallback(Q=>{Q.button===0&&(w||k(!1),s==null||s(Q))},[s,w]),$=S.useCallback(Q=>{if(n){Q.preventDefault();return}m==null||m(Q)},[n,m]),H=S.useCallback(Q=>{_&&(Q.preventDefault(),k(!1)),y==null||y(Q)},[_,y]),Y=Rn(t,L);return w?{...b,ref:Y,type:"button","aria-disabled":D?void 0:n,disabled:D,onClick:I,onMouseDown:a,onMouseUp:s,onKeyUp:d,onKeyDown:u,onMouseOver:m,onMouseLeave:y}:{...b,ref:Y,role:"button","data-active":Bt(_),"aria-disabled":n?"true":void 0,tabIndex:D?void 0:O,onClick:I,onMouseDown:ne,onMouseUp:z,onKeyUp:B,onKeyDown:U,onMouseOver:$,onMouseLeave:H}}function Pve(e){const t=e.current;if(!t)return!1;const n=ive(t);return!n||t.contains(n)?!1:!!lve(n)}function cH(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;rc(()=>{if(!o||Pve(e))return;const a=(i==null?void 0:i.current)||e.current;a&&requestAnimationFrame(()=>{a.focus()})},[o,e,i])}var Tve={preventScroll:!0,shouldFocus:!1};function Mve(e,t=Tve){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=Lve(e)?e.current:e,s=i&&o,l=S.useRef(s),u=S.useRef(o);Vl(()=>{!u.current&&o&&(l.current=s),u.current=o},[o,s]);const d=S.useCallback(()=>{if(!(!o||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var p;(p=n.current)==null||p.focus({preventScroll:r})});else{const p=eH(a);p.length>0&&requestAnimationFrame(()=>{p[0].focus({preventScroll:r})})}},[o,r,a,n]);rc(()=>{d()},[d]),Dh(a,"transitionend",d)}function Lve(e){return"current"in e}var Sg=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),ii={arrowShadowColor:Sg("--popper-arrow-shadow-color"),arrowSize:Sg("--popper-arrow-size","8px"),arrowSizeHalf:Sg("--popper-arrow-size-half"),arrowBg:Sg("--popper-arrow-bg"),transformOrigin:Sg("--popper-transform-origin"),arrowOffset:Sg("--popper-arrow-offset")};function Ave(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var Ove={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},Rve=e=>Ove[e],iO={scroll:!0,resize:!0};function Ive(e){let t;return typeof e=="object"?t={enabled:!0,options:{...iO,...e}}:t={enabled:e,options:iO},t}var Dve={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},jve={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{oO(e)},effect:({state:e})=>()=>{oO(e)}},oO=e=>{e.elements.popper.style.setProperty(ii.transformOrigin.var,Rve(e.placement))},Nve={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{$ve(e)}},$ve=e=>{var t;if(!e.placement)return;const n=Fve(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:ii.arrowSize.varRef,height:ii.arrowSize.varRef,zIndex:-1});const r={[ii.arrowSizeHalf.var]:`calc(${ii.arrowSize.varRef} / 2)`,[ii.arrowOffset.var]:`calc(${ii.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},Fve=e=>{if(e.startsWith("top"))return{property:"bottom",value:ii.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:ii.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:ii.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:ii.arrowOffset.varRef}},Bve={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{aO(e)},effect:({state:e})=>()=>{aO(e)}},aO=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=Ave(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:ii.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},zve={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},Hve={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function Wve(e,t="ltr"){var n,r;const i=((n=zve[e])==null?void 0:n[t])||e;return t==="ltr"?i:(r=Hve[e])!=null?r:i}var Zo="top",us="bottom",cs="right",Qo="left",A8="auto",c2=[Zo,us,cs,Qo],Gm="start",Ly="end",Uve="clippingParents",dH="viewport",Wv="popper",Vve="reference",sO=c2.reduce(function(e,t){return e.concat([t+"-"+Gm,t+"-"+Ly])},[]),fH=[].concat(c2,[A8]).reduce(function(e,t){return e.concat([t,t+"-"+Gm,t+"-"+Ly])},[]),Gve="beforeRead",qve="read",Kve="afterRead",Yve="beforeMain",Xve="main",Zve="afterMain",Qve="beforeWrite",Jve="write",e1e="afterWrite",t1e=[Gve,qve,Kve,Yve,Xve,Zve,Qve,Jve,e1e];function nu(e){return e?(e.nodeName||"").toLowerCase():null}function hs(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Kh(e){var t=hs(e).Element;return e instanceof t||e instanceof Element}function is(e){var t=hs(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function O8(e){if(typeof ShadowRoot>"u")return!1;var t=hs(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function n1e(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!is(o)||!nu(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function r1e(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!is(i)||!nu(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const i1e={name:"applyStyles",enabled:!0,phase:"write",fn:n1e,effect:r1e,requires:["computeStyles"]};function Zl(e){return e.split("-")[0]}var $h=Math.max,f3=Math.min,qm=Math.round;function Q_(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function hH(){return!/^((?!chrome|android).)*safari/i.test(Q_())}function Km(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&is(e)&&(i=e.offsetWidth>0&&qm(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&qm(r.height)/e.offsetHeight||1);var a=Kh(e)?hs(e):window,s=a.visualViewport,l=!hH()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,d=(r.top+(l&&s?s.offsetTop:0))/o,p=r.width/i,m=r.height/o;return{width:p,height:m,top:d,right:u+p,bottom:d+m,left:u,x:u,y:d}}function R8(e){var t=Km(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function pH(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&O8(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ic(e){return hs(e).getComputedStyle(e)}function o1e(e){return["table","td","th"].indexOf(nu(e))>=0}function lf(e){return((Kh(e)?e.ownerDocument:e.document)||window.document).documentElement}function Fw(e){return nu(e)==="html"?e:e.assignedSlot||e.parentNode||(O8(e)?e.host:null)||lf(e)}function lO(e){return!is(e)||ic(e).position==="fixed"?null:e.offsetParent}function a1e(e){var t=/firefox/i.test(Q_()),n=/Trident/i.test(Q_());if(n&&is(e)){var r=ic(e);if(r.position==="fixed")return null}var i=Fw(e);for(O8(i)&&(i=i.host);is(i)&&["html","body"].indexOf(nu(i))<0;){var o=ic(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function d2(e){for(var t=hs(e),n=lO(e);n&&o1e(n)&&ic(n).position==="static";)n=lO(n);return n&&(nu(n)==="html"||nu(n)==="body"&&ic(n).position==="static")?t:n||a1e(e)||t}function I8(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function H1(e,t,n){return $h(e,f3(t,n))}function s1e(e,t,n){var r=H1(e,t,n);return r>n?n:r}function gH(){return{top:0,right:0,bottom:0,left:0}}function mH(e){return Object.assign({},gH(),e)}function vH(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var l1e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,mH(typeof t!="number"?t:vH(t,c2))};function u1e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Zl(n.placement),l=I8(s),u=[Qo,cs].indexOf(s)>=0,d=u?"height":"width";if(!(!o||!a)){var p=l1e(i.padding,n),m=R8(o),y=l==="y"?Zo:Qo,b=l==="y"?us:cs,w=n.rects.reference[d]+n.rects.reference[l]-a[l]-n.rects.popper[d],E=a[l]-n.rects.reference[l],_=d2(o),k=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,T=w/2-E/2,L=p[y],O=k-m[d]-p[b],D=k/2-m[d]/2+T,I=H1(L,D,O),N=l;n.modifiersData[r]=(t={},t[N]=I,t.centerOffset=I-D,t)}}function c1e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||pH(t.elements.popper,i)&&(t.elements.arrow=i))}const d1e={name:"arrow",enabled:!0,phase:"main",fn:u1e,effect:c1e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ym(e){return e.split("-")[1]}var f1e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function h1e(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:qm(t*i)/i||0,y:qm(n*i)/i||0}}function uO(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,p=e.isFixed,m=a.x,y=m===void 0?0:m,b=a.y,w=b===void 0?0:b,E=typeof d=="function"?d({x:y,y:w}):{x:y,y:w};y=E.x,w=E.y;var _=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),T=Qo,L=Zo,O=window;if(u){var D=d2(n),I="clientHeight",N="clientWidth";if(D===hs(n)&&(D=lf(n),ic(D).position!=="static"&&s==="absolute"&&(I="scrollHeight",N="scrollWidth")),D=D,i===Zo||(i===Qo||i===cs)&&o===Ly){L=us;var U=p&&D===O&&O.visualViewport?O.visualViewport.height:D[I];w-=U-r.height,w*=l?1:-1}if(i===Qo||(i===Zo||i===us)&&o===Ly){T=cs;var B=p&&D===O&&O.visualViewport?O.visualViewport.width:D[N];y-=B-r.width,y*=l?1:-1}}var K=Object.assign({position:s},u&&f1e),ne=d===!0?h1e({x:y,y:w}):{x:y,y:w};if(y=ne.x,w=ne.y,l){var z;return Object.assign({},K,(z={},z[L]=k?"0":"",z[T]=_?"0":"",z.transform=(O.devicePixelRatio||1)<=1?"translate("+y+"px, "+w+"px)":"translate3d("+y+"px, "+w+"px, 0)",z))}return Object.assign({},K,(t={},t[L]=k?w+"px":"",t[T]=_?y+"px":"",t.transform="",t))}function p1e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Zl(t.placement),variation:Ym(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,uO(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,uO(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const g1e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:p1e,data:{}};var Gb={passive:!0};function m1e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=hs(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,Gb)}),s&&l.addEventListener("resize",n.update,Gb),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,Gb)}),s&&l.removeEventListener("resize",n.update,Gb)}}const v1e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:m1e,data:{}};var y1e={left:"right",right:"left",bottom:"top",top:"bottom"};function eS(e){return e.replace(/left|right|bottom|top/g,function(t){return y1e[t]})}var b1e={start:"end",end:"start"};function cO(e){return e.replace(/start|end/g,function(t){return b1e[t]})}function D8(e){var t=hs(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function j8(e){return Km(lf(e)).left+D8(e).scrollLeft}function x1e(e,t){var n=hs(e),r=lf(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=hH();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+j8(e),y:l}}function S1e(e){var t,n=lf(e),r=D8(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=$h(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=$h(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+j8(e),l=-r.scrollTop;return ic(i||n).direction==="rtl"&&(s+=$h(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function N8(e){var t=ic(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function yH(e){return["html","body","#document"].indexOf(nu(e))>=0?e.ownerDocument.body:is(e)&&N8(e)?e:yH(Fw(e))}function W1(e,t){var n;t===void 0&&(t=[]);var r=yH(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=hs(r),a=i?[o].concat(o.visualViewport||[],N8(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(W1(Fw(a)))}function J_(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function w1e(e,t){var n=Km(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function dO(e,t,n){return t===dH?J_(x1e(e,n)):Kh(t)?w1e(t,n):J_(S1e(lf(e)))}function C1e(e){var t=W1(Fw(e)),n=["absolute","fixed"].indexOf(ic(e).position)>=0,r=n&&is(e)?d2(e):e;return Kh(r)?t.filter(function(i){return Kh(i)&&pH(i,r)&&nu(i)!=="body"}):[]}function _1e(e,t,n,r){var i=t==="clippingParents"?C1e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var d=dO(e,u,r);return l.top=$h(d.top,l.top),l.right=f3(d.right,l.right),l.bottom=f3(d.bottom,l.bottom),l.left=$h(d.left,l.left),l},dO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function bH(e){var t=e.reference,n=e.element,r=e.placement,i=r?Zl(r):null,o=r?Ym(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Zo:l={x:a,y:t.y-n.height};break;case us:l={x:a,y:t.y+t.height};break;case cs:l={x:t.x+t.width,y:s};break;case Qo:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?I8(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case Gm:l[u]=l[u]-(t[d]/2-n[d]/2);break;case Ly:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function Ay(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?Uve:s,u=n.rootBoundary,d=u===void 0?dH:u,p=n.elementContext,m=p===void 0?Wv:p,y=n.altBoundary,b=y===void 0?!1:y,w=n.padding,E=w===void 0?0:w,_=mH(typeof E!="number"?E:vH(E,c2)),k=m===Wv?Vve:Wv,T=e.rects.popper,L=e.elements[b?k:m],O=_1e(Kh(L)?L:L.contextElement||lf(e.elements.popper),l,d,a),D=Km(e.elements.reference),I=bH({reference:D,element:T,strategy:"absolute",placement:i}),N=J_(Object.assign({},T,I)),U=m===Wv?N:D,B={top:O.top-U.top+_.top,bottom:U.bottom-O.bottom+_.bottom,left:O.left-U.left+_.left,right:U.right-O.right+_.right},K=e.modifiersData.offset;if(m===Wv&&K){var ne=K[i];Object.keys(B).forEach(function(z){var $=[cs,us].indexOf(z)>=0?1:-1,H=[Zo,us].indexOf(z)>=0?"y":"x";B[z]+=ne[H]*$})}return B}function k1e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?fH:l,d=Ym(r),p=d?s?sO:sO.filter(function(b){return Ym(b)===d}):c2,m=p.filter(function(b){return u.indexOf(b)>=0});m.length===0&&(m=p);var y=m.reduce(function(b,w){return b[w]=Ay(e,{placement:w,boundary:i,rootBoundary:o,padding:a})[Zl(w)],b},{});return Object.keys(y).sort(function(b,w){return y[b]-y[w]})}function E1e(e){if(Zl(e)===A8)return[];var t=eS(e);return[cO(e),t,cO(t)]}function P1e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,d=n.boundary,p=n.rootBoundary,m=n.altBoundary,y=n.flipVariations,b=y===void 0?!0:y,w=n.allowedAutoPlacements,E=t.options.placement,_=Zl(E),k=_===E,T=l||(k||!b?[eS(E)]:E1e(E)),L=[E].concat(T).reduce(function(xe,Le){return xe.concat(Zl(Le)===A8?k1e(t,{placement:Le,boundary:d,rootBoundary:p,padding:u,flipVariations:b,allowedAutoPlacements:w}):Le)},[]),O=t.rects.reference,D=t.rects.popper,I=new Map,N=!0,U=L[0],B=0;B=0,H=$?"width":"height",Y=Ay(t,{placement:K,boundary:d,rootBoundary:p,altBoundary:m,padding:u}),Q=$?z?cs:Qo:z?us:Zo;O[H]>D[H]&&(Q=eS(Q));var q=eS(Q),X=[];if(o&&X.push(Y[ne]<=0),s&&X.push(Y[Q]<=0,Y[q]<=0),X.every(function(xe){return xe})){U=K,N=!1;break}I.set(K,X)}if(N)for(var ee=b?3:1,fe=function(Le){var Se=L.find(function(Qe){var Xe=I.get(Qe);if(Xe)return Xe.slice(0,Le).every(function(tt){return tt})});if(Se)return U=Se,"break"},ke=ee;ke>0;ke--){var we=fe(ke);if(we==="break")break}t.placement!==U&&(t.modifiersData[r]._skip=!0,t.placement=U,t.reset=!0)}}const T1e={name:"flip",enabled:!0,phase:"main",fn:P1e,requiresIfExists:["offset"],data:{_skip:!1}};function fO(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function hO(e){return[Zo,cs,us,Qo].some(function(t){return e[t]>=0})}function M1e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Ay(t,{elementContext:"reference"}),s=Ay(t,{altBoundary:!0}),l=fO(a,r),u=fO(s,i,o),d=hO(l),p=hO(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}const L1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:M1e};function A1e(e,t,n){var r=Zl(e),i=[Qo,Zo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Qo,cs].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function O1e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=fH.reduce(function(d,p){return d[p]=A1e(p,t.rects,o),d},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const R1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:O1e};function I1e(e){var t=e.state,n=e.name;t.modifiersData[n]=bH({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const D1e={name:"popperOffsets",enabled:!0,phase:"read",fn:I1e,data:{}};function j1e(e){return e==="x"?"y":"x"}function N1e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,p=n.padding,m=n.tether,y=m===void 0?!0:m,b=n.tetherOffset,w=b===void 0?0:b,E=Ay(t,{boundary:l,rootBoundary:u,padding:p,altBoundary:d}),_=Zl(t.placement),k=Ym(t.placement),T=!k,L=I8(_),O=j1e(L),D=t.modifiersData.popperOffsets,I=t.rects.reference,N=t.rects.popper,U=typeof w=="function"?w(Object.assign({},t.rects,{placement:t.placement})):w,B=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,ne={x:0,y:0};if(D){if(o){var z,$=L==="y"?Zo:Qo,H=L==="y"?us:cs,Y=L==="y"?"height":"width",Q=D[L],q=Q+E[$],X=Q-E[H],ee=y?-N[Y]/2:0,fe=k===Gm?I[Y]:N[Y],ke=k===Gm?-N[Y]:-I[Y],we=t.elements.arrow,xe=y&&we?R8(we):{width:0,height:0},Le=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:gH(),Se=Le[$],Qe=Le[H],Xe=H1(0,I[Y],xe[Y]),tt=T?I[Y]/2-ee-Xe-Se-B.mainAxis:fe-Xe-Se-B.mainAxis,yt=T?-I[Y]/2+ee+Xe+Qe+B.mainAxis:ke+Xe+Qe+B.mainAxis,Be=t.elements.arrow&&d2(t.elements.arrow),Ae=Be?L==="y"?Be.clientTop||0:Be.clientLeft||0:0,bt=(z=K==null?void 0:K[L])!=null?z:0,Fe=Q+tt-bt-Ae,at=Q+yt-bt,jt=H1(y?f3(q,Fe):q,Q,y?$h(X,at):X);D[L]=jt,ne[L]=jt-Q}if(s){var mt,Zt=L==="x"?Zo:Qo,on=L==="x"?us:cs,se=D[O],Ie=O==="y"?"height":"width",He=se+E[Zt],Ue=se-E[on],ye=[Zo,Qo].indexOf(_)!==-1,je=(mt=K==null?void 0:K[O])!=null?mt:0,vt=ye?He:se-I[Ie]-N[Ie]-je+B.altAxis,Mt=ye?se+I[Ie]+N[Ie]-je-B.altAxis:Ue,Me=y&&ye?s1e(vt,se,Mt):H1(y?vt:He,se,y?Mt:Ue);D[O]=Me,ne[O]=Me-se}t.modifiersData[r]=ne}}const $1e={name:"preventOverflow",enabled:!0,phase:"main",fn:N1e,requiresIfExists:["offset"]};function F1e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function B1e(e){return e===hs(e)||!is(e)?D8(e):F1e(e)}function z1e(e){var t=e.getBoundingClientRect(),n=qm(t.width)/e.offsetWidth||1,r=qm(t.height)/e.offsetHeight||1;return n!==1||r!==1}function H1e(e,t,n){n===void 0&&(n=!1);var r=is(t),i=is(t)&&z1e(t),o=lf(t),a=Km(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((nu(t)!=="body"||N8(o))&&(s=B1e(t)),is(t)?(l=Km(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=j8(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function W1e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function U1e(e){var t=W1e(e);return t1e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function V1e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function G1e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var pO={placement:"bottom",modifiers:[],strategy:"absolute"};function gO(){for(var e=arguments.length,t=new Array(e),n=0;n{}),T=S.useCallback(()=>{var B;!t||!b.current||!w.current||((B=k.current)==null||B.call(k),E.current=Y1e(b.current,w.current,{placement:_,modifiers:[Bve,Nve,jve,{...Dve,enabled:!!m},{name:"eventListeners",...Ive(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!p,options:{boundary:d}},...n??[]],strategy:i}),E.current.forceUpdate(),k.current=E.current.destroy)},[_,t,n,m,a,o,s,l,u,p,d,i]);S.useEffect(()=>()=>{var B;!b.current&&!w.current&&((B=E.current)==null||B.destroy(),E.current=null)},[]);const L=S.useCallback(B=>{b.current=B,T()},[T]),O=S.useCallback((B={},K=null)=>({...B,ref:Rn(L,K)}),[L]),D=S.useCallback(B=>{w.current=B,T()},[T]),I=S.useCallback((B={},K=null)=>({...B,ref:Rn(D,K),style:{...B.style,position:i,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[i,D,m]),N=S.useCallback((B={},K=null)=>{const{size:ne,shadowColor:z,bg:$,style:H,...Y}=B;return{...Y,ref:K,"data-popper-arrow":"",style:X1e(B)}},[]),U=S.useCallback((B={},K=null)=>({...B,ref:K,"data-popper-arrow-inner":""}),[]);return{update(){var B;(B=E.current)==null||B.update()},forceUpdate(){var B;(B=E.current)==null||B.forceUpdate()},transformOrigin:ii.transformOrigin.varRef,referenceRef:L,popperRef:D,getPopperProps:I,getArrowProps:N,getArrowInnerProps:U,getReferenceProps:O}}function X1e(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function F8(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=Qr(n),a=Qr(t),[s,l]=S.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,d=r!==void 0,p=S.useId(),m=i??`disclosure-${p}`,y=S.useCallback(()=>{d||l(!1),a==null||a()},[d,a]),b=S.useCallback(()=>{d||l(!0),o==null||o()},[d,o]),w=S.useCallback(()=>{u?y():b()},[u,b,y]);function E(k={}){return{...k,"aria-expanded":u,"aria-controls":m,onClick(T){var L;(L=k.onClick)==null||L.call(k,T),w()}}}function _(k={}){return{...k,hidden:!u,id:m}}return{isOpen:u,onOpen:b,onClose:y,onToggle:w,isControlled:d,getButtonProps:E,getDisclosureProps:_}}function Z1e(e){const{ref:t,handler:n,enabled:r=!0}=e,i=Qr(n),a=S.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;S.useEffect(()=>{if(!r)return;const s=p=>{mC(p,t)&&(a.isPointerDown=!0)},l=p=>{if(a.ignoreEmulatedMouseEvents){a.ignoreEmulatedMouseEvents=!1;return}a.isPointerDown&&n&&mC(p,t)&&(a.isPointerDown=!1,i(p))},u=p=>{a.ignoreEmulatedMouseEvents=!0,n&&a.isPointerDown&&mC(p,t)&&(a.isPointerDown=!1,i(p))},d=xH(t.current);return d.addEventListener("mousedown",s,!0),d.addEventListener("mouseup",l,!0),d.addEventListener("touchstart",s,!0),d.addEventListener("touchend",u,!0),()=>{d.removeEventListener("mousedown",s,!0),d.removeEventListener("mouseup",l,!0),d.removeEventListener("touchstart",s,!0),d.removeEventListener("touchend",u,!0)}},[n,t,i,a,r])}function mC(e,t){var n;const r=e.target;return e.button>0||r&&!xH(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function xH(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function SH(e){const{isOpen:t,ref:n}=e,[r,i]=S.useState(t),[o,a]=S.useState(!1);return S.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),Dh(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=rve(n.current),d=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(d)}}}function B8(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var[Q1e,J1e,eye,tye]=l8(),[nye,f2]=Pn({strict:!1,name:"MenuContext"});function rye(e,...t){const n=S.useId(),r=e||n;return S.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}function wH(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function mO(e){return wH(e).activeElement===e}function iye(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:i,autoSelect:o=!0,isLazy:a,isOpen:s,defaultIsOpen:l,onClose:u,onOpen:d,placement:p="bottom-start",lazyBehavior:m="unmount",direction:y,computePositionOnMount:b=!1,...w}=e,E=S.useRef(null),_=S.useRef(null),k=eye(),T=S.useCallback(()=>{requestAnimationFrame(()=>{var we;(we=E.current)==null||we.focus({preventScroll:!1})})},[]),L=S.useCallback(()=>{const we=setTimeout(()=>{var xe;if(i)(xe=i.current)==null||xe.focus();else{const Le=k.firstEnabled();Le&&z(Le.index)}});q.current.add(we)},[k,i]),O=S.useCallback(()=>{const we=setTimeout(()=>{const xe=k.lastEnabled();xe&&z(xe.index)});q.current.add(we)},[k]),D=S.useCallback(()=>{d==null||d(),o?L():T()},[o,L,T,d]),{isOpen:I,onOpen:N,onClose:U,onToggle:B}=F8({isOpen:s,defaultIsOpen:l,onClose:u,onOpen:D});Z1e({enabled:I&&r,ref:E,handler:we=>{var xe;(xe=_.current)!=null&&xe.contains(we.target)||U()}});const K=$8({...w,enabled:I||b,placement:p,direction:y}),[ne,z]=S.useState(-1);rc(()=>{I||z(-1)},[I]),cH(E,{focusRef:_,visible:I,shouldFocus:!0});const $=SH({isOpen:I,ref:E}),[H,Y]=rye(t,"menu-button","menu-list"),Q=S.useCallback(()=>{N(),T()},[N,T]),q=S.useRef(new Set([]));dye(()=>{q.current.forEach(we=>clearTimeout(we)),q.current.clear()});const X=S.useCallback(()=>{N(),L()},[L,N]),ee=S.useCallback(()=>{N(),O()},[N,O]),fe=S.useCallback(()=>{var we,xe;const Le=wH(E.current),Se=(we=E.current)==null?void 0:we.contains(Le.activeElement);if(!(I&&!Se))return;const Xe=(xe=k.item(ne))==null?void 0:xe.node;Xe==null||Xe.focus()},[I,ne,k]),ke=S.useRef(null);return{openAndFocusMenu:Q,openAndFocusFirstItem:X,openAndFocusLastItem:ee,onTransitionEnd:fe,unstable__animationState:$,descendants:k,popper:K,buttonId:H,menuId:Y,forceUpdate:K.forceUpdate,orientation:"vertical",isOpen:I,onToggle:B,onOpen:N,onClose:U,menuRef:E,buttonRef:_,focusedIndex:ne,closeOnSelect:n,closeOnBlur:r,autoSelect:o,setFocusedIndex:z,isLazy:a,lazyBehavior:m,initialFocusRef:i,rafId:ke}}function oye(e={},t=null){const n=f2(),{onToggle:r,popper:i,openAndFocusFirstItem:o,openAndFocusLastItem:a}=n,s=S.useCallback(l=>{const u=l.key,p={Enter:o,ArrowDown:o,ArrowUp:a}[u];p&&(l.preventDefault(),l.stopPropagation(),p(l))},[o,a]);return{...e,ref:Rn(n.buttonRef,t,i.referenceRef),id:n.buttonId,"data-active":Bt(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:ht(e.onClick,r),onKeyDown:ht(e.onKeyDown,s)}}function ek(e){var t;return uye(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function aye(e={},t=null){const n=f2();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");const{focusedIndex:r,setFocusedIndex:i,menuRef:o,isOpen:a,onClose:s,menuId:l,isLazy:u,lazyBehavior:d,unstable__animationState:p}=n,m=J1e(),y=_ve({preventDefault:_=>_.key!==" "&&ek(_.target)}),b=S.useCallback(_=>{const k=_.key,L={Tab:D=>D.preventDefault(),Escape:s,ArrowDown:()=>{const D=m.nextEnabled(r);D&&i(D.index)},ArrowUp:()=>{const D=m.prevEnabled(r);D&&i(D.index)}}[k];if(L){_.preventDefault(),L(_);return}const O=y(D=>{const I=kve(m.values(),D,N=>{var U,B;return(B=(U=N==null?void 0:N.node)==null?void 0:U.textContent)!=null?B:""},m.item(r));if(I){const N=m.indexOf(I.node);i(N)}});ek(_.target)&&O(_)},[m,r,y,s,i]),w=S.useRef(!1);a&&(w.current=!0);const E=B8({wasSelected:w.current,enabled:u,mode:d,isSelected:p.present});return{...e,ref:Rn(o,t),children:E?e.children:null,tabIndex:-1,role:"menu",id:l,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:ht(e.onKeyDown,b)}}function sye(e={}){const{popper:t,isOpen:n}=f2();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function lye(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onClick:o,onFocus:a,isDisabled:s,isFocusable:l,closeOnSelect:u,type:d,...p}=e,m=f2(),{setFocusedIndex:y,focusedIndex:b,closeOnSelect:w,onClose:E,menuRef:_,isOpen:k,menuId:T,rafId:L}=m,O=S.useRef(null),D=`${T}-menuitem-${S.useId()}`,{index:I,register:N}=tye({disabled:s&&!l}),U=S.useCallback(Q=>{n==null||n(Q),!s&&y(I)},[y,I,s,n]),B=S.useCallback(Q=>{r==null||r(Q),O.current&&!mO(O.current)&&U(Q)},[U,r]),K=S.useCallback(Q=>{i==null||i(Q),!s&&y(-1)},[y,s,i]),ne=S.useCallback(Q=>{o==null||o(Q),ek(Q.currentTarget)&&(u??w)&&E()},[E,o,w,u]),z=S.useCallback(Q=>{a==null||a(Q),y(I)},[y,a,I]),$=I===b,H=s&&!l;rc(()=>{k&&($&&!H&&O.current?(L.current&&cancelAnimationFrame(L.current),L.current=requestAnimationFrame(()=>{var Q;(Q=O.current)==null||Q.focus(),L.current=null})):_.current&&!mO(_.current)&&_.current.focus())},[$,H,_,k]);const Y=uH({onClick:ne,onFocus:z,onMouseEnter:U,onMouseMove:B,onMouseLeave:K,ref:Rn(N,O,t),isDisabled:s,isFocusable:l});return{...p,...Y,type:d??Y.type,id:D,role:"menuitem",tabIndex:$?0:-1}}function uye(e){var t;if(!cye(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function cye(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function dye(e,t=[]){return S.useEffect(()=>()=>e(),t)}var[fye,Bw]=Pn({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),CH=e=>{const{children:t}=e,n=Yi("Menu",e),r=fr(e),{direction:i}=Qy(),{descendants:o,...a}=iye({...r,direction:i}),s=S.useMemo(()=>a,[a]),{isOpen:l,onClose:u,forceUpdate:d}=s;return g.jsx(Q1e,{value:o,children:g.jsx(nye,{value:s,children:g.jsx(fye,{value:n,children:ts(t,{isOpen:l,onClose:u,forceUpdate:d})})})})};CH.displayName="Menu";var _H=Ze((e,t)=>{const n=Bw();return g.jsx(Ne.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});_H.displayName="MenuCommand";var hye=Ze((e,t)=>{const{type:n,...r}=e,i=Bw(),o=r.as||n?n??void 0:"button",a=S.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...i.item}),[i.item]);return g.jsx(Ne.button,{ref:t,type:o,...r,__css:a})}),kH=e=>{const{className:t,children:n,...r}=e,i=S.Children.only(n),o=S.isValidElement(i)?S.cloneElement(i,{focusable:"false","aria-hidden":!0,className:xt("chakra-menu__icon",i.props.className)}):null,a=xt("chakra-menu__icon-wrapper",t);return g.jsx(Ne.span,{className:a,...r,__css:{flexShrink:0},children:o})};kH.displayName="MenuIcon";var EH=Ze((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:i,commandSpacing:o="0.75rem",children:a,...s}=e,l=lye(s,t),d=n||i?g.jsx("span",{style:{pointerEvents:"none",flex:1},children:a}):a;return g.jsxs(hye,{...l,className:xt("chakra-menu__menuitem",l.className),children:[n&&g.jsx(kH,{fontSize:"0.8em",marginEnd:r,children:n}),d,i&&g.jsx(_H,{marginStart:o,children:i})]})});EH.displayName="MenuItem";var pye={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},gye=Ne(su.div),PH=Ze(function(t,n){var r,i;const{rootProps:o,motionProps:a,...s}=t,{isOpen:l,onTransitionEnd:u,unstable__animationState:d}=f2(),p=aye(s,n),m=sye(o),y=Bw();return g.jsx(Ne.div,{...m,__css:{zIndex:(i=t.zIndex)!=null?i:(r=y.list)==null?void 0:r.zIndex},children:g.jsx(gye,{variants:pye,initial:!1,animate:l?"enter":"exit",__css:{outline:0,...y.list},...a,className:xt("chakra-menu__menu-list",p.className),...p,onUpdate:u,onAnimationComplete:ww(d.onComplete,p.onAnimationComplete)})})});PH.displayName="MenuList";var mye=Ze((e,t)=>{const n=Bw();return g.jsx(Ne.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),TH=Ze((e,t)=>{const{children:n,as:r,...i}=e,o=oye(i,t),a=r||mye;return g.jsx(a,{...o,className:xt("chakra-menu__menu-button",e.className),children:g.jsx(Ne.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});TH.displayName="MenuButton";var vye={slideInBottom:{...H_,custom:{offsetY:16,reverse:!0}},slideInRight:{...H_,custom:{offsetX:16,reverse:!0}},scale:{...lz,custom:{initialScale:.95,reverse:!0}},none:{}},yye=Ne(su.section),bye=e=>vye[e||"none"],MH=S.forwardRef((e,t)=>{const{preset:n,motionProps:r=bye(n),...i}=e;return g.jsx(yye,{ref:t,...r,...i})});MH.displayName="ModalTransition";var xye=Object.defineProperty,Sye=(e,t,n)=>t in e?xye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wye=(e,t,n)=>(Sye(e,typeof t!="symbol"?t+"":t,n),n),Cye=class{constructor(){wye(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},tk=new Cye;function LH(e,t){const[n,r]=S.useState(0);return S.useEffect(()=>{const i=e.current;if(i){if(t){const o=tk.add(i);r(o)}return()=>{tk.remove(i),r(0)}}},[t,e]),n}var _ye=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wg=new WeakMap,qb=new WeakMap,Kb={},vC=0,AH=function(e){return e&&(e.host||AH(e.parentNode))},kye=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=AH(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},Eye=function(e,t,n,r){var i=kye(t,Array.isArray(e)?e:[e]);Kb[n]||(Kb[n]=new WeakMap);var o=Kb[n],a=[],s=new Set,l=new Set(i),u=function(p){!p||s.has(p)||(s.add(p),u(p.parentNode))};i.forEach(u);var d=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(m){if(s.has(m))d(m);else{var y=m.getAttribute(r),b=y!==null&&y!=="false",w=(wg.get(m)||0)+1,E=(o.get(m)||0)+1;wg.set(m,w),o.set(m,E),a.push(m),w===1&&b&&qb.set(m,!0),E===1&&m.setAttribute(n,"true"),b||m.setAttribute(r,"true")}})};return d(t),s.clear(),vC++,function(){a.forEach(function(p){var m=wg.get(p)-1,y=o.get(p)-1;wg.set(p,m),o.set(p,y),m||(qb.has(p)||p.removeAttribute(r),qb.delete(p)),y||p.removeAttribute(n)}),vC--,vC||(wg=new WeakMap,wg=new WeakMap,qb=new WeakMap,Kb={})}},OH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||_ye(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Eye(r,i,n,"aria-hidden")):function(){return null}};function Pye(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=S.useRef(null),d=S.useRef(null),[p,m,y]=Mye(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Tye(u,t&&a),LH(u,t);const b=S.useRef(null),w=S.useCallback(N=>{b.current=N.target},[]),E=S.useCallback(N=>{N.key==="Escape"&&(N.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[_,k]=S.useState(!1),[T,L]=S.useState(!1),O=S.useCallback((N={},U=null)=>({role:"dialog",...N,ref:Rn(U,u),id:p,tabIndex:-1,"aria-modal":!0,"aria-labelledby":_?m:void 0,"aria-describedby":T?y:void 0,onClick:ht(N.onClick,B=>B.stopPropagation())}),[y,T,p,m,_]),D=S.useCallback(N=>{N.stopPropagation(),b.current===N.target&&tk.isTopModal(u.current)&&(i&&(n==null||n()),s==null||s())},[n,i,s]),I=S.useCallback((N={},U=null)=>({...N,ref:Rn(U,d),onClick:ht(N.onClick,D),onKeyDown:ht(N.onKeyDown,E),onMouseDown:ht(N.onMouseDown,w)}),[E,w,D]);return{isOpen:t,onClose:n,headerId:m,bodyId:y,setBodyMounted:L,setHeaderMounted:k,dialogRef:u,overlayRef:d,getDialogProps:O,getDialogContainerProps:I}}function Tye(e,t){const n=e.current;S.useEffect(()=>{if(!(!e.current||!t))return OH(e.current)},[t,e,n])}function Mye(e,...t){const n=S.useId(),r=e||n;return S.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[Lye,p0]=Pn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Aye,Yh]=Pn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Yd=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:i,trapFocus:o,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:d,preserveScrollBarGap:p,motionPreset:m,lockFocusAcrossFrames:y,onCloseComplete:b}=t,w=Yi("Modal",t),_={...Pye(t),autoFocus:i,trapFocus:o,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:d,preserveScrollBarGap:p,motionPreset:m,lockFocusAcrossFrames:y};return g.jsx(Aye,{value:_,children:g.jsx(Lye,{value:w,children:g.jsx(rp,{onExitComplete:b,children:_.isOpen&&g.jsx(u0,{...n,children:r})})})})};Yd.displayName="Modal";var tS="right-scroll-bar-position",nS="width-before-scroll-bar",Oye="with-scroll-bars-hidden",Rye="--removed-body-scroll-bar-size",RH=wz(),yC=function(){},zw=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:yC,onWheelCapture:yC,onTouchMoveCapture:yC}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,m=e.sideCar,y=e.noIsolation,b=e.inert,w=e.allowPinchZoom,E=e.as,_=E===void 0?"div":E,k=ZB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),T=m,L=bz([n,t]),O=Nl(Nl({},k),i);return S.createElement(S.Fragment,null,d&&S.createElement(T,{sideCar:RH,removeScrollBar:u,shards:p,noIsolation:y,inert:b,setCallbacks:o,allowPinchZoom:!!w,lockRef:n}),a?S.cloneElement(S.Children.only(s),Nl(Nl({},O),{ref:L})):S.createElement(_,Nl({},O,{className:l,ref:L}),s))});zw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zw.classNames={fullWidth:nS,zeroRight:tS};var vO,Iye=function(){if(vO)return vO;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Dye(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Iye();return t&&e.setAttribute("nonce",t),e}function jye(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Nye(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $ye=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Dye())&&(jye(t,n),Nye(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Fye=function(){var e=$ye();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},IH=function(){var e=Fye(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Bye={left:0,top:0,right:0,gap:0},bC=function(e){return parseInt(e||"",10)||0},zye=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[bC(n),bC(r),bC(i)]},Hye=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Bye;var t=zye(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Wye=IH(),Uye=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(Oye,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; } @@ -402,12 +402,12 @@ Error generating stack: `+o.message+` } body { - `).concat(Oye,": ").concat(s,`px; + `).concat(Rye,": ").concat(s,`px; } -`)},Vye=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=S.useMemo(function(){return zye(i)},[i]);return S.createElement(Hye,{styles:Wye(o,!t,i,n?"":"!important")})},nk=!1;if(typeof window<"u")try{var Yb=Object.defineProperty({},"passive",{get:function(){return nk=!0,!0}});window.addEventListener("test",Yb,Yb),window.removeEventListener("test",Yb,Yb)}catch{nk=!1}var Cg=nk?{passive:!1}:!1,Uye=function(e){return e.tagName==="TEXTAREA"},IH=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Uye(e)&&n[t]==="visible")},Gye=function(e){return IH(e,"overflowY")},qye=function(e){return IH(e,"overflowX")},vO=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=DH(e,n);if(r){var i=jH(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Kye=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Yye=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},DH=function(e,t){return e==="v"?Gye(t):qye(t)},jH=function(e,t){return e==="v"?Kye(t):Yye(t)},Xye=function(e,t){return e==="h"&&t==="rtl"?-1:1},Zye=function(e,t,n,r,i){var o=Xye(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,d=a>0,p=0,m=0;do{var y=jH(e,s),b=y[0],w=y[1],E=y[2],_=w-E-o*b;(b||_)&&DH(e,s)&&(p+=_,m+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(i&&p===0||!i&&a>p)||!d&&(i&&m===0||!i&&-a>m))&&(u=!0),u},Xb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yO=function(e){return[e.deltaX,e.deltaY]},bO=function(e){return e&&"current"in e?e.current:e},Qye=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Jye=function(e){return` +`)},Vye=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=S.useMemo(function(){return Hye(i)},[i]);return S.createElement(Wye,{styles:Uye(o,!t,i,n?"":"!important")})},nk=!1;if(typeof window<"u")try{var Yb=Object.defineProperty({},"passive",{get:function(){return nk=!0,!0}});window.addEventListener("test",Yb,Yb),window.removeEventListener("test",Yb,Yb)}catch{nk=!1}var Cg=nk?{passive:!1}:!1,Gye=function(e){return e.tagName==="TEXTAREA"},DH=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Gye(e)&&n[t]==="visible")},qye=function(e){return DH(e,"overflowY")},Kye=function(e){return DH(e,"overflowX")},yO=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=jH(e,n);if(r){var i=NH(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Yye=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Xye=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},jH=function(e,t){return e==="v"?qye(t):Kye(t)},NH=function(e,t){return e==="v"?Yye(t):Xye(t)},Zye=function(e,t){return e==="h"&&t==="rtl"?-1:1},Qye=function(e,t,n,r,i){var o=Zye(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,d=a>0,p=0,m=0;do{var y=NH(e,s),b=y[0],w=y[1],E=y[2],_=w-E-o*b;(b||_)&&jH(e,s)&&(p+=_,m+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(i&&p===0||!i&&a>p)||!d&&(i&&m===0||!i&&-a>m))&&(u=!0),u},Xb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bO=function(e){return[e.deltaX,e.deltaY]},xO=function(e){return e&&"current"in e?e.current:e},Jye=function(e,t){return e[0]===t[0]&&e[1]===t[1]},e2e=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},e2e=0,_g=[];function t2e(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),i=S.useState(e2e++)[0],o=S.useState(function(){return RH()})[0],a=S.useRef(e);S.useEffect(function(){a.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=B_([e.lockRef.current],(e.shards||[]).map(bO),!0).filter(Boolean);return w.forEach(function(E){return E.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=S.useCallback(function(w,E){if("touches"in w&&w.touches.length===2)return!a.current.allowPinchZoom;var _=Xb(w),k=n.current,T="deltaX"in w?w.deltaX:k[0]-_[0],L="deltaY"in w?w.deltaY:k[1]-_[1],O,D=w.target,I=Math.abs(T)>Math.abs(L)?"h":"v";if("touches"in w&&I==="h"&&D.type==="range")return!1;var N=vO(I,D);if(!N)return!0;if(N?O=I:(O=I==="v"?"h":"v",N=vO(I,D)),!N)return!1;if(!r.current&&"changedTouches"in w&&(T||L)&&(r.current=O),!O)return!0;var V=r.current||O;return Zye(V,E,w,V==="h"?T:L,!0)},[]),l=S.useCallback(function(w){var E=w;if(!(!_g.length||_g[_g.length-1]!==o)){var _="deltaY"in E?yO(E):Xb(E),k=t.current.filter(function(O){return O.name===E.type&&O.target===E.target&&Qye(O.delta,_)})[0];if(k&&k.should){E.cancelable&&E.preventDefault();return}if(!k){var T=(a.current.shards||[]).map(bO).filter(Boolean).filter(function(O){return O.contains(E.target)}),L=T.length>0?s(E,T[0]):!a.current.noIsolation;L&&E.cancelable&&E.preventDefault()}}},[]),u=S.useCallback(function(w,E,_,k){var T={name:w,delta:E,target:_,should:k};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(L){return L!==T})},1)},[]),d=S.useCallback(function(w){n.current=Xb(w),r.current=void 0},[]),p=S.useCallback(function(w){u(w.type,yO(w),w.target,s(w,e.lockRef.current))},[]),m=S.useCallback(function(w){u(w.type,Xb(w),w.target,s(w,e.lockRef.current))},[]);S.useEffect(function(){return _g.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Cg),document.addEventListener("touchmove",l,Cg),document.addEventListener("touchstart",d,Cg),function(){_g=_g.filter(function(w){return w!==o}),document.removeEventListener("wheel",l,Cg),document.removeEventListener("touchmove",l,Cg),document.removeEventListener("touchstart",d,Cg)}},[]);var y=e.removeScrollBar,b=e.inert;return S.createElement(S.Fragment,null,b?S.createElement(o,{styles:Jye(i)}):null,y?S.createElement(Vye,{gapMode:"margin"}):null)}const n2e=o0e(OH,t2e);var NH=S.forwardRef(function(e,t){return S.createElement(zw,Nl({},e,{ref:t,sideCar:n2e}))});NH.classNames=zw.classNames;const $H=NH;function r2e(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:d,isOpen:p}=Yh(),[m,y]=IB();S.useEffect(()=>{!m&&y&&setTimeout(y)},[m,y]);const b=MH(r,p);return g.jsx(eH,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:d,children:g.jsx($H,{removeScrollBar:!u,allowPinchZoom:a,enabled:b===1&&o,forwardProps:!0,children:e.children})})}var Xd=Xe((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Yh(),u=s(a,t),d=l(i),p=xt("chakra-modal__content",n),m=p0(),y={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:w}=Yh();return g.jsx(r2e,{children:g.jsx($e.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:b,children:g.jsx(TH,{preset:w,motionProps:o,className:p,...u,__css:y,children:r})})})});Xd.displayName="ModalContent";function FH(e){const{leastDestructiveRef:t,...n}=e;return g.jsx(Yd,{...n,initialFocusRef:t})}var BH=Xe((e,t)=>g.jsx(Xd,{ref:t,role:"alertdialog",...e})),Hw=Xe((e,t)=>{const{className:n,...r}=e,i=xt("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...p0().footer};return g.jsx($e.footer,{ref:t,...r,__css:a,className:i})});Hw.displayName="ModalFooter";var op=Xe((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=Yh();S.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=xt("chakra-modal__header",n),l={flex:0,...p0().header};return g.jsx($e.header,{ref:t,className:a,id:i,...r,__css:l})});op.displayName="ModalHeader";var i2e=$e(su.div),oc=Xe((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=xt("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...p0().overlay},{motionPreset:u}=Yh(),p=i||(u==="none"?{}:az);return g.jsx(i2e,{...p,__css:l,ref:t,className:a,...o})});oc.displayName="ModalOverlay";var Xm=Xe((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=Yh();S.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=xt("chakra-modal__body",n),s=p0();return g.jsx($e.div,{ref:t,className:a,id:i,...r,__css:s.body})});Xm.displayName="ModalBody";var g0=Xe((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=Yh(),a=xt("chakra-modal__close-btn",r),s=p0();return g.jsx(s8,{ref:t,__css:s.closeButton,className:a,onClick:ht(n,l=>{l.stopPropagation(),o()}),...i})});g0.displayName="ModalCloseButton";var o2e=e=>g.jsx(Da,{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})}),a2e=e=>g.jsx(Da,{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"})});function xO(e,t,n,r){S.useEffect(()=>{var i;if(!e.current||!r)return;const o=(i=e.current.ownerDocument.defaultView)!=null?i:window,a=Array.isArray(t)?t:[t],s=new o.MutationObserver(l=>{for(const u of l)u.type==="attributes"&&u.attributeName&&a.includes(u.attributeName)&&n(u)});return s.observe(e.current,{attributes:!0,attributeFilter:a}),()=>s.disconnect()})}function s2e(e,t){const n=Qr(e);S.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var l2e=50,SO=300;function u2e(e,t){const[n,r]=S.useState(!1),[i,o]=S.useState(null),[a,s]=S.useState(!0),l=S.useRef(null),u=()=>clearTimeout(l.current);s2e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?l2e:null);const d=S.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},SO)},[e,a]),p=S.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},SO)},[t,a]),m=S.useCallback(()=>{s(!0),r(!1),u()},[]);return S.useEffect(()=>()=>u(),[]),{up:d,down:p,stop:m,isSpinning:n}}var c2e=/^[Ee0-9+\-.]$/;function d2e(e){return c2e.test(e)}function f2e(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function h2e(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:u,isInvalid:d,pattern:p="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:y,id:b,onChange:w,precision:E,name:_,"aria-describedby":k,"aria-label":T,"aria-labelledby":L,onFocus:O,onBlur:D,onInvalid:I,getAriaValueText:N,isValidCharacter:V,format:B,parse:K,...ne}=e,z=Qr(O),$=Qr(D),H=Qr(I),Y=Qr(V??d2e),Q=Qr(N),q=zme(e),{update:X,increment:ee,decrement:fe}=q,[Ee,we]=S.useState(!1),xe=!(s||l),Ae=S.useRef(null),Se=S.useRef(null),Qe=S.useRef(null),Ye=S.useRef(null),nt=S.useCallback(Me=>Me.split("").filter(Y).join(""),[Y]),vt=S.useCallback(Me=>{var Ct;return(Ct=K==null?void 0:K(Me))!=null?Ct:Me},[K]),Ce=S.useCallback(Me=>{var Ct;return((Ct=B==null?void 0:B(Me))!=null?Ct:Me).toString()},[B]);rc(()=>{(q.valueAsNumber>o||q.valueAsNumber{if(!Ae.current)return;if(Ae.current.value!=q.value){const Ct=vt(Ae.current.value);q.setValue(nt(Ct))}},[vt,nt]);const et=S.useCallback((Me=a)=>{xe&&ee(Me)},[ee,xe,a]),yt=S.useCallback((Me=a)=>{xe&&fe(Me)},[fe,xe,a]),ze=u2e(et,yt);xO(Qe,"disabled",ze.stop,ze.isSpinning),xO(Ye,"disabled",ze.stop,ze.isSpinning);const at=S.useCallback(Me=>{if(Me.nativeEvent.isComposing)return;const zt=vt(Me.currentTarget.value);X(nt(zt)),Se.current={start:Me.currentTarget.selectionStart,end:Me.currentTarget.selectionEnd}},[X,nt,vt]),jt=S.useCallback(Me=>{var Ct,zt,$n;z==null||z(Me),Se.current&&(Me.target.selectionStart=(zt=Se.current.start)!=null?zt:(Ct=Me.currentTarget.value)==null?void 0:Ct.length,Me.currentTarget.selectionEnd=($n=Se.current.end)!=null?$n:Me.currentTarget.selectionStart)},[z]),gt=S.useCallback(Me=>{if(Me.nativeEvent.isComposing)return;f2e(Me,Y)||Me.preventDefault();const Ct=Jt(Me)*a,zt=Me.key,Ge={ArrowUp:()=>et(Ct),ArrowDown:()=>yt(Ct),Home:()=>X(i),End:()=>X(o)}[zt];Ge&&(Me.preventDefault(),Ge(Me))},[Y,a,et,yt,X,i,o]),Jt=Me=>{let Ct=1;return(Me.metaKey||Me.ctrlKey)&&(Ct=.1),Me.shiftKey&&(Ct=10),Ct},on=S.useMemo(()=>{const Me=Q==null?void 0:Q(q.value);if(Me!=null)return Me;const Ct=q.value.toString();return Ct||void 0},[q.value,Q]),se=S.useCallback(()=>{let Me=q.value;if(q.value==="")return;/^[eE]/.test(q.value.toString())?q.setValue(""):(q.valueAsNumbero&&(Me=o),q.cast(Me))},[q,o,i]),Ie=S.useCallback(()=>{we(!1),n&&se()},[n,we,se]),Ne=S.useCallback(()=>{t&&requestAnimationFrame(()=>{var Me;(Me=Ae.current)==null||Me.focus()})},[t]),Ue=S.useCallback(Me=>{Me.preventDefault(),ze.up(),Ne()},[Ne,ze]),be=S.useCallback(Me=>{Me.preventDefault(),ze.down(),Ne()},[Ne,ze]);Dh(()=>Ae.current,"wheel",Me=>{var Ct,zt;const Ge=((zt=(Ct=Ae.current)==null?void 0:Ct.ownerDocument)!=null?zt:document).activeElement===Ae.current;if(!y||!Ge)return;Me.preventDefault();const pt=Jt(Me)*a,zr=Math.sign(Me.deltaY);zr===-1?et(pt):zr===1&&yt(pt)},{passive:!1});const je=S.useCallback((Me={},Ct=null)=>{const zt=l||r&&q.isAtMax;return{...Me,ref:Rn(Ct,Qe),role:"button",tabIndex:-1,onPointerDown:ht(Me.onPointerDown,$n=>{$n.button!==0||zt||Ue($n)}),onPointerLeave:ht(Me.onPointerLeave,ze.stop),onPointerUp:ht(Me.onPointerUp,ze.stop),disabled:zt,"aria-disabled":Vu(zt)}},[q.isAtMax,r,Ue,ze.stop,l]),bt=S.useCallback((Me={},Ct=null)=>{const zt=l||r&&q.isAtMin;return{...Me,ref:Rn(Ct,Ye),role:"button",tabIndex:-1,onPointerDown:ht(Me.onPointerDown,$n=>{$n.button!==0||zt||be($n)}),onPointerLeave:ht(Me.onPointerLeave,ze.stop),onPointerUp:ht(Me.onPointerUp,ze.stop),disabled:zt,"aria-disabled":Vu(zt)}},[q.isAtMin,r,be,ze.stop,l]),Dt=S.useCallback((Me={},Ct=null)=>{var zt,$n,Ge,pt;return{name:_,inputMode:m,type:"text",pattern:p,"aria-labelledby":L,"aria-label":T,"aria-describedby":k,id:b,disabled:l,...Me,readOnly:(zt=Me.readOnly)!=null?zt:s,"aria-readonly":($n=Me.readOnly)!=null?$n:s,"aria-required":(Ge=Me.required)!=null?Ge:u,required:(pt=Me.required)!=null?pt:u,ref:Rn(Ae,Ct),value:Ce(q.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(q.valueAsNumber)?void 0:q.valueAsNumber,"aria-invalid":Vu(d??q.isOutOfRange),"aria-valuetext":on,autoComplete:"off",autoCorrect:"off",onChange:ht(Me.onChange,at),onKeyDown:ht(Me.onKeyDown,gt),onFocus:ht(Me.onFocus,jt,()=>we(!0)),onBlur:ht(Me.onBlur,$,Ie)}},[_,m,p,L,T,Ce,k,b,l,u,s,d,q.value,q.valueAsNumber,q.isOutOfRange,i,o,on,at,gt,jt,$,Ie]);return{value:Ce(q.value),valueAsNumber:q.valueAsNumber,isFocused:Ee,isDisabled:l,isReadOnly:s,getIncrementButtonProps:je,getDecrementButtonProps:bt,getInputProps:Dt,htmlProps:ne}}var[p2e,Ww]=Pn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[g2e,z8]=Pn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),H8=Xe(function(t,n){const r=Yi("NumberInput",t),i=fr(t),o=g8(i),{htmlProps:a,...s}=h2e(o),l=S.useMemo(()=>s,[s]);return g.jsx(g2e,{value:l,children:g.jsx(p2e,{value:r,children:g.jsx($e.div,{...a,ref:n,className:xt("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});H8.displayName="NumberInput";var zH=Xe(function(t,n){const r=Ww();return g.jsx($e.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});zH.displayName="NumberInputStepper";var W8=Xe(function(t,n){const{getInputProps:r}=z8(),i=r(t,n),o=Ww();return g.jsx($e.input,{...i,className:xt("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});W8.displayName="NumberInputField";var HH=$e("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),V8=Xe(function(t,n){var r;const i=Ww(),{getDecrementButtonProps:o}=z8(),a=o(t,n);return g.jsx(HH,{...a,__css:i.stepper,children:(r=t.children)!=null?r:g.jsx(o2e,{})})});V8.displayName="NumberDecrementStepper";var U8=Xe(function(t,n){var r;const{getIncrementButtonProps:i}=z8(),o=i(t,n),a=Ww();return g.jsx(HH,{...o,__css:a.stepper,children:(r=t.children)!=null?r:g.jsx(a2e,{})})});U8.displayName="NumberIncrementStepper";var[m2e,Vw]=Pn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[v2e,WH]=Pn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `});function G8(e){const t=S.Children.only(e.children),{getTriggerProps:n}=Vw();return S.cloneElement(t,n(t.props,t.ref))}G8.displayName="PopoverTrigger";var kg={click:"click",hover:"hover"};function y2e(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=kg.click,openDelay:d=200,closeDelay:p=200,isLazy:m,lazyBehavior:y="unmount",computePositionOnMount:b,...w}=e,{isOpen:E,onClose:_,onOpen:k,onToggle:T}=F8(e),L=S.useRef(null),O=S.useRef(null),D=S.useRef(null),I=S.useRef(!1),N=S.useRef(!1);E&&(N.current=!0);const[V,B]=S.useState(!1),[K,ne]=S.useState(!1),z=S.useId(),$=i??z,[H,Y,Q,q]=["popover-trigger","popover-content","popover-header","popover-body"].map(at=>`${at}-${$}`),{referenceRef:X,getArrowProps:ee,getPopperProps:fe,getArrowInnerProps:Ee,forceUpdate:we}=$8({...w,enabled:E||!!b}),xe=xH({isOpen:E,ref:D});Kme({enabled:E,ref:O}),uH(D,{focusRef:O,visible:E,shouldFocus:o&&u===kg.click}),Tve(D,{focusRef:r,visible:E,shouldFocus:a&&u===kg.click});const Ae=B8({wasSelected:N.current,enabled:m,mode:y,isSelected:xe.present}),Se=S.useCallback((at={},jt=null)=>{const gt={...at,style:{...at.style,transformOrigin:ii.transformOrigin.varRef,[ii.arrowSize.var]:s?`${s}px`:void 0,[ii.arrowShadowColor.var]:l},ref:Rn(D,jt),children:Ae?at.children:null,id:Y,tabIndex:-1,role:"dialog",onKeyDown:ht(at.onKeyDown,Jt=>{n&&Jt.key==="Escape"&&_()}),onBlur:ht(at.onBlur,Jt=>{const on=wO(Jt),se=xC(D.current,on),Ie=xC(O.current,on);E&&t&&(!se&&!Ie)&&_()}),"aria-labelledby":V?Q:void 0,"aria-describedby":K?q:void 0};return u===kg.hover&&(gt.role="tooltip",gt.onMouseEnter=ht(at.onMouseEnter,()=>{I.current=!0}),gt.onMouseLeave=ht(at.onMouseLeave,Jt=>{Jt.nativeEvent.relatedTarget!==null&&(I.current=!1,setTimeout(()=>_(),p))})),gt},[Ae,Y,V,Q,K,q,u,n,_,E,t,p,l,s]),Qe=S.useCallback((at={},jt=null)=>fe({...at,style:{visibility:E?"visible":"hidden",...at.style}},jt),[E,fe]),Ye=S.useCallback((at,jt=null)=>({...at,ref:Rn(jt,L,X)}),[L,X]),nt=S.useRef(),vt=S.useRef(),Ce=S.useCallback(at=>{L.current==null&&X(at)},[X]),et=S.useCallback((at={},jt=null)=>{const gt={...at,ref:Rn(O,jt,Ce),id:H,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":Y};return u===kg.click&&(gt.onClick=ht(at.onClick,T)),u===kg.hover&&(gt.onFocus=ht(at.onFocus,()=>{nt.current===void 0&&k()}),gt.onBlur=ht(at.onBlur,Jt=>{const on=wO(Jt),se=!xC(D.current,on);E&&t&&se&&_()}),gt.onKeyDown=ht(at.onKeyDown,Jt=>{Jt.key==="Escape"&&_()}),gt.onMouseEnter=ht(at.onMouseEnter,()=>{I.current=!0,nt.current=window.setTimeout(()=>k(),d)}),gt.onMouseLeave=ht(at.onMouseLeave,()=>{I.current=!1,nt.current&&(clearTimeout(nt.current),nt.current=void 0),vt.current=window.setTimeout(()=>{I.current===!1&&_()},p)})),gt},[H,E,Y,u,Ce,T,k,t,_,d,p]);S.useEffect(()=>()=>{nt.current&&clearTimeout(nt.current),vt.current&&clearTimeout(vt.current)},[]);const yt=S.useCallback((at={},jt=null)=>({...at,id:Q,ref:Rn(jt,gt=>{B(!!gt)})}),[Q]),ze=S.useCallback((at={},jt=null)=>({...at,id:q,ref:Rn(jt,gt=>{ne(!!gt)})}),[q]);return{forceUpdate:we,isOpen:E,onAnimationComplete:xe.onComplete,onClose:_,getAnchorProps:Ye,getArrowProps:ee,getArrowInnerProps:Ee,getPopoverPositionerProps:Qe,getPopoverProps:Se,getTriggerProps:et,getHeaderProps:yt,getBodyProps:ze}}function xC(e,t){return e===t||(e==null?void 0:e.contains(t))}function wO(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function q8(e){const t=Yi("Popover",e),{children:n,...r}=fr(e),i=Qy(),o=y2e({...r,direction:i.direction});return g.jsx(m2e,{value:o,children:g.jsx(v2e,{value:t,children:ts(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})})})}q8.displayName="Popover";function K8(e){var t;const{bg:n,bgColor:r,backgroundColor:i,shadow:o,boxShadow:a}=e,{getArrowProps:s,getArrowInnerProps:l}=Vw(),u=WH(),d=(t=n??r)!=null?t:i,p=o??a;return g.jsx($e.div,{...s(),className:"chakra-popover__arrow-positioner",children:g.jsx($e.div,{className:xt("chakra-popover__arrow",e.className),...l(e),__css:{"--popper-arrow-bg":d?`colors.${d}, ${d}`:void 0,"--popper-arrow-shadow":p?`shadows.${p}, ${p}`:void 0,...u.arrow}})})}K8.displayName="PopoverArrow";function b2e(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var x2e={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},S2e=$e(su.section),VH=Xe(function(t,n){const{variants:r=x2e,...i}=t,{isOpen:o}=Vw();return g.jsx(S2e,{ref:n,variants:b2e(r),initial:!1,animate:o?"enter":"exit",...i})});VH.displayName="PopoverTransition";var Y8=Xe(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=Vw(),u=WH(),d={position:"relative",display:"flex",flexDirection:"column",...u.content};return g.jsx($e.div,{...s(r),__css:u.popper,className:"chakra-popover__popper",children:g.jsx(VH,{...i,...a(o,n),onAnimationComplete:ww(l,o.onAnimationComplete),className:xt("chakra-popover__content",t.className),__css:d})})});Y8.displayName="PopoverContent";function w2e(e,t,n){return(e-t)*100/(n-t)}nf({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});nf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var C2e=nf({"0%":{left:"-40%"},"100%":{left:"100%"}}),_2e=nf({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function k2e(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=w2e(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof o=="function"?o(t,l):i})(),role:s},percent:l,value:t}}var[E2e,P2e]=Pn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),T2e=Xe((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=k2e({value:i,min:n,max:r,isIndeterminate:o,role:a}),d={height:"100%",...P2e().filledTrack};return g.jsx($e.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:d})}),UH=Xe((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:d,"aria-label":p,"aria-labelledby":m,"aria-valuetext":y,title:b,role:w,...E}=fr(e),_=Yi("Progress",e),k=u??((n=_.track)==null?void 0:n.borderRadius),T={animation:`${_2e} 1s linear infinite`},D={...!d&&a&&s&&T,...d&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${C2e} 1s ease infinite normal none running`}},I={overflow:"hidden",position:"relative",..._.track};return g.jsx($e.div,{ref:t,borderRadius:k,__css:I,...E,children:g.jsxs(E2e,{value:_,children:[g.jsx(T2e,{"aria-label":p,"aria-labelledby":m,"aria-valuetext":y,min:i,max:o,value:r,isIndeterminate:d,css:D,borderRadius:k,title:b,role:w}),l]})})});UH.displayName="Progress";function M2e(e){return e&&ko(e)&&ko(e.target)}function L2e(e={}){const{onChange:t,value:n,defaultValue:r,name:i,isDisabled:o,isFocusable:a,isNative:s,...l}=e,[u,d]=S.useState(r||""),p=typeof n<"u",m=p?n:u,y=S.useRef(null),b=S.useCallback(()=>{const O=y.current;if(!O)return;let D="input:not(:disabled):checked";const I=O.querySelector(D);if(I){I.focus();return}D="input:not(:disabled)";const N=O.querySelector(D);N==null||N.focus()},[]),E=`radio-${S.useId()}`,_=i||E,k=S.useCallback(O=>{const D=M2e(O)?O.target.value:O;p||d(D),t==null||t(String(D))},[t,p]),T=S.useCallback((O={},D=null)=>({...O,ref:Rn(D,y),role:"radiogroup"}),[]),L=S.useCallback((O={},D=null)=>({...O,ref:D,name:_,[s?"checked":"isChecked"]:m!=null?O.value===m:void 0,onChange(N){k(N)},"data-radiogroup":!0}),[s,_,k,m]);return{getRootProps:T,getRadioProps:L,name:_,ref:y,focus:b,setValue:d,value:m,onChange:k,isDisabled:o,isFocusable:a,htmlProps:l}}var[A2e,GH]=Pn({name:"RadioGroupContext",strict:!1}),Oy=Xe((e,t)=>{const{colorScheme:n,size:r,variant:i,children:o,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:d,onChange:p,getRootProps:m,name:y,htmlProps:b}=L2e(u),w=S.useMemo(()=>({name:y,size:r,onChange:p,colorScheme:n,value:d,variant:i,isDisabled:s,isFocusable:l}),[y,r,p,n,d,i,s,l]);return g.jsx(A2e,{value:w,children:g.jsx($e.div,{...m(b,t),className:xt("chakra-radio-group",a),children:o})})});Oy.displayName="RadioGroup";var O2e={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function R2e(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:i,isReadOnly:o,isRequired:a,onChange:s,isInvalid:l,name:u,value:d,id:p,"data-radiogroup":m,"aria-describedby":y,...b}=e,w=`radio-${S.useId()}`,E=ip(),k=!!GH()||!!m;let L=!!E&&!k?E.id:w;L=p??L;const O=i??(E==null?void 0:E.isDisabled),D=o??(E==null?void 0:E.isReadOnly),I=a??(E==null?void 0:E.isRequired),N=l??(E==null?void 0:E.isInvalid),[V,B]=S.useState(!1),[K,ne]=S.useState(!1),[z,$]=S.useState(!1),[H,Y]=S.useState(!1),[Q,q]=S.useState(Boolean(t)),X=typeof n<"u",ee=X?n:Q;S.useEffect(()=>cz(B),[]);const fe=S.useCallback(Ce=>{if(D||O){Ce.preventDefault();return}X||q(Ce.target.checked),s==null||s(Ce)},[X,O,D,s]),Ee=S.useCallback(Ce=>{Ce.key===" "&&Y(!0)},[Y]),we=S.useCallback(Ce=>{Ce.key===" "&&Y(!1)},[Y]),xe=S.useCallback((Ce={},et=null)=>({...Ce,ref:et,"data-active":Bt(H),"data-hover":Bt(z),"data-disabled":Bt(O),"data-invalid":Bt(N),"data-checked":Bt(ee),"data-focus":Bt(K),"data-focus-visible":Bt(K&&V),"data-readonly":Bt(D),"aria-hidden":!0,onMouseDown:ht(Ce.onMouseDown,()=>Y(!0)),onMouseUp:ht(Ce.onMouseUp,()=>Y(!1)),onMouseEnter:ht(Ce.onMouseEnter,()=>$(!0)),onMouseLeave:ht(Ce.onMouseLeave,()=>$(!1))}),[H,z,O,N,ee,K,D,V]),{onFocus:Ae,onBlur:Se}=E??{},Qe=S.useCallback((Ce={},et=null)=>{const yt=O&&!r;return{...Ce,id:L,ref:et,type:"radio",name:u,value:d,onChange:ht(Ce.onChange,fe),onBlur:ht(Se,Ce.onBlur,()=>ne(!1)),onFocus:ht(Ae,Ce.onFocus,()=>ne(!0)),onKeyDown:ht(Ce.onKeyDown,Ee),onKeyUp:ht(Ce.onKeyUp,we),checked:ee,disabled:yt,readOnly:D,required:I,"aria-invalid":Vu(N),"aria-disabled":Vu(yt),"aria-required":Vu(I),"data-readonly":Bt(D),"aria-describedby":y,style:O2e}},[O,r,L,u,d,fe,Se,Ae,Ee,we,ee,D,I,N,y]);return{state:{isInvalid:N,isFocused:K,isChecked:ee,isActive:H,isHovered:z,isDisabled:O,isReadOnly:D,isRequired:I},getCheckboxProps:xe,getInputProps:Qe,getLabelProps:(Ce={},et=null)=>({...Ce,ref:et,onMouseDown:ht(Ce.onMouseDown,CO),onTouchStart:ht(Ce.onTouchStart,CO),"data-disabled":Bt(O),"data-checked":Bt(ee),"data-invalid":Bt(N)}),getRootProps:(Ce,et=null)=>({...Ce,ref:et,"data-disabled":Bt(O),"data-checked":Bt(ee),"data-invalid":Bt(N)}),htmlProps:b}}function CO(e){e.preventDefault(),e.stopPropagation()}function I2e(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var Uo=Xe((e,t)=>{var n;const r=GH(),{onChange:i,value:o}=e,a=Yi("Radio",{...r,...e}),s=fr(e),{spacing:l="0.5rem",children:u,isDisabled:d=r==null?void 0:r.isDisabled,isFocusable:p=r==null?void 0:r.isFocusable,inputProps:m,...y}=s;let b=e.isChecked;(r==null?void 0:r.value)!=null&&o!=null&&(b=r.value===o);let w=i;r!=null&&r.onChange&&o!=null&&(w=ww(r.onChange,i));const E=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:_,getCheckboxProps:k,getLabelProps:T,getRootProps:L,htmlProps:O}=R2e({...y,isChecked:b,isFocusable:p,isDisabled:d,onChange:w,name:E}),[D,I]=I2e(O,uF),N=k(I),V=_(m,t),B=T(),K=Object.assign({},D,L()),ne={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...a.container},z={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...a.control},$={userSelect:"none",marginStart:l,...a.label};return g.jsxs($e.label,{className:"chakra-radio",...K,__css:ne,children:[g.jsx("input",{className:"chakra-radio__input",...V}),g.jsx($e.span,{className:"chakra-radio__control",...N,__css:z}),u&&g.jsx($e.span,{className:"chakra-radio__label",...B,__css:$,children:u})]})});Uo.displayName="Radio";var qH=Xe(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return g.jsxs($e.select,{...a,ref:n,className:xt("chakra-select",o),children:[i&&g.jsx("option",{value:"",children:i}),r]})});qH.displayName="SelectField";function D2e(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var KH=Xe((e,t)=>{var n;const r=Yi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:d,minHeight:p,iconColor:m,iconSize:y,...b}=fr(e),[w,E]=D2e(b,uF),_=p8(E),k={width:"100%",height:"fit-content",position:"relative",color:s},T={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return g.jsxs($e.div,{className:"chakra-select__wrapper",__css:k,...w,...i,children:[g.jsx(qH,{ref:t,height:u??l,minH:d??p,placeholder:o,..._,__css:T,children:e.children}),g.jsx(YH,{"data-disabled":Bt(_.disabled),...(m||s)&&{color:m||s},__css:r.icon,...y&&{fontSize:y},children:a})]})});KH.displayName="Select";var j2e=e=>g.jsx("svg",{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),N2e=$e("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),YH=e=>{const{children:t=g.jsx(j2e,{}),...n}=e,r=S.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return g.jsx(N2e,{...n,className:"chakra-select__icon-wrapper",children:S.isValidElement(t)?r:null})};YH.displayName="SelectIcon";var Eg=e=>e?"":void 0,SC=e=>e?!0:void 0,h2=(...e)=>e.filter(Boolean).join(" ");function wC(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Zb(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var rS={width:0,height:0},Qb=e=>e||rS;function $2e(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=w=>{var E;const _=(E=r[w])!=null?E:rS;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Zb({orientation:t,vertical:{bottom:`calc(${n[w]}% - ${_.height/2}px)`},horizontal:{left:`calc(${n[w]}% - ${_.width/2}px)`}})}},a=t==="vertical"?r.reduce((w,E)=>Qb(w).height>Qb(E).height?w:E,rS):r.reduce((w,E)=>Qb(w).width>Qb(E).width?w:E,rS),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Zb({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Zb({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,d=[0,i?100-n[0]:n[0]],p=u?d:n;let m=p[0];!u&&i&&(m=100-m);const y=Math.abs(p[p.length-1]-p[0]),b={...l,...Zb({orientation:t,vertical:i?{height:`${y}%`,top:`${m}%`}:{height:`${y}%`,bottom:`${m}%`},horizontal:i?{width:`${y}%`,right:`${m}%`}:{width:`${y}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function F2e(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function B2e(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function z2e(e){const t=W2e(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function XH(e){return!!e.touches}function H2e(e){return XH(e)&&e.touches.length>1}function W2e(e){var t;return(t=e.view)!=null?t:window}function V2e(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function U2e(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function ZH(e,t="page"){return XH(e)?V2e(e,t):U2e(e,t)}function G2e(e){return t=>{const n=z2e(t);(!n||n&&t.button===0)&&e(t)}}function q2e(e,t=!1){function n(i){e(i,{point:ZH(i)})}return t?G2e(n):n}function iS(e,t,n,r){return B2e(e,t,q2e(n,t==="pointerdown"),r)}var K2e=Object.defineProperty,Y2e=(e,t,n)=>t in e?K2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$s=(e,t,n)=>(Y2e(e,typeof t!="symbol"?t+"":t,n),n),X2e=class{constructor(e,t,n){$s(this,"history",[]),$s(this,"startEvent",null),$s(this,"lastEvent",null),$s(this,"lastEventInfo",null),$s(this,"handlers",{}),$s(this,"removeListeners",()=>{}),$s(this,"threshold",3),$s(this,"win"),$s(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const s=CC(this.lastEventInfo,this.history),l=this.startEvent!==null,u=ebe(s.offset,{x:0,y:0})>=this.threshold;if(!l&&!u)return;const{timestamp:d}=EL();this.history.push({...s.point,timestamp:d});const{onStart:p,onMove:m}=this.handlers;l||(p==null||p(this.lastEvent,s),this.startEvent=this.lastEvent),m==null||m(this.lastEvent,s)}),$s(this,"onPointerMove",(s,l)=>{this.lastEvent=s,this.lastEventInfo=l,bce.update(this.updatePoint,!0)}),$s(this,"onPointerUp",(s,l)=>{const u=CC(l,this.history),{onEnd:d,onSessionEnd:p}=this.handlers;p==null||p(s,u),this.end(),!(!d||!this.startEvent)&&(d==null||d(s,u))});var r;if(this.win=(r=e.view)!=null?r:window,H2e(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const i={point:ZH(e)},{timestamp:o}=EL();this.history=[{...i.point,timestamp:o}];const{onSessionStart:a}=t;a==null||a(e,CC(i,this.history)),this.removeListeners=J2e(iS(this.win,"pointermove",this.onPointerMove),iS(this.win,"pointerup",this.onPointerUp),iS(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),xce.update(this.updatePoint)}};function _O(e,t){return{x:e.x-t.x,y:e.y-t.y}}function CC(e,t){return{point:e.point,delta:_O(e.point,t[t.length-1]),offset:_O(e.point,t[0]),velocity:Q2e(t,.1)}}var Z2e=e=>e*1e3;function Q2e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Z2e(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function J2e(...e){return t=>e.reduce((n,r)=>r(n),t)}function _C(e,t){return Math.abs(e-t)}function kO(e){return"x"in e&&"y"in e}function ebe(e,t){if(typeof e=="number"&&typeof t=="number")return _C(e,t);if(kO(e)&&kO(t)){const n=_C(e.x,t.x),r=_C(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function QH(e){const t=S.useRef(null);return t.current=e,t}function tbe(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=S.useRef(null),d=QH({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(p,m){u.current=null,i==null||i(p,m)}});S.useEffect(()=>{var p;(p=u.current)==null||p.updateHandlers(d.current)}),S.useEffect(()=>{const p=e.current;if(!p||!l)return;function m(y){u.current=new X2e(y,d.current,s)}return iS(p,"pointerdown",m)},[e,l,d,s]),S.useEffect(()=>()=>{var p;(p=u.current)==null||p.end(),u.current=null},[])}function nbe(e,t){var n;if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const r=(n=e.ownerDocument.defaultView)!=null?n:window,i=new r.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[a]=o;let s,l;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;t({width:s,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}var rbe=Boolean(globalThis==null?void 0:globalThis.document)?S.useLayoutEffect:S.useEffect;function ibe(e,t){var n,r;if(!e||!e.parentElement)return;const i=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window,o=new i.MutationObserver(()=>{t()});return o.observe(e.parentElement,{childList:!0}),()=>{o.disconnect()}}function obe({getNodes:e,observeMutation:t=!0}){const[n,r]=S.useState([]),[i,o]=S.useState(0);return rbe(()=>{const a=e(),s=a.map((l,u)=>nbe(l,d=>{r(p=>[...p.slice(0,u),d,...p.slice(u+1)])}));if(t){const l=a[0];s.push(ibe(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function abe(e){return typeof e=="object"&&e!==null&&"current"in e}function sbe(e){const[t]=obe({observeMutation:!1,getNodes(){return[abe(e)?e.current:e]}});return t}function lbe(e){var t;const{min:n=0,max:r=100,onChange:i,value:o,defaultValue:a,isReversed:s,direction:l="ltr",orientation:u="horizontal",id:d,isDisabled:p,isReadOnly:m,onChangeStart:y,onChangeEnd:b,step:w=1,getAriaValueText:E,"aria-valuetext":_,"aria-label":k,"aria-labelledby":T,name:L,focusThumbOnChange:O=!0,...D}=e,I=Qr(y),N=Qr(b),V=Qr(E),B=F2e({isReversed:s,direction:l,orientation:u}),[K,ne]=c8({value:o,defaultValue:a??cbe(n,r),onChange:i}),[z,$]=S.useState(!1),[H,Y]=S.useState(!1),Q=!(p||m),q=(r-n)/10,X=w||(r-n)/100,ee=Jx(K,n,r),fe=r-ee+n,we=qA(B?fe:ee,n,r),xe=u==="vertical",Ae=QH({min:n,max:r,step:w,isDisabled:p,value:ee,isInteractive:Q,isReversed:B,isVertical:xe,eventSource:null,focusThumbOnChange:O,orientation:u}),Se=S.useRef(null),Qe=S.useRef(null),Ye=S.useRef(null),nt=S.useId(),vt=d??nt,[Ce,et]=[`slider-thumb-${vt}`,`slider-track-${vt}`],yt=S.useCallback(Ge=>{var pt,zr;if(!Se.current)return;const rr=Ae.current;rr.eventSource="pointer";const Bn=Se.current.getBoundingClientRect(),{clientX:li,clientY:vs}=(zr=(pt=Ge.touches)==null?void 0:pt[0])!=null?zr:Ge,tl=xe?Bn.bottom-vs:li-Bn.left,gf=xe?Bn.height:Bn.width;let ys=tl/gf;B&&(ys=1-ys);let Xi=Bme(ys,rr.min,rr.max);return rr.step&&(Xi=parseFloat(KA(Xi,rr.min,rr.step))),Xi=Jx(Xi,rr.min,rr.max),Xi},[xe,B,Ae]),ze=S.useCallback(Ge=>{const pt=Ae.current;pt.isInteractive&&(Ge=parseFloat(KA(Ge,pt.min,X)),Ge=Jx(Ge,pt.min,pt.max),ne(Ge))},[X,ne,Ae]),at=S.useMemo(()=>({stepUp(Ge=X){const pt=B?ee-Ge:ee+Ge;ze(pt)},stepDown(Ge=X){const pt=B?ee+Ge:ee-Ge;ze(pt)},reset(){ze(a||0)},stepTo(Ge){ze(Ge)}}),[ze,B,ee,X,a]),jt=S.useCallback(Ge=>{const pt=Ae.current,rr={ArrowRight:()=>at.stepUp(),ArrowUp:()=>at.stepUp(),ArrowLeft:()=>at.stepDown(),ArrowDown:()=>at.stepDown(),PageUp:()=>at.stepUp(q),PageDown:()=>at.stepDown(q),Home:()=>ze(pt.min),End:()=>ze(pt.max)}[Ge.key];rr&&(Ge.preventDefault(),Ge.stopPropagation(),rr(Ge),pt.eventSource="keyboard")},[at,ze,q,Ae]),gt=(t=V==null?void 0:V(ee))!=null?t:_,Jt=sbe(Qe),{getThumbStyle:on,rootStyle:se,trackStyle:Ie,innerTrackStyle:Ne}=S.useMemo(()=>{const Ge=Ae.current,pt=Jt??{width:0,height:0};return $2e({isReversed:B,orientation:Ge.orientation,thumbRects:[pt],thumbPercents:[we]})},[B,Jt,we,Ae]),Ue=S.useCallback(()=>{Ae.current.focusThumbOnChange&&setTimeout(()=>{var pt;return(pt=Qe.current)==null?void 0:pt.focus()})},[Ae]);rc(()=>{const Ge=Ae.current;Ue(),Ge.eventSource==="keyboard"&&(N==null||N(Ge.value))},[ee,N]);function be(Ge){const pt=yt(Ge);pt!=null&&pt!==Ae.current.value&&ne(pt)}tbe(Ye,{onPanSessionStart(Ge){const pt=Ae.current;pt.isInteractive&&($(!0),Ue(),be(Ge),I==null||I(pt.value))},onPanSessionEnd(){const Ge=Ae.current;Ge.isInteractive&&($(!1),N==null||N(Ge.value))},onPan(Ge){Ae.current.isInteractive&&be(Ge)}});const je=S.useCallback((Ge={},pt=null)=>({...Ge,...D,ref:Rn(pt,Ye),tabIndex:-1,"aria-disabled":SC(p),"data-focused":Eg(H),style:{...Ge.style,...se}}),[D,p,H,se]),bt=S.useCallback((Ge={},pt=null)=>({...Ge,ref:Rn(pt,Se),id:et,"data-disabled":Eg(p),style:{...Ge.style,...Ie}}),[p,et,Ie]),Dt=S.useCallback((Ge={},pt=null)=>({...Ge,ref:pt,style:{...Ge.style,...Ne}}),[Ne]),Me=S.useCallback((Ge={},pt=null)=>({...Ge,ref:Rn(pt,Qe),role:"slider",tabIndex:Q?0:void 0,id:Ce,"data-active":Eg(z),"aria-valuetext":gt,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":ee,"aria-orientation":u,"aria-disabled":SC(p),"aria-readonly":SC(m),"aria-label":k,"aria-labelledby":k?void 0:T,style:{...Ge.style,...on(0)},onKeyDown:wC(Ge.onKeyDown,jt),onFocus:wC(Ge.onFocus,()=>Y(!0)),onBlur:wC(Ge.onBlur,()=>Y(!1))}),[Q,Ce,z,gt,n,r,ee,u,p,m,k,T,on,jt]),Ct=S.useCallback((Ge,pt=null)=>{const zr=!(Ge.valuer),rr=ee>=Ge.value,Bn=qA(Ge.value,n,r),li={position:"absolute",pointerEvents:"none",...ube({orientation:u,vertical:{bottom:B?`${100-Bn}%`:`${Bn}%`},horizontal:{left:B?`${100-Bn}%`:`${Bn}%`}})};return{...Ge,ref:pt,role:"presentation","aria-hidden":!0,"data-disabled":Eg(p),"data-invalid":Eg(!zr),"data-highlighted":Eg(rr),style:{...Ge.style,...li}}},[p,B,r,n,u,ee]),zt=S.useCallback((Ge={},pt=null)=>({...Ge,ref:pt,type:"hidden",value:ee,name:L}),[L,ee]);return{state:{value:ee,isFocused:H,isDragging:z},actions:at,getRootProps:je,getTrackProps:bt,getInnerTrackProps:Dt,getThumbProps:Me,getMarkerProps:Ct,getInputProps:zt}}function ube(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function cbe(e,t){return t"}),[fbe,Gw]=Pn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),JH=Xe((e,t)=>{const n={orientation:"horizontal",...e},r=Yi("Slider",n),i=fr(n),{direction:o}=Qy();i.direction=o;const{getInputProps:a,getRootProps:s,...l}=lbe(i),u=s(),d=a({},t);return g.jsx(dbe,{value:l,children:g.jsx(fbe,{value:r,children:g.jsxs($e.div,{...u,className:h2("chakra-slider",n.className),__css:r.container,children:[n.children,g.jsx("input",{...d})]})})})});JH.displayName="Slider";var eW=Xe((e,t)=>{const{getThumbProps:n}=Uw(),r=Gw(),i=n(e,t);return g.jsx($e.div,{...i,className:h2("chakra-slider__thumb",e.className),__css:r.thumb})});eW.displayName="SliderThumb";var tW=Xe((e,t)=>{const{getTrackProps:n}=Uw(),r=Gw(),i=n(e,t);return g.jsx($e.div,{...i,className:h2("chakra-slider__track",e.className),__css:r.track})});tW.displayName="SliderTrack";var nW=Xe((e,t)=>{const{getInnerTrackProps:n}=Uw(),r=Gw(),i=n(e,t);return g.jsx($e.div,{...i,className:h2("chakra-slider__filled-track",e.className),__css:r.filledTrack})});nW.displayName="SliderFilledTrack";var rk=Xe((e,t)=>{const{getMarkerProps:n}=Uw(),r=Gw(),i=n(e,t);return g.jsx($e.div,{...i,className:h2("chakra-slider__marker",e.className),__css:r.mark})});rk.displayName="SliderMark";var X8=Xe(function(t,n){const r=Yi("Switch",t),{spacing:i="0.5rem",children:o,...a}=fr(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:d,getLabelProps:p}=dz(a),m=S.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),y=S.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=S.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return g.jsxs($e.label,{...d(),className:xt("chakra-switch",t.className),__css:m,children:[g.jsx("input",{className:"chakra-switch__input",...l({},n)}),g.jsx($e.span,{...u(),className:"chakra-switch__track",__css:y,children:g.jsx($e.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":Bt(s.isChecked),"data-hover":Bt(s.isHovered)})}),o&&g.jsx($e.span,{className:"chakra-switch__label",...p(),__css:b,children:o})]})});X8.displayName="Switch";var[hbe,pNe,pbe,gbe]=l8();function mbe(e){var t;const{defaultIndex:n,onChange:r,index:i,isManual:o,isLazy:a,lazyBehavior:s="unmount",orientation:l="horizontal",direction:u="ltr",...d}=e,[p,m]=S.useState(n??0),[y,b]=c8({defaultValue:n??0,value:i,onChange:r});S.useEffect(()=>{i!=null&&m(i)},[i]);const w=pbe(),E=S.useId();return{id:`tabs-${(t=e.id)!=null?t:E}`,selectedIndex:y,focusedIndex:p,setSelectedIndex:b,setFocusedIndex:m,isManual:o,isLazy:a,lazyBehavior:s,orientation:l,descendants:w,direction:u,htmlProps:d}}var[vbe,Z8]=Pn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function ybe(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=Z8(),{index:u,register:d}=gbe({disabled:t&&!n}),p=u===l,m=()=>{i(u)},y=()=>{s(u),!o&&!(t&&n)&&i(u)},b=lH({...r,ref:Rn(d,e.ref),isDisabled:t,isFocusable:n,onClick:ht(e.onClick,m)}),w="button";return{...b,id:rW(a,u),role:"tab",tabIndex:p?0:-1,type:w,"aria-selected":p,"aria-controls":iW(a,u),onFocus:t?void 0:ht(e.onFocus,y)}}var[bbe,xbe]=Pn({});function Sbe(e){const t=Z8(),{id:n,selectedIndex:r}=t,o=h8(e.children).map((a,s)=>S.createElement(bbe,{key:s,value:{isSelected:s===r,id:iW(n,s),tabId:rW(n,s),selectedIndex:r}},a));return{...e,children:o}}function wbe(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=Z8(),{isSelected:o,id:a,tabId:s}=xbe(),l=S.useRef(!1);o&&(l.current=!0);const u=B8({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function rW(e,t){return`${e}--tab-${t}`}function iW(e,t){return`${e}--tabpanel-${t}`}var[Cbe,Q8]=Pn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),oW=Xe(function(t,n){const r=Yi("Tabs",t),{children:i,className:o,...a}=fr(t),{htmlProps:s,descendants:l,...u}=mbe(a),d=S.useMemo(()=>u,[u]),{isFitted:p,...m}=s;return g.jsx(hbe,{value:l,children:g.jsx(vbe,{value:d,children:g.jsx(Cbe,{value:r,children:g.jsx($e.div,{className:xt("chakra-tabs",o),ref:n,...m,__css:r.root,children:i})})})})});oW.displayName="Tabs";var aW=Xe(function(t,n){const r=wbe({...t,ref:n}),i=Q8();return g.jsx($e.div,{outline:"0",...r,className:xt("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});aW.displayName="TabPanel";var sW=Xe(function(t,n){const r=Sbe(t),i=Q8();return g.jsx($e.div,{...r,width:"100%",ref:n,className:xt("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});sW.displayName="TabPanels";var lW=Xe(function(t,n){const r=Q8(),i=ybe({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return g.jsx($e.button,{...i,className:xt("chakra-tabs__tab",t.className),__css:o})});lW.displayName="Tab";function _be(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var kbe=["h","minH","height","minHeight"],J8=Xe((e,t)=>{const n=au("Textarea",e),{className:r,rows:i,...o}=fr(e),a=p8(o),s=i?_be(n,kbe):n;return g.jsx($e.textarea,{ref:t,rows:i,...a,className:xt("chakra-textarea",r),__css:s})});J8.displayName="Textarea";var Ebe={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},h3=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},ik=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function Pbe(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:d,id:p,isOpen:m,defaultIsOpen:y,arrowSize:b=10,arrowShadowColor:w,arrowPadding:E,modifiers:_,isDisabled:k,gutter:T,offset:L,direction:O,...D}=e,{isOpen:I,onOpen:N,onClose:V}=F8({isOpen:m,defaultIsOpen:y,onOpen:l,onClose:u}),{referenceRef:B,getPopperProps:K,getArrowInnerProps:ne,getArrowProps:z}=$8({enabled:I,placement:d,arrowPadding:E,modifiers:_,gutter:T,offset:L,direction:O}),$=S.useId(),Y=`tooltip-${p??$}`,Q=S.useRef(null),q=S.useRef(),X=S.useCallback(()=>{q.current&&(clearTimeout(q.current),q.current=void 0)},[]),ee=S.useRef(),fe=S.useCallback(()=>{ee.current&&(clearTimeout(ee.current),ee.current=void 0)},[]),Ee=S.useCallback(()=>{fe(),V()},[V,fe]),we=Tbe(Q,Ee),xe=S.useCallback(()=>{if(!k&&!q.current){we();const et=ik(Q);q.current=et.setTimeout(N,t)}},[we,k,N,t]),Ae=S.useCallback(()=>{X();const et=ik(Q);ee.current=et.setTimeout(Ee,n)},[n,Ee,X]),Se=S.useCallback(()=>{I&&r&&Ae()},[r,Ae,I]),Qe=S.useCallback(()=>{I&&a&&Ae()},[a,Ae,I]),Ye=S.useCallback(et=>{I&&et.key==="Escape"&&Ae()},[I,Ae]);Dh(()=>h3(Q),"keydown",s?Ye:void 0),Dh(()=>h3(Q),"scroll",()=>{I&&o&&Ee()}),S.useEffect(()=>{k&&(X(),I&&V())},[k,I,V,X]),S.useEffect(()=>()=>{X(),fe()},[X,fe]),Dh(()=>Q.current,"pointerleave",Ae);const nt=S.useCallback((et={},yt=null)=>({...et,ref:Rn(Q,yt,B),onPointerEnter:ht(et.onPointerEnter,at=>{at.pointerType!=="touch"&&xe()}),onClick:ht(et.onClick,Se),onPointerDown:ht(et.onPointerDown,Qe),onFocus:ht(et.onFocus,xe),onBlur:ht(et.onBlur,Ae),"aria-describedby":I?Y:void 0}),[xe,Ae,Qe,I,Y,Se,B]),vt=S.useCallback((et={},yt=null)=>K({...et,style:{...et.style,[ii.arrowSize.var]:b?`${b}px`:void 0,[ii.arrowShadowColor.var]:w}},yt),[K,b,w]),Ce=S.useCallback((et={},yt=null)=>{const ze={...et.style,position:"relative",transformOrigin:ii.transformOrigin.varRef};return{ref:yt,...D,...et,id:Y,role:"tooltip",style:ze}},[D,Y]);return{isOpen:I,show:xe,hide:Ae,getTriggerProps:nt,getTooltipProps:Ce,getTooltipPositionerProps:vt,getArrowProps:z,getArrowInnerProps:ne}}var kC="chakra-ui:close-tooltip";function Tbe(e,t){return S.useEffect(()=>{const n=h3(e);return n.addEventListener(kC,t),()=>n.removeEventListener(kC,t)},[t,e]),()=>{const n=h3(e),r=ik(e);n.dispatchEvent(new r.CustomEvent(kC))}}function Mbe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Lbe(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var Abe=$e(su.div),si=Xe((e,t)=>{var n,r;const i=au("Tooltip",e),o=fr(e),a=Qy(),{children:s,label:l,shouldWrapChildren:u,"aria-label":d,hasArrow:p,bg:m,portalProps:y,background:b,backgroundColor:w,bgColor:E,motionProps:_,...k}=o,T=(r=(n=b??w)!=null?n:m)!=null?r:E;if(T){i.bg=T;const K=Gre(a,"colors",T);i[ii.arrowBg.var]=K}const L=Pbe({...k,direction:a.direction}),O=typeof s=="string"||u;let D;if(O)D=g.jsx($e.span,{display:"inline-block",tabIndex:0,...L.getTriggerProps(),children:s});else{const K=S.Children.only(s);D=S.cloneElement(K,L.getTriggerProps(K.props,K.ref))}const I=!!d,N=L.getTooltipProps({},t),V=I?Mbe(N,["role","id"]):N,B=Lbe(N,["role","id"]);return l?g.jsxs(g.Fragment,{children:[D,g.jsx(rp,{children:L.isOpen&&g.jsx(u0,{...y,children:g.jsx($e.div,{...L.getTooltipPositionerProps(),__css:{zIndex:i.zIndex,pointerEvents:"none"},children:g.jsxs(Abe,{variants:Ebe,initial:"exit",animate:"enter",exit:"exit",..._,...V,__css:i,children:[l,I&&g.jsx($e.span,{srOnly:!0,...B,children:d}),p&&g.jsx($e.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:g.jsx($e.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:i.bg}})})]})})})})]}):g.jsx(g.Fragment,{children:s})});si.displayName="Tooltip";var ok={},EO=Xs;ok.createRoot=EO.createRoot,ok.hydrateRoot=EO.hydrateRoot;var ak={},Obe={get exports(){return ak},set exports(e){ak=e}},uW={};/** +`)},t2e=0,_g=[];function n2e(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),i=S.useState(t2e++)[0],o=S.useState(function(){return IH()})[0],a=S.useRef(e);S.useEffect(function(){a.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=B_([e.lockRef.current],(e.shards||[]).map(xO),!0).filter(Boolean);return w.forEach(function(E){return E.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=S.useCallback(function(w,E){if("touches"in w&&w.touches.length===2)return!a.current.allowPinchZoom;var _=Xb(w),k=n.current,T="deltaX"in w?w.deltaX:k[0]-_[0],L="deltaY"in w?w.deltaY:k[1]-_[1],O,D=w.target,I=Math.abs(T)>Math.abs(L)?"h":"v";if("touches"in w&&I==="h"&&D.type==="range")return!1;var N=yO(I,D);if(!N)return!0;if(N?O=I:(O=I==="v"?"h":"v",N=yO(I,D)),!N)return!1;if(!r.current&&"changedTouches"in w&&(T||L)&&(r.current=O),!O)return!0;var U=r.current||O;return Qye(U,E,w,U==="h"?T:L,!0)},[]),l=S.useCallback(function(w){var E=w;if(!(!_g.length||_g[_g.length-1]!==o)){var _="deltaY"in E?bO(E):Xb(E),k=t.current.filter(function(O){return O.name===E.type&&O.target===E.target&&Jye(O.delta,_)})[0];if(k&&k.should){E.cancelable&&E.preventDefault();return}if(!k){var T=(a.current.shards||[]).map(xO).filter(Boolean).filter(function(O){return O.contains(E.target)}),L=T.length>0?s(E,T[0]):!a.current.noIsolation;L&&E.cancelable&&E.preventDefault()}}},[]),u=S.useCallback(function(w,E,_,k){var T={name:w,delta:E,target:_,should:k};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(L){return L!==T})},1)},[]),d=S.useCallback(function(w){n.current=Xb(w),r.current=void 0},[]),p=S.useCallback(function(w){u(w.type,bO(w),w.target,s(w,e.lockRef.current))},[]),m=S.useCallback(function(w){u(w.type,Xb(w),w.target,s(w,e.lockRef.current))},[]);S.useEffect(function(){return _g.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Cg),document.addEventListener("touchmove",l,Cg),document.addEventListener("touchstart",d,Cg),function(){_g=_g.filter(function(w){return w!==o}),document.removeEventListener("wheel",l,Cg),document.removeEventListener("touchmove",l,Cg),document.removeEventListener("touchstart",d,Cg)}},[]);var y=e.removeScrollBar,b=e.inert;return S.createElement(S.Fragment,null,b?S.createElement(o,{styles:e2e(i)}):null,y?S.createElement(Vye,{gapMode:"margin"}):null)}const r2e=a0e(RH,n2e);var $H=S.forwardRef(function(e,t){return S.createElement(zw,Nl({},e,{ref:t,sideCar:r2e}))});$H.classNames=zw.classNames;const FH=$H;function i2e(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:d,isOpen:p}=Yh(),[m,y]=DB();S.useEffect(()=>{!m&&y&&setTimeout(y)},[m,y]);const b=LH(r,p);return g.jsx(tH,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:d,children:g.jsx(FH,{removeScrollBar:!u,allowPinchZoom:a,enabled:b===1&&o,forwardProps:!0,children:e.children})})}var Xd=Ze((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Yh(),u=s(a,t),d=l(i),p=xt("chakra-modal__content",n),m=p0(),y={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:w}=Yh();return g.jsx(i2e,{children:g.jsx(Ne.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:b,children:g.jsx(MH,{preset:w,motionProps:o,className:p,...u,__css:y,children:r})})})});Xd.displayName="ModalContent";function BH(e){const{leastDestructiveRef:t,...n}=e;return g.jsx(Yd,{...n,initialFocusRef:t})}var zH=Ze((e,t)=>g.jsx(Xd,{ref:t,role:"alertdialog",...e})),Hw=Ze((e,t)=>{const{className:n,...r}=e,i=xt("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...p0().footer};return g.jsx(Ne.footer,{ref:t,...r,__css:a,className:i})});Hw.displayName="ModalFooter";var op=Ze((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=Yh();S.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=xt("chakra-modal__header",n),l={flex:0,...p0().header};return g.jsx(Ne.header,{ref:t,className:a,id:i,...r,__css:l})});op.displayName="ModalHeader";var o2e=Ne(su.div),oc=Ze((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=xt("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...p0().overlay},{motionPreset:u}=Yh(),p=i||(u==="none"?{}:sz);return g.jsx(o2e,{...p,__css:l,ref:t,className:a,...o})});oc.displayName="ModalOverlay";var Xm=Ze((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=Yh();S.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=xt("chakra-modal__body",n),s=p0();return g.jsx(Ne.div,{ref:t,className:a,id:i,...r,__css:s.body})});Xm.displayName="ModalBody";var g0=Ze((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=Yh(),a=xt("chakra-modal__close-btn",r),s=p0();return g.jsx(s8,{ref:t,__css:s.closeButton,className:a,onClick:ht(n,l=>{l.stopPropagation(),o()}),...i})});g0.displayName="ModalCloseButton";var a2e=e=>g.jsx(ja,{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})}),s2e=e=>g.jsx(ja,{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"})});function SO(e,t,n,r){S.useEffect(()=>{var i;if(!e.current||!r)return;const o=(i=e.current.ownerDocument.defaultView)!=null?i:window,a=Array.isArray(t)?t:[t],s=new o.MutationObserver(l=>{for(const u of l)u.type==="attributes"&&u.attributeName&&a.includes(u.attributeName)&&n(u)});return s.observe(e.current,{attributes:!0,attributeFilter:a}),()=>s.disconnect()})}function l2e(e,t){const n=Qr(e);S.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var u2e=50,wO=300;function c2e(e,t){const[n,r]=S.useState(!1),[i,o]=S.useState(null),[a,s]=S.useState(!0),l=S.useRef(null),u=()=>clearTimeout(l.current);l2e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?u2e:null);const d=S.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},wO)},[e,a]),p=S.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},wO)},[t,a]),m=S.useCallback(()=>{s(!0),r(!1),u()},[]);return S.useEffect(()=>()=>u(),[]),{up:d,down:p,stop:m,isSpinning:n}}var d2e=/^[Ee0-9+\-.]$/;function f2e(e){return d2e.test(e)}function h2e(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function p2e(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:u,isInvalid:d,pattern:p="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:y,id:b,onChange:w,precision:E,name:_,"aria-describedby":k,"aria-label":T,"aria-labelledby":L,onFocus:O,onBlur:D,onInvalid:I,getAriaValueText:N,isValidCharacter:U,format:B,parse:K,...ne}=e,z=Qr(O),$=Qr(D),H=Qr(I),Y=Qr(U??f2e),Q=Qr(N),q=Hme(e),{update:X,increment:ee,decrement:fe}=q,[ke,we]=S.useState(!1),xe=!(s||l),Le=S.useRef(null),Se=S.useRef(null),Qe=S.useRef(null),Xe=S.useRef(null),tt=S.useCallback(Me=>Me.split("").filter(Y).join(""),[Y]),yt=S.useCallback(Me=>{var Ct;return(Ct=K==null?void 0:K(Me))!=null?Ct:Me},[K]),Be=S.useCallback(Me=>{var Ct;return((Ct=B==null?void 0:B(Me))!=null?Ct:Me).toString()},[B]);rc(()=>{(q.valueAsNumber>o||q.valueAsNumber{if(!Le.current)return;if(Le.current.value!=q.value){const Ct=yt(Le.current.value);q.setValue(tt(Ct))}},[yt,tt]);const Ae=S.useCallback((Me=a)=>{xe&&ee(Me)},[ee,xe,a]),bt=S.useCallback((Me=a)=>{xe&&fe(Me)},[fe,xe,a]),Fe=c2e(Ae,bt);SO(Qe,"disabled",Fe.stop,Fe.isSpinning),SO(Xe,"disabled",Fe.stop,Fe.isSpinning);const at=S.useCallback(Me=>{if(Me.nativeEvent.isComposing)return;const zt=yt(Me.currentTarget.value);X(tt(zt)),Se.current={start:Me.currentTarget.selectionStart,end:Me.currentTarget.selectionEnd}},[X,tt,yt]),jt=S.useCallback(Me=>{var Ct,zt,$n;z==null||z(Me),Se.current&&(Me.target.selectionStart=(zt=Se.current.start)!=null?zt:(Ct=Me.currentTarget.value)==null?void 0:Ct.length,Me.currentTarget.selectionEnd=($n=Se.current.end)!=null?$n:Me.currentTarget.selectionStart)},[z]),mt=S.useCallback(Me=>{if(Me.nativeEvent.isComposing)return;h2e(Me,Y)||Me.preventDefault();const Ct=Zt(Me)*a,zt=Me.key,qe={ArrowUp:()=>Ae(Ct),ArrowDown:()=>bt(Ct),Home:()=>X(i),End:()=>X(o)}[zt];qe&&(Me.preventDefault(),qe(Me))},[Y,a,Ae,bt,X,i,o]),Zt=Me=>{let Ct=1;return(Me.metaKey||Me.ctrlKey)&&(Ct=.1),Me.shiftKey&&(Ct=10),Ct},on=S.useMemo(()=>{const Me=Q==null?void 0:Q(q.value);if(Me!=null)return Me;const Ct=q.value.toString();return Ct||void 0},[q.value,Q]),se=S.useCallback(()=>{let Me=q.value;if(q.value==="")return;/^[eE]/.test(q.value.toString())?q.setValue(""):(q.valueAsNumbero&&(Me=o),q.cast(Me))},[q,o,i]),Ie=S.useCallback(()=>{we(!1),n&&se()},[n,we,se]),He=S.useCallback(()=>{t&&requestAnimationFrame(()=>{var Me;(Me=Le.current)==null||Me.focus()})},[t]),Ue=S.useCallback(Me=>{Me.preventDefault(),Fe.up(),He()},[He,Fe]),ye=S.useCallback(Me=>{Me.preventDefault(),Fe.down(),He()},[He,Fe]);Dh(()=>Le.current,"wheel",Me=>{var Ct,zt;const qe=((zt=(Ct=Le.current)==null?void 0:Ct.ownerDocument)!=null?zt:document).activeElement===Le.current;if(!y||!qe)return;Me.preventDefault();const pt=Zt(Me)*a,zr=Math.sign(Me.deltaY);zr===-1?Ae(pt):zr===1&&bt(pt)},{passive:!1});const je=S.useCallback((Me={},Ct=null)=>{const zt=l||r&&q.isAtMax;return{...Me,ref:Rn(Ct,Qe),role:"button",tabIndex:-1,onPointerDown:ht(Me.onPointerDown,$n=>{$n.button!==0||zt||Ue($n)}),onPointerLeave:ht(Me.onPointerLeave,Fe.stop),onPointerUp:ht(Me.onPointerUp,Fe.stop),disabled:zt,"aria-disabled":Uu(zt)}},[q.isAtMax,r,Ue,Fe.stop,l]),vt=S.useCallback((Me={},Ct=null)=>{const zt=l||r&&q.isAtMin;return{...Me,ref:Rn(Ct,Xe),role:"button",tabIndex:-1,onPointerDown:ht(Me.onPointerDown,$n=>{$n.button!==0||zt||ye($n)}),onPointerLeave:ht(Me.onPointerLeave,Fe.stop),onPointerUp:ht(Me.onPointerUp,Fe.stop),disabled:zt,"aria-disabled":Uu(zt)}},[q.isAtMin,r,ye,Fe.stop,l]),Mt=S.useCallback((Me={},Ct=null)=>{var zt,$n,qe,pt;return{name:_,inputMode:m,type:"text",pattern:p,"aria-labelledby":L,"aria-label":T,"aria-describedby":k,id:b,disabled:l,...Me,readOnly:(zt=Me.readOnly)!=null?zt:s,"aria-readonly":($n=Me.readOnly)!=null?$n:s,"aria-required":(qe=Me.required)!=null?qe:u,required:(pt=Me.required)!=null?pt:u,ref:Rn(Le,Ct),value:Be(q.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(q.valueAsNumber)?void 0:q.valueAsNumber,"aria-invalid":Uu(d??q.isOutOfRange),"aria-valuetext":on,autoComplete:"off",autoCorrect:"off",onChange:ht(Me.onChange,at),onKeyDown:ht(Me.onKeyDown,mt),onFocus:ht(Me.onFocus,jt,()=>we(!0)),onBlur:ht(Me.onBlur,$,Ie)}},[_,m,p,L,T,Be,k,b,l,u,s,d,q.value,q.valueAsNumber,q.isOutOfRange,i,o,on,at,mt,jt,$,Ie]);return{value:Be(q.value),valueAsNumber:q.valueAsNumber,isFocused:ke,isDisabled:l,isReadOnly:s,getIncrementButtonProps:je,getDecrementButtonProps:vt,getInputProps:Mt,htmlProps:ne}}var[g2e,Ww]=Pn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[m2e,z8]=Pn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),H8=Ze(function(t,n){const r=Yi("NumberInput",t),i=fr(t),o=g8(i),{htmlProps:a,...s}=p2e(o),l=S.useMemo(()=>s,[s]);return g.jsx(m2e,{value:l,children:g.jsx(g2e,{value:r,children:g.jsx(Ne.div,{...a,ref:n,className:xt("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});H8.displayName="NumberInput";var HH=Ze(function(t,n){const r=Ww();return g.jsx(Ne.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});HH.displayName="NumberInputStepper";var W8=Ze(function(t,n){const{getInputProps:r}=z8(),i=r(t,n),o=Ww();return g.jsx(Ne.input,{...i,className:xt("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});W8.displayName="NumberInputField";var WH=Ne("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),U8=Ze(function(t,n){var r;const i=Ww(),{getDecrementButtonProps:o}=z8(),a=o(t,n);return g.jsx(WH,{...a,__css:i.stepper,children:(r=t.children)!=null?r:g.jsx(a2e,{})})});U8.displayName="NumberDecrementStepper";var V8=Ze(function(t,n){var r;const{getIncrementButtonProps:i}=z8(),o=i(t,n),a=Ww();return g.jsx(WH,{...o,__css:a.stepper,children:(r=t.children)!=null?r:g.jsx(s2e,{})})});V8.displayName="NumberIncrementStepper";var[v2e,Uw]=Pn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[y2e,UH]=Pn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `});function G8(e){const t=S.Children.only(e.children),{getTriggerProps:n}=Uw();return S.cloneElement(t,n(t.props,t.ref))}G8.displayName="PopoverTrigger";var kg={click:"click",hover:"hover"};function b2e(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=kg.click,openDelay:d=200,closeDelay:p=200,isLazy:m,lazyBehavior:y="unmount",computePositionOnMount:b,...w}=e,{isOpen:E,onClose:_,onOpen:k,onToggle:T}=F8(e),L=S.useRef(null),O=S.useRef(null),D=S.useRef(null),I=S.useRef(!1),N=S.useRef(!1);E&&(N.current=!0);const[U,B]=S.useState(!1),[K,ne]=S.useState(!1),z=S.useId(),$=i??z,[H,Y,Q,q]=["popover-trigger","popover-content","popover-header","popover-body"].map(at=>`${at}-${$}`),{referenceRef:X,getArrowProps:ee,getPopperProps:fe,getArrowInnerProps:ke,forceUpdate:we}=$8({...w,enabled:E||!!b}),xe=SH({isOpen:E,ref:D});Yme({enabled:E,ref:O}),cH(D,{focusRef:O,visible:E,shouldFocus:o&&u===kg.click}),Mve(D,{focusRef:r,visible:E,shouldFocus:a&&u===kg.click});const Le=B8({wasSelected:N.current,enabled:m,mode:y,isSelected:xe.present}),Se=S.useCallback((at={},jt=null)=>{const mt={...at,style:{...at.style,transformOrigin:ii.transformOrigin.varRef,[ii.arrowSize.var]:s?`${s}px`:void 0,[ii.arrowShadowColor.var]:l},ref:Rn(D,jt),children:Le?at.children:null,id:Y,tabIndex:-1,role:"dialog",onKeyDown:ht(at.onKeyDown,Zt=>{n&&Zt.key==="Escape"&&_()}),onBlur:ht(at.onBlur,Zt=>{const on=CO(Zt),se=xC(D.current,on),Ie=xC(O.current,on);E&&t&&(!se&&!Ie)&&_()}),"aria-labelledby":U?Q:void 0,"aria-describedby":K?q:void 0};return u===kg.hover&&(mt.role="tooltip",mt.onMouseEnter=ht(at.onMouseEnter,()=>{I.current=!0}),mt.onMouseLeave=ht(at.onMouseLeave,Zt=>{Zt.nativeEvent.relatedTarget!==null&&(I.current=!1,setTimeout(()=>_(),p))})),mt},[Le,Y,U,Q,K,q,u,n,_,E,t,p,l,s]),Qe=S.useCallback((at={},jt=null)=>fe({...at,style:{visibility:E?"visible":"hidden",...at.style}},jt),[E,fe]),Xe=S.useCallback((at,jt=null)=>({...at,ref:Rn(jt,L,X)}),[L,X]),tt=S.useRef(),yt=S.useRef(),Be=S.useCallback(at=>{L.current==null&&X(at)},[X]),Ae=S.useCallback((at={},jt=null)=>{const mt={...at,ref:Rn(O,jt,Be),id:H,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":Y};return u===kg.click&&(mt.onClick=ht(at.onClick,T)),u===kg.hover&&(mt.onFocus=ht(at.onFocus,()=>{tt.current===void 0&&k()}),mt.onBlur=ht(at.onBlur,Zt=>{const on=CO(Zt),se=!xC(D.current,on);E&&t&&se&&_()}),mt.onKeyDown=ht(at.onKeyDown,Zt=>{Zt.key==="Escape"&&_()}),mt.onMouseEnter=ht(at.onMouseEnter,()=>{I.current=!0,tt.current=window.setTimeout(()=>k(),d)}),mt.onMouseLeave=ht(at.onMouseLeave,()=>{I.current=!1,tt.current&&(clearTimeout(tt.current),tt.current=void 0),yt.current=window.setTimeout(()=>{I.current===!1&&_()},p)})),mt},[H,E,Y,u,Be,T,k,t,_,d,p]);S.useEffect(()=>()=>{tt.current&&clearTimeout(tt.current),yt.current&&clearTimeout(yt.current)},[]);const bt=S.useCallback((at={},jt=null)=>({...at,id:Q,ref:Rn(jt,mt=>{B(!!mt)})}),[Q]),Fe=S.useCallback((at={},jt=null)=>({...at,id:q,ref:Rn(jt,mt=>{ne(!!mt)})}),[q]);return{forceUpdate:we,isOpen:E,onAnimationComplete:xe.onComplete,onClose:_,getAnchorProps:Xe,getArrowProps:ee,getArrowInnerProps:ke,getPopoverPositionerProps:Qe,getPopoverProps:Se,getTriggerProps:Ae,getHeaderProps:bt,getBodyProps:Fe}}function xC(e,t){return e===t||(e==null?void 0:e.contains(t))}function CO(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function q8(e){const t=Yi("Popover",e),{children:n,...r}=fr(e),i=Qy(),o=b2e({...r,direction:i.direction});return g.jsx(v2e,{value:o,children:g.jsx(y2e,{value:t,children:ts(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})})})}q8.displayName="Popover";function K8(e){var t;const{bg:n,bgColor:r,backgroundColor:i,shadow:o,boxShadow:a}=e,{getArrowProps:s,getArrowInnerProps:l}=Uw(),u=UH(),d=(t=n??r)!=null?t:i,p=o??a;return g.jsx(Ne.div,{...s(),className:"chakra-popover__arrow-positioner",children:g.jsx(Ne.div,{className:xt("chakra-popover__arrow",e.className),...l(e),__css:{"--popper-arrow-bg":d?`colors.${d}, ${d}`:void 0,"--popper-arrow-shadow":p?`shadows.${p}, ${p}`:void 0,...u.arrow}})})}K8.displayName="PopoverArrow";function x2e(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var S2e={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},w2e=Ne(su.section),VH=Ze(function(t,n){const{variants:r=S2e,...i}=t,{isOpen:o}=Uw();return g.jsx(w2e,{ref:n,variants:x2e(r),initial:!1,animate:o?"enter":"exit",...i})});VH.displayName="PopoverTransition";var Y8=Ze(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=Uw(),u=UH(),d={position:"relative",display:"flex",flexDirection:"column",...u.content};return g.jsx(Ne.div,{...s(r),__css:u.popper,className:"chakra-popover__popper",children:g.jsx(VH,{...i,...a(o,n),onAnimationComplete:ww(l,o.onAnimationComplete),className:xt("chakra-popover__content",t.className),__css:d})})});Y8.displayName="PopoverContent";function C2e(e,t,n){return(e-t)*100/(n-t)}nf({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});nf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var _2e=nf({"0%":{left:"-40%"},"100%":{left:"100%"}}),k2e=nf({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function E2e(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=C2e(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof o=="function"?o(t,l):i})(),role:s},percent:l,value:t}}var[P2e,T2e]=Pn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),M2e=Ze((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=E2e({value:i,min:n,max:r,isIndeterminate:o,role:a}),d={height:"100%",...T2e().filledTrack};return g.jsx(Ne.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:d})}),GH=Ze((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:d,"aria-label":p,"aria-labelledby":m,"aria-valuetext":y,title:b,role:w,...E}=fr(e),_=Yi("Progress",e),k=u??((n=_.track)==null?void 0:n.borderRadius),T={animation:`${k2e} 1s linear infinite`},D={...!d&&a&&s&&T,...d&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${_2e} 1s ease infinite normal none running`}},I={overflow:"hidden",position:"relative",..._.track};return g.jsx(Ne.div,{ref:t,borderRadius:k,__css:I,...E,children:g.jsxs(P2e,{value:_,children:[g.jsx(M2e,{"aria-label":p,"aria-labelledby":m,"aria-valuetext":y,min:i,max:o,value:r,isIndeterminate:d,css:D,borderRadius:k,title:b,role:w}),l]})})});GH.displayName="Progress";function L2e(e){return e&&ko(e)&&ko(e.target)}function A2e(e={}){const{onChange:t,value:n,defaultValue:r,name:i,isDisabled:o,isFocusable:a,isNative:s,...l}=e,[u,d]=S.useState(r||""),p=typeof n<"u",m=p?n:u,y=S.useRef(null),b=S.useCallback(()=>{const O=y.current;if(!O)return;let D="input:not(:disabled):checked";const I=O.querySelector(D);if(I){I.focus();return}D="input:not(:disabled)";const N=O.querySelector(D);N==null||N.focus()},[]),E=`radio-${S.useId()}`,_=i||E,k=S.useCallback(O=>{const D=L2e(O)?O.target.value:O;p||d(D),t==null||t(String(D))},[t,p]),T=S.useCallback((O={},D=null)=>({...O,ref:Rn(D,y),role:"radiogroup"}),[]),L=S.useCallback((O={},D=null)=>({...O,ref:D,name:_,[s?"checked":"isChecked"]:m!=null?O.value===m:void 0,onChange(N){k(N)},"data-radiogroup":!0}),[s,_,k,m]);return{getRootProps:T,getRadioProps:L,name:_,ref:y,focus:b,setValue:d,value:m,onChange:k,isDisabled:o,isFocusable:a,htmlProps:l}}var[O2e,qH]=Pn({name:"RadioGroupContext",strict:!1}),Oy=Ze((e,t)=>{const{colorScheme:n,size:r,variant:i,children:o,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:d,onChange:p,getRootProps:m,name:y,htmlProps:b}=A2e(u),w=S.useMemo(()=>({name:y,size:r,onChange:p,colorScheme:n,value:d,variant:i,isDisabled:s,isFocusable:l}),[y,r,p,n,d,i,s,l]);return g.jsx(O2e,{value:w,children:g.jsx(Ne.div,{...m(b,t),className:xt("chakra-radio-group",a),children:o})})});Oy.displayName="RadioGroup";var R2e={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function I2e(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:i,isReadOnly:o,isRequired:a,onChange:s,isInvalid:l,name:u,value:d,id:p,"data-radiogroup":m,"aria-describedby":y,...b}=e,w=`radio-${S.useId()}`,E=ip(),k=!!qH()||!!m;let L=!!E&&!k?E.id:w;L=p??L;const O=i??(E==null?void 0:E.isDisabled),D=o??(E==null?void 0:E.isReadOnly),I=a??(E==null?void 0:E.isRequired),N=l??(E==null?void 0:E.isInvalid),[U,B]=S.useState(!1),[K,ne]=S.useState(!1),[z,$]=S.useState(!1),[H,Y]=S.useState(!1),[Q,q]=S.useState(Boolean(t)),X=typeof n<"u",ee=X?n:Q;S.useEffect(()=>dz(B),[]);const fe=S.useCallback(Be=>{if(D||O){Be.preventDefault();return}X||q(Be.target.checked),s==null||s(Be)},[X,O,D,s]),ke=S.useCallback(Be=>{Be.key===" "&&Y(!0)},[Y]),we=S.useCallback(Be=>{Be.key===" "&&Y(!1)},[Y]),xe=S.useCallback((Be={},Ae=null)=>({...Be,ref:Ae,"data-active":Bt(H),"data-hover":Bt(z),"data-disabled":Bt(O),"data-invalid":Bt(N),"data-checked":Bt(ee),"data-focus":Bt(K),"data-focus-visible":Bt(K&&U),"data-readonly":Bt(D),"aria-hidden":!0,onMouseDown:ht(Be.onMouseDown,()=>Y(!0)),onMouseUp:ht(Be.onMouseUp,()=>Y(!1)),onMouseEnter:ht(Be.onMouseEnter,()=>$(!0)),onMouseLeave:ht(Be.onMouseLeave,()=>$(!1))}),[H,z,O,N,ee,K,D,U]),{onFocus:Le,onBlur:Se}=E??{},Qe=S.useCallback((Be={},Ae=null)=>{const bt=O&&!r;return{...Be,id:L,ref:Ae,type:"radio",name:u,value:d,onChange:ht(Be.onChange,fe),onBlur:ht(Se,Be.onBlur,()=>ne(!1)),onFocus:ht(Le,Be.onFocus,()=>ne(!0)),onKeyDown:ht(Be.onKeyDown,ke),onKeyUp:ht(Be.onKeyUp,we),checked:ee,disabled:bt,readOnly:D,required:I,"aria-invalid":Uu(N),"aria-disabled":Uu(bt),"aria-required":Uu(I),"data-readonly":Bt(D),"aria-describedby":y,style:R2e}},[O,r,L,u,d,fe,Se,Le,ke,we,ee,D,I,N,y]);return{state:{isInvalid:N,isFocused:K,isChecked:ee,isActive:H,isHovered:z,isDisabled:O,isReadOnly:D,isRequired:I},getCheckboxProps:xe,getInputProps:Qe,getLabelProps:(Be={},Ae=null)=>({...Be,ref:Ae,onMouseDown:ht(Be.onMouseDown,_O),onTouchStart:ht(Be.onTouchStart,_O),"data-disabled":Bt(O),"data-checked":Bt(ee),"data-invalid":Bt(N)}),getRootProps:(Be,Ae=null)=>({...Be,ref:Ae,"data-disabled":Bt(O),"data-checked":Bt(ee),"data-invalid":Bt(N)}),htmlProps:b}}function _O(e){e.preventDefault(),e.stopPropagation()}function D2e(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var Vo=Ze((e,t)=>{var n;const r=qH(),{onChange:i,value:o}=e,a=Yi("Radio",{...r,...e}),s=fr(e),{spacing:l="0.5rem",children:u,isDisabled:d=r==null?void 0:r.isDisabled,isFocusable:p=r==null?void 0:r.isFocusable,inputProps:m,...y}=s;let b=e.isChecked;(r==null?void 0:r.value)!=null&&o!=null&&(b=r.value===o);let w=i;r!=null&&r.onChange&&o!=null&&(w=ww(r.onChange,i));const E=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:_,getCheckboxProps:k,getLabelProps:T,getRootProps:L,htmlProps:O}=I2e({...y,isChecked:b,isFocusable:p,isDisabled:d,onChange:w,name:E}),[D,I]=D2e(O,cF),N=k(I),U=_(m,t),B=T(),K=Object.assign({},D,L()),ne={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...a.container},z={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...a.control},$={userSelect:"none",marginStart:l,...a.label};return g.jsxs(Ne.label,{className:"chakra-radio",...K,__css:ne,children:[g.jsx("input",{className:"chakra-radio__input",...U}),g.jsx(Ne.span,{className:"chakra-radio__control",...N,__css:z}),u&&g.jsx(Ne.span,{className:"chakra-radio__label",...B,__css:$,children:u})]})});Vo.displayName="Radio";var KH=Ze(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return g.jsxs(Ne.select,{...a,ref:n,className:xt("chakra-select",o),children:[i&&g.jsx("option",{value:"",children:i}),r]})});KH.displayName="SelectField";function j2e(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var YH=Ze((e,t)=>{var n;const r=Yi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:d,minHeight:p,iconColor:m,iconSize:y,...b}=fr(e),[w,E]=j2e(b,cF),_=p8(E),k={width:"100%",height:"fit-content",position:"relative",color:s},T={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return g.jsxs(Ne.div,{className:"chakra-select__wrapper",__css:k,...w,...i,children:[g.jsx(KH,{ref:t,height:u??l,minH:d??p,placeholder:o,..._,__css:T,children:e.children}),g.jsx(XH,{"data-disabled":Bt(_.disabled),...(m||s)&&{color:m||s},__css:r.icon,...y&&{fontSize:y},children:a})]})});YH.displayName="Select";var N2e=e=>g.jsx("svg",{viewBox:"0 0 24 24",...e,children:g.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),$2e=Ne("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),XH=e=>{const{children:t=g.jsx(N2e,{}),...n}=e,r=S.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return g.jsx($2e,{...n,className:"chakra-select__icon-wrapper",children:S.isValidElement(t)?r:null})};XH.displayName="SelectIcon";var Eg=e=>e?"":void 0,SC=e=>e?!0:void 0,h2=(...e)=>e.filter(Boolean).join(" ");function wC(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Zb(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var rS={width:0,height:0},Qb=e=>e||rS;function F2e(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=w=>{var E;const _=(E=r[w])!=null?E:rS;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Zb({orientation:t,vertical:{bottom:`calc(${n[w]}% - ${_.height/2}px)`},horizontal:{left:`calc(${n[w]}% - ${_.width/2}px)`}})}},a=t==="vertical"?r.reduce((w,E)=>Qb(w).height>Qb(E).height?w:E,rS):r.reduce((w,E)=>Qb(w).width>Qb(E).width?w:E,rS),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Zb({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Zb({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,d=[0,i?100-n[0]:n[0]],p=u?d:n;let m=p[0];!u&&i&&(m=100-m);const y=Math.abs(p[p.length-1]-p[0]),b={...l,...Zb({orientation:t,vertical:i?{height:`${y}%`,top:`${m}%`}:{height:`${y}%`,bottom:`${m}%`},horizontal:i?{width:`${y}%`,right:`${m}%`}:{width:`${y}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function B2e(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function z2e(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function H2e(e){const t=U2e(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function ZH(e){return!!e.touches}function W2e(e){return ZH(e)&&e.touches.length>1}function U2e(e){var t;return(t=e.view)!=null?t:window}function V2e(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function G2e(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function QH(e,t="page"){return ZH(e)?V2e(e,t):G2e(e,t)}function q2e(e){return t=>{const n=H2e(t);(!n||n&&t.button===0)&&e(t)}}function K2e(e,t=!1){function n(i){e(i,{point:QH(i)})}return t?q2e(n):n}function iS(e,t,n,r){return z2e(e,t,K2e(n,t==="pointerdown"),r)}var Y2e=Object.defineProperty,X2e=(e,t,n)=>t in e?Y2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$s=(e,t,n)=>(X2e(e,typeof t!="symbol"?t+"":t,n),n),Z2e=class{constructor(e,t,n){$s(this,"history",[]),$s(this,"startEvent",null),$s(this,"lastEvent",null),$s(this,"lastEventInfo",null),$s(this,"handlers",{}),$s(this,"removeListeners",()=>{}),$s(this,"threshold",3),$s(this,"win"),$s(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const s=CC(this.lastEventInfo,this.history),l=this.startEvent!==null,u=tbe(s.offset,{x:0,y:0})>=this.threshold;if(!l&&!u)return;const{timestamp:d}=PL();this.history.push({...s.point,timestamp:d});const{onStart:p,onMove:m}=this.handlers;l||(p==null||p(this.lastEvent,s),this.startEvent=this.lastEvent),m==null||m(this.lastEvent,s)}),$s(this,"onPointerMove",(s,l)=>{this.lastEvent=s,this.lastEventInfo=l,xce.update(this.updatePoint,!0)}),$s(this,"onPointerUp",(s,l)=>{const u=CC(l,this.history),{onEnd:d,onSessionEnd:p}=this.handlers;p==null||p(s,u),this.end(),!(!d||!this.startEvent)&&(d==null||d(s,u))});var r;if(this.win=(r=e.view)!=null?r:window,W2e(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const i={point:QH(e)},{timestamp:o}=PL();this.history=[{...i.point,timestamp:o}];const{onSessionStart:a}=t;a==null||a(e,CC(i,this.history)),this.removeListeners=ebe(iS(this.win,"pointermove",this.onPointerMove),iS(this.win,"pointerup",this.onPointerUp),iS(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),Sce.update(this.updatePoint)}};function kO(e,t){return{x:e.x-t.x,y:e.y-t.y}}function CC(e,t){return{point:e.point,delta:kO(e.point,t[t.length-1]),offset:kO(e.point,t[0]),velocity:J2e(t,.1)}}var Q2e=e=>e*1e3;function J2e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Q2e(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function ebe(...e){return t=>e.reduce((n,r)=>r(n),t)}function _C(e,t){return Math.abs(e-t)}function EO(e){return"x"in e&&"y"in e}function tbe(e,t){if(typeof e=="number"&&typeof t=="number")return _C(e,t);if(EO(e)&&EO(t)){const n=_C(e.x,t.x),r=_C(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function JH(e){const t=S.useRef(null);return t.current=e,t}function nbe(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=S.useRef(null),d=JH({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(p,m){u.current=null,i==null||i(p,m)}});S.useEffect(()=>{var p;(p=u.current)==null||p.updateHandlers(d.current)}),S.useEffect(()=>{const p=e.current;if(!p||!l)return;function m(y){u.current=new Z2e(y,d.current,s)}return iS(p,"pointerdown",m)},[e,l,d,s]),S.useEffect(()=>()=>{var p;(p=u.current)==null||p.end(),u.current=null},[])}function rbe(e,t){var n;if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const r=(n=e.ownerDocument.defaultView)!=null?n:window,i=new r.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[a]=o;let s,l;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;t({width:s,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}var ibe=Boolean(globalThis==null?void 0:globalThis.document)?S.useLayoutEffect:S.useEffect;function obe(e,t){var n,r;if(!e||!e.parentElement)return;const i=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window,o=new i.MutationObserver(()=>{t()});return o.observe(e.parentElement,{childList:!0}),()=>{o.disconnect()}}function abe({getNodes:e,observeMutation:t=!0}){const[n,r]=S.useState([]),[i,o]=S.useState(0);return ibe(()=>{const a=e(),s=a.map((l,u)=>rbe(l,d=>{r(p=>[...p.slice(0,u),d,...p.slice(u+1)])}));if(t){const l=a[0];s.push(obe(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function sbe(e){return typeof e=="object"&&e!==null&&"current"in e}function lbe(e){const[t]=abe({observeMutation:!1,getNodes(){return[sbe(e)?e.current:e]}});return t}function ube(e){var t;const{min:n=0,max:r=100,onChange:i,value:o,defaultValue:a,isReversed:s,direction:l="ltr",orientation:u="horizontal",id:d,isDisabled:p,isReadOnly:m,onChangeStart:y,onChangeEnd:b,step:w=1,getAriaValueText:E,"aria-valuetext":_,"aria-label":k,"aria-labelledby":T,name:L,focusThumbOnChange:O=!0,...D}=e,I=Qr(y),N=Qr(b),U=Qr(E),B=B2e({isReversed:s,direction:l,orientation:u}),[K,ne]=c8({value:o,defaultValue:a??dbe(n,r),onChange:i}),[z,$]=S.useState(!1),[H,Y]=S.useState(!1),Q=!(p||m),q=(r-n)/10,X=w||(r-n)/100,ee=Jx(K,n,r),fe=r-ee+n,we=KA(B?fe:ee,n,r),xe=u==="vertical",Le=JH({min:n,max:r,step:w,isDisabled:p,value:ee,isInteractive:Q,isReversed:B,isVertical:xe,eventSource:null,focusThumbOnChange:O,orientation:u}),Se=S.useRef(null),Qe=S.useRef(null),Xe=S.useRef(null),tt=S.useId(),yt=d??tt,[Be,Ae]=[`slider-thumb-${yt}`,`slider-track-${yt}`],bt=S.useCallback(qe=>{var pt,zr;if(!Se.current)return;const rr=Le.current;rr.eventSource="pointer";const Bn=Se.current.getBoundingClientRect(),{clientX:li,clientY:vs}=(zr=(pt=qe.touches)==null?void 0:pt[0])!=null?zr:qe,tl=xe?Bn.bottom-vs:li-Bn.left,gf=xe?Bn.height:Bn.width;let ys=tl/gf;B&&(ys=1-ys);let Xi=zme(ys,rr.min,rr.max);return rr.step&&(Xi=parseFloat(YA(Xi,rr.min,rr.step))),Xi=Jx(Xi,rr.min,rr.max),Xi},[xe,B,Le]),Fe=S.useCallback(qe=>{const pt=Le.current;pt.isInteractive&&(qe=parseFloat(YA(qe,pt.min,X)),qe=Jx(qe,pt.min,pt.max),ne(qe))},[X,ne,Le]),at=S.useMemo(()=>({stepUp(qe=X){const pt=B?ee-qe:ee+qe;Fe(pt)},stepDown(qe=X){const pt=B?ee+qe:ee-qe;Fe(pt)},reset(){Fe(a||0)},stepTo(qe){Fe(qe)}}),[Fe,B,ee,X,a]),jt=S.useCallback(qe=>{const pt=Le.current,rr={ArrowRight:()=>at.stepUp(),ArrowUp:()=>at.stepUp(),ArrowLeft:()=>at.stepDown(),ArrowDown:()=>at.stepDown(),PageUp:()=>at.stepUp(q),PageDown:()=>at.stepDown(q),Home:()=>Fe(pt.min),End:()=>Fe(pt.max)}[qe.key];rr&&(qe.preventDefault(),qe.stopPropagation(),rr(qe),pt.eventSource="keyboard")},[at,Fe,q,Le]),mt=(t=U==null?void 0:U(ee))!=null?t:_,Zt=lbe(Qe),{getThumbStyle:on,rootStyle:se,trackStyle:Ie,innerTrackStyle:He}=S.useMemo(()=>{const qe=Le.current,pt=Zt??{width:0,height:0};return F2e({isReversed:B,orientation:qe.orientation,thumbRects:[pt],thumbPercents:[we]})},[B,Zt,we,Le]),Ue=S.useCallback(()=>{Le.current.focusThumbOnChange&&setTimeout(()=>{var pt;return(pt=Qe.current)==null?void 0:pt.focus()})},[Le]);rc(()=>{const qe=Le.current;Ue(),qe.eventSource==="keyboard"&&(N==null||N(qe.value))},[ee,N]);function ye(qe){const pt=bt(qe);pt!=null&&pt!==Le.current.value&&ne(pt)}nbe(Xe,{onPanSessionStart(qe){const pt=Le.current;pt.isInteractive&&($(!0),Ue(),ye(qe),I==null||I(pt.value))},onPanSessionEnd(){const qe=Le.current;qe.isInteractive&&($(!1),N==null||N(qe.value))},onPan(qe){Le.current.isInteractive&&ye(qe)}});const je=S.useCallback((qe={},pt=null)=>({...qe,...D,ref:Rn(pt,Xe),tabIndex:-1,"aria-disabled":SC(p),"data-focused":Eg(H),style:{...qe.style,...se}}),[D,p,H,se]),vt=S.useCallback((qe={},pt=null)=>({...qe,ref:Rn(pt,Se),id:Ae,"data-disabled":Eg(p),style:{...qe.style,...Ie}}),[p,Ae,Ie]),Mt=S.useCallback((qe={},pt=null)=>({...qe,ref:pt,style:{...qe.style,...He}}),[He]),Me=S.useCallback((qe={},pt=null)=>({...qe,ref:Rn(pt,Qe),role:"slider",tabIndex:Q?0:void 0,id:Be,"data-active":Eg(z),"aria-valuetext":mt,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":ee,"aria-orientation":u,"aria-disabled":SC(p),"aria-readonly":SC(m),"aria-label":k,"aria-labelledby":k?void 0:T,style:{...qe.style,...on(0)},onKeyDown:wC(qe.onKeyDown,jt),onFocus:wC(qe.onFocus,()=>Y(!0)),onBlur:wC(qe.onBlur,()=>Y(!1))}),[Q,Be,z,mt,n,r,ee,u,p,m,k,T,on,jt]),Ct=S.useCallback((qe,pt=null)=>{const zr=!(qe.valuer),rr=ee>=qe.value,Bn=KA(qe.value,n,r),li={position:"absolute",pointerEvents:"none",...cbe({orientation:u,vertical:{bottom:B?`${100-Bn}%`:`${Bn}%`},horizontal:{left:B?`${100-Bn}%`:`${Bn}%`}})};return{...qe,ref:pt,role:"presentation","aria-hidden":!0,"data-disabled":Eg(p),"data-invalid":Eg(!zr),"data-highlighted":Eg(rr),style:{...qe.style,...li}}},[p,B,r,n,u,ee]),zt=S.useCallback((qe={},pt=null)=>({...qe,ref:pt,type:"hidden",value:ee,name:L}),[L,ee]);return{state:{value:ee,isFocused:H,isDragging:z},actions:at,getRootProps:je,getTrackProps:vt,getInnerTrackProps:Mt,getThumbProps:Me,getMarkerProps:Ct,getInputProps:zt}}function cbe(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function dbe(e,t){return t"}),[hbe,Gw]=Pn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),eW=Ze((e,t)=>{const n={orientation:"horizontal",...e},r=Yi("Slider",n),i=fr(n),{direction:o}=Qy();i.direction=o;const{getInputProps:a,getRootProps:s,...l}=ube(i),u=s(),d=a({},t);return g.jsx(fbe,{value:l,children:g.jsx(hbe,{value:r,children:g.jsxs(Ne.div,{...u,className:h2("chakra-slider",n.className),__css:r.container,children:[n.children,g.jsx("input",{...d})]})})})});eW.displayName="Slider";var tW=Ze((e,t)=>{const{getThumbProps:n}=Vw(),r=Gw(),i=n(e,t);return g.jsx(Ne.div,{...i,className:h2("chakra-slider__thumb",e.className),__css:r.thumb})});tW.displayName="SliderThumb";var nW=Ze((e,t)=>{const{getTrackProps:n}=Vw(),r=Gw(),i=n(e,t);return g.jsx(Ne.div,{...i,className:h2("chakra-slider__track",e.className),__css:r.track})});nW.displayName="SliderTrack";var rW=Ze((e,t)=>{const{getInnerTrackProps:n}=Vw(),r=Gw(),i=n(e,t);return g.jsx(Ne.div,{...i,className:h2("chakra-slider__filled-track",e.className),__css:r.filledTrack})});rW.displayName="SliderFilledTrack";var rk=Ze((e,t)=>{const{getMarkerProps:n}=Vw(),r=Gw(),i=n(e,t);return g.jsx(Ne.div,{...i,className:h2("chakra-slider__marker",e.className),__css:r.mark})});rk.displayName="SliderMark";var X8=Ze(function(t,n){const r=Yi("Switch",t),{spacing:i="0.5rem",children:o,...a}=fr(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:d,getLabelProps:p}=fz(a),m=S.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),y=S.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=S.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return g.jsxs(Ne.label,{...d(),className:xt("chakra-switch",t.className),__css:m,children:[g.jsx("input",{className:"chakra-switch__input",...l({},n)}),g.jsx(Ne.span,{...u(),className:"chakra-switch__track",__css:y,children:g.jsx(Ne.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":Bt(s.isChecked),"data-hover":Bt(s.isHovered)})}),o&&g.jsx(Ne.span,{className:"chakra-switch__label",...p(),__css:b,children:o})]})});X8.displayName="Switch";var[pbe,gNe,gbe,mbe]=l8();function vbe(e){var t;const{defaultIndex:n,onChange:r,index:i,isManual:o,isLazy:a,lazyBehavior:s="unmount",orientation:l="horizontal",direction:u="ltr",...d}=e,[p,m]=S.useState(n??0),[y,b]=c8({defaultValue:n??0,value:i,onChange:r});S.useEffect(()=>{i!=null&&m(i)},[i]);const w=gbe(),E=S.useId();return{id:`tabs-${(t=e.id)!=null?t:E}`,selectedIndex:y,focusedIndex:p,setSelectedIndex:b,setFocusedIndex:m,isManual:o,isLazy:a,lazyBehavior:s,orientation:l,descendants:w,direction:u,htmlProps:d}}var[ybe,Z8]=Pn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function bbe(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=Z8(),{index:u,register:d}=mbe({disabled:t&&!n}),p=u===l,m=()=>{i(u)},y=()=>{s(u),!o&&!(t&&n)&&i(u)},b=uH({...r,ref:Rn(d,e.ref),isDisabled:t,isFocusable:n,onClick:ht(e.onClick,m)}),w="button";return{...b,id:iW(a,u),role:"tab",tabIndex:p?0:-1,type:w,"aria-selected":p,"aria-controls":oW(a,u),onFocus:t?void 0:ht(e.onFocus,y)}}var[xbe,Sbe]=Pn({});function wbe(e){const t=Z8(),{id:n,selectedIndex:r}=t,o=h8(e.children).map((a,s)=>S.createElement(xbe,{key:s,value:{isSelected:s===r,id:oW(n,s),tabId:iW(n,s),selectedIndex:r}},a));return{...e,children:o}}function Cbe(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=Z8(),{isSelected:o,id:a,tabId:s}=Sbe(),l=S.useRef(!1);o&&(l.current=!0);const u=B8({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function iW(e,t){return`${e}--tab-${t}`}function oW(e,t){return`${e}--tabpanel-${t}`}var[_be,Q8]=Pn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),aW=Ze(function(t,n){const r=Yi("Tabs",t),{children:i,className:o,...a}=fr(t),{htmlProps:s,descendants:l,...u}=vbe(a),d=S.useMemo(()=>u,[u]),{isFitted:p,...m}=s;return g.jsx(pbe,{value:l,children:g.jsx(ybe,{value:d,children:g.jsx(_be,{value:r,children:g.jsx(Ne.div,{className:xt("chakra-tabs",o),ref:n,...m,__css:r.root,children:i})})})})});aW.displayName="Tabs";var sW=Ze(function(t,n){const r=Cbe({...t,ref:n}),i=Q8();return g.jsx(Ne.div,{outline:"0",...r,className:xt("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});sW.displayName="TabPanel";var lW=Ze(function(t,n){const r=wbe(t),i=Q8();return g.jsx(Ne.div,{...r,width:"100%",ref:n,className:xt("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});lW.displayName="TabPanels";var uW=Ze(function(t,n){const r=Q8(),i=bbe({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return g.jsx(Ne.button,{...i,className:xt("chakra-tabs__tab",t.className),__css:o})});uW.displayName="Tab";function kbe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var Ebe=["h","minH","height","minHeight"],J8=Ze((e,t)=>{const n=au("Textarea",e),{className:r,rows:i,...o}=fr(e),a=p8(o),s=i?kbe(n,Ebe):n;return g.jsx(Ne.textarea,{ref:t,rows:i,...a,className:xt("chakra-textarea",r),__css:s})});J8.displayName="Textarea";var Pbe={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},h3=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},ik=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function Tbe(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:d,id:p,isOpen:m,defaultIsOpen:y,arrowSize:b=10,arrowShadowColor:w,arrowPadding:E,modifiers:_,isDisabled:k,gutter:T,offset:L,direction:O,...D}=e,{isOpen:I,onOpen:N,onClose:U}=F8({isOpen:m,defaultIsOpen:y,onOpen:l,onClose:u}),{referenceRef:B,getPopperProps:K,getArrowInnerProps:ne,getArrowProps:z}=$8({enabled:I,placement:d,arrowPadding:E,modifiers:_,gutter:T,offset:L,direction:O}),$=S.useId(),Y=`tooltip-${p??$}`,Q=S.useRef(null),q=S.useRef(),X=S.useCallback(()=>{q.current&&(clearTimeout(q.current),q.current=void 0)},[]),ee=S.useRef(),fe=S.useCallback(()=>{ee.current&&(clearTimeout(ee.current),ee.current=void 0)},[]),ke=S.useCallback(()=>{fe(),U()},[U,fe]),we=Mbe(Q,ke),xe=S.useCallback(()=>{if(!k&&!q.current){we();const Ae=ik(Q);q.current=Ae.setTimeout(N,t)}},[we,k,N,t]),Le=S.useCallback(()=>{X();const Ae=ik(Q);ee.current=Ae.setTimeout(ke,n)},[n,ke,X]),Se=S.useCallback(()=>{I&&r&&Le()},[r,Le,I]),Qe=S.useCallback(()=>{I&&a&&Le()},[a,Le,I]),Xe=S.useCallback(Ae=>{I&&Ae.key==="Escape"&&Le()},[I,Le]);Dh(()=>h3(Q),"keydown",s?Xe:void 0),Dh(()=>h3(Q),"scroll",()=>{I&&o&&ke()}),S.useEffect(()=>{k&&(X(),I&&U())},[k,I,U,X]),S.useEffect(()=>()=>{X(),fe()},[X,fe]),Dh(()=>Q.current,"pointerleave",Le);const tt=S.useCallback((Ae={},bt=null)=>({...Ae,ref:Rn(Q,bt,B),onPointerEnter:ht(Ae.onPointerEnter,at=>{at.pointerType!=="touch"&&xe()}),onClick:ht(Ae.onClick,Se),onPointerDown:ht(Ae.onPointerDown,Qe),onFocus:ht(Ae.onFocus,xe),onBlur:ht(Ae.onBlur,Le),"aria-describedby":I?Y:void 0}),[xe,Le,Qe,I,Y,Se,B]),yt=S.useCallback((Ae={},bt=null)=>K({...Ae,style:{...Ae.style,[ii.arrowSize.var]:b?`${b}px`:void 0,[ii.arrowShadowColor.var]:w}},bt),[K,b,w]),Be=S.useCallback((Ae={},bt=null)=>{const Fe={...Ae.style,position:"relative",transformOrigin:ii.transformOrigin.varRef};return{ref:bt,...D,...Ae,id:Y,role:"tooltip",style:Fe}},[D,Y]);return{isOpen:I,show:xe,hide:Le,getTriggerProps:tt,getTooltipProps:Be,getTooltipPositionerProps:yt,getArrowProps:z,getArrowInnerProps:ne}}var kC="chakra-ui:close-tooltip";function Mbe(e,t){return S.useEffect(()=>{const n=h3(e);return n.addEventListener(kC,t),()=>n.removeEventListener(kC,t)},[t,e]),()=>{const n=h3(e),r=ik(e);n.dispatchEvent(new r.CustomEvent(kC))}}function Lbe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Abe(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var Obe=Ne(su.div),si=Ze((e,t)=>{var n,r;const i=au("Tooltip",e),o=fr(e),a=Qy(),{children:s,label:l,shouldWrapChildren:u,"aria-label":d,hasArrow:p,bg:m,portalProps:y,background:b,backgroundColor:w,bgColor:E,motionProps:_,...k}=o,T=(r=(n=b??w)!=null?n:m)!=null?r:E;if(T){i.bg=T;const K=qre(a,"colors",T);i[ii.arrowBg.var]=K}const L=Tbe({...k,direction:a.direction}),O=typeof s=="string"||u;let D;if(O)D=g.jsx(Ne.span,{display:"inline-block",tabIndex:0,...L.getTriggerProps(),children:s});else{const K=S.Children.only(s);D=S.cloneElement(K,L.getTriggerProps(K.props,K.ref))}const I=!!d,N=L.getTooltipProps({},t),U=I?Lbe(N,["role","id"]):N,B=Abe(N,["role","id"]);return l?g.jsxs(g.Fragment,{children:[D,g.jsx(rp,{children:L.isOpen&&g.jsx(u0,{...y,children:g.jsx(Ne.div,{...L.getTooltipPositionerProps(),__css:{zIndex:i.zIndex,pointerEvents:"none"},children:g.jsxs(Obe,{variants:Pbe,initial:"exit",animate:"enter",exit:"exit",..._,...U,__css:i,children:[l,I&&g.jsx(Ne.span,{srOnly:!0,...B,children:d}),p&&g.jsx(Ne.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:g.jsx(Ne.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:i.bg}})})]})})})})]}):g.jsx(g.Fragment,{children:s})});si.displayName="Tooltip";var ok={},PO=Xs;ok.createRoot=PO.createRoot,ok.hydrateRoot=PO.hydrateRoot;var ak={},Rbe={get exports(){return ak},set exports(e){ak=e}},cW={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -415,7 +415,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Zm=S;function Rbe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ibe=typeof Object.is=="function"?Object.is:Rbe,Dbe=Zm.useState,jbe=Zm.useEffect,Nbe=Zm.useLayoutEffect,$be=Zm.useDebugValue;function Fbe(e,t){var n=t(),r=Dbe({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Nbe(function(){i.value=n,i.getSnapshot=t,EC(i)&&o({inst:i})},[e,n,t]),jbe(function(){return EC(i)&&o({inst:i}),e(function(){EC(i)&&o({inst:i})})},[e]),$be(n),n}function EC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ibe(e,n)}catch{return!0}}function Bbe(e,t){return t()}var zbe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Bbe:Fbe;uW.useSyncExternalStore=Zm.useSyncExternalStore!==void 0?Zm.useSyncExternalStore:zbe;(function(e){e.exports=uW})(Obe);var sk={},Hbe={get exports(){return sk},set exports(e){sk=e}},cW={};/** + */var Zm=S;function Ibe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dbe=typeof Object.is=="function"?Object.is:Ibe,jbe=Zm.useState,Nbe=Zm.useEffect,$be=Zm.useLayoutEffect,Fbe=Zm.useDebugValue;function Bbe(e,t){var n=t(),r=jbe({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return $be(function(){i.value=n,i.getSnapshot=t,EC(i)&&o({inst:i})},[e,n,t]),Nbe(function(){return EC(i)&&o({inst:i}),e(function(){EC(i)&&o({inst:i})})},[e]),Fbe(n),n}function EC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dbe(e,n)}catch{return!0}}function zbe(e,t){return t()}var Hbe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?zbe:Bbe;cW.useSyncExternalStore=Zm.useSyncExternalStore!==void 0?Zm.useSyncExternalStore:Hbe;(function(e){e.exports=cW})(Rbe);var sk={},Wbe={get exports(){return sk},set exports(e){sk=e}},dW={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -423,7 +423,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var qw=S,Wbe=ak;function Vbe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ube=typeof Object.is=="function"?Object.is:Vbe,Gbe=Wbe.useSyncExternalStore,qbe=qw.useRef,Kbe=qw.useEffect,Ybe=qw.useMemo,Xbe=qw.useDebugValue;cW.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=qbe(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=Ybe(function(){function l(y){if(!u){if(u=!0,d=y,y=r(y),i!==void 0&&a.hasValue){var b=a.value;if(i(b,y))return p=b}return p=y}if(b=p,Ube(d,y))return b;var w=r(y);return i!==void 0&&i(b,w)?b:(d=y,p=w)}var u=!1,d,p,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,r,i]);var s=Gbe(e,o[0],o[1]);return Kbe(function(){a.hasValue=!0,a.value=s},[s]),Xbe(s),s};(function(e){e.exports=cW})(Hbe);function Zbe(e){e()}let dW=Zbe;const Qbe=e=>dW=e,Jbe=()=>dW,Zd=S.createContext(null);function fW(){return S.useContext(Zd)}const exe=()=>{throw new Error("uSES not initialized!")};let hW=exe;const txe=e=>{hW=e},nxe=(e,t)=>e===t;function rxe(e=Zd){const t=e===Zd?fW:()=>S.useContext(e);return function(r,i=nxe){const{store:o,subscription:a,getServerState:s}=t(),l=hW(a.addNestedSub,o.getState,s||o.getState,r,i);return S.useDebugValue(l),l}}const ixe=rxe();var PO={},oxe={get exports(){return PO},set exports(e){PO=e}},Nn={};/** + */var qw=S,Ube=ak;function Vbe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gbe=typeof Object.is=="function"?Object.is:Vbe,qbe=Ube.useSyncExternalStore,Kbe=qw.useRef,Ybe=qw.useEffect,Xbe=qw.useMemo,Zbe=qw.useDebugValue;dW.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Kbe(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=Xbe(function(){function l(y){if(!u){if(u=!0,d=y,y=r(y),i!==void 0&&a.hasValue){var b=a.value;if(i(b,y))return p=b}return p=y}if(b=p,Gbe(d,y))return b;var w=r(y);return i!==void 0&&i(b,w)?b:(d=y,p=w)}var u=!1,d,p,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,r,i]);var s=qbe(e,o[0],o[1]);return Ybe(function(){a.hasValue=!0,a.value=s},[s]),Zbe(s),s};(function(e){e.exports=dW})(Wbe);function Qbe(e){e()}let fW=Qbe;const Jbe=e=>fW=e,exe=()=>fW,Zd=S.createContext(null);function hW(){return S.useContext(Zd)}const txe=()=>{throw new Error("uSES not initialized!")};let pW=txe;const nxe=e=>{pW=e},rxe=(e,t)=>e===t;function ixe(e=Zd){const t=e===Zd?hW:()=>S.useContext(e);return function(r,i=rxe){const{store:o,subscription:a,getServerState:s}=t(),l=pW(a.addNestedSub,o.getState,s||o.getState,r,i);return S.useDebugValue(l),l}}const oxe=ixe();var TO={},axe={get exports(){return TO},set exports(e){TO=e}},Nn={};/** * @license React * react-is.production.min.js * @@ -431,7 +431,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var eE=Symbol.for("react.element"),tE=Symbol.for("react.portal"),Kw=Symbol.for("react.fragment"),Yw=Symbol.for("react.strict_mode"),Xw=Symbol.for("react.profiler"),Zw=Symbol.for("react.provider"),Qw=Symbol.for("react.context"),axe=Symbol.for("react.server_context"),Jw=Symbol.for("react.forward_ref"),e4=Symbol.for("react.suspense"),t4=Symbol.for("react.suspense_list"),n4=Symbol.for("react.memo"),r4=Symbol.for("react.lazy"),sxe=Symbol.for("react.offscreen"),pW;pW=Symbol.for("react.module.reference");function ps(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case eE:switch(e=e.type,e){case Kw:case Xw:case Yw:case e4:case t4:return e;default:switch(e=e&&e.$$typeof,e){case axe:case Qw:case Jw:case r4:case n4:case Zw:return e;default:return t}}case tE:return t}}}Nn.ContextConsumer=Qw;Nn.ContextProvider=Zw;Nn.Element=eE;Nn.ForwardRef=Jw;Nn.Fragment=Kw;Nn.Lazy=r4;Nn.Memo=n4;Nn.Portal=tE;Nn.Profiler=Xw;Nn.StrictMode=Yw;Nn.Suspense=e4;Nn.SuspenseList=t4;Nn.isAsyncMode=function(){return!1};Nn.isConcurrentMode=function(){return!1};Nn.isContextConsumer=function(e){return ps(e)===Qw};Nn.isContextProvider=function(e){return ps(e)===Zw};Nn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===eE};Nn.isForwardRef=function(e){return ps(e)===Jw};Nn.isFragment=function(e){return ps(e)===Kw};Nn.isLazy=function(e){return ps(e)===r4};Nn.isMemo=function(e){return ps(e)===n4};Nn.isPortal=function(e){return ps(e)===tE};Nn.isProfiler=function(e){return ps(e)===Xw};Nn.isStrictMode=function(e){return ps(e)===Yw};Nn.isSuspense=function(e){return ps(e)===e4};Nn.isSuspenseList=function(e){return ps(e)===t4};Nn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Kw||e===Xw||e===Yw||e===e4||e===t4||e===sxe||typeof e=="object"&&e!==null&&(e.$$typeof===r4||e.$$typeof===n4||e.$$typeof===Zw||e.$$typeof===Qw||e.$$typeof===Jw||e.$$typeof===pW||e.getModuleId!==void 0)};Nn.typeOf=ps;(function(e){e.exports=Nn})(oxe);function lxe(){const e=Jbe();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const TO={notify(){},get:()=>[]};function uxe(e,t){let n,r=TO;function i(p){return l(),r.subscribe(p)}function o(){r.notify()}function a(){d.onStateChange&&d.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=lxe())}function u(){n&&(n(),n=void 0,r.clear(),r=TO)}const d={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return d}const cxe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dxe=cxe?S.useLayoutEffect:S.useEffect;function fxe({store:e,context:t,children:n,serverState:r}){const i=S.useMemo(()=>{const s=uxe(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=S.useMemo(()=>e.getState(),[e]);dxe(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]);const a=t||Zd;return qe.createElement(a.Provider,{value:i},n)}function gW(e=Zd){const t=e===Zd?fW:()=>S.useContext(e);return function(){const{store:r}=t();return r}}const hxe=gW();function pxe(e=Zd){const t=e===Zd?hxe:gW(e);return function(){return t().dispatch}}const gxe=pxe();txe(sk.useSyncExternalStoreWithSelector);Qbe(Xs.unstable_batchedUpdates);function oS(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?oS=function(n){return typeof n}:oS=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},oS(e)}function mxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MO(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:nE(e)?2:rE(e)?3:0}function Pm(e,t){return m0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function xxe(e,t){return m0(e)===2?e.get(t):e[t]}function vW(e,t,n){var r=m0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function yW(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function nE(e){return Exe&&e instanceof Map}function rE(e){return Pxe&&e instanceof Set}function fh(e){return e.o||e.t}function iE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=xW(e);delete t[vr];for(var n=Tm(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=Sxe),Object.freeze(e),t&&Xh(e,function(n,r){return oE(r,!0)},!0)),e}function Sxe(){Us(2)}function aE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Ql(e){var t=hk[e];return t||Us(18,e),t}function wxe(e,t){hk[e]||(hk[e]=t)}function ck(){return Ry}function PC(e,t){t&&(Ql("Patches"),e.u=[],e.s=[],e.v=t)}function p3(e){dk(e),e.p.forEach(Cxe),e.p=null}function dk(e){e===Ry&&(Ry=e.l)}function LO(e){return Ry={p:[],l:Ry,h:e,m:!0,_:0}}function Cxe(e){var t=e[vr];t.i===0||t.i===1?t.j():t.O=!0}function TC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||Ql("ES5").S(t,e,r),r?(n[vr].P&&(p3(t),Us(4)),ac(e)&&(e=g3(t,e),t.l||m3(t,e)),t.u&&Ql("Patches").M(n[vr].t,e,t.u,t.s)):e=g3(t,n,[]),p3(t),t.u&&t.v(t.u,t.s),e!==bW?e:void 0}function g3(e,t,n){if(aE(t))return t;var r=t[vr];if(!r)return Xh(t,function(s,l){return AO(e,r,t,s,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return m3(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=iE(r.k):r.o,o=i,a=!1;r.i===3&&(o=new Set(i),i.clear(),a=!0),Xh(o,function(s,l){return AO(e,r,i,s,l,n,a)}),m3(e,i,!1),n&&e.u&&Ql("Patches").N(r,n,e.u,e.s)}return r.o}function AO(e,t,n,r,i,o,a){if(Qd(i)){var s=g3(e,i,o&&t&&t.i!==3&&!Pm(t.R,r)?o.concat(r):void 0);if(vW(n,r,s),!Qd(s))return;e.m=!1}else a&&n.add(i);if(ac(i)&&!aE(i)){if(!e.h.D&&e._<1)return;g3(e,i),t&&t.A.l||m3(e,i)}}function m3(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&oE(t,n)}function MC(e,t){var n=e[vr];return(n?fh(n):e)[t]}function OO(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function xd(e){e.P||(e.P=!0,e.l&&xd(e.l))}function LC(e){e.o||(e.o=iE(e.t))}function fk(e,t,n){var r=nE(t)?Ql("MapSet").F(t,n):rE(t)?Ql("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:ck(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=Iy;a&&(l=[s],u=f1);var d=Proxy.revocable(l,u),p=d.revoke,m=d.proxy;return s.k=m,s.j=p,m}(t,n):Ql("ES5").J(t,n);return(n?n.A:ck()).p.push(r),r}function _xe(e){return Qd(e)||Us(22,e),function t(n){if(!ac(n))return n;var r,i=n[vr],o=m0(n);if(i){if(!i.P&&(i.i<4||!Ql("ES5").K(i)))return i.t;i.I=!0,r=RO(n,o),i.I=!1}else r=RO(n,o);return Xh(r,function(a,s){i&&xxe(i.t,a)===s||vW(r,a,t(s))}),o===3?new Set(r):r}(e)}function RO(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return iE(e)}function kxe(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[vr];return Iy.get(l,o)},set:function(l){var u=this[vr];Iy.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][vr];if(!s.P)switch(s.i){case 5:r(s)&&xd(s);break;case 4:n(s)&&xd(s)}}}function n(o){for(var a=o.t,s=o.k,l=Tm(s),u=l.length-1;u>=0;u--){var d=l[u];if(d!==vr){var p=a[d];if(p===void 0&&!Pm(a,d))return!0;var m=s[d],y=m&&m[vr];if(y?y.t!==p:!yW(m,p))return!0}}var b=!!a[vr];return l.length!==Tm(a).length+(b?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l1?_-1:0),T=1;T<_;T++)k[T-1]=arguments[T];return l.produce(w,function(L){var O;return(O=o).call.apply(O,[E,L].concat(k))})}}var u;if(typeof o!="function"&&Us(6),a!==void 0&&typeof a!="function"&&Us(7),ac(i)){var d=LO(r),p=fk(r,i,void 0),m=!0;try{u=o(p),m=!1}finally{m?p3(d):dk(d)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(w){return PC(d,a),TC(w,d)},function(w){throw p3(d),w}):(PC(d,a),TC(u,d))}if(!i||typeof i!="object"){if((u=o(i))===void 0&&(u=i),u===bW&&(u=void 0),r.D&&oE(u,!0),a){var y=[],b=[];Ql("Patches").M(i,u,y,b),a(y,b)}return u}Us(21,i)},this.produceWithPatches=function(i,o){if(typeof i=="function")return function(u){for(var d=arguments.length,p=Array(d>1?d-1:0),m=1;m=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=Ql("Patches").$;return Qd(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Aa=new Mxe,SW=Aa.produce;Aa.produceWithPatches.bind(Aa);Aa.setAutoFreeze.bind(Aa);Aa.setUseProxies.bind(Aa);Aa.applyPatches.bind(Aa);Aa.createDraft.bind(Aa);Aa.finishDraft.bind(Aa);function NO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $O(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ro(1));return n(lE)(e,t)}if(typeof e!="function")throw new Error(ro(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function d(){if(l)throw new Error(ro(3));return o}function p(w){if(typeof w!="function")throw new Error(ro(4));if(l)throw new Error(ro(5));var E=!0;return u(),s.push(w),function(){if(E){if(l)throw new Error(ro(6));E=!1,u();var k=s.indexOf(w);s.splice(k,1),a=null}}}function m(w){if(!Lxe(w))throw new Error(ro(7));if(typeof w.type>"u")throw new Error(ro(8));if(l)throw new Error(ro(9));try{l=!0,o=i(o,w)}finally{l=!1}for(var E=a=s,_=0;_"u")throw new Error(ro(12));if(typeof n(void 0,{type:v3.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ro(13))})}function wW(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(ro(14));p[y]=E,d=d||E!==w}return d=d||o.length!==Object.keys(l).length,d?p:l}}function y3(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return b3}function i(s,l){r(s)===b3&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var Dxe=function(t,n){return t===n};function jxe(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(D).forEach(function(I){T(I)&&d[I]!==D[I]&&m.indexOf(I)===-1&&m.push(I)}),Object.keys(d).forEach(function(I){D[I]===void 0&&T(I)&&m.indexOf(I)===-1&&d[I]!==void 0&&m.push(I)}),y===null&&(y=setInterval(_,i)),d=D},o)}function _(){if(m.length===0){y&&clearInterval(y),y=null;return}var D=m.shift(),I=r.reduce(function(N,V){return V.in(N,D,d)},d[D]);if(I!==void 0)try{p[D]=l(I)}catch(N){console.error("redux-persist/createPersistoid: error serializing state",N)}else delete p[D];m.length===0&&k()}function k(){Object.keys(p).forEach(function(D){d[D]===void 0&&delete p[D]}),b=s.setItem(a,l(p)).catch(L)}function T(D){return!(n&&n.indexOf(D)===-1&&D!=="_persist"||t&&t.indexOf(D)!==-1)}function L(D){u&&u(D)}var O=function(){for(;m.length!==0;)_();return b||Promise.resolve()};return{update:E,flush:O}}function mSe(e){return JSON.stringify(e)}function vSe(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:cE).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=ySe,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,d){return d.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function ySe(e){return JSON.parse(e)}function bSe(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:cE).concat(e.key);return t.removeItem(n,xSe)}function xSe(e){}function GO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ou(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function CSe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var _Se=5e3;function kSe(e,t){var n=e.version!==void 0?e.version:dSe;e.debug;var r=e.stateReconciler===void 0?pSe:e.stateReconciler,i=e.getStoredState||vSe,o=e.timeout!==void 0?e.timeout:_Se,a=null,s=!1,l=!0,u=function(p){return p._persist.rehydrated&&a&&!l&&a.update(p),p};return function(d,p){var m=d||{},y=m._persist,b=wSe(m,["_persist"]),w=b;if(p.type===TW){var E=!1,_=function(N,V){E||(p.rehydrate(e.key,N,V),E=!0)};if(o&&setTimeout(function(){!E&&_(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=gSe(e)),y)return Ou({},t(w,p),{_persist:y});if(typeof p.rehydrate!="function"||typeof p.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return p.register(e.key),i(e).then(function(I){var N=e.migrate||function(V,B){return Promise.resolve(V)};N(I,n).then(function(V){_(V)},function(V){_(void 0,V)})},function(I){_(void 0,I)}),Ou({},t(w,p),{_persist:{version:n,rehydrated:!1}})}else{if(p.type===MW)return s=!0,p.result(bSe(e)),Ou({},t(w,p),{_persist:y});if(p.type===EW)return p.result(a&&a.flush()),Ou({},t(w,p),{_persist:y});if(p.type===PW)l=!0;else if(p.type===dE){if(s)return Ou({},w,{_persist:Ou({},y,{rehydrated:!0})});if(p.key===e.key){var k=t(w,p),T=p.payload,L=r!==!1&&T!==void 0?r(T,d,k,e):k,O=Ou({},L,{_persist:Ou({},y,{rehydrated:!0})});return u(O)}}}if(!y)return t(d,p);var D=t(w,p);return D===w?d:u(Ou({},D,{_persist:y}))}}function qO(e){return TSe(e)||PSe(e)||ESe()}function ESe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function PSe(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function TSe(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:AW,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case LW:return gk({},t,{registry:[].concat(qO(t.registry),[n.key])});case dE:var r=t.registry.indexOf(n.key),i=qO(t.registry);return i.splice(r,1),gk({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function ASe(e,t,n){var r=n||!1,i=lE(LSe,AW,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:LW,key:u})},a=function(u,d,p){var m={type:dE,payload:d,err:p,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=gk({},i,{purge:function(){var u=[];return e.dispatch({type:MW,result:function(p){u.push(p)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:EW,result:function(p){u.push(p)}}),Promise.all(u)},pause:function(){e.dispatch({type:PW})},persist:function(){e.dispatch({type:TW,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var fE={},hE={};hE.__esModule=!0;hE.default=ISe;function uS(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?uS=function(n){return typeof n}:uS=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},uS(e)}function IC(){}var OSe={getItem:IC,setItem:IC,removeItem:IC};function RSe(e){if((typeof self>"u"?"undefined":uS(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function ISe(e){var t="".concat(e,"Storage");return RSe(t)?self[t]:OSe}fE.__esModule=!0;fE.default=NSe;var DSe=jSe(hE);function jSe(e){return e&&e.__esModule?e:{default:e}}function NSe(e){var t=(0,DSe.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var OW=void 0,$Se=FSe(fE);function FSe(e){return e&&e.__esModule?e:{default:e}}var BSe=(0,$Se.default)("local");OW=BSe;var RW={},IW={},Zh={};Object.defineProperty(Zh,"__esModule",{value:!0});Zh.PLACEHOLDER_UNDEFINED=Zh.PACKAGE_NAME=void 0;Zh.PACKAGE_NAME="redux-deep-persist";Zh.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var pE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})(pE);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=Zh,n=pE,r=function(z){return typeof z=="object"&&z!==null};e.isObjectLike=r;const i=function(z){return typeof z=="number"&&z>-1&&z%1==0&&z<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(z){return(0,e.isLength)(z&&z.length)&&Object.prototype.toString.call(z)==="[object Array]"};const o=function(z){return!!z&&typeof z=="object"&&!(0,e.isArray)(z)};e.isPlainObject=o;const a=function(z){return String(~~z)===z&&Number(z)>=0};e.isIntegerString=a;const s=function(z){return Object.prototype.toString.call(z)==="[object String]"};e.isString=s;const l=function(z){return Object.prototype.toString.call(z)==="[object Date]"};e.isDate=l;const u=function(z){return Object.keys(z).length===0};e.isEmpty=u;const d=Object.prototype.hasOwnProperty,p=function(z,$,H){H||(H=new Set([z])),$||($="");for(const Y in z){const Q=$?`${$}.${Y}`:Y,q=z[Y];if((0,e.isObjectLike)(q))return H.has(q)?`${$}.${Y}:`:(H.add(q),(0,e.getCircularPath)(q,Q,H))}return null};e.getCircularPath=p;const m=function(z){if(!(0,e.isObjectLike)(z))return z;if((0,e.isDate)(z))return new Date(+z);const $=(0,e.isArray)(z)?[]:{};for(const H in z){const Y=z[H];$[H]=(0,e._cloneDeep)(Y)}return $};e._cloneDeep=m;const y=function(z){const $=(0,e.getCircularPath)(z);if($)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${$}' of object you're trying to persist: ${z}`);return(0,e._cloneDeep)(z)};e.cloneDeep=y;const b=function(z,$){if(z===$)return{};if(!(0,e.isObjectLike)(z)||!(0,e.isObjectLike)($))return $;const H=(0,e.cloneDeep)(z),Y=(0,e.cloneDeep)($),Q=Object.keys(H).reduce((X,ee)=>(d.call(Y,ee)||(X[ee]=void 0),X),{});if((0,e.isDate)(H)||(0,e.isDate)(Y))return H.valueOf()===Y.valueOf()?{}:Y;const q=Object.keys(Y).reduce((X,ee)=>{if(!d.call(H,ee))return X[ee]=Y[ee],X;const fe=(0,e.difference)(H[ee],Y[ee]);return(0,e.isObjectLike)(fe)&&(0,e.isEmpty)(fe)&&!(0,e.isDate)(fe)?(0,e.isArray)(H)&&!(0,e.isArray)(Y)||!(0,e.isArray)(H)&&(0,e.isArray)(Y)?Y:X:(X[ee]=fe,X)},Q);return delete q._persist,q};e.difference=b;const w=function(z,$){return $.reduce((H,Y)=>{if(H){const Q=parseInt(Y,10),q=(0,e.isIntegerString)(Y)&&Q<0?H.length+Q:Y;return(0,e.isString)(H)?H.charAt(q):H[q]}},z)};e.path=w;const E=function(z,$){return[...z].reverse().reduce((Q,q,X)=>{const ee=(0,e.isIntegerString)(q)?[]:{};return ee[q]=X===0?$:Q,ee},{})};e.assocPath=E;const _=function(z,$){const H=(0,e.cloneDeep)(z);return $.reduce((Y,Q,q)=>(q===$.length-1&&Y&&(0,e.isObjectLike)(Y)&&delete Y[Q],Y&&Y[Q]),H),H};e.dissocPath=_;const k=function(z,$,...H){if(!H||!H.length)return $;const Y=H.shift(),{preservePlaceholder:Q,preserveUndefined:q}=z;if((0,e.isObjectLike)($)&&(0,e.isObjectLike)(Y))for(const X in Y)if((0,e.isObjectLike)(Y[X])&&(0,e.isObjectLike)($[X]))$[X]||($[X]={}),k(z,$[X],Y[X]);else if((0,e.isArray)($)){let ee=Y[X];const fe=Q?t.PLACEHOLDER_UNDEFINED:void 0;q||(ee=typeof ee<"u"?ee:$[parseInt(X,10)]),ee=ee!==t.PLACEHOLDER_UNDEFINED?ee:fe,$[parseInt(X,10)]=ee}else{const ee=Y[X]!==t.PLACEHOLDER_UNDEFINED?Y[X]:void 0;$[X]=ee}return k(z,$,...H)},T=function(z,$,H){return k({preservePlaceholder:H==null?void 0:H.preservePlaceholder,preserveUndefined:H==null?void 0:H.preserveUndefined},(0,e.cloneDeep)(z),(0,e.cloneDeep)($))};e.mergeDeep=T;const L=function(z,$=[],H,Y,Q){if(!(0,e.isObjectLike)(z))return z;for(const q in z){const X=z[q],ee=(0,e.isArray)(z),fe=Y?Y+"."+q:q;X===null&&(H===n.ConfigType.WHITELIST&&$.indexOf(fe)===-1||H===n.ConfigType.BLACKLIST&&$.indexOf(fe)!==-1)&&ee&&(z[parseInt(q,10)]=void 0),X===void 0&&Q&&H===n.ConfigType.BLACKLIST&&$.indexOf(fe)===-1&&ee&&(z[parseInt(q,10)]=t.PLACEHOLDER_UNDEFINED),L(X,$,H,fe,Q)}},O=function(z,$,H,Y){const Q=(0,e.cloneDeep)(z);return L(Q,$,H,"",Y),Q};e.preserveUndefined=O;const D=function(z,$,H){return H.indexOf(z)===$};e.unique=D;const I=function(z){return z.reduce(($,H)=>{const Y=z.filter(Ee=>Ee===H),Q=z.filter(Ee=>(H+".").indexOf(Ee+".")===0),{duplicates:q,subsets:X}=$,ee=Y.length>1&&q.indexOf(H)===-1,fe=Q.length>1;return{duplicates:[...q,...ee?Y:[]],subsets:[...X,...fe?Q:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=I;const N=function(z,$,H){const Y=H===n.ConfigType.WHITELIST?"whitelist":"blacklist",Q=`${t.PACKAGE_NAME}: incorrect ${Y} configuration.`,q=`Check your create${H===n.ConfigType.WHITELIST?"White":"Black"}list arguments. + */var eE=Symbol.for("react.element"),tE=Symbol.for("react.portal"),Kw=Symbol.for("react.fragment"),Yw=Symbol.for("react.strict_mode"),Xw=Symbol.for("react.profiler"),Zw=Symbol.for("react.provider"),Qw=Symbol.for("react.context"),sxe=Symbol.for("react.server_context"),Jw=Symbol.for("react.forward_ref"),e4=Symbol.for("react.suspense"),t4=Symbol.for("react.suspense_list"),n4=Symbol.for("react.memo"),r4=Symbol.for("react.lazy"),lxe=Symbol.for("react.offscreen"),gW;gW=Symbol.for("react.module.reference");function ps(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case eE:switch(e=e.type,e){case Kw:case Xw:case Yw:case e4:case t4:return e;default:switch(e=e&&e.$$typeof,e){case sxe:case Qw:case Jw:case r4:case n4:case Zw:return e;default:return t}}case tE:return t}}}Nn.ContextConsumer=Qw;Nn.ContextProvider=Zw;Nn.Element=eE;Nn.ForwardRef=Jw;Nn.Fragment=Kw;Nn.Lazy=r4;Nn.Memo=n4;Nn.Portal=tE;Nn.Profiler=Xw;Nn.StrictMode=Yw;Nn.Suspense=e4;Nn.SuspenseList=t4;Nn.isAsyncMode=function(){return!1};Nn.isConcurrentMode=function(){return!1};Nn.isContextConsumer=function(e){return ps(e)===Qw};Nn.isContextProvider=function(e){return ps(e)===Zw};Nn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===eE};Nn.isForwardRef=function(e){return ps(e)===Jw};Nn.isFragment=function(e){return ps(e)===Kw};Nn.isLazy=function(e){return ps(e)===r4};Nn.isMemo=function(e){return ps(e)===n4};Nn.isPortal=function(e){return ps(e)===tE};Nn.isProfiler=function(e){return ps(e)===Xw};Nn.isStrictMode=function(e){return ps(e)===Yw};Nn.isSuspense=function(e){return ps(e)===e4};Nn.isSuspenseList=function(e){return ps(e)===t4};Nn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Kw||e===Xw||e===Yw||e===e4||e===t4||e===lxe||typeof e=="object"&&e!==null&&(e.$$typeof===r4||e.$$typeof===n4||e.$$typeof===Zw||e.$$typeof===Qw||e.$$typeof===Jw||e.$$typeof===gW||e.getModuleId!==void 0)};Nn.typeOf=ps;(function(e){e.exports=Nn})(axe);function uxe(){const e=exe();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const MO={notify(){},get:()=>[]};function cxe(e,t){let n,r=MO;function i(p){return l(),r.subscribe(p)}function o(){r.notify()}function a(){d.onStateChange&&d.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=uxe())}function u(){n&&(n(),n=void 0,r.clear(),r=MO)}const d={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return d}const dxe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",fxe=dxe?S.useLayoutEffect:S.useEffect;function hxe({store:e,context:t,children:n,serverState:r}){const i=S.useMemo(()=>{const s=cxe(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=S.useMemo(()=>e.getState(),[e]);fxe(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]);const a=t||Zd;return Ke.createElement(a.Provider,{value:i},n)}function mW(e=Zd){const t=e===Zd?hW:()=>S.useContext(e);return function(){const{store:r}=t();return r}}const pxe=mW();function gxe(e=Zd){const t=e===Zd?pxe:mW(e);return function(){return t().dispatch}}const mxe=gxe();nxe(sk.useSyncExternalStoreWithSelector);Jbe(Xs.unstable_batchedUpdates);function oS(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?oS=function(n){return typeof n}:oS=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},oS(e)}function vxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LO(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:nE(e)?2:rE(e)?3:0}function Pm(e,t){return m0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Sxe(e,t){return m0(e)===2?e.get(t):e[t]}function yW(e,t,n){var r=m0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function bW(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function nE(e){return Pxe&&e instanceof Map}function rE(e){return Txe&&e instanceof Set}function fh(e){return e.o||e.t}function iE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=SW(e);delete t[vr];for(var n=Tm(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=wxe),Object.freeze(e),t&&Xh(e,function(n,r){return oE(r,!0)},!0)),e}function wxe(){Vs(2)}function aE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Ql(e){var t=hk[e];return t||Vs(18,e),t}function Cxe(e,t){hk[e]||(hk[e]=t)}function ck(){return Ry}function PC(e,t){t&&(Ql("Patches"),e.u=[],e.s=[],e.v=t)}function p3(e){dk(e),e.p.forEach(_xe),e.p=null}function dk(e){e===Ry&&(Ry=e.l)}function AO(e){return Ry={p:[],l:Ry,h:e,m:!0,_:0}}function _xe(e){var t=e[vr];t.i===0||t.i===1?t.j():t.O=!0}function TC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||Ql("ES5").S(t,e,r),r?(n[vr].P&&(p3(t),Vs(4)),ac(e)&&(e=g3(t,e),t.l||m3(t,e)),t.u&&Ql("Patches").M(n[vr].t,e,t.u,t.s)):e=g3(t,n,[]),p3(t),t.u&&t.v(t.u,t.s),e!==xW?e:void 0}function g3(e,t,n){if(aE(t))return t;var r=t[vr];if(!r)return Xh(t,function(s,l){return OO(e,r,t,s,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return m3(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=iE(r.k):r.o,o=i,a=!1;r.i===3&&(o=new Set(i),i.clear(),a=!0),Xh(o,function(s,l){return OO(e,r,i,s,l,n,a)}),m3(e,i,!1),n&&e.u&&Ql("Patches").N(r,n,e.u,e.s)}return r.o}function OO(e,t,n,r,i,o,a){if(Qd(i)){var s=g3(e,i,o&&t&&t.i!==3&&!Pm(t.R,r)?o.concat(r):void 0);if(yW(n,r,s),!Qd(s))return;e.m=!1}else a&&n.add(i);if(ac(i)&&!aE(i)){if(!e.h.D&&e._<1)return;g3(e,i),t&&t.A.l||m3(e,i)}}function m3(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&oE(t,n)}function MC(e,t){var n=e[vr];return(n?fh(n):e)[t]}function RO(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function xd(e){e.P||(e.P=!0,e.l&&xd(e.l))}function LC(e){e.o||(e.o=iE(e.t))}function fk(e,t,n){var r=nE(t)?Ql("MapSet").F(t,n):rE(t)?Ql("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:ck(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=Iy;a&&(l=[s],u=f1);var d=Proxy.revocable(l,u),p=d.revoke,m=d.proxy;return s.k=m,s.j=p,m}(t,n):Ql("ES5").J(t,n);return(n?n.A:ck()).p.push(r),r}function kxe(e){return Qd(e)||Vs(22,e),function t(n){if(!ac(n))return n;var r,i=n[vr],o=m0(n);if(i){if(!i.P&&(i.i<4||!Ql("ES5").K(i)))return i.t;i.I=!0,r=IO(n,o),i.I=!1}else r=IO(n,o);return Xh(r,function(a,s){i&&Sxe(i.t,a)===s||yW(r,a,t(s))}),o===3?new Set(r):r}(e)}function IO(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return iE(e)}function Exe(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[vr];return Iy.get(l,o)},set:function(l){var u=this[vr];Iy.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][vr];if(!s.P)switch(s.i){case 5:r(s)&&xd(s);break;case 4:n(s)&&xd(s)}}}function n(o){for(var a=o.t,s=o.k,l=Tm(s),u=l.length-1;u>=0;u--){var d=l[u];if(d!==vr){var p=a[d];if(p===void 0&&!Pm(a,d))return!0;var m=s[d],y=m&&m[vr];if(y?y.t!==p:!bW(m,p))return!0}}var b=!!a[vr];return l.length!==Tm(a).length+(b?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l1?_-1:0),T=1;T<_;T++)k[T-1]=arguments[T];return l.produce(w,function(L){var O;return(O=o).call.apply(O,[E,L].concat(k))})}}var u;if(typeof o!="function"&&Vs(6),a!==void 0&&typeof a!="function"&&Vs(7),ac(i)){var d=AO(r),p=fk(r,i,void 0),m=!0;try{u=o(p),m=!1}finally{m?p3(d):dk(d)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(w){return PC(d,a),TC(w,d)},function(w){throw p3(d),w}):(PC(d,a),TC(u,d))}if(!i||typeof i!="object"){if((u=o(i))===void 0&&(u=i),u===xW&&(u=void 0),r.D&&oE(u,!0),a){var y=[],b=[];Ql("Patches").M(i,u,y,b),a(y,b)}return u}Vs(21,i)},this.produceWithPatches=function(i,o){if(typeof i=="function")return function(u){for(var d=arguments.length,p=Array(d>1?d-1:0),m=1;m=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=Ql("Patches").$;return Qd(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Oa=new Lxe,wW=Oa.produce;Oa.produceWithPatches.bind(Oa);Oa.setAutoFreeze.bind(Oa);Oa.setUseProxies.bind(Oa);Oa.applyPatches.bind(Oa);Oa.createDraft.bind(Oa);Oa.finishDraft.bind(Oa);function $O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function FO(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ro(1));return n(lE)(e,t)}if(typeof e!="function")throw new Error(ro(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function d(){if(l)throw new Error(ro(3));return o}function p(w){if(typeof w!="function")throw new Error(ro(4));if(l)throw new Error(ro(5));var E=!0;return u(),s.push(w),function(){if(E){if(l)throw new Error(ro(6));E=!1,u();var k=s.indexOf(w);s.splice(k,1),a=null}}}function m(w){if(!Axe(w))throw new Error(ro(7));if(typeof w.type>"u")throw new Error(ro(8));if(l)throw new Error(ro(9));try{l=!0,o=i(o,w)}finally{l=!1}for(var E=a=s,_=0;_"u")throw new Error(ro(12));if(typeof n(void 0,{type:v3.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ro(13))})}function CW(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(ro(14));p[y]=E,d=d||E!==w}return d=d||o.length!==Object.keys(l).length,d?p:l}}function y3(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return b3}function i(s,l){r(s)===b3&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var jxe=function(t,n){return t===n};function Nxe(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(D).forEach(function(I){T(I)&&d[I]!==D[I]&&m.indexOf(I)===-1&&m.push(I)}),Object.keys(d).forEach(function(I){D[I]===void 0&&T(I)&&m.indexOf(I)===-1&&d[I]!==void 0&&m.push(I)}),y===null&&(y=setInterval(_,i)),d=D},o)}function _(){if(m.length===0){y&&clearInterval(y),y=null;return}var D=m.shift(),I=r.reduce(function(N,U){return U.in(N,D,d)},d[D]);if(I!==void 0)try{p[D]=l(I)}catch(N){console.error("redux-persist/createPersistoid: error serializing state",N)}else delete p[D];m.length===0&&k()}function k(){Object.keys(p).forEach(function(D){d[D]===void 0&&delete p[D]}),b=s.setItem(a,l(p)).catch(L)}function T(D){return!(n&&n.indexOf(D)===-1&&D!=="_persist"||t&&t.indexOf(D)!==-1)}function L(D){u&&u(D)}var O=function(){for(;m.length!==0;)_();return b||Promise.resolve()};return{update:E,flush:O}}function vSe(e){return JSON.stringify(e)}function ySe(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:cE).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=bSe,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,d){return d.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function bSe(e){return JSON.parse(e)}function xSe(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:cE).concat(e.key);return t.removeItem(n,SSe)}function SSe(e){}function qO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ou(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _Se(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var kSe=5e3;function ESe(e,t){var n=e.version!==void 0?e.version:fSe;e.debug;var r=e.stateReconciler===void 0?gSe:e.stateReconciler,i=e.getStoredState||ySe,o=e.timeout!==void 0?e.timeout:kSe,a=null,s=!1,l=!0,u=function(p){return p._persist.rehydrated&&a&&!l&&a.update(p),p};return function(d,p){var m=d||{},y=m._persist,b=CSe(m,["_persist"]),w=b;if(p.type===MW){var E=!1,_=function(N,U){E||(p.rehydrate(e.key,N,U),E=!0)};if(o&&setTimeout(function(){!E&&_(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=mSe(e)),y)return Ou({},t(w,p),{_persist:y});if(typeof p.rehydrate!="function"||typeof p.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return p.register(e.key),i(e).then(function(I){var N=e.migrate||function(U,B){return Promise.resolve(U)};N(I,n).then(function(U){_(U)},function(U){_(void 0,U)})},function(I){_(void 0,I)}),Ou({},t(w,p),{_persist:{version:n,rehydrated:!1}})}else{if(p.type===LW)return s=!0,p.result(xSe(e)),Ou({},t(w,p),{_persist:y});if(p.type===PW)return p.result(a&&a.flush()),Ou({},t(w,p),{_persist:y});if(p.type===TW)l=!0;else if(p.type===dE){if(s)return Ou({},w,{_persist:Ou({},y,{rehydrated:!0})});if(p.key===e.key){var k=t(w,p),T=p.payload,L=r!==!1&&T!==void 0?r(T,d,k,e):k,O=Ou({},L,{_persist:Ou({},y,{rehydrated:!0})});return u(O)}}}if(!y)return t(d,p);var D=t(w,p);return D===w?d:u(Ou({},D,{_persist:y}))}}function KO(e){return MSe(e)||TSe(e)||PSe()}function PSe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function TSe(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function MSe(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:OW,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case AW:return gk({},t,{registry:[].concat(KO(t.registry),[n.key])});case dE:var r=t.registry.indexOf(n.key),i=KO(t.registry);return i.splice(r,1),gk({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function OSe(e,t,n){var r=n||!1,i=lE(ASe,OW,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:AW,key:u})},a=function(u,d,p){var m={type:dE,payload:d,err:p,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=gk({},i,{purge:function(){var u=[];return e.dispatch({type:LW,result:function(p){u.push(p)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:PW,result:function(p){u.push(p)}}),Promise.all(u)},pause:function(){e.dispatch({type:TW})},persist:function(){e.dispatch({type:MW,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var fE={},hE={};hE.__esModule=!0;hE.default=DSe;function uS(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?uS=function(n){return typeof n}:uS=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},uS(e)}function IC(){}var RSe={getItem:IC,setItem:IC,removeItem:IC};function ISe(e){if((typeof self>"u"?"undefined":uS(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function DSe(e){var t="".concat(e,"Storage");return ISe(t)?self[t]:RSe}fE.__esModule=!0;fE.default=$Se;var jSe=NSe(hE);function NSe(e){return e&&e.__esModule?e:{default:e}}function $Se(e){var t=(0,jSe.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var RW=void 0,FSe=BSe(fE);function BSe(e){return e&&e.__esModule?e:{default:e}}var zSe=(0,FSe.default)("local");RW=zSe;var IW={},DW={},Zh={};Object.defineProperty(Zh,"__esModule",{value:!0});Zh.PLACEHOLDER_UNDEFINED=Zh.PACKAGE_NAME=void 0;Zh.PACKAGE_NAME="redux-deep-persist";Zh.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var pE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})(pE);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=Zh,n=pE,r=function(z){return typeof z=="object"&&z!==null};e.isObjectLike=r;const i=function(z){return typeof z=="number"&&z>-1&&z%1==0&&z<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(z){return(0,e.isLength)(z&&z.length)&&Object.prototype.toString.call(z)==="[object Array]"};const o=function(z){return!!z&&typeof z=="object"&&!(0,e.isArray)(z)};e.isPlainObject=o;const a=function(z){return String(~~z)===z&&Number(z)>=0};e.isIntegerString=a;const s=function(z){return Object.prototype.toString.call(z)==="[object String]"};e.isString=s;const l=function(z){return Object.prototype.toString.call(z)==="[object Date]"};e.isDate=l;const u=function(z){return Object.keys(z).length===0};e.isEmpty=u;const d=Object.prototype.hasOwnProperty,p=function(z,$,H){H||(H=new Set([z])),$||($="");for(const Y in z){const Q=$?`${$}.${Y}`:Y,q=z[Y];if((0,e.isObjectLike)(q))return H.has(q)?`${$}.${Y}:`:(H.add(q),(0,e.getCircularPath)(q,Q,H))}return null};e.getCircularPath=p;const m=function(z){if(!(0,e.isObjectLike)(z))return z;if((0,e.isDate)(z))return new Date(+z);const $=(0,e.isArray)(z)?[]:{};for(const H in z){const Y=z[H];$[H]=(0,e._cloneDeep)(Y)}return $};e._cloneDeep=m;const y=function(z){const $=(0,e.getCircularPath)(z);if($)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${$}' of object you're trying to persist: ${z}`);return(0,e._cloneDeep)(z)};e.cloneDeep=y;const b=function(z,$){if(z===$)return{};if(!(0,e.isObjectLike)(z)||!(0,e.isObjectLike)($))return $;const H=(0,e.cloneDeep)(z),Y=(0,e.cloneDeep)($),Q=Object.keys(H).reduce((X,ee)=>(d.call(Y,ee)||(X[ee]=void 0),X),{});if((0,e.isDate)(H)||(0,e.isDate)(Y))return H.valueOf()===Y.valueOf()?{}:Y;const q=Object.keys(Y).reduce((X,ee)=>{if(!d.call(H,ee))return X[ee]=Y[ee],X;const fe=(0,e.difference)(H[ee],Y[ee]);return(0,e.isObjectLike)(fe)&&(0,e.isEmpty)(fe)&&!(0,e.isDate)(fe)?(0,e.isArray)(H)&&!(0,e.isArray)(Y)||!(0,e.isArray)(H)&&(0,e.isArray)(Y)?Y:X:(X[ee]=fe,X)},Q);return delete q._persist,q};e.difference=b;const w=function(z,$){return $.reduce((H,Y)=>{if(H){const Q=parseInt(Y,10),q=(0,e.isIntegerString)(Y)&&Q<0?H.length+Q:Y;return(0,e.isString)(H)?H.charAt(q):H[q]}},z)};e.path=w;const E=function(z,$){return[...z].reverse().reduce((Q,q,X)=>{const ee=(0,e.isIntegerString)(q)?[]:{};return ee[q]=X===0?$:Q,ee},{})};e.assocPath=E;const _=function(z,$){const H=(0,e.cloneDeep)(z);return $.reduce((Y,Q,q)=>(q===$.length-1&&Y&&(0,e.isObjectLike)(Y)&&delete Y[Q],Y&&Y[Q]),H),H};e.dissocPath=_;const k=function(z,$,...H){if(!H||!H.length)return $;const Y=H.shift(),{preservePlaceholder:Q,preserveUndefined:q}=z;if((0,e.isObjectLike)($)&&(0,e.isObjectLike)(Y))for(const X in Y)if((0,e.isObjectLike)(Y[X])&&(0,e.isObjectLike)($[X]))$[X]||($[X]={}),k(z,$[X],Y[X]);else if((0,e.isArray)($)){let ee=Y[X];const fe=Q?t.PLACEHOLDER_UNDEFINED:void 0;q||(ee=typeof ee<"u"?ee:$[parseInt(X,10)]),ee=ee!==t.PLACEHOLDER_UNDEFINED?ee:fe,$[parseInt(X,10)]=ee}else{const ee=Y[X]!==t.PLACEHOLDER_UNDEFINED?Y[X]:void 0;$[X]=ee}return k(z,$,...H)},T=function(z,$,H){return k({preservePlaceholder:H==null?void 0:H.preservePlaceholder,preserveUndefined:H==null?void 0:H.preserveUndefined},(0,e.cloneDeep)(z),(0,e.cloneDeep)($))};e.mergeDeep=T;const L=function(z,$=[],H,Y,Q){if(!(0,e.isObjectLike)(z))return z;for(const q in z){const X=z[q],ee=(0,e.isArray)(z),fe=Y?Y+"."+q:q;X===null&&(H===n.ConfigType.WHITELIST&&$.indexOf(fe)===-1||H===n.ConfigType.BLACKLIST&&$.indexOf(fe)!==-1)&&ee&&(z[parseInt(q,10)]=void 0),X===void 0&&Q&&H===n.ConfigType.BLACKLIST&&$.indexOf(fe)===-1&&ee&&(z[parseInt(q,10)]=t.PLACEHOLDER_UNDEFINED),L(X,$,H,fe,Q)}},O=function(z,$,H,Y){const Q=(0,e.cloneDeep)(z);return L(Q,$,H,"",Y),Q};e.preserveUndefined=O;const D=function(z,$,H){return H.indexOf(z)===$};e.unique=D;const I=function(z){return z.reduce(($,H)=>{const Y=z.filter(ke=>ke===H),Q=z.filter(ke=>(H+".").indexOf(ke+".")===0),{duplicates:q,subsets:X}=$,ee=Y.length>1&&q.indexOf(H)===-1,fe=Q.length>1;return{duplicates:[...q,...ee?Y:[]],subsets:[...X,...fe?Q:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=I;const N=function(z,$,H){const Y=H===n.ConfigType.WHITELIST?"whitelist":"blacklist",Q=`${t.PACKAGE_NAME}: incorrect ${Y} configuration.`,q=`Check your create${H===n.ConfigType.WHITELIST?"White":"Black"}list arguments. `;if(!(0,e.isString)($)||$.length<1)throw new Error(`${Q} Name (key) of reducer is required. ${q}`);if(!z||!z.length)return;const{duplicates:X,subsets:ee}=(0,e.findDuplicatesAndSubsets)(z);if(X.length>1)throw new Error(`${Q} Duplicated paths. @@ -441,41 +441,41 @@ Error generating stack: `+o.message+` ${JSON.stringify(ee)} - ${q}`)};e.singleTransformValidator=N;const V=function(z){if(!(0,e.isArray)(z))return;const $=(z==null?void 0:z.map(H=>H.deepPersistKey).filter(H=>H))||[];if($.length){const H=$.filter((Y,Q)=>$.indexOf(Y)!==Q);if(H.length)throw new Error(`${t.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed. + ${q}`)};e.singleTransformValidator=N;const U=function(z){if(!(0,e.isArray)(z))return;const $=(z==null?void 0:z.map(H=>H.deepPersistKey).filter(H=>H))||[];if($.length){const H=$.filter((Y,Q)=>$.indexOf(Y)!==Q);if(H.length)throw new Error(`${t.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed. - Duplicates: ${JSON.stringify(H)}`)}};e.transformsValidator=V;const B=function({whitelist:z,blacklist:$}){if(z&&z.length&&$&&$.length)throw new Error(`${t.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(z){const{duplicates:H,subsets:Y}=(0,e.findDuplicatesAndSubsets)(z);(0,e.throwError)({duplicates:H,subsets:Y},"whitelist")}if($){const{duplicates:H,subsets:Y}=(0,e.findDuplicatesAndSubsets)($);(0,e.throwError)({duplicates:H,subsets:Y},"blacklist")}};e.configValidator=B;const K=function({duplicates:z,subsets:$},H){if(z.length)throw new Error(`${t.PACKAGE_NAME}: duplicates of paths found in your ${H}. + Duplicates: ${JSON.stringify(H)}`)}};e.transformsValidator=U;const B=function({whitelist:z,blacklist:$}){if(z&&z.length&&$&&$.length)throw new Error(`${t.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(z){const{duplicates:H,subsets:Y}=(0,e.findDuplicatesAndSubsets)(z);(0,e.throwError)({duplicates:H,subsets:Y},"whitelist")}if($){const{duplicates:H,subsets:Y}=(0,e.findDuplicatesAndSubsets)($);(0,e.throwError)({duplicates:H,subsets:Y},"blacklist")}};e.configValidator=B;const K=function({duplicates:z,subsets:$},H){if(z.length)throw new Error(`${t.PACKAGE_NAME}: duplicates of paths found in your ${H}. ${JSON.stringify(z)}`);if($.length)throw new Error(`${t.PACKAGE_NAME}: subsets of some parent keys found in your ${H}. You must decide if you want to persist an entire path or its specific subset. - ${JSON.stringify($)}`)};e.throwError=K;const ne=function(z){return(0,e.isArray)(z)?z.filter(e.unique).reduce(($,H)=>{const Y=H.split("."),Q=Y[0],q=Y.slice(1).join(".")||void 0,X=$.filter(fe=>Object.keys(fe)[0]===Q)[0],ee=X?Object.values(X)[0]:void 0;return X||$.push({[Q]:q?[q]:void 0}),X&&!ee&&q&&(X[Q]=[q]),X&&ee&&q&&ee.push(q),$},[]):[]};e.getRootKeysGroup=ne})(IW);(function(e){var t=So&&So.__rest||function(p,m){var y={};for(var b in p)Object.prototype.hasOwnProperty.call(p,b)&&m.indexOf(b)<0&&(y[b]=p[b]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var w=0,b=Object.getOwnPropertySymbols(p);w!E(k)&&p?p(_,k,T):_,out:(_,k,T)=>!E(k)&&m?m(_,k,T):_,deepPersistKey:b&&b[0]}},a=(p,m,y,{debug:b,whitelist:w,blacklist:E,transforms:_})=>{if(w||E)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(_);const k=(0,n.cloneDeep)(y);let T=p;if(T&&(0,n.isObjectLike)(T)){const L=(0,n.difference)(m,y);(0,n.isEmpty)(L)||(T=(0,n.mergeDeep)(p,L,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(L)}`)),Object.keys(T).forEach(O=>{if(O!=="_persist"){if((0,n.isObjectLike)(k[O])){k[O]=(0,n.mergeDeep)(k[O],T[O]);return}k[O]=T[O]}})}return b&&T&&(0,n.isObjectLike)(T)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(T)}`),k};e.autoMergeDeep=a;const s=(p,m)=>((0,n.singleTransformValidator)(m,p,i.ConfigType.WHITELIST),o(y=>{if(!m||!m.length)return y;let b=null,w;return m.forEach(E=>{const _=E.split(".");w=(0,n.path)(y,_),typeof w>"u"&&(0,n.isIntegerString)(_[_.length-1])&&(w=r.PLACEHOLDER_UNDEFINED);const k=(0,n.assocPath)(_,w),T=(0,n.isArray)(k)?[]:{};b=(0,n.mergeDeep)(b||T,k,{preservePlaceholder:!0})}),b||y},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.WHITELIST),{whitelist:[p]}));e.createWhitelist=s;const l=(p,m)=>((0,n.singleTransformValidator)(m,p,i.ConfigType.BLACKLIST),o(y=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST,!0);return m.map(E=>E.split(".")).reduce((E,_)=>(0,n.dissocPath)(E,_),b)},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST),{whitelist:[p]}));e.createBlacklist=l;const u=function(p,m){return m.map(y=>{const b=Object.keys(y)[0],w=y[b];return p===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,w):(0,e.createBlacklist)(b,w)})};e.getTransforms=u;const d=p=>{var{key:m,whitelist:y,blacklist:b,storage:w,transforms:E,rootReducer:_}=p,k=t(p,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:y,blacklist:b});const T=(0,n.getRootKeysGroup)(y),L=(0,n.getRootKeysGroup)(b),O=Object.keys(_(void 0,{type:""})),D=T.map(ne=>Object.keys(ne)[0]),I=L.map(ne=>Object.keys(ne)[0]),N=O.filter(ne=>D.indexOf(ne)===-1&&I.indexOf(ne)===-1),V=(0,e.getTransforms)(i.ConfigType.WHITELIST,T),B=(0,e.getTransforms)(i.ConfigType.BLACKLIST,L),K=(0,n.isArray)(y)?N.map(ne=>(0,e.createBlacklist)(ne)):[];return Object.assign(Object.assign({},k),{key:m,storage:w,transforms:[...V,...B,...K,...E||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=d})(RW);const Cd=(e,t)=>Math.floor(e/t)*t,Hl=(e,t)=>Math.round(e/t)*t;var Te={},zSe={get exports(){return Te},set exports(e){Te=e}};/** + ${JSON.stringify($)}`)};e.throwError=K;const ne=function(z){return(0,e.isArray)(z)?z.filter(e.unique).reduce(($,H)=>{const Y=H.split("."),Q=Y[0],q=Y.slice(1).join(".")||void 0,X=$.filter(fe=>Object.keys(fe)[0]===Q)[0],ee=X?Object.values(X)[0]:void 0;return X||$.push({[Q]:q?[q]:void 0}),X&&!ee&&q&&(X[Q]=[q]),X&&ee&&q&&ee.push(q),$},[]):[]};e.getRootKeysGroup=ne})(DW);(function(e){var t=So&&So.__rest||function(p,m){var y={};for(var b in p)Object.prototype.hasOwnProperty.call(p,b)&&m.indexOf(b)<0&&(y[b]=p[b]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var w=0,b=Object.getOwnPropertySymbols(p);w!E(k)&&p?p(_,k,T):_,out:(_,k,T)=>!E(k)&&m?m(_,k,T):_,deepPersistKey:b&&b[0]}},a=(p,m,y,{debug:b,whitelist:w,blacklist:E,transforms:_})=>{if(w||E)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(_);const k=(0,n.cloneDeep)(y);let T=p;if(T&&(0,n.isObjectLike)(T)){const L=(0,n.difference)(m,y);(0,n.isEmpty)(L)||(T=(0,n.mergeDeep)(p,L,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(L)}`)),Object.keys(T).forEach(O=>{if(O!=="_persist"){if((0,n.isObjectLike)(k[O])){k[O]=(0,n.mergeDeep)(k[O],T[O]);return}k[O]=T[O]}})}return b&&T&&(0,n.isObjectLike)(T)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(T)}`),k};e.autoMergeDeep=a;const s=(p,m)=>((0,n.singleTransformValidator)(m,p,i.ConfigType.WHITELIST),o(y=>{if(!m||!m.length)return y;let b=null,w;return m.forEach(E=>{const _=E.split(".");w=(0,n.path)(y,_),typeof w>"u"&&(0,n.isIntegerString)(_[_.length-1])&&(w=r.PLACEHOLDER_UNDEFINED);const k=(0,n.assocPath)(_,w),T=(0,n.isArray)(k)?[]:{};b=(0,n.mergeDeep)(b||T,k,{preservePlaceholder:!0})}),b||y},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.WHITELIST),{whitelist:[p]}));e.createWhitelist=s;const l=(p,m)=>((0,n.singleTransformValidator)(m,p,i.ConfigType.BLACKLIST),o(y=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST,!0);return m.map(E=>E.split(".")).reduce((E,_)=>(0,n.dissocPath)(E,_),b)},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST),{whitelist:[p]}));e.createBlacklist=l;const u=function(p,m){return m.map(y=>{const b=Object.keys(y)[0],w=y[b];return p===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,w):(0,e.createBlacklist)(b,w)})};e.getTransforms=u;const d=p=>{var{key:m,whitelist:y,blacklist:b,storage:w,transforms:E,rootReducer:_}=p,k=t(p,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:y,blacklist:b});const T=(0,n.getRootKeysGroup)(y),L=(0,n.getRootKeysGroup)(b),O=Object.keys(_(void 0,{type:""})),D=T.map(ne=>Object.keys(ne)[0]),I=L.map(ne=>Object.keys(ne)[0]),N=O.filter(ne=>D.indexOf(ne)===-1&&I.indexOf(ne)===-1),U=(0,e.getTransforms)(i.ConfigType.WHITELIST,T),B=(0,e.getTransforms)(i.ConfigType.BLACKLIST,L),K=(0,n.isArray)(y)?N.map(ne=>(0,e.createBlacklist)(ne)):[];return Object.assign(Object.assign({},k),{key:m,storage:w,transforms:[...U,...B,...K,...E||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=d})(IW);const Cd=(e,t)=>Math.floor(e/t)*t,Hl=(e,t)=>Math.round(e/t)*t;var Pe={},HSe={get exports(){return Pe},set exports(e){Pe=e}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",p=1,m=2,y=4,b=1,w=2,E=1,_=2,k=4,T=8,L=16,O=32,D=64,I=128,N=256,V=512,B=30,K="...",ne=800,z=16,$=1,H=2,Y=3,Q=1/0,q=9007199254740991,X=17976931348623157e292,ee=0/0,fe=4294967295,Ee=fe-1,we=fe>>>1,xe=[["ary",I],["bind",E],["bindKey",_],["curry",T],["curryRight",L],["flip",V],["partial",O],["partialRight",D],["rearg",N]],Ae="[object Arguments]",Se="[object Array]",Qe="[object AsyncFunction]",Ye="[object Boolean]",nt="[object Date]",vt="[object DOMException]",Ce="[object Error]",et="[object Function]",yt="[object GeneratorFunction]",ze="[object Map]",at="[object Number]",jt="[object Null]",gt="[object Object]",Jt="[object Promise]",on="[object Proxy]",se="[object RegExp]",Ie="[object Set]",Ne="[object String]",Ue="[object Symbol]",be="[object Undefined]",je="[object WeakMap]",bt="[object WeakSet]",Dt="[object ArrayBuffer]",Me="[object DataView]",Ct="[object Float32Array]",zt="[object Float64Array]",$n="[object Int8Array]",Ge="[object Int16Array]",pt="[object Int32Array]",zr="[object Uint8Array]",rr="[object Uint8ClampedArray]",Bn="[object Uint16Array]",li="[object Uint32Array]",vs=/\b__p \+= '';/g,tl=/\b(__p \+=) '' \+/g,gf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ys=/&(?:amp|lt|gt|quot|#39);/g,Xi=/[&<>"']/g,C0=RegExp(ys.source),ja=RegExp(Xi.source),wp=/<%-([\s\S]+?)%>/g,_0=/<%([\s\S]+?)%>/g,bc=/<%=([\s\S]+?)%>/g,Cp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_p=/^\w*$/,na=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mf=/[\\^$.*+?()[\]{}|]/g,k0=RegExp(mf.source),xc=/^\s+/,vf=/\s/,E0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,nl=/\{\n\/\* \[wrapped with (.+)\] \*/,Sc=/,? & /,P0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,T0=/[()=,{}\[\]\/\s]/,M0=/\\(\\)?/g,L0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,bs=/\w*$/,A0=/^[-+]0x[0-9a-f]+$/i,O0=/^0b[01]+$/i,R0=/^\[object .+?Constructor\]$/,I0=/^0o[0-7]+$/i,D0=/^(?:0|[1-9]\d*)$/,j0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rl=/($^)/,N0=/['\n\r\u2028\u2029\\]/g,xs="\\ud800-\\udfff",fu="\\u0300-\\u036f",hu="\\ufe20-\\ufe2f",il="\\u20d0-\\u20ff",pu=fu+hu+il,kp="\\u2700-\\u27bf",wc="a-z\\xdf-\\xf6\\xf8-\\xff",ol="\\xac\\xb1\\xd7\\xf7",ra="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Mn="\\u2000-\\u206f",wn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ia="A-Z\\xc0-\\xd6\\xd8-\\xde",Hr="\\ufe0e\\ufe0f",ui=ol+ra+Mn+wn,oa="['’]",al="["+xs+"]",ci="["+ui+"]",Ss="["+pu+"]",yf="\\d+",gu="["+kp+"]",ws="["+wc+"]",bf="[^"+xs+ui+yf+kp+wc+ia+"]",Ri="\\ud83c[\\udffb-\\udfff]",Ep="(?:"+Ss+"|"+Ri+")",Pp="[^"+xs+"]",xf="(?:\\ud83c[\\udde6-\\uddff]){2}",sl="[\\ud800-\\udbff][\\udc00-\\udfff]",Mo="["+ia+"]",ll="\\u200d",mu="(?:"+ws+"|"+bf+")",$0="(?:"+Mo+"|"+bf+")",Cc="(?:"+oa+"(?:d|ll|m|re|s|t|ve))?",_c="(?:"+oa+"(?:D|LL|M|RE|S|T|VE))?",Sf=Ep+"?",kc="["+Hr+"]?",Na="(?:"+ll+"(?:"+[Pp,xf,sl].join("|")+")"+kc+Sf+")*",wf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Gt=kc+Sf+Na,Tp="(?:"+[gu,xf,sl].join("|")+")"+Gt,Ec="(?:"+[Pp+Ss+"?",Ss,xf,sl,al].join("|")+")",Pc=RegExp(oa,"g"),Mp=RegExp(Ss,"g"),aa=RegExp(Ri+"(?="+Ri+")|"+Ec+Gt,"g"),Xn=RegExp([Mo+"?"+ws+"+"+Cc+"(?="+[ci,Mo,"$"].join("|")+")",$0+"+"+_c+"(?="+[ci,Mo+mu,"$"].join("|")+")",Mo+"?"+mu+"+"+Cc,Mo+"+"+_c,vu,wf,yf,Tp].join("|"),"g"),Cf=RegExp("["+ll+xs+pu+Hr+"]"),Lp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_f=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ap=-1,cn={};cn[Ct]=cn[zt]=cn[$n]=cn[Ge]=cn[pt]=cn[zr]=cn[rr]=cn[Bn]=cn[li]=!0,cn[Ae]=cn[Se]=cn[Dt]=cn[Ye]=cn[Me]=cn[nt]=cn[Ce]=cn[et]=cn[ze]=cn[at]=cn[gt]=cn[se]=cn[Ie]=cn[Ne]=cn[je]=!1;var qt={};qt[Ae]=qt[Se]=qt[Dt]=qt[Me]=qt[Ye]=qt[nt]=qt[Ct]=qt[zt]=qt[$n]=qt[Ge]=qt[pt]=qt[ze]=qt[at]=qt[gt]=qt[se]=qt[Ie]=qt[Ne]=qt[Ue]=qt[zr]=qt[rr]=qt[Bn]=qt[li]=!0,qt[Ce]=qt[et]=qt[je]=!1;var Op={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},F0={"&":"&","<":"<",">":">",'"':""","'":"'"},G={"&":"&","<":"<",">":">",""":'"',"'":"'"},re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pe=parseFloat,ot=parseInt,Ht=typeof So=="object"&&So&&So.Object===Object&&So,mn=typeof self=="object"&&self&&self.Object===Object&&self,St=Ht||mn||Function("return this")(),At=t&&!t.nodeType&&t,Kt=At&&!0&&e&&!e.nodeType&&e,Jr=Kt&&Kt.exports===At,Ar=Jr&&Ht.process,vn=function(){try{var ie=Kt&&Kt.require&&Kt.require("util").types;return ie||Ar&&Ar.binding&&Ar.binding("util")}catch{}}(),di=vn&&vn.isArrayBuffer,Lo=vn&&vn.isDate,uo=vn&&vn.isMap,$a=vn&&vn.isRegExp,ul=vn&&vn.isSet,B0=vn&&vn.isTypedArray;function Ii(ie,ye,me){switch(me.length){case 0:return ie.call(ye);case 1:return ie.call(ye,me[0]);case 2:return ie.call(ye,me[0],me[1]);case 3:return ie.call(ye,me[0],me[1],me[2])}return ie.apply(ye,me)}function z0(ie,ye,me,rt){for(var Mt=-1,en=ie==null?0:ie.length;++Mt-1}function Rp(ie,ye,me){for(var rt=-1,Mt=ie==null?0:ie.length;++rt-1;);return me}function Cs(ie,ye){for(var me=ie.length;me--&&Lc(ye,ie[me],0)>-1;);return me}function W0(ie,ye){for(var me=ie.length,rt=0;me--;)ie[me]===ye&&++rt;return rt}var O2=Tf(Op),_s=Tf(F0);function dl(ie){return"\\"+re[ie]}function Dp(ie,ye){return ie==null?n:ie[ye]}function bu(ie){return Cf.test(ie)}function jp(ie){return Lp.test(ie)}function R2(ie){for(var ye,me=[];!(ye=ie.next()).done;)me.push(ye.value);return me}function Np(ie){var ye=-1,me=Array(ie.size);return ie.forEach(function(rt,Mt){me[++ye]=[Mt,rt]}),me}function $p(ie,ye){return function(me){return ie(ye(me))}}function ua(ie,ye){for(var me=-1,rt=ie.length,Mt=0,en=[];++me-1}function Q2(c,v){var C=this.__data__,A=Vr(C,c);return A<0?(++this.size,C.push([c,v])):C[A][1]=v,this}ca.prototype.clear=X2,ca.prototype.delete=Z2,ca.prototype.get=iv,ca.prototype.has=ov,ca.prototype.set=Q2;function da(c){var v=-1,C=c==null?0:c.length;for(this.clear();++v=v?c:v)),c}function wi(c,v,C,A,j,W){var Z,te=v&p,ce=v&m,_e=v&y;if(C&&(Z=j?C(c,A,j,W):C(c)),Z!==n)return Z;if(!Cr(c))return c;var Pe=$t(c);if(Pe){if(Z=CK(c),!te)return Bi(c,Z)}else{var Re=ki(c),tt=Re==et||Re==yt;if(id(c))return wl(c,te);if(Re==gt||Re==Ae||tt&&!j){if(Z=ce||tt?{}:OP(c),!te)return ce?Cv(c,Kc(Z,c)):No(c,st(Z,c))}else{if(!qt[Re])return j?c:{};Z=_K(c,Re,te)}}W||(W=new Rr);var mt=W.get(c);if(mt)return mt;W.set(c,Z),sT(c)?c.forEach(function(kt){Z.add(wi(kt,v,C,kt,c,W))}):oT(c)&&c.forEach(function(kt,Xt){Z.set(Xt,wi(kt,v,C,Xt,c,W))});var _t=_e?ce?ge:ma:ce?Fo:Ei,Ut=Pe?n:_t(c);return Zn(Ut||c,function(kt,Xt){Ut&&(Xt=kt,kt=c[Xt]),pl(Z,Xt,wi(kt,v,C,Xt,c,W))}),Z}function Gp(c){var v=Ei(c);return function(C){return qp(C,c,v)}}function qp(c,v,C){var A=C.length;if(c==null)return!A;for(c=dn(c);A--;){var j=C[A],W=v[j],Z=c[j];if(Z===n&&!(j in c)||!W(Z))return!1}return!0}function uv(c,v,C){if(typeof c!="function")throw new Di(a);return Tv(function(){c.apply(n,C)},v)}function Yc(c,v,C,A){var j=-1,W=Zi,Z=!0,te=c.length,ce=[],_e=v.length;if(!te)return ce;C&&(v=Hn(v,Wr(C))),A?(W=Rp,Z=!1):v.length>=i&&(W=Oc,Z=!1,v=new Ha(v));e:for(;++jj?0:j+C),A=A===n||A>j?j:Ft(A),A<0&&(A+=j),A=C>A?0:uT(A);C0&&C(te)?v>1?Ur(te,v-1,C,A,j):Fa(j,te):A||(j[j.length]=te)}return j}var Yp=Cl(),Io=Cl(!0);function ga(c,v){return c&&Yp(c,v,Ei)}function Do(c,v){return c&&Io(c,v,Ei)}function Xp(c,v){return Oo(v,function(C){return Tu(c[C])})}function gl(c,v){v=Sl(v,c);for(var C=0,A=v.length;c!=null&&Cv}function Qp(c,v){return c!=null&&an.call(c,v)}function Jp(c,v){return c!=null&&v in dn(c)}function eg(c,v,C){return c>=hi(v,C)&&c=120&&Pe.length>=120)?new Ha(Z&&Pe):n}Pe=c[0];var Re=-1,tt=te[0];e:for(;++Re-1;)te!==c&&jf.call(te,ce,1),jf.call(c,ce,1);return c}function Uf(c,v){for(var C=c?v.length:0,A=C-1;C--;){var j=v[C];if(C==A||j!==W){var W=j;Pu(j)?jf.call(c,j,1):cg(c,j)}}return c}function Gf(c,v){return c+Su(Q0()*(v-c+1))}function bl(c,v,C,A){for(var j=-1,W=Or(Ff((v-c)/(C||1)),0),Z=me(W);W--;)Z[A?W:++j]=c,c+=C;return Z}function td(c,v){var C="";if(!c||v<1||v>q)return C;do v%2&&(C+=c),v=Su(v/2),v&&(c+=c);while(v);return C}function Tt(c,v){return G4(DP(c,v,Bo),c+"")}function og(c){return qc(vg(c))}function qf(c,v){var C=vg(c);return ab(C,Cu(v,0,C.length))}function ku(c,v,C,A){if(!Cr(c))return c;v=Sl(v,c);for(var j=-1,W=v.length,Z=W-1,te=c;te!=null&&++jj?0:j+v),C=C>j?j:C,C<0&&(C+=j),j=v>C?0:C-v>>>0,v>>>=0;for(var W=me(j);++A>>1,Z=c[W];Z!==null&&!va(Z)&&(C?Z<=v:Z=i){var _e=v?null:U(c);if(_e)return Of(_e);Z=!1,j=Oc,ce=new Ha}else ce=v?[]:te;e:for(;++A=A?c:qr(c,v,C)}var bv=$2||function(c){return St.clearTimeout(c)};function wl(c,v){if(v)return c.slice();var C=c.length,A=Nc?Nc(C):new c.constructor(C);return c.copy(A),A}function xv(c){var v=new c.constructor(c.byteLength);return new ji(v).set(new ji(c)),v}function Eu(c,v){var C=v?xv(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.byteLength)}function nb(c){var v=new c.constructor(c.source,bs.exec(c));return v.lastIndex=c.lastIndex,v}function Qn(c){return zf?dn(zf.call(c)):{}}function rb(c,v){var C=v?xv(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.length)}function Sv(c,v){if(c!==v){var C=c!==n,A=c===null,j=c===c,W=va(c),Z=v!==n,te=v===null,ce=v===v,_e=va(v);if(!te&&!_e&&!W&&c>v||W&&Z&&ce&&!te&&!_e||A&&Z&&ce||!C&&ce||!j)return 1;if(!A&&!W&&!_e&&c=te)return ce;var _e=C[A];return ce*(_e=="desc"?-1:1)}}return c.index-v.index}function ib(c,v,C,A){for(var j=-1,W=c.length,Z=C.length,te=-1,ce=v.length,_e=Or(W-Z,0),Pe=me(ce+_e),Re=!A;++te1?C[j-1]:n,Z=j>2?C[2]:n;for(W=c.length>3&&typeof W=="function"?(j--,W):n,Z&&mo(C[0],C[1],Z)&&(W=j<3?n:W,j=1),v=dn(v);++A-1?j[W?v[Z]:Z]:n}}function kv(c){return gr(function(v){var C=v.length,A=C,j=fo.prototype.thru;for(c&&v.reverse();A--;){var W=v[A];if(typeof W!="function")throw new Di(a);if(j&&!Z&&ve(W)=="wrapper")var Z=new fo([],!0)}for(A=Z?A:C;++A1&&tn.reverse(),Pe&&cete))return!1;var _e=W.get(c),Pe=W.get(v);if(_e&&Pe)return _e==v&&Pe==c;var Re=-1,tt=!0,mt=C&w?new Ha:n;for(W.set(c,v),W.set(v,c);++Re1?"& ":"")+v[A],v=v.join(C>2?", ":" "),c.replace(E0,`{ + */(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",p=1,m=2,y=4,b=1,w=2,E=1,_=2,k=4,T=8,L=16,O=32,D=64,I=128,N=256,U=512,B=30,K="...",ne=800,z=16,$=1,H=2,Y=3,Q=1/0,q=9007199254740991,X=17976931348623157e292,ee=0/0,fe=4294967295,ke=fe-1,we=fe>>>1,xe=[["ary",I],["bind",E],["bindKey",_],["curry",T],["curryRight",L],["flip",U],["partial",O],["partialRight",D],["rearg",N]],Le="[object Arguments]",Se="[object Array]",Qe="[object AsyncFunction]",Xe="[object Boolean]",tt="[object Date]",yt="[object DOMException]",Be="[object Error]",Ae="[object Function]",bt="[object GeneratorFunction]",Fe="[object Map]",at="[object Number]",jt="[object Null]",mt="[object Object]",Zt="[object Promise]",on="[object Proxy]",se="[object RegExp]",Ie="[object Set]",He="[object String]",Ue="[object Symbol]",ye="[object Undefined]",je="[object WeakMap]",vt="[object WeakSet]",Mt="[object ArrayBuffer]",Me="[object DataView]",Ct="[object Float32Array]",zt="[object Float64Array]",$n="[object Int8Array]",qe="[object Int16Array]",pt="[object Int32Array]",zr="[object Uint8Array]",rr="[object Uint8ClampedArray]",Bn="[object Uint16Array]",li="[object Uint32Array]",vs=/\b__p \+= '';/g,tl=/\b(__p \+=) '' \+/g,gf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ys=/&(?:amp|lt|gt|quot|#39);/g,Xi=/[&<>"']/g,C0=RegExp(ys.source),Na=RegExp(Xi.source),wp=/<%-([\s\S]+?)%>/g,_0=/<%([\s\S]+?)%>/g,bc=/<%=([\s\S]+?)%>/g,Cp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_p=/^\w*$/,na=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mf=/[\\^$.*+?()[\]{}|]/g,k0=RegExp(mf.source),xc=/^\s+/,vf=/\s/,E0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,nl=/\{\n\/\* \[wrapped with (.+)\] \*/,Sc=/,? & /,P0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,T0=/[()=,{}\[\]\/\s]/,M0=/\\(\\)?/g,L0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,bs=/\w*$/,A0=/^[-+]0x[0-9a-f]+$/i,O0=/^0b[01]+$/i,R0=/^\[object .+?Constructor\]$/,I0=/^0o[0-7]+$/i,D0=/^(?:0|[1-9]\d*)$/,j0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rl=/($^)/,N0=/['\n\r\u2028\u2029\\]/g,xs="\\ud800-\\udfff",fu="\\u0300-\\u036f",hu="\\ufe20-\\ufe2f",il="\\u20d0-\\u20ff",pu=fu+hu+il,kp="\\u2700-\\u27bf",wc="a-z\\xdf-\\xf6\\xf8-\\xff",ol="\\xac\\xb1\\xd7\\xf7",ra="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Mn="\\u2000-\\u206f",wn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ia="A-Z\\xc0-\\xd6\\xd8-\\xde",Hr="\\ufe0e\\ufe0f",ui=ol+ra+Mn+wn,oa="['’]",al="["+xs+"]",ci="["+ui+"]",Ss="["+pu+"]",yf="\\d+",gu="["+kp+"]",ws="["+wc+"]",bf="[^"+xs+ui+yf+kp+wc+ia+"]",Ri="\\ud83c[\\udffb-\\udfff]",Ep="(?:"+Ss+"|"+Ri+")",Pp="[^"+xs+"]",xf="(?:\\ud83c[\\udde6-\\uddff]){2}",sl="[\\ud800-\\udbff][\\udc00-\\udfff]",Mo="["+ia+"]",ll="\\u200d",mu="(?:"+ws+"|"+bf+")",$0="(?:"+Mo+"|"+bf+")",Cc="(?:"+oa+"(?:d|ll|m|re|s|t|ve))?",_c="(?:"+oa+"(?:D|LL|M|RE|S|T|VE))?",Sf=Ep+"?",kc="["+Hr+"]?",$a="(?:"+ll+"(?:"+[Pp,xf,sl].join("|")+")"+kc+Sf+")*",wf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Gt=kc+Sf+$a,Tp="(?:"+[gu,xf,sl].join("|")+")"+Gt,Ec="(?:"+[Pp+Ss+"?",Ss,xf,sl,al].join("|")+")",Pc=RegExp(oa,"g"),Mp=RegExp(Ss,"g"),aa=RegExp(Ri+"(?="+Ri+")|"+Ec+Gt,"g"),Xn=RegExp([Mo+"?"+ws+"+"+Cc+"(?="+[ci,Mo,"$"].join("|")+")",$0+"+"+_c+"(?="+[ci,Mo+mu,"$"].join("|")+")",Mo+"?"+mu+"+"+Cc,Mo+"+"+_c,vu,wf,yf,Tp].join("|"),"g"),Cf=RegExp("["+ll+xs+pu+Hr+"]"),Lp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_f=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ap=-1,cn={};cn[Ct]=cn[zt]=cn[$n]=cn[qe]=cn[pt]=cn[zr]=cn[rr]=cn[Bn]=cn[li]=!0,cn[Le]=cn[Se]=cn[Mt]=cn[Xe]=cn[Me]=cn[tt]=cn[Be]=cn[Ae]=cn[Fe]=cn[at]=cn[mt]=cn[se]=cn[Ie]=cn[He]=cn[je]=!1;var qt={};qt[Le]=qt[Se]=qt[Mt]=qt[Me]=qt[Xe]=qt[tt]=qt[Ct]=qt[zt]=qt[$n]=qt[qe]=qt[pt]=qt[Fe]=qt[at]=qt[mt]=qt[se]=qt[Ie]=qt[He]=qt[Ue]=qt[zr]=qt[rr]=qt[Bn]=qt[li]=!0,qt[Be]=qt[Ae]=qt[je]=!1;var Op={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},F0={"&":"&","<":"<",">":">",'"':""","'":"'"},G={"&":"&","<":"<",">":">",""":'"',"'":"'"},re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pe=parseFloat,ot=parseInt,Ht=typeof So=="object"&&So&&So.Object===Object&&So,mn=typeof self=="object"&&self&&self.Object===Object&&self,St=Ht||mn||Function("return this")(),Ot=t&&!t.nodeType&&t,Kt=Ot&&!0&&e&&!e.nodeType&&e,Jr=Kt&&Kt.exports===Ot,Ar=Jr&&Ht.process,vn=function(){try{var ie=Kt&&Kt.require&&Kt.require("util").types;return ie||Ar&&Ar.binding&&Ar.binding("util")}catch{}}(),di=vn&&vn.isArrayBuffer,Lo=vn&&vn.isDate,uo=vn&&vn.isMap,Fa=vn&&vn.isRegExp,ul=vn&&vn.isSet,B0=vn&&vn.isTypedArray;function Ii(ie,be,me){switch(me.length){case 0:return ie.call(be);case 1:return ie.call(be,me[0]);case 2:return ie.call(be,me[0],me[1]);case 3:return ie.call(be,me[0],me[1],me[2])}return ie.apply(be,me)}function z0(ie,be,me,rt){for(var Lt=-1,en=ie==null?0:ie.length;++Lt-1}function Rp(ie,be,me){for(var rt=-1,Lt=ie==null?0:ie.length;++rt-1;);return me}function Cs(ie,be){for(var me=ie.length;me--&&Lc(be,ie[me],0)>-1;);return me}function W0(ie,be){for(var me=ie.length,rt=0;me--;)ie[me]===be&&++rt;return rt}var O2=Tf(Op),_s=Tf(F0);function dl(ie){return"\\"+re[ie]}function Dp(ie,be){return ie==null?n:ie[be]}function bu(ie){return Cf.test(ie)}function jp(ie){return Lp.test(ie)}function R2(ie){for(var be,me=[];!(be=ie.next()).done;)me.push(be.value);return me}function Np(ie){var be=-1,me=Array(ie.size);return ie.forEach(function(rt,Lt){me[++be]=[Lt,rt]}),me}function $p(ie,be){return function(me){return ie(be(me))}}function ua(ie,be){for(var me=-1,rt=ie.length,Lt=0,en=[];++me-1}function Q2(c,v){var C=this.__data__,A=Ur(C,c);return A<0?(++this.size,C.push([c,v])):C[A][1]=v,this}ca.prototype.clear=X2,ca.prototype.delete=Z2,ca.prototype.get=iv,ca.prototype.has=ov,ca.prototype.set=Q2;function da(c){var v=-1,C=c==null?0:c.length;for(this.clear();++v=v?c:v)),c}function wi(c,v,C,A,j,W){var Z,te=v&p,ce=v&m,Ce=v&y;if(C&&(Z=j?C(c,A,j,W):C(c)),Z!==n)return Z;if(!Cr(c))return c;var Ee=$t(c);if(Ee){if(Z=_K(c),!te)return Bi(c,Z)}else{var Re=ki(c),nt=Re==Ae||Re==bt;if(id(c))return wl(c,te);if(Re==mt||Re==Le||nt&&!j){if(Z=ce||nt?{}:RP(c),!te)return ce?Cv(c,Kc(Z,c)):No(c,st(Z,c))}else{if(!qt[Re])return j?c:{};Z=kK(c,Re,te)}}W||(W=new Rr);var gt=W.get(c);if(gt)return gt;W.set(c,Z),lT(c)?c.forEach(function(kt){Z.add(wi(kt,v,C,kt,c,W))}):aT(c)&&c.forEach(function(kt,Xt){Z.set(Xt,wi(kt,v,C,Xt,c,W))});var _t=Ce?ce?ge:ma:ce?Fo:Ei,Vt=Ee?n:_t(c);return Zn(Vt||c,function(kt,Xt){Vt&&(Xt=kt,kt=c[Xt]),pl(Z,Xt,wi(kt,v,C,Xt,c,W))}),Z}function Gp(c){var v=Ei(c);return function(C){return qp(C,c,v)}}function qp(c,v,C){var A=C.length;if(c==null)return!A;for(c=dn(c);A--;){var j=C[A],W=v[j],Z=c[j];if(Z===n&&!(j in c)||!W(Z))return!1}return!0}function uv(c,v,C){if(typeof c!="function")throw new Di(a);return Tv(function(){c.apply(n,C)},v)}function Yc(c,v,C,A){var j=-1,W=Zi,Z=!0,te=c.length,ce=[],Ce=v.length;if(!te)return ce;C&&(v=Hn(v,Wr(C))),A?(W=Rp,Z=!1):v.length>=i&&(W=Oc,Z=!1,v=new Wa(v));e:for(;++jj?0:j+C),A=A===n||A>j?j:Ft(A),A<0&&(A+=j),A=C>A?0:cT(A);C0&&C(te)?v>1?Vr(te,v-1,C,A,j):Ba(j,te):A||(j[j.length]=te)}return j}var Yp=Cl(),Io=Cl(!0);function ga(c,v){return c&&Yp(c,v,Ei)}function Do(c,v){return c&&Io(c,v,Ei)}function Xp(c,v){return Oo(v,function(C){return Tu(c[C])})}function gl(c,v){v=Sl(v,c);for(var C=0,A=v.length;c!=null&&Cv}function Qp(c,v){return c!=null&&an.call(c,v)}function Jp(c,v){return c!=null&&v in dn(c)}function eg(c,v,C){return c>=hi(v,C)&&c=120&&Ee.length>=120)?new Wa(Z&&Ee):n}Ee=c[0];var Re=-1,nt=te[0];e:for(;++Re-1;)te!==c&&jf.call(te,ce,1),jf.call(c,ce,1);return c}function Vf(c,v){for(var C=c?v.length:0,A=C-1;C--;){var j=v[C];if(C==A||j!==W){var W=j;Pu(j)?jf.call(c,j,1):cg(c,j)}}return c}function Gf(c,v){return c+Su(Q0()*(v-c+1))}function bl(c,v,C,A){for(var j=-1,W=Or(Ff((v-c)/(C||1)),0),Z=me(W);W--;)Z[A?W:++j]=c,c+=C;return Z}function td(c,v){var C="";if(!c||v<1||v>q)return C;do v%2&&(C+=c),v=Su(v/2),v&&(c+=c);while(v);return C}function Tt(c,v){return G4(jP(c,v,Bo),c+"")}function og(c){return qc(vg(c))}function qf(c,v){var C=vg(c);return ab(C,Cu(v,0,C.length))}function ku(c,v,C,A){if(!Cr(c))return c;v=Sl(v,c);for(var j=-1,W=v.length,Z=W-1,te=c;te!=null&&++jj?0:j+v),C=C>j?j:C,C<0&&(C+=j),j=v>C?0:C-v>>>0,v>>>=0;for(var W=me(j);++A>>1,Z=c[W];Z!==null&&!va(Z)&&(C?Z<=v:Z=i){var Ce=v?null:V(c);if(Ce)return Of(Ce);Z=!1,j=Oc,ce=new Wa}else ce=v?[]:te;e:for(;++A=A?c:qr(c,v,C)}var bv=$2||function(c){return St.clearTimeout(c)};function wl(c,v){if(v)return c.slice();var C=c.length,A=Nc?Nc(C):new c.constructor(C);return c.copy(A),A}function xv(c){var v=new c.constructor(c.byteLength);return new ji(v).set(new ji(c)),v}function Eu(c,v){var C=v?xv(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.byteLength)}function nb(c){var v=new c.constructor(c.source,bs.exec(c));return v.lastIndex=c.lastIndex,v}function Qn(c){return zf?dn(zf.call(c)):{}}function rb(c,v){var C=v?xv(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.length)}function Sv(c,v){if(c!==v){var C=c!==n,A=c===null,j=c===c,W=va(c),Z=v!==n,te=v===null,ce=v===v,Ce=va(v);if(!te&&!Ce&&!W&&c>v||W&&Z&&ce&&!te&&!Ce||A&&Z&&ce||!C&&ce||!j)return 1;if(!A&&!W&&!Ce&&c=te)return ce;var Ce=C[A];return ce*(Ce=="desc"?-1:1)}}return c.index-v.index}function ib(c,v,C,A){for(var j=-1,W=c.length,Z=C.length,te=-1,ce=v.length,Ce=Or(W-Z,0),Ee=me(ce+Ce),Re=!A;++te1?C[j-1]:n,Z=j>2?C[2]:n;for(W=c.length>3&&typeof W=="function"?(j--,W):n,Z&&mo(C[0],C[1],Z)&&(W=j<3?n:W,j=1),v=dn(v);++A-1?j[W?v[Z]:Z]:n}}function kv(c){return gr(function(v){var C=v.length,A=C,j=fo.prototype.thru;for(c&&v.reverse();A--;){var W=v[A];if(typeof W!="function")throw new Di(a);if(j&&!Z&&ve(W)=="wrapper")var Z=new fo([],!0)}for(A=Z?A:C;++A1&&tn.reverse(),Ee&&cete))return!1;var Ce=W.get(c),Ee=W.get(v);if(Ce&&Ee)return Ce==v&&Ee==c;var Re=-1,nt=!0,gt=C&w?new Wa:n;for(W.set(c,v),W.set(v,c);++Re1?"& ":"")+v[A],v=v.join(C>2?", ":" "),c.replace(E0,`{ /* [wrapped with `+v+`] */ -`)}function EK(c){return $t(c)||th(c)||!!(X0&&c&&c[X0])}function Pu(c,v){var C=typeof c;return v=v??q,!!v&&(C=="number"||C!="symbol"&&D0.test(c))&&c>-1&&c%1==0&&c0){if(++v>=ne)return arguments[0]}else v=0;return c.apply(n,arguments)}}function ab(c,v){var C=-1,A=c.length,j=A-1;for(v=v===n?A:v;++C1?c[v-1]:n;return C=typeof C=="function"?(c.pop(),C):n,qP(c,C)});function KP(c){var v=F(c);return v.__chain__=!0,v}function NY(c,v){return v(c),c}function sb(c,v){return v(c)}var $Y=gr(function(c){var v=c.length,C=v?c[0]:0,A=this.__wrapped__,j=function(W){return Up(W,c)};return v>1||this.__actions__.length||!(A instanceof Yt)||!Pu(C)?this.thru(j):(A=A.slice(C,+C+(v?1:0)),A.__actions__.push({func:sb,args:[j],thisArg:n}),new fo(A,this.__chain__).thru(function(W){return v&&!W.length&&W.push(n),W}))});function FY(){return KP(this)}function BY(){return new fo(this.value(),this.__chain__)}function zY(){this.__values__===n&&(this.__values__=lT(this.value()));var c=this.__index__>=this.__values__.length,v=c?n:this.__values__[this.__index__++];return{done:c,value:v}}function HY(){return this}function WY(c){for(var v,C=this;C instanceof Hf;){var A=zP(C);A.__index__=0,A.__values__=n,v?j.__wrapped__=A:v=A;var j=A;C=C.__wrapped__}return j.__wrapped__=c,v}function VY(){var c=this.__wrapped__;if(c instanceof Yt){var v=c;return this.__actions__.length&&(v=new Yt(this)),v=v.reverse(),v.__actions__.push({func:sb,args:[q4],thisArg:n}),new fo(v,this.__chain__)}return this.thru(q4)}function UY(){return xl(this.__wrapped__,this.__actions__)}var GY=fg(function(c,v,C){an.call(c,C)?++c[C]:fa(c,C,1)});function qY(c,v,C){var A=$t(c)?zn:cv;return C&&mo(c,v,C)&&(v=n),A(c,Oe(v,3))}function KY(c,v){var C=$t(c)?Oo:pa;return C(c,Oe(v,3))}var YY=_v(HP),XY=_v(WP);function ZY(c,v){return Ur(lb(c,v),1)}function QY(c,v){return Ur(lb(c,v),Q)}function JY(c,v,C){return C=C===n?1:Ft(C),Ur(lb(c,v),C)}function YP(c,v){var C=$t(c)?Zn:Ps;return C(c,Oe(v,3))}function XP(c,v){var C=$t(c)?Ao:Kp;return C(c,Oe(v,3))}var eX=fg(function(c,v,C){an.call(c,C)?c[C].push(v):fa(c,C,[v])});function tX(c,v,C,A){c=$o(c)?c:vg(c),C=C&&!A?Ft(C):0;var j=c.length;return C<0&&(C=Or(j+C,0)),hb(c)?C<=j&&c.indexOf(v,C)>-1:!!j&&Lc(c,v,C)>-1}var nX=Tt(function(c,v,C){var A=-1,j=typeof v=="function",W=$o(c)?me(c.length):[];return Ps(c,function(Z){W[++A]=j?Ii(v,Z,C):Ts(Z,v,C)}),W}),rX=fg(function(c,v,C){fa(c,C,v)});function lb(c,v){var C=$t(c)?Hn:Dr;return C(c,Oe(v,3))}function iX(c,v,C,A){return c==null?[]:($t(v)||(v=v==null?[]:[v]),C=A?n:C,$t(C)||(C=C==null?[]:[C]),$i(c,v,C))}var oX=fg(function(c,v,C){c[C?0:1].push(v)},function(){return[[],[]]});function aX(c,v,C){var A=$t(c)?kf:Ip,j=arguments.length<3;return A(c,Oe(v,4),C,j,Ps)}function sX(c,v,C){var A=$t(c)?T2:Ip,j=arguments.length<3;return A(c,Oe(v,4),C,j,Kp)}function lX(c,v){var C=$t(c)?Oo:pa;return C(c,db(Oe(v,3)))}function uX(c){var v=$t(c)?qc:og;return v(c)}function cX(c,v,C){(C?mo(c,v,C):v===n)?v=1:v=Ft(v);var A=$t(c)?Si:qf;return A(c,v)}function dX(c){var v=$t(c)?$4:_i;return v(c)}function fX(c){if(c==null)return 0;if($o(c))return hb(c)?Ba(c):c.length;var v=ki(c);return v==ze||v==Ie?c.size:Gr(c).length}function hX(c,v,C){var A=$t(c)?Tc:jo;return C&&mo(c,v,C)&&(v=n),A(c,Oe(v,3))}var pX=Tt(function(c,v){if(c==null)return[];var C=v.length;return C>1&&mo(c,v[0],v[1])?v=[]:C>2&&mo(v[0],v[1],v[2])&&(v=[v[0]]),$i(c,Ur(v,1),[])}),ub=F2||function(){return St.Date.now()};function gX(c,v){if(typeof v!="function")throw new Di(a);return c=Ft(c),function(){if(--c<1)return v.apply(this,arguments)}}function ZP(c,v,C){return v=C?n:v,v=c&&v==null?c.length:v,he(c,I,n,n,n,n,v)}function QP(c,v){var C;if(typeof v!="function")throw new Di(a);return c=Ft(c),function(){return--c>0&&(C=v.apply(this,arguments)),c<=1&&(v=n),C}}var Y4=Tt(function(c,v,C){var A=E;if(C.length){var j=ua(C,Je(Y4));A|=O}return he(c,A,v,C,j)}),JP=Tt(function(c,v,C){var A=E|_;if(C.length){var j=ua(C,Je(JP));A|=O}return he(v,A,c,C,j)});function eT(c,v,C){v=C?n:v;var A=he(c,T,n,n,n,n,n,v);return A.placeholder=eT.placeholder,A}function tT(c,v,C){v=C?n:v;var A=he(c,L,n,n,n,n,n,v);return A.placeholder=tT.placeholder,A}function nT(c,v,C){var A,j,W,Z,te,ce,_e=0,Pe=!1,Re=!1,tt=!0;if(typeof c!="function")throw new Di(a);v=Ua(v)||0,Cr(C)&&(Pe=!!C.leading,Re="maxWait"in C,W=Re?Or(Ua(C.maxWait)||0,v):W,tt="trailing"in C?!!C.trailing:tt);function mt(Yr){var Rs=A,Lu=j;return A=j=n,_e=Yr,Z=c.apply(Lu,Rs),Z}function _t(Yr){return _e=Yr,te=Tv(Xt,v),Pe?mt(Yr):Z}function Ut(Yr){var Rs=Yr-ce,Lu=Yr-_e,ST=v-Rs;return Re?hi(ST,W-Lu):ST}function kt(Yr){var Rs=Yr-ce,Lu=Yr-_e;return ce===n||Rs>=v||Rs<0||Re&&Lu>=W}function Xt(){var Yr=ub();if(kt(Yr))return tn(Yr);te=Tv(Xt,Ut(Yr))}function tn(Yr){return te=n,tt&&A?mt(Yr):(A=j=n,Z)}function ya(){te!==n&&bv(te),_e=0,A=ce=j=te=n}function vo(){return te===n?Z:tn(ub())}function ba(){var Yr=ub(),Rs=kt(Yr);if(A=arguments,j=this,ce=Yr,Rs){if(te===n)return _t(ce);if(Re)return bv(te),te=Tv(Xt,v),mt(ce)}return te===n&&(te=Tv(Xt,v)),Z}return ba.cancel=ya,ba.flush=vo,ba}var mX=Tt(function(c,v){return uv(c,1,v)}),vX=Tt(function(c,v,C){return uv(c,Ua(v)||0,C)});function yX(c){return he(c,V)}function cb(c,v){if(typeof c!="function"||v!=null&&typeof v!="function")throw new Di(a);var C=function(){var A=arguments,j=v?v.apply(this,A):A[0],W=C.cache;if(W.has(j))return W.get(j);var Z=c.apply(this,A);return C.cache=W.set(j,Z)||W,Z};return C.cache=new(cb.Cache||da),C}cb.Cache=da;function db(c){if(typeof c!="function")throw new Di(a);return function(){var v=arguments;switch(v.length){case 0:return!c.call(this);case 1:return!c.call(this,v[0]);case 2:return!c.call(this,v[0],v[1]);case 3:return!c.call(this,v[0],v[1],v[2])}return!c.apply(this,v)}}function bX(c){return QP(2,c)}var xX=z4(function(c,v){v=v.length==1&&$t(v[0])?Hn(v[0],Wr(Oe())):Hn(Ur(v,1),Wr(Oe()));var C=v.length;return Tt(function(A){for(var j=-1,W=hi(A.length,C);++j=v}),th=ng(function(){return arguments}())?ng:function(c){return jr(c)&&an.call(c,"callee")&&!Y0.call(c,"callee")},$t=me.isArray,DX=di?Wr(di):fv;function $o(c){return c!=null&&fb(c.length)&&!Tu(c)}function Kr(c){return jr(c)&&$o(c)}function jX(c){return c===!0||c===!1||jr(c)&&Ci(c)==Ye}var id=B2||s5,NX=Lo?Wr(Lo):hv;function $X(c){return jr(c)&&c.nodeType===1&&!Mv(c)}function FX(c){if(c==null)return!0;if($o(c)&&($t(c)||typeof c=="string"||typeof c.splice=="function"||id(c)||mg(c)||th(c)))return!c.length;var v=ki(c);if(v==ze||v==Ie)return!c.size;if(Pv(c))return!Gr(c).length;for(var C in c)if(an.call(c,C))return!1;return!0}function BX(c,v){return Zc(c,v)}function zX(c,v,C){C=typeof C=="function"?C:n;var A=C?C(c,v):n;return A===n?Zc(c,v,n,C):!!A}function Z4(c){if(!jr(c))return!1;var v=Ci(c);return v==Ce||v==vt||typeof c.message=="string"&&typeof c.name=="string"&&!Mv(c)}function HX(c){return typeof c=="number"&&zp(c)}function Tu(c){if(!Cr(c))return!1;var v=Ci(c);return v==et||v==yt||v==Qe||v==on}function iT(c){return typeof c=="number"&&c==Ft(c)}function fb(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=q}function Cr(c){var v=typeof c;return c!=null&&(v=="object"||v=="function")}function jr(c){return c!=null&&typeof c=="object"}var oT=uo?Wr(uo):B4;function WX(c,v){return c===v||Qc(c,v,Lt(v))}function VX(c,v,C){return C=typeof C=="function"?C:n,Qc(c,v,Lt(v),C)}function UX(c){return aT(c)&&c!=+c}function GX(c){if(MK(c))throw new Mt(o);return rg(c)}function qX(c){return c===null}function KX(c){return c==null}function aT(c){return typeof c=="number"||jr(c)&&Ci(c)==at}function Mv(c){if(!jr(c)||Ci(c)!=gt)return!1;var v=$c(c);if(v===null)return!0;var C=an.call(v,"constructor")&&v.constructor;return typeof C=="function"&&C instanceof C&&xr.call(C)==xi}var Q4=$a?Wr($a):Sr;function YX(c){return iT(c)&&c>=-q&&c<=q}var sT=ul?Wr(ul):Wt;function hb(c){return typeof c=="string"||!$t(c)&&jr(c)&&Ci(c)==Ne}function va(c){return typeof c=="symbol"||jr(c)&&Ci(c)==Ue}var mg=B0?Wr(B0):ei;function XX(c){return c===n}function ZX(c){return jr(c)&&ki(c)==je}function QX(c){return jr(c)&&Ci(c)==bt}var JX=P(ml),eZ=P(function(c,v){return c<=v});function lT(c){if(!c)return[];if($o(c))return hb(c)?Qi(c):Bi(c);if(Fc&&c[Fc])return R2(c[Fc]());var v=ki(c),C=v==ze?Np:v==Ie?Of:vg;return C(c)}function Mu(c){if(!c)return c===0?c:0;if(c=Ua(c),c===Q||c===-Q){var v=c<0?-1:1;return v*X}return c===c?c:0}function Ft(c){var v=Mu(c),C=v%1;return v===v?C?v-C:v:0}function uT(c){return c?Cu(Ft(c),0,fe):0}function Ua(c){if(typeof c=="number")return c;if(va(c))return ee;if(Cr(c)){var v=typeof c.valueOf=="function"?c.valueOf():c;c=Cr(v)?v+"":v}if(typeof c!="string")return c===0?c:+c;c=co(c);var C=O0.test(c);return C||I0.test(c)?ot(c.slice(2),C?2:8):A0.test(c)?ee:+c}function cT(c){return Wa(c,Fo(c))}function tZ(c){return c?Cu(Ft(c),-q,q):c===0?c:0}function _n(c){return c==null?"":po(c)}var nZ=go(function(c,v){if(Pv(v)||$o(v)){Wa(v,Ei(v),c);return}for(var C in v)an.call(v,C)&&pl(c,C,v[C])}),dT=go(function(c,v){Wa(v,Fo(v),c)}),pb=go(function(c,v,C,A){Wa(v,Fo(v),c,A)}),rZ=go(function(c,v,C,A){Wa(v,Ei(v),c,A)}),iZ=gr(Up);function oZ(c,v){var C=wu(c);return v==null?C:st(C,v)}var aZ=Tt(function(c,v){c=dn(c);var C=-1,A=v.length,j=A>2?v[2]:n;for(j&&mo(v[0],v[1],j)&&(A=1);++C1),W}),Wa(c,ge(c),C),A&&(C=wi(C,p|m|y,Ot));for(var j=v.length;j--;)cg(C,v[j]);return C});function _Z(c,v){return hT(c,db(Oe(v)))}var kZ=gr(function(c,v){return c==null?{}:mv(c,v)});function hT(c,v){if(c==null)return{};var C=Hn(ge(c),function(A){return[A]});return v=Oe(v),ig(c,C,function(A,j){return v(A,j[0])})}function EZ(c,v,C){v=Sl(v,c);var A=-1,j=v.length;for(j||(j=1,c=n);++Av){var A=c;c=v,v=A}if(C||c%1||v%1){var j=Q0();return hi(c+j*(v-c+pe("1e-"+((j+"").length-1))),v)}return Gf(c,v)}var NZ=_l(function(c,v,C){return v=v.toLowerCase(),c+(C?mT(v):v)});function mT(c){return t5(_n(c).toLowerCase())}function vT(c){return c=_n(c),c&&c.replace(j0,O2).replace(Mp,"")}function $Z(c,v,C){c=_n(c),v=po(v);var A=c.length;C=C===n?A:Cu(Ft(C),0,A);var j=C;return C-=v.length,C>=0&&c.slice(C,j)==v}function FZ(c){return c=_n(c),c&&ja.test(c)?c.replace(Xi,_s):c}function BZ(c){return c=_n(c),c&&k0.test(c)?c.replace(mf,"\\$&"):c}var zZ=_l(function(c,v,C){return c+(C?"-":"")+v.toLowerCase()}),HZ=_l(function(c,v,C){return c+(C?" ":"")+v.toLowerCase()}),WZ=pg("toLowerCase");function VZ(c,v,C){c=_n(c),v=Ft(v);var A=v?Ba(c):0;if(!v||A>=v)return c;var j=(v-A)/2;return f(Su(j),C)+c+f(Ff(j),C)}function UZ(c,v,C){c=_n(c),v=Ft(v);var A=v?Ba(c):0;return v&&A>>0,C?(c=_n(c),c&&(typeof v=="string"||v!=null&&!Q4(v))&&(v=po(v),!v&&bu(c))?Ls(Qi(c),0,C):c.split(v,C)):[]}var QZ=_l(function(c,v,C){return c+(C?" ":"")+t5(v)});function JZ(c,v,C){return c=_n(c),C=C==null?0:Cu(Ft(C),0,c.length),v=po(v),c.slice(C,C+v.length)==v}function eQ(c,v,C){var A=F.templateSettings;C&&mo(c,v,C)&&(v=n),c=_n(c),v=pb({},v,A,He);var j=pb({},v.imports,A.imports,He),W=Ei(j),Z=Af(j,W),te,ce,_e=0,Pe=v.interpolate||rl,Re="__p += '",tt=If((v.escape||rl).source+"|"+Pe.source+"|"+(Pe===bc?L0:rl).source+"|"+(v.evaluate||rl).source+"|$","g"),mt="//# sourceURL="+(an.call(v,"sourceURL")?(v.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ap+"]")+` -`;c.replace(tt,function(kt,Xt,tn,ya,vo,ba){return tn||(tn=ya),Re+=c.slice(_e,ba).replace(N0,dl),Xt&&(te=!0,Re+=`' + +`)}function PK(c){return $t(c)||th(c)||!!(X0&&c&&c[X0])}function Pu(c,v){var C=typeof c;return v=v??q,!!v&&(C=="number"||C!="symbol"&&D0.test(c))&&c>-1&&c%1==0&&c0){if(++v>=ne)return arguments[0]}else v=0;return c.apply(n,arguments)}}function ab(c,v){var C=-1,A=c.length,j=A-1;for(v=v===n?A:v;++C1?c[v-1]:n;return C=typeof C=="function"?(c.pop(),C):n,KP(c,C)});function YP(c){var v=F(c);return v.__chain__=!0,v}function $Y(c,v){return v(c),c}function sb(c,v){return v(c)}var FY=gr(function(c){var v=c.length,C=v?c[0]:0,A=this.__wrapped__,j=function(W){return Vp(W,c)};return v>1||this.__actions__.length||!(A instanceof Yt)||!Pu(C)?this.thru(j):(A=A.slice(C,+C+(v?1:0)),A.__actions__.push({func:sb,args:[j],thisArg:n}),new fo(A,this.__chain__).thru(function(W){return v&&!W.length&&W.push(n),W}))});function BY(){return YP(this)}function zY(){return new fo(this.value(),this.__chain__)}function HY(){this.__values__===n&&(this.__values__=uT(this.value()));var c=this.__index__>=this.__values__.length,v=c?n:this.__values__[this.__index__++];return{done:c,value:v}}function WY(){return this}function UY(c){for(var v,C=this;C instanceof Hf;){var A=HP(C);A.__index__=0,A.__values__=n,v?j.__wrapped__=A:v=A;var j=A;C=C.__wrapped__}return j.__wrapped__=c,v}function VY(){var c=this.__wrapped__;if(c instanceof Yt){var v=c;return this.__actions__.length&&(v=new Yt(this)),v=v.reverse(),v.__actions__.push({func:sb,args:[q4],thisArg:n}),new fo(v,this.__chain__)}return this.thru(q4)}function GY(){return xl(this.__wrapped__,this.__actions__)}var qY=fg(function(c,v,C){an.call(c,C)?++c[C]:fa(c,C,1)});function KY(c,v,C){var A=$t(c)?zn:cv;return C&&mo(c,v,C)&&(v=n),A(c,Oe(v,3))}function YY(c,v){var C=$t(c)?Oo:pa;return C(c,Oe(v,3))}var XY=_v(WP),ZY=_v(UP);function QY(c,v){return Vr(lb(c,v),1)}function JY(c,v){return Vr(lb(c,v),Q)}function eX(c,v,C){return C=C===n?1:Ft(C),Vr(lb(c,v),C)}function XP(c,v){var C=$t(c)?Zn:Ps;return C(c,Oe(v,3))}function ZP(c,v){var C=$t(c)?Ao:Kp;return C(c,Oe(v,3))}var tX=fg(function(c,v,C){an.call(c,C)?c[C].push(v):fa(c,C,[v])});function nX(c,v,C,A){c=$o(c)?c:vg(c),C=C&&!A?Ft(C):0;var j=c.length;return C<0&&(C=Or(j+C,0)),hb(c)?C<=j&&c.indexOf(v,C)>-1:!!j&&Lc(c,v,C)>-1}var rX=Tt(function(c,v,C){var A=-1,j=typeof v=="function",W=$o(c)?me(c.length):[];return Ps(c,function(Z){W[++A]=j?Ii(v,Z,C):Ts(Z,v,C)}),W}),iX=fg(function(c,v,C){fa(c,C,v)});function lb(c,v){var C=$t(c)?Hn:Dr;return C(c,Oe(v,3))}function oX(c,v,C,A){return c==null?[]:($t(v)||(v=v==null?[]:[v]),C=A?n:C,$t(C)||(C=C==null?[]:[C]),$i(c,v,C))}var aX=fg(function(c,v,C){c[C?0:1].push(v)},function(){return[[],[]]});function sX(c,v,C){var A=$t(c)?kf:Ip,j=arguments.length<3;return A(c,Oe(v,4),C,j,Ps)}function lX(c,v,C){var A=$t(c)?T2:Ip,j=arguments.length<3;return A(c,Oe(v,4),C,j,Kp)}function uX(c,v){var C=$t(c)?Oo:pa;return C(c,db(Oe(v,3)))}function cX(c){var v=$t(c)?qc:og;return v(c)}function dX(c,v,C){(C?mo(c,v,C):v===n)?v=1:v=Ft(v);var A=$t(c)?Si:qf;return A(c,v)}function fX(c){var v=$t(c)?$4:_i;return v(c)}function hX(c){if(c==null)return 0;if($o(c))return hb(c)?za(c):c.length;var v=ki(c);return v==Fe||v==Ie?c.size:Gr(c).length}function pX(c,v,C){var A=$t(c)?Tc:jo;return C&&mo(c,v,C)&&(v=n),A(c,Oe(v,3))}var gX=Tt(function(c,v){if(c==null)return[];var C=v.length;return C>1&&mo(c,v[0],v[1])?v=[]:C>2&&mo(v[0],v[1],v[2])&&(v=[v[0]]),$i(c,Vr(v,1),[])}),ub=F2||function(){return St.Date.now()};function mX(c,v){if(typeof v!="function")throw new Di(a);return c=Ft(c),function(){if(--c<1)return v.apply(this,arguments)}}function QP(c,v,C){return v=C?n:v,v=c&&v==null?c.length:v,he(c,I,n,n,n,n,v)}function JP(c,v){var C;if(typeof v!="function")throw new Di(a);return c=Ft(c),function(){return--c>0&&(C=v.apply(this,arguments)),c<=1&&(v=n),C}}var Y4=Tt(function(c,v,C){var A=E;if(C.length){var j=ua(C,et(Y4));A|=O}return he(c,A,v,C,j)}),eT=Tt(function(c,v,C){var A=E|_;if(C.length){var j=ua(C,et(eT));A|=O}return he(v,A,c,C,j)});function tT(c,v,C){v=C?n:v;var A=he(c,T,n,n,n,n,n,v);return A.placeholder=tT.placeholder,A}function nT(c,v,C){v=C?n:v;var A=he(c,L,n,n,n,n,n,v);return A.placeholder=nT.placeholder,A}function rT(c,v,C){var A,j,W,Z,te,ce,Ce=0,Ee=!1,Re=!1,nt=!0;if(typeof c!="function")throw new Di(a);v=Ga(v)||0,Cr(C)&&(Ee=!!C.leading,Re="maxWait"in C,W=Re?Or(Ga(C.maxWait)||0,v):W,nt="trailing"in C?!!C.trailing:nt);function gt(Yr){var Rs=A,Lu=j;return A=j=n,Ce=Yr,Z=c.apply(Lu,Rs),Z}function _t(Yr){return Ce=Yr,te=Tv(Xt,v),Ee?gt(Yr):Z}function Vt(Yr){var Rs=Yr-ce,Lu=Yr-Ce,wT=v-Rs;return Re?hi(wT,W-Lu):wT}function kt(Yr){var Rs=Yr-ce,Lu=Yr-Ce;return ce===n||Rs>=v||Rs<0||Re&&Lu>=W}function Xt(){var Yr=ub();if(kt(Yr))return tn(Yr);te=Tv(Xt,Vt(Yr))}function tn(Yr){return te=n,nt&&A?gt(Yr):(A=j=n,Z)}function ya(){te!==n&&bv(te),Ce=0,A=ce=j=te=n}function vo(){return te===n?Z:tn(ub())}function ba(){var Yr=ub(),Rs=kt(Yr);if(A=arguments,j=this,ce=Yr,Rs){if(te===n)return _t(ce);if(Re)return bv(te),te=Tv(Xt,v),gt(ce)}return te===n&&(te=Tv(Xt,v)),Z}return ba.cancel=ya,ba.flush=vo,ba}var vX=Tt(function(c,v){return uv(c,1,v)}),yX=Tt(function(c,v,C){return uv(c,Ga(v)||0,C)});function bX(c){return he(c,U)}function cb(c,v){if(typeof c!="function"||v!=null&&typeof v!="function")throw new Di(a);var C=function(){var A=arguments,j=v?v.apply(this,A):A[0],W=C.cache;if(W.has(j))return W.get(j);var Z=c.apply(this,A);return C.cache=W.set(j,Z)||W,Z};return C.cache=new(cb.Cache||da),C}cb.Cache=da;function db(c){if(typeof c!="function")throw new Di(a);return function(){var v=arguments;switch(v.length){case 0:return!c.call(this);case 1:return!c.call(this,v[0]);case 2:return!c.call(this,v[0],v[1]);case 3:return!c.call(this,v[0],v[1],v[2])}return!c.apply(this,v)}}function xX(c){return JP(2,c)}var SX=z4(function(c,v){v=v.length==1&&$t(v[0])?Hn(v[0],Wr(Oe())):Hn(Vr(v,1),Wr(Oe()));var C=v.length;return Tt(function(A){for(var j=-1,W=hi(A.length,C);++j=v}),th=ng(function(){return arguments}())?ng:function(c){return jr(c)&&an.call(c,"callee")&&!Y0.call(c,"callee")},$t=me.isArray,jX=di?Wr(di):fv;function $o(c){return c!=null&&fb(c.length)&&!Tu(c)}function Kr(c){return jr(c)&&$o(c)}function NX(c){return c===!0||c===!1||jr(c)&&Ci(c)==Xe}var id=B2||s5,$X=Lo?Wr(Lo):hv;function FX(c){return jr(c)&&c.nodeType===1&&!Mv(c)}function BX(c){if(c==null)return!0;if($o(c)&&($t(c)||typeof c=="string"||typeof c.splice=="function"||id(c)||mg(c)||th(c)))return!c.length;var v=ki(c);if(v==Fe||v==Ie)return!c.size;if(Pv(c))return!Gr(c).length;for(var C in c)if(an.call(c,C))return!1;return!0}function zX(c,v){return Zc(c,v)}function HX(c,v,C){C=typeof C=="function"?C:n;var A=C?C(c,v):n;return A===n?Zc(c,v,n,C):!!A}function Z4(c){if(!jr(c))return!1;var v=Ci(c);return v==Be||v==yt||typeof c.message=="string"&&typeof c.name=="string"&&!Mv(c)}function WX(c){return typeof c=="number"&&zp(c)}function Tu(c){if(!Cr(c))return!1;var v=Ci(c);return v==Ae||v==bt||v==Qe||v==on}function oT(c){return typeof c=="number"&&c==Ft(c)}function fb(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=q}function Cr(c){var v=typeof c;return c!=null&&(v=="object"||v=="function")}function jr(c){return c!=null&&typeof c=="object"}var aT=uo?Wr(uo):B4;function UX(c,v){return c===v||Qc(c,v,At(v))}function VX(c,v,C){return C=typeof C=="function"?C:n,Qc(c,v,At(v),C)}function GX(c){return sT(c)&&c!=+c}function qX(c){if(LK(c))throw new Lt(o);return rg(c)}function KX(c){return c===null}function YX(c){return c==null}function sT(c){return typeof c=="number"||jr(c)&&Ci(c)==at}function Mv(c){if(!jr(c)||Ci(c)!=mt)return!1;var v=$c(c);if(v===null)return!0;var C=an.call(v,"constructor")&&v.constructor;return typeof C=="function"&&C instanceof C&&xr.call(C)==xi}var Q4=Fa?Wr(Fa):Sr;function XX(c){return oT(c)&&c>=-q&&c<=q}var lT=ul?Wr(ul):Wt;function hb(c){return typeof c=="string"||!$t(c)&&jr(c)&&Ci(c)==He}function va(c){return typeof c=="symbol"||jr(c)&&Ci(c)==Ue}var mg=B0?Wr(B0):ei;function ZX(c){return c===n}function QX(c){return jr(c)&&ki(c)==je}function JX(c){return jr(c)&&Ci(c)==vt}var eZ=P(ml),tZ=P(function(c,v){return c<=v});function uT(c){if(!c)return[];if($o(c))return hb(c)?Qi(c):Bi(c);if(Fc&&c[Fc])return R2(c[Fc]());var v=ki(c),C=v==Fe?Np:v==Ie?Of:vg;return C(c)}function Mu(c){if(!c)return c===0?c:0;if(c=Ga(c),c===Q||c===-Q){var v=c<0?-1:1;return v*X}return c===c?c:0}function Ft(c){var v=Mu(c),C=v%1;return v===v?C?v-C:v:0}function cT(c){return c?Cu(Ft(c),0,fe):0}function Ga(c){if(typeof c=="number")return c;if(va(c))return ee;if(Cr(c)){var v=typeof c.valueOf=="function"?c.valueOf():c;c=Cr(v)?v+"":v}if(typeof c!="string")return c===0?c:+c;c=co(c);var C=O0.test(c);return C||I0.test(c)?ot(c.slice(2),C?2:8):A0.test(c)?ee:+c}function dT(c){return Ua(c,Fo(c))}function nZ(c){return c?Cu(Ft(c),-q,q):c===0?c:0}function _n(c){return c==null?"":po(c)}var rZ=go(function(c,v){if(Pv(v)||$o(v)){Ua(v,Ei(v),c);return}for(var C in v)an.call(v,C)&&pl(c,C,v[C])}),fT=go(function(c,v){Ua(v,Fo(v),c)}),pb=go(function(c,v,C,A){Ua(v,Fo(v),c,A)}),iZ=go(function(c,v,C,A){Ua(v,Ei(v),c,A)}),oZ=gr(Vp);function aZ(c,v){var C=wu(c);return v==null?C:st(C,v)}var sZ=Tt(function(c,v){c=dn(c);var C=-1,A=v.length,j=A>2?v[2]:n;for(j&&mo(v[0],v[1],j)&&(A=1);++C1),W}),Ua(c,ge(c),C),A&&(C=wi(C,p|m|y,Rt));for(var j=v.length;j--;)cg(C,v[j]);return C});function kZ(c,v){return pT(c,db(Oe(v)))}var EZ=gr(function(c,v){return c==null?{}:mv(c,v)});function pT(c,v){if(c==null)return{};var C=Hn(ge(c),function(A){return[A]});return v=Oe(v),ig(c,C,function(A,j){return v(A,j[0])})}function PZ(c,v,C){v=Sl(v,c);var A=-1,j=v.length;for(j||(j=1,c=n);++Av){var A=c;c=v,v=A}if(C||c%1||v%1){var j=Q0();return hi(c+j*(v-c+pe("1e-"+((j+"").length-1))),v)}return Gf(c,v)}var $Z=_l(function(c,v,C){return v=v.toLowerCase(),c+(C?vT(v):v)});function vT(c){return t5(_n(c).toLowerCase())}function yT(c){return c=_n(c),c&&c.replace(j0,O2).replace(Mp,"")}function FZ(c,v,C){c=_n(c),v=po(v);var A=c.length;C=C===n?A:Cu(Ft(C),0,A);var j=C;return C-=v.length,C>=0&&c.slice(C,j)==v}function BZ(c){return c=_n(c),c&&Na.test(c)?c.replace(Xi,_s):c}function zZ(c){return c=_n(c),c&&k0.test(c)?c.replace(mf,"\\$&"):c}var HZ=_l(function(c,v,C){return c+(C?"-":"")+v.toLowerCase()}),WZ=_l(function(c,v,C){return c+(C?" ":"")+v.toLowerCase()}),UZ=pg("toLowerCase");function VZ(c,v,C){c=_n(c),v=Ft(v);var A=v?za(c):0;if(!v||A>=v)return c;var j=(v-A)/2;return f(Su(j),C)+c+f(Ff(j),C)}function GZ(c,v,C){c=_n(c),v=Ft(v);var A=v?za(c):0;return v&&A>>0,C?(c=_n(c),c&&(typeof v=="string"||v!=null&&!Q4(v))&&(v=po(v),!v&&bu(c))?Ls(Qi(c),0,C):c.split(v,C)):[]}var JZ=_l(function(c,v,C){return c+(C?" ":"")+t5(v)});function eQ(c,v,C){return c=_n(c),C=C==null?0:Cu(Ft(C),0,c.length),v=po(v),c.slice(C,C+v.length)==v}function tQ(c,v,C){var A=F.templateSettings;C&&mo(c,v,C)&&(v=n),c=_n(c),v=pb({},v,A,We);var j=pb({},v.imports,A.imports,We),W=Ei(j),Z=Af(j,W),te,ce,Ce=0,Ee=v.interpolate||rl,Re="__p += '",nt=If((v.escape||rl).source+"|"+Ee.source+"|"+(Ee===bc?L0:rl).source+"|"+(v.evaluate||rl).source+"|$","g"),gt="//# sourceURL="+(an.call(v,"sourceURL")?(v.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ap+"]")+` +`;c.replace(nt,function(kt,Xt,tn,ya,vo,ba){return tn||(tn=ya),Re+=c.slice(Ce,ba).replace(N0,dl),Xt&&(te=!0,Re+=`' + __e(`+Xt+`) + '`),vo&&(ce=!0,Re+=`'; `+vo+`; __p += '`),tn&&(Re+=`' + ((__t = (`+tn+`)) == null ? '' : __t) + -'`),_e=ba+kt.length,kt}),Re+=`'; +'`),Ce=ba+kt.length,kt}),Re+=`'; `;var _t=an.call(v,"variable")&&v.variable;if(!_t)Re=`with (obj) { `+Re+` } -`;else if(T0.test(_t))throw new Mt(s);Re=(ce?Re.replace(vs,""):Re).replace(tl,"$1").replace(gf,"$1;"),Re="function("+(_t||"obj")+`) { +`;else if(T0.test(_t))throw new Lt(s);Re=(ce?Re.replace(vs,""):Re).replace(tl,"$1").replace(gf,"$1;"),Re="function("+(_t||"obj")+`) { `+(_t?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(te?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Re+`return __p -}`;var Ut=bT(function(){return en(W,mt+"return "+Re).apply(n,Z)});if(Ut.source=Re,Z4(Ut))throw Ut;return Ut}function tQ(c){return _n(c).toLowerCase()}function nQ(c){return _n(c).toUpperCase()}function rQ(c,v,C){if(c=_n(c),c&&(C||v===n))return co(c);if(!c||!(v=po(v)))return c;var A=Qi(c),j=Qi(v),W=la(A,j),Z=Cs(A,j)+1;return Ls(A,W,Z).join("")}function iQ(c,v,C){if(c=_n(c),c&&(C||v===n))return c.slice(0,U0(c)+1);if(!c||!(v=po(v)))return c;var A=Qi(c),j=Cs(A,Qi(v))+1;return Ls(A,0,j).join("")}function oQ(c,v,C){if(c=_n(c),c&&(C||v===n))return c.replace(xc,"");if(!c||!(v=po(v)))return c;var A=Qi(c),j=la(A,Qi(v));return Ls(A,j).join("")}function aQ(c,v){var C=B,A=K;if(Cr(v)){var j="separator"in v?v.separator:j;C="length"in v?Ft(v.length):C,A="omission"in v?po(v.omission):A}c=_n(c);var W=c.length;if(bu(c)){var Z=Qi(c);W=Z.length}if(C>=W)return c;var te=C-Ba(A);if(te<1)return A;var ce=Z?Ls(Z,0,te).join(""):c.slice(0,te);if(j===n)return ce+A;if(Z&&(te+=ce.length-te),Q4(j)){if(c.slice(te).search(j)){var _e,Pe=ce;for(j.global||(j=If(j.source,_n(bs.exec(j))+"g")),j.lastIndex=0;_e=j.exec(Pe);)var Re=_e.index;ce=ce.slice(0,Re===n?te:Re)}}else if(c.indexOf(po(j),te)!=te){var tt=ce.lastIndexOf(j);tt>-1&&(ce=ce.slice(0,tt))}return ce+A}function sQ(c){return c=_n(c),c&&C0.test(c)?c.replace(ys,j2):c}var lQ=_l(function(c,v,C){return c+(C?" ":"")+v.toUpperCase()}),t5=pg("toUpperCase");function yT(c,v,C){return c=_n(c),v=C?n:v,v===n?jp(c)?Rf(c):H0(c):c.match(v)||[]}var bT=Tt(function(c,v){try{return Ii(c,n,v)}catch(C){return Z4(C)?C:new Mt(C)}}),uQ=gr(function(c,v){return Zn(v,function(C){C=kl(C),fa(c,C,Y4(c[C],c))}),c});function cQ(c){var v=c==null?0:c.length,C=Oe();return c=v?Hn(c,function(A){if(typeof A[1]!="function")throw new Di(a);return[C(A[0]),A[1]]}):[],Tt(function(A){for(var j=-1;++jq)return[];var C=fe,A=hi(c,fe);v=Oe(v),c-=fe;for(var j=Lf(A,v);++C0||v<0)?new Yt(C):(c<0?C=C.takeRight(-c):c&&(C=C.drop(c)),v!==n&&(v=Ft(v),C=v<0?C.dropRight(-v):C.take(v-c)),C)},Yt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Yt.prototype.toArray=function(){return this.take(fe)},ga(Yt.prototype,function(c,v){var C=/^(?:filter|find|map|reject)|While$/.test(v),A=/^(?:head|last)$/.test(v),j=F[A?"take"+(v=="last"?"Right":""):v],W=A||/^find/.test(v);j&&(F.prototype[v]=function(){var Z=this.__wrapped__,te=A?[1]:arguments,ce=Z instanceof Yt,_e=te[0],Pe=ce||$t(Z),Re=function(Xt){var tn=j.apply(F,Fa([Xt],te));return A&&tt?tn[0]:tn};Pe&&C&&typeof _e=="function"&&_e.length!=1&&(ce=Pe=!1);var tt=this.__chain__,mt=!!this.__actions__.length,_t=W&&!tt,Ut=ce&&!mt;if(!W&&Pe){Z=Ut?Z:new Yt(this);var kt=c.apply(Z,te);return kt.__actions__.push({func:sb,args:[Re],thisArg:n}),new fo(kt,tt)}return _t&&Ut?c.apply(this,te):(kt=this.thru(Re),_t?A?kt.value()[0]:kt.value():kt)})}),Zn(["pop","push","shift","sort","splice","unshift"],function(c){var v=Ic[c],C=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",A=/^(?:pop|shift)$/.test(c);F.prototype[c]=function(){var j=arguments;if(A&&!this.__chain__){var W=this.value();return v.apply($t(W)?W:[],j)}return this[C](function(Z){return v.apply($t(Z)?Z:[],j)})}}),ga(Yt.prototype,function(c,v){var C=F[v];if(C){var A=C.name+"";an.call(ks,A)||(ks[A]=[]),ks[A].push({name:v,func:C})}}),ks[Qf(n,_).name]=[{name:"wrapper",func:n}],Yt.prototype.clone=Ji,Yt.prototype.reverse=Ni,Yt.prototype.value=U2,F.prototype.at=$Y,F.prototype.chain=FY,F.prototype.commit=BY,F.prototype.next=zY,F.prototype.plant=WY,F.prototype.reverse=VY,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=UY,F.prototype.first=F.prototype.head,Fc&&(F.prototype[Fc]=HY),F},za=Ro();Kt?((Kt.exports=za)._=za,At._=za):St._=za}).call(So)})(zSe,Te);const Pg=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Tg=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},HSe=.999,WSe=.1,VSe=20,Vv=.95,YO=30,mk=10,XO=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),ih=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Hl(s/o,64)):o<1&&(r.height=s,r.width=Hl(s*o,64)),a=r.width*r.height;return r},USe=e=>({width:Hl(e.width,64),height:Hl(e.height,64)}),DW=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],GSe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],gE=e=>e.kind==="line"&&e.layer==="mask",qSe=e=>e.kind==="line"&&e.layer==="base",S3=e=>e.kind==="image"&&e.layer==="base",KSe=e=>e.kind==="fillRect"&&e.layer==="base",YSe=e=>e.kind==="eraseRect"&&e.layer==="base",XSe=e=>e.kind==="line",h1={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},ZSe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:h1,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},jW=ap({name:"canvas",initialState:ZSe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(Te.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!gE(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Cd(Te.clamp(n.width,64,512),64),height:Cd(Te.clamp(n.height,64,512),64)},o={x:Hl(n.width/2-i.width/2,64),y:Hl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=ih(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(Te.cloneDeep(e.layerState)),e.layerState={...h1,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Tg(r.width,r.height,n.width,n.height,Vv),s=Pg(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=USe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=ih(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=XO(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(Te.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(Te.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...h1.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(Te.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(Te.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(Te.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(XSe);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(Te.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(Te.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(Te.cloneDeep(e.layerState)),e.layerState=h1,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(S3),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const d=Tg(i.width,i.height,512,512,Vv),p=Pg(i.width,i.height,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=p,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=ih(m);e.scaledBoundingBoxDimensions=y}return}const{width:o,height:a}=r,l=Tg(t,n,o,a,.95),u=Pg(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=XO(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(S3)){const i=Tg(r.width,r.height,512,512,Vv),o=Pg(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=ih(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const d=r?1:Tg(i,o,l,u,Vv),p=Pg(i,o,a,s,l,u,d);e.stageScale=d,e.stageCoordinates=p}else{const d=Tg(i,o,512,512,Vv),p=Pg(i,o,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=p,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=ih(m);e.scaledBoundingBoxDimensions=y}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(Te.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...h1.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Cd(Te.clamp(o,64,512),64),height:Cd(Te.clamp(a,64,512),64)},l={x:Hl(o/2-s.width/2,64),y:Hl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=ih(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=ih(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(Te.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:NW,addFillRect:$W,addImageToStagingArea:QSe,addLine:JSe,addPointToCurrentLine:FW,clearCanvasHistory:BW,clearMask:mE,commitColorPickerColor:e3e,commitStagingAreaImage:t3e,discardStagedImages:n3e,fitBoundingBoxToStage:gNe,mouseLeftCanvas:r3e,nextStagingAreaImage:i3e,prevStagingAreaImage:o3e,redo:a3e,resetCanvas:vE,resetCanvasInteractionState:s3e,resetCanvasView:zW,resizeAndScaleCanvas:i4,resizeCanvas:l3e,setBoundingBoxCoordinates:DC,setBoundingBoxDimensions:p1,setBoundingBoxPreviewFill:mNe,setBoundingBoxScaleMethod:u3e,setBrushColor:Mm,setBrushSize:Lm,setCanvasContainerDimensions:c3e,setColorPickerColor:d3e,setCursorPosition:f3e,setDoesCanvasNeedScaling:Li,setInitialCanvasImage:o4,setIsDrawing:HW,setIsMaskEnabled:p2,setIsMouseOverBoundingBox:Jb,setIsMoveBoundingBoxKeyHeld:vNe,setIsMoveStageKeyHeld:yNe,setIsMovingBoundingBox:jC,setIsMovingStage:w3,setIsTransformingBoundingBox:NC,setLayer:C3,setMaskColor:WW,setMergedCanvas:h3e,setShouldAutoSave:VW,setShouldCropToBoundingBoxOnSave:UW,setShouldDarkenOutsideBoundingBox:GW,setShouldLockBoundingBox:bNe,setShouldPreserveMaskedArea:qW,setShouldShowBoundingBox:p3e,setShouldShowBrush:xNe,setShouldShowBrushPreview:SNe,setShouldShowCanvasDebugInfo:KW,setShouldShowCheckboardTransparency:wNe,setShouldShowGrid:YW,setShouldShowIntermediates:XW,setShouldShowStagingImage:g3e,setShouldShowStagingOutline:ZO,setShouldSnapToGrid:_3,setStageCoordinates:ZW,setStageScale:m3e,setTool:Jl,toggleShouldLockBoundingBox:CNe,toggleTool:_Ne,undo:v3e,setScaledBoundingBoxDimensions:ex,setShouldRestrictStrokesToBox:QW}=jW.actions,y3e=jW.reducer,b3e={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},JW=ap({name:"gallery",initialState:b3e,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=Te.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:sm,clearIntermediateImage:$C,removeImage:eV,setCurrentImage:QO,addGalleryImages:x3e,setIntermediateImage:S3e,selectNextImage:yE,selectPrevImage:bE,setShouldPinGallery:w3e,setShouldShowGallery:Am,setGalleryScrollPosition:C3e,setGalleryImageMinimumWidth:Uv,setGalleryImageObjectFit:_3e,setShouldHoldGalleryOpen:tV,setShouldAutoSwitchToNewImages:k3e,setCurrentCategory:tx,setGalleryWidth:E3e,setShouldUseSingleGalleryColumn:P3e}=JW.actions,T3e=JW.reducer,M3e={isLightboxOpen:!1},L3e=M3e,nV=ap({name:"lightbox",initialState:L3e,reducers:{setIsLightboxOpen:(e,t)=>{e.isLightboxOpen=t.payload}}}),{setIsLightboxOpen:Om}=nV.actions,A3e=nV.reducer,V1=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" ");function xE(e){let t=V1(e),n=null;const r=new RegExp(/\[([^\][]*)]/,"gi"),i=[...t.matchAll(r)].map(o=>o[1]);return i.length&&(n=i.join(" "),i.forEach(o=>{t=t.replace(`[${o}]`,"").replaceAll("[]","").trim()})),[t,n]}const O3e=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return SE(r)?r:!1},SE=e=>Boolean(typeof e=="string"?O3e(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),k3=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),R3e=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0],10),parseFloat(r[1])]),rV={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512,horizontalSymmetryTimePercentage:0,verticalSymmetryTimePercentage:0},I3e=rV,iV=ap({name:"generation",initialState:I3e,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=V1(n)},setNegativePrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.negativePrompt=n:e.negativePrompt=V1(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:d,hires_fix:p,width:m,height:y}=t.payload.image;o&&o.length>0?(e.seedWeights=k3(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=V1(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,typeof u>"u"?e.perlin=0:e.perlin=u,typeof d=="boolean"&&(e.seamless=d),m&&(e.width=m),y&&(e.height=y)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:d,seamless:p,hires_fix:m,width:y,height:b,strength:w,fit:E,init_image_path:_,mask_image_path:k}=t.payload.image;if(n==="img2img"&&(_&&(e.initialImage=_),k&&(e.maskPath=k),w&&(e.img2imgStrength=w),typeof E=="boolean"&&(e.shouldFitToWidthHeight=E)),a&&a.length>0?(e.seedWeights=k3(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i){const[T,L]=xE(i);T&&(e.prompt=T),L?e.negativePrompt=L:e.negativePrompt=""}r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),typeof u>"u"?e.threshold=0:e.threshold=u,typeof d>"u"?e.perlin=0:e.perlin=d,typeof p=="boolean"&&(e.seamless=p),y&&(e.width=y),b&&(e.height=b)},resetParametersState:e=>({...e,...rV}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setHorizontalSymmetryTimePercentage:(e,t)=>{e.horizontalSymmetryTimePercentage=t.payload},setVerticalSymmetryTimePercentage:(e,t)=>{e.verticalSymmetryTimePercentage=t.payload}}}),{clearInitialImage:oV,resetParametersState:kNe,resetSeed:ENe,setAllImageToImageParameters:D3e,setAllParameters:aV,setAllTextToImageParameters:PNe,setCfgScale:vk,setHeight:cS,setImg2imgStrength:yk,setInfillMethod:sV,setInitialImage:v0,setIterations:JO,setMaskPath:lV,setParameter:TNe,setPerlin:bk,setPrompt:a4,setNegativePrompt:Dy,setSampler:uV,setSeamBlur:eR,setSeamless:cV,setSeamSize:tR,setSeamSteps:nR,setSeamStrength:rR,setSeed:g2,setSeedWeights:dV,setShouldFitToWidthHeight:fV,setShouldGenerateVariations:j3e,setShouldRandomizeSeed:N3e,setSteps:xk,setThreshold:Sk,setTileSize:iR,setVariationAmount:oR,setWidth:dS,setHorizontalSymmetryTimePercentage:aR,setVerticalSymmetryTimePercentage:sR}=iV.actions,$3e=iV.reducer,hV={codeformerFidelity:.75,facetoolStrength:.75,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingDenoising:.75,upscalingStrength:.75},F3e=hV,pV=ap({name:"postprocessing",initialState:F3e,reducers:{setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingDenoising:(e,t)=>{e.upscalingDenoising=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setHiresStrength:(e,t)=>{e.hiresStrength=t.payload},resetPostprocessingState:e=>({...e,...hV}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload}}}),{resetPostprocessingState:MNe,setCodeformerFidelity:wk,setFacetoolStrength:E3,setFacetoolType:fS,setHiresFix:gV,setHiresStrength:lR,setShouldLoopback:B3e,setShouldRunESRGAN:z3e,setShouldRunFacetool:H3e,setUpscalingLevel:mV,setUpscalingDenoising:Ck,setUpscalingStrength:_k}=pV.actions,W3e=pV.reducer;function gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};gs(this,e),this.init(t,n)}return ms(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||G3e,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function pR(e,t,n){var r=wE(e,t,Object),i=r.obj,o=r.k;i[o]=n}function Y3e(e,t,n,r){var i=wE(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}function P3(e,t){var n=wE(e,t),r=n.obj,i=n.k;if(r)return r[i]}function gR(e,t,n){var r=P3(e,n);return r!==void 0?r:P3(t,n)}function xV(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):xV(e[r],t[r],n):e[r]=t[r]);return e}function Mg(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var X3e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Z3e(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return X3e[t]}):e}var l4=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Q3e=[" ",",","?","!",";"];function J3e(e,t,n){t=t||"",n=n||"";var r=Q3e.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function mR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nx(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function SV(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(o+a).join(n);return u?SV(l,u,n):void 0}i=i[r[o]]}return i}}var nwe=function(e){s4(n,e);var t=ewe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return gs(this,n),i=t.call(this),l4&&Jd.call(Fd(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return ms(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[i,o];a&&typeof a!="string"&&(d=d.concat(a)),a&&typeof a=="string"&&(d=d.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(d=i.split("."));var p=P3(this.data,d);return p||!u||typeof a!="string"?p:SV(this.data&&this.data[i]&&this.data[i][o],a,l)}},{key:"addResource",value:function(i,o,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var d=[i,o];a&&(d=d.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(d=i.split("."),s=o,o=d[1]),this.addNamespaces(o),pR(this.data,d,s),l.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(i,o,l,a[l],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[i,o];i.indexOf(".")>-1&&(d=i.split("."),s=a,a=o,o=d[1]),this.addNamespaces(o);var p=P3(this.data,d)||{};s?xV(p,a,l):p=nx(nx({},p),a),pR(this.data,d,p),u.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?nx(nx({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Jd),wV={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,i,o))}),n}};function vR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yo(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var yR={},bR=function(e){s4(n,e);var t=rwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return gs(this,n),i=t.call(this),l4&&Jd.call(Fd(i)),K3e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Fd(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Wl.create("translator"),i}return ms(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=a&&i.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!J3e(i,a,s);if(u&&!d){var p=i.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:i,namespaces:l};var m=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(m[0])>-1)&&(l=m.shift()),i=m.join(s)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,a){var s=this;if(Ks(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,d=this.extractFromKey(i[i.length-1],o),p=d.key,m=d.namespaces,y=m[m.length-1],b=o.lng||this.language,w=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(w){var E=o.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(y).concat(E).concat(p),usedKey:p,exactUsedKey:p,usedLng:b,usedNS:y}:"".concat(y).concat(E).concat(p)}return l?{res:p,usedKey:p,exactUsedKey:p,usedLng:b,usedNS:y}:p}var _=this.resolve(i,o),k=_&&_.res,T=_&&_.usedKey||p,L=_&&_.exactUsedKey||p,O=Object.prototype.toString.apply(k),D=["[object Number]","[object Function]","[object RegExp]"],I=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,N=!this.i18nFormat||this.i18nFormat.handleAsObject,V=typeof k!="string"&&typeof k!="boolean"&&typeof k!="number";if(N&&k&&V&&D.indexOf(O)<0&&!(typeof I=="string"&&O==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,k,yo(yo({},o),{},{ns:m})):"key '".concat(p," (").concat(this.language,")' returned an object instead of string.");return l?(_.res=B,_):B}if(u){var K=O==="[object Array]",ne=K?[]:{},z=K?L:T;for(var $ in k)if(Object.prototype.hasOwnProperty.call(k,$)){var H="".concat(z).concat(u).concat($);ne[$]=this.translate(H,yo(yo({},o),{joinArrays:!1,ns:m})),ne[$]===H&&(ne[$]=k[$])}k=ne}}else if(N&&typeof I=="string"&&O==="[object Array]")k=k.join(I),k&&(k=this.extendTranslation(k,i,o,a));else{var Y=!1,Q=!1,q=o.count!==void 0&&typeof o.count!="string",X=n.hasDefaultValue(o),ee=q?this.pluralResolver.getSuffix(b,o.count,o):"",fe=o["defaultValue".concat(ee)]||o.defaultValue;!this.isValidLookup(k)&&X&&(Y=!0,k=fe),this.isValidLookup(k)||(Q=!0,k=p);var Ee=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,we=Ee&&Q?void 0:k,xe=X&&fe!==k&&this.options.updateMissing;if(Q||Y||xe){if(this.logger.log(xe?"updateKey":"missingKey",b,y,p,xe?fe:k),u){var Ae=this.resolve(p,yo(yo({},o),{},{keySeparator:!1}));Ae&&Ae.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Se=[],Qe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Qe&&Qe[0])for(var Ye=0;Ye1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,d,p;return typeof i=="string"&&(i=[i]),i.forEach(function(m){if(!o.isValidLookup(s)){var y=o.extractFromKey(m,a),b=y.key;l=b;var w=y.namespaces;o.options.fallbackNS&&(w=w.concat(o.options.fallbackNS));var E=a.count!==void 0&&typeof a.count!="string",_=E&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),k=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",T=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);w.forEach(function(L){o.isValidLookup(s)||(p=L,!yR["".concat(T[0],"-").concat(L)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(p)&&(yR["".concat(T[0],"-").concat(L)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(T.join(", "),`" won't get resolved as namespace "`).concat(p,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(function(O){if(!o.isValidLookup(s)){d=O;var D=[b];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(D,b,O,L,a);else{var I;E&&(I=o.pluralResolver.getSuffix(O,a.count,a));var N="".concat(o.options.pluralSeparator,"zero");if(E&&(D.push(b+I),_&&D.push(b+N)),k){var V="".concat(b).concat(o.options.contextSeparator).concat(a.context);D.push(V),E&&(D.push(V+I),_&&D.push(V+N))}}for(var B;B=D.pop();)o.isValidLookup(s)||(u=B,s=o.getResource(O,L,B,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:d,usedNS:p}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),n}(Jd);function FC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var xR=function(){function e(t){gs(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Wl.create("languageUtils")}return ms(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=FC(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=FC(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=FC(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var a=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var a=r.getLanguagePartFromCode(o);if(r.isSupportedCode(a))return i=a;i=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){u&&(i.isSupportedCode(u)?a.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),o.forEach(function(l){a.indexOf(l)<0&&s(i.formatLanguageCode(l))}),a}}]),e}(),owe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],awe={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},swe=["v1","v2","v3"],SR={zero:0,one:1,two:2,few:3,many:4,other:5};function lwe(){var e={};return owe.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:awe[t.fc]}})}),e}var uwe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gs(this,e),this.languageUtils=t,this.options=n,this.logger=Wl.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=lwe()}return ms(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return SR[a]-SR[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):o.numbers.map(function(a){return r.getSuffix(n,a,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!swe.includes(this.options.compatibilityJSON)}}]),e}();function wR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fs(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};gs(this,e),this.logger=Wl.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return ms(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:Z3e,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Mg(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Mg(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Mg(r.nestingPrefix):r.nestingPrefixEscaped||Mg("$t("),this.nestingSuffix=r.nestingSuffix?Mg(r.nestingSuffix):r.nestingSuffixEscaped||Mg(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var a=this,s,l,u,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function p(E){return E.replace(/\$/g,"$$$$")}var m=function(_){if(_.indexOf(a.formatSeparator)<0){var k=gR(r,d,_);return a.alwaysFormat?a.format(k,void 0,i,Fs(Fs(Fs({},o),r),{},{interpolationkey:_})):k}var T=_.split(a.formatSeparator),L=T.shift().trim(),O=T.join(a.formatSeparator).trim();return a.format(gR(r,d,L),O,i,Fs(Fs(Fs({},o),r),{},{interpolationkey:L}))};this.resetRegExp();var y=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,w=[{regex:this.regexpUnescape,safeValue:function(_){return p(_)}},{regex:this.regexp,safeValue:function(_){return a.escapeValue?p(a.escape(_)):p(_)}}];return w.forEach(function(E){for(u=0;s=E.regex.exec(n);){var _=s[1].trim();if(l=m(_),l===void 0)if(typeof y=="function"){var k=y(n,s,o);l=typeof k=="string"?k:""}else if(o&&Object.prototype.hasOwnProperty.call(o,_))l="";else if(b){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(_," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=hR(l));var T=E.safeValue(l);if(n=n.replace(s[0],T),b?(E.regex.lastIndex+=l.length,E.regex.lastIndex-=s[0].length):E.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l;function u(y,b){var w=this.nestingOptionsSeparator;if(y.indexOf(w)<0)return y;var E=y.split(new RegExp("".concat(w,"[ ]*{"))),_="{".concat(E[1]);y=E[0],_=this.interpolate(_,l);var k=_.match(/'/g),T=_.match(/"/g);(k&&k.length%2===0&&!T||T.length%2!==0)&&(_=_.replace(/'/g,'"'));try{l=JSON.parse(_),b&&(l=Fs(Fs({},b),l))}catch(L){return this.logger.warn("failed parsing options string in nesting for key ".concat(y),L),"".concat(y).concat(w).concat(_)}return delete l.defaultValue,y}for(;a=this.nestingRegexp.exec(n);){var d=[];l=Fs({},o),l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;var p=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var m=a[1].split(this.formatSeparator).map(function(y){return y.trim()});a[1]=m.shift(),d=m,p=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=hR(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),p&&(s=d.reduce(function(y,b){return i.format(y,b,o.lng,Fs(Fs({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function CR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ru(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(a){var s=a.split(":"),l=U3e(s),u=l[0],d=l.slice(1),p=d.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=p),p==="false"&&(n[u.trim()]=!1),p==="true"&&(n[u.trim()]=!0),isNaN(p)||(n[u.trim()]=parseInt(p,10))}})}}return{formatName:t,formatOptions:n}}function Lg(e){var t={};return function(r,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(r)}}var fwe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gs(this,e),this.logger=Wl.create("formatter"),this.options=t,this.formats={number:Lg(function(n,r){var i=new Intl.NumberFormat(n,Ru({},r));return function(o){return i.format(o)}}),currency:Lg(function(n,r){var i=new Intl.NumberFormat(n,Ru(Ru({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:Lg(function(n,r){var i=new Intl.DateTimeFormat(n,Ru({},r));return function(o){return i.format(o)}}),relativetime:Lg(function(n,r){var i=new Intl.RelativeTimeFormat(n,Ru({},r));return function(o){return i.format(o,r.range||"day")}}),list:Lg(function(n,r){var i=new Intl.ListFormat(n,Ru({},r));return function(o){return i.format(o)}})},this.init(t)}return ms(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Lg(r)}},{key:"format",value:function(n,r,i){var o=this,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r.split(this.formatSeparator),l=s.reduce(function(u,d){var p=dwe(d),m=p.formatName,y=p.formatOptions;if(o.formats[m]){var b=u;try{var w=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},E=w.locale||w.lng||a.locale||a.lng||i;b=o.formats[m](u,E,Ru(Ru(Ru({},y),a),w))}catch(_){o.logger.warn(_)}return b}else o.logger.warn("there was no format function for ".concat(m));return u},n);return l}}]),e}();function _R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kR(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gwe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var mwe=function(e){s4(n,e);var t=hwe(n);function n(r,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return gs(this,n),a=t.call(this),l4&&Jd.call(Fd(a)),a.backend=r,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=Wl.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return ms(n,[{key:"queueLoad",value:function(i,o,a,s){var l=this,u={},d={},p={},m={};return i.forEach(function(y){var b=!0;o.forEach(function(w){var E="".concat(y,"|").concat(w);!a.reload&&l.store.hasResourceBundle(y,w)?l.state[E]=2:l.state[E]<0||(l.state[E]===1?d[E]===void 0&&(d[E]=!0):(l.state[E]=1,b=!1,d[E]===void 0&&(d[E]=!0),u[E]===void 0&&(u[E]=!0),m[w]===void 0&&(m[w]=!0)))}),b||(p[y]=!0)}),(Object.keys(u).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(d),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),l=s[0],u=s[1];o&&this.emit("failedLoading",l,u,o),a&&this.store.addResourceBundle(l,u,a),this.state[i]=o?-1:2;var d={};this.queue.forEach(function(p){Y3e(p.loaded,[l],u),gwe(p,i),o&&p.errors.push(o),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(function(m){d[m]||(d[m]={});var y=p.loaded[m];y.length&&y.forEach(function(b){d[m][b]===void 0&&(d[m][b]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(p){return!p.done})}},{key:"read",value:function(i,o,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!i.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:l,wait:u,callback:d});return}this.readingCalls++;var p=function(w,E){if(s.readingCalls--,s.waitingReads.length>0){var _=s.waitingReads.shift();s.read(_.lng,_.ns,_.fcName,_.tried,_.wait,_.callback)}if(w&&E&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(d){a.loadOne(d)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(d,p){d&&o.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),d),!d&&p&&o.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),p),o.loaded(i,d,p)})}},{key:"saveMissing",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend&&this.backend.create){var p=kR(kR({},u),{},{isUpdate:l}),m=this.backend.create.bind(this.backend);if(m.length<6)try{var y;m.length===5?y=m(i,o,a,s,p):y=m(i,o,a,s),y&&typeof y.then=="function"?y.then(function(b){return d(null,b)}).catch(d):d(null,y)}catch(b){d(b)}else m(i,o,a,s,d,p)}!i||!i[0]||this.store.addResource(i[0],o,a,s)}}}]),n}(Jd);function ER(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Ks(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Ks(t[2])==="object"||Ks(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function PR(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function TR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tl(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rx(){}function bwe(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var T3=function(e){s4(n,e);var t=vwe(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(gs(this,n),r=t.call(this),l4&&Jd.call(Fd(r)),r.options=PR(i),r.services={},r.logger=Wl,r.modules={external:[]},bwe(Fd(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),m2(r,Fd(r));setTimeout(function(){r.init(i,o)},0)}return r}return ms(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=ER();this.options=Tl(Tl(Tl({},s),this.options),PR(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Tl(Tl({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(_){return _?typeof _=="function"?new _:_:null}if(!this.options.isClone){this.modules.logger?Wl.init(l(this.modules.logger),this.options):Wl.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=fwe);var d=new xR(this.options);this.store=new nwe(this.options.resources,this.options);var p=this.services;p.logger=Wl,p.resourceStore=this.store,p.languageUtils=d,p.pluralResolver=new uwe(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(p.formatter=l(u),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new cwe(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new mwe(l(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(_){for(var k=arguments.length,T=new Array(k>1?k-1:0),L=1;L1?k-1:0),L=1;L0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var y=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];y.forEach(function(_){i[_]=function(){var k;return(k=i.store)[_].apply(k,arguments)}});var b=["addResource","addResources","addResourceBundle","removeResourceBundle"];b.forEach(function(_){i[_]=function(){var k;return(k=i.store)[_].apply(k,arguments),i}});var w=Gv(),E=function(){var k=function(L,O){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),w.resolve(O),a(L,O)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return k(null,i.t.bind(i));i.changeLanguage(i.options.lng,k)};return this.options.resources||!this.options.initImmediate?E():setTimeout(E,0),w}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rx,s=a,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],d=function(y){if(y){var b=o.services.languageUtils.toResolveHierarchy(y);b.forEach(function(w){u.indexOf(w)<0&&u.push(w)})}};if(l)d(l);else{var p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.forEach(function(m){return d(m)})}this.options.preload&&this.options.preload.forEach(function(m){return d(m)}),this.services.backendConnector.load(u,this.options.ns,function(m){!m&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(m)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=Gv();return i||(i=this.languages),o||(o=this.options.ns),a||(a=rx),this.services.backendConnector.reload(i,o,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&wV.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=Gv();this.emit("languageChanging",i);var l=function(m){a.language=m,a.languages=a.services.languageUtils.toResolveHierarchy(m),a.resolvedLanguage=void 0,a.setResolvedLanguage(m)},u=function(m,y){y?(l(y),a.translator.changeLanguage(y),a.isLanguageChangingTo=void 0,a.emit("languageChanged",y),a.logger.log("languageChanged",y)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(m,function(){return a.t.apply(a,arguments)})},d=function(m){!i&&!m&&a.services.languageDetector&&(m=[]);var y=typeof m=="string"?m:a.services.languageUtils.getBestMatchFromCodes(m);y&&(a.language||l(y),a.translator.language||a.translator.changeLanguage(y),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage&&a.services.languageDetector.cacheUserLanguage(y)),a.loadResources(y,function(b){u(b,y)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,l=function u(d,p){var m;if(Ks(p)!=="object"){for(var y=arguments.length,b=new Array(y>2?y-2:0),w=2;w1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var d=function(y,b){var w=o.services.backendConnector.state["".concat(y,"|").concat(b)];return w===-1||w===2};if(a.precheck){var p=a.precheck(this,d);if(p!==void 0)return p}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,i)&&(!l||d(u,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=Gv();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),o&&o(l)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=Gv();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],l=i.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),o&&o(u)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services&&this.services.languageUtils||new xR(ER());return o.indexOf(a.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rx,s=Tl(Tl(Tl({},this.options),o),{isClone:!0}),l=new n(s);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(d){l[d]=i[d]}),l.services=Tl({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new bR(l.services,l.options),l.translator.on("*",function(d){for(var p=arguments.length,m=new Array(p>1?p-1:0),y=1;y0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new T3(e,t)});var Et=T3.createInstance();Et.createInstance=T3.createInstance;Et.createInstance;Et.dir;Et.init;Et.loadResources;Et.reloadResources;Et.use;Et.changeLanguage;Et.getFixedT;Et.t;Et.exists;Et.setDefaultNamespace;Et.hasLoadedNamespace;Et.loadNamespaces;Et.loadLanguages;var CV=[],xwe=CV.forEach,Swe=CV.slice;function wwe(e){return xwe.call(Swe.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var MR=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Cwe=function(t,n,r){var i=r||{};i.path=i.path||"/";var o=encodeURIComponent(n),a="".concat(t,"=").concat(o);if(i.maxAge>0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!MR.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!MR.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},LR={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=Cwe(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),a=0;a0){var l=o[a].substring(0,s);l===t.lookupQuerystring&&(n=o[a].substring(s+1))}}}return n}},qv=null,AR=function(){if(qv!==null)return qv;try{qv=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{qv=!1}return qv},Ewe={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&AR()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&AR()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},Kv=null,OR=function(){if(Kv!==null)return Kv;try{Kv=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Kv=!1}return Kv},Pwe={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&OR()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&OR()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},Twe={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},Mwe={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},Lwe={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},Awe={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function Owe(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var _V=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gs(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return ms(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=wwe(r,this.options||{},Owe()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(_we),this.addDetector(kwe),this.addDetector(Ewe),this.addDetector(Pwe),this.addDetector(Twe),this.addDetector(Mwe),this.addDetector(Lwe),this.addDetector(Awe)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var a=r.detectors[o].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}]),e}();_V.type="languageDetector";function kk(e){return kk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kk(e)}var kV=[],Rwe=kV.forEach,Iwe=kV.slice;function Ek(e){return Rwe.call(Iwe.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function EV(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":kk(XMLHttpRequest))==="object"}function Dwe(e){return!!e&&typeof e.then=="function"}function jwe(e){return Dwe(e)?e:Promise.resolve(e)}function Nwe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jy={},$we={get exports(){return jy},set exports(e){jy=e}},U1={},Fwe={get exports(){return U1},set exports(e){U1=e}},RR;function Bwe(){return RR||(RR=1,function(e,t){var n=typeof self<"u"?self:So,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l($){return $&&DataView.prototype.isPrototypeOf($)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function($){return $&&u.indexOf(Object.prototype.toString.call($))>-1};function p($){if(typeof $!="string"&&($=String($)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test($))throw new TypeError("Invalid character in header field name");return $.toLowerCase()}function m($){return typeof $!="string"&&($=String($)),$}function y($){var H={next:function(){var Y=$.shift();return{done:Y===void 0,value:Y}}};return s.iterable&&(H[Symbol.iterator]=function(){return H}),H}function b($){this.map={},$ instanceof b?$.forEach(function(H,Y){this.append(Y,H)},this):Array.isArray($)?$.forEach(function(H){this.append(H[0],H[1])},this):$&&Object.getOwnPropertyNames($).forEach(function(H){this.append(H,$[H])},this)}b.prototype.append=function($,H){$=p($),H=m(H);var Y=this.map[$];this.map[$]=Y?Y+", "+H:H},b.prototype.delete=function($){delete this.map[p($)]},b.prototype.get=function($){return $=p($),this.has($)?this.map[$]:null},b.prototype.has=function($){return this.map.hasOwnProperty(p($))},b.prototype.set=function($,H){this.map[p($)]=m(H)},b.prototype.forEach=function($,H){for(var Y in this.map)this.map.hasOwnProperty(Y)&&$.call(H,this.map[Y],Y,this)},b.prototype.keys=function(){var $=[];return this.forEach(function(H,Y){$.push(Y)}),y($)},b.prototype.values=function(){var $=[];return this.forEach(function(H){$.push(H)}),y($)},b.prototype.entries=function(){var $=[];return this.forEach(function(H,Y){$.push([Y,H])}),y($)},s.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function w($){if($.bodyUsed)return Promise.reject(new TypeError("Already read"));$.bodyUsed=!0}function E($){return new Promise(function(H,Y){$.onload=function(){H($.result)},$.onerror=function(){Y($.error)}})}function _($){var H=new FileReader,Y=E(H);return H.readAsArrayBuffer($),Y}function k($){var H=new FileReader,Y=E(H);return H.readAsText($),Y}function T($){for(var H=new Uint8Array($),Y=new Array(H.length),Q=0;Q-1?H:$}function N($,H){H=H||{};var Y=H.body;if($ instanceof N){if($.bodyUsed)throw new TypeError("Already read");this.url=$.url,this.credentials=$.credentials,H.headers||(this.headers=new b($.headers)),this.method=$.method,this.mode=$.mode,this.signal=$.signal,!Y&&$._bodyInit!=null&&(Y=$._bodyInit,$.bodyUsed=!0)}else this.url=String($);if(this.credentials=H.credentials||this.credentials||"same-origin",(H.headers||!this.headers)&&(this.headers=new b(H.headers)),this.method=I(H.method||this.method||"GET"),this.mode=H.mode||this.mode||null,this.signal=H.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Y)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(Y)}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function V($){var H=new FormData;return $.trim().split("&").forEach(function(Y){if(Y){var Q=Y.split("="),q=Q.shift().replace(/\+/g," "),X=Q.join("=").replace(/\+/g," ");H.append(decodeURIComponent(q),decodeURIComponent(X))}}),H}function B($){var H=new b,Y=$.replace(/\r?\n[\t ]+/g," ");return Y.split(/\r?\n/).forEach(function(Q){var q=Q.split(":"),X=q.shift().trim();if(X){var ee=q.join(":").trim();H.append(X,ee)}}),H}O.call(N.prototype);function K($,H){H||(H={}),this.type="default",this.status=H.status===void 0?200:H.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in H?H.statusText:"OK",this.headers=new b(H.headers),this.url=H.url||"",this._initBody($)}O.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},K.error=function(){var $=new K(null,{status:0,statusText:""});return $.type="error",$};var ne=[301,302,303,307,308];K.redirect=function($,H){if(ne.indexOf(H)===-1)throw new RangeError("Invalid status code");return new K(null,{status:H,headers:{location:$}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(H,Y){this.message=H,this.name=Y;var Q=Error(H);this.stack=Q.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function z($,H){return new Promise(function(Y,Q){var q=new N($,H);if(q.signal&&q.signal.aborted)return Q(new a.DOMException("Aborted","AbortError"));var X=new XMLHttpRequest;function ee(){X.abort()}X.onload=function(){var fe={status:X.status,statusText:X.statusText,headers:B(X.getAllResponseHeaders()||"")};fe.url="responseURL"in X?X.responseURL:fe.headers.get("X-Request-URL");var Ee="response"in X?X.response:X.responseText;Y(new K(Ee,fe))},X.onerror=function(){Q(new TypeError("Network request failed"))},X.ontimeout=function(){Q(new TypeError("Network request failed"))},X.onabort=function(){Q(new a.DOMException("Aborted","AbortError"))},X.open(q.method,q.url,!0),q.credentials==="include"?X.withCredentials=!0:q.credentials==="omit"&&(X.withCredentials=!1),"responseType"in X&&s.blob&&(X.responseType="blob"),q.headers.forEach(function(fe,Ee){X.setRequestHeader(Ee,fe)}),q.signal&&(q.signal.addEventListener("abort",ee),X.onreadystatechange=function(){X.readyState===4&&q.signal.removeEventListener("abort",ee)}),X.send(typeof q._bodyInit>"u"?null:q._bodyInit)})}return z.polyfill=!0,o.fetch||(o.fetch=z,o.Headers=b,o.Request=N,o.Response=K),a.Headers=b,a.Request=N,a.Response=K,a.fetch=z,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Fwe,U1)),U1}(function(e,t){var n;if(typeof fetch=="function"&&(typeof So<"u"&&So.fetch?n=So.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof Nwe<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||Bwe();r.default&&(r=r.default),t.default=r,e.exports=t.default}})($we,jy);const PV=jy,IR=_j({__proto__:null,default:PV},[jy]);function M3(e){return M3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M3(e)}var Yu;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Yu=global.fetch:typeof window<"u"&&window.fetch?Yu=window.fetch:Yu=fetch);var Ny;EV()&&(typeof global<"u"&&global.XMLHttpRequest?Ny=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Ny=window.XMLHttpRequest));var L3;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?L3=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(L3=window.ActiveXObject));!Yu&&IR&&!Ny&&!L3&&(Yu=PV||IR);typeof Yu!="function"&&(Yu=void 0);var Pk=function(t,n){if(n&&M3(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},DR=function(t,n,r){Yu(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},jR=!1,zwe=function(t,n,r,i){t.queryStringParams&&(n=Pk(n,t.queryStringParams));var o=Ek({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=Ek({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},jR?{}:a);try{DR(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),DR(n,s,i),jR=!0}catch(u){i(u)}}},Hwe=function(t,n,r,i){r&&M3(r)==="object"&&(r=Pk("",r).slice(1)),t.queryStringParams&&(n=Pk(n,t.queryStringParams));try{var o;Ny?o=new Ny:o=new L3("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},Wwe=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Yu&&n.indexOf("file:")!==0)return zwe(t,n,r,i);if(EV()||typeof ActiveXObject=="function")return Hwe(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function $y(e){return $y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$y(e)}function Vwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NR(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Vwe(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return Uwe(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Ek(i,this.options||{},Kwe()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=jwe(l),l.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(d,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,d;try{typeof l.data=="string"?u=a.options.parse(l.data,i,o):u=l.data}catch{d="failed parsing "+n+" to json"}if(d)return r(d,!1);r(null,u)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,d=[],p=[];n.forEach(function(m){var y=s.options.addPath;typeof s.options.addPath=="function"&&(y=s.options.addPath(m,r));var b=s.services.interpolator.interpolate(y,{lng:m,ns:r});s.options.request(s.options,b,l,function(w,E){u+=1,d.push(w),p.push(E),u===n.length&&typeof a=="function"&&a(d,p)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(p){var m=o.toResolveHierarchy(p);m.forEach(function(y){l.indexOf(y)<0&&l.push(y)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),l.forEach(function(d){n.allOptions.ns.forEach(function(p){i.read(d,p,"read",null,null,function(m,y){m&&a.warn("loading namespace ".concat(p," for language ").concat(d," failed"),m),!m&&y&&a.log("loaded namespace ".concat(p," for language ").concat(d),y),i.loaded("".concat(d,"|").concat(p),m,y)})})})}}}]),e}();MV.type="backend";function Ywe(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var d=t.services.backendConnector.state["".concat(l,"|").concat(u)];return d===-1||d===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function Zwe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Tk("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):Xwe(e,t,n)}var Qwe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Jwe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},e4e=function(t){return Jwe[t]},t4e=function(t){return t.replace(Qwe,e4e)};function BR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zR(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};Mk=zR(zR({},Mk),e)}function r4e(){return Mk}var LV;function i4e(e){LV=e}function o4e(){return LV}var a4e={type:"3rdParty",init:function(t){n4e(t.options.react),i4e(t)}},s4e=S.createContext(),l4e=function(){function e(){gs(this,e),this.usedNamespaces={}}return ms(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function u4e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function c4e(e,t){return vV(e)||u4e(e,t)||yV(e,t)||bV()}function HR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BC(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=S.useContext(s4e)||{},i=r.i18n,o=r.defaultNS,a=n||i||o4e();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new l4e),!a){Tk("You will need to pass in an i18next instance by using initReactI18next");var s=function(V){return Array.isArray(V)?V[V.length-1]:V},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&Tk("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=BC(BC(BC({},r4e()),a.options.react),t),d=u.useSuspense,p=u.keyPrefix,m=e||o||a.options&&a.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(m);var y=(a.isInitialized||a.initializedStoreOnce)&&m.every(function(N){return Zwe(N,a,u)});function b(){return a.getFixedT(null,u.nsMode==="fallback"?m:m[0],p)}var w=S.useState(b),E=c4e(w,2),_=E[0],k=E[1],T=m.join(),L=d4e(T),O=S.useRef(!0);S.useEffect(function(){var N=u.bindI18n,V=u.bindI18nStore;O.current=!0,!y&&!d&&FR(a,m,function(){O.current&&k(b)}),y&&L&&L!==T&&O.current&&k(b);function B(){O.current&&k(b)}return N&&a&&a.on(N,B),V&&a&&a.store.on(V,B),function(){O.current=!1,N&&a&&N.split(" ").forEach(function(K){return a.off(K,B)}),V&&a&&V.split(" ").forEach(function(K){return a.store.off(K,B)})}},[a,T]);var D=S.useRef(!0);S.useEffect(function(){O.current&&!D.current&&k(b),D.current=!1},[a,p]);var I=[_,a,y];if(I.t=_,I.i18n=a,I.ready=y,y||!y&&!d)return I;throw new Promise(function(N){FR(a,m,function(){N()})})}Et.use(MV).use(_V).use(a4e).init({fallbackLng:"en",debug:!1,backend:{loadPath:"/locales/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const f4e={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[0],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:Et.isInitialized?Et.t("common.statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null,cancelOptions:{cancelType:"immediate",cancelAfter:null}},AV=ap({name:"system",initialState:f4e,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=Et.t("common.statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?Et.t("common.statusConnected"):Et.t("common.statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=Et.t("common.statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=Et.t("common.statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=Et.t("common.statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},modelConvertRequested:e=>{e.currentStatus=Et.t("common.statusConvertingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},modelMergingRequested:e=>{e.currentStatus=Et.t("common.statusMergingModels"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload},setCancelType:(e,t)=>{e.cancelOptions.cancelType=t.payload},setCancelAfter:(e,t)=>{e.cancelOptions.cancelAfter=t.payload}}}),{setShouldDisplayInProgressType:h4e,setIsProcessing:wa,addLogEntry:Pi,setShouldShowLogViewer:zC,setIsConnected:WR,setSocketId:LNe,setShouldConfirmOnDelete:OV,setOpenAccordions:p4e,setSystemStatus:g4e,setCurrentStatus:hh,setSystemConfig:m4e,setShouldDisplayGuides:v4e,processingCanceled:y4e,errorOccurred:VR,errorSeen:RV,setModelList:Ag,setIsCancelable:_d,modelChangeRequested:b4e,modelConvertRequested:x4e,modelMergingRequested:S4e,setSaveIntermediatesInterval:w4e,setEnableImageDebugging:C4e,generationRequested:_4e,addToast:$u,clearToastQueue:k4e,setProcessingIndeterminateTask:E4e,setSearchFolder:IV,setFoundModels:DV,setOpenModel:UR,setCancelType:GR,setCancelAfter:HC}=AV.actions,P4e=AV.reducer,CE=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],T4e={activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,shouldUseSliders:!1,addNewModelUIOption:null},M4e=T4e,jV=ap({name:"ui",initialState:M4e,reducers:{setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=CE.indexOf(t.payload)},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setParametersPanelScrollPosition:(e,t)=>{e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:(e,t)=>{e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:(e,t)=>{e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:(e,t)=>{e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:(e,t)=>{e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setShouldUseSliders:(e,t)=>{e.shouldUseSliders=t.payload},setAddNewModelUIOption:(e,t)=>{e.addNewModelUIOption=t.payload}}}),{setActiveTab:Wo,setCurrentTheme:L4e,setParametersPanelScrollPosition:A4e,setShouldHoldParametersPanelOpen:O4e,setShouldPinParametersPanel:R4e,setShouldShowParametersPanel:Fh,setShouldShowDualDisplay:I4e,setShouldShowImageDetails:NV,setShouldUseCanvasBetaLayout:D4e,setShouldShowExistingModelsInSearch:j4e,setShouldUseSliders:N4e,setAddNewModelUIOption:Bh}=jV.actions,$4e=jV.reducer,iu=Object.create(null);iu.open="0";iu.close="1";iu.ping="2";iu.pong="3";iu.message="4";iu.upgrade="5";iu.noop="6";const hS=Object.create(null);Object.keys(iu).forEach(e=>{hS[iu[e]]=e});const F4e={type:"error",data:"parser error"},B4e=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",z4e=typeof ArrayBuffer=="function",H4e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,$V=({type:e,data:t},n,r)=>B4e&&t instanceof Blob?n?r(t):qR(t,r):z4e&&(t instanceof ArrayBuffer||H4e(t))?n?r(t):qR(new Blob([t]),r):r(iu[e]+(t||"")),qR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)},KR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r>4,d[i++]=(a&15)<<4|s>>2,d[i++]=(s&3)<<6|l&63;return u},V4e=typeof ArrayBuffer=="function",FV=(e,t)=>{if(typeof e!="string")return{type:"message",data:BV(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:U4e(e.substring(1),t)}:hS[n]?e.length>1?{type:hS[n],data:e.substring(1)}:{type:hS[n]}:F4e},U4e=(e,t)=>{if(V4e){const n=W4e(e);return BV(n,t)}else return{base64:!0,data:e}},BV=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},zV=String.fromCharCode(30),G4e=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{$V(o,!1,s=>{r[a]=s,++i===n&&t(r.join(zV))})})},q4e=(e,t)=>{const n=e.split(zV),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function WV(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Y4e=Xa.setTimeout,X4e=Xa.clearTimeout;function u4(e,t){t.useNativeTimers?(e.setTimeoutFn=Y4e.bind(Xa),e.clearTimeoutFn=X4e.bind(Xa)):(e.setTimeoutFn=Xa.setTimeout.bind(Xa),e.clearTimeoutFn=Xa.clearTimeout.bind(Xa))}const Z4e=1.33;function Q4e(e){return typeof e=="string"?J4e(e):Math.ceil((e.byteLength||e.size)*Z4e)}function J4e(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class e5e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class VV extends ai{constructor(t){super(),this.writable=!1,u4(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new e5e(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=FV(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}}const UV="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Lk=64,t5e={};let YR=0,ix=0,XR;function ZR(e){let t="";do t=UV[e%Lk]+t,e=Math.floor(e/Lk);while(e>0);return t}function GV(){const e=ZR(+new Date);return e!==XR?(YR=0,XR=e):e+"."+ZR(YR++)}for(;ix{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};q4e(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,G4e(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=GV()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=qV(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new eu(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class eu extends ai{constructor(t,n){super(),u4(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=WV(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new YV(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=eu.requestsCount++,eu.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=i5e,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete eu.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}eu.requestsCount=0;eu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",QR);else if(typeof addEventListener=="function"){const e="onpagehide"in Xa?"pagehide":"unload";addEventListener(e,QR,!1)}}function QR(){for(let e in eu.requests)eu.requests.hasOwnProperty(e)&&eu.requests[e].abort()}const XV=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),ox=Xa.WebSocket||Xa.MozWebSocket,JR=!0,s5e="arraybuffer",eI=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class l5e extends VV{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=eI?{}:WV(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=JR&&!eI?n?new ox(t,n):new ox(t):new ox(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||s5e,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{JR&&this.ws.send(o)}catch{}i&&XV(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=GV()),this.supportsBinary||(t.b64=1);const i=qV(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!ox}}const u5e={websocket:l5e,polling:a5e},c5e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,d5e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ak(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=c5e.exec(e||""),o={},a=14;for(;a--;)o[d5e[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=f5e(o,o.path),o.queryKey=h5e(o,o.query),o}function f5e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function h5e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let ZV=class Ng extends ai{constructor(t,n={}){super(),this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=Ak(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=Ak(n.host).host),u4(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=n5e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=HV,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new u5e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Ng.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Ng.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ng.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=p=>{const m=new Error("probe error: "+p);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(p){n&&p.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",Ng.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Ng.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,QV=Object.prototype.toString,v5e=typeof Blob=="function"||typeof Blob<"u"&&QV.call(Blob)==="[object BlobConstructor]",y5e=typeof File=="function"||typeof File<"u"&&QV.call(File)==="[object FileConstructor]";function _E(e){return g5e&&(e instanceof ArrayBuffer||m5e(e))||v5e&&e instanceof Blob||y5e&&e instanceof File}function pS(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case nn.ACK:case nn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class C5e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=x5e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const _5e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:kE,Encoder:w5e,get PacketType(){return nn},protocol:S5e},Symbol.toStringTag,{value:"Module"}));function Hs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const k5e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class JV extends ai{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Hs(t,"open",this.onopen.bind(this)),Hs(t,"packet",this.onpacket.bind(this)),Hs(t,"error",this.onerror.bind(this)),Hs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(k5e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:nn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a{this.io.clearTimeoutFn(o),n.apply(this,[null,...a])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((a,s)=>r?a?o(a):i(s):i(a)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this.ids++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(){if(this._queue.length===0)return;const t=this._queue[0];if(t.pending)return;t.pending=!0,t.tryCount++;const n=this.ids;this.ids=t.id,this.flags=t.flags,this.emit.apply(this,t.args),this.ids=n}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:nn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case nn.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case nn.EVENT:case nn.BINARY_EVENT:this.onevent(t);break;case nn.ACK:case nn.BINARY_ACK:this.onack(t);break;case nn.DISCONNECT:this.ondisconnect();break;case nn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:nn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:nn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}y0.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};y0.prototype.reset=function(){this.attempts=0};y0.prototype.setMin=function(e){this.ms=e};y0.prototype.setMax=function(e){this.max=e};y0.prototype.setJitter=function(e){this.jitter=e};class Ik extends ai{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,u4(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new y0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||_5e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new ZV(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Hs(n,"open",function(){r.onopen(),t&&t()}),o=Hs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Hs(t,"ping",this.onping.bind(this)),Hs(t,"data",this.ondata.bind(this)),Hs(t,"error",this.onerror.bind(this)),Hs(t,"close",this.onclose.bind(this)),Hs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){XV(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new JV(this,t,n),this.nsps[t]=r),this._autoConnect&&r.connect(),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Yv={};function gS(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=p5e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=Yv[i]&&o in Yv[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new Ik(r,t):(Yv[i]||(Yv[i]=new Ik(r,t)),l=Yv[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(gS,{Manager:Ik,Socket:JV,io:gS,connect:gS});const E5e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],P5e=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],T5e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],M5e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],L5e=[{key:"2x",value:2},{key:"4x",value:4}],EE=0,PE=4294967295,A5e=["gfpgan","codeformer"],O5e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}];var R5e=Math.PI/180;function I5e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Rm=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},ft={_global:Rm,version:"8.4.2",isBrowser:I5e(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return ft.angleDeg?e*R5e:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return ft.DD.isDragging},isDragReady(){return!!ft.DD.node},releaseCanvasOnDestroy:!0,document:Rm.document,_injectGlobal(e){Rm.Konva=e}},Mr=e=>{ft[e.prototype.getClassName()]=e};ft._injectGlobal(ft);class Ca{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 Ca(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){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var d=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/d):-Math.acos(r/d)),l.scaleX=s/d,l.scaleY=d,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=de._getRotation(l.rotation),l}}var D5e="[object Array]",j5e="[object Number]",N5e="[object String]",$5e="[object Boolean]",F5e=Math.PI/180,B5e=180/Math.PI,WC="#",z5e="",H5e="0",W5e="Konva warning: ",tI="Konva error: ",V5e="rgb(",VC={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]},U5e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,ax=[];const G5e=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},de={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===D5e},_isNumber(e){return Object.prototype.toString.call(e)===j5e&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===N5e},_isBoolean(e){return Object.prototype.toString.call(e)===$5e},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){ax.push(e),ax.length===1&&G5e(function(){const t=ax;ax=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=de.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(WC,z5e);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=H5e+e;return WC+e},getRGB(e){var t;return e in VC?(t=VC[e],{r:t[0],g:t[1],b:t[2]}):e[0]===WC?this._hexToRgb(e.substring(1)):e.substr(0,4)===V5e?(t=U5e.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",de._namedColorToRBA(e)||de._hex3ColorToRGBA(e)||de._hex4ColorToRGBA(e)||de._hex6ColorToRGBA(e)||de._hex8ColorToRGBA(e)||de._rgbColorToRGBA(e)||de._rgbaColorToRGBA(e)||de._hslColorToRGBA(e)},_namedColorToRBA(e){var t=VC[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(e){if(e[0]==="#"&&e.length===9)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if(e[0]==="#"&&e.length===5)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const u=2*o-a,d=[0,0,0];for(let p=0;p<3;p++)s=r+1/3*-(p-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,d[p]=l*255;return{r:Math.round(d[0]),g:Math.round(d[1]),b:Math.round(d[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+d*(n-e),s=t+d*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=de.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=de._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],d=l[1],p=l[2];pt.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})},drawRoundedRectPath(e,t,n,r){let i=0,o=0,a=0,s=0;typeof r=="number"?i=o=a=s=Math.min(r,t/2,n/2):(i=Math.min(r[0]||0,t/2,n/2),o=Math.min(r[1]||0,t/2,n/2),s=Math.min(r[2]||0,t/2,n/2),a=Math.min(r[3]||0,t/2,n/2)),e.moveTo(i,0),e.lineTo(t-o,0),e.arc(t-o,o,o,Math.PI*3/2,0,!1),e.lineTo(t,n-s),e.arc(t-s,n-s,s,0,Math.PI/2,!1),e.lineTo(a,n),e.arc(a,n-a,a,Math.PI/2,Math.PI,!1),e.lineTo(0,i),e.arc(i,i,i,Math.PI,Math.PI*3/2,!1)}};function uf(e){return de._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||de._isBoolean(e)?e:Object.prototype.toString.call(e)}function eU(e){return e>255?255:e<0?0:Math.round(e)}function We(){if(ft.isUnminified)return function(e,t){return de._isNumber(e)||de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function TE(e){if(ft.isUnminified)return function(t,n){let r=de._isNumber(t),i=de._isArray(t)&&t.length==e;return!r&&!i&&de.warn(uf(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function ME(){if(ft.isUnminified)return function(e,t){var n=de._isNumber(e),r=e==="auto";return n||r||de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function b0(){if(ft.isUnminified)return function(e,t){return de._isString(e)||de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function tU(){if(ft.isUnminified)return function(e,t){const n=de._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function q5e(){if(ft.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(de._isArray(e)?e.forEach(function(r){de._isNumber(r)||de.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function el(){if(ft.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function K5e(e){if(ft.isUnminified)return function(t,n){return t==null||de.isObject(t)||de.warn(uf(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var Xv="get",Zv="set";const J={addGetterSetter(e,t,n,r,i){J.addGetter(e,t,n),J.addSetter(e,t,r,i),J.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=Xv+de._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=Zv+de._capitalize(t);e.prototype[i]||J.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=Zv+de._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=de._capitalize,s=Xv+a(t),l=Zv+a(t),u,d;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(w),void 0)}),this._fireChangeEvent(t,y,m),i&&i.call(this),this},J.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=de._capitalize(t),r=Zv+n,i=Xv+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){de.error("Adding deprecated "+t);var i=Xv+de._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){de.error(o);var a=this.attrs[t];return a===void 0?n:a},J.addSetter(e,t,r,function(){de.error(o)}),J.addOverloadedGetterSetter(e,t)},backCompat(e,t){de.each(t,function(n,r){var i=e.prototype[r],o=Xv+de._capitalize(n),a=Zv+de._capitalize(n);function s(){i.apply(this,arguments),de.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function Y5e(e){var t=[],n=e.length,r=de,i,o;for(i=0;itypeof d=="number"?Math.floor(d):d)),o+=X5e+u.join(nI)+Z5e)):(o+=s.property,t||(o+=nCe+s.val)),o+=eCe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=iCe&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var d=arguments,p=this._context;d.length===3?p.drawImage(t,n,r):d.length===5?p.drawImage(t,n,r,i,o):d.length===9&&p.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n,r,i){return r?this._context.isPointInPath(r,t,n,i):this._context.isPointInPath(t,n,i)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}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,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=rI.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=Y5e(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return fn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];fn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=de._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.id===n.pointerId);if(a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];fn._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(fn.justDragged=!0,ft._mouseListenClick=!1,ft._touchListenClick=!1,ft._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof ft.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){fn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&fn._dragElements.delete(n)})}};ft.isBrowser&&(window.addEventListener("mouseup",fn._endDragBefore,!0),window.addEventListener("touchend",fn._endDragBefore,!0),window.addEventListener("mousemove",fn._drag),window.addEventListener("touchmove",fn._drag),window.addEventListener("mouseup",fn._endDragAfter,!1),window.addEventListener("touchend",fn._endDragAfter,!1));var mS="absoluteOpacity",lx="allEventListeners",Iu="absoluteTransform",iI="absoluteScale",oh="canvas",lCe="Change",uCe="children",cCe="konva",Dk="listening",oI="mouseenter",aI="mouseleave",sI="set",lI="Shape",vS=" ",uI="stage",fd="transform",dCe="Stage",jk="visible",fCe=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(vS);let hCe=1,Ve=class Nk{constructor(t){this._id=hCe++,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===fd||t===Iu)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===fd||t===Iu,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(vS);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(oh)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Iu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(oh)){const{scene:t,filter:n,hit:r}=this._cache.get(oh);de.releaseCanvas(t,n,r),this._cache.delete(oh)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,p=n.hitCanvasPixelRatio||1;if(!i||!o){de.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new Im({pixelRatio:a,width:i,height:o}),y=new Im({pixelRatio:a,width:0,height:0}),b=new LE({pixelRatio:p,width:i,height:o}),w=m.getContext(),E=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(oh),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),w.save(),E.save(),w.translate(-s,-l),E.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(mS),this._clearSelfAndDescendantCache(iI),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,w.restore(),E.restore(),d&&(w.save(),w.beginPath(),w.rect(0,0,i,o),w.closePath(),w.setAttr("strokeStyle","red"),w.setAttr("lineWidth",5),w.stroke(),w.restore()),this._cache.set(oh,{scene:m,filter:y,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(oh)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{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}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=l.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==uCe&&(r=sI+de._capitalize(n),de._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(Dk,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(jk,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;fn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!ft.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==dCe&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(fd),this._clearSelfAndDescendantCache(Iu)),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(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new Ca,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(fd);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(fd),this._clearSelfAndDescendantCache(Iu),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var 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){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return de.warn("Node has no parent. moveToBottom function is ignored."),!1;var 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 de.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&de.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)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(mS,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=de.isObject(i)&&!de._isPlainObject(i)&&!de._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),de._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i{try{const i=t==null?void 0:t.callback;i&&delete t.callback,de._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}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():ft.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(r&&!this.isDragging()){var i=!1;fn._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=fn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&fn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return de.haveIntersection(r,this.getClientRect())}static create(t,n){return de._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=Nk.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),ft[r]||(de.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=ft[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}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(var n=0;n0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=Ve.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=Ve.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const d=r===this;if(u){o.save();var p=this.getAbsoluteTransform(r),m=p.getMatrix();if(o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath(),l)l.call(this,o,this);else{var y=this.clipX(),b=this.clipY();o.rect(y,b,a,s)}o.clip(),m=p.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var w=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";w&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(E){E[t](n,r)}),w&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(w){if(w.visible()){var E=w.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});E.width===0&&E.height===0||(o===void 0?(o=E.x,a=E.y,s=E.x+E.width,l=E.y+E.height):(o=Math.min(o,E.x),a=Math.min(a,E.y),s=Math.max(s,E.x+E.width),l=Math.max(l,E.y+E.height)))}});for(var p=this.find("Shape"),m=!1,y=0;ye.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",Og=e=>{const t=b1(e);if(t==="pointer")return ft.pointerEventsEnabled&&GC.pointer;if(t==="touch")return GC.touch;if(t==="mouse")return GC.mouse};function dI(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&de.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const xCe="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);",yS=[];let f4=class extends Ta{constructor(t){super(dI(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),yS.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{dI(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||de.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===gCe){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}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(){var t=this.children,n=t.length,r;for(r=0;r-1&&yS.splice(n,1),de.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}:(de.warn(xCe),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.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();var n=new Im({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+cI,this.content.style.height=n+cI),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;ryCe&&de.warn("The stage has "+i+" 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(),ft.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return rU(t,this)}setPointerCapture(t){iU(t,this)}releaseCapture(t){G1(t)}getLayers(){return this.children}_bindContentEvents(){ft.isBrowser&&bCe.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=Og(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=Og(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=Og(t.type),r=b1(t.type);if(n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!fn.isDragging||ft.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=Og(t.type),r=b1(t.type);if(n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(fn.justDragged=!1,ft["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;ft.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=Og(t.type),r=b1(t.type);if(!n)return;fn.isDragging&&fn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!fn.isDragging||ft.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=UC(l.id)||this.getIntersection(l),d=l.id,p={evt:t,pointerId:d};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},p),u),s._fireAndBubble(n.pointerleave,Object.assign({},p),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},p),s),u._fireAndBubble(n.pointerenter,Object.assign({},p),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},p))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:d}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=Og(t.type),r=b1(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=UC(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const d=l.id,p={evt:t,pointerId:d};let m=!1;ft["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):fn.justDragged||(ft["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){ft["_"+r+"InDblClickWindow"]=!1},ft.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},p)),ft["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},p)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},p)))):(this[r+"ClickEndShape"]=null,ft["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:d}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:d}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),ft["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble($k,{evt:t}):this._fire($k,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Fk,{evt:t}):this._fire(Fk,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=UC(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(lm,AE(t)),G1(t.pointerId)}_lostpointercapture(t){G1(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}])}_setPointerPosition(t){de.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};var 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 Im({width:this.width(),height:this.height()}),this.bufferHitCanvas=new LE({pixelRatio:1,width:this.width(),height:this.height()}),!!ft.isBrowser){var 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 de.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}};f4.prototype.nodeType=pCe;Mr(f4);J.addGetterSetter(f4,"container");var gU="hasShadow",mU="shadowRGBA",vU="patternImage",yU="linearGradient",bU="radialGradient";let hx;function qC(){return hx||(hx=de.createCanvasElement().getContext("2d"),hx)}const q1={};function SCe(e){e.fill()}function wCe(e){e.stroke()}function CCe(e){e.fill()}function _Ce(e){e.stroke()}function kCe(){this._clearCache(gU)}function ECe(){this._clearCache(mU)}function PCe(){this._clearCache(vU)}function TCe(){this._clearCache(yU)}function MCe(){this._clearCache(bU)}class Fe extends Ve{constructor(t){super(t);let n;for(;n=de.getRandomColor(),!(n&&!(n in q1)););this.colorKey=n,q1[n]=this}getContext(){return de.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return de.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(gU,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(vU,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=qC();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new Ca;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(ft.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(yU,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=qC(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.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){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return Ve.prototype.destroy.call(this),delete q1[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){de.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var 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={}){const n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,u=!t.skipShadow&&this.hasShadow(),d=u?this.shadowOffsetX():0,p=u?this.shadowOffsetY():0,m=s+Math.abs(d),y=l+Math.abs(p),b=u&&this.shadowBlur()||0,w=m+b*2,E=y+b*2,_={width:w,height:E,x:-(a/2+b)+Math.min(d,0)+i.x,y:-(a/2+b)+Math.min(p,0)+i.y};return n?_:this._transformedRect(_,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,d,p,m=i.isCache,y=n===this;if(!this.isVisible()&&!y)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),d=u.bufferCanvas,p=d.getContext(),p.clear(),p.save(),p._applyLineJoin(this);var w=this.getAbsoluteTransform(n).getMatrix();p.transform(w[0],w[1],w[2],w[3],w[4],w[5]),s.call(this,p,this),p.restore();var E=d.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(d._canvas,0,0,d.width/E,d.height/E)}else{if(o._applyLineJoin(this),!y){var w=this.getAbsoluteTransform(n).getMatrix();o.transform(w[0],w[1],w[2],w[3],w[4],w[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||de.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()"),u){a.save();var d=this.getAbsoluteTransform(n).getMatrix();return a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var m=this.getAbsoluteTransform(n).getMatrix();a.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,u,d,p,m,y;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,d=u.length,p=de._hexToRgb(this.colorKey),m=0;mt?(u[m]=p.r,u[m+1]=p.g,u[m+2]=p.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){de.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return rU(t,this)}setPointerCapture(t){iU(t,this)}releaseCapture(t){G1(t)}}Fe.prototype._fillFunc=SCe;Fe.prototype._strokeFunc=wCe;Fe.prototype._fillFuncHit=CCe;Fe.prototype._strokeFuncHit=_Ce;Fe.prototype._centroid=!1;Fe.prototype.nodeType="Shape";Mr(Fe);Fe.prototype.eventListeners={};Fe.prototype.on.call(Fe.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",kCe);Fe.prototype.on.call(Fe.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",ECe);Fe.prototype.on.call(Fe.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",PCe);Fe.prototype.on.call(Fe.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",TCe);Fe.prototype.on.call(Fe.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",MCe);J.addGetterSetter(Fe,"stroke",void 0,tU());J.addGetterSetter(Fe,"strokeWidth",2,We());J.addGetterSetter(Fe,"fillAfterStrokeEnabled",!1);J.addGetterSetter(Fe,"hitStrokeWidth","auto",ME());J.addGetterSetter(Fe,"strokeHitEnabled",!0,el());J.addGetterSetter(Fe,"perfectDrawEnabled",!0,el());J.addGetterSetter(Fe,"shadowForStrokeEnabled",!0,el());J.addGetterSetter(Fe,"lineJoin");J.addGetterSetter(Fe,"lineCap");J.addGetterSetter(Fe,"sceneFunc");J.addGetterSetter(Fe,"hitFunc");J.addGetterSetter(Fe,"dash");J.addGetterSetter(Fe,"dashOffset",0,We());J.addGetterSetter(Fe,"shadowColor",void 0,b0());J.addGetterSetter(Fe,"shadowBlur",0,We());J.addGetterSetter(Fe,"shadowOpacity",1,We());J.addComponentsGetterSetter(Fe,"shadowOffset",["x","y"]);J.addGetterSetter(Fe,"shadowOffsetX",0,We());J.addGetterSetter(Fe,"shadowOffsetY",0,We());J.addGetterSetter(Fe,"fillPatternImage");J.addGetterSetter(Fe,"fill",void 0,tU());J.addGetterSetter(Fe,"fillPatternX",0,We());J.addGetterSetter(Fe,"fillPatternY",0,We());J.addGetterSetter(Fe,"fillLinearGradientColorStops");J.addGetterSetter(Fe,"strokeLinearGradientColorStops");J.addGetterSetter(Fe,"fillRadialGradientStartRadius",0);J.addGetterSetter(Fe,"fillRadialGradientEndRadius",0);J.addGetterSetter(Fe,"fillRadialGradientColorStops");J.addGetterSetter(Fe,"fillPatternRepeat","repeat");J.addGetterSetter(Fe,"fillEnabled",!0);J.addGetterSetter(Fe,"strokeEnabled",!0);J.addGetterSetter(Fe,"shadowEnabled",!0);J.addGetterSetter(Fe,"dashEnabled",!0);J.addGetterSetter(Fe,"strokeScaleEnabled",!0);J.addGetterSetter(Fe,"fillPriority","color");J.addComponentsGetterSetter(Fe,"fillPatternOffset",["x","y"]);J.addGetterSetter(Fe,"fillPatternOffsetX",0,We());J.addGetterSetter(Fe,"fillPatternOffsetY",0,We());J.addComponentsGetterSetter(Fe,"fillPatternScale",["x","y"]);J.addGetterSetter(Fe,"fillPatternScaleX",1,We());J.addGetterSetter(Fe,"fillPatternScaleY",1,We());J.addComponentsGetterSetter(Fe,"fillLinearGradientStartPoint",["x","y"]);J.addComponentsGetterSetter(Fe,"strokeLinearGradientStartPoint",["x","y"]);J.addGetterSetter(Fe,"fillLinearGradientStartPointX",0);J.addGetterSetter(Fe,"strokeLinearGradientStartPointX",0);J.addGetterSetter(Fe,"fillLinearGradientStartPointY",0);J.addGetterSetter(Fe,"strokeLinearGradientStartPointY",0);J.addComponentsGetterSetter(Fe,"fillLinearGradientEndPoint",["x","y"]);J.addComponentsGetterSetter(Fe,"strokeLinearGradientEndPoint",["x","y"]);J.addGetterSetter(Fe,"fillLinearGradientEndPointX",0);J.addGetterSetter(Fe,"strokeLinearGradientEndPointX",0);J.addGetterSetter(Fe,"fillLinearGradientEndPointY",0);J.addGetterSetter(Fe,"strokeLinearGradientEndPointY",0);J.addComponentsGetterSetter(Fe,"fillRadialGradientStartPoint",["x","y"]);J.addGetterSetter(Fe,"fillRadialGradientStartPointX",0);J.addGetterSetter(Fe,"fillRadialGradientStartPointY",0);J.addComponentsGetterSetter(Fe,"fillRadialGradientEndPoint",["x","y"]);J.addGetterSetter(Fe,"fillRadialGradientEndPointX",0);J.addGetterSetter(Fe,"fillRadialGradientEndPointY",0);J.addGetterSetter(Fe,"fillPatternRotation",0);J.backCompat(Fe,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var LCe="#",ACe="beforeDraw",OCe="draw",xU=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],RCe=xU.length;let sp=class extends Ta{constructor(t){super(t),this.canvas=new Im,this.hitCanvas=new LE({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);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(ACe,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Ta.prototype.drawScene.call(this,i,n),this._fire(OCe,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Ta.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return de.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};sp.prototype.nodeType="Layer";Mr(sp);J.addGetterSetter(sp,"imageSmoothingEnabled",!0);J.addGetterSetter(sp,"clearBeforeDraw",!0);J.addGetterSetter(sp,"hitGraphEnabled",!0,el());class OE extends sp{constructor(t){super(t),this.listening(!1),de.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}OE.prototype.nodeType="FastLayer";Mr(OE);let Qm=class extends Ta{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&de.throw("You may only add groups and shapes to groups.")}};Qm.prototype.nodeType="Group";Mr(Qm);var KC=function(){return Rm.performance&&Rm.performance.now?function(){return Rm.performance.now()}:function(){return new Date().getTime()}}();class Qa{constructor(t,n){this.id=Qa.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:KC(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;ithis.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=fI,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=hI,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(){var t=this.getTimer()-this._startTime;this.state===fI?this.setTime(t):this.state===hI&&this.setTime(this.duration-t)}pause(){this.state=DCe,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Xr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||K1.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=jCe++;var u=r.getLayer()||(r instanceof ft.Stage?r.getLayers():null);u||de.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Qa(function(){n.tween.onEnterFrame()},u),this.tween=new NCe(l,function(d){n._tweenFunc(d)},a,0,1,o*1e3,s),this._addListeners(),Xr.attrs[i]||(Xr.attrs[i]={}),Xr.attrs[i][this._id]||(Xr.attrs[i][this._id]={}),Xr.tweens[i]||(Xr.tweens[i]={});for(l in t)ICe[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,u,d,p,m;if(s=Xr.tweens[i][t],s&&delete Xr.attrs[i][s][t],o=r.getAttr(t),de._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(p=o,o=de._prepareArrayForTween(o,n,r.closed())):(d=n,n=de._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.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(){var t=this.node._id,n=this._id,r=Xr.tweens[t],i;this.pause();for(i in r)delete Xr.tweens[t][i];delete Xr.attrs[t][n]}}Xr.attrs={};Xr.tweens={};Ve.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Xr(e);n.play()};const K1={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),d=a*n,p=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:p,width:d-u,height:m-p}}}hc.prototype._centroid=!0;hc.prototype.className="Arc";hc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Mr(hc);J.addGetterSetter(hc,"innerRadius",0,We());J.addGetterSetter(hc,"outerRadius",0,We());J.addGetterSetter(hc,"angle",0,We());J.addGetterSetter(hc,"clockwise",!1,el());function Bk(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),d=a*l/(s+l),p=n-u*(i-e),m=r-u*(o-t),y=n+d*(i-e),b=r+d*(o-t);return[p,m,y,b]}function gI(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);ud?u:d,E=u>d?1:u/d,_=u>d?d/u:1;t.translate(s,l),t.rotate(y),t.scale(E,_),t.arc(0,0,w,p,p+m,1-b),t.scale(1/E,1/_),t.rotate(-y),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var d=u.points[4],p=u.points[5],m=u.points[4]+p,y=Math.PI/180;if(Math.abs(d-m)m;b-=y){const w=Fn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(w.x,w.y)}else for(let b=d+y;bthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return Fn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return Fn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return Fn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],d=a[3],p=a[4],m=a[5],y=a[6];return p+=m*t/o.pathLength,Fn.getPointOnEllipticalArc(s,l,u,d,p,y)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var k=null,T=[],L=l,O=u,D,I,N,V,B,K,ne,z,$,H;switch(y){case"l":l+=b.shift(),u+=b.shift(),k="L",T.push(l,u);break;case"L":l=b.shift(),u=b.shift(),T.push(l,u);break;case"m":var Y=b.shift(),Q=b.shift();if(l+=Y,u+=Q,k="M",a.length>2&&a[a.length-1].command==="z"){for(var q=a.length-2;q>=0;q--)if(a[q].command==="M"){l=a[q].points[0]+Y,u=a[q].points[1]+Q;break}}T.push(l,u),y="l";break;case"M":l=b.shift(),u=b.shift(),k="M",T.push(l,u),y="L";break;case"h":l+=b.shift(),k="L",T.push(l,u);break;case"H":l=b.shift(),k="L",T.push(l,u);break;case"v":u+=b.shift(),k="L",T.push(l,u);break;case"V":u=b.shift(),k="L",T.push(l,u);break;case"C":T.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"c":T.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="C",T.push(l,u);break;case"S":I=l,N=u,D=a[a.length-1],D.command==="C"&&(I=l+(l-D.points[2]),N=u+(u-D.points[3])),T.push(I,N,b.shift(),b.shift()),l=b.shift(),u=b.shift(),k="C",T.push(l,u);break;case"s":I=l,N=u,D=a[a.length-1],D.command==="C"&&(I=l+(l-D.points[2]),N=u+(u-D.points[3])),T.push(I,N,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="C",T.push(l,u);break;case"Q":T.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"q":T.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="Q",T.push(l,u);break;case"T":I=l,N=u,D=a[a.length-1],D.command==="Q"&&(I=l+(l-D.points[0]),N=u+(u-D.points[1])),l=b.shift(),u=b.shift(),k="Q",T.push(I,N,l,u);break;case"t":I=l,N=u,D=a[a.length-1],D.command==="Q"&&(I=l+(l-D.points[0]),N=u+(u-D.points[1])),l+=b.shift(),u+=b.shift(),k="Q",T.push(I,N,l,u);break;case"A":V=b.shift(),B=b.shift(),K=b.shift(),ne=b.shift(),z=b.shift(),$=l,H=u,l=b.shift(),u=b.shift(),k="A",T=this.convertEndpointToCenterParameterization($,H,l,u,ne,z,V,B,K);break;case"a":V=b.shift(),B=b.shift(),K=b.shift(),ne=b.shift(),z=b.shift(),$=l,H=u,l+=b.shift(),u+=b.shift(),k="A",T=this.convertEndpointToCenterParameterization($,H,l,u,ne,z,V,B,K);break}a.push({command:k||y,points:T,start:{x:L,y:O},pathLength:this.calcLength(L,O,k||y,T)})}(y==="z"||y==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=Fn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var d=i[4],p=i[5],m=i[4]+p,y=Math.PI/180;if(Math.abs(d-m)m;l-=y)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=d+y;l1&&(s*=Math.sqrt(y),l*=Math.sqrt(y));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(p*p))/(s*s*(m*m)+l*l*(p*p)));o===a&&(b*=-1),isNaN(b)&&(b=0);var w=b*s*m/l,E=b*-l*p/s,_=(t+r)/2+Math.cos(d)*w-Math.sin(d)*E,k=(n+i)/2+Math.sin(d)*w+Math.cos(d)*E,T=function(B){return Math.sqrt(B[0]*B[0]+B[1]*B[1])},L=function(B,K){return(B[0]*K[0]+B[1]*K[1])/(T(B)*T(K))},O=function(B,K){return(B[0]*K[1]=1&&(V=0),a===0&&V>0&&(V=V-2*Math.PI),a===1&&V<0&&(V=V+2*Math.PI),[_,k,s,l,D,V,d,a]}}Fn.prototype.className="Path";Fn.prototype._attrsAffectingSize=["data"];Mr(Fn);J.addGetterSetter(Fn,"data");class lp extends pc{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],y=Fn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=Fn.getPointOnQuadraticBezier(Math.min(1,1-a/y),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var d=(Math.atan2(u,l)+n)%n,p=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(d),t.moveTo(0,0),t.lineTo(-a,p/2),t.lineTo(-a,-p/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,p/2),t.lineTo(-a,-p/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}lp.prototype.className="Arrow";Mr(lp);J.addGetterSetter(lp,"pointerLength",10,We());J.addGetterSetter(lp,"pointerWidth",10,We());J.addGetterSetter(lp,"pointerAtBeginning",!1);J.addGetterSetter(lp,"pointerAtEnding",!0);let x0=class extends Fe{_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)}};x0.prototype._centroid=!0;x0.prototype.className="Circle";x0.prototype._attrsAffectingSize=["radius"];Mr(x0);J.addGetterSetter(x0,"radius",0,We());class cf extends Fe{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,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)}}cf.prototype.className="Ellipse";cf.prototype._centroid=!0;cf.prototype._attrsAffectingSize=["radiusX","radiusY"];Mr(cf);J.addComponentsGetterSetter(cf,"radius",["x","y"]);J.addGetterSetter(cf,"radiusX",0,We());J.addGetterSetter(cf,"radiusY",0,We());let uu=class SU extends Fe{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let a;if(o){const s=this.attrs.cropWidth,l=this.attrs.cropHeight;s&&l?a=[o,this.cropX(),this.cropY(),s,l,0,0,n,r]:a=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?de.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),o&&(i&&t.clip(),t.drawImage.apply(t,a))}_hitFunc(t){var n=this.width(),r=this.height(),i=this.cornerRadius();t.beginPath(),i?de.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=de.createImageElement();i.onload=function(){var o=new SU({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};uu.prototype.className="Image";Mr(uu);J.addGetterSetter(uu,"cornerRadius",0,TE(4));J.addGetterSetter(uu,"image");J.addComponentsGetterSetter(uu,"crop",["x","y","width","height"]);J.addGetterSetter(uu,"cropX",0,We());J.addGetterSetter(uu,"cropY",0,We());J.addGetterSetter(uu,"cropWidth",0,We());J.addGetterSetter(uu,"cropHeight",0,We());var wU=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],$Ce="Change.konva",FCe="none",zk="up",Hk="right",Wk="down",Vk="left",BCe=wU.length;class RE extends Qm{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}cp.prototype.className="RegularPolygon";cp.prototype._centroid=!0;cp.prototype._attrsAffectingSize=["radius"];Mr(cp);J.addGetterSetter(cp,"radius",0,We());J.addGetterSetter(cp,"sides",0,We());var mI=Math.PI*2;class dp extends Fe{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,mI,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),mI,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)}}dp.prototype.className="Ring";dp.prototype._centroid=!0;dp.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Mr(dp);J.addGetterSetter(dp,"innerRadius",0,We());J.addGetterSetter(dp,"outerRadius",0,We());class cu extends Fe{constructor(t){super(t),this._updated=!0,this.anim=new Qa(()=>{var n=this._updated;return this._updated=!1,n}),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){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],d=o[i+3],p=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,d),t.closePath(),t.fillStrokeShape(this)),p)if(a){var m=a[n],y=r*2;t.drawImage(p,s,l,u,d,m[y+0],m[y+1],u,d)}else t.drawImage(p,s,l,u,d,0,0,u,d)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],d=r*2;t.rect(u[d+0],u[d+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var 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(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var gx;function XC(){return gx||(gx=de.createCanvasElement().getContext(WCe),gx)}function e6e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function t6e(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function n6e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class Tr extends Fe{constructor(t){super(n6e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(_+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=de._isString(t)?t:t==null?"":t+"";return this._setAttr(VCe,n),this}getWidth(){var t=this.attrs.width===Rg||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Rg||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return de.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=XC(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+px+this.fontVariant()+px+(this.fontSize()+KCe)+JCe(this.fontFamily())}_addTextLine(t){this.align()===Qv&&(t=t.trim());var r=this._getTextWidth(t);return this.textArr.push({text:t,width:r,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return XC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` -`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Rg&&o!==void 0,l=a!==Rg&&a!==void 0,u=this.padding(),d=o-u*2,p=a-u*2,m=0,y=this.wrap(),b=y!==bI,w=y!==ZCe&&b,E=this.ellipsis();this.textArr=[],XC().font=this._getContextFont();for(var _=E?this._getTextWidth(YC):0,k=0,T=t.length;kd)for(;L.length>0;){for(var D=0,I=L.length,N="",V=0;D>>1,K=L.slice(0,B+1),ne=this._getTextWidth(K)+_;ne<=d?(D=B+1,N=K,V=ne):I=B}if(N){if(w){var z,$=L[N.length],H=$===px||$===vI;H&&V<=d?z=N.length:z=Math.max(N.lastIndexOf(px),N.lastIndexOf(vI))+1,z>0&&(D=z,N=N.slice(0,D),V=this._getTextWidth(N))}N=N.trimRight(),this._addTextLine(N),r=Math.max(r,V),m+=i;var Y=this._shouldHandleEllipsis(m);if(Y){this._tryToAddEllipsisToLastLine();break}if(L=L.slice(D),L=L.trimLeft(),L.length>0&&(O=this._getTextWidth(L),O<=d)){this._addTextLine(L),m+=i,r=Math.max(r,O);break}}else break}else this._addTextLine(L),m+=i,r=Math.max(r,O),this._shouldHandleEllipsis(m)&&kp)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Rg&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==bI;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Rg&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+YC)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var d=CU(this.text()),p=this.text().split(" ").length-1,m,y,b,w=-1,E=0,_=function(){E=0;for(var ne=t.dataArray,z=w+1;z0)return w=z,ne[z];ne[z].command==="M"&&(m={x:ne[z].points[0],y:ne[z].points[1]})}return{}},k=function(ne){var z=t._getTextSize(ne).width+r;ne===" "&&i==="justify"&&(z+=(s-a)/p);var $=0,H=0;for(y=void 0;Math.abs(z-$)/z>.01&&H<20;){H++;for(var Y=$;b===void 0;)b=_(),b&&Y+b.pathLengthz?y=Fn.getPointOnLine(z,m.x,m.y,b.points[0],b.points[1],m.x,m.y):b=void 0;break;case"A":var q=b.points[4],X=b.points[5],ee=b.points[4]+X;E===0?E=q+1e-8:z>$?E+=Math.PI/180*X/Math.abs(X):E-=Math.PI/360*X/Math.abs(X),(X<0&&E=0&&E>ee)&&(E=ee,Q=!0),y=Fn.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],E,b.points[6]);break;case"C":E===0?z>b.pathLength?E=1e-8:E=z/b.pathLength:z>$?E+=(z-$)/b.pathLength/2:E=Math.max(E-($-z)/b.pathLength/2,0),E>1&&(E=1,Q=!0),y=Fn.getPointOnCubicBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case"Q":E===0?E=z/b.pathLength:z>$?E+=(z-$)/b.pathLength:E-=($-z)/b.pathLength,E>1&&(E=1,Q=!0),y=Fn.getPointOnQuadraticBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}y!==void 0&&($=Fn.getLineLength(m.x,m.y,y.x,y.y)),Q&&(Q=!1,b=void 0)}},T="C",L=t._getTextSize(T).width+r,O=u/L-1,D=0;De+`.${LU}`).join(" "),xI="nodesRect",o6e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],a6e={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const s6e="ontouchstart"in ft._global;function l6e(e,t){if(e==="rotater")return"crosshair";t+=de.degToRad(a6e[e]||0);var n=(de.radToDeg(t)%360+360)%360;return de._inRange(n,315+22.5,360)||de._inRange(n,0,22.5)?"ns-resize":de._inRange(n,45-22.5,45+22.5)?"nesw-resize":de._inRange(n,90-22.5,90+22.5)?"ew-resize":de._inRange(n,135-22.5,135+22.5)?"nwse-resize":de._inRange(n,180-22.5,180+22.5)?"ns-resize":de._inRange(n,225-22.5,225+22.5)?"nesw-resize":de._inRange(n,270-22.5,270+22.5)?"ew-resize":de._inRange(n,315-22.5,315+22.5)?"nwse-resize":(de.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var A3=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],SI=1e8;function u6e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function AU(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function c6e(e,t){const n=u6e(e);return AU(e,t,n)}function d6e(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(o6e.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=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(xI),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(xI,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(ft.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),d={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return AU(d,-ft.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-SI,y:-SI,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const d=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var p=[{x:d.x,y:d.y},{x:d.x+d.width,y:d.y},{x:d.x+d.width,y:d.y+d.height},{x:d.x,y:d.y+d.height}],m=u.getAbsoluteTransform();p.forEach(function(y){var b=m.point(y);n.push(b)})});const r=new Ca;r.rotate(-ft.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var d=r.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:ft.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(),A3.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new v2({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:s6e?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=ft.getAngle(this.rotation()),o=l6e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new Fe({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*de._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),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;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const d=o.getAbsolutePosition();if(!(u.x===d.x&&u.y===d.y)){if(this._movingAnchorName==="rotater"){var p=this._getNodeRect();n=o.x()-p.width/2,r=-o.y()+p.height/2;let ne=Math.atan2(-r,n)+Math.PI/2;p.height<0&&(ne-=Math.PI);var m=ft.getAngle(this.rotation());const z=m+ne,$=ft.getAngle(this.rotationSnapTolerance()),Y=d6e(this.rotationSnaps(),z,$)-p.rotation,Q=c6e(p,Y);this._fitNodesInto(Q,t);return}var y=this.keepRatio()||t.shiftKey,k=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(y){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(b.y-o.y(),2));var w=this.findOne(".top-left").x()>b.x?-1:1,E=this.findOne(".top-left").y()>b.y?-1:1;n=i*this.cos*w,r=i*this.sin*E,this.findOne(".top-left").x(b.x-n),this.findOne(".top-left").y(b.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(y){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-b.x,2)+Math.pow(b.y-o.y(),2));var w=this.findOne(".top-right").x()b.y?-1:1;n=i*this.cos*w,r=i*this.sin*E,this.findOne(".top-right").x(b.x+n),this.findOne(".top-right").y(b.y-r)}var _=o.position();this.findOne(".top-left").y(_.y),this.findOne(".bottom-right").x(_.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(y){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(o.y()-b.y,2));var w=b.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(de._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(de._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new Ca;if(a.rotate(ft.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const p=a.point({x:-this.padding()*2,y:0});if(t.x+=p.x,t.y+=p.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const p=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const p=a.point({x:0,y:-this.padding()*2});if(t.x+=p.x,t.y+=p.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const p=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const p=this.boundBoxFunc()(r,t);p?t=p:de.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new Ca;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new Ca;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const d=u.multiply(l.invert());this._nodes.forEach(p=>{var m;const y=p.getParent().getAbsoluteTransform(),b=p.getTransform().copy();b.translate(p.offsetX(),p.offsetY());const w=new Ca;w.multiply(y.copy().invert()).multiply(d).multiply(y).multiply(b);const E=w.decompose();p.setAttrs(E),this._fire("transform",{evt:n,target:p}),p._fire("transform",{evt:n,target:p}),(m=p.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(de._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(de._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach(u=>{u.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*de._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Qm.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Ve.prototype.toObject.call(this)}clone(t){var n=Ve.prototype.clone.call(this,t);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};function f6e(e){return e instanceof Array||de.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){A3.indexOf(t)===-1&&de.warn("Unknown anchor name: "+t+". Available names are: "+A3.join(", "))}),e||[]}Tn.prototype.className="Transformer";Mr(Tn);J.addGetterSetter(Tn,"enabledAnchors",A3,f6e);J.addGetterSetter(Tn,"flipEnabled",!0,el());J.addGetterSetter(Tn,"resizeEnabled",!0);J.addGetterSetter(Tn,"anchorSize",10,We());J.addGetterSetter(Tn,"rotateEnabled",!0);J.addGetterSetter(Tn,"rotationSnaps",[]);J.addGetterSetter(Tn,"rotateAnchorOffset",50,We());J.addGetterSetter(Tn,"rotationSnapTolerance",5,We());J.addGetterSetter(Tn,"borderEnabled",!0);J.addGetterSetter(Tn,"anchorStroke","rgb(0, 161, 255)");J.addGetterSetter(Tn,"anchorStrokeWidth",1,We());J.addGetterSetter(Tn,"anchorFill","white");J.addGetterSetter(Tn,"anchorCornerRadius",0,We());J.addGetterSetter(Tn,"borderStroke","rgb(0, 161, 255)");J.addGetterSetter(Tn,"borderStrokeWidth",1,We());J.addGetterSetter(Tn,"borderDash");J.addGetterSetter(Tn,"keepRatio",!0);J.addGetterSetter(Tn,"centeredScaling",!1);J.addGetterSetter(Tn,"ignoreStroke",!1);J.addGetterSetter(Tn,"padding",0,We());J.addGetterSetter(Tn,"node");J.addGetterSetter(Tn,"nodes");J.addGetterSetter(Tn,"boundBoxFunc");J.addGetterSetter(Tn,"anchorDragBoundFunc");J.addGetterSetter(Tn,"shouldOverdrawWholeArea",!1);J.addGetterSetter(Tn,"useSingleNodeRotation",!0);J.backCompat(Tn,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class gc extends Fe{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,ft.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)}}gc.prototype.className="Wedge";gc.prototype._centroid=!0;gc.prototype._attrsAffectingSize=["radius"];Mr(gc);J.addGetterSetter(gc,"radius",0,We());J.addGetterSetter(gc,"angle",0,We());J.addGetterSetter(gc,"clockwise",!1);J.backCompat(gc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function wI(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var h6e=[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],p6e=[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 g6e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,d,p,m,y,b,w,E,_,k,T,L,O,D,I,N,V,B,K,ne,z=t+t+1,$=r-1,H=i-1,Y=t+1,Q=Y*(Y+1)/2,q=new wI,X=null,ee=q,fe=null,Ee=null,we=h6e[t],xe=p6e[t];for(s=1;s>xe,K!==0?(K=255/K,n[d]=(m*we>>xe)*K,n[d+1]=(y*we>>xe)*K,n[d+2]=(b*we>>xe)*K):n[d]=n[d+1]=n[d+2]=0,m-=E,y-=_,b-=k,w-=T,E-=fe.r,_-=fe.g,k-=fe.b,T-=fe.a,l=p+((l=o+t+1)<$?l:$)<<2,L+=fe.r=n[l],O+=fe.g=n[l+1],D+=fe.b=n[l+2],I+=fe.a=n[l+3],m+=L,y+=O,b+=D,w+=I,fe=fe.next,E+=N=Ee.r,_+=V=Ee.g,k+=B=Ee.b,T+=K=Ee.a,L-=N,O-=V,D-=B,I-=K,Ee=Ee.next,d+=4;p+=r}for(o=0;o>xe,K>0?(K=255/K,n[l]=(m*we>>xe)*K,n[l+1]=(y*we>>xe)*K,n[l+2]=(b*we>>xe)*K):n[l]=n[l+1]=n[l+2]=0,m-=E,y-=_,b-=k,w-=T,E-=fe.r,_-=fe.g,k-=fe.b,T-=fe.a,l=o+((l=a+Y)0&&g6e(t,n)};J.addGetterSetter(Ve,"blurRadius",0,We(),J.afterSetFilter);const v6e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};J.addGetterSetter(Ve,"contrast",0,We(),J.afterSetFilter);const b6e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,d=l*4,p=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:de.error("Unknown emboss direction: "+r)}do{var m=(p-1)*d,y=o;p+y<1&&(y=0),p+y>u&&(y=0);var b=(p-1+y)*l*4,w=l;do{var E=m+(w-1)*4,_=a;w+_<1&&(_=0),w+_>l&&(_=0);var k=b+(w-1+_)*4,T=s[E]-s[k],L=s[E+1]-s[k+1],O=s[E+2]-s[k+2],D=T,I=D>0?D:-D,N=L>0?L:-L,V=O>0?O:-O;if(N>I&&(D=L),V>I&&(D=O),D*=t,i){var B=s[E]+D,K=s[E+1]+D,ne=s[E+2]+D;s[E]=B>255?255:B<0?0:B,s[E+1]=K>255?255:K<0?0:K,s[E+2]=ne>255?255:ne<0?0:ne}else{var z=n-D;z<0?z=0:z>255&&(z=255),s[E]=s[E+1]=s[E+2]=z}}while(--w)}while(--p)};J.addGetterSetter(Ve,"embossStrength",.5,We(),J.afterSetFilter);J.addGetterSetter(Ve,"embossWhiteLevel",.5,We(),J.afterSetFilter);J.addGetterSetter(Ve,"embossDirection","top-left",null,J.afterSetFilter);J.addGetterSetter(Ve,"embossBlend",!1,null,J.afterSetFilter);function ZC(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const x6e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],d=u,p,m,y=this.enhance();if(y!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),p=t[m+2],pd&&(d=p);i===r&&(i=255,r=0),s===a&&(s=255,a=0),d===u&&(d=255,u=0);var b,w,E,_,k,T,L,O,D;for(y>0?(w=i+y*(255-i),E=r-y*(r-0),k=s+y*(255-s),T=a-y*(a-0),O=d+y*(255-d),D=u-y*(u-0)):(b=(i+r)*.5,w=i+y*(i-b),E=r+y*(r-b),_=(s+a)*.5,k=s+y*(s-_),T=a+y*(a-_),L=(d+u)*.5,O=d+y*(d-L),D=u+y*(u-L)),m=0;m_?E:_;var k=a,T=o,L,O,D=360/T*Math.PI/180,I,N;for(O=0;OT?k:T;var L=a,O=o,D,I,N=n.polarRotation||0,V,B;for(d=0;dt&&(L=T,O=0,D=-1),i=0;i=0&&y=0&&b=0&&y=0&&b=255*4?255:0}return a}function R6e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s=0&&y=0&&b=n))for(o=w;o=r||(a=(n*o+i)*4,s+=L[a+0],l+=L[a+1],u+=L[a+2],d+=L[a+3],T+=1);for(s=s/T,l=l/T,u=u/T,d=d/T,i=y;i=n))for(o=w;o=r||(a=(n*o+i)*4,L[a+0]=s,L[a+1]=l,L[a+2]=u,L[a+3]=d)}};J.addGetterSetter(Ve,"pixelSize",8,We(),J.afterSetFilter);const N6e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});J.addGetterSetter(Ve,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});J.addGetterSetter(Ve,"blue",0,eU,J.afterSetFilter);const F6e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s255?255:e<0?0:Math.round(e)});J.addGetterSetter(Ve,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});J.addGetterSetter(Ve,"blue",0,eU,J.afterSetFilter);J.addGetterSetter(Ve,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const B6e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),d>127&&(d=255-d),p>127&&(p=255-p),t[l]=u,t[l+1]=d,t[l+2]=p}while(--s)}while(--o)},H6e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new $g.Stage({container:i,width:n,height:r}),a=new $g.Layer,s=new $g.Layer;a.add(new $g.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new $g.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l};let OU=null,RU=null;const V6e=e=>{OU=e},Qs=()=>OU,U6e=e=>{RU=e},IU=()=>RU,G6e=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},DU=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),q6e=e=>{const t=Qs(),{generationMode:n,generationState:r,postprocessingState:i,canvasState:o,systemState:a}=e,{codeformerFidelity:s,facetoolStrength:l,facetoolType:u,hiresFix:d,hiresStrength:p,shouldRunESRGAN:m,shouldRunFacetool:y,upscalingLevel:b,upscalingStrength:w,upscalingDenoising:E}=i,{cfgScale:_,height:k,img2imgStrength:T,infillMethod:L,initialImage:O,iterations:D,perlin:I,prompt:N,negativePrompt:V,sampler:B,seamBlur:K,seamless:ne,seamSize:z,seamSteps:$,seamStrength:H,seed:Y,seedWeights:Q,shouldFitToWidthHeight:q,shouldGenerateVariations:X,shouldRandomizeSeed:ee,steps:fe,threshold:Ee,tileSize:we,variationAmount:xe,width:Ae,horizontalSymmetryTimePercentage:Se,verticalSymmetryTimePercentage:Qe}=r,{shouldDisplayInProgressType:Ye,saveIntermediatesInterval:nt,enableImageDebugging:vt}=a,Ce={prompt:N,iterations:D,steps:fe,cfg_scale:_,threshold:Ee,perlin:I,height:k,width:Ae,sampler_name:B,seed:Y,progress_images:Ye==="full-res",progress_latents:Ye==="latents",save_intermediates:nt,generation_mode:n,init_mask:"",h_symmetry_time_pct:Se,v_symmetry_time_pct:Qe};let et=!1,yt=!1;if(Ce.h_symmetry_time_pct=Math.max(0,Math.min(1,Se/fe)),Ce.v_symmetry_time_pct=Math.max(0,Math.min(1,Qe/fe)),V!==""&&(Ce.prompt=`${N} [${V}]`),Ce.seed=ee?DU(EE,PE):Y,n==="txt2img"&&(Ce.hires_fix=d,d&&(Ce.strength=p)),["txt2img","img2img"].includes(n)&&(Ce.seamless=ne,m&&(et={level:b,denoise_str:E,strength:w}),y&&(yt={type:u,strength:l},u==="codeformer"&&(yt.codeformer_fidelity=s))),n==="img2img"&&O&&(Ce.init_img=typeof O=="string"?O:O.url,Ce.strength=T,Ce.fit=q),n==="unifiedCanvas"&&t){const{layerState:{objects:ze},boundingBoxCoordinates:at,boundingBoxDimensions:jt,stageScale:gt,isMaskEnabled:Jt,shouldPreserveMaskedArea:on,boundingBoxScaleMethod:se,scaledBoundingBoxDimensions:Ie}=o,Ne={...at,...jt},Ue=W6e(Jt?ze.filter(gE):[],Ne);Ce.init_mask=Ue,Ce.fit=!1,Ce.strength=T,Ce.invert_mask=on,Ce.bounding_box=Ne;const be=t.scale();t.scale({x:1/gt,y:1/gt});const je=t.getAbsolutePosition(),bt=t.toDataURL({x:Ne.x+je.x,y:Ne.y+je.y,width:Ne.width,height:Ne.height});vt&&G6e([{base64:Ue,caption:"mask sent as init_mask"},{base64:bt,caption:"image sent as init_img"}]),t.scale(be),Ce.init_img=bt,Ce.progress_images=!1,se!=="none"&&(Ce.inpaint_width=Ie.width,Ce.inpaint_height=Ie.height),Ce.seam_size=z,Ce.seam_blur=K,Ce.seam_strength=H,Ce.seam_steps=$,Ce.tile_size=we,Ce.infill_method=L,Ce.force_outpaint=!1}return X?(Ce.variation_amount=xe,Q&&(Ce.with_variations=R3e(Q))):Ce.variation_amount=0,vt&&(Ce.enable_image_debugging=vt),{generationParameters:Ce,esrganParameters:et,facetoolParameters:yt}};var K6e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,Y6e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,X6e=/[^-+\dA-Z]/g;function Ti(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(CI[t]||t||CI.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},d=function(){return e[o()+"Hours"]()},p=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},y=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},w=function(){return Z6e(e)},E=function(){return Q6e(e)},_={d:function(){return a()},dd:function(){return xa(a())},ddd:function(){return zo.dayNames[s()]},DDD:function(){return _I({y:u(),m:l(),d:a(),_:o(),dayName:zo.dayNames[s()],short:!0})},dddd:function(){return zo.dayNames[s()+7]},DDDD:function(){return _I({y:u(),m:l(),d:a(),_:o(),dayName:zo.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return xa(l()+1)},mmm:function(){return zo.monthNames[l()]},mmmm:function(){return zo.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return xa(u(),4)},h:function(){return d()%12||12},hh:function(){return xa(d()%12||12)},H:function(){return d()},HH:function(){return xa(d())},M:function(){return p()},MM:function(){return xa(p())},s:function(){return m()},ss:function(){return xa(m())},l:function(){return xa(y(),3)},L:function(){return xa(Math.floor(y()/10))},t:function(){return d()<12?zo.timeNames[0]:zo.timeNames[1]},tt:function(){return d()<12?zo.timeNames[2]:zo.timeNames[3]},T:function(){return d()<12?zo.timeNames[4]:zo.timeNames[5]},TT:function(){return d()<12?zo.timeNames[6]:zo.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":J6e(e)},o:function(){return(b()>0?"-":"+")+xa(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+xa(Math.floor(Math.abs(b())/60),2)+":"+xa(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return w()},WW:function(){return xa(w())},N:function(){return E()}};return t.replace(K6e,function(k){return k in _?_[k]():k.slice(1,k.length-1)})}var CI={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},zo={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},xa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},_I=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,d=new Date;d.setDate(d[o+"Date"]()-1);var p=new Date;p.setDate(p[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},y=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},w=function(){return d[o+"Date"]()},E=function(){return d[o+"Month"]()},_=function(){return d[o+"FullYear"]()},k=function(){return p[o+"Date"]()},T=function(){return p[o+"Month"]()},L=function(){return p[o+"FullYear"]()};return b()===n&&y()===r&&m()===i?l?"Tdy":"Today":_()===n&&E()===r&&w()===i?l?"Ysd":"Yesterday":L()===n&&T()===r&&k()===i?l?"Tmw":"Tomorrow":a},Z6e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},Q6e=function(t){var n=t.getDay();return n===0&&(n=7),n},J6e=function(t){return(String(t).match(Y6e)||[""]).pop().replace(X6e,"").replace(/GMT\+0000/g,"UTC")};const e_e=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(wa(!0));const o=r(),{generation:a,postprocessing:s,system:l,canvas:u}=o,d={generationMode:i,generationState:a,postprocessingState:s,canvasState:u,systemState:l};n(_4e());const{generationParameters:p,esrganParameters:m,facetoolParameters:y}=q6e(d);t.emit("generateImage",p,m,y),p.init_mask&&(p.init_mask=p.init_mask.substr(0,64).concat("...")),p.init_img&&(p.init_img=p.init_img.substr(0,64).concat("...")),n(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...p,...m,...y})}`}))},emitRunESRGAN:i=>{n(wa(!0));const{postprocessing:{upscalingLevel:o,upscalingDenoising:a,upscalingStrength:s}}=r(),l={upscale:[o,a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(wa(!0));const{postprocessing:{facetoolType:o,facetoolStrength:a,codeformerFidelity:s}}=r(),l={facetool_strength:a};o==="codeformer"&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",i,{type:o,...l}),n(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Face restoration (${o}) requested: ${JSON.stringify({file:i.url,...l})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(eV(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:i=>{t.emit("searchForModels",i)},emitAddNewModel:i=>{t.emit("addNewModel",i)},emitDeleteModel:i=>{t.emit("deleteModel",i)},emitConvertToDiffusers:i=>{n(x4e()),t.emit("convertToDiffusers",i)},emitMergeDiffusersModels:i=>{n(S4e()),t.emit("mergeDiffusersModels",i)},emitRequestModelChange:i=>{n(b4e()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}};let vx;const t_e=new Uint8Array(16);function n_e(){if(!vx&&(vx=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vx))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vx(t_e)}const Hi=[];for(let e=0;e<256;++e)Hi.push((e+256).toString(16).slice(1));function r_e(e,t=0){return(Hi[e[t+0]]+Hi[e[t+1]]+Hi[e[t+2]]+Hi[e[t+3]]+"-"+Hi[e[t+4]]+Hi[e[t+5]]+"-"+Hi[e[t+6]]+Hi[e[t+7]]+"-"+Hi[e[t+8]]+Hi[e[t+9]]+"-"+Hi[e[t+10]]+Hi[e[t+11]]+Hi[e[t+12]]+Hi[e[t+13]]+Hi[e[t+14]]+Hi[e[t+15]]).toLowerCase()}const i_e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),kI={randomUUID:i_e};function um(e,t,n){if(kI.randomUUID&&!t&&!e)return kI.randomUUID();e=e||{};const r=e.random||(e.rng||n_e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return r_e(r)}const Uk=br("socketio/generateImage"),o_e=br("socketio/runESRGAN"),a_e=br("socketio/runFacetool"),s_e=br("socketio/deleteImage"),Gk=br("socketio/requestImages"),EI=br("socketio/requestNewImages"),l_e=br("socketio/cancelProcessing"),u_e=br("socketio/requestSystemConfig"),PI=br("socketio/searchForModels"),y2=br("socketio/addNewModel"),c_e=br("socketio/deleteModel"),d_e=br("socketio/convertToDiffusers"),f_e=br("socketio/mergeDiffusersModels"),jU=br("socketio/requestModelChange"),h_e=br("socketio/saveStagingAreaImageToGallery"),p_e=br("socketio/requestEmptyTempFolder"),g_e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(WR(!0)),t(hh(Et.t("common.statusConnected"))),t(u_e());const r=n().gallery;r.categories.result.latest_mtime?t(EI("result")):t(Gk("result")),r.categories.user.latest_mtime?t(EI("user")):t(Gk("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(WR(!1)),t(hh(Et.t("common.statusDisconnected"))),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{activeTab:o}=i.ui,{shouldLoopback:a}=i.postprocessing,{boundingBox:s,generationMode:l,...u}=r,d={uuid:um(),...u};if(["txt2img","img2img"].includes(l)&&t(sm({category:"result",image:{...d,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:p}=r;t(QSe({image:{...d,category:"temp"},boundingBox:p})),i.canvas.shouldAutoSave&&t(sm({image:{...d,category:"result"},category:"result"}))}if(a)switch(CE[o]){case"img2img":{t(v0(d));break}}t($C()),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(S3e({uuid:um(),...r,category:"result"})),r.isBase64||t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(sm({category:"result",image:{uuid:um(),...r,category:"result"}})),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(wa(!0)),t(g4e(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(VR()),t($C())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:um(),...l}));t(x3e({images:s,areMoreImagesAvailable:o,category:a})),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(y4e());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(sm({category:"result",image:r})),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t($C())),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(eV(r));const{generation:{initialImage:o,maskPath:a}}=n();(o===i||(o==null?void 0:o.url)===i)&&t(oV()),a===i&&t(lV("")),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(m4e(r)),r.infill_methods.includes("patchmatch")||t(sV(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(IV(i)),t(DV(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(Ag(o)),t(wa(!1)),t(hh(Et.t("modelManager.modelAdded"))),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t($u({title:a?`${Et.t("modelManager.modelUpdated")}: ${i}`:`${Et.t("modelManager.modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(Ag(o)),t(wa(!1)),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`${Et.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t($u({title:`${Et.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelConverted:r=>{const{converted_model_name:i,model_list:o}=r;t(Ag(o)),t(hh(Et.t("common.statusModelConverted"))),t(wa(!1)),t(_d(!0)),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Model converted: ${i}`,level:"info"})),t($u({title:`${Et.t("modelmanager:modelConverted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelsMerged:r=>{const{merged_models:i,merged_model_name:o,model_list:a}=r;t(Ag(a)),t(hh(Et.t("common.statusMergedModels"))),t(wa(!1)),t(_d(!0)),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Models merged: ${i}`,level:"info"})),t($u({title:`${Et.t("modelManager.modelsMerged")}: ${o}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(Ag(o)),t(hh(Et.t("common.statusModelChanged"))),t(wa(!1)),t(_d(!0)),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(Ag(o)),t(wa(!1)),t(_d(!0)),t(VR()),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t($u({title:Et.t("toast.tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},m_e=()=>{const{origin:e}=new URL(window.location.href),t=gS(e,{timeout:6e4,path:`${window.location.pathname}socket.io`});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:d,onGenerationResult:p,onIntermediateResult:m,onProgressUpdate:y,onGalleryImages:b,onProcessingCanceled:w,onImageDeleted:E,onSystemConfig:_,onModelChanged:k,onFoundModels:T,onNewModelAdded:L,onModelDeleted:O,onModelConverted:D,onModelsMerged:I,onModelChangeFailed:N,onTempFolderEmptied:V}=g_e(i),{emitGenerateImage:B,emitRunESRGAN:K,emitRunFacetool:ne,emitDeleteImage:z,emitRequestImages:$,emitRequestNewImages:H,emitCancelProcessing:Y,emitRequestSystemConfig:Q,emitSearchForModels:q,emitAddNewModel:X,emitDeleteModel:ee,emitConvertToDiffusers:fe,emitMergeDiffusersModels:Ee,emitRequestModelChange:we,emitSaveStagingAreaImageToGallery:xe,emitRequestEmptyTempFolder:Ae}=e_e(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",Se=>u(Se)),t.on("generationResult",Se=>p(Se)),t.on("postprocessingResult",Se=>d(Se)),t.on("intermediateResult",Se=>m(Se)),t.on("progressUpdate",Se=>y(Se)),t.on("galleryImages",Se=>b(Se)),t.on("processingCanceled",()=>{w()}),t.on("imageDeleted",Se=>{E(Se)}),t.on("systemConfig",Se=>{_(Se)}),t.on("foundModels",Se=>{T(Se)}),t.on("newModelAdded",Se=>{L(Se)}),t.on("modelDeleted",Se=>{O(Se)}),t.on("modelConverted",Se=>{D(Se)}),t.on("modelsMerged",Se=>{I(Se)}),t.on("modelChanged",Se=>{k(Se)}),t.on("modelChangeFailed",Se=>{N(Se)}),t.on("tempFolderEmptied",()=>{V()}),n=!0),a.type){case"socketio/generateImage":{B(a.payload);break}case"socketio/runESRGAN":{K(a.payload);break}case"socketio/runFacetool":{ne(a.payload);break}case"socketio/deleteImage":{z(a.payload);break}case"socketio/requestImages":{$(a.payload);break}case"socketio/requestNewImages":{H(a.payload);break}case"socketio/cancelProcessing":{Y();break}case"socketio/requestSystemConfig":{Q();break}case"socketio/searchForModels":{q(a.payload);break}case"socketio/addNewModel":{X(a.payload);break}case"socketio/deleteModel":{ee(a.payload);break}case"socketio/convertToDiffusers":{fe(a.payload);break}case"socketio/mergeDiffusersModels":{Ee(a.payload);break}case"socketio/requestModelChange":{we(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{xe(a.payload);break}case"socketio/requestEmptyTempFolder":{Ae();break}}o(a)}},v_e=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),y_e=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel","cancelOptions.cancelAfter"].map(e=>`system.${e}`),b_e=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),NU=wW({generation:$3e,postprocessing:W3e,gallery:T3e,system:P4e,canvas:y3e,ui:$4e,lightbox:A3e}),x_e=RW.getPersistConfig({key:"root",storage:OW,rootReducer:NU,blacklist:[...v_e,...y_e,...b_e],debounce:300}),S_e=kSe(x_e,NU),$U=tSe({reducer:S_e,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(m_e()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),FU=ASe($U),IE=S.createContext(null),Le=gxe,le=ixe;let TI;const DE=()=>({setOpenUploader:e=>{e&&(TI=e)},openUploader:TI}),Br=lt(e=>e.ui,e=>CE[e.activeTab],{memoizeOptions:{equalityCheck:Te.isEqual}}),w_e=lt(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:Te.isEqual}}),fp=lt(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:Te.isEqual}}),MI=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=Br(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:a})).json(),u={uuid:um(),category:"user",...l};t(sm({image:u,category:"user"})),o==="unifiedCanvas"?t(o4(u)):o==="img2img"&&t(v0(u))};function C_e(){const{t:e}=De();return g.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[g.jsx("h1",{children:e("common.nodes")}),g.jsx("p",{children:e("common.nodesDesc")})]})}const __e=()=>{const{t:e}=De();return g.jsxs("div",{className:"work-in-progress post-processing-work-in-progress",children:[g.jsx("h1",{children:e("common.postProcessing")}),g.jsx("p",{children:e("common.postProcessDesc1")}),g.jsx("p",{children:e("common.postProcessDesc2")}),g.jsx("p",{children:e("common.postProcessDesc3")})]})};function k_e(){const{t:e}=De();return g.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[g.jsx("h1",{children:e("common.training")}),g.jsxs("p",{children:[e("common.trainingDesc1"),g.jsx("br",{}),g.jsx("br",{}),e("common.trainingDesc2")]})]})}function E_e(e){const{i18n:t}=De(),n=localStorage.getItem("i18nextLng");qe.useEffect(()=>{e()},[e]),qe.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const P_e=fc({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:g.jsx("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:g.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),T_e=fc({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:g.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),M_e=fc({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:g.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),L_e=fc({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:g.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:g.jsx("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})}),A_e=fc({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:g.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),O_e=fc({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:g.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})}),Ke=Xe((e,t)=>{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return g.jsx(si,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:g.jsx(ls,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})}),On=Xe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return g.jsx(si,{label:r,...i,children:g.jsx(ss,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})}),Ys=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return g.jsxs(q8,{...o,children:[g.jsx(G8,{children:t}),g.jsxs(Y8,{className:`invokeai__popover-content ${r}`,children:[i&&g.jsx(K8,{className:"invokeai__popover-arrow"}),n]})]})},h4=lt(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:Te.isEqual}}),Jo=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return g.jsxs(sn,{isDisabled:n,className:`invokeai__select ${l}`,onClick:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation(),d.nativeEvent.stopPropagation(),d.nativeEvent.cancelBubble=!0},children:[t&&g.jsx(Sn,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),g.jsx(si,{label:i,...o,children:g.jsx(KH,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(d=>typeof d=="string"||typeof d=="number"?g.jsx("option",{value:d,className:"invokeai__select-option",children:d},d):g.jsx("option",{value:d.value,className:"invokeai__select-option",children:d.key},d.value))})})]})};function R_e(){const e=le(i=>i.postprocessing.facetoolType),t=Le(),{t:n}=De(),r=i=>t(fS(i.target.value));return g.jsx(Jo,{label:n("parameters.type"),validValues:A5e.concat(),value:e,onChange:r})}var BU={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},LI=qe.createContext&&qe.createContext(BU),Bd=globalThis&&globalThis.__assign||function(){return Bd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{Ee(i)},[i]);const we=S.useMemo(()=>H!=null&&H.max?H.max:a,[a,H==null?void 0:H.max]),xe=Ye=>{l(Ye)},Ae=Ye=>{Ye.target.value===""&&(Ye.target.value=String(o));const nt=Te.clamp(w?Math.floor(Number(Ye.target.value)):Number(fe),o,we);l(nt)},Se=Ye=>{Ee(Ye)},Qe=()=>{O&&O()};return g.jsxs(sn,{className:V?`invokeai__slider-component ${V}`:"invokeai__slider-component","data-markers":p,style:L?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...B,children:[g.jsx(Sn,{className:"invokeai__slider-component-label",fontSize:"sm",...K,children:r}),g.jsxs(u2,{w:"100%",gap:2,alignItems:"center",children:[g.jsxs(JH,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:xe,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:I,width:u,...ee,children:[p&&g.jsxs(g.Fragment,{children:[g.jsx(rk,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...ne,children:o}),g.jsx(rk,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:y,...ne,children:a})]}),g.jsx(tW,{className:"invokeai__slider_track",...z,children:g.jsx(nW,{className:"invokeai__slider_track-filled"})}),g.jsx(si,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${d}`,hidden:T,...q,children:g.jsx(eW,{className:"invokeai__slider-thumb",...$})})]}),b&&g.jsxs(H8,{min:o,max:we,step:s,value:fe,onChange:Se,onBlur:Ae,className:"invokeai__slider-number-field",isDisabled:N,...H,children:[g.jsx(W8,{className:"invokeai__slider-number-input",width:E,readOnly:_,minWidth:E,...Y}),g.jsxs(zH,{...Q,children:[g.jsx(U8,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"}),g.jsx(V8,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"})]})]}),k&&g.jsx(Ke,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:g.jsx(p4,{}),onClick:Qe,isDisabled:D,...X})]})]})}function z_e(){const e=le(i=>i.system.isGFPGANAvailable),t=le(i=>i.postprocessing.facetoolStrength),{t:n}=De(),r=Le();return g.jsx(Dn,{isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,label:n("parameters.strength"),step:.05,min:0,max:1,onChange:i=>r(E3(i)),handleReset:()=>r(E3(.75)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}function H_e(){const e=le(i=>i.system.isGFPGANAvailable),t=le(i=>i.postprocessing.codeformerFidelity),{t:n}=De(),r=Le();return g.jsx(Dn,{isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,label:n("parameters.codeformerFidelity"),step:.05,min:0,max:1,onChange:i=>r(wk(i)),handleReset:()=>r(wk(1)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}const jE=()=>{const e=le(t=>t.postprocessing.facetoolType);return g.jsxs(ke,{direction:"column",gap:2,minWidth:"20rem",children:[g.jsx(R_e,{}),g.jsx(z_e,{}),e==="codeformer"&&g.jsx(H_e,{})]})};function W_e(){const e=le(i=>i.system.isESRGANAvailable),t=le(i=>i.postprocessing.upscalingDenoising),{t:n}=De(),r=Le();return g.jsx(Dn,{label:n("parameters.denoisingStrength"),value:t,min:0,max:1,step:.01,onChange:i=>{r(Ck(i))},handleReset:()=>r(Ck(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})}function V_e(){const e=le(i=>i.system.isESRGANAvailable),t=le(i=>i.postprocessing.upscalingStrength),{t:n}=De(),r=Le();return g.jsx(Dn,{label:`${n("parameters.upscale")} ${n("parameters.strength")}`,value:t,min:0,max:1,step:.05,onChange:i=>r(_k(i)),handleReset:()=>r(_k(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})}function U_e(){const e=le(o=>o.system.isESRGANAvailable),t=le(o=>o.postprocessing.upscalingLevel),{t:n}=De(),r=Le(),i=o=>r(mV(Number(o.target.value)));return g.jsx(Jo,{isDisabled:!e,label:n("parameters.scale"),value:t,onChange:i,validValues:L5e})}const NE=()=>g.jsxs(ke,{flexDir:"column",rowGap:2,minWidth:"20rem",children:[g.jsx(U_e,{}),g.jsx(W_e,{}),g.jsx(V_e,{})]}),$E=e=>e.postprocessing,hr=e=>e.system,G_e=e=>e.system.toastQueue,WU=lt(hr,e=>{const{model_list:t}=e,n=Te.reduce(t,(r,i,o)=>(i.status==="active"&&(r=o),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),q_e=lt(hr,e=>{const{model_list:t}=e;return Te.pickBy(t,(r,i)=>{if(r.format==="diffusers")return{name:i,...r}})},{memoizeOptions:{resultEqualityCheck:Te.isEqual}});function qk(){return qk=Object.assign?Object.assign.bind():function(e){for(var t=1;t'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var tke=function(t,n,r){r===void 0&&(r=!1);var i=n.alt,o=n.meta,a=n.mod,s=n.shift,l=n.ctrl,u=n.keys,d=t.key,p=t.code,m=t.ctrlKey,y=t.metaKey,b=t.shiftKey,w=t.altKey,E=kd(p),_=d.toLowerCase();if(!r){if(i===!w&&_!=="alt"||s===!b&&_!=="shift")return!1;if(a){if(!y&&!m)return!1}else if(o===!y&&_!=="meta"||l===!m&&_!=="ctrl")return!1}return u&&u.length===1&&(u.includes(_)||u.includes(E))?!0:u?X_e(u):!u},nke=S.createContext(void 0),rke=function(){return S.useContext(nke)};function KU(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&KU(e[r],t[r])},!0):e===t}var ike=S.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),oke=function(){return S.useContext(ike)};function ake(e){var t=S.useRef(void 0);return KU(t.current,e)||(t.current=e),t.current}var AI=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},ske=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Ze(e,t,n,r){var i=S.useRef(null),o=S.useRef(!1),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:void 0,l=S.useCallback(t,s??[]),u=S.useRef(l);s?u.current=l:u.current=t;var d=ake(a),p=oke(),m=p.enabledScopes,y=rke();return ske(function(){if(!((d==null?void 0:d.enabled)===!1||!eke(m,d==null?void 0:d.scopes))){var b=function(k,T){var L;if(T===void 0&&(T=!1),!(J_e(k)&&!qU(k,d==null?void 0:d.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){AI(k);return}(L=k.target)!=null&&L.isContentEditable&&!(d!=null&&d.enableOnContentEditable)||QC(e,d==null?void 0:d.splitKey).forEach(function(O){var D,I=JC(O,d==null?void 0:d.combinationKey);if(tke(k,I,d==null?void 0:d.ignoreModifiers)||(D=I.keys)!=null&&D.includes("*")){if(T&&o.current)return;if(Z_e(k,I,d==null?void 0:d.preventDefault),!Q_e(k,I,d==null?void 0:d.enabled)){AI(k);return}u.current(k,I),T||(o.current=!0)}})}},w=function(k){k.key!==void 0&&(UU(kd(k.code)),((d==null?void 0:d.keydown)===void 0&&(d==null?void 0:d.keyup)!==!0||d!=null&&d.keydown)&&b(k))},E=function(k){k.key!==void 0&&(GU(kd(k.code)),o.current=!1,d!=null&&d.keyup&&b(k,!0))};return(i.current||(a==null?void 0:a.document)||document).addEventListener("keyup",E),(i.current||(a==null?void 0:a.document)||document).addEventListener("keydown",w),y&&QC(e,d==null?void 0:d.splitKey).forEach(function(_){return y.addHotkey(JC(_,d==null?void 0:d.combinationKey))}),function(){(i.current||(a==null?void 0:a.document)||document).removeEventListener("keyup",E),(i.current||(a==null?void 0:a.document)||document).removeEventListener("keydown",w),y&&QC(e,d==null?void 0:d.splitKey).forEach(function(_){return y.removeHotkey(JC(_,d==null?void 0:d.combinationKey))})}}},[e,d,m]),i}function lke(e){return ut({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function uke(e){return ut({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function cke(e){return ut({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function YU(e){return ut({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function XU(e){return ut({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function dke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function fke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function ZU(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function hke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function pke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function FE(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function QU(e){return ut({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function Jm(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function JU(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function gke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function BE(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function eG(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function mke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function vke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function tG(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function yke(e){return ut({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function bke(e){return ut({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function nG(e){return ut({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function xke(e){return ut({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function Ske(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function wke(e){return ut({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function Cke(e){return ut({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"}}]})(e)}function rG(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function _ke(e){return ut({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function kke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function iG(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function Eke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function Pke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function b2(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function Tke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function Mke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function Lke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function zE(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function Ake(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function Oke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function OI(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function HE(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function Rke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function hp(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function Ike(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function g4(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function Dke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function WE(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const rn=e=>e.canvas,Lr=lt([rn,Br,hr],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),oG=e=>e.canvas.layerState.objects.find(S3),pp=e=>e.gallery,jke=lt([pp,h4,Lr,Br],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,galleryWidth:b,shouldUseSingleGalleryColumn:w}=e,{isLightboxOpen:E}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:p,galleryGridTemplateColumns:w?"auto":`repeat(auto-fill, minmax(${d}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightboxOpen:E,isStaging:n,shouldEnableResize:!(E||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:w}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),Nke=lt([pp,hr,h4,Br],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),$ke=lt(hr,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),O3=S.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Kd(),a=Le(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=le($ke),d=S.useRef(null),p=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(s_e(e)),o()};Ze("delete",()=>{s?i():m()},[e,s,l,u]);const y=b=>a(OV(!b.target.checked));return g.jsxs(g.Fragment,{children:[S.cloneElement(t,{onClick:e?p:void 0,ref:n}),g.jsx(FH,{isOpen:r,leastDestructiveRef:d,onClose:o,children:g.jsx(oc,{children:g.jsxs(BH,{className:"modal",children:[g.jsx(op,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),g.jsx(Xm,{children:g.jsxs(ke,{direction:"column",gap:5,children:[g.jsx(It,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),g.jsx(sn,{children:g.jsxs(ke,{alignItems:"center",children:[g.jsx(Sn,{mb:0,children:"Don't ask me again"}),g.jsx(X8,{checked:!s,onChange:y})]})})]})}),g.jsxs(Hw,{children:[g.jsx(ss,{ref:d,onClick:o,className:"modal-close-btn",children:"Cancel"}),g.jsx(ss,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})});O3.displayName="DeleteImageModal";const Fke=lt([hr,pp,$E,fp,h4,Br],(e,t,n,r,i,o)=>{const{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u}=e,{upscalingLevel:d,facetoolStrength:p}=n,{isLightboxOpen:m}=i,{shouldShowImageDetails:y}=r,{intermediateImage:b,currentImage:w}=t;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:d,facetoolStrength:p,shouldDisableToolbarButtons:Boolean(b)||!w,currentImage:w,shouldShowImageDetails:y,activeTabName:o,isLightboxOpen:m}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),aG=()=>{var V,B,K,ne,z,$;const e=Le(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightboxOpen:d,activeTabName:p}=le(Fke),m=s2(),{t:y}=De(),b=()=>{u&&(d&&e(Om(!1)),e(v0(u)),e(Wo("img2img")))},w=async()=>{if(!u)return;const H=await fetch(u.url).then(Q=>Q.blob()),Y=[new ClipboardItem({[H.type]:H})];await navigator.clipboard.write(Y),m({title:y("toast.imageCopied"),status:"success",duration:2500,isClosable:!0})},E=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:y("toast.imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};Ze("shift+i",()=>{u?(b(),m({title:y("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast.imageNotLoaded"),description:y("toast.imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{var H,Y;u&&(u.metadata&&e(aV(u.metadata)),((H=u.metadata)==null?void 0:H.image.type)==="img2img"?e(Wo("img2img")):((Y=u.metadata)==null?void 0:Y.image.type)==="txt2img"&&e(Wo("txt2img")))};Ze("a",()=>{var H,Y;["txt2img","img2img"].includes((Y=(H=u==null?void 0:u.metadata)==null?void 0:H.image)==null?void 0:Y.type)?(_(),m({title:y("toast.parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast.parametersNotSet"),description:y("toast.parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const k=()=>{u!=null&&u.metadata&&e(g2(u.metadata.image.seed))};Ze("s",()=>{var H,Y;(Y=(H=u==null?void 0:u.metadata)==null?void 0:H.image)!=null&&Y.seed?(k(),m({title:y("toast.seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast.seedNotSet"),description:y("toast.seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const T=()=>{var H,Y,Q,q;if((Y=(H=u==null?void 0:u.metadata)==null?void 0:H.image)!=null&&Y.prompt){const[X,ee]=xE((q=(Q=u==null?void 0:u.metadata)==null?void 0:Q.image)==null?void 0:q.prompt);X&&e(a4(X)),e(Dy(ee||""))}};Ze("p",()=>{var H,Y;(Y=(H=u==null?void 0:u.metadata)==null?void 0:H.image)!=null&&Y.prompt?(T(),m({title:y("toast.promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast.promptNotSet"),description:y("toast.promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const L=()=>{u&&e(o_e(u))};Ze("Shift+U",()=>{i&&!s&&n&&!t&&o?L():m({title:y("toast.upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const O=()=>{u&&e(a_e(u))};Ze("Shift+R",()=>{r&&!s&&n&&!t&&a?O():m({title:y("toast.faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const D=()=>e(NV(!l)),I=()=>{u&&(d&&e(Om(!1)),e(o4(u)),e(Li(!0)),p!=="unifiedCanvas"&&e(Wo("unifiedCanvas")),m({title:y("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};Ze("i",()=>{u?D():m({title:y("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const N=()=>{e(Om(!d))};return g.jsxs("div",{className:"current-image-options",children:[g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ke,{"aria-label":`${y("parameters.sendTo")}...`,icon:g.jsx(Oke,{})}),children:g.jsxs("div",{className:"current-image-send-to-popover",children:[g.jsx(On,{size:"sm",onClick:b,leftIcon:g.jsx(OI,{}),children:y("parameters.sendToImg2Img")}),g.jsx(On,{size:"sm",onClick:I,leftIcon:g.jsx(OI,{}),children:y("parameters.sendToUnifiedCanvas")}),g.jsx(On,{size:"sm",onClick:w,leftIcon:g.jsx(Jm,{}),children:y("parameters.copyImage")}),g.jsx(On,{size:"sm",onClick:E,leftIcon:g.jsx(Jm,{}),children:y("parameters.copyImageToLink")}),g.jsx(Nh,{download:!0,href:u==null?void 0:u.url,children:g.jsx(On,{leftIcon:g.jsx(BE,{}),size:"sm",w:"100%",children:y("parameters.downloadImage")})})]})}),g.jsx(Ke,{icon:g.jsx(vke,{}),tooltip:d?`${y("parameters.closeViewer")} (Z)`:`${y("parameters.openInViewer")} (Z)`,"aria-label":d?`${y("parameters.closeViewer")} (Z)`:`${y("parameters.openInViewer")} (Z)`,"data-selected":d,onClick:N})]}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ke,{icon:g.jsx(Tke,{}),tooltip:`${y("parameters.usePrompt")} (P)`,"aria-label":`${y("parameters.usePrompt")} (P)`,isDisabled:!((B=(V=u==null?void 0:u.metadata)==null?void 0:V.image)!=null&&B.prompt),onClick:T}),g.jsx(Ke,{icon:g.jsx(Ake,{}),tooltip:`${y("parameters.useSeed")} (S)`,"aria-label":`${y("parameters.useSeed")} (S)`,isDisabled:!((ne=(K=u==null?void 0:u.metadata)==null?void 0:K.image)!=null&&ne.seed),onClick:k}),g.jsx(Ke,{icon:g.jsx(hke,{}),tooltip:`${y("parameters.useAll")} (A)`,"aria-label":`${y("parameters.useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes(($=(z=u==null?void 0:u.metadata)==null?void 0:z.image)==null?void 0:$.type),onClick:_})]}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ke,{icon:g.jsx(xke,{}),"aria-label":y("parameters.restoreFaces")}),children:g.jsxs("div",{className:"current-image-postprocessing-popover",children:[g.jsx(jE,{}),g.jsx(On,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:O,children:y("parameters.restoreFaces")})]})}),g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ke,{icon:g.jsx(mke,{}),"aria-label":y("parameters.upscale")}),children:g.jsxs("div",{className:"current-image-postprocessing-popover",children:[g.jsx(NE,{}),g.jsx(On,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:L,children:y("parameters.upscaleImage")})]})})]}),g.jsx(Gi,{isAttached:!0,children:g.jsx(Ke,{icon:g.jsx(QU,{}),tooltip:`${y("parameters.info")} (I)`,"aria-label":`${y("parameters.info")} (I)`,"data-selected":l,onClick:D})}),g.jsx(O3,{image:u,children:g.jsx(Ke,{icon:g.jsx(hp,{}),tooltip:`${y("parameters.deleteImage")} (Del)`,"aria-label":`${y("parameters.deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};var Bke=fc({displayName:"EditIcon",path:g.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[g.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),g.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),sG=fc({displayName:"ExternalLinkIcon",path:g.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[g.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),g.jsx("path",{d:"M15 3h6v6"}),g.jsx("path",{d:"M10 14L21 3"})]})}),zke=fc({displayName:"DeleteIcon",path:g.jsx("g",{fill:"currentColor",children:g.jsx("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})});function Hke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const Jn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>g.jsxs(ke,{gap:2,children:[n&&g.jsx(si,{label:`Recall ${e}`,children:g.jsx(ls,{"aria-label":"Use this parameter",icon:g.jsx(Hke,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&g.jsx(si,{label:`Copy ${e}`,children:g.jsx(ls,{"aria-label":`Copy ${e}`,icon:g.jsx(Jm,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),g.jsxs(ke,{direction:i?"column":"row",children:[g.jsxs(It,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?g.jsxs(Nh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",g.jsx(sG,{mx:"2px"})]}):g.jsx(It,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),Wke=(e,t)=>e.image.uuid===t.image.uuid,VE=S.memo(({image:e,styleClass:t})=>{var B,K;const n=Le();Ze("esc",()=>{n(NV(!1))});const r=((B=e==null?void 0:e.metadata)==null?void 0:B.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:d,orig_path:p,perlin:m,postprocessing:y,prompt:b,sampler:w,seamless:E,seed:_,steps:k,strength:T,denoise_str:L,threshold:O,type:D,variations:I,width:N}=r,V=JSON.stringify(e.metadata,null,2);return g.jsx("div",{className:`image-metadata-viewer ${t}`,children:g.jsxs(ke,{gap:1,direction:"column",width:"100%",children:[g.jsxs(ke,{gap:2,children:[g.jsx(It,{fontWeight:"semibold",children:"File:"}),g.jsxs(Nh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,g.jsx(sG,{mx:"2px"})]})]}),Object.keys(r).length>0?g.jsxs(g.Fragment,{children:[D&&g.jsx(Jn,{label:"Generation type",value:D}),((K=e.metadata)==null?void 0:K.model_weights)&&g.jsx(Jn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(D)&&g.jsx(Jn,{label:"Original image",value:p}),b&&g.jsx(Jn,{label:"Prompt",labelPosition:"top",value:V1(b),onClick:()=>n(a4(b))}),_!==void 0&&g.jsx(Jn,{label:"Seed",value:_,onClick:()=>n(g2(_))}),O!==void 0&&g.jsx(Jn,{label:"Noise Threshold",value:O,onClick:()=>n(Sk(O))}),m!==void 0&&g.jsx(Jn,{label:"Perlin Noise",value:m,onClick:()=>n(bk(m))}),w&&g.jsx(Jn,{label:"Sampler",value:w,onClick:()=>n(uV(w))}),k&&g.jsx(Jn,{label:"Steps",value:k,onClick:()=>n(xk(k))}),o!==void 0&&g.jsx(Jn,{label:"CFG scale",value:o,onClick:()=>n(vk(o))}),I&&I.length>0&&g.jsx(Jn,{label:"Seed-weight pairs",value:k3(I),onClick:()=>n(dV(k3(I)))}),E&&g.jsx(Jn,{label:"Seamless",value:E,onClick:()=>n(cV(E))}),l&&g.jsx(Jn,{label:"High Resolution Optimization",value:l,onClick:()=>n(gV(l))}),N&&g.jsx(Jn,{label:"Width",value:N,onClick:()=>n(dS(N))}),s&&g.jsx(Jn,{label:"Height",value:s,onClick:()=>n(cS(s))}),u&&g.jsx(Jn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(v0(u))}),d&&g.jsx(Jn,{label:"Mask image",value:d,isLink:!0,onClick:()=>n(lV(d))}),D==="img2img"&&T&&g.jsx(Jn,{label:"Image to image strength",value:T,onClick:()=>n(yk(T))}),a&&g.jsx(Jn,{label:"Image to image fit",value:a,onClick:()=>n(fV(a))}),y&&y.length>0&&g.jsxs(g.Fragment,{children:[g.jsx(jh,{size:"sm",children:"Postprocessing"}),y.map((ne,z)=>{if(ne.type==="esrgan"){const{scale:$,strength:H,denoise_str:Y}=ne;return g.jsxs(ke,{pl:"2rem",gap:1,direction:"column",children:[g.jsx(It,{size:"md",children:`${z+1}: Upscale (ESRGAN)`}),g.jsx(Jn,{label:"Scale",value:$,onClick:()=>n(mV($))}),g.jsx(Jn,{label:"Strength",value:H,onClick:()=>n(_k(H))}),Y!==void 0&&g.jsx(Jn,{label:"Denoising strength",value:Y,onClick:()=>n(Ck(Y))})]},z)}else if(ne.type==="gfpgan"){const{strength:$}=ne;return g.jsxs(ke,{pl:"2rem",gap:1,direction:"column",children:[g.jsx(It,{size:"md",children:`${z+1}: Face restoration (GFPGAN)`}),g.jsx(Jn,{label:"Strength",value:$,onClick:()=>{n(E3($)),n(fS("gfpgan"))}})]},z)}else if(ne.type==="codeformer"){const{strength:$,fidelity:H}=ne;return g.jsxs(ke,{pl:"2rem",gap:1,direction:"column",children:[g.jsx(It,{size:"md",children:`${z+1}: Face restoration (Codeformer)`}),g.jsx(Jn,{label:"Strength",value:$,onClick:()=>{n(E3($)),n(fS("codeformer"))}}),H&&g.jsx(Jn,{label:"Fidelity",value:H,onClick:()=>{n(wk(H)),n(fS("codeformer"))}})]},z)}})]}),i&&g.jsx(Jn,{withCopy:!0,label:"Dream Prompt",value:i}),g.jsxs(ke,{gap:2,direction:"column",children:[g.jsxs(ke,{gap:2,children:[g.jsx(si,{label:"Copy metadata JSON",children:g.jsx(ls,{"aria-label":"Copy metadata JSON",icon:g.jsx(Jm,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(V)})}),g.jsx(It,{fontWeight:"semibold",children:"Metadata JSON:"})]}),g.jsx("div",{className:"image-json-viewer",children:g.jsx("pre",{children:V})})]})]}):g.jsx(sH,{width:"100%",pt:10,children:g.jsx(It,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},Wke);VE.displayName="ImageMetadataViewer";const lG=lt([pp,fp],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var d;return u.uuid===((d=e==null?void 0:e.currentImage)==null?void 0:d.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}});function Vke(){const e=Le(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=le(lG),[a,s]=S.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(bE())},p=()=>{e(yE())};return g.jsxs("div",{className:"current-image-preview",children:[i&&g.jsx(Nw,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&g.jsxs("div",{className:"current-image-next-prev-buttons",children:[g.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&g.jsx(ls,{"aria-label":"Previous image",icon:g.jsx(YU,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),g.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&g.jsx(ls,{"aria-label":"Next image",icon:g.jsx(XU,{className:"next-prev-button"}),variant:"unstyled",onClick:p})})]}),r&&i&&g.jsx(VE,{image:i,styleClass:"current-image-metadata"})]})}var Uke=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ni=globalThis&&globalThis.__assign||function(){return ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},Qke=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],NI="__resizable_base__",uG=function(e){Kke(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(NI):o.className+=NI,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;o&&o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||Yke},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),d=u/l[s]*100;return d+"%"}return e6(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?e6(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?e6(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&Ig("left",o),s=i&&Ig("top",o),l,u;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=a?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,p=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,y=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,w=u||0;if(s){var E=(m-b)*this.ratio+w,_=(y-b)*this.ratio+w,k=(d-w)/this.ratio+b,T=(p-w)/this.ratio+b,L=Math.max(d,E),O=Math.min(p,_),D=Math.max(m,k),I=Math.min(y,T);n=bx(n,L,O),r=bx(r,D,I)}else n=bx(n,d,p),r=bx(r,m,y);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&Xke(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&xx(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var d=this.window.getComputedStyle(u).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Ol(Ol({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(p)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&xx(n))try{n.preventDefault(),n.stopPropagation()}catch{}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=xx(n)?n.touches[0].clientX:n.clientX,d=xx(n)?n.touches[0].clientY:n.clientY,p=this.state,m=p.direction,y=p.original,b=p.width,w=p.height,E=this.getParentSize(),_=Zke(E,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=_.maxWidth,a=_.maxHeight,s=_.minWidth,l=_.minHeight;var k=this.calculateNewSizeFromDirection(u,d),T=k.newHeight,L=k.newWidth,O=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(L=jI(L,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=jI(T,this.props.snap.y,this.props.snapGap));var D=this.calculateNewSizeFromAspectRatio(L,T,{width:O.maxWidth,height:O.maxHeight},{width:s,height:l});if(L=D.newWidth,T=D.newHeight,this.props.grid){var I=DI(L,this.props.grid[0]),N=DI(T,this.props.grid[1]),V=this.props.snapGap||0;L=V===0||Math.abs(I-L)<=V?I:L,T=V===0||Math.abs(N-T)<=V?N:T}var B={width:L-y.width,height:T-y.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var K=L/E.width*100;L=K+"%"}else if(b.endsWith("vw")){var ne=L/this.window.innerWidth*100;L=ne+"vw"}else if(b.endsWith("vh")){var z=L/this.window.innerHeight*100;L=z+"vh"}}if(w&&typeof w=="string"){if(w.endsWith("%")){var K=T/E.height*100;T=K+"%"}else if(w.endsWith("vw")){var ne=T/this.window.innerWidth*100;T=ne+"vw"}else if(w.endsWith("vh")){var z=T/this.window.innerHeight*100;T=z+"vh"}}var $={width:this.createSizeForCssProperty(L,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?$.flexBasis=$.width:this.flexDir==="column"&&($.flexBasis=$.height),Xs.flushSync(function(){r.setState($)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,B)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Ol(Ol({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var d=Object.keys(i).map(function(p){return i[p]!==!1?S.createElement(qke,{key:p,direction:p,onResizeStart:n.onResizeStart,replaceStyles:o&&o[p],className:a&&a[p]},u&&u[p]?u[p]:null):null});return S.createElement("div",{className:l,style:s},d)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return Qke.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Ol(Ol(Ol({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return S.createElement(o,Ol({ref:this.ref,style:i,className:this.props.className},r),this.state.isResizing&&S.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(S.PureComponent);const Gn=e=>{const{label:t,styleClass:n,...r}=e;return g.jsx(fz,{className:`invokeai__checkbox ${n}`,...r,children:t})};function cG(e){return ut({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function dG(e){return ut({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function Jke(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.5 9c-.42 0-.83.04-1.24.11L1.01 3 1 10l9 2-9 2 .01 7 8.07-3.46C9.59 21.19 12.71 24 16.5 24c4.14 0 7.5-3.36 7.5-7.5S20.64 9 16.5 9zm0 13c-3.03 0-5.5-2.47-5.5-5.5s2.47-5.5 5.5-5.5 5.5 2.47 5.5 5.5-2.47 5.5-5.5 5.5z"}},{tag:"path",attr:{d:"M18.27 14.03l-1.77 1.76-1.77-1.76-.7.7 1.76 1.77-1.76 1.77.7.7 1.77-1.76 1.77 1.76.7-.7-1.76-1.77 1.76-1.77z"}}]})(e)}function e7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function t7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function n7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function r7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function fG(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function i7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function o7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 10l5 5 5-5z"}}]})(e)}function a7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 14l5-5 5 5z"}}]})(e)}function s7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function l7e(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function u7e(e,t){e.classList?e.classList.add(t):l7e(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function $I(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function c7e(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=$I(e.className,t):e.setAttribute("class",$I(e.className&&e.className.baseVal||"",t))}const FI={disabled:!1},hG=qe.createContext(null);var pG=function(t){return t.scrollTop},x1="unmounted",ph="exited",gh="entering",Fg="entered",Kk="exiting",mc=function(e){S8(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=ph,o.appearStatus=gh):l=Fg:r.unmountOnExit||r.mountOnEnter?l=x1:l=ph,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===x1?{status:ph}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==gh&&a!==Fg&&(o=gh):(a===gh||a===Fg)&&(o=Kk)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===gh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Rb.findDOMNode(this);a&&pG(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ph&&this.setState({status:x1})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Rb.findDOMNode(this),s],u=l[0],d=l[1],p=this.getTimeouts(),m=s?p.appear:p.enter;if(!i&&!a||FI.disabled){this.safeSetState({status:Fg},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:gh},function(){o.props.onEntering(u,d),o.onTransitionEnd(m,function(){o.safeSetState({status:Fg},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Rb.findDOMNode(this);if(!o||FI.disabled){this.safeSetState({status:ph},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:Kk},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:ph},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Rb.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===x1)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=y8(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return qe.createElement(hG.Provider,{value:null},typeof a=="function"?a(i,s):qe.cloneElement(qe.Children.only(a),s))},t}(qe.Component);mc.contextType=hG;mc.propTypes={};function Dg(){}mc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Dg,onEntering:Dg,onEntered:Dg,onExit:Dg,onExiting:Dg,onExited:Dg};mc.UNMOUNTED=x1;mc.EXITED=ph;mc.ENTERING=gh;mc.ENTERED=Fg;mc.EXITING=Kk;const d7e=mc;var f7e=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return u7e(t,r)})},t6=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return c7e(t,r)})},UE=function(e){S8(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ab,Object.values(b));return S.createElement(w.Provider,{value:E},y)}function d(p,m){const y=(m==null?void 0:m[e][l])||s,b=S.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const i=()=>{const o=n.map(a=>S.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,h7e(i,...t)]}function h7e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const p=l(o)[`__scope${u}`];return{...s,...p}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function p7e(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function mG(...e){return t=>e.forEach(n=>p7e(n,t))}function ds(...e){return S.useCallback(mG(...e),e)}const By=S.forwardRef((e,t)=>{const{children:n,...r}=e,i=S.Children.toArray(n),o=i.find(m7e);if(o){const a=o.props.children,s=i.map(l=>l===o?S.Children.count(a)>1?S.Children.only(null):S.isValidElement(a)?a.props.children:null:l);return S.createElement(Yk,pn({},r,{ref:t}),S.isValidElement(a)?S.cloneElement(a,void 0,s):null)}return S.createElement(Yk,pn({},r,{ref:t}),n)});By.displayName="Slot";const Yk=S.forwardRef((e,t)=>{const{children:n,...r}=e;return S.isValidElement(n)?S.cloneElement(n,{...v7e(r,n.props),ref:mG(t,n.ref)}):S.Children.count(n)>1?S.Children.only(null):null});Yk.displayName="SlotClone";const g7e=({children:e})=>S.createElement(S.Fragment,null,e);function m7e(e){return S.isValidElement(e)&&e.type===g7e}function v7e(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const y7e=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],sc=y7e.reduce((e,t)=>{const n=S.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?By:t;return S.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),S.createElement(s,pn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function vG(e,t){e&&Xs.flushSync(()=>e.dispatchEvent(t))}function yG(e){const t=e+"CollectionProvider",[n,r]=x2(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:b,children:w}=y,E=qe.useRef(null),_=qe.useRef(new Map).current;return qe.createElement(i,{scope:b,itemMap:_,collectionRef:E},w)},s=e+"CollectionSlot",l=qe.forwardRef((y,b)=>{const{scope:w,children:E}=y,_=o(s,w),k=ds(b,_.collectionRef);return qe.createElement(By,{ref:k},E)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",p=qe.forwardRef((y,b)=>{const{scope:w,children:E,..._}=y,k=qe.useRef(null),T=ds(b,k),L=o(u,w);return qe.useEffect(()=>(L.itemMap.set(k,{ref:k,..._}),()=>void L.itemMap.delete(k))),qe.createElement(By,{[d]:"",ref:T},E)});function m(y){const b=o(e+"CollectionConsumer",y);return qe.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const _=Array.from(E.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((L,O)=>_.indexOf(L.ref.current)-_.indexOf(O.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:p},m,r]}const b7e=S.createContext(void 0);function bG(e){const t=S.useContext(b7e);return e||t||"ltr"}function Js(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function x7e(e,t=globalThis==null?void 0:globalThis.document){const n=Js(e);S.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Xk="dismissableLayer.update",S7e="dismissableLayer.pointerDownOutside",w7e="dismissableLayer.focusOutside";let BI;const C7e=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_7e=S.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,d=S.useContext(C7e),[p,m]=S.useState(null),y=(n=p==null?void 0:p.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=S.useState({}),w=ds(t,N=>m(N)),E=Array.from(d.layers),[_]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=E.indexOf(_),T=p?E.indexOf(p):-1,L=d.layersWithOutsidePointerEventsDisabled.size>0,O=T>=k,D=k7e(N=>{const V=N.target,B=[...d.branches].some(K=>K.contains(V));!O||B||(o==null||o(N),s==null||s(N),N.defaultPrevented||l==null||l())},y),I=E7e(N=>{const V=N.target;[...d.branches].some(K=>K.contains(V))||(a==null||a(N),s==null||s(N),N.defaultPrevented||l==null||l())},y);return x7e(N=>{T===d.layers.size-1&&(i==null||i(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},y),S.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(BI=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),zI(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=BI)}},[p,y,r,d]),S.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),zI())},[p,d]),S.useEffect(()=>{const N=()=>b({});return document.addEventListener(Xk,N),()=>document.removeEventListener(Xk,N)},[]),S.createElement(sc.div,pn({},u,{ref:w,style:{pointerEvents:L?O?"auto":"none":void 0,...e.style},onFocusCapture:Kn(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Kn(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Kn(e.onPointerDownCapture,D.onPointerDownCapture)}))});function k7e(e,t=globalThis==null?void 0:globalThis.document){const n=Js(e),r=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){xG(S7e,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function E7e(e,t=globalThis==null?void 0:globalThis.document){const n=Js(e),r=S.useRef(!1);return S.useEffect(()=>{const i=o=>{o.target&&!r.current&&xG(w7e,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function zI(){const e=new CustomEvent(Xk);document.dispatchEvent(e)}function xG(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?vG(i,o):i.dispatchEvent(o)}let n6=0;function P7e(){S.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:HI()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:HI()),n6++,()=>{n6===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),n6--}},[])}function HI(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const r6="focusScope.autoFocusOnMount",i6="focusScope.autoFocusOnUnmount",WI={bubbles:!1,cancelable:!0},T7e=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=S.useState(null),u=Js(i),d=Js(o),p=S.useRef(null),m=ds(t,w=>l(w)),y=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let w=function(_){if(y.paused||!s)return;const k=_.target;s.contains(k)?p.current=k:mh(p.current,{select:!0})},E=function(_){y.paused||!s||s.contains(_.relatedTarget)||mh(p.current,{select:!0})};return document.addEventListener("focusin",w),document.addEventListener("focusout",E),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",E)}}},[r,s,y.paused]),S.useEffect(()=>{if(s){UI.add(y);const w=document.activeElement;if(!s.contains(w)){const _=new CustomEvent(r6,WI);s.addEventListener(r6,u),s.dispatchEvent(_),_.defaultPrevented||(M7e(I7e(SG(s)),{select:!0}),document.activeElement===w&&mh(s))}return()=>{s.removeEventListener(r6,u),setTimeout(()=>{const _=new CustomEvent(i6,WI);s.addEventListener(i6,d),s.dispatchEvent(_),_.defaultPrevented||mh(w??document.body,{select:!0}),s.removeEventListener(i6,d),UI.remove(y)},0)}}},[s,u,d,y]);const b=S.useCallback(w=>{if(!n&&!r||y.paused)return;const E=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,_=document.activeElement;if(E&&_){const k=w.currentTarget,[T,L]=L7e(k);T&&L?!w.shiftKey&&_===L?(w.preventDefault(),n&&mh(T,{select:!0})):w.shiftKey&&_===T&&(w.preventDefault(),n&&mh(L,{select:!0})):_===k&&w.preventDefault()}},[n,r,y.paused]);return S.createElement(sc.div,pn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function M7e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mh(r,{select:t}),document.activeElement!==n)return}function L7e(e){const t=SG(e),n=VI(t,e),r=VI(t.reverse(),e);return[n,r]}function SG(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function VI(e,t){for(const n of e)if(!A7e(n,{upTo:t}))return n}function A7e(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function O7e(e){return e instanceof HTMLInputElement&&"select"in e}function mh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&O7e(e)&&t&&e.select()}}const UI=R7e();function R7e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=GI(e,t),e.unshift(t)},remove(t){var n;e=GI(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function GI(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function I7e(e){return e.filter(t=>t.tagName!=="A")}const Pd=Boolean(globalThis==null?void 0:globalThis.document)?S.useLayoutEffect:()=>{},D7e=m6["useId".toString()]||(()=>{});let j7e=0;function N7e(e){const[t,n]=S.useState(D7e());return Pd(()=>{e||n(r=>r??String(j7e++))},[e]),e||(t?`radix-${t}`:"")}function gp(e){return e.split("-")[0]}function S2(e){return e.split("-")[1]}function S0(e){return["top","bottom"].includes(gp(e))?"x":"y"}function GE(e){return e==="y"?"height":"width"}function qI(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=S0(t),l=GE(s),u=r[l]/2-i[l]/2,d=s==="x";let p;switch(gp(t)){case"top":p={x:o,y:r.y-i.height};break;case"bottom":p={x:o,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:a};break;case"left":p={x:r.x-i.width,y:a};break;default:p={x:r.x,y:r.y}}switch(S2(t)){case"start":p[s]-=u*(n&&d?-1:1);break;case"end":p[s]+=u*(n&&d?-1:1)}return p}const $7e=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=qI(l,r,s),p=r,m={},y=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=wG(r),d={x:i,y:o},p=S0(a),m=S2(a),y=GE(p),b=await l.getDimensions(n),w=p==="y"?"top":"left",E=p==="y"?"bottom":"right",_=s.reference[y]+s.reference[p]-d[p]-s.floating[y],k=d[p]-s.reference[p],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let L=T?p==="y"?T.clientHeight||0:T.clientWidth||0:0;L===0&&(L=s.floating[y]);const O=_/2-k/2,D=u[w],I=L-b[y]-u[E],N=L/2-b[y]/2+O,V=Zk(D,N,I),B=(m==="start"?u[w]:u[E])>0&&N!==V&&s.reference[y]<=s.floating[y];return{[p]:d[p]-(B?NB7e[t])}function z7e(e,t,n){n===void 0&&(n=!1);const r=S2(e),i=S0(e),o=GE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=I3(a)),{main:a,cross:I3(a)}}const H7e={start:"end",end:"start"};function YI(e){return e.replace(/start|end/g,t=>H7e[t])}const CG=["top","right","bottom","left"];CG.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const W7e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",flipAlignment:y=!0,...b}=e,w=gp(r),E=p||(w===a||!y?[I3(a)]:function(N){const V=I3(N);return[YI(N),V,YI(V)]}(a)),_=[a,...E],k=await zy(t,b),T=[];let L=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(k[w]),d){const{main:N,cross:V}=z7e(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));T.push(k[N],k[V])}if(L=[...L,{placement:r,overflows:T}],!T.every(N=>N<=0)){var O,D;const N=((O=(D=i.flip)==null?void 0:D.index)!=null?O:0)+1,V=_[N];if(V)return{data:{index:N,overflows:L},reset:{placement:V}};let B="bottom";switch(m){case"bestFit":{var I;const K=(I=L.map(ne=>[ne,ne.overflows.filter(z=>z>0).reduce((z,$)=>z+$,0)]).sort((ne,z)=>ne[1]-z[1])[0])==null?void 0:I[0].placement;K&&(B=K);break}case"initialPlacement":B=a}if(r!==B)return{reset:{placement:B}}}return{}}}};function XI(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ZI(e){return CG.some(t=>e[t]>=0)}const V7e=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=XI(await zy(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:ZI(o)}}}case"escaped":{const o=XI(await zy(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:o,escaped:ZI(o)}}}default:return{}}}}},U7e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,d=await(l.isRTL==null?void 0:l.isRTL(u.floating)),p=gp(s),m=S2(s),y=S0(s)==="x",b=["left","top"].includes(p)?-1:1,w=d&&y?-1:1,E=typeof a=="function"?a(o):a;let{mainAxis:_,crossAxis:k,alignmentAxis:T}=typeof E=="number"?{mainAxis:E,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...E};return m&&typeof T=="number"&&(k=m==="end"?-1*T:T),y?{x:k*w,y:_*b}:{x:_*b,y:k*w}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function _G(e){return e==="x"?"y":"x"}const G7e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:E=>{let{x:_,y:k}=E;return{x:_,y:k}}},...l}=e,u={x:n,y:r},d=await zy(t,l),p=S0(gp(i)),m=_G(p);let y=u[p],b=u[m];if(o){const E=p==="y"?"bottom":"right";y=Zk(y+d[p==="y"?"top":"left"],y,y-d[E])}if(a){const E=m==="y"?"bottom":"right";b=Zk(b+d[m==="y"?"top":"left"],b,b-d[E])}const w=s.fn({...t,[p]:y,[m]:b});return{...w,data:{x:w.x-n,y:w.y-r}}}}},q7e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,d={x:n,y:r},p=S0(i),m=_G(p);let y=d[p],b=d[m];const w=typeof s=="function"?s({...o,placement:i}):s,E=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const O=p==="y"?"height":"width",D=o.reference[p]-o.floating[O]+E.mainAxis,I=o.reference[p]+o.reference[O]-E.mainAxis;yI&&(y=I)}if(u){var _,k,T,L;const O=p==="y"?"width":"height",D=["top","left"].includes(gp(i)),I=o.reference[m]-o.floating[O]+(D&&(_=(k=a.offset)==null?void 0:k[m])!=null?_:0)+(D?0:E.crossAxis),N=o.reference[m]+o.reference[O]+(D?0:(T=(L=a.offset)==null?void 0:L[m])!=null?T:0)-(D?E.crossAxis:0);bN&&(b=N)}return{[p]:y,[m]:b}}}},K7e=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:a,...s}=e,l=await zy(t,s),u=gp(n),d=S2(n);let p,m;u==="top"||u==="bottom"?(p=u,m=d===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(m=u,p=d==="end"?"top":"bottom");const y=vh(l.left,0),b=vh(l.right,0),w=vh(l.top,0),E=vh(l.bottom,0),_={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(w!==0||E!==0?w+E:vh(l.top,l.bottom)):l[p]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(y!==0||b!==0?y+b:vh(l.left,l.right)):l[m])},k=await i.getDimensions(o.floating);a==null||a({...t,..._});const T=await i.getDimensions(o.floating);return k.width!==T.width||k.height!==T.height?{reset:{rects:!0}}:{}}}};function kG(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function vc(e){if(e==null)return window;if(!kG(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function w2(e){return vc(e).getComputedStyle(e)}function Xu(e){return kG(e)?"":e?(e.nodeName||"").toLowerCase():""}function EG(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function ou(e){return e instanceof vc(e).HTMLElement}function ef(e){return e instanceof vc(e).Element}function qE(e){return typeof ShadowRoot>"u"?!1:e instanceof vc(e).ShadowRoot||e instanceof ShadowRoot}function m4(e){const{overflow:t,overflowX:n,overflowY:r}=w2(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function Y7e(e){return["table","td","th"].includes(Xu(e))}function QI(e){const t=/firefox/i.test(EG()),n=w2(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function PG(){return!/^((?!chrome|android).)*safari/i.test(EG())}const JI=Math.min,Y1=Math.max,D3=Math.round;function Zu(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&ou(e)&&(l=e.offsetWidth>0&&D3(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&D3(s.height)/e.offsetHeight||1);const d=ef(e)?vc(e):window,p=!PG()&&n,m=(s.left+(p&&(r=(i=d.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,y=(s.top+(p&&(o=(a=d.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,w=s.height/u;return{width:b,height:w,top:y,right:m+b,bottom:y+w,left:m,x:m,y}}function zd(e){return(t=e,(t instanceof vc(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function v4(e){return ef(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function TG(e){return Zu(zd(e)).left+v4(e).scrollLeft}function X7e(e,t,n){const r=ou(t),i=zd(t),o=Zu(e,r&&function(l){const u=Zu(l);return D3(u.width)!==l.offsetWidth||D3(u.height)!==l.offsetHeight}(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Xu(t)!=="body"||m4(i))&&(a=v4(t)),ou(t)){const l=Zu(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=TG(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function MG(e){return Xu(e)==="html"?e:e.assignedSlot||e.parentNode||(qE(e)?e.host:null)||zd(e)}function eD(e){return ou(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function Qk(e){const t=vc(e);let n=eD(e);for(;n&&Y7e(n)&&getComputedStyle(n).position==="static";)n=eD(n);return n&&(Xu(n)==="html"||Xu(n)==="body"&&getComputedStyle(n).position==="static"&&!QI(n))?t:n||function(r){let i=MG(r);for(qE(i)&&(i=i.host);ou(i)&&!["html","body"].includes(Xu(i));){if(QI(i))return i;i=i.parentNode}return null}(e)||t}function tD(e){if(ou(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Zu(e);return{width:t.width,height:t.height}}function LG(e){const t=MG(e);return["html","body","#document"].includes(Xu(t))?e.ownerDocument.body:ou(t)&&m4(t)?t:LG(t)}function j3(e,t){var n;t===void 0&&(t=[]);const r=LG(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=vc(r),a=i?[o].concat(o.visualViewport||[],m4(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(j3(a))}function nD(e,t,n){return t==="viewport"?R3(function(r,i){const o=vc(r),a=zd(r),s=o.visualViewport;let l=a.clientWidth,u=a.clientHeight,d=0,p=0;if(s){l=s.width,u=s.height;const m=PG();(m||!m&&i==="fixed")&&(d=s.offsetLeft,p=s.offsetTop)}return{width:l,height:u,x:d,y:p}}(e,n)):ef(t)?function(r,i){const o=Zu(r,!1,i==="fixed"),a=o.top+r.clientTop,s=o.left+r.clientLeft;return{top:a,left:s,x:s,y:a,right:s+r.clientWidth,bottom:a+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):R3(function(r){var i;const o=zd(r),a=v4(r),s=(i=r.ownerDocument)==null?void 0:i.body,l=Y1(o.scrollWidth,o.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=Y1(o.scrollHeight,o.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let d=-a.scrollLeft+TG(r);const p=-a.scrollTop;return w2(s||o).direction==="rtl"&&(d+=Y1(o.clientWidth,s?s.clientWidth:0)-l),{width:l,height:u,x:d,y:p}}(zd(e)))}function Z7e(e){const t=j3(e),n=["absolute","fixed"].includes(w2(e).position)&&ou(e)?Qk(e):e;return ef(n)?t.filter(r=>ef(r)&&function(i,o){const a=o.getRootNode==null?void 0:o.getRootNode();if(i.contains(o))return!0;if(a&&qE(a)){let s=o;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&Xu(r)!=="body"):[]}const Q7e={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Z7e(t):[].concat(n),r],a=o[0],s=o.reduce((l,u)=>{const d=nD(t,u,i);return l.top=Y1(d.top,l.top),l.right=JI(d.right,l.right),l.bottom=JI(d.bottom,l.bottom),l.left=Y1(d.left,l.left),l},nD(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=ou(n),o=zd(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Xu(n)!=="body"||m4(o))&&(a=v4(n)),ou(n))){const l=Zu(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:ef,getDimensions:tD,getOffsetParent:Qk,getDocumentElement:zd,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:X7e(t,Qk(n),r),floating:{...tD(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>w2(e).direction==="rtl"};function J7e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,d=l||u?[...ef(e)?j3(e):[],...j3(t)]:[];d.forEach(b=>{l&&b.addEventListener("scroll",n,{passive:!0}),u&&b.addEventListener("resize",n)});let p,m=null;if(a){let b=!0;m=new ResizeObserver(()=>{b||n(),b=!1}),ef(e)&&!s&&m.observe(e),m.observe(t)}let y=s?Zu(e):null;return s&&function b(){const w=Zu(e);!y||w.x===y.x&&w.y===y.y&&w.width===y.width&&w.height===y.height||n(),y=w,p=requestAnimationFrame(b)}(),n(),()=>{var b;d.forEach(w=>{l&&w.removeEventListener("scroll",n),u&&w.removeEventListener("resize",n)}),(b=m)==null||b.disconnect(),m=null,s&&cancelAnimationFrame(p)}}const e9e=(e,t,n)=>$7e(e,t,{platform:Q7e,...n});var Jk=typeof document<"u"?S.useLayoutEffect:S.useEffect;function e7(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!e7(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!e7(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function t9e(e){const t=S.useRef(e);return Jk(()=>{t.current=e}),t}function n9e(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=S.useRef(null),a=S.useRef(null),s=t9e(i),l=S.useRef(null),[u,d]=S.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[p,m]=S.useState(t);e7(p==null?void 0:p.map(T=>{let{options:L}=T;return L}),t==null?void 0:t.map(T=>{let{options:L}=T;return L}))||m(t);const y=S.useCallback(()=>{!o.current||!a.current||e9e(o.current,a.current,{middleware:p,placement:n,strategy:r}).then(T=>{b.current&&Xs.flushSync(()=>{d(T)})})},[p,n,r]);Jk(()=>{b.current&&y()},[y]);const b=S.useRef(!1);Jk(()=>(b.current=!0,()=>{b.current=!1}),[]);const w=S.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const T=s.current(o.current,a.current,y);l.current=T}else y()},[y,s]),E=S.useCallback(T=>{o.current=T,w()},[w]),_=S.useCallback(T=>{a.current=T,w()},[w]),k=S.useMemo(()=>({reference:o,floating:a}),[]);return S.useMemo(()=>({...u,update:y,refs:k,reference:E,floating:_}),[u,y,k,E,_])}const r9e=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?KI({element:t.current,padding:n}).fn(i):{}:t?KI({element:t,padding:n}).fn(i):{}}}};function i9e(e){const[t,n]=S.useState(void 0);return Pd(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const AG="Popper",[KE,OG]=x2(AG),[o9e,RG]=KE(AG),a9e=e=>{const{__scopePopper:t,children:n}=e,[r,i]=S.useState(null);return S.createElement(o9e,{scope:t,anchor:r,onAnchorChange:i},n)},s9e="PopperAnchor",l9e=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=RG(s9e,n),a=S.useRef(null),s=ds(t,a);return S.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:S.createElement(sc.div,pn({},i,{ref:s}))}),N3="PopperContent",[u9e,FNe]=KE(N3),[c9e,d9e]=KE(N3,{hasParent:!1,positionUpdateFns:new Set}),f9e=S.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:d,side:p="bottom",sideOffset:m=0,align:y="center",alignOffset:b=0,arrowPadding:w=0,collisionBoundary:E=[],collisionPadding:_=0,sticky:k="partial",hideWhenDetached:T=!1,avoidCollisions:L=!0,onPlaced:O,...D}=e,I=RG(N3,d),[N,V]=S.useState(null),B=ds(t,Ne=>V(Ne)),[K,ne]=S.useState(null),z=i9e(K),$=(n=z==null?void 0:z.width)!==null&&n!==void 0?n:0,H=(r=z==null?void 0:z.height)!==null&&r!==void 0?r:0,Y=p+(y!=="center"?"-"+y:""),Q=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},q=Array.isArray(E)?E:[E],X=q.length>0,ee={padding:Q,boundary:q.filter(p9e),altBoundary:X},{reference:fe,floating:Ee,strategy:we,x:xe,y:Ae,placement:Se,middlewareData:Qe,update:Ye}=n9e({strategy:"fixed",placement:Y,whileElementsMounted:J7e,middleware:[g9e(),U7e({mainAxis:m+H,alignmentAxis:b}),L?G7e({mainAxis:!0,crossAxis:!1,limiter:k==="partial"?q7e():void 0,...ee}):void 0,K?r9e({element:K,padding:w}):void 0,L?W7e({...ee}):void 0,K7e({...ee,apply:({elements:Ne,availableWidth:Ue,availableHeight:be})=>{Ne.floating.style.setProperty("--radix-popper-available-width",`${Ue}px`),Ne.floating.style.setProperty("--radix-popper-available-height",`${be}px`)}}),m9e({arrowWidth:$,arrowHeight:H}),T?V7e({strategy:"referenceHidden"}):void 0].filter(h9e)});Pd(()=>{fe(I.anchor)},[fe,I.anchor]);const nt=xe!==null&&Ae!==null,[vt,Ce]=IG(Se),et=Js(O);Pd(()=>{nt&&(et==null||et())},[nt,et]);const yt=(i=Qe.arrow)===null||i===void 0?void 0:i.x,ze=(o=Qe.arrow)===null||o===void 0?void 0:o.y,at=((a=Qe.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[jt,gt]=S.useState();Pd(()=>{N&>(window.getComputedStyle(N).zIndex)},[N]);const{hasParent:Jt,positionUpdateFns:on}=d9e(N3,d),se=!Jt;S.useLayoutEffect(()=>{if(!se)return on.add(Ye),()=>{on.delete(Ye)}},[se,on,Ye]),Pd(()=>{se&&nt&&Array.from(on).reverse().forEach(Ne=>requestAnimationFrame(Ne))},[se,nt,on]);const Ie={"data-side":vt,"data-align":Ce,...D,ref:B,style:{...D.style,animation:nt?void 0:"none",opacity:(s=Qe.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return S.createElement("div",{ref:Ee,"data-radix-popper-content-wrapper":"",style:{position:we,left:0,top:0,transform:nt?`translate3d(${Math.round(xe)}px, ${Math.round(Ae)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:jt,["--radix-popper-transform-origin"]:[(l=Qe.transformOrigin)===null||l===void 0?void 0:l.x,(u=Qe.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")},dir:e.dir},S.createElement(u9e,{scope:d,placedSide:vt,onArrowChange:ne,arrowX:yt,arrowY:ze,shouldHideArrow:at},se?S.createElement(c9e,{scope:d,hasParent:!0,positionUpdateFns:on},S.createElement(sc.div,Ie)):S.createElement(sc.div,Ie)))});function h9e(e){return e!==void 0}function p9e(e){return e!==null}const g9e=()=>({name:"anchorCssProperties",fn(e){const{rects:t,elements:n}=e,{width:r,height:i}=t.reference;return n.floating.style.setProperty("--radix-popper-anchor-width",`${r}px`),n.floating.style.setProperty("--radix-popper-anchor-height",`${i}px`),{}}}),m9e=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,p=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=p?0:e.arrowWidth,y=p?0:e.arrowHeight,[b,w]=IG(s),E={start:"0%",center:"50%",end:"100%"}[w],_=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,k=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+y/2;let T="",L="";return b==="bottom"?(T=p?E:`${_}px`,L=`${-y}px`):b==="top"?(T=p?E:`${_}px`,L=`${l.floating.height+y}px`):b==="right"?(T=`${-y}px`,L=p?E:`${k}px`):b==="left"&&(T=`${l.floating.width+y}px`,L=p?E:`${k}px`),{data:{x:T,y:L}}}});function IG(e){const[t,n="center"]=e.split("-");return[t,n]}const v9e=a9e,y9e=l9e,b9e=f9e;function x9e(e,t){return S.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const DG=e=>{const{present:t,children:n}=e,r=S9e(t),i=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),o=ds(r.ref,i.ref);return typeof n=="function"||r.isPresent?S.cloneElement(i,{ref:o}):null};DG.displayName="Presence";function S9e(e){const[t,n]=S.useState(),r=S.useRef({}),i=S.useRef(e),o=S.useRef("none"),a=e?"mounted":"unmounted",[s,l]=x9e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const u=wx(r.current);o.current=s==="mounted"?u:"none"},[s]),Pd(()=>{const u=r.current,d=i.current;if(d!==e){const m=o.current,y=wx(u);e?l("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Pd(()=>{if(t){const u=p=>{const y=wx(r.current).includes(p.animationName);p.target===t&&y&&Xs.flushSync(()=>l("ANIMATION_END"))},d=p=>{p.target===t&&(o.current=wx(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:S.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function wx(e){return(e==null?void 0:e.animationName)||"none"}function w9e({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=C9e({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Js(n),l=S.useCallback(u=>{if(o){const p=typeof u=="function"?u(e):u;p!==e&&s(p)}else i(u)},[o,e,i,s]);return[a,l]}function C9e({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,i=S.useRef(r),o=Js(t);return S.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const o6="rovingFocusGroup.onEntryFocus",_9e={bubbles:!1,cancelable:!0},YE="RovingFocusGroup",[t7,jG,k9e]=yG(YE),[E9e,NG]=x2(YE,[k9e]),[P9e,T9e]=E9e(YE),M9e=S.forwardRef((e,t)=>S.createElement(t7.Provider,{scope:e.__scopeRovingFocusGroup},S.createElement(t7.Slot,{scope:e.__scopeRovingFocusGroup},S.createElement(L9e,pn({},e,{ref:t}))))),L9e=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,p=S.useRef(null),m=ds(t,p),y=bG(o),[b=null,w]=w9e({prop:a,defaultProp:s,onChange:l}),[E,_]=S.useState(!1),k=Js(u),T=jG(n),L=S.useRef(!1),[O,D]=S.useState(0);return S.useEffect(()=>{const I=p.current;if(I)return I.addEventListener(o6,k),()=>I.removeEventListener(o6,k)},[k]),S.createElement(P9e,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:b,onItemFocus:S.useCallback(I=>w(I),[w]),onItemShiftTab:S.useCallback(()=>_(!0),[]),onFocusableItemAdd:S.useCallback(()=>D(I=>I+1),[]),onFocusableItemRemove:S.useCallback(()=>D(I=>I-1),[])},S.createElement(sc.div,pn({tabIndex:E||O===0?-1:0,"data-orientation":r},d,{ref:m,style:{outline:"none",...e.style},onMouseDown:Kn(e.onMouseDown,()=>{L.current=!0}),onFocus:Kn(e.onFocus,I=>{const N=!L.current;if(I.target===I.currentTarget&&N&&!E){const V=new CustomEvent(o6,_9e);if(I.currentTarget.dispatchEvent(V),!V.defaultPrevented){const B=T().filter(H=>H.focusable),K=B.find(H=>H.active),ne=B.find(H=>H.id===b),$=[K,ne,...B].filter(Boolean).map(H=>H.ref.current);$G($)}}L.current=!1}),onBlur:Kn(e.onBlur,()=>_(!1))})))}),A9e="RovingFocusGroupItem",O9e=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...a}=e,s=N7e(),l=o||s,u=T9e(A9e,n),d=u.currentTabStopId===l,p=jG(n),{onFocusableItemAdd:m,onFocusableItemRemove:y}=u;return S.useEffect(()=>{if(r)return m(),()=>y()},[r,m,y]),S.createElement(t7.ItemSlot,{scope:n,id:l,focusable:r,active:i},S.createElement(sc.span,pn({tabIndex:d?0:-1,"data-orientation":u.orientation},a,{ref:t,onMouseDown:Kn(e.onMouseDown,b=>{r?u.onItemFocus(l):b.preventDefault()}),onFocus:Kn(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Kn(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const w=D9e(b,u.orientation,u.dir);if(w!==void 0){b.preventDefault();let _=p().filter(k=>k.focusable).map(k=>k.ref.current);if(w==="last")_.reverse();else if(w==="prev"||w==="next"){w==="prev"&&_.reverse();const k=_.indexOf(b.currentTarget);_=u.loop?j9e(_,k+1):_.slice(k+1)}setTimeout(()=>$G(_))}})})))}),R9e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function I9e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function D9e(e,t,n){const r=I9e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return R9e[r]}function $G(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function j9e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const N9e=M9e,$9e=O9e,F9e=["Enter"," "],B9e=["ArrowDown","PageUp","Home"],FG=["ArrowUp","PageDown","End"],z9e=[...B9e,...FG],y4="Menu",[n7,H9e,W9e]=yG(y4),[mp,BG]=x2(y4,[W9e,OG,NG]),XE=OG(),zG=NG(),[V9e,b4]=mp(y4),[U9e,ZE]=mp(y4),G9e=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=XE(t),[l,u]=S.useState(null),d=S.useRef(!1),p=Js(o),m=bG(i);return S.useEffect(()=>{const y=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),S.createElement(v9e,s,S.createElement(V9e,{scope:t,open:n,onOpenChange:p,content:l,onContentChange:u},S.createElement(U9e,{scope:t,onClose:S.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:m,modal:a},r)))},q9e=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=XE(n);return S.createElement(y9e,pn({},i,r,{ref:t}))}),K9e="MenuPortal",[BNe,Y9e]=mp(K9e,{forceMount:void 0}),Hd="MenuContent",[X9e,HG]=mp(Hd),Z9e=S.forwardRef((e,t)=>{const n=Y9e(Hd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=b4(Hd,e.__scopeMenu),a=ZE(Hd,e.__scopeMenu);return S.createElement(n7.Provider,{scope:e.__scopeMenu},S.createElement(DG,{present:r||o.open},S.createElement(n7.Slot,{scope:e.__scopeMenu},a.modal?S.createElement(Q9e,pn({},i,{ref:t})):S.createElement(J9e,pn({},i,{ref:t})))))}),Q9e=S.forwardRef((e,t)=>{const n=b4(Hd,e.__scopeMenu),r=S.useRef(null),i=ds(t,r);return S.useEffect(()=>{const o=r.current;if(o)return AH(o)},[]),S.createElement(WG,pn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Kn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),J9e=S.forwardRef((e,t)=>{const n=b4(Hd,e.__scopeMenu);return S.createElement(WG,pn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),WG=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:y,disableOutsideScroll:b,...w}=e,E=b4(Hd,n),_=ZE(Hd,n),k=XE(n),T=zG(n),L=H9e(n),[O,D]=S.useState(null),I=S.useRef(null),N=ds(t,I,E.onContentChange),V=S.useRef(0),B=S.useRef(""),K=S.useRef(0),ne=S.useRef(null),z=S.useRef("right"),$=S.useRef(0),H=b?$H:S.Fragment,Y=b?{as:By,allowPinchZoom:!0}:void 0,Q=X=>{var ee,fe;const Ee=B.current+X,we=L().filter(nt=>!nt.disabled),xe=document.activeElement,Ae=(ee=we.find(nt=>nt.ref.current===xe))===null||ee===void 0?void 0:ee.textValue,Se=we.map(nt=>nt.textValue),Qe=l8e(Se,Ee,Ae),Ye=(fe=we.find(nt=>nt.textValue===Qe))===null||fe===void 0?void 0:fe.ref.current;(function nt(vt){B.current=vt,window.clearTimeout(V.current),vt!==""&&(V.current=window.setTimeout(()=>nt(""),1e3))})(Ee),Ye&&setTimeout(()=>Ye.focus())};S.useEffect(()=>()=>window.clearTimeout(V.current),[]),P7e();const q=S.useCallback(X=>{var ee,fe;return z.current===((ee=ne.current)===null||ee===void 0?void 0:ee.side)&&c8e(X,(fe=ne.current)===null||fe===void 0?void 0:fe.area)},[]);return S.createElement(X9e,{scope:n,searchRef:B,onItemEnter:S.useCallback(X=>{q(X)&&X.preventDefault()},[q]),onItemLeave:S.useCallback(X=>{var ee;q(X)||((ee=I.current)===null||ee===void 0||ee.focus(),D(null))},[q]),onTriggerLeave:S.useCallback(X=>{q(X)&&X.preventDefault()},[q]),pointerGraceTimerRef:K,onPointerGraceIntentChange:S.useCallback(X=>{ne.current=X},[])},S.createElement(H,Y,S.createElement(T7e,{asChild:!0,trapped:i,onMountAutoFocus:Kn(o,X=>{var ee;X.preventDefault(),(ee=I.current)===null||ee===void 0||ee.focus()}),onUnmountAutoFocus:a},S.createElement(_7e,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:y},S.createElement(N9e,pn({asChild:!0},T,{dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:D,onEntryFocus:Kn(l,X=>{_.isUsingKeyboardRef.current||X.preventDefault()})}),S.createElement(b9e,pn({role:"menu","aria-orientation":"vertical","data-state":o8e(E.open),"data-radix-menu-content":"",dir:_.dir},k,w,{ref:N,style:{outline:"none",...w.style},onKeyDown:Kn(w.onKeyDown,X=>{const fe=X.target.closest("[data-radix-menu-content]")===X.currentTarget,Ee=X.ctrlKey||X.altKey||X.metaKey,we=X.key.length===1;fe&&(X.key==="Tab"&&X.preventDefault(),!Ee&&we&&Q(X.key));const xe=I.current;if(X.target!==xe||!z9e.includes(X.key))return;X.preventDefault();const Se=L().filter(Qe=>!Qe.disabled).map(Qe=>Qe.ref.current);FG.includes(X.key)&&Se.reverse(),a8e(Se)}),onBlur:Kn(e.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(V.current),B.current="")}),onPointerMove:Kn(e.onPointerMove,i7(X=>{const ee=X.target,fe=$.current!==X.clientX;if(X.currentTarget.contains(ee)&&fe){const Ee=X.clientX>$.current?"right":"left";z.current=Ee,$.current=X.clientX}}))})))))))}),r7="MenuItem",rD="menu.itemSelect",e8e=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=S.useRef(null),a=ZE(r7,e.__scopeMenu),s=HG(r7,e.__scopeMenu),l=ds(t,o),u=S.useRef(!1),d=()=>{const p=o.current;if(!n&&p){const m=new CustomEvent(rD,{bubbles:!0,cancelable:!0});p.addEventListener(rD,y=>r==null?void 0:r(y),{once:!0}),vG(p,m),m.defaultPrevented?u.current=!1:a.onClose()}};return S.createElement(t8e,pn({},i,{ref:l,disabled:n,onClick:Kn(e.onClick,d),onPointerDown:p=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,p),u.current=!0},onPointerUp:Kn(e.onPointerUp,p=>{var m;u.current||(m=p.currentTarget)===null||m===void 0||m.click()}),onKeyDown:Kn(e.onKeyDown,p=>{const m=s.searchRef.current!=="";n||m&&p.key===" "||F9e.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})}))}),t8e=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=HG(r7,n),s=zG(n),l=S.useRef(null),u=ds(t,l),[d,p]=S.useState(!1),[m,y]=S.useState("");return S.useEffect(()=>{const b=l.current;if(b){var w;y(((w=b.textContent)!==null&&w!==void 0?w:"").trim())}},[o.children]),S.createElement(n7.ItemSlot,{scope:n,disabled:r,textValue:i??m},S.createElement($9e,pn({asChild:!0},s,{focusable:!r}),S.createElement(sc.div,pn({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:Kn(e.onPointerMove,i7(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:Kn(e.onPointerLeave,i7(b=>a.onItemLeave(b))),onFocus:Kn(e.onFocus,()=>p(!0)),onBlur:Kn(e.onBlur,()=>p(!1))}))))}),n8e="MenuRadioGroup";mp(n8e,{value:void 0,onValueChange:()=>{}});const r8e="MenuItemIndicator";mp(r8e,{checked:!1});const i8e="MenuSub";mp(i8e);function o8e(e){return e?"open":"closed"}function a8e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function s8e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function l8e(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=s8e(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function u8e(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(u-s)*(r-l)/(d-l)+s&&(i=!i)}return i}function c8e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return u8e(n,t)}function i7(e){return t=>t.pointerType==="mouse"?e(t):void 0}const d8e=G9e,f8e=q9e,h8e=Z9e,p8e=e8e,VG="ContextMenu",[g8e,zNe]=x2(VG,[BG]),x4=BG(),[m8e,UG]=g8e(VG),v8e=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=S.useState(!1),l=x4(t),u=Js(r),d=S.useCallback(p=>{s(p),u(p)},[u]);return S.createElement(m8e,{scope:t,open:a,onOpenChange:d,modal:o},S.createElement(d8e,pn({},l,{dir:i,open:a,onOpenChange:d,modal:o}),n))},y8e="ContextMenuTrigger",b8e=S.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=e,o=UG(y8e,n),a=x4(n),s=S.useRef({x:0,y:0}),l=S.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),u=S.useRef(0),d=S.useCallback(()=>window.clearTimeout(u.current),[]),p=m=>{s.current={x:m.clientX,y:m.clientY},o.onOpenChange(!0)};return S.useEffect(()=>d,[d]),S.useEffect(()=>void(r&&d()),[r,d]),S.createElement(S.Fragment,null,S.createElement(f8e,pn({},a,{virtualRef:l})),S.createElement(sc.span,pn({"data-state":o.open?"open":"closed","data-disabled":r?"":void 0},i,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Kn(e.onContextMenu,m=>{d(),p(m),m.preventDefault()}),onPointerDown:r?e.onPointerDown:Kn(e.onPointerDown,Cx(m=>{d(),u.current=window.setTimeout(()=>p(m),700)})),onPointerMove:r?e.onPointerMove:Kn(e.onPointerMove,Cx(d)),onPointerCancel:r?e.onPointerCancel:Kn(e.onPointerCancel,Cx(d)),onPointerUp:r?e.onPointerUp:Kn(e.onPointerUp,Cx(d))})))}),x8e="ContextMenuContent",S8e=S.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=UG(x8e,n),o=x4(n),a=S.useRef(!1);return S.createElement(h8e,pn({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),w8e=S.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=x4(n);return S.createElement(p8e,pn({},i,r,{ref:t}))});function Cx(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const C8e=v8e,_8e=b8e,k8e=S8e,ud=w8e,E8e=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,GG=S.memo(e=>{var ne,z,$,H,Y,Q,q,X;const t=Le(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,shouldUseSingleGalleryColumn:a}=le(Nke),{image:s,isSelected:l}=e,{url:u,thumbnail:d,uuid:p,metadata:m}=s,[y,b]=S.useState(!1),w=s2(),{t:E}=De(),_=()=>b(!0),k=()=>b(!1),T=()=>{var ee,fe;if(s.metadata){const[Ee,we]=xE((fe=(ee=s.metadata)==null?void 0:ee.image)==null?void 0:fe.prompt);Ee&&t(a4(Ee)),t(Dy(we||""))}w({title:E("toast.promptSet"),status:"success",duration:2500,isClosable:!0})},L=()=>{s.metadata&&t(g2(s.metadata.image.seed)),w({title:E("toast.seedSet"),status:"success",duration:2500,isClosable:!0})},O=()=>{t(v0(s)),n!=="img2img"&&t(Wo("img2img")),w({title:E("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},D=()=>{t(o4(s)),t(i4()),n!=="unifiedCanvas"&&t(Wo("unifiedCanvas")),w({title:E("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},I=()=>{m&&t(aV(m)),w({title:E("toast.parametersSet"),status:"success",duration:2500,isClosable:!0})},N=async()=>{var ee;if((ee=m==null?void 0:m.image)!=null&&ee.init_image_path&&(await fetch(m.image.init_image_path)).ok){t(Wo("img2img")),t(D3e(m)),w({title:E("toast.initialImageSet"),status:"success",duration:2500,isClosable:!0});return}w({title:E("toast.initialImageNotSet"),description:E("toast.initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},V=()=>t(QO(s)),B=ee=>{ee.dataTransfer.setData("invokeai/imageUuid",p),ee.dataTransfer.effectAllowed="move"},K=()=>{t(QO(s))};return g.jsxs(C8e,{onOpenChange:ee=>{t(tV(ee))},children:[g.jsx(_8e,{children:g.jsxs(ao,{position:"relative",className:"hoverable-image",onMouseOver:_,onMouseOut:k,userSelect:"none",draggable:!0,onDragStart:B,children:[g.jsx(Nw,{className:"hoverable-image-image",objectFit:a?"contain":r,rounded:"md",src:d||u,loading:"lazy"}),g.jsx("div",{className:"hoverable-image-content",onClick:V,children:l&&g.jsx(Da,{width:"50%",height:"50%",as:FE,className:"hoverable-image-check"})}),y&&i>=64&&g.jsx("div",{className:"hoverable-image-delete-button",children:g.jsx(O3,{image:s,children:g.jsx(ls,{"aria-label":E("parameters.deleteImage"),icon:g.jsx(Rke,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},p)}),g.jsxs(k8e,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:ee=>{ee.detail.originalEvent.preventDefault()},children:[g.jsx(ud,{onClickCapture:K,children:E("parameters.openInViewer")}),g.jsx(ud,{onClickCapture:T,disabled:((z=(ne=s==null?void 0:s.metadata)==null?void 0:ne.image)==null?void 0:z.prompt)===void 0,children:E("parameters.usePrompt")}),g.jsx(ud,{onClickCapture:L,disabled:((H=($=s==null?void 0:s.metadata)==null?void 0:$.image)==null?void 0:H.seed)===void 0,children:E("parameters.useSeed")}),g.jsx(ud,{onClickCapture:I,disabled:!["txt2img","img2img"].includes((Q=(Y=s==null?void 0:s.metadata)==null?void 0:Y.image)==null?void 0:Q.type),children:E("parameters.useAll")}),g.jsx(ud,{onClickCapture:N,disabled:((X=(q=s==null?void 0:s.metadata)==null?void 0:q.image)==null?void 0:X.type)!=="img2img",children:E("parameters.useInitImg")}),g.jsx(ud,{onClickCapture:O,children:E("parameters.sendToImg2Img")}),g.jsx(ud,{onClickCapture:D,children:E("parameters.sendToUnifiedCanvas")}),g.jsx(ud,{"data-warning":!0,children:g.jsx(O3,{image:s,children:g.jsx("p",{children:E("parameters.deleteImage")})})})]})]})},E8e);GG.displayName="HoverableImage";const _x=320,iD=40,P8e={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},oD=400;function qG(){const e=Le(),{t}=De(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,areMoreImagesAvailable:b,galleryWidth:w,isLightboxOpen:E,isStaging:_,shouldEnableResize:k,shouldUseSingleGalleryColumn:T}=le(jke),{galleryMinWidth:L,galleryMaxWidth:O}=E?{galleryMinWidth:oD,galleryMaxWidth:oD}:P8e[d],[D,I]=S.useState(w>=_x),[N,V]=S.useState(!1),[B,K]=S.useState(0),ne=S.useRef(null),z=S.useRef(null),$=S.useRef(null);S.useEffect(()=>{w>=_x&&I(!1)},[w]);const H=()=>{e(w3e(!o)),e(Li(!0))},Y=()=>{a?q():Q()},Q=()=>{e(Am(!0)),o&&e(Li(!0))},q=S.useCallback(()=>{e(Am(!1)),e(tV(!1)),e(C3e(z.current?z.current.scrollTop:0)),setTimeout(()=>o&&e(Li(!0)),400)},[e,o]),X=()=>{e(Gk(r))},ee=xe=>{e(Uv(xe))},fe=()=>{m||($.current=window.setTimeout(()=>q(),500))},Ee=()=>{$.current&&window.clearTimeout($.current)};Ze("g",()=>{Y()},[a,o]),Ze("left",()=>{e(bE())},{enabled:!_||d!=="unifiedCanvas"},[_]),Ze("right",()=>{e(yE())},{enabled:!_||d!=="unifiedCanvas"},[_]),Ze("shift+g",()=>{H()},[o]),Ze("esc",()=>{e(Am(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const we=32;return Ze("shift+up",()=>{if(l<256){const xe=Te.clamp(l+we,32,256);e(Uv(xe))}},[l]),Ze("shift+down",()=>{if(l>32){const xe=Te.clamp(l-we,32,256);e(Uv(xe))}},[l]),S.useEffect(()=>{z.current&&(z.current.scrollTop=s)},[s,a]),S.useEffect(()=>{function xe(Ae){!o&&ne.current&&!ne.current.contains(Ae.target)&&q()}return document.addEventListener("mousedown",xe),()=>{document.removeEventListener("mousedown",xe)}},[q,o]),g.jsx(gG,{nodeRef:ne,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:g.jsxs("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:ne,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:Ee,onMouseOver:o?void 0:Ee,children:[g.jsxs(uG,{minWidth:L,maxWidth:o?O:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:k},size:{width:w,height:o?"100%":"100vh"},onResizeStart:(xe,Ae,Se)=>{K(Se.clientHeight),Se.style.height=`${Se.clientHeight}px`,o&&(Se.style.position="fixed",Se.style.right="1rem",V(!0))},onResizeStop:(xe,Ae,Se,Qe)=>{const Ye=o?Te.clamp(Number(w)+Qe.width,L,Number(O)):Number(w)+Qe.width;e(E3e(Ye)),Se.removeAttribute("data-resize-alert"),o&&(Se.style.position="relative",Se.style.removeProperty("right"),Se.style.setProperty("height",o?"100%":"100vh"),V(!1),e(Li(!0)))},onResize:(xe,Ae,Se,Qe)=>{const Ye=Te.clamp(Number(w)+Qe.width,L,Number(o?O:.95*window.innerWidth));Ye>=_x&&!D?I(!0):Ye<_x&&D&&I(!1),l>Ye-iD&&e(Uv(Ye-iD)),o&&(Ye>=O?Se.setAttribute("data-resize-alert","true"):Se.removeAttribute("data-resize-alert")),Se.style.height=`${B}px`},children:[g.jsxs("div",{className:"image-gallery-header",children:[g.jsx(Gi,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:D?g.jsxs(g.Fragment,{children:[g.jsx(On,{size:"sm","data-selected":r==="result",onClick:()=>e(tx("result")),children:t("gallery.generations")}),g.jsx(On,{size:"sm","data-selected":r==="user",onClick:()=>e(tx("user")),children:t("gallery.uploads")})]}):g.jsxs(g.Fragment,{children:[g.jsx(Ke,{"aria-label":t("gallery.showGenerations"),tooltip:t("gallery.showGenerations"),"data-selected":r==="result",icon:g.jsx(Ske,{}),onClick:()=>e(tx("result"))}),g.jsx(Ke,{"aria-label":t("gallery.showUploads"),tooltip:t("gallery.showUploads"),"data-selected":r==="user",icon:g.jsx(Dke,{}),onClick:()=>e(tx("user"))})]})}),g.jsxs("div",{className:"image-gallery-header-right-icons",children:[g.jsx(Ys,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:g.jsx(Ke,{size:"sm","aria-label":t("gallery.gallerySettings"),icon:g.jsx(WE,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:g.jsxs("div",{className:"image-gallery-settings-popover",children:[g.jsxs("div",{children:[g.jsx(Dn,{value:l,onChange:ee,min:32,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize")}),g.jsx(Ke,{size:"sm","aria-label":t("gallery.galleryImageResetSize"),tooltip:t("gallery.galleryImageResetSize"),onClick:()=>e(Uv(64)),icon:g.jsx(p4,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),g.jsx("div",{children:g.jsx(Gn,{label:t("gallery.maintainAspectRatio"),isChecked:p==="contain",onChange:()=>e(_3e(p==="contain"?"cover":"contain"))})}),g.jsx("div",{children:g.jsx(Gn,{label:t("gallery.autoSwitchNewImages"),isChecked:y,onChange:xe=>e(k3e(xe.target.checked))})}),g.jsx("div",{children:g.jsx(Gn,{label:t("gallery.singleColumnLayout"),isChecked:T,onChange:xe=>e(P3e(xe.target.checked))})})]})}),g.jsx(Ke,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery.pinGallery"),tooltip:`${t("gallery.pinGallery")} (Shift+G)`,onClick:H,icon:o?g.jsx(cG,{}):g.jsx(dG,{})})]})]}),g.jsx("div",{className:"image-gallery-container",ref:z,children:n.length||b?g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(xe=>{const{uuid:Ae}=xe,Se=i===Ae;return g.jsx(GG,{image:xe,isSelected:Se},Ae)})}),g.jsx(ss,{onClick:X,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery.loadMore":"gallery.allImagesLoaded")})]}):g.jsxs("div",{className:"image-gallery-container-placeholder",children:[g.jsx(fG,{}),g.jsx("p",{children:t("gallery.noImagesInGallery")})]})})]}),N&&g.jsx("div",{style:{width:`${w}px`,height:"100%"}})]})})}var ns=function(e,t){return Number(e.toFixed(t))},T8e=function(e,t){return typeof e=="number"?e:t},mr=function(e,t,n){n&&typeof n=="function"&&n(e,t)},M8e=function(e){return-Math.cos(e*Math.PI)/2+.5},L8e=function(e){return e},A8e=function(e){return e*e},O8e=function(e){return e*(2-e)},R8e=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},I8e=function(e){return e*e*e},D8e=function(e){return--e*e*e+1},j8e=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},N8e=function(e){return e*e*e*e},$8e=function(e){return 1- --e*e*e*e},F8e=function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},B8e=function(e){return e*e*e*e*e},z8e=function(e){return 1+--e*e*e*e*e},H8e=function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},KG={easeOut:M8e,linear:L8e,easeInQuad:A8e,easeOutQuad:O8e,easeInOutQuad:R8e,easeInCubic:I8e,easeOutCubic:D8e,easeInOutCubic:j8e,easeInQuart:N8e,easeOutQuart:$8e,easeInOutQuart:F8e,easeInQuint:B8e,easeOutQuint:z8e,easeInOutQuint:H8e},YG=function(e){typeof e=="number"&&cancelAnimationFrame(e)},Fl=function(e){e.mounted&&(YG(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function XG(e,t,n,r){if(e.mounted){var i=new Date().getTime(),o=1;Fl(e),e.animation=function(){if(!e.mounted)return YG(e.animation);var a=new Date().getTime()-i,s=a/n,l=KG[t],u=l(s);a>=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function W8e(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function ff(e,t,n,r){var i=W8e(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=t.scale-s,p=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):XG(e,r,n,function(y){var b=s+d*y,w=l+p*y,E=u+m*y;o(b,w,E)})}}function V8e(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,d=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:d}}var U8e=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,d=s,p=r-i-l,m=l;return{minPositionX:u,maxPositionX:d,minPositionY:p,maxPositionY:m}},QE=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=V8e(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,d=o.newContentHeight,p=o.newDiffHeight,m=U8e(a,l,u,s,d,p,Boolean(i));return m},o7=function(e,t,n,r){return r?en?ns(n,2):ns(e,2):ns(e,2)},e0=function(e,t){var n=QE(e,t);return e.bounds=n,n};function S4(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,d=n.maxPositionY,p=0,m=0;a&&(p=i,m=o);var y=o7(e,s-p,u+p,r),b=o7(t,l-m,d+m,r);return{x:y,y:b}}function w4(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var p=l-t*d,m=u-n*d,y=S4(p,m,i,o,0,0,null);return y}function C2(e,t,n,r,i){var o=i?r:0,a=t-o;return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=a?a:e}var aD=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=C4(o,n);return!l},sD=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},G8e=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},q8e=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function K8e(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var d=e.bounds,p=d.maxPositionX,m=d.minPositionX,y=d.maxPositionY,b=d.minPositionY,w=n>p||ny||rp?u.offsetWidth:e.setup.minPositionX||0,k=r>y?u.offsetHeight:e.setup.minPositionY||0,T=w4(e,_,k,i,e.bounds,s||l),L=T.x,O=T.y;return{scale:i,positionX:w?L:n,positionY:E?O:r}}}function Y8e(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,d=l.positionX,p=l.positionY;if(!(a===null||s===null||t===d&&n===p)){var m=S4(t,n,s,o,r,i,a),y=m.x,b=m.y;e.setTransformState(u,y,b)}}var X8e=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var d=t-r.x,p=n-r.y,m=a?l:d,y=s?u:p;return{x:m,y}},$3=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale,a=n.disablePadding;return t>0&&i>=o&&!a?t:0},Z8e=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},Q8e=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function J8e(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function lD(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var d=a+(e-a)*u;return d>l?l:do?o:d}}return r?t:o7(e,o,a,i)}function eEe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function tEe(e,t){var n=Z8e(e);if(n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=eEe(a,s),d=t.x-r.x,p=t.y-r.y,m=d/u,y=p/u,b=l-i,w=d*d+p*p,E=Math.sqrt(w)/b;e.velocity={velocityX:m,velocityY:y,total:E}}e.lastMousePosition=t,e.velocityTime=l}}function nEe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=Q8e(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,d=n.minPositionX,p=n.maxPositionY,m=n.minPositionY,y=r.limitToBounds,b=r.alignmentAnimation,w=r.zoomAnimation,E=r.panning,_=E.lockAxisY,k=E.lockAxisX,T=w.animationType,L=b.sizeX,O=b.sizeY,D=b.velocityAlignmentTime,I=D,N=J8e(e,l),V=Math.max(N,I),B=$3(e,L),K=$3(e,O),ne=B*i.offsetWidth/100,z=K*i.offsetHeight/100,$=u+ne,H=d-ne,Y=p+z,Q=m-z,q=e.transformState,X=new Date().getTime();XG(e,T,V,function(ee){var fe=e.transformState,Ee=fe.scale,we=fe.positionX,xe=fe.positionY,Ae=new Date().getTime()-X,Se=Ae/I,Qe=KG[b.animationType],Ye=1-Qe(Math.min(1,Se)),nt=1-ee,vt=we+a*nt,Ce=xe+s*nt,et=lD(vt,q.positionX,we,k,y,d,u,H,$,Ye),yt=lD(Ce,q.positionY,xe,_,y,m,p,Q,Y,Ye);(we!==vt||xe!==Ce)&&e.setTransformState(Ee,et,yt)})}}function uD(e,t){var n=e.transformState.scale;Fl(e),e0(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?q8e(e,t):G8e(e,t)}function ZG(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,d=o||t.1&&p;m?nEe(e):ZG(e)}}function JE(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=C2(ns(t,2),o,a,0,!1),u=e0(e,l),d=w4(e,n,r,l,u,s),p=d.x,m=d.y;return{scale:l,positionX:p,positionY:m}}function QG(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.minScale,s=o.limitToBounds,l=o.zoomAnimation,u=l.disabled,d=l.animationTime,p=l.animationType,m=u||r>=a;if((r>=1||s)&&ZG(e),!(m||!i||!e.mounted)){var y=t||i.offsetWidth/2,b=n||i.offsetHeight/2,w=JE(e,a,y,b);w&&ff(e,w,d,p)}}var Wd=function(){return Wd=Object.assign||function(t){for(var n,r=1,i=arguments.length;ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},bEe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=C4(a,i);return!l},xEe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},SEe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=ns(i[0].clientX-r.left,5),a=ns(i[0].clientY-r.top,5),s=ns(i[1].clientX-r.left,5),l=ns(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},oq=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},wEe=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=i.disablePadding,u=s.size,d=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var p=t/r,m=p*n;return C2(ns(m,2),a,o,u,!d&&!l)},CEe=160,_Ee=100,kEe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Fl(e),mr(Vn(e),t,r),mr(Vn(e),t,i))},EEe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,d=a.centerZoomedOut,p=a.zoomAnimation,m=a.wheel,y=a.disablePadding,b=p.size,w=p.disabled,E=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var _=mEe(t,null),k=vEe(e,_,E,!t.ctrlKey);if(l!==k){var T=e0(e,k),L=iq(t,o,l),O=w||b===0||d||y,D=u&&O,I=w4(e,L.x,L.y,k,T,D),N=I.x,V=I.y;e.previousWheelEvent=t,e.setTransformState(k,N,V),mr(Vn(e),t,r),mr(Vn(e),t,i)}},PEe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;a7(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(QG(e,t.x,t.y),e.wheelAnimationTimer=null)},_Ee);var o=yEe(e,t);o&&(a7(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,mr(Vn(e),t,r),mr(Vn(e),t,i))},CEe))},TEe=function(e,t){var n=oq(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Fl(e)},MEe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,d=l.size;if(!(r===null||!n)){var p=SEe(t,i,n);if(!(!Number.isFinite(p.x)||!Number.isFinite(p.y))){var m=oq(t),y=wEe(e,m);if(y!==i){var b=e0(e,y),w=u||d===0||s,E=a&&w,_=w4(e,p.x,p.y,y,b,E),k=_.x,T=_.y;e.pinchMidpoint=p,e.lastDistance=m,e.setTransformState(y,k,T)}}}},LEe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,QG(e,t==null?void 0:t.x,t==null?void 0:t.y)},aq=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;a7(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,mr(Vn(e),t,n)},r)},AEe=function(e,t){var n=e.props,r=n.onZoomStart,i=n.onZoom,o=e.setup.doubleClick,a=o.animationTime,s=o.animationType;mr(Vn(e),t,r),nq(e,a,s,function(){return mr(Vn(e),t,i)}),aq(e,t)};function OEe(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,i=e.transformState,o=e.contentComponent,a=i.scale,s=e.props,l=s.onZoomStart,u=s.onZoom,d=n.doubleClick,p=d.disabled,m=d.mode,y=d.step,b=d.animationTime,w=d.animationType;if(!p&&!r){if(m==="reset")return AEe(e,t);if(!o)return console.error("No ContentComponent found");var E=m==="zoomOut"?-1:1,_=eq(e,E,y);if(a!==_){mr(Vn(e),t,l);var k=iq(t,o,a),T=JE(e,_,k.x,k.y);if(!T)return console.error("Error during zoom event. New transformation state was not calculated.");mr(Vn(e),t,u),ff(e,T,b,w),aq(e,t)}}}var REe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),d=n&&l&&u&&!a;if(!d)return!1;var p=C4(l,s);return!p},IEe=function(){function e(t){var n=this;this.mounted=!0,this.onChangeCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){n.initializeWindowEvents()},this.unmount=function(){n.cleanupWindowEvents()},this.update=function(r){e0(n,n.transformState.scale),n.setup=fD(r)},this.initializeWindowEvents=function(){var r,i=s6(),o=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,a=o==null?void 0:o.defaultView;a==null||a.addEventListener("mousedown",n.onPanningStart,i),a==null||a.addEventListener("mousemove",n.onPanning,i),a==null||a.addEventListener("mouseup",n.onPanningStop,i),o==null||o.addEventListener("mouseleave",n.clearPanning,i),a==null||a.addEventListener("keyup",n.setKeyUnPressed,i),a==null||a.addEventListener("keydown",n.setKeyPressed,i)},this.cleanupWindowEvents=function(){var r,i,o=s6(),a=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,s=a==null?void 0:a.defaultView;s==null||s.removeEventListener("mousedown",n.onPanningStart,o),s==null||s.removeEventListener("mousemove",n.onPanning,o),s==null||s.removeEventListener("mouseup",n.onPanningStop,o),a==null||a.removeEventListener("mouseleave",n.clearPanning,o),s==null||s.removeEventListener("keyup",n.setKeyUnPressed,o),s==null||s.removeEventListener("keydown",n.setKeyPressed,o),document.removeEventListener("mouseleave",n.clearPanning,o),Fl(n),(i=n.observer)===null||i===void 0||i.disconnect()},this.handleInitializeWrapperEvents=function(r){var i=s6();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},this.handleInitialize=function(r){var i=n.setup.centerOnInit;n.applyTransformation(),i&&(n.setCenter(),n.observer=new ResizeObserver(function(){var o;n.setCenter(),(o=n.observer)===null||o===void 0||o.disconnect()}),n.observer.observe(r))},this.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=pEe(n,r);if(o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(kEe(n,r),EEe(n,r),PEe(n,r))}}},this.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=aD(n,r);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),Fl(n),uD(n,r),mr(Vn(n),r,o))}}},this.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=sD(n);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),cD(n,r.clientX,r.clientY),mr(Vn(n),r,o))}}},this.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(rEe(n),mr(Vn(n),r,i))},this.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=bEe(n,r);l&&(TEe(n,r),Fl(n),mr(Vn(n),r,a),mr(Vn(n),r,s))}},this.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=xEe(n);l&&(r.preventDefault(),r.stopPropagation(),MEe(n,r),mr(Vn(n),r,a),mr(Vn(n),r,s))}},this.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(LEe(n),mr(Vn(n),r,o),mr(Vn(n),r,a))},this.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=aD(n,r);if(a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Fl(n);var l=r.touches,u=l.length===1,d=l.length===2;u&&(Fl(n),uD(n,r),mr(Vn(n),r,o)),d&&n.onPinchStart(r)}}}},this.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=sD(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];cD(n,s.clientX,s.clientY),mr(Vn(n),r,o)}else r.touches.length>1&&n.onPinch(r)},this.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},this.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=REe(n,r);o&&OEe(n,r)}},this.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},this.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},this.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},this.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},this.setTransformState=function(r,i,o){var a=n.props.onTransformed;if(!Number.isNaN(r)&&!Number.isNaN(i)&&!Number.isNaN(o)){r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o;var s=Vn(n);n.onChangeCallbacks.forEach(function(l){return l(s)}),mr(s,{scale:r,positionX:i,positionY:o},a),n.applyTransformation()}else console.error("Detected NaN set state values")},this.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=rq(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},this.handleTransformStyles=function(r,i,o){return n.props.customTransform?n.props.customTransform(r,i,o):fEe(r,i,o)},this.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=n.handleTransformStyles(o,a,i);n.contentComponent.style.transform=s}},this.getContext=function(){return Vn(n)},this.onChange=function(r){return n.onChangeCallbacks.has(r)||n.onChangeCallbacks.add(r),function(){n.onChangeCallbacks.delete(r)}},this.init=function(r,i){n.cleanupWindowEvents(),n.wrapperComponent=r,n.contentComponent=i,e0(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(i),n.initializeWindowEvents(),n.isInitialized=!0,mr(Vn(n),void 0,n.props.onInit)},this.props=t,this.setup=fD(this.props),this.transformState=JG(this.props)}return e}(),eP=qe.createContext(null),DEe=function(e,t){return typeof e=="function"?e(t):e},jEe=qe.forwardRef(function(e,t){var n=S.useState(0),r=n[1],i=e.children,o=S.useRef(new IEe(e)).current,a=DEe(e.children,Vn(o)),s=S.useCallback(function(){typeof i=="function"&&r(function(l){return l+1})},[i]);return S.useImperativeHandle(t,function(){return Vn(o)},[o]),S.useEffect(function(){o.update(e)},[o,e]),S.useEffect(function(){return o.onChange(s)},[o,e,s]),qe.createElement(eP.Provider,{value:o},a)});function NEe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var $Ee=`.transform-component-module_wrapper__7HFJe { +}`;var Vt=xT(function(){return en(W,gt+"return "+Re).apply(n,Z)});if(Vt.source=Re,Z4(Vt))throw Vt;return Vt}function nQ(c){return _n(c).toLowerCase()}function rQ(c){return _n(c).toUpperCase()}function iQ(c,v,C){if(c=_n(c),c&&(C||v===n))return co(c);if(!c||!(v=po(v)))return c;var A=Qi(c),j=Qi(v),W=la(A,j),Z=Cs(A,j)+1;return Ls(A,W,Z).join("")}function oQ(c,v,C){if(c=_n(c),c&&(C||v===n))return c.slice(0,V0(c)+1);if(!c||!(v=po(v)))return c;var A=Qi(c),j=Cs(A,Qi(v))+1;return Ls(A,0,j).join("")}function aQ(c,v,C){if(c=_n(c),c&&(C||v===n))return c.replace(xc,"");if(!c||!(v=po(v)))return c;var A=Qi(c),j=la(A,Qi(v));return Ls(A,j).join("")}function sQ(c,v){var C=B,A=K;if(Cr(v)){var j="separator"in v?v.separator:j;C="length"in v?Ft(v.length):C,A="omission"in v?po(v.omission):A}c=_n(c);var W=c.length;if(bu(c)){var Z=Qi(c);W=Z.length}if(C>=W)return c;var te=C-za(A);if(te<1)return A;var ce=Z?Ls(Z,0,te).join(""):c.slice(0,te);if(j===n)return ce+A;if(Z&&(te+=ce.length-te),Q4(j)){if(c.slice(te).search(j)){var Ce,Ee=ce;for(j.global||(j=If(j.source,_n(bs.exec(j))+"g")),j.lastIndex=0;Ce=j.exec(Ee);)var Re=Ce.index;ce=ce.slice(0,Re===n?te:Re)}}else if(c.indexOf(po(j),te)!=te){var nt=ce.lastIndexOf(j);nt>-1&&(ce=ce.slice(0,nt))}return ce+A}function lQ(c){return c=_n(c),c&&C0.test(c)?c.replace(ys,j2):c}var uQ=_l(function(c,v,C){return c+(C?" ":"")+v.toUpperCase()}),t5=pg("toUpperCase");function bT(c,v,C){return c=_n(c),v=C?n:v,v===n?jp(c)?Rf(c):H0(c):c.match(v)||[]}var xT=Tt(function(c,v){try{return Ii(c,n,v)}catch(C){return Z4(C)?C:new Lt(C)}}),cQ=gr(function(c,v){return Zn(v,function(C){C=kl(C),fa(c,C,Y4(c[C],c))}),c});function dQ(c){var v=c==null?0:c.length,C=Oe();return c=v?Hn(c,function(A){if(typeof A[1]!="function")throw new Di(a);return[C(A[0]),A[1]]}):[],Tt(function(A){for(var j=-1;++jq)return[];var C=fe,A=hi(c,fe);v=Oe(v),c-=fe;for(var j=Lf(A,v);++C0||v<0)?new Yt(C):(c<0?C=C.takeRight(-c):c&&(C=C.drop(c)),v!==n&&(v=Ft(v),C=v<0?C.dropRight(-v):C.take(v-c)),C)},Yt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Yt.prototype.toArray=function(){return this.take(fe)},ga(Yt.prototype,function(c,v){var C=/^(?:filter|find|map|reject)|While$/.test(v),A=/^(?:head|last)$/.test(v),j=F[A?"take"+(v=="last"?"Right":""):v],W=A||/^find/.test(v);j&&(F.prototype[v]=function(){var Z=this.__wrapped__,te=A?[1]:arguments,ce=Z instanceof Yt,Ce=te[0],Ee=ce||$t(Z),Re=function(Xt){var tn=j.apply(F,Ba([Xt],te));return A&&nt?tn[0]:tn};Ee&&C&&typeof Ce=="function"&&Ce.length!=1&&(ce=Ee=!1);var nt=this.__chain__,gt=!!this.__actions__.length,_t=W&&!nt,Vt=ce&&!gt;if(!W&&Ee){Z=Vt?Z:new Yt(this);var kt=c.apply(Z,te);return kt.__actions__.push({func:sb,args:[Re],thisArg:n}),new fo(kt,nt)}return _t&&Vt?c.apply(this,te):(kt=this.thru(Re),_t?A?kt.value()[0]:kt.value():kt)})}),Zn(["pop","push","shift","sort","splice","unshift"],function(c){var v=Ic[c],C=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",A=/^(?:pop|shift)$/.test(c);F.prototype[c]=function(){var j=arguments;if(A&&!this.__chain__){var W=this.value();return v.apply($t(W)?W:[],j)}return this[C](function(Z){return v.apply($t(Z)?Z:[],j)})}}),ga(Yt.prototype,function(c,v){var C=F[v];if(C){var A=C.name+"";an.call(ks,A)||(ks[A]=[]),ks[A].push({name:v,func:C})}}),ks[Qf(n,_).name]=[{name:"wrapper",func:n}],Yt.prototype.clone=Ji,Yt.prototype.reverse=Ni,Yt.prototype.value=V2,F.prototype.at=FY,F.prototype.chain=BY,F.prototype.commit=zY,F.prototype.next=HY,F.prototype.plant=UY,F.prototype.reverse=VY,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=GY,F.prototype.first=F.prototype.head,Fc&&(F.prototype[Fc]=WY),F},Ha=Ro();Kt?((Kt.exports=Ha)._=Ha,Ot._=Ha):St._=Ha}).call(So)})(HSe,Pe);const Pg=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Tg=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},WSe=.999,USe=.1,VSe=20,Uv=.95,XO=30,mk=10,ZO=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),ih=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Hl(s/o,64)):o<1&&(r.height=s,r.width=Hl(s*o,64)),a=r.width*r.height;return r},GSe=e=>({width:Hl(e.width,64),height:Hl(e.height,64)}),jW=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],qSe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],gE=e=>e.kind==="line"&&e.layer==="mask",KSe=e=>e.kind==="line"&&e.layer==="base",S3=e=>e.kind==="image"&&e.layer==="base",YSe=e=>e.kind==="fillRect"&&e.layer==="base",XSe=e=>e.kind==="eraseRect"&&e.layer==="base",ZSe=e=>e.kind==="line",h1={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},QSe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:h1,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},NW=ap({name:"canvas",initialState:QSe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(Pe.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!gE(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Cd(Pe.clamp(n.width,64,512),64),height:Cd(Pe.clamp(n.height,64,512),64)},o={x:Hl(n.width/2-i.width/2,64),y:Hl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=ih(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(Pe.cloneDeep(e.layerState)),e.layerState={...h1,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Tg(r.width,r.height,n.width,n.height,Uv),s=Pg(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=GSe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=ih(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=ZO(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(Pe.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(Pe.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...h1.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(Pe.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(Pe.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(Pe.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(ZSe);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(Pe.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(Pe.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(Pe.cloneDeep(e.layerState)),e.layerState=h1,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(S3),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const d=Tg(i.width,i.height,512,512,Uv),p=Pg(i.width,i.height,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=p,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=ih(m);e.scaledBoundingBoxDimensions=y}return}const{width:o,height:a}=r,l=Tg(t,n,o,a,.95),u=Pg(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=ZO(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(S3)){const i=Tg(r.width,r.height,512,512,Uv),o=Pg(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=ih(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const d=r?1:Tg(i,o,l,u,Uv),p=Pg(i,o,a,s,l,u,d);e.stageScale=d,e.stageCoordinates=p}else{const d=Tg(i,o,512,512,Uv),p=Pg(i,o,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=p,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=ih(m);e.scaledBoundingBoxDimensions=y}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(Pe.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...h1.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Cd(Pe.clamp(o,64,512),64),height:Cd(Pe.clamp(a,64,512),64)},l={x:Hl(o/2-s.width/2,64),y:Hl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=ih(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=ih(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(Pe.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:$W,addFillRect:FW,addImageToStagingArea:JSe,addLine:e3e,addPointToCurrentLine:BW,clearCanvasHistory:zW,clearMask:mE,commitColorPickerColor:t3e,commitStagingAreaImage:n3e,discardStagedImages:r3e,fitBoundingBoxToStage:mNe,mouseLeftCanvas:i3e,nextStagingAreaImage:o3e,prevStagingAreaImage:a3e,redo:s3e,resetCanvas:vE,resetCanvasInteractionState:l3e,resetCanvasView:HW,resizeAndScaleCanvas:i4,resizeCanvas:u3e,setBoundingBoxCoordinates:DC,setBoundingBoxDimensions:p1,setBoundingBoxPreviewFill:vNe,setBoundingBoxScaleMethod:c3e,setBrushColor:Mm,setBrushSize:Lm,setCanvasContainerDimensions:d3e,setColorPickerColor:f3e,setCursorPosition:h3e,setDoesCanvasNeedScaling:Li,setInitialCanvasImage:o4,setIsDrawing:WW,setIsMaskEnabled:p2,setIsMouseOverBoundingBox:Jb,setIsMoveBoundingBoxKeyHeld:yNe,setIsMoveStageKeyHeld:bNe,setIsMovingBoundingBox:jC,setIsMovingStage:w3,setIsTransformingBoundingBox:NC,setLayer:C3,setMaskColor:UW,setMergedCanvas:p3e,setShouldAutoSave:VW,setShouldCropToBoundingBoxOnSave:GW,setShouldDarkenOutsideBoundingBox:qW,setShouldLockBoundingBox:xNe,setShouldPreserveMaskedArea:KW,setShouldShowBoundingBox:g3e,setShouldShowBrush:SNe,setShouldShowBrushPreview:wNe,setShouldShowCanvasDebugInfo:YW,setShouldShowCheckboardTransparency:CNe,setShouldShowGrid:XW,setShouldShowIntermediates:ZW,setShouldShowStagingImage:m3e,setShouldShowStagingOutline:QO,setShouldSnapToGrid:_3,setStageCoordinates:QW,setStageScale:v3e,setTool:Jl,toggleShouldLockBoundingBox:_Ne,toggleTool:kNe,undo:y3e,setScaledBoundingBoxDimensions:ex,setShouldRestrictStrokesToBox:JW}=NW.actions,b3e=NW.reducer,x3e={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},eU=ap({name:"gallery",initialState:x3e,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=Pe.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:sm,clearIntermediateImage:$C,removeImage:tU,setCurrentImage:JO,addGalleryImages:S3e,setIntermediateImage:w3e,selectNextImage:yE,selectPrevImage:bE,setShouldPinGallery:C3e,setShouldShowGallery:Am,setGalleryScrollPosition:_3e,setGalleryImageMinimumWidth:Vv,setGalleryImageObjectFit:k3e,setShouldHoldGalleryOpen:nU,setShouldAutoSwitchToNewImages:E3e,setCurrentCategory:tx,setGalleryWidth:P3e,setShouldUseSingleGalleryColumn:T3e}=eU.actions,M3e=eU.reducer,L3e={isLightboxOpen:!1},A3e=L3e,rU=ap({name:"lightbox",initialState:A3e,reducers:{setIsLightboxOpen:(e,t)=>{e.isLightboxOpen=t.payload}}}),{setIsLightboxOpen:Om}=rU.actions,O3e=rU.reducer,U1=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" ");function xE(e){let t=U1(e),n=null;const r=new RegExp(/\[([^\][]*)]/,"gi"),i=[...t.matchAll(r)].map(o=>o[1]);return i.length&&(n=i.join(" "),i.forEach(o=>{t=t.replace(`[${o}]`,"").replaceAll("[]","").trim()})),[t,n]}const R3e=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return SE(r)?r:!1},SE=e=>Boolean(typeof e=="string"?R3e(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),k3=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),I3e=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0],10),parseFloat(r[1])]),iU={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512,shouldUseSymmetry:!1,horizontalSymmetryTimePercentage:0,verticalSymmetryTimePercentage:0},D3e=iU,oU=ap({name:"generation",initialState:D3e,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=U1(n)},setNegativePrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.negativePrompt=n:e.negativePrompt=U1(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:d,hires_fix:p,width:m,height:y}=t.payload.image;o&&o.length>0?(e.seedWeights=k3(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=U1(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,typeof u>"u"?e.perlin=0:e.perlin=u,typeof d=="boolean"&&(e.seamless=d),m&&(e.width=m),y&&(e.height=y)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:d,seamless:p,hires_fix:m,width:y,height:b,strength:w,fit:E,init_image_path:_,mask_image_path:k}=t.payload.image;if(n==="img2img"&&(_&&(e.initialImage=_),k&&(e.maskPath=k),w&&(e.img2imgStrength=w),typeof E=="boolean"&&(e.shouldFitToWidthHeight=E)),a&&a.length>0?(e.seedWeights=k3(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i){const[T,L]=xE(i);T&&(e.prompt=T),L?e.negativePrompt=L:e.negativePrompt=""}r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),typeof u>"u"?e.threshold=0:e.threshold=u,typeof d>"u"?e.perlin=0:e.perlin=d,typeof p=="boolean"&&(e.seamless=p),y&&(e.width=y),b&&(e.height=b)},resetParametersState:e=>({...e,...iU}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setShouldUseSymmetry:(e,t)=>{e.shouldUseSymmetry=t.payload},setHorizontalSymmetryTimePercentage:(e,t)=>{e.horizontalSymmetryTimePercentage=t.payload},setVerticalSymmetryTimePercentage:(e,t)=>{e.verticalSymmetryTimePercentage=t.payload}}}),{clearInitialImage:aU,resetParametersState:ENe,resetSeed:PNe,setAllImageToImageParameters:j3e,setAllParameters:sU,setAllTextToImageParameters:TNe,setCfgScale:vk,setHeight:cS,setImg2imgStrength:yk,setInfillMethod:lU,setInitialImage:v0,setIterations:eR,setMaskPath:uU,setParameter:MNe,setPerlin:bk,setPrompt:a4,setNegativePrompt:Dy,setSampler:cU,setSeamBlur:tR,setSeamless:dU,setSeamSize:nR,setSeamSteps:rR,setSeamStrength:iR,setSeed:g2,setSeedWeights:fU,setShouldFitToWidthHeight:hU,setShouldGenerateVariations:N3e,setShouldRandomizeSeed:$3e,setSteps:xk,setThreshold:Sk,setTileSize:oR,setVariationAmount:aR,setWidth:dS,setShouldUseSymmetry:F3e,setHorizontalSymmetryTimePercentage:sR,setVerticalSymmetryTimePercentage:lR}=oU.actions,B3e=oU.reducer,pU={codeformerFidelity:.75,facetoolStrength:.75,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingDenoising:.75,upscalingStrength:.75},z3e=pU,gU=ap({name:"postprocessing",initialState:z3e,reducers:{setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingDenoising:(e,t)=>{e.upscalingDenoising=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setHiresStrength:(e,t)=>{e.hiresStrength=t.payload},resetPostprocessingState:e=>({...e,...pU}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload}}}),{resetPostprocessingState:LNe,setCodeformerFidelity:wk,setFacetoolStrength:E3,setFacetoolType:fS,setHiresFix:mU,setHiresStrength:uR,setShouldLoopback:H3e,setShouldRunESRGAN:W3e,setShouldRunFacetool:U3e,setUpscalingLevel:vU,setUpscalingDenoising:Ck,setUpscalingStrength:_k}=gU.actions,V3e=gU.reducer;function gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};gs(this,e),this.init(t,n)}return ms(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||K3e,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function gR(e,t,n){var r=wE(e,t,Object),i=r.obj,o=r.k;i[o]=n}function Z3e(e,t,n,r){var i=wE(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}function P3(e,t){var n=wE(e,t),r=n.obj,i=n.k;if(r)return r[i]}function mR(e,t,n){var r=P3(e,n);return r!==void 0?r:P3(t,n)}function SU(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):SU(e[r],t[r],n):e[r]=t[r]);return e}function Mg(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Q3e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function J3e(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return Q3e[t]}):e}var l4=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,ewe=[" ",",","?","!",";"];function twe(e,t,n){t=t||"",n=n||"";var r=ewe.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function vR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nx(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wU(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(o+a).join(n);return u?wU(l,u,n):void 0}i=i[r[o]]}return i}}var iwe=function(e){s4(n,e);var t=nwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return gs(this,n),i=t.call(this),l4&&Jd.call(Fd(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return ms(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[i,o];a&&typeof a!="string"&&(d=d.concat(a)),a&&typeof a=="string"&&(d=d.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(d=i.split("."));var p=P3(this.data,d);return p||!u||typeof a!="string"?p:wU(this.data&&this.data[i]&&this.data[i][o],a,l)}},{key:"addResource",value:function(i,o,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var d=[i,o];a&&(d=d.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(d=i.split("."),s=o,o=d[1]),this.addNamespaces(o),gR(this.data,d,s),l.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(i,o,l,a[l],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[i,o];i.indexOf(".")>-1&&(d=i.split("."),s=a,a=o,o=d[1]),this.addNamespaces(o);var p=P3(this.data,d)||{};s?SU(p,a,l):p=nx(nx({},p),a),gR(this.data,d,p),u.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?nx(nx({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Jd),CU={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,i,o))}),n}};function yR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yo(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var bR={},xR=function(e){s4(n,e);var t=owe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return gs(this,n),i=t.call(this),l4&&Jd.call(Fd(i)),X3e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Fd(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Wl.create("translator"),i}return ms(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=a&&i.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!twe(i,a,s);if(u&&!d){var p=i.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:i,namespaces:l};var m=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(m[0])>-1)&&(l=m.shift()),i=m.join(s)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,a){var s=this;if(Ks(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,d=this.extractFromKey(i[i.length-1],o),p=d.key,m=d.namespaces,y=m[m.length-1],b=o.lng||this.language,w=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(w){var E=o.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(y).concat(E).concat(p),usedKey:p,exactUsedKey:p,usedLng:b,usedNS:y}:"".concat(y).concat(E).concat(p)}return l?{res:p,usedKey:p,exactUsedKey:p,usedLng:b,usedNS:y}:p}var _=this.resolve(i,o),k=_&&_.res,T=_&&_.usedKey||p,L=_&&_.exactUsedKey||p,O=Object.prototype.toString.apply(k),D=["[object Number]","[object Function]","[object RegExp]"],I=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,N=!this.i18nFormat||this.i18nFormat.handleAsObject,U=typeof k!="string"&&typeof k!="boolean"&&typeof k!="number";if(N&&k&&U&&D.indexOf(O)<0&&!(typeof I=="string"&&O==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,k,yo(yo({},o),{},{ns:m})):"key '".concat(p," (").concat(this.language,")' returned an object instead of string.");return l?(_.res=B,_):B}if(u){var K=O==="[object Array]",ne=K?[]:{},z=K?L:T;for(var $ in k)if(Object.prototype.hasOwnProperty.call(k,$)){var H="".concat(z).concat(u).concat($);ne[$]=this.translate(H,yo(yo({},o),{joinArrays:!1,ns:m})),ne[$]===H&&(ne[$]=k[$])}k=ne}}else if(N&&typeof I=="string"&&O==="[object Array]")k=k.join(I),k&&(k=this.extendTranslation(k,i,o,a));else{var Y=!1,Q=!1,q=o.count!==void 0&&typeof o.count!="string",X=n.hasDefaultValue(o),ee=q?this.pluralResolver.getSuffix(b,o.count,o):"",fe=o["defaultValue".concat(ee)]||o.defaultValue;!this.isValidLookup(k)&&X&&(Y=!0,k=fe),this.isValidLookup(k)||(Q=!0,k=p);var ke=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,we=ke&&Q?void 0:k,xe=X&&fe!==k&&this.options.updateMissing;if(Q||Y||xe){if(this.logger.log(xe?"updateKey":"missingKey",b,y,p,xe?fe:k),u){var Le=this.resolve(p,yo(yo({},o),{},{keySeparator:!1}));Le&&Le.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Se=[],Qe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Qe&&Qe[0])for(var Xe=0;Xe1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,d,p;return typeof i=="string"&&(i=[i]),i.forEach(function(m){if(!o.isValidLookup(s)){var y=o.extractFromKey(m,a),b=y.key;l=b;var w=y.namespaces;o.options.fallbackNS&&(w=w.concat(o.options.fallbackNS));var E=a.count!==void 0&&typeof a.count!="string",_=E&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),k=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",T=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);w.forEach(function(L){o.isValidLookup(s)||(p=L,!bR["".concat(T[0],"-").concat(L)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(p)&&(bR["".concat(T[0],"-").concat(L)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(T.join(", "),`" won't get resolved as namespace "`).concat(p,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(function(O){if(!o.isValidLookup(s)){d=O;var D=[b];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(D,b,O,L,a);else{var I;E&&(I=o.pluralResolver.getSuffix(O,a.count,a));var N="".concat(o.options.pluralSeparator,"zero");if(E&&(D.push(b+I),_&&D.push(b+N)),k){var U="".concat(b).concat(o.options.contextSeparator).concat(a.context);D.push(U),E&&(D.push(U+I),_&&D.push(U+N))}}for(var B;B=D.pop();)o.isValidLookup(s)||(u=B,s=o.getResource(O,L,B,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:d,usedNS:p}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),n}(Jd);function FC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var SR=function(){function e(t){gs(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Wl.create("languageUtils")}return ms(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=FC(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=FC(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=FC(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var a=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var a=r.getLanguagePartFromCode(o);if(r.isSupportedCode(a))return i=a;i=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){u&&(i.isSupportedCode(u)?a.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),o.forEach(function(l){a.indexOf(l)<0&&s(i.formatLanguageCode(l))}),a}}]),e}(),swe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],lwe={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},uwe=["v1","v2","v3"],wR={zero:0,one:1,two:2,few:3,many:4,other:5};function cwe(){var e={};return swe.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:lwe[t.fc]}})}),e}var dwe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gs(this,e),this.languageUtils=t,this.options=n,this.logger=Wl.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=cwe()}return ms(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return wR[a]-wR[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):o.numbers.map(function(a){return r.getSuffix(n,a,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!uwe.includes(this.options.compatibilityJSON)}}]),e}();function CR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fs(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};gs(this,e),this.logger=Wl.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return ms(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:J3e,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Mg(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Mg(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Mg(r.nestingPrefix):r.nestingPrefixEscaped||Mg("$t("),this.nestingSuffix=r.nestingSuffix?Mg(r.nestingSuffix):r.nestingSuffixEscaped||Mg(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var a=this,s,l,u,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function p(E){return E.replace(/\$/g,"$$$$")}var m=function(_){if(_.indexOf(a.formatSeparator)<0){var k=mR(r,d,_);return a.alwaysFormat?a.format(k,void 0,i,Fs(Fs(Fs({},o),r),{},{interpolationkey:_})):k}var T=_.split(a.formatSeparator),L=T.shift().trim(),O=T.join(a.formatSeparator).trim();return a.format(mR(r,d,L),O,i,Fs(Fs(Fs({},o),r),{},{interpolationkey:L}))};this.resetRegExp();var y=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,w=[{regex:this.regexpUnescape,safeValue:function(_){return p(_)}},{regex:this.regexp,safeValue:function(_){return a.escapeValue?p(a.escape(_)):p(_)}}];return w.forEach(function(E){for(u=0;s=E.regex.exec(n);){var _=s[1].trim();if(l=m(_),l===void 0)if(typeof y=="function"){var k=y(n,s,o);l=typeof k=="string"?k:""}else if(o&&Object.prototype.hasOwnProperty.call(o,_))l="";else if(b){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(_," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=pR(l));var T=E.safeValue(l);if(n=n.replace(s[0],T),b?(E.regex.lastIndex+=l.length,E.regex.lastIndex-=s[0].length):E.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l;function u(y,b){var w=this.nestingOptionsSeparator;if(y.indexOf(w)<0)return y;var E=y.split(new RegExp("".concat(w,"[ ]*{"))),_="{".concat(E[1]);y=E[0],_=this.interpolate(_,l);var k=_.match(/'/g),T=_.match(/"/g);(k&&k.length%2===0&&!T||T.length%2!==0)&&(_=_.replace(/'/g,'"'));try{l=JSON.parse(_),b&&(l=Fs(Fs({},b),l))}catch(L){return this.logger.warn("failed parsing options string in nesting for key ".concat(y),L),"".concat(y).concat(w).concat(_)}return delete l.defaultValue,y}for(;a=this.nestingRegexp.exec(n);){var d=[];l=Fs({},o),l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;var p=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var m=a[1].split(this.formatSeparator).map(function(y){return y.trim()});a[1]=m.shift(),d=m,p=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=pR(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),p&&(s=d.reduce(function(y,b){return i.format(y,b,o.lng,Fs(Fs({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function _R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ru(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(a){var s=a.split(":"),l=q3e(s),u=l[0],d=l.slice(1),p=d.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=p),p==="false"&&(n[u.trim()]=!1),p==="true"&&(n[u.trim()]=!0),isNaN(p)||(n[u.trim()]=parseInt(p,10))}})}}return{formatName:t,formatOptions:n}}function Lg(e){var t={};return function(r,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(r)}}var pwe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gs(this,e),this.logger=Wl.create("formatter"),this.options=t,this.formats={number:Lg(function(n,r){var i=new Intl.NumberFormat(n,Ru({},r));return function(o){return i.format(o)}}),currency:Lg(function(n,r){var i=new Intl.NumberFormat(n,Ru(Ru({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:Lg(function(n,r){var i=new Intl.DateTimeFormat(n,Ru({},r));return function(o){return i.format(o)}}),relativetime:Lg(function(n,r){var i=new Intl.RelativeTimeFormat(n,Ru({},r));return function(o){return i.format(o,r.range||"day")}}),list:Lg(function(n,r){var i=new Intl.ListFormat(n,Ru({},r));return function(o){return i.format(o)}})},this.init(t)}return ms(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Lg(r)}},{key:"format",value:function(n,r,i){var o=this,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r.split(this.formatSeparator),l=s.reduce(function(u,d){var p=hwe(d),m=p.formatName,y=p.formatOptions;if(o.formats[m]){var b=u;try{var w=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},E=w.locale||w.lng||a.locale||a.lng||i;b=o.formats[m](u,E,Ru(Ru(Ru({},y),a),w))}catch(_){o.logger.warn(_)}return b}else o.logger.warn("there was no format function for ".concat(m));return u},n);return l}}]),e}();function kR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ER(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vwe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var ywe=function(e){s4(n,e);var t=gwe(n);function n(r,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return gs(this,n),a=t.call(this),l4&&Jd.call(Fd(a)),a.backend=r,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=Wl.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return ms(n,[{key:"queueLoad",value:function(i,o,a,s){var l=this,u={},d={},p={},m={};return i.forEach(function(y){var b=!0;o.forEach(function(w){var E="".concat(y,"|").concat(w);!a.reload&&l.store.hasResourceBundle(y,w)?l.state[E]=2:l.state[E]<0||(l.state[E]===1?d[E]===void 0&&(d[E]=!0):(l.state[E]=1,b=!1,d[E]===void 0&&(d[E]=!0),u[E]===void 0&&(u[E]=!0),m[w]===void 0&&(m[w]=!0)))}),b||(p[y]=!0)}),(Object.keys(u).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(d),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),l=s[0],u=s[1];o&&this.emit("failedLoading",l,u,o),a&&this.store.addResourceBundle(l,u,a),this.state[i]=o?-1:2;var d={};this.queue.forEach(function(p){Z3e(p.loaded,[l],u),vwe(p,i),o&&p.errors.push(o),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(function(m){d[m]||(d[m]={});var y=p.loaded[m];y.length&&y.forEach(function(b){d[m][b]===void 0&&(d[m][b]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(p){return!p.done})}},{key:"read",value:function(i,o,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!i.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:l,wait:u,callback:d});return}this.readingCalls++;var p=function(w,E){if(s.readingCalls--,s.waitingReads.length>0){var _=s.waitingReads.shift();s.read(_.lng,_.ns,_.fcName,_.tried,_.wait,_.callback)}if(w&&E&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(d){a.loadOne(d)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(d,p){d&&o.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),d),!d&&p&&o.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),p),o.loaded(i,d,p)})}},{key:"saveMissing",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend&&this.backend.create){var p=ER(ER({},u),{},{isUpdate:l}),m=this.backend.create.bind(this.backend);if(m.length<6)try{var y;m.length===5?y=m(i,o,a,s,p):y=m(i,o,a,s),y&&typeof y.then=="function"?y.then(function(b){return d(null,b)}).catch(d):d(null,y)}catch(b){d(b)}else m(i,o,a,s,d,p)}!i||!i[0]||this.store.addResource(i[0],o,a,s)}}}]),n}(Jd);function PR(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Ks(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Ks(t[2])==="object"||Ks(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function TR(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function MR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tl(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rx(){}function Swe(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var T3=function(e){s4(n,e);var t=bwe(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(gs(this,n),r=t.call(this),l4&&Jd.call(Fd(r)),r.options=TR(i),r.services={},r.logger=Wl,r.modules={external:[]},Swe(Fd(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),m2(r,Fd(r));setTimeout(function(){r.init(i,o)},0)}return r}return ms(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=PR();this.options=Tl(Tl(Tl({},s),this.options),TR(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Tl(Tl({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(_){return _?typeof _=="function"?new _:_:null}if(!this.options.isClone){this.modules.logger?Wl.init(l(this.modules.logger),this.options):Wl.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=pwe);var d=new SR(this.options);this.store=new iwe(this.options.resources,this.options);var p=this.services;p.logger=Wl,p.resourceStore=this.store,p.languageUtils=d,p.pluralResolver=new dwe(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(p.formatter=l(u),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new fwe(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new ywe(l(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(_){for(var k=arguments.length,T=new Array(k>1?k-1:0),L=1;L1?k-1:0),L=1;L0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var y=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];y.forEach(function(_){i[_]=function(){var k;return(k=i.store)[_].apply(k,arguments)}});var b=["addResource","addResources","addResourceBundle","removeResourceBundle"];b.forEach(function(_){i[_]=function(){var k;return(k=i.store)[_].apply(k,arguments),i}});var w=Gv(),E=function(){var k=function(L,O){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),w.resolve(O),a(L,O)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return k(null,i.t.bind(i));i.changeLanguage(i.options.lng,k)};return this.options.resources||!this.options.initImmediate?E():setTimeout(E,0),w}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rx,s=a,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],d=function(y){if(y){var b=o.services.languageUtils.toResolveHierarchy(y);b.forEach(function(w){u.indexOf(w)<0&&u.push(w)})}};if(l)d(l);else{var p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.forEach(function(m){return d(m)})}this.options.preload&&this.options.preload.forEach(function(m){return d(m)}),this.services.backendConnector.load(u,this.options.ns,function(m){!m&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(m)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=Gv();return i||(i=this.languages),o||(o=this.options.ns),a||(a=rx),this.services.backendConnector.reload(i,o,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&CU.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=Gv();this.emit("languageChanging",i);var l=function(m){a.language=m,a.languages=a.services.languageUtils.toResolveHierarchy(m),a.resolvedLanguage=void 0,a.setResolvedLanguage(m)},u=function(m,y){y?(l(y),a.translator.changeLanguage(y),a.isLanguageChangingTo=void 0,a.emit("languageChanged",y),a.logger.log("languageChanged",y)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(m,function(){return a.t.apply(a,arguments)})},d=function(m){!i&&!m&&a.services.languageDetector&&(m=[]);var y=typeof m=="string"?m:a.services.languageUtils.getBestMatchFromCodes(m);y&&(a.language||l(y),a.translator.language||a.translator.changeLanguage(y),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage&&a.services.languageDetector.cacheUserLanguage(y)),a.loadResources(y,function(b){u(b,y)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,l=function u(d,p){var m;if(Ks(p)!=="object"){for(var y=arguments.length,b=new Array(y>2?y-2:0),w=2;w1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var d=function(y,b){var w=o.services.backendConnector.state["".concat(y,"|").concat(b)];return w===-1||w===2};if(a.precheck){var p=a.precheck(this,d);if(p!==void 0)return p}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,i)&&(!l||d(u,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=Gv();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),o&&o(l)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=Gv();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],l=i.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),o&&o(u)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services&&this.services.languageUtils||new SR(PR());return o.indexOf(a.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rx,s=Tl(Tl(Tl({},this.options),o),{isClone:!0}),l=new n(s);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(d){l[d]=i[d]}),l.services=Tl({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new xR(l.services,l.options),l.translator.on("*",function(d){for(var p=arguments.length,m=new Array(p>1?p-1:0),y=1;y0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new T3(e,t)});var Et=T3.createInstance();Et.createInstance=T3.createInstance;Et.createInstance;Et.dir;Et.init;Et.loadResources;Et.reloadResources;Et.use;Et.changeLanguage;Et.getFixedT;Et.t;Et.exists;Et.setDefaultNamespace;Et.hasLoadedNamespace;Et.loadNamespaces;Et.loadLanguages;var _U=[],wwe=_U.forEach,Cwe=_U.slice;function _we(e){return wwe.call(Cwe.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var LR=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,kwe=function(t,n,r){var i=r||{};i.path=i.path||"/";var o=encodeURIComponent(n),a="".concat(t,"=").concat(o);if(i.maxAge>0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!LR.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!LR.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},AR={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=kwe(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),a=0;a0){var l=o[a].substring(0,s);l===t.lookupQuerystring&&(n=o[a].substring(s+1))}}}return n}},qv=null,OR=function(){if(qv!==null)return qv;try{qv=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{qv=!1}return qv},Twe={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&OR()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&OR()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},Kv=null,RR=function(){if(Kv!==null)return Kv;try{Kv=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Kv=!1}return Kv},Mwe={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&RR()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&RR()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},Lwe={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},Awe={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},Owe={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},Rwe={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function Iwe(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var kU=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gs(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return ms(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=_we(r,this.options||{},Iwe()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(Ewe),this.addDetector(Pwe),this.addDetector(Twe),this.addDetector(Mwe),this.addDetector(Lwe),this.addDetector(Awe),this.addDetector(Owe),this.addDetector(Rwe)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var a=r.detectors[o].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}]),e}();kU.type="languageDetector";function kk(e){return kk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kk(e)}var EU=[],Dwe=EU.forEach,jwe=EU.slice;function Ek(e){return Dwe.call(jwe.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function PU(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":kk(XMLHttpRequest))==="object"}function Nwe(e){return!!e&&typeof e.then=="function"}function $we(e){return Nwe(e)?e:Promise.resolve(e)}function Fwe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jy={},Bwe={get exports(){return jy},set exports(e){jy=e}},V1={},zwe={get exports(){return V1},set exports(e){V1=e}},IR;function Hwe(){return IR||(IR=1,function(e,t){var n=typeof self<"u"?self:So,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l($){return $&&DataView.prototype.isPrototypeOf($)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function($){return $&&u.indexOf(Object.prototype.toString.call($))>-1};function p($){if(typeof $!="string"&&($=String($)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test($))throw new TypeError("Invalid character in header field name");return $.toLowerCase()}function m($){return typeof $!="string"&&($=String($)),$}function y($){var H={next:function(){var Y=$.shift();return{done:Y===void 0,value:Y}}};return s.iterable&&(H[Symbol.iterator]=function(){return H}),H}function b($){this.map={},$ instanceof b?$.forEach(function(H,Y){this.append(Y,H)},this):Array.isArray($)?$.forEach(function(H){this.append(H[0],H[1])},this):$&&Object.getOwnPropertyNames($).forEach(function(H){this.append(H,$[H])},this)}b.prototype.append=function($,H){$=p($),H=m(H);var Y=this.map[$];this.map[$]=Y?Y+", "+H:H},b.prototype.delete=function($){delete this.map[p($)]},b.prototype.get=function($){return $=p($),this.has($)?this.map[$]:null},b.prototype.has=function($){return this.map.hasOwnProperty(p($))},b.prototype.set=function($,H){this.map[p($)]=m(H)},b.prototype.forEach=function($,H){for(var Y in this.map)this.map.hasOwnProperty(Y)&&$.call(H,this.map[Y],Y,this)},b.prototype.keys=function(){var $=[];return this.forEach(function(H,Y){$.push(Y)}),y($)},b.prototype.values=function(){var $=[];return this.forEach(function(H){$.push(H)}),y($)},b.prototype.entries=function(){var $=[];return this.forEach(function(H,Y){$.push([Y,H])}),y($)},s.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function w($){if($.bodyUsed)return Promise.reject(new TypeError("Already read"));$.bodyUsed=!0}function E($){return new Promise(function(H,Y){$.onload=function(){H($.result)},$.onerror=function(){Y($.error)}})}function _($){var H=new FileReader,Y=E(H);return H.readAsArrayBuffer($),Y}function k($){var H=new FileReader,Y=E(H);return H.readAsText($),Y}function T($){for(var H=new Uint8Array($),Y=new Array(H.length),Q=0;Q-1?H:$}function N($,H){H=H||{};var Y=H.body;if($ instanceof N){if($.bodyUsed)throw new TypeError("Already read");this.url=$.url,this.credentials=$.credentials,H.headers||(this.headers=new b($.headers)),this.method=$.method,this.mode=$.mode,this.signal=$.signal,!Y&&$._bodyInit!=null&&(Y=$._bodyInit,$.bodyUsed=!0)}else this.url=String($);if(this.credentials=H.credentials||this.credentials||"same-origin",(H.headers||!this.headers)&&(this.headers=new b(H.headers)),this.method=I(H.method||this.method||"GET"),this.mode=H.mode||this.mode||null,this.signal=H.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Y)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(Y)}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function U($){var H=new FormData;return $.trim().split("&").forEach(function(Y){if(Y){var Q=Y.split("="),q=Q.shift().replace(/\+/g," "),X=Q.join("=").replace(/\+/g," ");H.append(decodeURIComponent(q),decodeURIComponent(X))}}),H}function B($){var H=new b,Y=$.replace(/\r?\n[\t ]+/g," ");return Y.split(/\r?\n/).forEach(function(Q){var q=Q.split(":"),X=q.shift().trim();if(X){var ee=q.join(":").trim();H.append(X,ee)}}),H}O.call(N.prototype);function K($,H){H||(H={}),this.type="default",this.status=H.status===void 0?200:H.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in H?H.statusText:"OK",this.headers=new b(H.headers),this.url=H.url||"",this._initBody($)}O.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},K.error=function(){var $=new K(null,{status:0,statusText:""});return $.type="error",$};var ne=[301,302,303,307,308];K.redirect=function($,H){if(ne.indexOf(H)===-1)throw new RangeError("Invalid status code");return new K(null,{status:H,headers:{location:$}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(H,Y){this.message=H,this.name=Y;var Q=Error(H);this.stack=Q.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function z($,H){return new Promise(function(Y,Q){var q=new N($,H);if(q.signal&&q.signal.aborted)return Q(new a.DOMException("Aborted","AbortError"));var X=new XMLHttpRequest;function ee(){X.abort()}X.onload=function(){var fe={status:X.status,statusText:X.statusText,headers:B(X.getAllResponseHeaders()||"")};fe.url="responseURL"in X?X.responseURL:fe.headers.get("X-Request-URL");var ke="response"in X?X.response:X.responseText;Y(new K(ke,fe))},X.onerror=function(){Q(new TypeError("Network request failed"))},X.ontimeout=function(){Q(new TypeError("Network request failed"))},X.onabort=function(){Q(new a.DOMException("Aborted","AbortError"))},X.open(q.method,q.url,!0),q.credentials==="include"?X.withCredentials=!0:q.credentials==="omit"&&(X.withCredentials=!1),"responseType"in X&&s.blob&&(X.responseType="blob"),q.headers.forEach(function(fe,ke){X.setRequestHeader(ke,fe)}),q.signal&&(q.signal.addEventListener("abort",ee),X.onreadystatechange=function(){X.readyState===4&&q.signal.removeEventListener("abort",ee)}),X.send(typeof q._bodyInit>"u"?null:q._bodyInit)})}return z.polyfill=!0,o.fetch||(o.fetch=z,o.Headers=b,o.Request=N,o.Response=K),a.Headers=b,a.Request=N,a.Response=K,a.fetch=z,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(zwe,V1)),V1}(function(e,t){var n;if(typeof fetch=="function"&&(typeof So<"u"&&So.fetch?n=So.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof Fwe<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||Hwe();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(Bwe,jy);const TU=jy,DR=kj({__proto__:null,default:TU},[jy]);function M3(e){return M3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M3(e)}var Yu;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Yu=global.fetch:typeof window<"u"&&window.fetch?Yu=window.fetch:Yu=fetch);var Ny;PU()&&(typeof global<"u"&&global.XMLHttpRequest?Ny=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Ny=window.XMLHttpRequest));var L3;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?L3=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(L3=window.ActiveXObject));!Yu&&DR&&!Ny&&!L3&&(Yu=TU||DR);typeof Yu!="function"&&(Yu=void 0);var Pk=function(t,n){if(n&&M3(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},jR=function(t,n,r){Yu(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},NR=!1,Wwe=function(t,n,r,i){t.queryStringParams&&(n=Pk(n,t.queryStringParams));var o=Ek({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=Ek({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},NR?{}:a);try{jR(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),jR(n,s,i),NR=!0}catch(u){i(u)}}},Uwe=function(t,n,r,i){r&&M3(r)==="object"&&(r=Pk("",r).slice(1)),t.queryStringParams&&(n=Pk(n,t.queryStringParams));try{var o;Ny?o=new Ny:o=new L3("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},Vwe=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Yu&&n.indexOf("file:")!==0)return Wwe(t,n,r,i);if(PU()||typeof ActiveXObject=="function")return Uwe(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function $y(e){return $y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$y(e)}function Gwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $R(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Gwe(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return qwe(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Ek(i,this.options||{},Xwe()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=$we(l),l.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(d,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,d;try{typeof l.data=="string"?u=a.options.parse(l.data,i,o):u=l.data}catch{d="failed parsing "+n+" to json"}if(d)return r(d,!1);r(null,u)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,d=[],p=[];n.forEach(function(m){var y=s.options.addPath;typeof s.options.addPath=="function"&&(y=s.options.addPath(m,r));var b=s.services.interpolator.interpolate(y,{lng:m,ns:r});s.options.request(s.options,b,l,function(w,E){u+=1,d.push(w),p.push(E),u===n.length&&typeof a=="function"&&a(d,p)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(p){var m=o.toResolveHierarchy(p);m.forEach(function(y){l.indexOf(y)<0&&l.push(y)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),l.forEach(function(d){n.allOptions.ns.forEach(function(p){i.read(d,p,"read",null,null,function(m,y){m&&a.warn("loading namespace ".concat(p," for language ").concat(d," failed"),m),!m&&y&&a.log("loaded namespace ".concat(p," for language ").concat(d),y),i.loaded("".concat(d,"|").concat(p),m,y)})})})}}}]),e}();LU.type="backend";function Zwe(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var d=t.services.backendConnector.state["".concat(l,"|").concat(u)];return d===-1||d===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function Jwe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Tk("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):Qwe(e,t,n)}var e4e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,t4e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},n4e=function(t){return t4e[t]},r4e=function(t){return t.replace(e4e,n4e)};function zR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function HR(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};Mk=HR(HR({},Mk),e)}function o4e(){return Mk}var AU;function a4e(e){AU=e}function s4e(){return AU}var l4e={type:"3rdParty",init:function(t){i4e(t.options.react),a4e(t)}},u4e=S.createContext(),c4e=function(){function e(){gs(this,e),this.usedNamespaces={}}return ms(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function d4e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function f4e(e,t){return yU(e)||d4e(e,t)||bU(e,t)||xU()}function WR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BC(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=S.useContext(u4e)||{},i=r.i18n,o=r.defaultNS,a=n||i||s4e();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new c4e),!a){Tk("You will need to pass in an i18next instance by using initReactI18next");var s=function(U){return Array.isArray(U)?U[U.length-1]:U},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&Tk("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=BC(BC(BC({},o4e()),a.options.react),t),d=u.useSuspense,p=u.keyPrefix,m=e||o||a.options&&a.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(m);var y=(a.isInitialized||a.initializedStoreOnce)&&m.every(function(N){return Jwe(N,a,u)});function b(){return a.getFixedT(null,u.nsMode==="fallback"?m:m[0],p)}var w=S.useState(b),E=f4e(w,2),_=E[0],k=E[1],T=m.join(),L=h4e(T),O=S.useRef(!0);S.useEffect(function(){var N=u.bindI18n,U=u.bindI18nStore;O.current=!0,!y&&!d&&BR(a,m,function(){O.current&&k(b)}),y&&L&&L!==T&&O.current&&k(b);function B(){O.current&&k(b)}return N&&a&&a.on(N,B),U&&a&&a.store.on(U,B),function(){O.current=!1,N&&a&&N.split(" ").forEach(function(K){return a.off(K,B)}),U&&a&&U.split(" ").forEach(function(K){return a.store.off(K,B)})}},[a,T]);var D=S.useRef(!0);S.useEffect(function(){O.current&&!D.current&&k(b),D.current=!1},[a,p]);var I=[_,a,y];if(I.t=_,I.i18n=a,I.ready=y,y||!y&&!d)return I;throw new Promise(function(N){BR(a,m,function(){N()})})}Et.use(LU).use(kU).use(l4e).init({fallbackLng:"en",debug:!1,backend:{loadPath:"/locales/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const p4e={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[0],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:Et.isInitialized?Et.t("common.statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null,cancelOptions:{cancelType:"immediate",cancelAfter:null}},OU=ap({name:"system",initialState:p4e,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=Et.t("common.statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?Et.t("common.statusConnected"):Et.t("common.statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=Et.t("common.statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=Et.t("common.statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=Et.t("common.statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},modelConvertRequested:e=>{e.currentStatus=Et.t("common.statusConvertingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},modelMergingRequested:e=>{e.currentStatus=Et.t("common.statusMergingModels"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload},setCancelType:(e,t)=>{e.cancelOptions.cancelType=t.payload},setCancelAfter:(e,t)=>{e.cancelOptions.cancelAfter=t.payload}}}),{setShouldDisplayInProgressType:g4e,setIsProcessing:wa,addLogEntry:Pi,setShouldShowLogViewer:zC,setIsConnected:UR,setSocketId:ANe,setShouldConfirmOnDelete:RU,setOpenAccordions:m4e,setSystemStatus:v4e,setCurrentStatus:hh,setSystemConfig:y4e,setShouldDisplayGuides:b4e,processingCanceled:x4e,errorOccurred:VR,errorSeen:IU,setModelList:Ag,setIsCancelable:_d,modelChangeRequested:S4e,modelConvertRequested:w4e,modelMergingRequested:C4e,setSaveIntermediatesInterval:_4e,setEnableImageDebugging:k4e,generationRequested:E4e,addToast:$u,clearToastQueue:P4e,setProcessingIndeterminateTask:T4e,setSearchFolder:DU,setFoundModels:jU,setOpenModel:GR,setCancelType:qR,setCancelAfter:HC}=OU.actions,M4e=OU.reducer,CE=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],L4e={activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,shouldUseSliders:!1,addNewModelUIOption:null},A4e=L4e,NU=ap({name:"ui",initialState:A4e,reducers:{setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=CE.indexOf(t.payload)},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setParametersPanelScrollPosition:(e,t)=>{e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:(e,t)=>{e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:(e,t)=>{e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:(e,t)=>{e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:(e,t)=>{e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setShouldUseSliders:(e,t)=>{e.shouldUseSliders=t.payload},setAddNewModelUIOption:(e,t)=>{e.addNewModelUIOption=t.payload}}}),{setActiveTab:Wo,setCurrentTheme:O4e,setParametersPanelScrollPosition:R4e,setShouldHoldParametersPanelOpen:I4e,setShouldPinParametersPanel:D4e,setShouldShowParametersPanel:Fh,setShouldShowDualDisplay:j4e,setShouldShowImageDetails:$U,setShouldUseCanvasBetaLayout:N4e,setShouldShowExistingModelsInSearch:$4e,setShouldUseSliders:F4e,setAddNewModelUIOption:Bh}=NU.actions,B4e=NU.reducer,iu=Object.create(null);iu.open="0";iu.close="1";iu.ping="2";iu.pong="3";iu.message="4";iu.upgrade="5";iu.noop="6";const hS=Object.create(null);Object.keys(iu).forEach(e=>{hS[iu[e]]=e});const z4e={type:"error",data:"parser error"},H4e=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",W4e=typeof ArrayBuffer=="function",U4e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,FU=({type:e,data:t},n,r)=>H4e&&t instanceof Blob?n?r(t):KR(t,r):W4e&&(t instanceof ArrayBuffer||U4e(t))?n?r(t):KR(new Blob([t]),r):r(iu[e]+(t||"")),KR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)},YR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r>4,d[i++]=(a&15)<<4|s>>2,d[i++]=(s&3)<<6|l&63;return u},G4e=typeof ArrayBuffer=="function",BU=(e,t)=>{if(typeof e!="string")return{type:"message",data:zU(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:q4e(e.substring(1),t)}:hS[n]?e.length>1?{type:hS[n],data:e.substring(1)}:{type:hS[n]}:z4e},q4e=(e,t)=>{if(G4e){const n=V4e(e);return zU(n,t)}else return{base64:!0,data:e}},zU=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},HU=String.fromCharCode(30),K4e=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{FU(o,!1,s=>{r[a]=s,++i===n&&t(r.join(HU))})})},Y4e=(e,t)=>{const n=e.split(HU),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function UU(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Z4e=Za.setTimeout,Q4e=Za.clearTimeout;function u4(e,t){t.useNativeTimers?(e.setTimeoutFn=Z4e.bind(Za),e.clearTimeoutFn=Q4e.bind(Za)):(e.setTimeoutFn=Za.setTimeout.bind(Za),e.clearTimeoutFn=Za.clearTimeout.bind(Za))}const J4e=1.33;function e5e(e){return typeof e=="string"?t5e(e):Math.ceil((e.byteLength||e.size)*J4e)}function t5e(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class n5e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class VU extends ai{constructor(t){super(),this.writable=!1,u4(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new n5e(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=BU(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}}const GU="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Lk=64,r5e={};let XR=0,ix=0,ZR;function QR(e){let t="";do t=GU[e%Lk]+t,e=Math.floor(e/Lk);while(e>0);return t}function qU(){const e=QR(+new Date);return e!==ZR?(XR=0,ZR=e):e+"."+QR(XR++)}for(;ix{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Y4e(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,K4e(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=qU()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=KU(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new eu(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class eu extends ai{constructor(t,n){super(),u4(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=UU(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new XU(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=eu.requestsCount++,eu.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=a5e,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete eu.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}eu.requestsCount=0;eu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",JR);else if(typeof addEventListener=="function"){const e="onpagehide"in Za?"pagehide":"unload";addEventListener(e,JR,!1)}}function JR(){for(let e in eu.requests)eu.requests.hasOwnProperty(e)&&eu.requests[e].abort()}const ZU=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),ox=Za.WebSocket||Za.MozWebSocket,eI=!0,u5e="arraybuffer",tI=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class c5e extends VU{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=tI?{}:UU(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=eI&&!tI?n?new ox(t,n):new ox(t):new ox(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||u5e,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{eI&&this.ws.send(o)}catch{}i&&ZU(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=qU()),this.supportsBinary||(t.b64=1);const i=KU(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!ox}}const d5e={websocket:c5e,polling:l5e},f5e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,h5e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ak(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=f5e.exec(e||""),o={},a=14;for(;a--;)o[h5e[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=p5e(o,o.path),o.queryKey=g5e(o,o.query),o}function p5e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function g5e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let QU=class Ng extends ai{constructor(t,n={}){super(),this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=Ak(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=Ak(n.host).host),u4(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=i5e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=WU,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new d5e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Ng.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Ng.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ng.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=p=>{const m=new Error("probe error: "+p);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(p){n&&p.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",Ng.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Ng.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,JU=Object.prototype.toString,b5e=typeof Blob=="function"||typeof Blob<"u"&&JU.call(Blob)==="[object BlobConstructor]",x5e=typeof File=="function"||typeof File<"u"&&JU.call(File)==="[object FileConstructor]";function _E(e){return v5e&&(e instanceof ArrayBuffer||y5e(e))||b5e&&e instanceof Blob||x5e&&e instanceof File}function pS(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case nn.ACK:case nn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class k5e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=w5e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const E5e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:kE,Encoder:_5e,get PacketType(){return nn},protocol:C5e},Symbol.toStringTag,{value:"Module"}));function Hs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const P5e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class eV extends ai{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Hs(t,"open",this.onopen.bind(this)),Hs(t,"packet",this.onpacket.bind(this)),Hs(t,"error",this.onerror.bind(this)),Hs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(P5e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:nn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a{this.io.clearTimeoutFn(o),n.apply(this,[null,...a])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((a,s)=>r?a?o(a):i(s):i(a)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this.ids++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(){if(this._queue.length===0)return;const t=this._queue[0];if(t.pending)return;t.pending=!0,t.tryCount++;const n=this.ids;this.ids=t.id,this.flags=t.flags,this.emit.apply(this,t.args),this.ids=n}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:nn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case nn.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case nn.EVENT:case nn.BINARY_EVENT:this.onevent(t);break;case nn.ACK:case nn.BINARY_ACK:this.onack(t);break;case nn.DISCONNECT:this.ondisconnect();break;case nn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:nn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:nn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}y0.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};y0.prototype.reset=function(){this.attempts=0};y0.prototype.setMin=function(e){this.ms=e};y0.prototype.setMax=function(e){this.max=e};y0.prototype.setJitter=function(e){this.jitter=e};class Ik extends ai{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,u4(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new y0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||E5e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new QU(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Hs(n,"open",function(){r.onopen(),t&&t()}),o=Hs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Hs(t,"ping",this.onping.bind(this)),Hs(t,"data",this.ondata.bind(this)),Hs(t,"error",this.onerror.bind(this)),Hs(t,"close",this.onclose.bind(this)),Hs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){ZU(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new eV(this,t,n),this.nsps[t]=r),this._autoConnect&&r.connect(),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Yv={};function gS(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=m5e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=Yv[i]&&o in Yv[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new Ik(r,t):(Yv[i]||(Yv[i]=new Ik(r,t)),l=Yv[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(gS,{Manager:Ik,Socket:eV,io:gS,connect:gS});const T5e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],M5e=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],L5e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],A5e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],O5e=[{key:"2x",value:2},{key:"4x",value:4}],EE=0,PE=4294967295,R5e=["gfpgan","codeformer"],I5e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}];var D5e=Math.PI/180;function j5e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Rm=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},ft={_global:Rm,version:"8.4.2",isBrowser:j5e(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return ft.angleDeg?e*D5e:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return ft.DD.isDragging},isDragReady(){return!!ft.DD.node},releaseCanvasOnDestroy:!0,document:Rm.document,_injectGlobal(e){Rm.Konva=e}},Mr=e=>{ft[e.prototype.getClassName()]=e};ft._injectGlobal(ft);class Ca{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 Ca(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){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var d=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/d):-Math.acos(r/d)),l.scaleX=s/d,l.scaleY=d,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=de._getRotation(l.rotation),l}}var N5e="[object Array]",$5e="[object Number]",F5e="[object String]",B5e="[object Boolean]",z5e=Math.PI/180,H5e=180/Math.PI,WC="#",W5e="",U5e="0",V5e="Konva warning: ",nI="Konva error: ",G5e="rgb(",UC={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]},q5e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,ax=[];const K5e=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},de={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===N5e},_isNumber(e){return Object.prototype.toString.call(e)===$5e&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===F5e},_isBoolean(e){return Object.prototype.toString.call(e)===B5e},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){ax.push(e),ax.length===1&&K5e(function(){const t=ax;ax=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=de.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(WC,W5e);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=U5e+e;return WC+e},getRGB(e){var t;return e in UC?(t=UC[e],{r:t[0],g:t[1],b:t[2]}):e[0]===WC?this._hexToRgb(e.substring(1)):e.substr(0,4)===G5e?(t=q5e.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",de._namedColorToRBA(e)||de._hex3ColorToRGBA(e)||de._hex4ColorToRGBA(e)||de._hex6ColorToRGBA(e)||de._hex8ColorToRGBA(e)||de._rgbColorToRGBA(e)||de._rgbaColorToRGBA(e)||de._hslColorToRGBA(e)},_namedColorToRBA(e){var t=UC[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(e){if(e[0]==="#"&&e.length===9)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if(e[0]==="#"&&e.length===5)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const u=2*o-a,d=[0,0,0];for(let p=0;p<3;p++)s=r+1/3*-(p-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,d[p]=l*255;return{r:Math.round(d[0]),g:Math.round(d[1]),b:Math.round(d[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+d*(n-e),s=t+d*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=de.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=de._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],d=l[1],p=l[2];pt.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})},drawRoundedRectPath(e,t,n,r){let i=0,o=0,a=0,s=0;typeof r=="number"?i=o=a=s=Math.min(r,t/2,n/2):(i=Math.min(r[0]||0,t/2,n/2),o=Math.min(r[1]||0,t/2,n/2),s=Math.min(r[2]||0,t/2,n/2),a=Math.min(r[3]||0,t/2,n/2)),e.moveTo(i,0),e.lineTo(t-o,0),e.arc(t-o,o,o,Math.PI*3/2,0,!1),e.lineTo(t,n-s),e.arc(t-s,n-s,s,0,Math.PI/2,!1),e.lineTo(a,n),e.arc(a,n-a,a,Math.PI/2,Math.PI,!1),e.lineTo(0,i),e.arc(i,i,i,Math.PI,Math.PI*3/2,!1)}};function uf(e){return de._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||de._isBoolean(e)?e:Object.prototype.toString.call(e)}function tV(e){return e>255?255:e<0?0:Math.round(e)}function Ve(){if(ft.isUnminified)return function(e,t){return de._isNumber(e)||de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function TE(e){if(ft.isUnminified)return function(t,n){let r=de._isNumber(t),i=de._isArray(t)&&t.length==e;return!r&&!i&&de.warn(uf(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function ME(){if(ft.isUnminified)return function(e,t){var n=de._isNumber(e),r=e==="auto";return n||r||de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function b0(){if(ft.isUnminified)return function(e,t){return de._isString(e)||de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function nV(){if(ft.isUnminified)return function(e,t){const n=de._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function Y5e(){if(ft.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(de._isArray(e)?e.forEach(function(r){de._isNumber(r)||de.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function el(){if(ft.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||de.warn(uf(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function X5e(e){if(ft.isUnminified)return function(t,n){return t==null||de.isObject(t)||de.warn(uf(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var Xv="get",Zv="set";const J={addGetterSetter(e,t,n,r,i){J.addGetter(e,t,n),J.addSetter(e,t,r,i),J.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=Xv+de._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=Zv+de._capitalize(t);e.prototype[i]||J.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=Zv+de._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=de._capitalize,s=Xv+a(t),l=Zv+a(t),u,d;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(w),void 0)}),this._fireChangeEvent(t,y,m),i&&i.call(this),this},J.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=de._capitalize(t),r=Zv+n,i=Xv+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){de.error("Adding deprecated "+t);var i=Xv+de._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){de.error(o);var a=this.attrs[t];return a===void 0?n:a},J.addSetter(e,t,r,function(){de.error(o)}),J.addOverloadedGetterSetter(e,t)},backCompat(e,t){de.each(t,function(n,r){var i=e.prototype[r],o=Xv+de._capitalize(n),a=Zv+de._capitalize(n);function s(){i.apply(this,arguments),de.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function Z5e(e){var t=[],n=e.length,r=de,i,o;for(i=0;itypeof d=="number"?Math.floor(d):d)),o+=Q5e+u.join(rI)+J5e)):(o+=s.property,t||(o+=iCe+s.val)),o+=nCe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=aCe&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var d=arguments,p=this._context;d.length===3?p.drawImage(t,n,r):d.length===5?p.drawImage(t,n,r,i,o):d.length===9&&p.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n,r,i){return r?this._context.isPointInPath(r,t,n,i):this._context.isPointInPath(t,n,i)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}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,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=iI.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=Z5e(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return fn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];fn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=de._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.id===n.pointerId);if(a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];fn._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(fn.justDragged=!0,ft._mouseListenClick=!1,ft._touchListenClick=!1,ft._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof ft.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){fn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&fn._dragElements.delete(n)})}};ft.isBrowser&&(window.addEventListener("mouseup",fn._endDragBefore,!0),window.addEventListener("touchend",fn._endDragBefore,!0),window.addEventListener("mousemove",fn._drag),window.addEventListener("touchmove",fn._drag),window.addEventListener("mouseup",fn._endDragAfter,!1),window.addEventListener("touchend",fn._endDragAfter,!1));var mS="absoluteOpacity",lx="allEventListeners",Iu="absoluteTransform",oI="absoluteScale",oh="canvas",cCe="Change",dCe="children",fCe="konva",Dk="listening",aI="mouseenter",sI="mouseleave",lI="set",uI="Shape",vS=" ",cI="stage",fd="transform",hCe="Stage",jk="visible",pCe=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(vS);let gCe=1,Ge=class Nk{constructor(t){this._id=gCe++,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===fd||t===Iu)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===fd||t===Iu,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(vS);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(oh)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Iu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(oh)){const{scene:t,filter:n,hit:r}=this._cache.get(oh);de.releaseCanvas(t,n,r),this._cache.delete(oh)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,p=n.hitCanvasPixelRatio||1;if(!i||!o){de.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new Im({pixelRatio:a,width:i,height:o}),y=new Im({pixelRatio:a,width:0,height:0}),b=new LE({pixelRatio:p,width:i,height:o}),w=m.getContext(),E=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(oh),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),w.save(),E.save(),w.translate(-s,-l),E.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(mS),this._clearSelfAndDescendantCache(oI),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,w.restore(),E.restore(),d&&(w.save(),w.beginPath(),w.rect(0,0,i,o),w.closePath(),w.setAttr("strokeStyle","red"),w.setAttr("lineWidth",5),w.stroke(),w.restore()),this._cache.set(oh,{scene:m,filter:y,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(oh)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{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}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=l.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==dCe&&(r=lI+de._capitalize(n),de._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(Dk,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(jk,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;fn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!ft.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==hCe&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(fd),this._clearSelfAndDescendantCache(Iu)),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(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new Ca,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(fd);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(fd),this._clearSelfAndDescendantCache(Iu),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var 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){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return de.warn("Node has no parent. moveToBottom function is ignored."),!1;var 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 de.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&de.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)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(mS,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=de.isObject(i)&&!de._isPlainObject(i)&&!de._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),de._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i{try{const i=t==null?void 0:t.callback;i&&delete t.callback,de._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}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():ft.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(r&&!this.isDragging()){var i=!1;fn._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=fn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&fn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return de.haveIntersection(r,this.getClientRect())}static create(t,n){return de._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=Nk.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),ft[r]||(de.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=ft[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}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(var n=0;n0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=Ge.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=Ge.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const d=r===this;if(u){o.save();var p=this.getAbsoluteTransform(r),m=p.getMatrix();if(o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath(),l)l.call(this,o,this);else{var y=this.clipX(),b=this.clipY();o.rect(y,b,a,s)}o.clip(),m=p.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var w=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";w&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(E){E[t](n,r)}),w&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(w){if(w.visible()){var E=w.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});E.width===0&&E.height===0||(o===void 0?(o=E.x,a=E.y,s=E.x+E.width,l=E.y+E.height):(o=Math.min(o,E.x),a=Math.min(a,E.y),s=Math.max(s,E.x+E.width),l=Math.max(l,E.y+E.height)))}});for(var p=this.find("Shape"),m=!1,y=0;ye.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",Og=e=>{const t=b1(e);if(t==="pointer")return ft.pointerEventsEnabled&&GC.pointer;if(t==="touch")return GC.touch;if(t==="mouse")return GC.mouse};function fI(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&de.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const wCe="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);",yS=[];let f4=class extends Ma{constructor(t){super(fI(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),yS.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{fI(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||de.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===vCe){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}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(){var t=this.children,n=t.length,r;for(r=0;r-1&&yS.splice(n,1),de.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}:(de.warn(wCe),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.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();var n=new Im({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+dI,this.content.style.height=n+dI),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;rxCe&&de.warn("The stage has "+i+" 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(),ft.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return iV(t,this)}setPointerCapture(t){oV(t,this)}releaseCapture(t){G1(t)}getLayers(){return this.children}_bindContentEvents(){ft.isBrowser&&SCe.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=Og(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=Og(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=Og(t.type),r=b1(t.type);if(n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!fn.isDragging||ft.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=Og(t.type),r=b1(t.type);if(n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(fn.justDragged=!1,ft["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;ft.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=Og(t.type),r=b1(t.type);if(!n)return;fn.isDragging&&fn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!fn.isDragging||ft.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=VC(l.id)||this.getIntersection(l),d=l.id,p={evt:t,pointerId:d};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},p),u),s._fireAndBubble(n.pointerleave,Object.assign({},p),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},p),s),u._fireAndBubble(n.pointerenter,Object.assign({},p),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},p))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:d}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=Og(t.type),r=b1(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=VC(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const d=l.id,p={evt:t,pointerId:d};let m=!1;ft["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):fn.justDragged||(ft["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){ft["_"+r+"InDblClickWindow"]=!1},ft.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},p)),ft["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},p)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},p)))):(this[r+"ClickEndShape"]=null,ft["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:d}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:d}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),ft["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble($k,{evt:t}):this._fire($k,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Fk,{evt:t}):this._fire(Fk,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=VC(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(lm,AE(t)),G1(t.pointerId)}_lostpointercapture(t){G1(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}])}_setPointerPosition(t){de.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};var 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 Im({width:this.width(),height:this.height()}),this.bufferHitCanvas=new LE({pixelRatio:1,width:this.width(),height:this.height()}),!!ft.isBrowser){var 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 de.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}};f4.prototype.nodeType=mCe;Mr(f4);J.addGetterSetter(f4,"container");var mV="hasShadow",vV="shadowRGBA",yV="patternImage",bV="linearGradient",xV="radialGradient";let hx;function qC(){return hx||(hx=de.createCanvasElement().getContext("2d"),hx)}const q1={};function CCe(e){e.fill()}function _Ce(e){e.stroke()}function kCe(e){e.fill()}function ECe(e){e.stroke()}function PCe(){this._clearCache(mV)}function TCe(){this._clearCache(vV)}function MCe(){this._clearCache(yV)}function LCe(){this._clearCache(bV)}function ACe(){this._clearCache(xV)}class $e extends Ge{constructor(t){super(t);let n;for(;n=de.getRandomColor(),!(n&&!(n in q1)););this.colorKey=n,q1[n]=this}getContext(){return de.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return de.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(mV,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(yV,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=qC();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new Ca;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(ft.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(bV,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=qC(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.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){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return Ge.prototype.destroy.call(this),delete q1[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){de.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var 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={}){const n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,u=!t.skipShadow&&this.hasShadow(),d=u?this.shadowOffsetX():0,p=u?this.shadowOffsetY():0,m=s+Math.abs(d),y=l+Math.abs(p),b=u&&this.shadowBlur()||0,w=m+b*2,E=y+b*2,_={width:w,height:E,x:-(a/2+b)+Math.min(d,0)+i.x,y:-(a/2+b)+Math.min(p,0)+i.y};return n?_:this._transformedRect(_,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,d,p,m=i.isCache,y=n===this;if(!this.isVisible()&&!y)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),d=u.bufferCanvas,p=d.getContext(),p.clear(),p.save(),p._applyLineJoin(this);var w=this.getAbsoluteTransform(n).getMatrix();p.transform(w[0],w[1],w[2],w[3],w[4],w[5]),s.call(this,p,this),p.restore();var E=d.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(d._canvas,0,0,d.width/E,d.height/E)}else{if(o._applyLineJoin(this),!y){var w=this.getAbsoluteTransform(n).getMatrix();o.transform(w[0],w[1],w[2],w[3],w[4],w[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||de.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()"),u){a.save();var d=this.getAbsoluteTransform(n).getMatrix();return a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var m=this.getAbsoluteTransform(n).getMatrix();a.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,u,d,p,m,y;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,d=u.length,p=de._hexToRgb(this.colorKey),m=0;mt?(u[m]=p.r,u[m+1]=p.g,u[m+2]=p.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){de.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return iV(t,this)}setPointerCapture(t){oV(t,this)}releaseCapture(t){G1(t)}}$e.prototype._fillFunc=CCe;$e.prototype._strokeFunc=_Ce;$e.prototype._fillFuncHit=kCe;$e.prototype._strokeFuncHit=ECe;$e.prototype._centroid=!1;$e.prototype.nodeType="Shape";Mr($e);$e.prototype.eventListeners={};$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",PCe);$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",TCe);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",MCe);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",LCe);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",ACe);J.addGetterSetter($e,"stroke",void 0,nV());J.addGetterSetter($e,"strokeWidth",2,Ve());J.addGetterSetter($e,"fillAfterStrokeEnabled",!1);J.addGetterSetter($e,"hitStrokeWidth","auto",ME());J.addGetterSetter($e,"strokeHitEnabled",!0,el());J.addGetterSetter($e,"perfectDrawEnabled",!0,el());J.addGetterSetter($e,"shadowForStrokeEnabled",!0,el());J.addGetterSetter($e,"lineJoin");J.addGetterSetter($e,"lineCap");J.addGetterSetter($e,"sceneFunc");J.addGetterSetter($e,"hitFunc");J.addGetterSetter($e,"dash");J.addGetterSetter($e,"dashOffset",0,Ve());J.addGetterSetter($e,"shadowColor",void 0,b0());J.addGetterSetter($e,"shadowBlur",0,Ve());J.addGetterSetter($e,"shadowOpacity",1,Ve());J.addComponentsGetterSetter($e,"shadowOffset",["x","y"]);J.addGetterSetter($e,"shadowOffsetX",0,Ve());J.addGetterSetter($e,"shadowOffsetY",0,Ve());J.addGetterSetter($e,"fillPatternImage");J.addGetterSetter($e,"fill",void 0,nV());J.addGetterSetter($e,"fillPatternX",0,Ve());J.addGetterSetter($e,"fillPatternY",0,Ve());J.addGetterSetter($e,"fillLinearGradientColorStops");J.addGetterSetter($e,"strokeLinearGradientColorStops");J.addGetterSetter($e,"fillRadialGradientStartRadius",0);J.addGetterSetter($e,"fillRadialGradientEndRadius",0);J.addGetterSetter($e,"fillRadialGradientColorStops");J.addGetterSetter($e,"fillPatternRepeat","repeat");J.addGetterSetter($e,"fillEnabled",!0);J.addGetterSetter($e,"strokeEnabled",!0);J.addGetterSetter($e,"shadowEnabled",!0);J.addGetterSetter($e,"dashEnabled",!0);J.addGetterSetter($e,"strokeScaleEnabled",!0);J.addGetterSetter($e,"fillPriority","color");J.addComponentsGetterSetter($e,"fillPatternOffset",["x","y"]);J.addGetterSetter($e,"fillPatternOffsetX",0,Ve());J.addGetterSetter($e,"fillPatternOffsetY",0,Ve());J.addComponentsGetterSetter($e,"fillPatternScale",["x","y"]);J.addGetterSetter($e,"fillPatternScaleX",1,Ve());J.addGetterSetter($e,"fillPatternScaleY",1,Ve());J.addComponentsGetterSetter($e,"fillLinearGradientStartPoint",["x","y"]);J.addComponentsGetterSetter($e,"strokeLinearGradientStartPoint",["x","y"]);J.addGetterSetter($e,"fillLinearGradientStartPointX",0);J.addGetterSetter($e,"strokeLinearGradientStartPointX",0);J.addGetterSetter($e,"fillLinearGradientStartPointY",0);J.addGetterSetter($e,"strokeLinearGradientStartPointY",0);J.addComponentsGetterSetter($e,"fillLinearGradientEndPoint",["x","y"]);J.addComponentsGetterSetter($e,"strokeLinearGradientEndPoint",["x","y"]);J.addGetterSetter($e,"fillLinearGradientEndPointX",0);J.addGetterSetter($e,"strokeLinearGradientEndPointX",0);J.addGetterSetter($e,"fillLinearGradientEndPointY",0);J.addGetterSetter($e,"strokeLinearGradientEndPointY",0);J.addComponentsGetterSetter($e,"fillRadialGradientStartPoint",["x","y"]);J.addGetterSetter($e,"fillRadialGradientStartPointX",0);J.addGetterSetter($e,"fillRadialGradientStartPointY",0);J.addComponentsGetterSetter($e,"fillRadialGradientEndPoint",["x","y"]);J.addGetterSetter($e,"fillRadialGradientEndPointX",0);J.addGetterSetter($e,"fillRadialGradientEndPointY",0);J.addGetterSetter($e,"fillPatternRotation",0);J.backCompat($e,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var OCe="#",RCe="beforeDraw",ICe="draw",SV=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],DCe=SV.length;let sp=class extends Ma{constructor(t){super(t),this.canvas=new Im,this.hitCanvas=new LE({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);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(RCe,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Ma.prototype.drawScene.call(this,i,n),this._fire(ICe,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Ma.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return de.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};sp.prototype.nodeType="Layer";Mr(sp);J.addGetterSetter(sp,"imageSmoothingEnabled",!0);J.addGetterSetter(sp,"clearBeforeDraw",!0);J.addGetterSetter(sp,"hitGraphEnabled",!0,el());class OE extends sp{constructor(t){super(t),this.listening(!1),de.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}OE.prototype.nodeType="FastLayer";Mr(OE);let Qm=class extends Ma{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&de.throw("You may only add groups and shapes to groups.")}};Qm.prototype.nodeType="Group";Mr(Qm);var KC=function(){return Rm.performance&&Rm.performance.now?function(){return Rm.performance.now()}:function(){return new Date().getTime()}}();class Ja{constructor(t,n){this.id=Ja.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:KC(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;ithis.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=hI,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=pI,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(){var t=this.getTimer()-this._startTime;this.state===hI?this.setTime(t):this.state===pI&&this.setTime(this.duration-t)}pause(){this.state=NCe,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Xr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||K1.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=$Ce++;var u=r.getLayer()||(r instanceof ft.Stage?r.getLayers():null);u||de.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Ja(function(){n.tween.onEnterFrame()},u),this.tween=new FCe(l,function(d){n._tweenFunc(d)},a,0,1,o*1e3,s),this._addListeners(),Xr.attrs[i]||(Xr.attrs[i]={}),Xr.attrs[i][this._id]||(Xr.attrs[i][this._id]={}),Xr.tweens[i]||(Xr.tweens[i]={});for(l in t)jCe[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,u,d,p,m;if(s=Xr.tweens[i][t],s&&delete Xr.attrs[i][s][t],o=r.getAttr(t),de._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(p=o,o=de._prepareArrayForTween(o,n,r.closed())):(d=n,n=de._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.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(){var t=this.node._id,n=this._id,r=Xr.tweens[t],i;this.pause();for(i in r)delete Xr.tweens[t][i];delete Xr.attrs[t][n]}}Xr.attrs={};Xr.tweens={};Ge.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Xr(e);n.play()};const K1={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),d=a*n,p=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:p,width:d-u,height:m-p}}}hc.prototype._centroid=!0;hc.prototype.className="Arc";hc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Mr(hc);J.addGetterSetter(hc,"innerRadius",0,Ve());J.addGetterSetter(hc,"outerRadius",0,Ve());J.addGetterSetter(hc,"angle",0,Ve());J.addGetterSetter(hc,"clockwise",!1,el());function Bk(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),d=a*l/(s+l),p=n-u*(i-e),m=r-u*(o-t),y=n+d*(i-e),b=r+d*(o-t);return[p,m,y,b]}function mI(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);ud?u:d,E=u>d?1:u/d,_=u>d?d/u:1;t.translate(s,l),t.rotate(y),t.scale(E,_),t.arc(0,0,w,p,p+m,1-b),t.scale(1/E,1/_),t.rotate(-y),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var d=u.points[4],p=u.points[5],m=u.points[4]+p,y=Math.PI/180;if(Math.abs(d-m)m;b-=y){const w=Fn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(w.x,w.y)}else for(let b=d+y;bthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return Fn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return Fn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return Fn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],d=a[3],p=a[4],m=a[5],y=a[6];return p+=m*t/o.pathLength,Fn.getPointOnEllipticalArc(s,l,u,d,p,y)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var k=null,T=[],L=l,O=u,D,I,N,U,B,K,ne,z,$,H;switch(y){case"l":l+=b.shift(),u+=b.shift(),k="L",T.push(l,u);break;case"L":l=b.shift(),u=b.shift(),T.push(l,u);break;case"m":var Y=b.shift(),Q=b.shift();if(l+=Y,u+=Q,k="M",a.length>2&&a[a.length-1].command==="z"){for(var q=a.length-2;q>=0;q--)if(a[q].command==="M"){l=a[q].points[0]+Y,u=a[q].points[1]+Q;break}}T.push(l,u),y="l";break;case"M":l=b.shift(),u=b.shift(),k="M",T.push(l,u),y="L";break;case"h":l+=b.shift(),k="L",T.push(l,u);break;case"H":l=b.shift(),k="L",T.push(l,u);break;case"v":u+=b.shift(),k="L",T.push(l,u);break;case"V":u=b.shift(),k="L",T.push(l,u);break;case"C":T.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"c":T.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="C",T.push(l,u);break;case"S":I=l,N=u,D=a[a.length-1],D.command==="C"&&(I=l+(l-D.points[2]),N=u+(u-D.points[3])),T.push(I,N,b.shift(),b.shift()),l=b.shift(),u=b.shift(),k="C",T.push(l,u);break;case"s":I=l,N=u,D=a[a.length-1],D.command==="C"&&(I=l+(l-D.points[2]),N=u+(u-D.points[3])),T.push(I,N,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="C",T.push(l,u);break;case"Q":T.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"q":T.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),k="Q",T.push(l,u);break;case"T":I=l,N=u,D=a[a.length-1],D.command==="Q"&&(I=l+(l-D.points[0]),N=u+(u-D.points[1])),l=b.shift(),u=b.shift(),k="Q",T.push(I,N,l,u);break;case"t":I=l,N=u,D=a[a.length-1],D.command==="Q"&&(I=l+(l-D.points[0]),N=u+(u-D.points[1])),l+=b.shift(),u+=b.shift(),k="Q",T.push(I,N,l,u);break;case"A":U=b.shift(),B=b.shift(),K=b.shift(),ne=b.shift(),z=b.shift(),$=l,H=u,l=b.shift(),u=b.shift(),k="A",T=this.convertEndpointToCenterParameterization($,H,l,u,ne,z,U,B,K);break;case"a":U=b.shift(),B=b.shift(),K=b.shift(),ne=b.shift(),z=b.shift(),$=l,H=u,l+=b.shift(),u+=b.shift(),k="A",T=this.convertEndpointToCenterParameterization($,H,l,u,ne,z,U,B,K);break}a.push({command:k||y,points:T,start:{x:L,y:O},pathLength:this.calcLength(L,O,k||y,T)})}(y==="z"||y==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=Fn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var d=i[4],p=i[5],m=i[4]+p,y=Math.PI/180;if(Math.abs(d-m)m;l-=y)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=d+y;l1&&(s*=Math.sqrt(y),l*=Math.sqrt(y));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(p*p))/(s*s*(m*m)+l*l*(p*p)));o===a&&(b*=-1),isNaN(b)&&(b=0);var w=b*s*m/l,E=b*-l*p/s,_=(t+r)/2+Math.cos(d)*w-Math.sin(d)*E,k=(n+i)/2+Math.sin(d)*w+Math.cos(d)*E,T=function(B){return Math.sqrt(B[0]*B[0]+B[1]*B[1])},L=function(B,K){return(B[0]*K[0]+B[1]*K[1])/(T(B)*T(K))},O=function(B,K){return(B[0]*K[1]=1&&(U=0),a===0&&U>0&&(U=U-2*Math.PI),a===1&&U<0&&(U=U+2*Math.PI),[_,k,s,l,D,U,d,a]}}Fn.prototype.className="Path";Fn.prototype._attrsAffectingSize=["data"];Mr(Fn);J.addGetterSetter(Fn,"data");class lp extends pc{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],y=Fn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=Fn.getPointOnQuadraticBezier(Math.min(1,1-a/y),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var d=(Math.atan2(u,l)+n)%n,p=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(d),t.moveTo(0,0),t.lineTo(-a,p/2),t.lineTo(-a,-p/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,p/2),t.lineTo(-a,-p/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}lp.prototype.className="Arrow";Mr(lp);J.addGetterSetter(lp,"pointerLength",10,Ve());J.addGetterSetter(lp,"pointerWidth",10,Ve());J.addGetterSetter(lp,"pointerAtBeginning",!1);J.addGetterSetter(lp,"pointerAtEnding",!0);let x0=class extends $e{_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)}};x0.prototype._centroid=!0;x0.prototype.className="Circle";x0.prototype._attrsAffectingSize=["radius"];Mr(x0);J.addGetterSetter(x0,"radius",0,Ve());class cf extends $e{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,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)}}cf.prototype.className="Ellipse";cf.prototype._centroid=!0;cf.prototype._attrsAffectingSize=["radiusX","radiusY"];Mr(cf);J.addComponentsGetterSetter(cf,"radius",["x","y"]);J.addGetterSetter(cf,"radiusX",0,Ve());J.addGetterSetter(cf,"radiusY",0,Ve());let uu=class wV extends $e{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let a;if(o){const s=this.attrs.cropWidth,l=this.attrs.cropHeight;s&&l?a=[o,this.cropX(),this.cropY(),s,l,0,0,n,r]:a=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?de.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),o&&(i&&t.clip(),t.drawImage.apply(t,a))}_hitFunc(t){var n=this.width(),r=this.height(),i=this.cornerRadius();t.beginPath(),i?de.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=de.createImageElement();i.onload=function(){var o=new wV({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};uu.prototype.className="Image";Mr(uu);J.addGetterSetter(uu,"cornerRadius",0,TE(4));J.addGetterSetter(uu,"image");J.addComponentsGetterSetter(uu,"crop",["x","y","width","height"]);J.addGetterSetter(uu,"cropX",0,Ve());J.addGetterSetter(uu,"cropY",0,Ve());J.addGetterSetter(uu,"cropWidth",0,Ve());J.addGetterSetter(uu,"cropHeight",0,Ve());var CV=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],BCe="Change.konva",zCe="none",zk="up",Hk="right",Wk="down",Uk="left",HCe=CV.length;class RE extends Qm{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}cp.prototype.className="RegularPolygon";cp.prototype._centroid=!0;cp.prototype._attrsAffectingSize=["radius"];Mr(cp);J.addGetterSetter(cp,"radius",0,Ve());J.addGetterSetter(cp,"sides",0,Ve());var vI=Math.PI*2;class dp extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,vI,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),vI,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)}}dp.prototype.className="Ring";dp.prototype._centroid=!0;dp.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Mr(dp);J.addGetterSetter(dp,"innerRadius",0,Ve());J.addGetterSetter(dp,"outerRadius",0,Ve());class cu extends $e{constructor(t){super(t),this._updated=!0,this.anim=new Ja(()=>{var n=this._updated;return this._updated=!1,n}),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){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],d=o[i+3],p=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,d),t.closePath(),t.fillStrokeShape(this)),p)if(a){var m=a[n],y=r*2;t.drawImage(p,s,l,u,d,m[y+0],m[y+1],u,d)}else t.drawImage(p,s,l,u,d,0,0,u,d)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],d=r*2;t.rect(u[d+0],u[d+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var 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(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var gx;function XC(){return gx||(gx=de.createCanvasElement().getContext(VCe),gx)}function n6e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function r6e(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function i6e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class Tr extends $e{constructor(t){super(i6e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(_+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=de._isString(t)?t:t==null?"":t+"";return this._setAttr(GCe,n),this}getWidth(){var t=this.attrs.width===Rg||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Rg||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return de.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=XC(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+px+this.fontVariant()+px+(this.fontSize()+XCe)+t6e(this.fontFamily())}_addTextLine(t){this.align()===Qv&&(t=t.trim());var r=this._getTextWidth(t);return this.textArr.push({text:t,width:r,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return XC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` +`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Rg&&o!==void 0,l=a!==Rg&&a!==void 0,u=this.padding(),d=o-u*2,p=a-u*2,m=0,y=this.wrap(),b=y!==xI,w=y!==JCe&&b,E=this.ellipsis();this.textArr=[],XC().font=this._getContextFont();for(var _=E?this._getTextWidth(YC):0,k=0,T=t.length;kd)for(;L.length>0;){for(var D=0,I=L.length,N="",U=0;D>>1,K=L.slice(0,B+1),ne=this._getTextWidth(K)+_;ne<=d?(D=B+1,N=K,U=ne):I=B}if(N){if(w){var z,$=L[N.length],H=$===px||$===yI;H&&U<=d?z=N.length:z=Math.max(N.lastIndexOf(px),N.lastIndexOf(yI))+1,z>0&&(D=z,N=N.slice(0,D),U=this._getTextWidth(N))}N=N.trimRight(),this._addTextLine(N),r=Math.max(r,U),m+=i;var Y=this._shouldHandleEllipsis(m);if(Y){this._tryToAddEllipsisToLastLine();break}if(L=L.slice(D),L=L.trimLeft(),L.length>0&&(O=this._getTextWidth(L),O<=d)){this._addTextLine(L),m+=i,r=Math.max(r,O);break}}else break}else this._addTextLine(L),m+=i,r=Math.max(r,O),this._shouldHandleEllipsis(m)&&kp)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Rg&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==xI;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Rg&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+YC)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var d=_V(this.text()),p=this.text().split(" ").length-1,m,y,b,w=-1,E=0,_=function(){E=0;for(var ne=t.dataArray,z=w+1;z0)return w=z,ne[z];ne[z].command==="M"&&(m={x:ne[z].points[0],y:ne[z].points[1]})}return{}},k=function(ne){var z=t._getTextSize(ne).width+r;ne===" "&&i==="justify"&&(z+=(s-a)/p);var $=0,H=0;for(y=void 0;Math.abs(z-$)/z>.01&&H<20;){H++;for(var Y=$;b===void 0;)b=_(),b&&Y+b.pathLengthz?y=Fn.getPointOnLine(z,m.x,m.y,b.points[0],b.points[1],m.x,m.y):b=void 0;break;case"A":var q=b.points[4],X=b.points[5],ee=b.points[4]+X;E===0?E=q+1e-8:z>$?E+=Math.PI/180*X/Math.abs(X):E-=Math.PI/360*X/Math.abs(X),(X<0&&E=0&&E>ee)&&(E=ee,Q=!0),y=Fn.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],E,b.points[6]);break;case"C":E===0?z>b.pathLength?E=1e-8:E=z/b.pathLength:z>$?E+=(z-$)/b.pathLength/2:E=Math.max(E-($-z)/b.pathLength/2,0),E>1&&(E=1,Q=!0),y=Fn.getPointOnCubicBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case"Q":E===0?E=z/b.pathLength:z>$?E+=(z-$)/b.pathLength:E-=($-z)/b.pathLength,E>1&&(E=1,Q=!0),y=Fn.getPointOnQuadraticBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}y!==void 0&&($=Fn.getLineLength(m.x,m.y,y.x,y.y)),Q&&(Q=!1,b=void 0)}},T="C",L=t._getTextSize(T).width+r,O=u/L-1,D=0;De+`.${AV}`).join(" "),SI="nodesRect",s6e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],l6e={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const u6e="ontouchstart"in ft._global;function c6e(e,t){if(e==="rotater")return"crosshair";t+=de.degToRad(l6e[e]||0);var n=(de.radToDeg(t)%360+360)%360;return de._inRange(n,315+22.5,360)||de._inRange(n,0,22.5)?"ns-resize":de._inRange(n,45-22.5,45+22.5)?"nesw-resize":de._inRange(n,90-22.5,90+22.5)?"ew-resize":de._inRange(n,135-22.5,135+22.5)?"nwse-resize":de._inRange(n,180-22.5,180+22.5)?"ns-resize":de._inRange(n,225-22.5,225+22.5)?"nesw-resize":de._inRange(n,270-22.5,270+22.5)?"ew-resize":de._inRange(n,315-22.5,315+22.5)?"nwse-resize":(de.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var A3=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],wI=1e8;function d6e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function OV(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function f6e(e,t){const n=d6e(e);return OV(e,t,n)}function h6e(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(s6e.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=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(SI),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(SI,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(ft.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),d={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return OV(d,-ft.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-wI,y:-wI,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const d=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var p=[{x:d.x,y:d.y},{x:d.x+d.width,y:d.y},{x:d.x+d.width,y:d.y+d.height},{x:d.x,y:d.y+d.height}],m=u.getAbsoluteTransform();p.forEach(function(y){var b=m.point(y);n.push(b)})});const r=new Ca;r.rotate(-ft.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var d=r.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:ft.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(),A3.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new v2({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:u6e?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=ft.getAngle(this.rotation()),o=c6e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new $e({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*de._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),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;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const d=o.getAbsolutePosition();if(!(u.x===d.x&&u.y===d.y)){if(this._movingAnchorName==="rotater"){var p=this._getNodeRect();n=o.x()-p.width/2,r=-o.y()+p.height/2;let ne=Math.atan2(-r,n)+Math.PI/2;p.height<0&&(ne-=Math.PI);var m=ft.getAngle(this.rotation());const z=m+ne,$=ft.getAngle(this.rotationSnapTolerance()),Y=h6e(this.rotationSnaps(),z,$)-p.rotation,Q=f6e(p,Y);this._fitNodesInto(Q,t);return}var y=this.keepRatio()||t.shiftKey,k=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(y){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(b.y-o.y(),2));var w=this.findOne(".top-left").x()>b.x?-1:1,E=this.findOne(".top-left").y()>b.y?-1:1;n=i*this.cos*w,r=i*this.sin*E,this.findOne(".top-left").x(b.x-n),this.findOne(".top-left").y(b.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(y){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-b.x,2)+Math.pow(b.y-o.y(),2));var w=this.findOne(".top-right").x()b.y?-1:1;n=i*this.cos*w,r=i*this.sin*E,this.findOne(".top-right").x(b.x+n),this.findOne(".top-right").y(b.y-r)}var _=o.position();this.findOne(".top-left").y(_.y),this.findOne(".bottom-right").x(_.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(y){var b=k?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(o.y()-b.y,2));var w=b.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(de._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(de._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new Ca;if(a.rotate(ft.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const p=a.point({x:-this.padding()*2,y:0});if(t.x+=p.x,t.y+=p.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const p=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const p=a.point({x:0,y:-this.padding()*2});if(t.x+=p.x,t.y+=p.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const p=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const p=this.boundBoxFunc()(r,t);p?t=p:de.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new Ca;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new Ca;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const d=u.multiply(l.invert());this._nodes.forEach(p=>{var m;const y=p.getParent().getAbsoluteTransform(),b=p.getTransform().copy();b.translate(p.offsetX(),p.offsetY());const w=new Ca;w.multiply(y.copy().invert()).multiply(d).multiply(y).multiply(b);const E=w.decompose();p.setAttrs(E),this._fire("transform",{evt:n,target:p}),p._fire("transform",{evt:n,target:p}),(m=p.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(de._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(de._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach(u=>{u.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*de._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Qm.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Ge.prototype.toObject.call(this)}clone(t){var n=Ge.prototype.clone.call(this,t);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};function p6e(e){return e instanceof Array||de.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){A3.indexOf(t)===-1&&de.warn("Unknown anchor name: "+t+". Available names are: "+A3.join(", "))}),e||[]}Tn.prototype.className="Transformer";Mr(Tn);J.addGetterSetter(Tn,"enabledAnchors",A3,p6e);J.addGetterSetter(Tn,"flipEnabled",!0,el());J.addGetterSetter(Tn,"resizeEnabled",!0);J.addGetterSetter(Tn,"anchorSize",10,Ve());J.addGetterSetter(Tn,"rotateEnabled",!0);J.addGetterSetter(Tn,"rotationSnaps",[]);J.addGetterSetter(Tn,"rotateAnchorOffset",50,Ve());J.addGetterSetter(Tn,"rotationSnapTolerance",5,Ve());J.addGetterSetter(Tn,"borderEnabled",!0);J.addGetterSetter(Tn,"anchorStroke","rgb(0, 161, 255)");J.addGetterSetter(Tn,"anchorStrokeWidth",1,Ve());J.addGetterSetter(Tn,"anchorFill","white");J.addGetterSetter(Tn,"anchorCornerRadius",0,Ve());J.addGetterSetter(Tn,"borderStroke","rgb(0, 161, 255)");J.addGetterSetter(Tn,"borderStrokeWidth",1,Ve());J.addGetterSetter(Tn,"borderDash");J.addGetterSetter(Tn,"keepRatio",!0);J.addGetterSetter(Tn,"centeredScaling",!1);J.addGetterSetter(Tn,"ignoreStroke",!1);J.addGetterSetter(Tn,"padding",0,Ve());J.addGetterSetter(Tn,"node");J.addGetterSetter(Tn,"nodes");J.addGetterSetter(Tn,"boundBoxFunc");J.addGetterSetter(Tn,"anchorDragBoundFunc");J.addGetterSetter(Tn,"shouldOverdrawWholeArea",!1);J.addGetterSetter(Tn,"useSingleNodeRotation",!0);J.backCompat(Tn,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class gc extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,ft.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)}}gc.prototype.className="Wedge";gc.prototype._centroid=!0;gc.prototype._attrsAffectingSize=["radius"];Mr(gc);J.addGetterSetter(gc,"radius",0,Ve());J.addGetterSetter(gc,"angle",0,Ve());J.addGetterSetter(gc,"clockwise",!1);J.backCompat(gc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function CI(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var g6e=[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],m6e=[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 v6e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,d,p,m,y,b,w,E,_,k,T,L,O,D,I,N,U,B,K,ne,z=t+t+1,$=r-1,H=i-1,Y=t+1,Q=Y*(Y+1)/2,q=new CI,X=null,ee=q,fe=null,ke=null,we=g6e[t],xe=m6e[t];for(s=1;s>xe,K!==0?(K=255/K,n[d]=(m*we>>xe)*K,n[d+1]=(y*we>>xe)*K,n[d+2]=(b*we>>xe)*K):n[d]=n[d+1]=n[d+2]=0,m-=E,y-=_,b-=k,w-=T,E-=fe.r,_-=fe.g,k-=fe.b,T-=fe.a,l=p+((l=o+t+1)<$?l:$)<<2,L+=fe.r=n[l],O+=fe.g=n[l+1],D+=fe.b=n[l+2],I+=fe.a=n[l+3],m+=L,y+=O,b+=D,w+=I,fe=fe.next,E+=N=ke.r,_+=U=ke.g,k+=B=ke.b,T+=K=ke.a,L-=N,O-=U,D-=B,I-=K,ke=ke.next,d+=4;p+=r}for(o=0;o>xe,K>0?(K=255/K,n[l]=(m*we>>xe)*K,n[l+1]=(y*we>>xe)*K,n[l+2]=(b*we>>xe)*K):n[l]=n[l+1]=n[l+2]=0,m-=E,y-=_,b-=k,w-=T,E-=fe.r,_-=fe.g,k-=fe.b,T-=fe.a,l=o+((l=a+Y)0&&v6e(t,n)};J.addGetterSetter(Ge,"blurRadius",0,Ve(),J.afterSetFilter);const b6e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};J.addGetterSetter(Ge,"contrast",0,Ve(),J.afterSetFilter);const S6e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,d=l*4,p=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:de.error("Unknown emboss direction: "+r)}do{var m=(p-1)*d,y=o;p+y<1&&(y=0),p+y>u&&(y=0);var b=(p-1+y)*l*4,w=l;do{var E=m+(w-1)*4,_=a;w+_<1&&(_=0),w+_>l&&(_=0);var k=b+(w-1+_)*4,T=s[E]-s[k],L=s[E+1]-s[k+1],O=s[E+2]-s[k+2],D=T,I=D>0?D:-D,N=L>0?L:-L,U=O>0?O:-O;if(N>I&&(D=L),U>I&&(D=O),D*=t,i){var B=s[E]+D,K=s[E+1]+D,ne=s[E+2]+D;s[E]=B>255?255:B<0?0:B,s[E+1]=K>255?255:K<0?0:K,s[E+2]=ne>255?255:ne<0?0:ne}else{var z=n-D;z<0?z=0:z>255&&(z=255),s[E]=s[E+1]=s[E+2]=z}}while(--w)}while(--p)};J.addGetterSetter(Ge,"embossStrength",.5,Ve(),J.afterSetFilter);J.addGetterSetter(Ge,"embossWhiteLevel",.5,Ve(),J.afterSetFilter);J.addGetterSetter(Ge,"embossDirection","top-left",null,J.afterSetFilter);J.addGetterSetter(Ge,"embossBlend",!1,null,J.afterSetFilter);function ZC(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const w6e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],d=u,p,m,y=this.enhance();if(y!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),p=t[m+2],pd&&(d=p);i===r&&(i=255,r=0),s===a&&(s=255,a=0),d===u&&(d=255,u=0);var b,w,E,_,k,T,L,O,D;for(y>0?(w=i+y*(255-i),E=r-y*(r-0),k=s+y*(255-s),T=a-y*(a-0),O=d+y*(255-d),D=u-y*(u-0)):(b=(i+r)*.5,w=i+y*(i-b),E=r+y*(r-b),_=(s+a)*.5,k=s+y*(s-_),T=a+y*(a-_),L=(d+u)*.5,O=d+y*(d-L),D=u+y*(u-L)),m=0;m_?E:_;var k=a,T=o,L,O,D=360/T*Math.PI/180,I,N;for(O=0;OT?k:T;var L=a,O=o,D,I,N=n.polarRotation||0,U,B;for(d=0;dt&&(L=T,O=0,D=-1),i=0;i=0&&y=0&&b=0&&y=0&&b=255*4?255:0}return a}function D6e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s=0&&y=0&&b=n))for(o=w;o=r||(a=(n*o+i)*4,s+=L[a+0],l+=L[a+1],u+=L[a+2],d+=L[a+3],T+=1);for(s=s/T,l=l/T,u=u/T,d=d/T,i=y;i=n))for(o=w;o=r||(a=(n*o+i)*4,L[a+0]=s,L[a+1]=l,L[a+2]=u,L[a+3]=d)}};J.addGetterSetter(Ge,"pixelSize",8,Ve(),J.afterSetFilter);const F6e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});J.addGetterSetter(Ge,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});J.addGetterSetter(Ge,"blue",0,tV,J.afterSetFilter);const z6e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s255?255:e<0?0:Math.round(e)});J.addGetterSetter(Ge,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});J.addGetterSetter(Ge,"blue",0,tV,J.afterSetFilter);J.addGetterSetter(Ge,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const H6e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),d>127&&(d=255-d),p>127&&(p=255-p),t[l]=u,t[l+1]=d,t[l+2]=p}while(--s)}while(--o)},U6e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new $g.Stage({container:i,width:n,height:r}),a=new $g.Layer,s=new $g.Layer;a.add(new $g.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new $g.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l};let RV=null,IV=null;const G6e=e=>{RV=e},Qs=()=>RV,q6e=e=>{IV=e},DV=()=>IV,K6e=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},jV=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),Y6e=e=>{const t=Qs(),{generationMode:n,generationState:r,postprocessingState:i,canvasState:o,systemState:a}=e,{codeformerFidelity:s,facetoolStrength:l,facetoolType:u,hiresFix:d,hiresStrength:p,shouldRunESRGAN:m,shouldRunFacetool:y,upscalingLevel:b,upscalingStrength:w,upscalingDenoising:E}=i,{cfgScale:_,height:k,img2imgStrength:T,infillMethod:L,initialImage:O,iterations:D,perlin:I,prompt:N,negativePrompt:U,sampler:B,seamBlur:K,seamless:ne,seamSize:z,seamSteps:$,seamStrength:H,seed:Y,seedWeights:Q,shouldFitToWidthHeight:q,shouldGenerateVariations:X,shouldRandomizeSeed:ee,steps:fe,threshold:ke,tileSize:we,variationAmount:xe,width:Le,shouldUseSymmetry:Se,horizontalSymmetryTimePercentage:Qe,verticalSymmetryTimePercentage:Xe}=r,{shouldDisplayInProgressType:tt,saveIntermediatesInterval:yt,enableImageDebugging:Be}=a,Ae={prompt:N,iterations:D,steps:fe,cfg_scale:_,threshold:ke,perlin:I,height:k,width:Le,sampler_name:B,seed:Y,progress_images:tt==="full-res",progress_latents:tt==="latents",save_intermediates:yt,generation_mode:n,init_mask:""};let bt=!1,Fe=!1;if(U!==""&&(Ae.prompt=`${N} [${U}]`),Ae.seed=ee?jV(EE,PE):Y,Se&&(Qe>0&&(Ae.h_symmetry_time_pct=Math.max(0,Math.min(1,Qe/fe))),Qe>0&&(Ae.v_symmetry_time_pct=Math.max(0,Math.min(1,Xe/fe)))),n==="txt2img"&&(Ae.hires_fix=d,d&&(Ae.strength=p)),["txt2img","img2img"].includes(n)&&(Ae.seamless=ne,m&&(bt={level:b,denoise_str:E,strength:w}),y&&(Fe={type:u,strength:l},u==="codeformer"&&(Fe.codeformer_fidelity=s))),n==="img2img"&&O&&(Ae.init_img=typeof O=="string"?O:O.url,Ae.strength=T,Ae.fit=q),n==="unifiedCanvas"&&t){const{layerState:{objects:at},boundingBoxCoordinates:jt,boundingBoxDimensions:mt,stageScale:Zt,isMaskEnabled:on,shouldPreserveMaskedArea:se,boundingBoxScaleMethod:Ie,scaledBoundingBoxDimensions:He}=o,Ue={...jt,...mt},ye=V6e(on?at.filter(gE):[],Ue);Ae.init_mask=ye,Ae.fit=!1,Ae.strength=T,Ae.invert_mask=se,Ae.bounding_box=Ue;const je=t.scale();t.scale({x:1/Zt,y:1/Zt});const vt=t.getAbsolutePosition(),Mt=t.toDataURL({x:Ue.x+vt.x,y:Ue.y+vt.y,width:Ue.width,height:Ue.height});Be&&K6e([{base64:ye,caption:"mask sent as init_mask"},{base64:Mt,caption:"image sent as init_img"}]),t.scale(je),Ae.init_img=Mt,Ae.progress_images=!1,Ie!=="none"&&(Ae.inpaint_width=He.width,Ae.inpaint_height=He.height),Ae.seam_size=z,Ae.seam_blur=K,Ae.seam_strength=H,Ae.seam_steps=$,Ae.tile_size=we,Ae.infill_method=L,Ae.force_outpaint=!1}return X?(Ae.variation_amount=xe,Q&&(Ae.with_variations=I3e(Q))):Ae.variation_amount=0,Be&&(Ae.enable_image_debugging=Be),{generationParameters:Ae,esrganParameters:bt,facetoolParameters:Fe}};var X6e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,Z6e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,Q6e=/[^-+\dA-Z]/g;function Ti(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(_I[t]||t||_I.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},d=function(){return e[o()+"Hours"]()},p=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},y=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},w=function(){return J6e(e)},E=function(){return e_e(e)},_={d:function(){return a()},dd:function(){return xa(a())},ddd:function(){return zo.dayNames[s()]},DDD:function(){return kI({y:u(),m:l(),d:a(),_:o(),dayName:zo.dayNames[s()],short:!0})},dddd:function(){return zo.dayNames[s()+7]},DDDD:function(){return kI({y:u(),m:l(),d:a(),_:o(),dayName:zo.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return xa(l()+1)},mmm:function(){return zo.monthNames[l()]},mmmm:function(){return zo.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return xa(u(),4)},h:function(){return d()%12||12},hh:function(){return xa(d()%12||12)},H:function(){return d()},HH:function(){return xa(d())},M:function(){return p()},MM:function(){return xa(p())},s:function(){return m()},ss:function(){return xa(m())},l:function(){return xa(y(),3)},L:function(){return xa(Math.floor(y()/10))},t:function(){return d()<12?zo.timeNames[0]:zo.timeNames[1]},tt:function(){return d()<12?zo.timeNames[2]:zo.timeNames[3]},T:function(){return d()<12?zo.timeNames[4]:zo.timeNames[5]},TT:function(){return d()<12?zo.timeNames[6]:zo.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":t_e(e)},o:function(){return(b()>0?"-":"+")+xa(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+xa(Math.floor(Math.abs(b())/60),2)+":"+xa(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return w()},WW:function(){return xa(w())},N:function(){return E()}};return t.replace(X6e,function(k){return k in _?_[k]():k.slice(1,k.length-1)})}var _I={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},zo={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},xa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},kI=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,d=new Date;d.setDate(d[o+"Date"]()-1);var p=new Date;p.setDate(p[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},y=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},w=function(){return d[o+"Date"]()},E=function(){return d[o+"Month"]()},_=function(){return d[o+"FullYear"]()},k=function(){return p[o+"Date"]()},T=function(){return p[o+"Month"]()},L=function(){return p[o+"FullYear"]()};return b()===n&&y()===r&&m()===i?l?"Tdy":"Today":_()===n&&E()===r&&w()===i?l?"Ysd":"Yesterday":L()===n&&T()===r&&k()===i?l?"Tmw":"Tomorrow":a},J6e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},e_e=function(t){var n=t.getDay();return n===0&&(n=7),n},t_e=function(t){return(String(t).match(Z6e)||[""]).pop().replace(Q6e,"").replace(/GMT\+0000/g,"UTC")};const n_e=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(wa(!0));const o=r(),{generation:a,postprocessing:s,system:l,canvas:u}=o,d={generationMode:i,generationState:a,postprocessingState:s,canvasState:u,systemState:l};n(E4e());const{generationParameters:p,esrganParameters:m,facetoolParameters:y}=Y6e(d);t.emit("generateImage",p,m,y),p.init_mask&&(p.init_mask=p.init_mask.substr(0,64).concat("...")),p.init_img&&(p.init_img=p.init_img.substr(0,64).concat("...")),n(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...p,...m,...y})}`}))},emitRunESRGAN:i=>{n(wa(!0));const{postprocessing:{upscalingLevel:o,upscalingDenoising:a,upscalingStrength:s}}=r(),l={upscale:[o,a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(wa(!0));const{postprocessing:{facetoolType:o,facetoolStrength:a,codeformerFidelity:s}}=r(),l={facetool_strength:a};o==="codeformer"&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",i,{type:o,...l}),n(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Face restoration (${o}) requested: ${JSON.stringify({file:i.url,...l})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(tU(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:i=>{t.emit("searchForModels",i)},emitAddNewModel:i=>{t.emit("addNewModel",i)},emitDeleteModel:i=>{t.emit("deleteModel",i)},emitConvertToDiffusers:i=>{n(w4e()),t.emit("convertToDiffusers",i)},emitMergeDiffusersModels:i=>{n(C4e()),t.emit("mergeDiffusersModels",i)},emitRequestModelChange:i=>{n(S4e()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}};let vx;const r_e=new Uint8Array(16);function i_e(){if(!vx&&(vx=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vx))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vx(r_e)}const Hi=[];for(let e=0;e<256;++e)Hi.push((e+256).toString(16).slice(1));function o_e(e,t=0){return(Hi[e[t+0]]+Hi[e[t+1]]+Hi[e[t+2]]+Hi[e[t+3]]+"-"+Hi[e[t+4]]+Hi[e[t+5]]+"-"+Hi[e[t+6]]+Hi[e[t+7]]+"-"+Hi[e[t+8]]+Hi[e[t+9]]+"-"+Hi[e[t+10]]+Hi[e[t+11]]+Hi[e[t+12]]+Hi[e[t+13]]+Hi[e[t+14]]+Hi[e[t+15]]).toLowerCase()}const a_e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),EI={randomUUID:a_e};function um(e,t,n){if(EI.randomUUID&&!t&&!e)return EI.randomUUID();e=e||{};const r=e.random||(e.rng||i_e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return o_e(r)}const Vk=br("socketio/generateImage"),s_e=br("socketio/runESRGAN"),l_e=br("socketio/runFacetool"),u_e=br("socketio/deleteImage"),Gk=br("socketio/requestImages"),PI=br("socketio/requestNewImages"),c_e=br("socketio/cancelProcessing"),d_e=br("socketio/requestSystemConfig"),TI=br("socketio/searchForModels"),y2=br("socketio/addNewModel"),f_e=br("socketio/deleteModel"),h_e=br("socketio/convertToDiffusers"),p_e=br("socketio/mergeDiffusersModels"),NV=br("socketio/requestModelChange"),g_e=br("socketio/saveStagingAreaImageToGallery"),m_e=br("socketio/requestEmptyTempFolder"),v_e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(UR(!0)),t(hh(Et.t("common.statusConnected"))),t(d_e());const r=n().gallery;r.categories.result.latest_mtime?t(PI("result")):t(Gk("result")),r.categories.user.latest_mtime?t(PI("user")):t(Gk("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(UR(!1)),t(hh(Et.t("common.statusDisconnected"))),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{activeTab:o}=i.ui,{shouldLoopback:a}=i.postprocessing,{boundingBox:s,generationMode:l,...u}=r,d={uuid:um(),...u};if(["txt2img","img2img"].includes(l)&&t(sm({category:"result",image:{...d,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:p}=r;t(JSe({image:{...d,category:"temp"},boundingBox:p})),i.canvas.shouldAutoSave&&t(sm({image:{...d,category:"result"},category:"result"}))}if(a)switch(CE[o]){case"img2img":{t(v0(d));break}}t($C()),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(w3e({uuid:um(),...r,category:"result"})),r.isBase64||t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(sm({category:"result",image:{uuid:um(),...r,category:"result"}})),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(wa(!0)),t(v4e(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(VR()),t($C())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:um(),...l}));t(S3e({images:s,areMoreImagesAvailable:o,category:a})),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(x4e());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(sm({category:"result",image:r})),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t($C())),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(tU(r));const{generation:{initialImage:o,maskPath:a}}=n();(o===i||(o==null?void 0:o.url)===i)&&t(aU()),a===i&&t(uU("")),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(y4e(r)),r.infill_methods.includes("patchmatch")||t(lU(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(DU(i)),t(jU(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(Ag(o)),t(wa(!1)),t(hh(Et.t("modelManager.modelAdded"))),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t($u({title:a?`${Et.t("modelManager.modelUpdated")}: ${i}`:`${Et.t("modelManager.modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(Ag(o)),t(wa(!1)),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`${Et.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t($u({title:`${Et.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelConverted:r=>{const{converted_model_name:i,model_list:o}=r;t(Ag(o)),t(hh(Et.t("common.statusModelConverted"))),t(wa(!1)),t(_d(!0)),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Model converted: ${i}`,level:"info"})),t($u({title:`${Et.t("modelmanager:modelConverted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelsMerged:r=>{const{merged_models:i,merged_model_name:o,model_list:a}=r;t(Ag(a)),t(hh(Et.t("common.statusMergedModels"))),t(wa(!1)),t(_d(!0)),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Models merged: ${i}`,level:"info"})),t($u({title:`${Et.t("modelManager.modelsMerged")}: ${o}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(Ag(o)),t(hh(Et.t("common.statusModelChanged"))),t(wa(!1)),t(_d(!0)),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(Ag(o)),t(wa(!1)),t(_d(!0)),t(VR()),t(Pi({timestamp:Ti(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t($u({title:Et.t("toast.tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},y_e=()=>{const{origin:e}=new URL(window.location.href),t=gS(e,{timeout:6e4,path:`${window.location.pathname}socket.io`});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:d,onGenerationResult:p,onIntermediateResult:m,onProgressUpdate:y,onGalleryImages:b,onProcessingCanceled:w,onImageDeleted:E,onSystemConfig:_,onModelChanged:k,onFoundModels:T,onNewModelAdded:L,onModelDeleted:O,onModelConverted:D,onModelsMerged:I,onModelChangeFailed:N,onTempFolderEmptied:U}=v_e(i),{emitGenerateImage:B,emitRunESRGAN:K,emitRunFacetool:ne,emitDeleteImage:z,emitRequestImages:$,emitRequestNewImages:H,emitCancelProcessing:Y,emitRequestSystemConfig:Q,emitSearchForModels:q,emitAddNewModel:X,emitDeleteModel:ee,emitConvertToDiffusers:fe,emitMergeDiffusersModels:ke,emitRequestModelChange:we,emitSaveStagingAreaImageToGallery:xe,emitRequestEmptyTempFolder:Le}=n_e(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",Se=>u(Se)),t.on("generationResult",Se=>p(Se)),t.on("postprocessingResult",Se=>d(Se)),t.on("intermediateResult",Se=>m(Se)),t.on("progressUpdate",Se=>y(Se)),t.on("galleryImages",Se=>b(Se)),t.on("processingCanceled",()=>{w()}),t.on("imageDeleted",Se=>{E(Se)}),t.on("systemConfig",Se=>{_(Se)}),t.on("foundModels",Se=>{T(Se)}),t.on("newModelAdded",Se=>{L(Se)}),t.on("modelDeleted",Se=>{O(Se)}),t.on("modelConverted",Se=>{D(Se)}),t.on("modelsMerged",Se=>{I(Se)}),t.on("modelChanged",Se=>{k(Se)}),t.on("modelChangeFailed",Se=>{N(Se)}),t.on("tempFolderEmptied",()=>{U()}),n=!0),a.type){case"socketio/generateImage":{B(a.payload);break}case"socketio/runESRGAN":{K(a.payload);break}case"socketio/runFacetool":{ne(a.payload);break}case"socketio/deleteImage":{z(a.payload);break}case"socketio/requestImages":{$(a.payload);break}case"socketio/requestNewImages":{H(a.payload);break}case"socketio/cancelProcessing":{Y();break}case"socketio/requestSystemConfig":{Q();break}case"socketio/searchForModels":{q(a.payload);break}case"socketio/addNewModel":{X(a.payload);break}case"socketio/deleteModel":{ee(a.payload);break}case"socketio/convertToDiffusers":{fe(a.payload);break}case"socketio/mergeDiffusersModels":{ke(a.payload);break}case"socketio/requestModelChange":{we(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{xe(a.payload);break}case"socketio/requestEmptyTempFolder":{Le();break}}o(a)}},b_e=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),x_e=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel","cancelOptions.cancelAfter"].map(e=>`system.${e}`),S_e=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),$V=CW({generation:B3e,postprocessing:V3e,gallery:M3e,system:M4e,canvas:b3e,ui:B4e,lightbox:O3e}),w_e=IW.getPersistConfig({key:"root",storage:RW,rootReducer:$V,blacklist:[...b_e,...x_e,...S_e],debounce:300}),C_e=ESe(w_e,$V),FV=nSe({reducer:C_e,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(y_e()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),BV=OSe(FV),IE=S.createContext(null),Te=mxe,le=oxe;let MI;const DE=()=>({setOpenUploader:e=>{e&&(MI=e)},openUploader:MI}),Br=lt(e=>e.ui,e=>CE[e.activeTab],{memoizeOptions:{equalityCheck:Pe.isEqual}}),__e=lt(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:Pe.isEqual}}),fp=lt(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:Pe.isEqual}}),LI=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=Br(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:a})).json(),u={uuid:um(),category:"user",...l};t(sm({image:u,category:"user"})),o==="unifiedCanvas"?t(o4(u)):o==="img2img"&&t(v0(u))};function k_e(){const{t:e}=De();return g.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[g.jsx("h1",{children:e("common.nodes")}),g.jsx("p",{children:e("common.nodesDesc")})]})}const E_e=()=>{const{t:e}=De();return g.jsxs("div",{className:"work-in-progress post-processing-work-in-progress",children:[g.jsx("h1",{children:e("common.postProcessing")}),g.jsx("p",{children:e("common.postProcessDesc1")}),g.jsx("p",{children:e("common.postProcessDesc2")}),g.jsx("p",{children:e("common.postProcessDesc3")})]})};function P_e(){const{t:e}=De();return g.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[g.jsx("h1",{children:e("common.training")}),g.jsxs("p",{children:[e("common.trainingDesc1"),g.jsx("br",{}),g.jsx("br",{}),e("common.trainingDesc2")]})]})}function T_e(e){const{i18n:t}=De(),n=localStorage.getItem("i18nextLng");Ke.useEffect(()=>{e()},[e]),Ke.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const M_e=fc({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:g.jsx("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:g.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),L_e=fc({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:g.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),A_e=fc({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:g.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),O_e=fc({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:g.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:g.jsx("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})}),R_e=fc({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:g.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),I_e=fc({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:g.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})}),Ye=Ze((e,t)=>{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return g.jsx(si,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:g.jsx(ls,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})}),On=Ze((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return g.jsx(si,{label:r,...i,children:g.jsx(ss,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})}),Ys=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return g.jsxs(q8,{...o,children:[g.jsx(G8,{children:t}),g.jsxs(Y8,{className:`invokeai__popover-content ${r}`,children:[i&&g.jsx(K8,{className:"invokeai__popover-arrow"}),n]})]})},h4=lt(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:Pe.isEqual}}),Jo=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return g.jsxs(sn,{isDisabled:n,className:`invokeai__select ${l}`,onClick:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation(),d.nativeEvent.stopPropagation(),d.nativeEvent.cancelBubble=!0},children:[t&&g.jsx(Sn,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),g.jsx(si,{label:i,...o,children:g.jsx(YH,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(d=>typeof d=="string"||typeof d=="number"?g.jsx("option",{value:d,className:"invokeai__select-option",children:d},d):g.jsx("option",{value:d.value,className:"invokeai__select-option",children:d.key},d.value))})})]})};function D_e(){const e=le(i=>i.postprocessing.facetoolType),t=Te(),{t:n}=De(),r=i=>t(fS(i.target.value));return g.jsx(Jo,{label:n("parameters.type"),validValues:R5e.concat(),value:e,onChange:r})}var zV={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},AI=Ke.createContext&&Ke.createContext(zV),Bd=globalThis&&globalThis.__assign||function(){return Bd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{ke(i)},[i]);const we=S.useMemo(()=>H!=null&&H.max?H.max:a,[a,H==null?void 0:H.max]),xe=Xe=>{l(Xe)},Le=Xe=>{Xe.target.value===""&&(Xe.target.value=String(o));const tt=Pe.clamp(w?Math.floor(Number(Xe.target.value)):Number(fe),o,we);l(tt)},Se=Xe=>{ke(Xe)},Qe=()=>{O&&O()};return g.jsxs(sn,{className:U?`invokeai__slider-component ${U}`:"invokeai__slider-component","data-markers":p,style:L?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...B,children:[g.jsx(Sn,{className:"invokeai__slider-component-label",fontSize:"sm",...K,children:r}),g.jsxs(u2,{w:"100%",gap:2,alignItems:"center",children:[g.jsxs(eW,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:xe,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:I,width:u,...ee,children:[p&&g.jsxs(g.Fragment,{children:[g.jsx(rk,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...ne,children:o}),g.jsx(rk,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:y,...ne,children:a})]}),g.jsx(nW,{className:"invokeai__slider_track",...z,children:g.jsx(rW,{className:"invokeai__slider_track-filled"})}),g.jsx(si,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${d}`,hidden:T,...q,children:g.jsx(tW,{className:"invokeai__slider-thumb",...$})})]}),b&&g.jsxs(H8,{min:o,max:we,step:s,value:fe,onChange:Se,onBlur:Le,className:"invokeai__slider-number-field",isDisabled:N,...H,children:[g.jsx(W8,{className:"invokeai__slider-number-input",width:E,readOnly:_,minWidth:E,...Y}),g.jsxs(HH,{...Q,children:[g.jsx(V8,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"}),g.jsx(U8,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"})]})]}),k&&g.jsx(Ye,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:g.jsx(p4,{}),onClick:Qe,isDisabled:D,...X})]})]})}function W_e(){const e=le(i=>i.system.isGFPGANAvailable),t=le(i=>i.postprocessing.facetoolStrength),{t:n}=De(),r=Te();return g.jsx(Dn,{isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,label:n("parameters.strength"),step:.05,min:0,max:1,onChange:i=>r(E3(i)),handleReset:()=>r(E3(.75)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}function U_e(){const e=le(i=>i.system.isGFPGANAvailable),t=le(i=>i.postprocessing.codeformerFidelity),{t:n}=De(),r=Te();return g.jsx(Dn,{isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,label:n("parameters.codeformerFidelity"),step:.05,min:0,max:1,onChange:i=>r(wk(i)),handleReset:()=>r(wk(1)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}const jE=()=>{const e=le(t=>t.postprocessing.facetoolType);return g.jsxs(_e,{direction:"column",gap:2,minWidth:"20rem",children:[g.jsx(D_e,{}),g.jsx(W_e,{}),e==="codeformer"&&g.jsx(U_e,{})]})};function V_e(){const e=le(i=>i.system.isESRGANAvailable),t=le(i=>i.postprocessing.upscalingDenoising),{t:n}=De(),r=Te();return g.jsx(Dn,{label:n("parameters.denoisingStrength"),value:t,min:0,max:1,step:.01,onChange:i=>{r(Ck(i))},handleReset:()=>r(Ck(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})}function G_e(){const e=le(i=>i.system.isESRGANAvailable),t=le(i=>i.postprocessing.upscalingStrength),{t:n}=De(),r=Te();return g.jsx(Dn,{label:`${n("parameters.upscale")} ${n("parameters.strength")}`,value:t,min:0,max:1,step:.05,onChange:i=>r(_k(i)),handleReset:()=>r(_k(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})}function q_e(){const e=le(o=>o.system.isESRGANAvailable),t=le(o=>o.postprocessing.upscalingLevel),{t:n}=De(),r=Te(),i=o=>r(vU(Number(o.target.value)));return g.jsx(Jo,{isDisabled:!e,label:n("parameters.scale"),value:t,onChange:i,validValues:O5e})}const NE=()=>g.jsxs(_e,{flexDir:"column",rowGap:2,minWidth:"20rem",children:[g.jsx(q_e,{}),g.jsx(V_e,{}),g.jsx(G_e,{})]}),$E=e=>e.postprocessing,hr=e=>e.system,K_e=e=>e.system.toastQueue,UV=lt(hr,e=>{const{model_list:t}=e,n=Pe.reduce(t,(r,i,o)=>(i.status==="active"&&(r=o),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),Y_e=lt(hr,e=>{const{model_list:t}=e;return Pe.pickBy(t,(r,i)=>{if(r.format==="diffusers")return{name:i,...r}})},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});function qk(){return qk=Object.assign?Object.assign.bind():function(e){for(var t=1;t'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var rke=function(t,n,r){r===void 0&&(r=!1);var i=n.alt,o=n.meta,a=n.mod,s=n.shift,l=n.ctrl,u=n.keys,d=t.key,p=t.code,m=t.ctrlKey,y=t.metaKey,b=t.shiftKey,w=t.altKey,E=kd(p),_=d.toLowerCase();if(!r){if(i===!w&&_!=="alt"||s===!b&&_!=="shift")return!1;if(a){if(!y&&!m)return!1}else if(o===!y&&_!=="meta"||l===!m&&_!=="ctrl")return!1}return u&&u.length===1&&(u.includes(_)||u.includes(E))?!0:u?Q_e(u):!u},ike=S.createContext(void 0),oke=function(){return S.useContext(ike)};function YV(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&YV(e[r],t[r])},!0):e===t}var ake=S.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),ske=function(){return S.useContext(ake)};function lke(e){var t=S.useRef(void 0);return YV(t.current,e)||(t.current=e),t.current}var OI=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},uke=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Je(e,t,n,r){var i=S.useRef(null),o=S.useRef(!1),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:void 0,l=S.useCallback(t,s??[]),u=S.useRef(l);s?u.current=l:u.current=t;var d=lke(a),p=ske(),m=p.enabledScopes,y=oke();return uke(function(){if(!((d==null?void 0:d.enabled)===!1||!nke(m,d==null?void 0:d.scopes))){var b=function(k,T){var L;if(T===void 0&&(T=!1),!(tke(k)&&!KV(k,d==null?void 0:d.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){OI(k);return}(L=k.target)!=null&&L.isContentEditable&&!(d!=null&&d.enableOnContentEditable)||QC(e,d==null?void 0:d.splitKey).forEach(function(O){var D,I=JC(O,d==null?void 0:d.combinationKey);if(rke(k,I,d==null?void 0:d.ignoreModifiers)||(D=I.keys)!=null&&D.includes("*")){if(T&&o.current)return;if(J_e(k,I,d==null?void 0:d.preventDefault),!eke(k,I,d==null?void 0:d.enabled)){OI(k);return}u.current(k,I),T||(o.current=!0)}})}},w=function(k){k.key!==void 0&&(GV(kd(k.code)),((d==null?void 0:d.keydown)===void 0&&(d==null?void 0:d.keyup)!==!0||d!=null&&d.keydown)&&b(k))},E=function(k){k.key!==void 0&&(qV(kd(k.code)),o.current=!1,d!=null&&d.keyup&&b(k,!0))};return(i.current||(a==null?void 0:a.document)||document).addEventListener("keyup",E),(i.current||(a==null?void 0:a.document)||document).addEventListener("keydown",w),y&&QC(e,d==null?void 0:d.splitKey).forEach(function(_){return y.addHotkey(JC(_,d==null?void 0:d.combinationKey))}),function(){(i.current||(a==null?void 0:a.document)||document).removeEventListener("keyup",E),(i.current||(a==null?void 0:a.document)||document).removeEventListener("keydown",w),y&&QC(e,d==null?void 0:d.splitKey).forEach(function(_){return y.removeHotkey(JC(_,d==null?void 0:d.combinationKey))})}}},[e,d,m]),i}function cke(e){return ut({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function dke(e){return ut({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function fke(e){return ut({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function XV(e){return ut({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function ZV(e){return ut({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function hke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function pke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function QV(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function gke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function mke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function FE(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function JV(e){return ut({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function Jm(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function eG(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function vke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function BE(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function tG(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function yke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function bke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function nG(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function xke(e){return ut({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function Ske(e){return ut({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function rG(e){return ut({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function wke(e){return ut({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function Cke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function _ke(e){return ut({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function kke(e){return ut({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"}}]})(e)}function iG(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function Eke(e){return ut({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function Pke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function oG(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function Tke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function Mke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function b2(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function Lke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function Ake(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function Oke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function zE(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function Rke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function Ike(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function RI(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function HE(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function Dke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function hp(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function jke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function g4(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function Nke(e){return ut({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function WE(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const rn=e=>e.canvas,Lr=lt([rn,Br,hr],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),aG=e=>e.canvas.layerState.objects.find(S3),pp=e=>e.gallery,$ke=lt([pp,h4,Lr,Br],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,galleryWidth:b,shouldUseSingleGalleryColumn:w}=e,{isLightboxOpen:E}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:p,galleryGridTemplateColumns:w?"auto":`repeat(auto-fill, minmax(${d}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightboxOpen:E,isStaging:n,shouldEnableResize:!(E||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:w}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),Fke=lt([pp,hr,h4,Br],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),Bke=lt(hr,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),O3=S.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Kd(),a=Te(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=le(Bke),d=S.useRef(null),p=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(u_e(e)),o()};Je("delete",()=>{s?i():m()},[e,s,l,u]);const y=b=>a(RU(!b.target.checked));return g.jsxs(g.Fragment,{children:[S.cloneElement(t,{onClick:e?p:void 0,ref:n}),g.jsx(BH,{isOpen:r,leastDestructiveRef:d,onClose:o,children:g.jsx(oc,{children:g.jsxs(zH,{className:"modal",children:[g.jsx(op,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),g.jsx(Xm,{children:g.jsxs(_e,{direction:"column",gap:5,children:[g.jsx(Dt,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),g.jsx(sn,{children:g.jsxs(_e,{alignItems:"center",children:[g.jsx(Sn,{mb:0,children:"Don't ask me again"}),g.jsx(X8,{checked:!s,onChange:y})]})})]})}),g.jsxs(Hw,{children:[g.jsx(ss,{ref:d,onClick:o,className:"modal-close-btn",children:"Cancel"}),g.jsx(ss,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})});O3.displayName="DeleteImageModal";const zke=lt([hr,pp,$E,fp,h4,Br],(e,t,n,r,i,o)=>{const{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u}=e,{upscalingLevel:d,facetoolStrength:p}=n,{isLightboxOpen:m}=i,{shouldShowImageDetails:y}=r,{intermediateImage:b,currentImage:w}=t;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:d,facetoolStrength:p,shouldDisableToolbarButtons:Boolean(b)||!w,currentImage:w,shouldShowImageDetails:y,activeTabName:o,isLightboxOpen:m}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),sG=()=>{var U,B,K,ne,z,$;const e=Te(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightboxOpen:d,activeTabName:p}=le(zke),m=s2(),{t:y}=De(),b=()=>{u&&(d&&e(Om(!1)),e(v0(u)),e(Wo("img2img")))},w=async()=>{if(!u)return;const H=await fetch(u.url).then(Q=>Q.blob()),Y=[new ClipboardItem({[H.type]:H})];await navigator.clipboard.write(Y),m({title:y("toast.imageCopied"),status:"success",duration:2500,isClosable:!0})},E=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:y("toast.imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};Je("shift+i",()=>{u?(b(),m({title:y("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast.imageNotLoaded"),description:y("toast.imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{var H,Y;u&&(u.metadata&&e(sU(u.metadata)),((H=u.metadata)==null?void 0:H.image.type)==="img2img"?e(Wo("img2img")):((Y=u.metadata)==null?void 0:Y.image.type)==="txt2img"&&e(Wo("txt2img")))};Je("a",()=>{var H,Y;["txt2img","img2img"].includes((Y=(H=u==null?void 0:u.metadata)==null?void 0:H.image)==null?void 0:Y.type)?(_(),m({title:y("toast.parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast.parametersNotSet"),description:y("toast.parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const k=()=>{u!=null&&u.metadata&&e(g2(u.metadata.image.seed))};Je("s",()=>{var H,Y;(Y=(H=u==null?void 0:u.metadata)==null?void 0:H.image)!=null&&Y.seed?(k(),m({title:y("toast.seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast.seedNotSet"),description:y("toast.seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const T=()=>{var H,Y,Q,q;if((Y=(H=u==null?void 0:u.metadata)==null?void 0:H.image)!=null&&Y.prompt){const[X,ee]=xE((q=(Q=u==null?void 0:u.metadata)==null?void 0:Q.image)==null?void 0:q.prompt);X&&e(a4(X)),e(Dy(ee||""))}};Je("p",()=>{var H,Y;(Y=(H=u==null?void 0:u.metadata)==null?void 0:H.image)!=null&&Y.prompt?(T(),m({title:y("toast.promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast.promptNotSet"),description:y("toast.promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const L=()=>{u&&e(s_e(u))};Je("Shift+U",()=>{i&&!s&&n&&!t&&o?L():m({title:y("toast.upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const O=()=>{u&&e(l_e(u))};Je("Shift+R",()=>{r&&!s&&n&&!t&&a?O():m({title:y("toast.faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const D=()=>e($U(!l)),I=()=>{u&&(d&&e(Om(!1)),e(o4(u)),e(Li(!0)),p!=="unifiedCanvas"&&e(Wo("unifiedCanvas")),m({title:y("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};Je("i",()=>{u?D():m({title:y("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const N=()=>{e(Om(!d))};return g.jsxs("div",{className:"current-image-options",children:[g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ye,{"aria-label":`${y("parameters.sendTo")}...`,icon:g.jsx(Ike,{})}),children:g.jsxs("div",{className:"current-image-send-to-popover",children:[g.jsx(On,{size:"sm",onClick:b,leftIcon:g.jsx(RI,{}),children:y("parameters.sendToImg2Img")}),g.jsx(On,{size:"sm",onClick:I,leftIcon:g.jsx(RI,{}),children:y("parameters.sendToUnifiedCanvas")}),g.jsx(On,{size:"sm",onClick:w,leftIcon:g.jsx(Jm,{}),children:y("parameters.copyImage")}),g.jsx(On,{size:"sm",onClick:E,leftIcon:g.jsx(Jm,{}),children:y("parameters.copyImageToLink")}),g.jsx(Nh,{download:!0,href:u==null?void 0:u.url,children:g.jsx(On,{leftIcon:g.jsx(BE,{}),size:"sm",w:"100%",children:y("parameters.downloadImage")})})]})}),g.jsx(Ye,{icon:g.jsx(bke,{}),tooltip:d?`${y("parameters.closeViewer")} (Z)`:`${y("parameters.openInViewer")} (Z)`,"aria-label":d?`${y("parameters.closeViewer")} (Z)`:`${y("parameters.openInViewer")} (Z)`,"data-selected":d,onClick:N})]}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ye,{icon:g.jsx(Lke,{}),tooltip:`${y("parameters.usePrompt")} (P)`,"aria-label":`${y("parameters.usePrompt")} (P)`,isDisabled:!((B=(U=u==null?void 0:u.metadata)==null?void 0:U.image)!=null&&B.prompt),onClick:T}),g.jsx(Ye,{icon:g.jsx(Rke,{}),tooltip:`${y("parameters.useSeed")} (S)`,"aria-label":`${y("parameters.useSeed")} (S)`,isDisabled:!((ne=(K=u==null?void 0:u.metadata)==null?void 0:K.image)!=null&&ne.seed),onClick:k}),g.jsx(Ye,{icon:g.jsx(gke,{}),tooltip:`${y("parameters.useAll")} (A)`,"aria-label":`${y("parameters.useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes(($=(z=u==null?void 0:u.metadata)==null?void 0:z.image)==null?void 0:$.type),onClick:_})]}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ye,{icon:g.jsx(wke,{}),"aria-label":y("parameters.restoreFaces")}),children:g.jsxs("div",{className:"current-image-postprocessing-popover",children:[g.jsx(jE,{}),g.jsx(On,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:O,children:y("parameters.restoreFaces")})]})}),g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ye,{icon:g.jsx(yke,{}),"aria-label":y("parameters.upscale")}),children:g.jsxs("div",{className:"current-image-postprocessing-popover",children:[g.jsx(NE,{}),g.jsx(On,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:L,children:y("parameters.upscaleImage")})]})})]}),g.jsx(Gi,{isAttached:!0,children:g.jsx(Ye,{icon:g.jsx(JV,{}),tooltip:`${y("parameters.info")} (I)`,"aria-label":`${y("parameters.info")} (I)`,"data-selected":l,onClick:D})}),g.jsx(O3,{image:u,children:g.jsx(Ye,{icon:g.jsx(hp,{}),tooltip:`${y("parameters.deleteImage")} (Del)`,"aria-label":`${y("parameters.deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};var Hke=fc({displayName:"EditIcon",path:g.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[g.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),g.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),lG=fc({displayName:"ExternalLinkIcon",path:g.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[g.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),g.jsx("path",{d:"M15 3h6v6"}),g.jsx("path",{d:"M10 14L21 3"})]})}),Wke=fc({displayName:"DeleteIcon",path:g.jsx("g",{fill:"currentColor",children:g.jsx("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})});function Uke(e){return ut({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const Jn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>g.jsxs(_e,{gap:2,children:[n&&g.jsx(si,{label:`Recall ${e}`,children:g.jsx(ls,{"aria-label":"Use this parameter",icon:g.jsx(Uke,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&g.jsx(si,{label:`Copy ${e}`,children:g.jsx(ls,{"aria-label":`Copy ${e}`,icon:g.jsx(Jm,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),g.jsxs(_e,{direction:i?"column":"row",children:[g.jsxs(Dt,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?g.jsxs(Nh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",g.jsx(lG,{mx:"2px"})]}):g.jsx(Dt,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),Vke=(e,t)=>e.image.uuid===t.image.uuid,UE=S.memo(({image:e,styleClass:t})=>{var B,K;const n=Te();Je("esc",()=>{n($U(!1))});const r=((B=e==null?void 0:e.metadata)==null?void 0:B.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:d,orig_path:p,perlin:m,postprocessing:y,prompt:b,sampler:w,seamless:E,seed:_,steps:k,strength:T,denoise_str:L,threshold:O,type:D,variations:I,width:N}=r,U=JSON.stringify(e.metadata,null,2);return g.jsx("div",{className:`image-metadata-viewer ${t}`,children:g.jsxs(_e,{gap:1,direction:"column",width:"100%",children:[g.jsxs(_e,{gap:2,children:[g.jsx(Dt,{fontWeight:"semibold",children:"File:"}),g.jsxs(Nh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,g.jsx(lG,{mx:"2px"})]})]}),Object.keys(r).length>0?g.jsxs(g.Fragment,{children:[D&&g.jsx(Jn,{label:"Generation type",value:D}),((K=e.metadata)==null?void 0:K.model_weights)&&g.jsx(Jn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(D)&&g.jsx(Jn,{label:"Original image",value:p}),b&&g.jsx(Jn,{label:"Prompt",labelPosition:"top",value:U1(b),onClick:()=>n(a4(b))}),_!==void 0&&g.jsx(Jn,{label:"Seed",value:_,onClick:()=>n(g2(_))}),O!==void 0&&g.jsx(Jn,{label:"Noise Threshold",value:O,onClick:()=>n(Sk(O))}),m!==void 0&&g.jsx(Jn,{label:"Perlin Noise",value:m,onClick:()=>n(bk(m))}),w&&g.jsx(Jn,{label:"Sampler",value:w,onClick:()=>n(cU(w))}),k&&g.jsx(Jn,{label:"Steps",value:k,onClick:()=>n(xk(k))}),o!==void 0&&g.jsx(Jn,{label:"CFG scale",value:o,onClick:()=>n(vk(o))}),I&&I.length>0&&g.jsx(Jn,{label:"Seed-weight pairs",value:k3(I),onClick:()=>n(fU(k3(I)))}),E&&g.jsx(Jn,{label:"Seamless",value:E,onClick:()=>n(dU(E))}),l&&g.jsx(Jn,{label:"High Resolution Optimization",value:l,onClick:()=>n(mU(l))}),N&&g.jsx(Jn,{label:"Width",value:N,onClick:()=>n(dS(N))}),s&&g.jsx(Jn,{label:"Height",value:s,onClick:()=>n(cS(s))}),u&&g.jsx(Jn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(v0(u))}),d&&g.jsx(Jn,{label:"Mask image",value:d,isLink:!0,onClick:()=>n(uU(d))}),D==="img2img"&&T&&g.jsx(Jn,{label:"Image to image strength",value:T,onClick:()=>n(yk(T))}),a&&g.jsx(Jn,{label:"Image to image fit",value:a,onClick:()=>n(hU(a))}),y&&y.length>0&&g.jsxs(g.Fragment,{children:[g.jsx(jh,{size:"sm",children:"Postprocessing"}),y.map((ne,z)=>{if(ne.type==="esrgan"){const{scale:$,strength:H,denoise_str:Y}=ne;return g.jsxs(_e,{pl:"2rem",gap:1,direction:"column",children:[g.jsx(Dt,{size:"md",children:`${z+1}: Upscale (ESRGAN)`}),g.jsx(Jn,{label:"Scale",value:$,onClick:()=>n(vU($))}),g.jsx(Jn,{label:"Strength",value:H,onClick:()=>n(_k(H))}),Y!==void 0&&g.jsx(Jn,{label:"Denoising strength",value:Y,onClick:()=>n(Ck(Y))})]},z)}else if(ne.type==="gfpgan"){const{strength:$}=ne;return g.jsxs(_e,{pl:"2rem",gap:1,direction:"column",children:[g.jsx(Dt,{size:"md",children:`${z+1}: Face restoration (GFPGAN)`}),g.jsx(Jn,{label:"Strength",value:$,onClick:()=>{n(E3($)),n(fS("gfpgan"))}})]},z)}else if(ne.type==="codeformer"){const{strength:$,fidelity:H}=ne;return g.jsxs(_e,{pl:"2rem",gap:1,direction:"column",children:[g.jsx(Dt,{size:"md",children:`${z+1}: Face restoration (Codeformer)`}),g.jsx(Jn,{label:"Strength",value:$,onClick:()=>{n(E3($)),n(fS("codeformer"))}}),H&&g.jsx(Jn,{label:"Fidelity",value:H,onClick:()=>{n(wk(H)),n(fS("codeformer"))}})]},z)}})]}),i&&g.jsx(Jn,{withCopy:!0,label:"Dream Prompt",value:i}),g.jsxs(_e,{gap:2,direction:"column",children:[g.jsxs(_e,{gap:2,children:[g.jsx(si,{label:"Copy metadata JSON",children:g.jsx(ls,{"aria-label":"Copy metadata JSON",icon:g.jsx(Jm,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(U)})}),g.jsx(Dt,{fontWeight:"semibold",children:"Metadata JSON:"})]}),g.jsx("div",{className:"image-json-viewer",children:g.jsx("pre",{children:U})})]})]}):g.jsx(lH,{width:"100%",pt:10,children:g.jsx(Dt,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},Vke);UE.displayName="ImageMetadataViewer";const uG=lt([pp,fp],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var d;return u.uuid===((d=e==null?void 0:e.currentImage)==null?void 0:d.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});function Gke(){const e=Te(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=le(uG),[a,s]=S.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(bE())},p=()=>{e(yE())};return g.jsxs("div",{className:"current-image-preview",children:[i&&g.jsx(Nw,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&g.jsxs("div",{className:"current-image-next-prev-buttons",children:[g.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&g.jsx(ls,{"aria-label":"Previous image",icon:g.jsx(XV,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),g.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&g.jsx(ls,{"aria-label":"Next image",icon:g.jsx(ZV,{className:"next-prev-button"}),variant:"unstyled",onClick:p})})]}),r&&i&&g.jsx(UE,{image:i,styleClass:"current-image-metadata"})]})}var qke=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ni=globalThis&&globalThis.__assign||function(){return ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},e7e=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],$I="__resizable_base__",cG=function(e){Xke(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add($I):o.className+=$I,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;o&&o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||Zke},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),d=u/l[s]*100;return d+"%"}return e6(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?e6(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?e6(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&Ig("left",o),s=i&&Ig("top",o),l,u;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=a?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,p=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,y=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,w=u||0;if(s){var E=(m-b)*this.ratio+w,_=(y-b)*this.ratio+w,k=(d-w)/this.ratio+b,T=(p-w)/this.ratio+b,L=Math.max(d,E),O=Math.min(p,_),D=Math.max(m,k),I=Math.min(y,T);n=bx(n,L,O),r=bx(r,D,I)}else n=bx(n,d,p),r=bx(r,m,y);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&Qke(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&xx(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var d=this.window.getComputedStyle(u).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Ol(Ol({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(p)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&xx(n))try{n.preventDefault(),n.stopPropagation()}catch{}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=xx(n)?n.touches[0].clientX:n.clientX,d=xx(n)?n.touches[0].clientY:n.clientY,p=this.state,m=p.direction,y=p.original,b=p.width,w=p.height,E=this.getParentSize(),_=Jke(E,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=_.maxWidth,a=_.maxHeight,s=_.minWidth,l=_.minHeight;var k=this.calculateNewSizeFromDirection(u,d),T=k.newHeight,L=k.newWidth,O=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(L=NI(L,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=NI(T,this.props.snap.y,this.props.snapGap));var D=this.calculateNewSizeFromAspectRatio(L,T,{width:O.maxWidth,height:O.maxHeight},{width:s,height:l});if(L=D.newWidth,T=D.newHeight,this.props.grid){var I=jI(L,this.props.grid[0]),N=jI(T,this.props.grid[1]),U=this.props.snapGap||0;L=U===0||Math.abs(I-L)<=U?I:L,T=U===0||Math.abs(N-T)<=U?N:T}var B={width:L-y.width,height:T-y.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var K=L/E.width*100;L=K+"%"}else if(b.endsWith("vw")){var ne=L/this.window.innerWidth*100;L=ne+"vw"}else if(b.endsWith("vh")){var z=L/this.window.innerHeight*100;L=z+"vh"}}if(w&&typeof w=="string"){if(w.endsWith("%")){var K=T/E.height*100;T=K+"%"}else if(w.endsWith("vw")){var ne=T/this.window.innerWidth*100;T=ne+"vw"}else if(w.endsWith("vh")){var z=T/this.window.innerHeight*100;T=z+"vh"}}var $={width:this.createSizeForCssProperty(L,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?$.flexBasis=$.width:this.flexDir==="column"&&($.flexBasis=$.height),Xs.flushSync(function(){r.setState($)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,B)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Ol(Ol({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var d=Object.keys(i).map(function(p){return i[p]!==!1?S.createElement(Yke,{key:p,direction:p,onResizeStart:n.onResizeStart,replaceStyles:o&&o[p],className:a&&a[p]},u&&u[p]?u[p]:null):null});return S.createElement("div",{className:l,style:s},d)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return e7e.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Ol(Ol(Ol({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return S.createElement(o,Ol({ref:this.ref,style:i,className:this.props.className},r),this.state.isResizing&&S.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(S.PureComponent);const Gn=e=>{const{label:t,styleClass:n,...r}=e;return g.jsx(hz,{className:`invokeai__checkbox ${n}`,...r,children:t})};function dG(e){return ut({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function fG(e){return ut({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function t7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.5 9c-.42 0-.83.04-1.24.11L1.01 3 1 10l9 2-9 2 .01 7 8.07-3.46C9.59 21.19 12.71 24 16.5 24c4.14 0 7.5-3.36 7.5-7.5S20.64 9 16.5 9zm0 13c-3.03 0-5.5-2.47-5.5-5.5s2.47-5.5 5.5-5.5 5.5 2.47 5.5 5.5-2.47 5.5-5.5 5.5z"}},{tag:"path",attr:{d:"M18.27 14.03l-1.77 1.76-1.77-1.76-.7.7 1.76 1.77-1.76 1.77.7.7 1.77-1.76 1.77 1.76.7-.7-1.76-1.77 1.76-1.77z"}}]})(e)}function n7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function r7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function i7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function o7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function hG(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function a7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function s7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 10l5 5 5-5z"}}]})(e)}function l7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 14l5-5 5 5z"}}]})(e)}function u7e(e){return ut({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function c7e(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function d7e(e,t){e.classList?e.classList.add(t):c7e(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function FI(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function f7e(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=FI(e.className,t):e.setAttribute("class",FI(e.className&&e.className.baseVal||"",t))}const BI={disabled:!1},pG=Ke.createContext(null);var gG=function(t){return t.scrollTop},x1="unmounted",ph="exited",gh="entering",Fg="entered",Kk="exiting",mc=function(e){S8(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=ph,o.appearStatus=gh):l=Fg:r.unmountOnExit||r.mountOnEnter?l=x1:l=ph,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===x1?{status:ph}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==gh&&a!==Fg&&(o=gh):(a===gh||a===Fg)&&(o=Kk)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===gh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Rb.findDOMNode(this);a&&gG(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ph&&this.setState({status:x1})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Rb.findDOMNode(this),s],u=l[0],d=l[1],p=this.getTimeouts(),m=s?p.appear:p.enter;if(!i&&!a||BI.disabled){this.safeSetState({status:Fg},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:gh},function(){o.props.onEntering(u,d),o.onTransitionEnd(m,function(){o.safeSetState({status:Fg},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Rb.findDOMNode(this);if(!o||BI.disabled){this.safeSetState({status:ph},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:Kk},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:ph},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Rb.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===x1)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=y8(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ke.createElement(pG.Provider,{value:null},typeof a=="function"?a(i,s):Ke.cloneElement(Ke.Children.only(a),s))},t}(Ke.Component);mc.contextType=pG;mc.propTypes={};function Dg(){}mc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Dg,onEntering:Dg,onEntered:Dg,onExit:Dg,onExiting:Dg,onExited:Dg};mc.UNMOUNTED=x1;mc.EXITED=ph;mc.ENTERING=gh;mc.ENTERED=Fg;mc.EXITING=Kk;const h7e=mc;var p7e=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return d7e(t,r)})},t6=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return f7e(t,r)})},VE=function(e){S8(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ab,Object.values(b));return S.createElement(w.Provider,{value:E},y)}function d(p,m){const y=(m==null?void 0:m[e][l])||s,b=S.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const i=()=>{const o=n.map(a=>S.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,g7e(i,...t)]}function g7e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const p=l(o)[`__scope${u}`];return{...s,...p}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function m7e(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function vG(...e){return t=>e.forEach(n=>m7e(n,t))}function ds(...e){return S.useCallback(vG(...e),e)}const By=S.forwardRef((e,t)=>{const{children:n,...r}=e,i=S.Children.toArray(n),o=i.find(y7e);if(o){const a=o.props.children,s=i.map(l=>l===o?S.Children.count(a)>1?S.Children.only(null):S.isValidElement(a)?a.props.children:null:l);return S.createElement(Yk,pn({},r,{ref:t}),S.isValidElement(a)?S.cloneElement(a,void 0,s):null)}return S.createElement(Yk,pn({},r,{ref:t}),n)});By.displayName="Slot";const Yk=S.forwardRef((e,t)=>{const{children:n,...r}=e;return S.isValidElement(n)?S.cloneElement(n,{...b7e(r,n.props),ref:vG(t,n.ref)}):S.Children.count(n)>1?S.Children.only(null):null});Yk.displayName="SlotClone";const v7e=({children:e})=>S.createElement(S.Fragment,null,e);function y7e(e){return S.isValidElement(e)&&e.type===v7e}function b7e(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const x7e=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],sc=x7e.reduce((e,t)=>{const n=S.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?By:t;return S.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),S.createElement(s,pn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function yG(e,t){e&&Xs.flushSync(()=>e.dispatchEvent(t))}function bG(e){const t=e+"CollectionProvider",[n,r]=x2(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:b,children:w}=y,E=Ke.useRef(null),_=Ke.useRef(new Map).current;return Ke.createElement(i,{scope:b,itemMap:_,collectionRef:E},w)},s=e+"CollectionSlot",l=Ke.forwardRef((y,b)=>{const{scope:w,children:E}=y,_=o(s,w),k=ds(b,_.collectionRef);return Ke.createElement(By,{ref:k},E)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",p=Ke.forwardRef((y,b)=>{const{scope:w,children:E,..._}=y,k=Ke.useRef(null),T=ds(b,k),L=o(u,w);return Ke.useEffect(()=>(L.itemMap.set(k,{ref:k,..._}),()=>void L.itemMap.delete(k))),Ke.createElement(By,{[d]:"",ref:T},E)});function m(y){const b=o(e+"CollectionConsumer",y);return Ke.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const _=Array.from(E.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((L,O)=>_.indexOf(L.ref.current)-_.indexOf(O.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:p},m,r]}const S7e=S.createContext(void 0);function xG(e){const t=S.useContext(S7e);return e||t||"ltr"}function Js(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function w7e(e,t=globalThis==null?void 0:globalThis.document){const n=Js(e);S.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Xk="dismissableLayer.update",C7e="dismissableLayer.pointerDownOutside",_7e="dismissableLayer.focusOutside";let zI;const k7e=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),E7e=S.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,d=S.useContext(k7e),[p,m]=S.useState(null),y=(n=p==null?void 0:p.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=S.useState({}),w=ds(t,N=>m(N)),E=Array.from(d.layers),[_]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=E.indexOf(_),T=p?E.indexOf(p):-1,L=d.layersWithOutsidePointerEventsDisabled.size>0,O=T>=k,D=P7e(N=>{const U=N.target,B=[...d.branches].some(K=>K.contains(U));!O||B||(o==null||o(N),s==null||s(N),N.defaultPrevented||l==null||l())},y),I=T7e(N=>{const U=N.target;[...d.branches].some(K=>K.contains(U))||(a==null||a(N),s==null||s(N),N.defaultPrevented||l==null||l())},y);return w7e(N=>{T===d.layers.size-1&&(i==null||i(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},y),S.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(zI=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),HI(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=zI)}},[p,y,r,d]),S.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),HI())},[p,d]),S.useEffect(()=>{const N=()=>b({});return document.addEventListener(Xk,N),()=>document.removeEventListener(Xk,N)},[]),S.createElement(sc.div,pn({},u,{ref:w,style:{pointerEvents:L?O?"auto":"none":void 0,...e.style},onFocusCapture:Kn(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Kn(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Kn(e.onPointerDownCapture,D.onPointerDownCapture)}))});function P7e(e,t=globalThis==null?void 0:globalThis.document){const n=Js(e),r=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){SG(C7e,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function T7e(e,t=globalThis==null?void 0:globalThis.document){const n=Js(e),r=S.useRef(!1);return S.useEffect(()=>{const i=o=>{o.target&&!r.current&&SG(_7e,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function HI(){const e=new CustomEvent(Xk);document.dispatchEvent(e)}function SG(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?yG(i,o):i.dispatchEvent(o)}let n6=0;function M7e(){S.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:WI()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:WI()),n6++,()=>{n6===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),n6--}},[])}function WI(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const r6="focusScope.autoFocusOnMount",i6="focusScope.autoFocusOnUnmount",UI={bubbles:!1,cancelable:!0},L7e=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=S.useState(null),u=Js(i),d=Js(o),p=S.useRef(null),m=ds(t,w=>l(w)),y=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let w=function(_){if(y.paused||!s)return;const k=_.target;s.contains(k)?p.current=k:mh(p.current,{select:!0})},E=function(_){y.paused||!s||s.contains(_.relatedTarget)||mh(p.current,{select:!0})};return document.addEventListener("focusin",w),document.addEventListener("focusout",E),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",E)}}},[r,s,y.paused]),S.useEffect(()=>{if(s){GI.add(y);const w=document.activeElement;if(!s.contains(w)){const _=new CustomEvent(r6,UI);s.addEventListener(r6,u),s.dispatchEvent(_),_.defaultPrevented||(A7e(j7e(wG(s)),{select:!0}),document.activeElement===w&&mh(s))}return()=>{s.removeEventListener(r6,u),setTimeout(()=>{const _=new CustomEvent(i6,UI);s.addEventListener(i6,d),s.dispatchEvent(_),_.defaultPrevented||mh(w??document.body,{select:!0}),s.removeEventListener(i6,d),GI.remove(y)},0)}}},[s,u,d,y]);const b=S.useCallback(w=>{if(!n&&!r||y.paused)return;const E=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,_=document.activeElement;if(E&&_){const k=w.currentTarget,[T,L]=O7e(k);T&&L?!w.shiftKey&&_===L?(w.preventDefault(),n&&mh(T,{select:!0})):w.shiftKey&&_===T&&(w.preventDefault(),n&&mh(L,{select:!0})):_===k&&w.preventDefault()}},[n,r,y.paused]);return S.createElement(sc.div,pn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function A7e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mh(r,{select:t}),document.activeElement!==n)return}function O7e(e){const t=wG(e),n=VI(t,e),r=VI(t.reverse(),e);return[n,r]}function wG(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function VI(e,t){for(const n of e)if(!R7e(n,{upTo:t}))return n}function R7e(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function I7e(e){return e instanceof HTMLInputElement&&"select"in e}function mh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&I7e(e)&&t&&e.select()}}const GI=D7e();function D7e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=qI(e,t),e.unshift(t)},remove(t){var n;e=qI(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function qI(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function j7e(e){return e.filter(t=>t.tagName!=="A")}const Pd=Boolean(globalThis==null?void 0:globalThis.document)?S.useLayoutEffect:()=>{},N7e=m6["useId".toString()]||(()=>{});let $7e=0;function F7e(e){const[t,n]=S.useState(N7e());return Pd(()=>{e||n(r=>r??String($7e++))},[e]),e||(t?`radix-${t}`:"")}function gp(e){return e.split("-")[0]}function S2(e){return e.split("-")[1]}function S0(e){return["top","bottom"].includes(gp(e))?"x":"y"}function GE(e){return e==="y"?"height":"width"}function KI(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=S0(t),l=GE(s),u=r[l]/2-i[l]/2,d=s==="x";let p;switch(gp(t)){case"top":p={x:o,y:r.y-i.height};break;case"bottom":p={x:o,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:a};break;case"left":p={x:r.x-i.width,y:a};break;default:p={x:r.x,y:r.y}}switch(S2(t)){case"start":p[s]-=u*(n&&d?-1:1);break;case"end":p[s]+=u*(n&&d?-1:1)}return p}const B7e=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=KI(l,r,s),p=r,m={},y=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=CG(r),d={x:i,y:o},p=S0(a),m=S2(a),y=GE(p),b=await l.getDimensions(n),w=p==="y"?"top":"left",E=p==="y"?"bottom":"right",_=s.reference[y]+s.reference[p]-d[p]-s.floating[y],k=d[p]-s.reference[p],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let L=T?p==="y"?T.clientHeight||0:T.clientWidth||0:0;L===0&&(L=s.floating[y]);const O=_/2-k/2,D=u[w],I=L-b[y]-u[E],N=L/2-b[y]/2+O,U=Zk(D,N,I),B=(m==="start"?u[w]:u[E])>0&&N!==U&&s.reference[y]<=s.floating[y];return{[p]:d[p]-(B?NH7e[t])}function W7e(e,t,n){n===void 0&&(n=!1);const r=S2(e),i=S0(e),o=GE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=I3(a)),{main:a,cross:I3(a)}}const U7e={start:"end",end:"start"};function XI(e){return e.replace(/start|end/g,t=>U7e[t])}const _G=["top","right","bottom","left"];_G.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const V7e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",flipAlignment:y=!0,...b}=e,w=gp(r),E=p||(w===a||!y?[I3(a)]:function(N){const U=I3(N);return[XI(N),U,XI(U)]}(a)),_=[a,...E],k=await zy(t,b),T=[];let L=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(k[w]),d){const{main:N,cross:U}=W7e(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));T.push(k[N],k[U])}if(L=[...L,{placement:r,overflows:T}],!T.every(N=>N<=0)){var O,D;const N=((O=(D=i.flip)==null?void 0:D.index)!=null?O:0)+1,U=_[N];if(U)return{data:{index:N,overflows:L},reset:{placement:U}};let B="bottom";switch(m){case"bestFit":{var I;const K=(I=L.map(ne=>[ne,ne.overflows.filter(z=>z>0).reduce((z,$)=>z+$,0)]).sort((ne,z)=>ne[1]-z[1])[0])==null?void 0:I[0].placement;K&&(B=K);break}case"initialPlacement":B=a}if(r!==B)return{reset:{placement:B}}}return{}}}};function ZI(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function QI(e){return _G.some(t=>e[t]>=0)}const G7e=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=ZI(await zy(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:QI(o)}}}case"escaped":{const o=ZI(await zy(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:o,escaped:QI(o)}}}default:return{}}}}},q7e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,d=await(l.isRTL==null?void 0:l.isRTL(u.floating)),p=gp(s),m=S2(s),y=S0(s)==="x",b=["left","top"].includes(p)?-1:1,w=d&&y?-1:1,E=typeof a=="function"?a(o):a;let{mainAxis:_,crossAxis:k,alignmentAxis:T}=typeof E=="number"?{mainAxis:E,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...E};return m&&typeof T=="number"&&(k=m==="end"?-1*T:T),y?{x:k*w,y:_*b}:{x:_*b,y:k*w}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function kG(e){return e==="x"?"y":"x"}const K7e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:E=>{let{x:_,y:k}=E;return{x:_,y:k}}},...l}=e,u={x:n,y:r},d=await zy(t,l),p=S0(gp(i)),m=kG(p);let y=u[p],b=u[m];if(o){const E=p==="y"?"bottom":"right";y=Zk(y+d[p==="y"?"top":"left"],y,y-d[E])}if(a){const E=m==="y"?"bottom":"right";b=Zk(b+d[m==="y"?"top":"left"],b,b-d[E])}const w=s.fn({...t,[p]:y,[m]:b});return{...w,data:{x:w.x-n,y:w.y-r}}}}},Y7e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,d={x:n,y:r},p=S0(i),m=kG(p);let y=d[p],b=d[m];const w=typeof s=="function"?s({...o,placement:i}):s,E=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const O=p==="y"?"height":"width",D=o.reference[p]-o.floating[O]+E.mainAxis,I=o.reference[p]+o.reference[O]-E.mainAxis;yI&&(y=I)}if(u){var _,k,T,L;const O=p==="y"?"width":"height",D=["top","left"].includes(gp(i)),I=o.reference[m]-o.floating[O]+(D&&(_=(k=a.offset)==null?void 0:k[m])!=null?_:0)+(D?0:E.crossAxis),N=o.reference[m]+o.reference[O]+(D?0:(T=(L=a.offset)==null?void 0:L[m])!=null?T:0)-(D?E.crossAxis:0);bN&&(b=N)}return{[p]:y,[m]:b}}}},X7e=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:a,...s}=e,l=await zy(t,s),u=gp(n),d=S2(n);let p,m;u==="top"||u==="bottom"?(p=u,m=d===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(m=u,p=d==="end"?"top":"bottom");const y=vh(l.left,0),b=vh(l.right,0),w=vh(l.top,0),E=vh(l.bottom,0),_={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(w!==0||E!==0?w+E:vh(l.top,l.bottom)):l[p]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(y!==0||b!==0?y+b:vh(l.left,l.right)):l[m])},k=await i.getDimensions(o.floating);a==null||a({...t,..._});const T=await i.getDimensions(o.floating);return k.width!==T.width||k.height!==T.height?{reset:{rects:!0}}:{}}}};function EG(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function vc(e){if(e==null)return window;if(!EG(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function w2(e){return vc(e).getComputedStyle(e)}function Xu(e){return EG(e)?"":e?(e.nodeName||"").toLowerCase():""}function PG(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function ou(e){return e instanceof vc(e).HTMLElement}function ef(e){return e instanceof vc(e).Element}function qE(e){return typeof ShadowRoot>"u"?!1:e instanceof vc(e).ShadowRoot||e instanceof ShadowRoot}function m4(e){const{overflow:t,overflowX:n,overflowY:r}=w2(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function Z7e(e){return["table","td","th"].includes(Xu(e))}function JI(e){const t=/firefox/i.test(PG()),n=w2(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function TG(){return!/^((?!chrome|android).)*safari/i.test(PG())}const eD=Math.min,Y1=Math.max,D3=Math.round;function Zu(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&ou(e)&&(l=e.offsetWidth>0&&D3(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&D3(s.height)/e.offsetHeight||1);const d=ef(e)?vc(e):window,p=!TG()&&n,m=(s.left+(p&&(r=(i=d.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,y=(s.top+(p&&(o=(a=d.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,w=s.height/u;return{width:b,height:w,top:y,right:m+b,bottom:y+w,left:m,x:m,y}}function zd(e){return(t=e,(t instanceof vc(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function v4(e){return ef(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function MG(e){return Zu(zd(e)).left+v4(e).scrollLeft}function Q7e(e,t,n){const r=ou(t),i=zd(t),o=Zu(e,r&&function(l){const u=Zu(l);return D3(u.width)!==l.offsetWidth||D3(u.height)!==l.offsetHeight}(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Xu(t)!=="body"||m4(i))&&(a=v4(t)),ou(t)){const l=Zu(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=MG(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function LG(e){return Xu(e)==="html"?e:e.assignedSlot||e.parentNode||(qE(e)?e.host:null)||zd(e)}function tD(e){return ou(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function Qk(e){const t=vc(e);let n=tD(e);for(;n&&Z7e(n)&&getComputedStyle(n).position==="static";)n=tD(n);return n&&(Xu(n)==="html"||Xu(n)==="body"&&getComputedStyle(n).position==="static"&&!JI(n))?t:n||function(r){let i=LG(r);for(qE(i)&&(i=i.host);ou(i)&&!["html","body"].includes(Xu(i));){if(JI(i))return i;i=i.parentNode}return null}(e)||t}function nD(e){if(ou(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Zu(e);return{width:t.width,height:t.height}}function AG(e){const t=LG(e);return["html","body","#document"].includes(Xu(t))?e.ownerDocument.body:ou(t)&&m4(t)?t:AG(t)}function j3(e,t){var n;t===void 0&&(t=[]);const r=AG(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=vc(r),a=i?[o].concat(o.visualViewport||[],m4(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(j3(a))}function rD(e,t,n){return t==="viewport"?R3(function(r,i){const o=vc(r),a=zd(r),s=o.visualViewport;let l=a.clientWidth,u=a.clientHeight,d=0,p=0;if(s){l=s.width,u=s.height;const m=TG();(m||!m&&i==="fixed")&&(d=s.offsetLeft,p=s.offsetTop)}return{width:l,height:u,x:d,y:p}}(e,n)):ef(t)?function(r,i){const o=Zu(r,!1,i==="fixed"),a=o.top+r.clientTop,s=o.left+r.clientLeft;return{top:a,left:s,x:s,y:a,right:s+r.clientWidth,bottom:a+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):R3(function(r){var i;const o=zd(r),a=v4(r),s=(i=r.ownerDocument)==null?void 0:i.body,l=Y1(o.scrollWidth,o.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=Y1(o.scrollHeight,o.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let d=-a.scrollLeft+MG(r);const p=-a.scrollTop;return w2(s||o).direction==="rtl"&&(d+=Y1(o.clientWidth,s?s.clientWidth:0)-l),{width:l,height:u,x:d,y:p}}(zd(e)))}function J7e(e){const t=j3(e),n=["absolute","fixed"].includes(w2(e).position)&&ou(e)?Qk(e):e;return ef(n)?t.filter(r=>ef(r)&&function(i,o){const a=o.getRootNode==null?void 0:o.getRootNode();if(i.contains(o))return!0;if(a&&qE(a)){let s=o;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&Xu(r)!=="body"):[]}const e9e={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?J7e(t):[].concat(n),r],a=o[0],s=o.reduce((l,u)=>{const d=rD(t,u,i);return l.top=Y1(d.top,l.top),l.right=eD(d.right,l.right),l.bottom=eD(d.bottom,l.bottom),l.left=Y1(d.left,l.left),l},rD(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=ou(n),o=zd(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Xu(n)!=="body"||m4(o))&&(a=v4(n)),ou(n))){const l=Zu(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:ef,getDimensions:nD,getOffsetParent:Qk,getDocumentElement:zd,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Q7e(t,Qk(n),r),floating:{...nD(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>w2(e).direction==="rtl"};function t9e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,d=l||u?[...ef(e)?j3(e):[],...j3(t)]:[];d.forEach(b=>{l&&b.addEventListener("scroll",n,{passive:!0}),u&&b.addEventListener("resize",n)});let p,m=null;if(a){let b=!0;m=new ResizeObserver(()=>{b||n(),b=!1}),ef(e)&&!s&&m.observe(e),m.observe(t)}let y=s?Zu(e):null;return s&&function b(){const w=Zu(e);!y||w.x===y.x&&w.y===y.y&&w.width===y.width&&w.height===y.height||n(),y=w,p=requestAnimationFrame(b)}(),n(),()=>{var b;d.forEach(w=>{l&&w.removeEventListener("scroll",n),u&&w.removeEventListener("resize",n)}),(b=m)==null||b.disconnect(),m=null,s&&cancelAnimationFrame(p)}}const n9e=(e,t,n)=>B7e(e,t,{platform:e9e,...n});var Jk=typeof document<"u"?S.useLayoutEffect:S.useEffect;function e7(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!e7(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!e7(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function r9e(e){const t=S.useRef(e);return Jk(()=>{t.current=e}),t}function i9e(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=S.useRef(null),a=S.useRef(null),s=r9e(i),l=S.useRef(null),[u,d]=S.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[p,m]=S.useState(t);e7(p==null?void 0:p.map(T=>{let{options:L}=T;return L}),t==null?void 0:t.map(T=>{let{options:L}=T;return L}))||m(t);const y=S.useCallback(()=>{!o.current||!a.current||n9e(o.current,a.current,{middleware:p,placement:n,strategy:r}).then(T=>{b.current&&Xs.flushSync(()=>{d(T)})})},[p,n,r]);Jk(()=>{b.current&&y()},[y]);const b=S.useRef(!1);Jk(()=>(b.current=!0,()=>{b.current=!1}),[]);const w=S.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const T=s.current(o.current,a.current,y);l.current=T}else y()},[y,s]),E=S.useCallback(T=>{o.current=T,w()},[w]),_=S.useCallback(T=>{a.current=T,w()},[w]),k=S.useMemo(()=>({reference:o,floating:a}),[]);return S.useMemo(()=>({...u,update:y,refs:k,reference:E,floating:_}),[u,y,k,E,_])}const o9e=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?YI({element:t.current,padding:n}).fn(i):{}:t?YI({element:t,padding:n}).fn(i):{}}}};function a9e(e){const[t,n]=S.useState(void 0);return Pd(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const OG="Popper",[KE,RG]=x2(OG),[s9e,IG]=KE(OG),l9e=e=>{const{__scopePopper:t,children:n}=e,[r,i]=S.useState(null);return S.createElement(s9e,{scope:t,anchor:r,onAnchorChange:i},n)},u9e="PopperAnchor",c9e=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=IG(u9e,n),a=S.useRef(null),s=ds(t,a);return S.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:S.createElement(sc.div,pn({},i,{ref:s}))}),N3="PopperContent",[d9e,BNe]=KE(N3),[f9e,h9e]=KE(N3,{hasParent:!1,positionUpdateFns:new Set}),p9e=S.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:d,side:p="bottom",sideOffset:m=0,align:y="center",alignOffset:b=0,arrowPadding:w=0,collisionBoundary:E=[],collisionPadding:_=0,sticky:k="partial",hideWhenDetached:T=!1,avoidCollisions:L=!0,onPlaced:O,...D}=e,I=IG(N3,d),[N,U]=S.useState(null),B=ds(t,He=>U(He)),[K,ne]=S.useState(null),z=a9e(K),$=(n=z==null?void 0:z.width)!==null&&n!==void 0?n:0,H=(r=z==null?void 0:z.height)!==null&&r!==void 0?r:0,Y=p+(y!=="center"?"-"+y:""),Q=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},q=Array.isArray(E)?E:[E],X=q.length>0,ee={padding:Q,boundary:q.filter(m9e),altBoundary:X},{reference:fe,floating:ke,strategy:we,x:xe,y:Le,placement:Se,middlewareData:Qe,update:Xe}=i9e({strategy:"fixed",placement:Y,whileElementsMounted:t9e,middleware:[v9e(),q7e({mainAxis:m+H,alignmentAxis:b}),L?K7e({mainAxis:!0,crossAxis:!1,limiter:k==="partial"?Y7e():void 0,...ee}):void 0,K?o9e({element:K,padding:w}):void 0,L?V7e({...ee}):void 0,X7e({...ee,apply:({elements:He,availableWidth:Ue,availableHeight:ye})=>{He.floating.style.setProperty("--radix-popper-available-width",`${Ue}px`),He.floating.style.setProperty("--radix-popper-available-height",`${ye}px`)}}),y9e({arrowWidth:$,arrowHeight:H}),T?G7e({strategy:"referenceHidden"}):void 0].filter(g9e)});Pd(()=>{fe(I.anchor)},[fe,I.anchor]);const tt=xe!==null&&Le!==null,[yt,Be]=DG(Se),Ae=Js(O);Pd(()=>{tt&&(Ae==null||Ae())},[tt,Ae]);const bt=(i=Qe.arrow)===null||i===void 0?void 0:i.x,Fe=(o=Qe.arrow)===null||o===void 0?void 0:o.y,at=((a=Qe.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[jt,mt]=S.useState();Pd(()=>{N&&mt(window.getComputedStyle(N).zIndex)},[N]);const{hasParent:Zt,positionUpdateFns:on}=h9e(N3,d),se=!Zt;S.useLayoutEffect(()=>{if(!se)return on.add(Xe),()=>{on.delete(Xe)}},[se,on,Xe]),Pd(()=>{se&&tt&&Array.from(on).reverse().forEach(He=>requestAnimationFrame(He))},[se,tt,on]);const Ie={"data-side":yt,"data-align":Be,...D,ref:B,style:{...D.style,animation:tt?void 0:"none",opacity:(s=Qe.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return S.createElement("div",{ref:ke,"data-radix-popper-content-wrapper":"",style:{position:we,left:0,top:0,transform:tt?`translate3d(${Math.round(xe)}px, ${Math.round(Le)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:jt,["--radix-popper-transform-origin"]:[(l=Qe.transformOrigin)===null||l===void 0?void 0:l.x,(u=Qe.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")},dir:e.dir},S.createElement(d9e,{scope:d,placedSide:yt,onArrowChange:ne,arrowX:bt,arrowY:Fe,shouldHideArrow:at},se?S.createElement(f9e,{scope:d,hasParent:!0,positionUpdateFns:on},S.createElement(sc.div,Ie)):S.createElement(sc.div,Ie)))});function g9e(e){return e!==void 0}function m9e(e){return e!==null}const v9e=()=>({name:"anchorCssProperties",fn(e){const{rects:t,elements:n}=e,{width:r,height:i}=t.reference;return n.floating.style.setProperty("--radix-popper-anchor-width",`${r}px`),n.floating.style.setProperty("--radix-popper-anchor-height",`${i}px`),{}}}),y9e=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,p=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=p?0:e.arrowWidth,y=p?0:e.arrowHeight,[b,w]=DG(s),E={start:"0%",center:"50%",end:"100%"}[w],_=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,k=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+y/2;let T="",L="";return b==="bottom"?(T=p?E:`${_}px`,L=`${-y}px`):b==="top"?(T=p?E:`${_}px`,L=`${l.floating.height+y}px`):b==="right"?(T=`${-y}px`,L=p?E:`${k}px`):b==="left"&&(T=`${l.floating.width+y}px`,L=p?E:`${k}px`),{data:{x:T,y:L}}}});function DG(e){const[t,n="center"]=e.split("-");return[t,n]}const b9e=l9e,x9e=c9e,S9e=p9e;function w9e(e,t){return S.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const jG=e=>{const{present:t,children:n}=e,r=C9e(t),i=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),o=ds(r.ref,i.ref);return typeof n=="function"||r.isPresent?S.cloneElement(i,{ref:o}):null};jG.displayName="Presence";function C9e(e){const[t,n]=S.useState(),r=S.useRef({}),i=S.useRef(e),o=S.useRef("none"),a=e?"mounted":"unmounted",[s,l]=w9e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const u=wx(r.current);o.current=s==="mounted"?u:"none"},[s]),Pd(()=>{const u=r.current,d=i.current;if(d!==e){const m=o.current,y=wx(u);e?l("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Pd(()=>{if(t){const u=p=>{const y=wx(r.current).includes(p.animationName);p.target===t&&y&&Xs.flushSync(()=>l("ANIMATION_END"))},d=p=>{p.target===t&&(o.current=wx(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:S.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function wx(e){return(e==null?void 0:e.animationName)||"none"}function _9e({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=k9e({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Js(n),l=S.useCallback(u=>{if(o){const p=typeof u=="function"?u(e):u;p!==e&&s(p)}else i(u)},[o,e,i,s]);return[a,l]}function k9e({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,i=S.useRef(r),o=Js(t);return S.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const o6="rovingFocusGroup.onEntryFocus",E9e={bubbles:!1,cancelable:!0},YE="RovingFocusGroup",[t7,NG,P9e]=bG(YE),[T9e,$G]=x2(YE,[P9e]),[M9e,L9e]=T9e(YE),A9e=S.forwardRef((e,t)=>S.createElement(t7.Provider,{scope:e.__scopeRovingFocusGroup},S.createElement(t7.Slot,{scope:e.__scopeRovingFocusGroup},S.createElement(O9e,pn({},e,{ref:t}))))),O9e=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,p=S.useRef(null),m=ds(t,p),y=xG(o),[b=null,w]=_9e({prop:a,defaultProp:s,onChange:l}),[E,_]=S.useState(!1),k=Js(u),T=NG(n),L=S.useRef(!1),[O,D]=S.useState(0);return S.useEffect(()=>{const I=p.current;if(I)return I.addEventListener(o6,k),()=>I.removeEventListener(o6,k)},[k]),S.createElement(M9e,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:b,onItemFocus:S.useCallback(I=>w(I),[w]),onItemShiftTab:S.useCallback(()=>_(!0),[]),onFocusableItemAdd:S.useCallback(()=>D(I=>I+1),[]),onFocusableItemRemove:S.useCallback(()=>D(I=>I-1),[])},S.createElement(sc.div,pn({tabIndex:E||O===0?-1:0,"data-orientation":r},d,{ref:m,style:{outline:"none",...e.style},onMouseDown:Kn(e.onMouseDown,()=>{L.current=!0}),onFocus:Kn(e.onFocus,I=>{const N=!L.current;if(I.target===I.currentTarget&&N&&!E){const U=new CustomEvent(o6,E9e);if(I.currentTarget.dispatchEvent(U),!U.defaultPrevented){const B=T().filter(H=>H.focusable),K=B.find(H=>H.active),ne=B.find(H=>H.id===b),$=[K,ne,...B].filter(Boolean).map(H=>H.ref.current);FG($)}}L.current=!1}),onBlur:Kn(e.onBlur,()=>_(!1))})))}),R9e="RovingFocusGroupItem",I9e=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...a}=e,s=F7e(),l=o||s,u=L9e(R9e,n),d=u.currentTabStopId===l,p=NG(n),{onFocusableItemAdd:m,onFocusableItemRemove:y}=u;return S.useEffect(()=>{if(r)return m(),()=>y()},[r,m,y]),S.createElement(t7.ItemSlot,{scope:n,id:l,focusable:r,active:i},S.createElement(sc.span,pn({tabIndex:d?0:-1,"data-orientation":u.orientation},a,{ref:t,onMouseDown:Kn(e.onMouseDown,b=>{r?u.onItemFocus(l):b.preventDefault()}),onFocus:Kn(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Kn(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const w=N9e(b,u.orientation,u.dir);if(w!==void 0){b.preventDefault();let _=p().filter(k=>k.focusable).map(k=>k.ref.current);if(w==="last")_.reverse();else if(w==="prev"||w==="next"){w==="prev"&&_.reverse();const k=_.indexOf(b.currentTarget);_=u.loop?$9e(_,k+1):_.slice(k+1)}setTimeout(()=>FG(_))}})})))}),D9e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function j9e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function N9e(e,t,n){const r=j9e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return D9e[r]}function FG(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $9e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const F9e=A9e,B9e=I9e,z9e=["Enter"," "],H9e=["ArrowDown","PageUp","Home"],BG=["ArrowUp","PageDown","End"],W9e=[...H9e,...BG],y4="Menu",[n7,U9e,V9e]=bG(y4),[mp,zG]=x2(y4,[V9e,RG,$G]),XE=RG(),HG=$G(),[G9e,b4]=mp(y4),[q9e,ZE]=mp(y4),K9e=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=XE(t),[l,u]=S.useState(null),d=S.useRef(!1),p=Js(o),m=xG(i);return S.useEffect(()=>{const y=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),S.createElement(b9e,s,S.createElement(G9e,{scope:t,open:n,onOpenChange:p,content:l,onContentChange:u},S.createElement(q9e,{scope:t,onClose:S.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:m,modal:a},r)))},Y9e=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=XE(n);return S.createElement(x9e,pn({},i,r,{ref:t}))}),X9e="MenuPortal",[zNe,Z9e]=mp(X9e,{forceMount:void 0}),Hd="MenuContent",[Q9e,WG]=mp(Hd),J9e=S.forwardRef((e,t)=>{const n=Z9e(Hd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=b4(Hd,e.__scopeMenu),a=ZE(Hd,e.__scopeMenu);return S.createElement(n7.Provider,{scope:e.__scopeMenu},S.createElement(jG,{present:r||o.open},S.createElement(n7.Slot,{scope:e.__scopeMenu},a.modal?S.createElement(e8e,pn({},i,{ref:t})):S.createElement(t8e,pn({},i,{ref:t})))))}),e8e=S.forwardRef((e,t)=>{const n=b4(Hd,e.__scopeMenu),r=S.useRef(null),i=ds(t,r);return S.useEffect(()=>{const o=r.current;if(o)return OH(o)},[]),S.createElement(UG,pn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Kn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),t8e=S.forwardRef((e,t)=>{const n=b4(Hd,e.__scopeMenu);return S.createElement(UG,pn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),UG=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:y,disableOutsideScroll:b,...w}=e,E=b4(Hd,n),_=ZE(Hd,n),k=XE(n),T=HG(n),L=U9e(n),[O,D]=S.useState(null),I=S.useRef(null),N=ds(t,I,E.onContentChange),U=S.useRef(0),B=S.useRef(""),K=S.useRef(0),ne=S.useRef(null),z=S.useRef("right"),$=S.useRef(0),H=b?FH:S.Fragment,Y=b?{as:By,allowPinchZoom:!0}:void 0,Q=X=>{var ee,fe;const ke=B.current+X,we=L().filter(tt=>!tt.disabled),xe=document.activeElement,Le=(ee=we.find(tt=>tt.ref.current===xe))===null||ee===void 0?void 0:ee.textValue,Se=we.map(tt=>tt.textValue),Qe=c8e(Se,ke,Le),Xe=(fe=we.find(tt=>tt.textValue===Qe))===null||fe===void 0?void 0:fe.ref.current;(function tt(yt){B.current=yt,window.clearTimeout(U.current),yt!==""&&(U.current=window.setTimeout(()=>tt(""),1e3))})(ke),Xe&&setTimeout(()=>Xe.focus())};S.useEffect(()=>()=>window.clearTimeout(U.current),[]),M7e();const q=S.useCallback(X=>{var ee,fe;return z.current===((ee=ne.current)===null||ee===void 0?void 0:ee.side)&&f8e(X,(fe=ne.current)===null||fe===void 0?void 0:fe.area)},[]);return S.createElement(Q9e,{scope:n,searchRef:B,onItemEnter:S.useCallback(X=>{q(X)&&X.preventDefault()},[q]),onItemLeave:S.useCallback(X=>{var ee;q(X)||((ee=I.current)===null||ee===void 0||ee.focus(),D(null))},[q]),onTriggerLeave:S.useCallback(X=>{q(X)&&X.preventDefault()},[q]),pointerGraceTimerRef:K,onPointerGraceIntentChange:S.useCallback(X=>{ne.current=X},[])},S.createElement(H,Y,S.createElement(L7e,{asChild:!0,trapped:i,onMountAutoFocus:Kn(o,X=>{var ee;X.preventDefault(),(ee=I.current)===null||ee===void 0||ee.focus()}),onUnmountAutoFocus:a},S.createElement(E7e,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:y},S.createElement(F9e,pn({asChild:!0},T,{dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:D,onEntryFocus:Kn(l,X=>{_.isUsingKeyboardRef.current||X.preventDefault()})}),S.createElement(S9e,pn({role:"menu","aria-orientation":"vertical","data-state":s8e(E.open),"data-radix-menu-content":"",dir:_.dir},k,w,{ref:N,style:{outline:"none",...w.style},onKeyDown:Kn(w.onKeyDown,X=>{const fe=X.target.closest("[data-radix-menu-content]")===X.currentTarget,ke=X.ctrlKey||X.altKey||X.metaKey,we=X.key.length===1;fe&&(X.key==="Tab"&&X.preventDefault(),!ke&&we&&Q(X.key));const xe=I.current;if(X.target!==xe||!W9e.includes(X.key))return;X.preventDefault();const Se=L().filter(Qe=>!Qe.disabled).map(Qe=>Qe.ref.current);BG.includes(X.key)&&Se.reverse(),l8e(Se)}),onBlur:Kn(e.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(U.current),B.current="")}),onPointerMove:Kn(e.onPointerMove,i7(X=>{const ee=X.target,fe=$.current!==X.clientX;if(X.currentTarget.contains(ee)&&fe){const ke=X.clientX>$.current?"right":"left";z.current=ke,$.current=X.clientX}}))})))))))}),r7="MenuItem",iD="menu.itemSelect",n8e=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=S.useRef(null),a=ZE(r7,e.__scopeMenu),s=WG(r7,e.__scopeMenu),l=ds(t,o),u=S.useRef(!1),d=()=>{const p=o.current;if(!n&&p){const m=new CustomEvent(iD,{bubbles:!0,cancelable:!0});p.addEventListener(iD,y=>r==null?void 0:r(y),{once:!0}),yG(p,m),m.defaultPrevented?u.current=!1:a.onClose()}};return S.createElement(r8e,pn({},i,{ref:l,disabled:n,onClick:Kn(e.onClick,d),onPointerDown:p=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,p),u.current=!0},onPointerUp:Kn(e.onPointerUp,p=>{var m;u.current||(m=p.currentTarget)===null||m===void 0||m.click()}),onKeyDown:Kn(e.onKeyDown,p=>{const m=s.searchRef.current!=="";n||m&&p.key===" "||z9e.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})}))}),r8e=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=WG(r7,n),s=HG(n),l=S.useRef(null),u=ds(t,l),[d,p]=S.useState(!1),[m,y]=S.useState("");return S.useEffect(()=>{const b=l.current;if(b){var w;y(((w=b.textContent)!==null&&w!==void 0?w:"").trim())}},[o.children]),S.createElement(n7.ItemSlot,{scope:n,disabled:r,textValue:i??m},S.createElement(B9e,pn({asChild:!0},s,{focusable:!r}),S.createElement(sc.div,pn({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:Kn(e.onPointerMove,i7(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:Kn(e.onPointerLeave,i7(b=>a.onItemLeave(b))),onFocus:Kn(e.onFocus,()=>p(!0)),onBlur:Kn(e.onBlur,()=>p(!1))}))))}),i8e="MenuRadioGroup";mp(i8e,{value:void 0,onValueChange:()=>{}});const o8e="MenuItemIndicator";mp(o8e,{checked:!1});const a8e="MenuSub";mp(a8e);function s8e(e){return e?"open":"closed"}function l8e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function u8e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function c8e(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=u8e(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function d8e(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(u-s)*(r-l)/(d-l)+s&&(i=!i)}return i}function f8e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return d8e(n,t)}function i7(e){return t=>t.pointerType==="mouse"?e(t):void 0}const h8e=K9e,p8e=Y9e,g8e=J9e,m8e=n8e,VG="ContextMenu",[v8e,HNe]=x2(VG,[zG]),x4=zG(),[y8e,GG]=v8e(VG),b8e=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=S.useState(!1),l=x4(t),u=Js(r),d=S.useCallback(p=>{s(p),u(p)},[u]);return S.createElement(y8e,{scope:t,open:a,onOpenChange:d,modal:o},S.createElement(h8e,pn({},l,{dir:i,open:a,onOpenChange:d,modal:o}),n))},x8e="ContextMenuTrigger",S8e=S.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=e,o=GG(x8e,n),a=x4(n),s=S.useRef({x:0,y:0}),l=S.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),u=S.useRef(0),d=S.useCallback(()=>window.clearTimeout(u.current),[]),p=m=>{s.current={x:m.clientX,y:m.clientY},o.onOpenChange(!0)};return S.useEffect(()=>d,[d]),S.useEffect(()=>void(r&&d()),[r,d]),S.createElement(S.Fragment,null,S.createElement(p8e,pn({},a,{virtualRef:l})),S.createElement(sc.span,pn({"data-state":o.open?"open":"closed","data-disabled":r?"":void 0},i,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Kn(e.onContextMenu,m=>{d(),p(m),m.preventDefault()}),onPointerDown:r?e.onPointerDown:Kn(e.onPointerDown,Cx(m=>{d(),u.current=window.setTimeout(()=>p(m),700)})),onPointerMove:r?e.onPointerMove:Kn(e.onPointerMove,Cx(d)),onPointerCancel:r?e.onPointerCancel:Kn(e.onPointerCancel,Cx(d)),onPointerUp:r?e.onPointerUp:Kn(e.onPointerUp,Cx(d))})))}),w8e="ContextMenuContent",C8e=S.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=GG(w8e,n),o=x4(n),a=S.useRef(!1);return S.createElement(g8e,pn({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),_8e=S.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=x4(n);return S.createElement(m8e,pn({},i,r,{ref:t}))});function Cx(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const k8e=b8e,E8e=S8e,P8e=C8e,ud=_8e,T8e=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,qG=S.memo(e=>{var ne,z,$,H,Y,Q,q,X;const t=Te(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,shouldUseSingleGalleryColumn:a}=le(Fke),{image:s,isSelected:l}=e,{url:u,thumbnail:d,uuid:p,metadata:m}=s,[y,b]=S.useState(!1),w=s2(),{t:E}=De(),_=()=>b(!0),k=()=>b(!1),T=()=>{var ee,fe;if(s.metadata){const[ke,we]=xE((fe=(ee=s.metadata)==null?void 0:ee.image)==null?void 0:fe.prompt);ke&&t(a4(ke)),t(Dy(we||""))}w({title:E("toast.promptSet"),status:"success",duration:2500,isClosable:!0})},L=()=>{s.metadata&&t(g2(s.metadata.image.seed)),w({title:E("toast.seedSet"),status:"success",duration:2500,isClosable:!0})},O=()=>{t(v0(s)),n!=="img2img"&&t(Wo("img2img")),w({title:E("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},D=()=>{t(o4(s)),t(i4()),n!=="unifiedCanvas"&&t(Wo("unifiedCanvas")),w({title:E("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},I=()=>{m&&t(sU(m)),w({title:E("toast.parametersSet"),status:"success",duration:2500,isClosable:!0})},N=async()=>{var ee;if((ee=m==null?void 0:m.image)!=null&&ee.init_image_path&&(await fetch(m.image.init_image_path)).ok){t(Wo("img2img")),t(j3e(m)),w({title:E("toast.initialImageSet"),status:"success",duration:2500,isClosable:!0});return}w({title:E("toast.initialImageNotSet"),description:E("toast.initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},U=()=>t(JO(s)),B=ee=>{ee.dataTransfer.setData("invokeai/imageUuid",p),ee.dataTransfer.effectAllowed="move"},K=()=>{t(JO(s))};return g.jsxs(k8e,{onOpenChange:ee=>{t(nU(ee))},children:[g.jsx(E8e,{children:g.jsxs(ao,{position:"relative",className:"hoverable-image",onMouseOver:_,onMouseOut:k,userSelect:"none",draggable:!0,onDragStart:B,children:[g.jsx(Nw,{className:"hoverable-image-image",objectFit:a?"contain":r,rounded:"md",src:d||u,loading:"lazy"}),g.jsx("div",{className:"hoverable-image-content",onClick:U,children:l&&g.jsx(ja,{width:"50%",height:"50%",as:FE,className:"hoverable-image-check"})}),y&&i>=64&&g.jsx("div",{className:"hoverable-image-delete-button",children:g.jsx(O3,{image:s,children:g.jsx(ls,{"aria-label":E("parameters.deleteImage"),icon:g.jsx(Dke,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},p)}),g.jsxs(P8e,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:ee=>{ee.detail.originalEvent.preventDefault()},children:[g.jsx(ud,{onClickCapture:K,children:E("parameters.openInViewer")}),g.jsx(ud,{onClickCapture:T,disabled:((z=(ne=s==null?void 0:s.metadata)==null?void 0:ne.image)==null?void 0:z.prompt)===void 0,children:E("parameters.usePrompt")}),g.jsx(ud,{onClickCapture:L,disabled:((H=($=s==null?void 0:s.metadata)==null?void 0:$.image)==null?void 0:H.seed)===void 0,children:E("parameters.useSeed")}),g.jsx(ud,{onClickCapture:I,disabled:!["txt2img","img2img"].includes((Q=(Y=s==null?void 0:s.metadata)==null?void 0:Y.image)==null?void 0:Q.type),children:E("parameters.useAll")}),g.jsx(ud,{onClickCapture:N,disabled:((X=(q=s==null?void 0:s.metadata)==null?void 0:q.image)==null?void 0:X.type)!=="img2img",children:E("parameters.useInitImg")}),g.jsx(ud,{onClickCapture:O,children:E("parameters.sendToImg2Img")}),g.jsx(ud,{onClickCapture:D,children:E("parameters.sendToUnifiedCanvas")}),g.jsx(ud,{"data-warning":!0,children:g.jsx(O3,{image:s,children:g.jsx("p",{children:E("parameters.deleteImage")})})})]})]})},T8e);qG.displayName="HoverableImage";const _x=320,oD=40,M8e={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},aD=400;function KG(){const e=Te(),{t}=De(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,areMoreImagesAvailable:b,galleryWidth:w,isLightboxOpen:E,isStaging:_,shouldEnableResize:k,shouldUseSingleGalleryColumn:T}=le($ke),{galleryMinWidth:L,galleryMaxWidth:O}=E?{galleryMinWidth:aD,galleryMaxWidth:aD}:M8e[d],[D,I]=S.useState(w>=_x),[N,U]=S.useState(!1),[B,K]=S.useState(0),ne=S.useRef(null),z=S.useRef(null),$=S.useRef(null);S.useEffect(()=>{w>=_x&&I(!1)},[w]);const H=()=>{e(C3e(!o)),e(Li(!0))},Y=()=>{a?q():Q()},Q=()=>{e(Am(!0)),o&&e(Li(!0))},q=S.useCallback(()=>{e(Am(!1)),e(nU(!1)),e(_3e(z.current?z.current.scrollTop:0)),setTimeout(()=>o&&e(Li(!0)),400)},[e,o]),X=()=>{e(Gk(r))},ee=xe=>{e(Vv(xe))},fe=()=>{m||($.current=window.setTimeout(()=>q(),500))},ke=()=>{$.current&&window.clearTimeout($.current)};Je("g",()=>{Y()},[a,o]),Je("left",()=>{e(bE())},{enabled:!_||d!=="unifiedCanvas"},[_]),Je("right",()=>{e(yE())},{enabled:!_||d!=="unifiedCanvas"},[_]),Je("shift+g",()=>{H()},[o]),Je("esc",()=>{e(Am(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const we=32;return Je("shift+up",()=>{if(l<256){const xe=Pe.clamp(l+we,32,256);e(Vv(xe))}},[l]),Je("shift+down",()=>{if(l>32){const xe=Pe.clamp(l-we,32,256);e(Vv(xe))}},[l]),S.useEffect(()=>{z.current&&(z.current.scrollTop=s)},[s,a]),S.useEffect(()=>{function xe(Le){!o&&ne.current&&!ne.current.contains(Le.target)&&q()}return document.addEventListener("mousedown",xe),()=>{document.removeEventListener("mousedown",xe)}},[q,o]),g.jsx(mG,{nodeRef:ne,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:g.jsxs("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:ne,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:ke,onMouseOver:o?void 0:ke,children:[g.jsxs(cG,{minWidth:L,maxWidth:o?O:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:k},size:{width:w,height:o?"100%":"100vh"},onResizeStart:(xe,Le,Se)=>{K(Se.clientHeight),Se.style.height=`${Se.clientHeight}px`,o&&(Se.style.position="fixed",Se.style.right="1rem",U(!0))},onResizeStop:(xe,Le,Se,Qe)=>{const Xe=o?Pe.clamp(Number(w)+Qe.width,L,Number(O)):Number(w)+Qe.width;e(P3e(Xe)),Se.removeAttribute("data-resize-alert"),o&&(Se.style.position="relative",Se.style.removeProperty("right"),Se.style.setProperty("height",o?"100%":"100vh"),U(!1),e(Li(!0)))},onResize:(xe,Le,Se,Qe)=>{const Xe=Pe.clamp(Number(w)+Qe.width,L,Number(o?O:.95*window.innerWidth));Xe>=_x&&!D?I(!0):Xe<_x&&D&&I(!1),l>Xe-oD&&e(Vv(Xe-oD)),o&&(Xe>=O?Se.setAttribute("data-resize-alert","true"):Se.removeAttribute("data-resize-alert")),Se.style.height=`${B}px`},children:[g.jsxs("div",{className:"image-gallery-header",children:[g.jsx(Gi,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:D?g.jsxs(g.Fragment,{children:[g.jsx(On,{size:"sm","data-selected":r==="result",onClick:()=>e(tx("result")),children:t("gallery.generations")}),g.jsx(On,{size:"sm","data-selected":r==="user",onClick:()=>e(tx("user")),children:t("gallery.uploads")})]}):g.jsxs(g.Fragment,{children:[g.jsx(Ye,{"aria-label":t("gallery.showGenerations"),tooltip:t("gallery.showGenerations"),"data-selected":r==="result",icon:g.jsx(Cke,{}),onClick:()=>e(tx("result"))}),g.jsx(Ye,{"aria-label":t("gallery.showUploads"),tooltip:t("gallery.showUploads"),"data-selected":r==="user",icon:g.jsx(Nke,{}),onClick:()=>e(tx("user"))})]})}),g.jsxs("div",{className:"image-gallery-header-right-icons",children:[g.jsx(Ys,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:g.jsx(Ye,{size:"sm","aria-label":t("gallery.gallerySettings"),icon:g.jsx(WE,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:g.jsxs("div",{className:"image-gallery-settings-popover",children:[g.jsxs("div",{children:[g.jsx(Dn,{value:l,onChange:ee,min:32,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize")}),g.jsx(Ye,{size:"sm","aria-label":t("gallery.galleryImageResetSize"),tooltip:t("gallery.galleryImageResetSize"),onClick:()=>e(Vv(64)),icon:g.jsx(p4,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),g.jsx("div",{children:g.jsx(Gn,{label:t("gallery.maintainAspectRatio"),isChecked:p==="contain",onChange:()=>e(k3e(p==="contain"?"cover":"contain"))})}),g.jsx("div",{children:g.jsx(Gn,{label:t("gallery.autoSwitchNewImages"),isChecked:y,onChange:xe=>e(E3e(xe.target.checked))})}),g.jsx("div",{children:g.jsx(Gn,{label:t("gallery.singleColumnLayout"),isChecked:T,onChange:xe=>e(T3e(xe.target.checked))})})]})}),g.jsx(Ye,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery.pinGallery"),tooltip:`${t("gallery.pinGallery")} (Shift+G)`,onClick:H,icon:o?g.jsx(dG,{}):g.jsx(fG,{})})]})]}),g.jsx("div",{className:"image-gallery-container",ref:z,children:n.length||b?g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(xe=>{const{uuid:Le}=xe,Se=i===Le;return g.jsx(qG,{image:xe,isSelected:Se},Le)})}),g.jsx(ss,{onClick:X,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery.loadMore":"gallery.allImagesLoaded")})]}):g.jsxs("div",{className:"image-gallery-container-placeholder",children:[g.jsx(hG,{}),g.jsx("p",{children:t("gallery.noImagesInGallery")})]})})]}),N&&g.jsx("div",{style:{width:`${w}px`,height:"100%"}})]})})}var ns=function(e,t){return Number(e.toFixed(t))},L8e=function(e,t){return typeof e=="number"?e:t},mr=function(e,t,n){n&&typeof n=="function"&&n(e,t)},A8e=function(e){return-Math.cos(e*Math.PI)/2+.5},O8e=function(e){return e},R8e=function(e){return e*e},I8e=function(e){return e*(2-e)},D8e=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},j8e=function(e){return e*e*e},N8e=function(e){return--e*e*e+1},$8e=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},F8e=function(e){return e*e*e*e},B8e=function(e){return 1- --e*e*e*e},z8e=function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},H8e=function(e){return e*e*e*e*e},W8e=function(e){return 1+--e*e*e*e*e},U8e=function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},YG={easeOut:A8e,linear:O8e,easeInQuad:R8e,easeOutQuad:I8e,easeInOutQuad:D8e,easeInCubic:j8e,easeOutCubic:N8e,easeInOutCubic:$8e,easeInQuart:F8e,easeOutQuart:B8e,easeInOutQuart:z8e,easeInQuint:H8e,easeOutQuint:W8e,easeInOutQuint:U8e},XG=function(e){typeof e=="number"&&cancelAnimationFrame(e)},Fl=function(e){e.mounted&&(XG(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function ZG(e,t,n,r){if(e.mounted){var i=new Date().getTime(),o=1;Fl(e),e.animation=function(){if(!e.mounted)return XG(e.animation);var a=new Date().getTime()-i,s=a/n,l=YG[t],u=l(s);a>=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function V8e(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function ff(e,t,n,r){var i=V8e(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=t.scale-s,p=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):ZG(e,r,n,function(y){var b=s+d*y,w=l+p*y,E=u+m*y;o(b,w,E)})}}function G8e(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,d=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:d}}var q8e=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,d=s,p=r-i-l,m=l;return{minPositionX:u,maxPositionX:d,minPositionY:p,maxPositionY:m}},QE=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=G8e(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,d=o.newContentHeight,p=o.newDiffHeight,m=q8e(a,l,u,s,d,p,Boolean(i));return m},o7=function(e,t,n,r){return r?en?ns(n,2):ns(e,2):ns(e,2)},e0=function(e,t){var n=QE(e,t);return e.bounds=n,n};function S4(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,d=n.maxPositionY,p=0,m=0;a&&(p=i,m=o);var y=o7(e,s-p,u+p,r),b=o7(t,l-m,d+m,r);return{x:y,y:b}}function w4(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var p=l-t*d,m=u-n*d,y=S4(p,m,i,o,0,0,null);return y}function C2(e,t,n,r,i){var o=i?r:0,a=t-o;return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=a?a:e}var sD=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=C4(o,n);return!l},lD=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},K8e=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},Y8e=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function X8e(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var d=e.bounds,p=d.maxPositionX,m=d.minPositionX,y=d.maxPositionY,b=d.minPositionY,w=n>p||ny||rp?u.offsetWidth:e.setup.minPositionX||0,k=r>y?u.offsetHeight:e.setup.minPositionY||0,T=w4(e,_,k,i,e.bounds,s||l),L=T.x,O=T.y;return{scale:i,positionX:w?L:n,positionY:E?O:r}}}function Z8e(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,d=l.positionX,p=l.positionY;if(!(a===null||s===null||t===d&&n===p)){var m=S4(t,n,s,o,r,i,a),y=m.x,b=m.y;e.setTransformState(u,y,b)}}var Q8e=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var d=t-r.x,p=n-r.y,m=a?l:d,y=s?u:p;return{x:m,y}},$3=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale,a=n.disablePadding;return t>0&&i>=o&&!a?t:0},J8e=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},eEe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function tEe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function uD(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var d=a+(e-a)*u;return d>l?l:do?o:d}}return r?t:o7(e,o,a,i)}function nEe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function rEe(e,t){var n=J8e(e);if(n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=nEe(a,s),d=t.x-r.x,p=t.y-r.y,m=d/u,y=p/u,b=l-i,w=d*d+p*p,E=Math.sqrt(w)/b;e.velocity={velocityX:m,velocityY:y,total:E}}e.lastMousePosition=t,e.velocityTime=l}}function iEe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=eEe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,d=n.minPositionX,p=n.maxPositionY,m=n.minPositionY,y=r.limitToBounds,b=r.alignmentAnimation,w=r.zoomAnimation,E=r.panning,_=E.lockAxisY,k=E.lockAxisX,T=w.animationType,L=b.sizeX,O=b.sizeY,D=b.velocityAlignmentTime,I=D,N=tEe(e,l),U=Math.max(N,I),B=$3(e,L),K=$3(e,O),ne=B*i.offsetWidth/100,z=K*i.offsetHeight/100,$=u+ne,H=d-ne,Y=p+z,Q=m-z,q=e.transformState,X=new Date().getTime();ZG(e,T,U,function(ee){var fe=e.transformState,ke=fe.scale,we=fe.positionX,xe=fe.positionY,Le=new Date().getTime()-X,Se=Le/I,Qe=YG[b.animationType],Xe=1-Qe(Math.min(1,Se)),tt=1-ee,yt=we+a*tt,Be=xe+s*tt,Ae=uD(yt,q.positionX,we,k,y,d,u,H,$,Xe),bt=uD(Be,q.positionY,xe,_,y,m,p,Q,Y,Xe);(we!==yt||xe!==Be)&&e.setTransformState(ke,Ae,bt)})}}function cD(e,t){var n=e.transformState.scale;Fl(e),e0(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?Y8e(e,t):K8e(e,t)}function QG(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,d=o||t.1&&p;m?iEe(e):QG(e)}}function JE(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=C2(ns(t,2),o,a,0,!1),u=e0(e,l),d=w4(e,n,r,l,u,s),p=d.x,m=d.y;return{scale:l,positionX:p,positionY:m}}function JG(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.minScale,s=o.limitToBounds,l=o.zoomAnimation,u=l.disabled,d=l.animationTime,p=l.animationType,m=u||r>=a;if((r>=1||s)&&QG(e),!(m||!i||!e.mounted)){var y=t||i.offsetWidth/2,b=n||i.offsetHeight/2,w=JE(e,a,y,b);w&&ff(e,w,d,p)}}var Wd=function(){return Wd=Object.assign||function(t){for(var n,r=1,i=arguments.length;ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},SEe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=C4(a,i);return!l},wEe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},CEe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=ns(i[0].clientX-r.left,5),a=ns(i[0].clientY-r.top,5),s=ns(i[1].clientX-r.left,5),l=ns(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},aq=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},_Ee=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=i.disablePadding,u=s.size,d=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var p=t/r,m=p*n;return C2(ns(m,2),a,o,u,!d&&!l)},kEe=160,EEe=100,PEe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Fl(e),mr(Un(e),t,r),mr(Un(e),t,i))},TEe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,d=a.centerZoomedOut,p=a.zoomAnimation,m=a.wheel,y=a.disablePadding,b=p.size,w=p.disabled,E=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var _=yEe(t,null),k=bEe(e,_,E,!t.ctrlKey);if(l!==k){var T=e0(e,k),L=oq(t,o,l),O=w||b===0||d||y,D=u&&O,I=w4(e,L.x,L.y,k,T,D),N=I.x,U=I.y;e.previousWheelEvent=t,e.setTransformState(k,N,U),mr(Un(e),t,r),mr(Un(e),t,i)}},MEe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;a7(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(JG(e,t.x,t.y),e.wheelAnimationTimer=null)},EEe);var o=xEe(e,t);o&&(a7(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,mr(Un(e),t,r),mr(Un(e),t,i))},kEe))},LEe=function(e,t){var n=aq(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Fl(e)},AEe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,d=l.size;if(!(r===null||!n)){var p=CEe(t,i,n);if(!(!Number.isFinite(p.x)||!Number.isFinite(p.y))){var m=aq(t),y=_Ee(e,m);if(y!==i){var b=e0(e,y),w=u||d===0||s,E=a&&w,_=w4(e,p.x,p.y,y,b,E),k=_.x,T=_.y;e.pinchMidpoint=p,e.lastDistance=m,e.setTransformState(y,k,T)}}}},OEe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,JG(e,t==null?void 0:t.x,t==null?void 0:t.y)},sq=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;a7(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,mr(Un(e),t,n)},r)},REe=function(e,t){var n=e.props,r=n.onZoomStart,i=n.onZoom,o=e.setup.doubleClick,a=o.animationTime,s=o.animationType;mr(Un(e),t,r),rq(e,a,s,function(){return mr(Un(e),t,i)}),sq(e,t)};function IEe(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,i=e.transformState,o=e.contentComponent,a=i.scale,s=e.props,l=s.onZoomStart,u=s.onZoom,d=n.doubleClick,p=d.disabled,m=d.mode,y=d.step,b=d.animationTime,w=d.animationType;if(!p&&!r){if(m==="reset")return REe(e,t);if(!o)return console.error("No ContentComponent found");var E=m==="zoomOut"?-1:1,_=tq(e,E,y);if(a!==_){mr(Un(e),t,l);var k=oq(t,o,a),T=JE(e,_,k.x,k.y);if(!T)return console.error("Error during zoom event. New transformation state was not calculated.");mr(Un(e),t,u),ff(e,T,b,w),sq(e,t)}}}var DEe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),d=n&&l&&u&&!a;if(!d)return!1;var p=C4(l,s);return!p},jEe=function(){function e(t){var n=this;this.mounted=!0,this.onChangeCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){n.initializeWindowEvents()},this.unmount=function(){n.cleanupWindowEvents()},this.update=function(r){e0(n,n.transformState.scale),n.setup=hD(r)},this.initializeWindowEvents=function(){var r,i=s6(),o=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,a=o==null?void 0:o.defaultView;a==null||a.addEventListener("mousedown",n.onPanningStart,i),a==null||a.addEventListener("mousemove",n.onPanning,i),a==null||a.addEventListener("mouseup",n.onPanningStop,i),o==null||o.addEventListener("mouseleave",n.clearPanning,i),a==null||a.addEventListener("keyup",n.setKeyUnPressed,i),a==null||a.addEventListener("keydown",n.setKeyPressed,i)},this.cleanupWindowEvents=function(){var r,i,o=s6(),a=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,s=a==null?void 0:a.defaultView;s==null||s.removeEventListener("mousedown",n.onPanningStart,o),s==null||s.removeEventListener("mousemove",n.onPanning,o),s==null||s.removeEventListener("mouseup",n.onPanningStop,o),a==null||a.removeEventListener("mouseleave",n.clearPanning,o),s==null||s.removeEventListener("keyup",n.setKeyUnPressed,o),s==null||s.removeEventListener("keydown",n.setKeyPressed,o),document.removeEventListener("mouseleave",n.clearPanning,o),Fl(n),(i=n.observer)===null||i===void 0||i.disconnect()},this.handleInitializeWrapperEvents=function(r){var i=s6();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},this.handleInitialize=function(r){var i=n.setup.centerOnInit;n.applyTransformation(),i&&(n.setCenter(),n.observer=new ResizeObserver(function(){var o;n.setCenter(),(o=n.observer)===null||o===void 0||o.disconnect()}),n.observer.observe(r))},this.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=mEe(n,r);if(o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(PEe(n,r),TEe(n,r),MEe(n,r))}}},this.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=sD(n,r);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),Fl(n),cD(n,r),mr(Un(n),r,o))}}},this.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=lD(n);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),dD(n,r.clientX,r.clientY),mr(Un(n),r,o))}}},this.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(oEe(n),mr(Un(n),r,i))},this.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=SEe(n,r);l&&(LEe(n,r),Fl(n),mr(Un(n),r,a),mr(Un(n),r,s))}},this.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=wEe(n);l&&(r.preventDefault(),r.stopPropagation(),AEe(n,r),mr(Un(n),r,a),mr(Un(n),r,s))}},this.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(OEe(n),mr(Un(n),r,o),mr(Un(n),r,a))},this.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=sD(n,r);if(a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Fl(n);var l=r.touches,u=l.length===1,d=l.length===2;u&&(Fl(n),cD(n,r),mr(Un(n),r,o)),d&&n.onPinchStart(r)}}}},this.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=lD(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];dD(n,s.clientX,s.clientY),mr(Un(n),r,o)}else r.touches.length>1&&n.onPinch(r)},this.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},this.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=DEe(n,r);o&&IEe(n,r)}},this.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},this.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},this.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},this.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},this.setTransformState=function(r,i,o){var a=n.props.onTransformed;if(!Number.isNaN(r)&&!Number.isNaN(i)&&!Number.isNaN(o)){r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o;var s=Un(n);n.onChangeCallbacks.forEach(function(l){return l(s)}),mr(s,{scale:r,positionX:i,positionY:o},a),n.applyTransformation()}else console.error("Detected NaN set state values")},this.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=iq(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},this.handleTransformStyles=function(r,i,o){return n.props.customTransform?n.props.customTransform(r,i,o):pEe(r,i,o)},this.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=n.handleTransformStyles(o,a,i);n.contentComponent.style.transform=s}},this.getContext=function(){return Un(n)},this.onChange=function(r){return n.onChangeCallbacks.has(r)||n.onChangeCallbacks.add(r),function(){n.onChangeCallbacks.delete(r)}},this.init=function(r,i){n.cleanupWindowEvents(),n.wrapperComponent=r,n.contentComponent=i,e0(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(i),n.initializeWindowEvents(),n.isInitialized=!0,mr(Un(n),void 0,n.props.onInit)},this.props=t,this.setup=hD(this.props),this.transformState=eq(this.props)}return e}(),eP=Ke.createContext(null),NEe=function(e,t){return typeof e=="function"?e(t):e},$Ee=Ke.forwardRef(function(e,t){var n=S.useState(0),r=n[1],i=e.children,o=S.useRef(new jEe(e)).current,a=NEe(e.children,Un(o)),s=S.useCallback(function(){typeof i=="function"&&r(function(l){return l+1})},[i]);return S.useImperativeHandle(t,function(){return Un(o)},[o]),S.useEffect(function(){o.update(e)},[o,e]),S.useEffect(function(){return o.onChange(s)},[o,e,s]),Ke.createElement(eP.Provider,{value:o},a)});function FEe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var BEe=`.transform-component-module_wrapper__7HFJe { position: relative; width: -moz-fit-content; width: fit-content; @@ -505,7 +505,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .transform-component-module_content__uCDPE img { pointer-events: none; } -`,hD={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};NEe($Ee);var FEe=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=e.wrapperProps,u=l===void 0?{}:l,d=e.contentProps,p=d===void 0?{}:d,m=S.useContext(eP).init,y=S.useRef(null),b=S.useRef(null);return S.useEffect(function(){var w=y.current,E=b.current;w!==null&&E!==null&&m&&m(w,E)},[]),qe.createElement("div",Wd({},u,{ref:y,className:"react-transform-wrapper ".concat(hD.wrapper," ").concat(r),style:a}),qe.createElement("div",Wd({},p,{ref:b,className:"react-transform-component ".concat(hD.content," ").concat(o),style:s}),t))};qe.forwardRef(function(e,t){var n=S.useRef(null),r=S.useContext(eP);return S.useEffect(function(){return r.onChange(function(i){if(n.current){var o=0,a=0;n.current.style.transform=r.handleTransformStyles(o,a,1/i.state.scale)}})},[r]),qe.createElement("div",Wd({},e,{ref:hEe([n,t])}))});function BEe({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=S.useState(0),[a,s]=S.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},d=()=>{s(!a)};return g.jsx(jEe,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:p,zoomOut:m,resetTransform:y,centerView:b})=>g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"lightbox-image-options",children:[g.jsx(Ke,{icon:g.jsx(F_e,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>p(),fontSize:20}),g.jsx(Ke,{icon:g.jsx(B_e,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),g.jsx(Ke,{icon:g.jsx(N_e,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),g.jsx(Ke,{icon:g.jsx($_e,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),g.jsx(Ke,{icon:g.jsx(r7e,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),g.jsx(Ke,{icon:g.jsx(p4,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{y(),o(0),s(!1)},fontSize:20})]}),g.jsx(FEe,{wrapperStyle:{width:"100%",height:"100%"},children:g.jsx("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function zEe(){const e=Le(),t=le(m=>m.lightbox.isLightboxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=le(lG),[a,s]=S.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(bE())},p=()=>{e(yE())};return Ze("Esc",()=>{t&&e(Om(!1))},[t]),g.jsxs("div",{className:"lightbox-container",children:[g.jsx(Ke,{icon:g.jsx(j_e,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Om(!1))},fontSize:20}),g.jsxs("div",{className:"lightbox-display-container",children:[g.jsxs("div",{className:"lightbox-preview-wrapper",children:[g.jsx(aG,{}),!r&&g.jsxs("div",{className:"current-image-next-prev-buttons",children:[g.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&g.jsx(ls,{"aria-label":"Previous image",icon:g.jsx(YU,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),g.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&g.jsx(ls,{"aria-label":"Next image",icon:g.jsx(XU,{className:"next-prev-button"}),variant:"unstyled",onClick:p})})]}),n&&g.jsxs(g.Fragment,{children:[g.jsx(BEe,{image:n.url,styleClass:"lightbox-image"}),r&&g.jsx(VE,{image:n})]})]}),g.jsx(qG,{})]})]})}function HEe(e){const{menuType:t="icon",iconTooltip:n,buttonText:r,menuItems:i,menuProps:o,menuButtonProps:a,menuListProps:s,menuItemProps:l}=e,u=()=>{const d=[];return i.forEach((p,m)=>{d.push(g.jsx(kH,{onClick:p.onClick,fontSize:"0.9rem",color:"var(--text-color-secondary)",backgroundColor:"var(--background-color-secondary)",_focus:{color:"var(--text-color)",backgroundColor:"var(--border-color)"},...l,children:p.item},m))}),d};return g.jsx(wH,{...o,children:({isOpen:d})=>g.jsxs(g.Fragment,{children:[g.jsx(PH,{as:t==="icon"?Ke:On,tooltip:n,icon:d?g.jsx(a7e,{}):g.jsx(o7e,{}),padding:t==="regular"?"0 0.5rem":0,backgroundColor:"var(--btn-base-color)",_hover:{backgroundColor:"var(--btn-base-color-hover)"},minWidth:"1rem",minHeight:"1rem",fontSize:"1.5rem",...a,children:t==="regular"&&r}),g.jsx(EH,{zIndex:15,padding:0,borderRadius:"0.5rem",backgroundColor:"var(--background-color-secondary)",color:"var(--text-color-secondary)",borderColor:"var(--border-color)",...s,children:u()})]})})}const WEe=lt(hr,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable,currentIteration:e.currentIteration,totalIterations:e.totalIterations,cancelType:e.cancelOptions.cancelType,cancelAfter:e.cancelOptions.cancelAfter}),{memoizeOptions:{resultEqualityCheck:Te.isEqual}});function tP(e){const t=Le(),{btnGroupWidth:n="auto",...r}=e,{isProcessing:i,isConnected:o,isCancelable:a,currentIteration:s,totalIterations:l,cancelType:u,cancelAfter:d}=le(WEe),p=S.useCallback(()=>{t(l_e()),t(HC(null))},[t]),{t:m}=De(),y=d!==null;Ze("shift+x",()=>{(o||i)&&a&&p()},[o,i,a]),S.useEffect(()=>{d!==null&&dt(GR("immediate"))},{item:m("parameters.cancel.schedule"),onClick:()=>t(GR("scheduled"))}];return g.jsxs(Gi,{isAttached:!0,variant:"link",minHeight:"2.5rem",width:n,children:[u==="immediate"?g.jsx(Ke,{icon:g.jsx(s7e,{}),tooltip:m("parameters.cancel.immediate"),"aria-label":m("parameters.cancel.immediate"),isDisabled:!o||!i||!a,onClick:p,className:"cancel-btn",...r}):g.jsx(Ke,{icon:y?g.jsx(s3,{color:"var(--text-color)"}):g.jsx(Jke,{}),tooltip:m(y?"parameters.cancel.isScheduled":"parameters.cancel.schedule"),"aria-label":m(y?"parameters.cancel.isScheduled":"parameters.cancel.schedule"),isDisabled:!o||!i||!a||s===l,onClick:()=>{t(HC(y?null:s))},className:"cancel-btn",...r}),g.jsx(HEe,{menuItems:b,iconTooltip:m("parameters.cancel.setType"),menuButtonProps:{backgroundColor:"var(--destructive-color)",color:"var(--text-color)",minWidth:"1.5rem",minHeight:"1.5rem",_hover:{backgroundColor:"var(--destructive-color-hover)"}}})]})}const nP=e=>e.generation;lt(nP,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:Te.isEqual}});const sq=lt([nP,hr,oG,Br],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:d}=t;let p=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(p=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(p=!1,m.push("No initial image selected")),u&&(p=!1,m.push("System Busy")),d||(p=!1,m.push("System Disconnected")),o&&(!(SE(a)||a==="")||l===-1)&&(p=!1,m.push("Seed-Weights badly formatted.")),{isReady:p,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:Te.isEqual,resultEqualityCheck:Te.isEqual}});function rP(e){const{iconButton:t=!1,...n}=e,r=Le(),{isReady:i}=le(sq),o=le(Br),a=()=>{r(Uk(o))},{t:s}=De();return Ze(["ctrl+enter","meta+enter"],()=>{r(Uk(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),g.jsx("div",{style:{flexGrow:4},children:t?g.jsx(Ke,{"aria-label":s("parameters.invoke"),type:"submit",icon:g.jsx(Pke,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("parameters.invoke"),tooltipProps:{placement:"bottom"},...n}):g.jsx(On,{"aria-label":s("parameters.invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const iP=lt([pp,fp,Br],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:i,shouldHoldParametersPanelOpen:o,shouldUseCanvasBetaLayout:a}=t,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=e,d=a&&n==="unifiedCanvas",p=!d&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinParametersPanel:r,shouldShowProcessButtons:!d&&(!r||!i),shouldShowParametersPanelButton:p,shouldShowParametersPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),VEe=()=>{const e=Le(),{shouldShowParametersPanelButton:t,shouldShowProcessButtons:n,shouldPinParametersPanel:r}=le(iP),i=()=>{e(Fh(!0)),r&&setTimeout(()=>e(Li(!0)),400)};return t?g.jsxs("div",{className:"show-hide-button-options",children:[g.jsx(Ke,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:i,children:g.jsx(HE,{})}),n&&g.jsxs(g.Fragment,{children:[g.jsx(rP,{iconButton:!0}),g.jsx(tP,{})]})]}):null};function UEe(e){return ut({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}const GEe=lt(pp,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),qEe=()=>{const{resultImages:e,userImages:t}=le(GEe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},KEe=lt([fp,h4,Br],(e,t,n)=>{const{shouldShowDualDisplay:r,shouldPinParametersPanel:i}=e,{isLightboxOpen:o}=t;return{shouldShowDualDisplay:r,shouldPinParametersPanel:i,isLightboxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),oP=e=>{const t=Le(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,shouldShowDualDisplay:a,isLightboxOpen:s,shouldShowDualDisplayButton:l}=le(KEe),u=qEe(),d=()=>{t(I4e(!a)),t(Li(!0))},p=m=>{const y=m.dataTransfer.getData("invokeai/imageUuid"),b=u(y);b&&(o==="img2img"?t(v0(b)):o==="unifiedCanvas"&&t(o4(b)))};return g.jsx("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:g.jsxs("div",{className:"workarea-main",children:[n,g.jsxs("div",{className:"workarea-children-wrapper",onDrop:p,children:[r,l&&g.jsx(si,{label:"Toggle Split View",children:g.jsx("div",{className:"workarea-split-button","data-selected":a,onClick:d,children:g.jsx(UEe,{})})})]}),!s&&g.jsx(qG,{})]})})},YEe=e=>{const{styleClass:t}=e,n=S.useContext(IE),r=()=>{n&&n()};return g.jsx("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:g.jsxs("div",{className:"image-upload-button",children:[g.jsx(g4,{}),g.jsx(jh,{size:"lg",children:"Click or Drag and Drop"})]})})},XEe=lt([pp,fp,Br],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),lq=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=le(XEe);return g.jsx("div",{className:"current-image-area","data-tab-name":t,children:e?g.jsxs(g.Fragment,{children:[g.jsx(aG,{}),g.jsx(Vke,{})]}):g.jsx("div",{className:"current-image-display-placeholder",children:g.jsx(i7e,{})})})},ZEe=()=>{const e=S.useContext(IE);return g.jsx(Ke,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:g.jsx(g4,{}),onClick:e||void 0})};function QEe(){const e=le(o=>o.generation.initialImage),{t}=De(),n=Le(),r=s2(),i=()=>{r({title:t("toast.parametersFailed"),description:t("toast.parametersFailedDesc"),status:"error",isClosable:!0}),n(oV())};return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"init-image-preview-header",children:[g.jsx("h2",{children:t("parameters.initialImage")}),g.jsx(ZEe,{})]}),e&&g.jsx("div",{className:"init-image-preview",children:g.jsx(Nw,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const JEe=()=>{const e=le(r=>r.generation.initialImage),{currentImage:t}=le(r=>r.gallery),n=e?g.jsx("div",{className:"image-to-image-area",children:g.jsx(QEe,{})}):g.jsx(YEe,{});return g.jsxs("div",{className:"workarea-split-view",children:[g.jsx("div",{className:"workarea-split-view-left",children:n}),t&&g.jsx("div",{className:"workarea-split-view-right",children:g.jsx(lq,{})})]})};var oo=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(oo||{});const ePe=()=>{const{t:e}=De();return S.useMemo(()=>({[0]:{text:e("tooltip.feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip.feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip.feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip.feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip.feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip.feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip.feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip.feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip.feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip.feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip.feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},tPe=e=>ePe()[e],Ja=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return g.jsxs(sn,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[g.jsx(Sn,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),g.jsx(X8,{className:"invokeai__switch-root",...s})]})};function uq(){const e=le(i=>i.system.isGFPGANAvailable),t=le(i=>i.postprocessing.shouldRunFacetool),n=Le(),r=i=>n(H3e(i.target.checked));return g.jsx(Ja,{isDisabled:!e,isChecked:t,onChange:r})}const cq=()=>{const e=Le(),t=le(i=>i.generation.seamless),n=i=>e(cV(i.target.checked)),{t:r}=De();return g.jsx(ke,{gap:2,direction:"column",children:g.jsx(Ja,{label:r("parameters.seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})};function aP(){const e=le(o=>o.generation.horizontalSymmetryTimePercentage),t=le(o=>o.generation.verticalSymmetryTimePercentage),n=le(o=>o.generation.steps),r=Le(),{t:i}=De();return g.jsxs(g.Fragment,{children:[g.jsx(Dn,{label:i("parameters.hSymmetryStep"),value:e,onChange:o=>r(aR(o)),min:0,max:n,step:1,withInput:!0,inputWidth:"6.5rem",withSliderMarks:!0,withReset:!0,handleReset:()=>r(aR(0)),sliderMarkRightOffset:-6}),g.jsx(Dn,{label:i("parameters.vSymmetryStep"),value:t,onChange:o=>r(sR(o)),min:0,max:n,step:1,withInput:!0,inputWidth:"6.5rem",withSliderMarks:!0,withReset:!0,handleReset:()=>r(sR(0)),sliderMarkRightOffset:-6})]})}const nPe=()=>g.jsxs(ke,{gap:2,direction:"column",children:[g.jsx(cq,{}),g.jsx(aP,{})]});function rPe(){const e=Le(),t=le(r=>r.generation.perlin),{t:n}=De();return g.jsx(Dn,{label:n("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:r=>e(bk(r)),handleReset:()=>e(bk(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}function iPe(){const e=Le(),{t}=De(),n=le(i=>i.generation.shouldRandomizeSeed),r=i=>e(N3e(i.target.checked));return g.jsx(Ja,{label:t("parameters.randomizeSeed"),isChecked:n,onChange:r})}const pD=/^-?(0\.)?\.?$/,lc=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:d,min:p,max:m,isInteger:y=!0,formControlProps:b,formLabelProps:w,numberInputFieldProps:E,numberInputStepperProps:_,tooltipProps:k,...T}=e,[L,O]=S.useState(String(u));S.useEffect(()=>{!L.match(pD)&&u!==Number(L)&&O(String(u))},[u,L]);const D=N=>{O(N),N.match(pD)||d(y?Math.floor(Number(N)):Number(N))},I=N=>{const V=Te.clamp(y?Math.floor(Number(N.target.value)):Number(N.target.value),p,m);O(String(V)),d(V)};return g.jsx(si,{...k,children:g.jsxs(sn,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&g.jsx(Sn,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...w,children:t}),g.jsxs(H8,{className:"invokeai__number-input-root",value:L,min:p,max:m,keepWithinRange:!0,clampValueOnBlur:!1,onChange:D,onBlur:I,width:a,...T,children:[g.jsx(W8,{className:"invokeai__number-input-field",textAlign:s,...E}),o&&g.jsxs("div",{className:"invokeai__number-input-stepper",children:[g.jsx(U8,{..._,className:"invokeai__number-input-stepper-button"}),g.jsx(V8,{..._,className:"invokeai__number-input-stepper-button"})]})]})]})})};function oPe(){const e=le(a=>a.generation.seed),t=le(a=>a.generation.shouldRandomizeSeed),n=le(a=>a.generation.shouldGenerateVariations),{t:r}=De(),i=Le(),o=a=>i(g2(a));return g.jsx(lc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:EE,max:PE,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function aPe(){const e=Le(),t=le(i=>i.generation.shouldRandomizeSeed),{t:n}=De(),r=()=>e(g2(DU(EE,PE)));return g.jsx(ss,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:g.jsx("p",{children:n("parameters.shuffle")})})}function sPe(){const e=Le(),t=le(r=>r.generation.threshold),{t:n}=De();return g.jsx(Dn,{label:n("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:r=>e(Sk(r)),handleReset:()=>e(Sk(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"6rem"})}const sP=()=>g.jsxs(ke,{gap:2,direction:"column",children:[g.jsx(iPe,{}),g.jsxs(ke,{gap:2,children:[g.jsx(oPe,{}),g.jsx(aPe,{})]}),g.jsx(ke,{gap:2,children:g.jsx(sPe,{})}),g.jsx(ke,{gap:2,children:g.jsx(rPe,{})})]});function dq(){const e=le(i=>i.system.isESRGANAvailable),t=le(i=>i.postprocessing.shouldRunESRGAN),n=Le(),r=i=>n(z3e(i.target.checked));return g.jsx(Ja,{isDisabled:!e,isChecked:t,onChange:r})}function lP(){const e=le(r=>r.generation.shouldGenerateVariations),t=Le(),n=r=>t(j3e(r.target.checked));return g.jsx(Ja,{isChecked:e,width:"auto",onChange:n})}function qn(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return g.jsxs(sn,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&g.jsx(Sn,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),g.jsx(T8,{...l,className:"input-entry",size:a,width:o})]})}function lPe(){const e=le(o=>o.generation.seedWeights),t=le(o=>o.generation.shouldGenerateVariations),{t:n}=De(),r=Le(),i=o=>r(dV(o.target.value));return g.jsx(qn,{label:n("parameters.seedWeights"),value:e,isInvalid:t&&!(SE(e)||e===""),isDisabled:!t,onChange:i})}function uPe(){const e=le(i=>i.generation.variationAmount),t=le(i=>i.generation.shouldGenerateVariations),{t:n}=De(),r=Le();return g.jsx(Dn,{label:n("parameters.variationAmount"),value:e,step:.01,min:0,max:1,isSliderDisabled:!t,isInputDisabled:!t,isResetDisabled:!t,onChange:i=>r(oR(i)),handleReset:()=>r(oR(.1)),withInput:!0,withReset:!0,withSliderMarks:!0})}const uP=()=>g.jsxs(ke,{gap:2,direction:"column",children:[g.jsx(uPe,{}),g.jsx(lPe,{})]}),cPe=lt(hr,e=>e.shouldDisplayGuides),dPe=({children:e,feature:t})=>{const n=le(cPe),{text:r}=tPe(t);return n?g.jsxs(q8,{trigger:"hover",children:[g.jsx(G8,{children:g.jsx(ao,{children:e})}),g.jsxs(Y8,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[g.jsx(K8,{className:"guide-popover-arrow"}),g.jsx("div",{className:"guide-popover-guide-content",children:r})]})]}):null},fPe=Xe(({feature:e,icon:t=t7e},n)=>g.jsx(dPe,{feature:e,children:g.jsx(ao,{ref:n,children:g.jsx(Da,{marginBottom:"-.15rem",as:t})})}));function hPe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return g.jsxs(rm,{className:"advanced-parameters-item",children:[g.jsx(tm,{className:"advanced-parameters-header",children:g.jsxs(ke,{width:"100%",gap:"0.5rem",align:"center",children:[g.jsx(ao,{flexGrow:1,textAlign:"left",children:t}),i,n&&g.jsx(fPe,{feature:n}),g.jsx(nm,{})]})}),g.jsx(om,{className:"advanced-parameters-panel",children:r})]})}const t0=e=>{const{accordionInfo:t}=e,n=le(a=>a.system.openAccordions),r=Le(),i=a=>r(p4e(a)),o=()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:d,additionalHeaderComponents:p}=t[s];a.push(g.jsx(hPe,{header:l,feature:u,content:d,additionalHeaderComponents:p},s))}),a};return g.jsx(f8,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:i,className:"advanced-parameters",children:o()})};function gD(){const e=Le(),t=le(o=>o.generation.cfgScale),n=le(o=>o.ui.shouldUseSliders),{t:r}=De(),i=o=>e(vk(o));return n?g.jsx(Dn,{label:r("parameters.cfgScale"),step:.5,min:1.01,max:30,onChange:i,handleReset:()=>e(vk(7.5)),value:t,sliderMarkRightOffset:-5,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0}):g.jsx(lc,{label:r("parameters.cfgScale"),step:.5,min:1.01,max:200,onChange:i,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function mD(){const e=le(o=>o.generation.height),t=le(o=>o.ui.shouldUseSliders),n=le(Br),r=Le(),{t:i}=De();return t?g.jsx(Dn,{isSliderDisabled:n==="unifiedCanvas",isInputDisabled:n==="unifiedCanvas",isResetDisabled:n==="unifiedCanvas",label:i("parameters.height"),value:e,min:64,step:64,max:2048,onChange:o=>r(cS(o)),handleReset:()=>r(cS(512)),withInput:!0,withReset:!0,withSliderMarks:!0,sliderMarkRightOffset:-8,inputWidth:"6.2rem",sliderNumberInputProps:{max:15360}}):g.jsx(Jo,{isDisabled:n==="unifiedCanvas",label:i("parameters.height"),value:e,flexGrow:1,onChange:o=>r(cS(Number(o.target.value))),validValues:M5e,styleClass:"main-settings-block",width:"5.5rem"})}function vD(){const e=le(o=>o.generation.iterations),t=le(o=>o.ui.shouldUseSliders),n=Le(),{t:r}=De(),i=o=>n(JO(o));return t?g.jsx(Dn,{label:r("parameters.images"),step:1,min:1,max:16,onChange:i,handleReset:()=>n(JO(1)),value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderMarkRightOffset:-5,sliderNumberInputProps:{max:9999}}):g.jsx(lc,{label:r("parameters.images"),step:1,min:1,max:9999,onChange:i,value:e,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function yD(){const e=le(o=>o.generation.sampler),t=le(WU),n=Le(),{t:r}=De(),i=o=>n(uV(o.target.value));return g.jsx(Jo,{label:r("parameters.sampler"),value:e,onChange:i,validValues:t.format==="diffusers"?P5e:E5e,styleClass:"main-settings-block",minWidth:"9rem"})}function bD(){const e=Le(),t=le(o=>o.generation.steps),n=le(o=>o.ui.shouldUseSliders),{t:r}=De(),i=o=>e(xk(o));return n?g.jsx(Dn,{label:r("parameters.steps"),min:1,step:1,onChange:i,handleReset:()=>e(xk(20)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0,sliderMarkRightOffset:-6,sliderNumberInputProps:{max:9999}}):g.jsx(lc,{label:r("parameters.steps"),min:1,max:9999,step:1,onChange:i,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function xD(){const e=le(o=>o.generation.width),t=le(o=>o.ui.shouldUseSliders),n=le(Br),{t:r}=De(),i=Le();return t?g.jsx(Dn,{isSliderDisabled:n==="unifiedCanvas",isInputDisabled:n==="unifiedCanvas",isResetDisabled:n==="unifiedCanvas",label:r("parameters.width"),value:e,min:64,step:64,max:2048,onChange:o=>i(dS(o)),handleReset:()=>i(dS(512)),withInput:!0,withReset:!0,withSliderMarks:!0,sliderMarkRightOffset:-8,inputWidth:"6.2rem",inputReadOnly:!0,sliderNumberInputProps:{max:15360}}):g.jsx(Jo,{isDisabled:n==="unifiedCanvas",label:r("parameters.width"),value:e,flexGrow:1,onChange:o=>i(dS(Number(o.target.value))),validValues:T5e,styleClass:"main-settings-block",width:"5.5rem"})}function cP(){const{t:e}=De(),t=le(r=>r.ui.shouldUseSliders),n={main:{header:`${e("parameters.general")}`,feature:void 0,content:t?g.jsxs(ke,{flexDir:"column",rowGap:2,children:[g.jsx(vD,{}),g.jsx(bD,{}),g.jsx(gD,{}),g.jsx(xD,{}),g.jsx(mD,{}),g.jsx(yD,{})]}):g.jsxs(ke,{flexDirection:"column",rowGap:2,children:[g.jsxs(ke,{gap:2,children:[g.jsx(vD,{}),g.jsx(bD,{}),g.jsx(gD,{})]}),g.jsxs(ke,{children:[g.jsx(xD,{}),g.jsx(mD,{}),g.jsx(yD,{})]})]})}};return g.jsx(t0,{accordionInfo:n})}const pPe=lt($E,({shouldLoopback:e})=>e),gPe=()=>{const e=Le(),t=le(pPe),{t:n}=De();return g.jsx(Ke,{"aria-label":n("parameters.toggleLoopback"),tooltip:n("parameters.toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:g.jsx(Mke,{}),onClick:()=>{e(B3e(!t))}})},dP=()=>{const e=le(Br);return g.jsxs("div",{className:"process-buttons",children:[g.jsx(rP,{}),e==="img2img"&&g.jsx(gPe,{}),g.jsx(tP,{})]})},fP=()=>{const e=le(r=>r.generation.negativePrompt),t=Le(),{t:n}=De();return g.jsx(sn,{children:g.jsx(J8,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(Dy(r.target.value)),background:"var(--prompt-bg-color)",placeholder:n("parameters.negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},mPe=lt([e=>e.generation,Br],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),hP=()=>{const e=Le(),{prompt:t,activeTabName:n}=le(mPe),{isReady:r}=le(sq),i=S.useRef(null),{t:o}=De(),a=l=>{e(a4(l.target.value))};Ze("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e(Uk(n)))};return g.jsx("div",{className:"prompt-bar",children:g.jsx(sn,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:g.jsx(J8,{id:"prompt",name:"prompt",placeholder:o("parameters.promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},fq=""+new URL("logo-13003d72.png",import.meta.url).href,vPe=lt(fp,e=>{const{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}=e;return{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),pP=e=>{const t=Le(),{shouldShowParametersPanel:n,shouldHoldParametersPanelOpen:r,shouldPinParametersPanel:i}=le(vPe),o=S.useRef(null),a=S.useRef(null),s=S.useRef(null),{children:l}=e;Ze("o",()=>{t(Fh(!n)),i&&setTimeout(()=>t(Li(!0)),400)},[n,i]),Ze("esc",()=>{t(Fh(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Ze("shift+o",()=>{m(),t(Li(!0))},[i]);const u=S.useCallback(()=>{i||(t(A4e(a.current?a.current.scrollTop:0)),t(Fh(!1)),t(O4e(!1)))},[t,i]),d=()=>{s.current=window.setTimeout(()=>u(),500)},p=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(R4e(!i)),t(Li(!0))};return S.useEffect(()=>{function y(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[u]),g.jsx(gG,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:g.jsx("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:p,onMouseOver:i?void 0:p,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:g.jsx("div",{className:"parameters-panel-margin",children:g.jsxs("div",{className:"parameters-panel",ref:a,onMouseLeave:y=>{y.target!==a.current?p():!i&&d()},children:[g.jsx(si,{label:"Pin Options Panel",children:g.jsx("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:m,children:i?g.jsx(cG,{}):g.jsx(dG,{})})}),!i&&g.jsxs("div",{className:"invoke-ai-logo-wrapper",children:[g.jsx("img",{src:fq,alt:"invoke-ai-logo"}),g.jsxs("h1",{children:["invoke ",g.jsx("strong",{children:"ai"})]})]}),l]})})})})};function yPe(){const e=Le(),t=le(i=>i.generation.shouldFitToWidthHeight),n=i=>e(fV(i.target.checked)),{t:r}=De();return g.jsx(Ja,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function hq(e){const{t}=De(),{label:n=`${t("parameters.strength")}`,styleClass:r}=e,i=le(l=>l.generation.img2imgStrength),o=Le(),a=l=>o(yk(l)),s=()=>{o(yk(.75))};return g.jsx(Dn,{label:n,step:.01,min:.01,max:1,onChange:a,value:i,isInteger:!1,styleClass:r,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:s})}function bPe(){const{t:e}=De(),t={imageToImage:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:g.jsxs(ke,{gap:2,flexDir:"column",children:[g.jsx(hq,{label:e("parameters.img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),g.jsx(yPe,{})]})}};return g.jsx(t0,{accordionInfo:t})}function xPe(){const{t:e}=De(),t={seed:{header:`${e("parameters.seed")}`,feature:oo.SEED,content:g.jsx(sP,{})},variations:{header:`${e("parameters.variations")}`,feature:oo.VARIATIONS,content:g.jsx(uP,{}),additionalHeaderComponents:g.jsx(lP,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:oo.FACE_CORRECTION,content:g.jsx(jE,{}),additionalHeaderComponents:g.jsx(uq,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:oo.UPSCALE,content:g.jsx(NE,{}),additionalHeaderComponents:g.jsx(dq,{})},other:{header:`${e("parameters.otherOptions")}`,feature:oo.OTHER,content:g.jsx(nPe,{})}};return g.jsxs(pP,{children:[g.jsxs(ke,{flexDir:"column",rowGap:"0.5rem",children:[g.jsx(hP,{}),g.jsx(fP,{})]}),g.jsx(dP,{}),g.jsx(cP,{}),g.jsx(bPe,{}),g.jsx(t0,{accordionInfo:t})]})}function SPe(){return g.jsx(oP,{optionsPanel:g.jsx(xPe,{}),children:g.jsx(JEe,{})})}const wPe=()=>g.jsx("div",{className:"workarea-single-view",children:g.jsx("div",{className:"text-to-image-area",children:g.jsx(lq,{})})});function CPe(e){const{active:t=!0,width:n="1rem",height:r="1.3rem",side:i="right"}=e;return g.jsxs(g.Fragment,{children:[i==="right"&&g.jsx(ao,{width:n,height:r,margin:"-0.5rem 0.5rem 0 0.5rem",borderLeft:t?"3px solid var(--subhook-color)":"3px solid var(--tab-hover-color)",borderBottom:t?"3px solid var(--subhook-color)":"3px solid var(--tab-hover-color)"}),i==="left"&&g.jsx(ao,{width:n,height:r,margin:"-0.5rem 0.5rem 0 0.5rem",borderRight:t?"3px solid var(--subhook-color)":"3px solid var(--tab-hover-color)",borderBottom:t?"3px solid var(--subhook-color)":"3px solid var(--tab-hover-color)"})]})}const _Pe=lt([$E],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),kPe=()=>{const{hiresFix:e,hiresStrength:t}=le(_Pe),n=Le(),{t:r}=De(),i=a=>{n(lR(a))},o=()=>{n(lR(.75))};return g.jsxs(ke,{children:[g.jsx(CPe,{active:e}),g.jsx(Dn,{label:r("parameters.hiresStrength"),step:.01,min:.01,max:.99,onChange:i,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:o,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,sliderMarkRightOffset:-7})]})},EPe=()=>{const e=Le(),t=le(i=>i.postprocessing.hiresFix),{t:n}=De(),r=i=>e(gV(i.target.checked));return g.jsxs(ke,{rowGap:"0.8rem",direction:"column",children:[g.jsx(Ja,{label:n("parameters.hiresOptim"),fontSize:"md",isChecked:t,onChange:r}),g.jsx(kPe,{})]})},PPe=()=>g.jsxs(ke,{gap:2,direction:"column",children:[g.jsx(cq,{}),g.jsx(EPe,{}),g.jsx(aP,{})]});function TPe(){const{t:e}=De(),t={seed:{header:`${e("parameters.seed")}`,feature:oo.SEED,content:g.jsx(sP,{})},variations:{header:`${e("parameters.variations")}`,feature:oo.VARIATIONS,content:g.jsx(uP,{}),additionalHeaderComponents:g.jsx(lP,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:oo.FACE_CORRECTION,content:g.jsx(jE,{}),additionalHeaderComponents:g.jsx(uq,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:oo.UPSCALE,content:g.jsx(NE,{}),additionalHeaderComponents:g.jsx(dq,{})},other:{header:`${e("parameters.otherOptions")}`,feature:oo.OTHER,content:g.jsx(PPe,{})}};return g.jsxs(pP,{children:[g.jsxs(ke,{flexDir:"column",rowGap:"0.5rem",children:[g.jsx(hP,{}),g.jsx(fP,{})]}),g.jsx(dP,{}),g.jsx(cP,{}),g.jsx(t0,{accordionInfo:t})]})}function MPe(){return g.jsx(oP,{optionsPanel:g.jsx(TPe,{}),children:g.jsx(wPe,{})})}var s7={},LPe={get exports(){return s7},set exports(e){s7=e}};/** +`,pD={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};FEe(BEe);var zEe=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=e.wrapperProps,u=l===void 0?{}:l,d=e.contentProps,p=d===void 0?{}:d,m=S.useContext(eP).init,y=S.useRef(null),b=S.useRef(null);return S.useEffect(function(){var w=y.current,E=b.current;w!==null&&E!==null&&m&&m(w,E)},[]),Ke.createElement("div",Wd({},u,{ref:y,className:"react-transform-wrapper ".concat(pD.wrapper," ").concat(r),style:a}),Ke.createElement("div",Wd({},p,{ref:b,className:"react-transform-component ".concat(pD.content," ").concat(o),style:s}),t))};Ke.forwardRef(function(e,t){var n=S.useRef(null),r=S.useContext(eP);return S.useEffect(function(){return r.onChange(function(i){if(n.current){var o=0,a=0;n.current.style.transform=r.handleTransformStyles(o,a,1/i.state.scale)}})},[r]),Ke.createElement("div",Wd({},e,{ref:gEe([n,t])}))});function HEe({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=S.useState(0),[a,s]=S.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},d=()=>{s(!a)};return g.jsx($Ee,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:p,zoomOut:m,resetTransform:y,centerView:b})=>g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"lightbox-image-options",children:[g.jsx(Ye,{icon:g.jsx(z_e,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>p(),fontSize:20}),g.jsx(Ye,{icon:g.jsx(H_e,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),g.jsx(Ye,{icon:g.jsx(F_e,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),g.jsx(Ye,{icon:g.jsx(B_e,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),g.jsx(Ye,{icon:g.jsx(o7e,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),g.jsx(Ye,{icon:g.jsx(p4,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{y(),o(0),s(!1)},fontSize:20})]}),g.jsx(zEe,{wrapperStyle:{width:"100%",height:"100%"},children:g.jsx("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function WEe(){const e=Te(),t=le(m=>m.lightbox.isLightboxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=le(uG),[a,s]=S.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(bE())},p=()=>{e(yE())};return Je("Esc",()=>{t&&e(Om(!1))},[t]),g.jsxs("div",{className:"lightbox-container",children:[g.jsx(Ye,{icon:g.jsx($_e,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Om(!1))},fontSize:20}),g.jsxs("div",{className:"lightbox-display-container",children:[g.jsxs("div",{className:"lightbox-preview-wrapper",children:[g.jsx(sG,{}),!r&&g.jsxs("div",{className:"current-image-next-prev-buttons",children:[g.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&g.jsx(ls,{"aria-label":"Previous image",icon:g.jsx(XV,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),g.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&g.jsx(ls,{"aria-label":"Next image",icon:g.jsx(ZV,{className:"next-prev-button"}),variant:"unstyled",onClick:p})})]}),n&&g.jsxs(g.Fragment,{children:[g.jsx(HEe,{image:n.url,styleClass:"lightbox-image"}),r&&g.jsx(UE,{image:n})]})]}),g.jsx(KG,{})]})]})}function UEe(e){const{menuType:t="icon",iconTooltip:n,buttonText:r,menuItems:i,menuProps:o,menuButtonProps:a,menuListProps:s,menuItemProps:l}=e,u=()=>{const d=[];return i.forEach((p,m)=>{d.push(g.jsx(EH,{onClick:p.onClick,fontSize:"0.9rem",color:"var(--text-color-secondary)",backgroundColor:"var(--background-color-secondary)",_focus:{color:"var(--text-color)",backgroundColor:"var(--border-color)"},...l,children:p.item},m))}),d};return g.jsx(CH,{...o,children:({isOpen:d})=>g.jsxs(g.Fragment,{children:[g.jsx(TH,{as:t==="icon"?Ye:On,tooltip:n,icon:d?g.jsx(l7e,{}):g.jsx(s7e,{}),padding:t==="regular"?"0 0.5rem":0,backgroundColor:"var(--btn-base-color)",_hover:{backgroundColor:"var(--btn-base-color-hover)"},minWidth:"1rem",minHeight:"1rem",fontSize:"1.5rem",...a,children:t==="regular"&&r}),g.jsx(PH,{zIndex:15,padding:0,borderRadius:"0.5rem",backgroundColor:"var(--background-color-secondary)",color:"var(--text-color-secondary)",borderColor:"var(--border-color)",...s,children:u()})]})})}const VEe=lt(hr,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable,currentIteration:e.currentIteration,totalIterations:e.totalIterations,cancelType:e.cancelOptions.cancelType,cancelAfter:e.cancelOptions.cancelAfter}),{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});function tP(e){const t=Te(),{btnGroupWidth:n="auto",...r}=e,{isProcessing:i,isConnected:o,isCancelable:a,currentIteration:s,totalIterations:l,cancelType:u,cancelAfter:d}=le(VEe),p=S.useCallback(()=>{t(c_e()),t(HC(null))},[t]),{t:m}=De(),y=d!==null;Je("shift+x",()=>{(o||i)&&a&&p()},[o,i,a]),S.useEffect(()=>{d!==null&&dt(qR("immediate"))},{item:m("parameters.cancel.schedule"),onClick:()=>t(qR("scheduled"))}];return g.jsxs(Gi,{isAttached:!0,variant:"link",minHeight:"2.5rem",width:n,children:[u==="immediate"?g.jsx(Ye,{icon:g.jsx(u7e,{}),tooltip:m("parameters.cancel.immediate"),"aria-label":m("parameters.cancel.immediate"),isDisabled:!o||!i||!a,onClick:p,className:"cancel-btn",...r}):g.jsx(Ye,{icon:y?g.jsx(s3,{color:"var(--text-color)"}):g.jsx(t7e,{}),tooltip:m(y?"parameters.cancel.isScheduled":"parameters.cancel.schedule"),"aria-label":m(y?"parameters.cancel.isScheduled":"parameters.cancel.schedule"),isDisabled:!o||!i||!a||s===l,onClick:()=>{t(HC(y?null:s))},className:"cancel-btn",...r}),g.jsx(UEe,{menuItems:b,iconTooltip:m("parameters.cancel.setType"),menuButtonProps:{backgroundColor:"var(--destructive-color)",color:"var(--text-color)",minWidth:"1.5rem",minHeight:"1.5rem",_hover:{backgroundColor:"var(--destructive-color-hover)"}}})]})}const nP=e=>e.generation;lt(nP,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});const lq=lt([nP,hr,aG,Br],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:d}=t;let p=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(p=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(p=!1,m.push("No initial image selected")),u&&(p=!1,m.push("System Busy")),d||(p=!1,m.push("System Disconnected")),o&&(!(SE(a)||a==="")||l===-1)&&(p=!1,m.push("Seed-Weights badly formatted.")),{isReady:p,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:Pe.isEqual,resultEqualityCheck:Pe.isEqual}});function rP(e){const{iconButton:t=!1,...n}=e,r=Te(),{isReady:i}=le(lq),o=le(Br),a=()=>{r(Vk(o))},{t:s}=De();return Je(["ctrl+enter","meta+enter"],()=>{r(Vk(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),g.jsx("div",{style:{flexGrow:4},children:t?g.jsx(Ye,{"aria-label":s("parameters.invoke"),type:"submit",icon:g.jsx(Mke,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("parameters.invoke"),tooltipProps:{placement:"bottom"},...n}):g.jsx(On,{"aria-label":s("parameters.invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const iP=lt([pp,fp,Br],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:i,shouldHoldParametersPanelOpen:o,shouldUseCanvasBetaLayout:a}=t,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=e,d=a&&n==="unifiedCanvas",p=!d&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinParametersPanel:r,shouldShowProcessButtons:!d&&(!r||!i),shouldShowParametersPanelButton:p,shouldShowParametersPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),GEe=()=>{const e=Te(),{shouldShowParametersPanelButton:t,shouldShowProcessButtons:n,shouldPinParametersPanel:r}=le(iP),i=()=>{e(Fh(!0)),r&&setTimeout(()=>e(Li(!0)),400)};return t?g.jsxs("div",{className:"show-hide-button-options",children:[g.jsx(Ye,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:i,children:g.jsx(HE,{})}),n&&g.jsxs(g.Fragment,{children:[g.jsx(rP,{iconButton:!0}),g.jsx(tP,{})]})]}):null};function qEe(e){return ut({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}const KEe=lt(pp,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),YEe=()=>{const{resultImages:e,userImages:t}=le(KEe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},XEe=lt([fp,h4,Br],(e,t,n)=>{const{shouldShowDualDisplay:r,shouldPinParametersPanel:i}=e,{isLightboxOpen:o}=t;return{shouldShowDualDisplay:r,shouldPinParametersPanel:i,isLightboxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),oP=e=>{const t=Te(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,shouldShowDualDisplay:a,isLightboxOpen:s,shouldShowDualDisplayButton:l}=le(XEe),u=YEe(),d=()=>{t(j4e(!a)),t(Li(!0))},p=m=>{const y=m.dataTransfer.getData("invokeai/imageUuid"),b=u(y);b&&(o==="img2img"?t(v0(b)):o==="unifiedCanvas"&&t(o4(b)))};return g.jsx("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:g.jsxs("div",{className:"workarea-main",children:[n,g.jsxs("div",{className:"workarea-children-wrapper",onDrop:p,children:[r,l&&g.jsx(si,{label:"Toggle Split View",children:g.jsx("div",{className:"workarea-split-button","data-selected":a,onClick:d,children:g.jsx(qEe,{})})})]}),!s&&g.jsx(KG,{})]})})},ZEe=e=>{const{styleClass:t}=e,n=S.useContext(IE),r=()=>{n&&n()};return g.jsx("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:g.jsxs("div",{className:"image-upload-button",children:[g.jsx(g4,{}),g.jsx(jh,{size:"lg",children:"Click or Drag and Drop"})]})})},QEe=lt([pp,fp,Br],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),uq=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=le(QEe);return g.jsx("div",{className:"current-image-area","data-tab-name":t,children:e?g.jsxs(g.Fragment,{children:[g.jsx(sG,{}),g.jsx(Gke,{})]}):g.jsx("div",{className:"current-image-display-placeholder",children:g.jsx(a7e,{})})})},JEe=()=>{const e=S.useContext(IE);return g.jsx(Ye,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:g.jsx(g4,{}),onClick:e||void 0})};function ePe(){const e=le(o=>o.generation.initialImage),{t}=De(),n=Te(),r=s2(),i=()=>{r({title:t("toast.parametersFailed"),description:t("toast.parametersFailedDesc"),status:"error",isClosable:!0}),n(aU())};return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"init-image-preview-header",children:[g.jsx("h2",{children:t("parameters.initialImage")}),g.jsx(JEe,{})]}),e&&g.jsx("div",{className:"init-image-preview",children:g.jsx(Nw,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const tPe=()=>{const e=le(r=>r.generation.initialImage),{currentImage:t}=le(r=>r.gallery),n=e?g.jsx("div",{className:"image-to-image-area",children:g.jsx(ePe,{})}):g.jsx(ZEe,{});return g.jsxs("div",{className:"workarea-split-view",children:[g.jsx("div",{className:"workarea-split-view-left",children:n}),t&&g.jsx("div",{className:"workarea-split-view-right",children:g.jsx(uq,{})})]})};var oo=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(oo||{});const nPe=()=>{const{t:e}=De();return S.useMemo(()=>({[0]:{text:e("tooltip.feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip.feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip.feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip.feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip.feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip.feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip.feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip.feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip.feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip.feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip.feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},rPe=e=>nPe()[e],_a=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return g.jsxs(sn,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[g.jsx(Sn,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),g.jsx(X8,{className:"invokeai__switch-root",...s})]})};function cq(){const e=le(i=>i.system.isGFPGANAvailable),t=le(i=>i.postprocessing.shouldRunFacetool),n=Te(),r=i=>n(U3e(i.target.checked));return g.jsx(_a,{isDisabled:!e,isChecked:t,onChange:r})}const dq=()=>{const e=Te(),t=le(i=>i.generation.seamless),n=i=>e(dU(i.target.checked)),{t:r}=De();return g.jsx(_e,{gap:2,direction:"column",children:g.jsx(_a,{label:r("parameters.seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},iPe=()=>g.jsx(_e,{gap:2,direction:"column",children:g.jsx(dq,{})});function aP(){const e=le(o=>o.generation.horizontalSymmetryTimePercentage),t=le(o=>o.generation.verticalSymmetryTimePercentage),n=le(o=>o.generation.steps),r=Te(),{t:i}=De();return g.jsxs(g.Fragment,{children:[g.jsx(Dn,{label:i("parameters.hSymmetryStep"),value:e,onChange:o=>r(sR(o)),min:0,max:n,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>r(sR(0)),sliderMarkRightOffset:-6}),g.jsx(Dn,{label:i("parameters.vSymmetryStep"),value:t,onChange:o=>r(lR(o)),min:0,max:n,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>r(lR(0)),sliderMarkRightOffset:-6})]})}function sP(){const e=le(n=>n.generation.shouldUseSymmetry),t=Te();return g.jsx(_a,{isChecked:e,onChange:n=>t(F3e(n.target.checked))})}function oPe(){const e=Te(),t=le(r=>r.generation.perlin),{t:n}=De();return g.jsx(Dn,{label:n("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:r=>e(bk(r)),handleReset:()=>e(bk(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}function aPe(){const e=Te(),{t}=De(),n=le(i=>i.generation.shouldRandomizeSeed),r=i=>e($3e(i.target.checked));return g.jsx(_a,{label:t("parameters.randomizeSeed"),isChecked:n,onChange:r})}const gD=/^-?(0\.)?\.?$/,lc=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:d,min:p,max:m,isInteger:y=!0,formControlProps:b,formLabelProps:w,numberInputFieldProps:E,numberInputStepperProps:_,tooltipProps:k,...T}=e,[L,O]=S.useState(String(u));S.useEffect(()=>{!L.match(gD)&&u!==Number(L)&&O(String(u))},[u,L]);const D=N=>{O(N),N.match(gD)||d(y?Math.floor(Number(N)):Number(N))},I=N=>{const U=Pe.clamp(y?Math.floor(Number(N.target.value)):Number(N.target.value),p,m);O(String(U)),d(U)};return g.jsx(si,{...k,children:g.jsxs(sn,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&g.jsx(Sn,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...w,children:t}),g.jsxs(H8,{className:"invokeai__number-input-root",value:L,min:p,max:m,keepWithinRange:!0,clampValueOnBlur:!1,onChange:D,onBlur:I,width:a,...T,children:[g.jsx(W8,{className:"invokeai__number-input-field",textAlign:s,...E}),o&&g.jsxs("div",{className:"invokeai__number-input-stepper",children:[g.jsx(V8,{..._,className:"invokeai__number-input-stepper-button"}),g.jsx(U8,{..._,className:"invokeai__number-input-stepper-button"})]})]})]})})};function sPe(){const e=le(a=>a.generation.seed),t=le(a=>a.generation.shouldRandomizeSeed),n=le(a=>a.generation.shouldGenerateVariations),{t:r}=De(),i=Te(),o=a=>i(g2(a));return g.jsx(lc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:EE,max:PE,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function lPe(){const e=Te(),t=le(i=>i.generation.shouldRandomizeSeed),{t:n}=De(),r=()=>e(g2(jV(EE,PE)));return g.jsx(ss,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:g.jsx("p",{children:n("parameters.shuffle")})})}function uPe(){const e=Te(),t=le(r=>r.generation.threshold),{t:n}=De();return g.jsx(Dn,{label:n("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:r=>e(Sk(r)),handleReset:()=>e(Sk(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0,sliderMarkRightOffset:-4})}const lP=()=>g.jsxs(_e,{gap:2,direction:"column",children:[g.jsx(aPe,{}),g.jsxs(_e,{gap:2,children:[g.jsx(sPe,{}),g.jsx(lPe,{})]}),g.jsx(_e,{gap:2,children:g.jsx(uPe,{})}),g.jsx(_e,{gap:2,children:g.jsx(oPe,{})})]});function fq(){const e=le(i=>i.system.isESRGANAvailable),t=le(i=>i.postprocessing.shouldRunESRGAN),n=Te(),r=i=>n(W3e(i.target.checked));return g.jsx(_a,{isDisabled:!e,isChecked:t,onChange:r})}function uP(){const e=le(r=>r.generation.shouldGenerateVariations),t=Te(),n=r=>t(N3e(r.target.checked));return g.jsx(_a,{isChecked:e,width:"auto",onChange:n})}function qn(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return g.jsxs(sn,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&g.jsx(Sn,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),g.jsx(T8,{...l,className:"input-entry",size:a,width:o})]})}function cPe(){const e=le(o=>o.generation.seedWeights),t=le(o=>o.generation.shouldGenerateVariations),{t:n}=De(),r=Te(),i=o=>r(fU(o.target.value));return g.jsx(qn,{label:n("parameters.seedWeights"),value:e,isInvalid:t&&!(SE(e)||e===""),isDisabled:!t,onChange:i})}function dPe(){const e=le(i=>i.generation.variationAmount),t=le(i=>i.generation.shouldGenerateVariations),{t:n}=De(),r=Te();return g.jsx(Dn,{label:n("parameters.variationAmount"),value:e,step:.01,min:0,max:1,isSliderDisabled:!t,isInputDisabled:!t,isResetDisabled:!t,onChange:i=>r(aR(i)),handleReset:()=>r(aR(.1)),withInput:!0,withReset:!0,withSliderMarks:!0})}const cP=()=>g.jsxs(_e,{gap:2,direction:"column",children:[g.jsx(dPe,{}),g.jsx(cPe,{})]}),fPe=lt(hr,e=>e.shouldDisplayGuides),hPe=({children:e,feature:t})=>{const n=le(fPe),{text:r}=rPe(t);return n?g.jsxs(q8,{trigger:"hover",children:[g.jsx(G8,{children:g.jsx(ao,{children:e})}),g.jsxs(Y8,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[g.jsx(K8,{className:"guide-popover-arrow"}),g.jsx("div",{className:"guide-popover-guide-content",children:r})]})]}):null},pPe=Ze(({feature:e,icon:t=r7e},n)=>g.jsx(hPe,{feature:e,children:g.jsx(ao,{ref:n,children:g.jsx(ja,{marginBottom:"-.15rem",as:t})})}));function gPe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return g.jsxs(rm,{className:"advanced-parameters-item",children:[g.jsx(tm,{className:"advanced-parameters-header",children:g.jsxs(_e,{width:"100%",gap:"0.5rem",align:"center",children:[g.jsx(ao,{flexGrow:1,textAlign:"left",children:t}),i,n&&g.jsx(pPe,{feature:n}),g.jsx(nm,{})]})}),g.jsx(om,{className:"advanced-parameters-panel",children:r})]})}const t0=e=>{const{accordionInfo:t}=e,n=le(a=>a.system.openAccordions),r=Te(),i=a=>r(m4e(a)),o=()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:d,additionalHeaderComponents:p}=t[s];a.push(g.jsx(gPe,{header:l,feature:u,content:d,additionalHeaderComponents:p},s))}),a};return g.jsx(f8,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:i,className:"advanced-parameters",children:o()})};function mD(){const e=Te(),t=le(o=>o.generation.cfgScale),n=le(o=>o.ui.shouldUseSliders),{t:r}=De(),i=o=>e(vk(o));return n?g.jsx(Dn,{label:r("parameters.cfgScale"),step:.5,min:1.01,max:30,onChange:i,handleReset:()=>e(vk(7.5)),value:t,sliderMarkRightOffset:-5,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0}):g.jsx(lc,{label:r("parameters.cfgScale"),step:.5,min:1.01,max:200,onChange:i,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function vD(){const e=le(o=>o.generation.height),t=le(o=>o.ui.shouldUseSliders),n=le(Br),r=Te(),{t:i}=De();return t?g.jsx(Dn,{isSliderDisabled:n==="unifiedCanvas",isInputDisabled:n==="unifiedCanvas",isResetDisabled:n==="unifiedCanvas",label:i("parameters.height"),value:e,min:64,step:64,max:2048,onChange:o=>r(cS(o)),handleReset:()=>r(cS(512)),withInput:!0,withReset:!0,withSliderMarks:!0,sliderMarkRightOffset:-8,inputWidth:"6.2rem",sliderNumberInputProps:{max:15360}}):g.jsx(Jo,{isDisabled:n==="unifiedCanvas",label:i("parameters.height"),value:e,flexGrow:1,onChange:o=>r(cS(Number(o.target.value))),validValues:A5e,styleClass:"main-settings-block",width:"5.5rem"})}function yD(){const e=le(o=>o.generation.iterations),t=le(o=>o.ui.shouldUseSliders),n=Te(),{t:r}=De(),i=o=>n(eR(o));return t?g.jsx(Dn,{label:r("parameters.images"),step:1,min:1,max:16,onChange:i,handleReset:()=>n(eR(1)),value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderMarkRightOffset:-5,sliderNumberInputProps:{max:9999}}):g.jsx(lc,{label:r("parameters.images"),step:1,min:1,max:9999,onChange:i,value:e,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function bD(){const e=le(o=>o.generation.sampler),t=le(UV),n=Te(),{t:r}=De(),i=o=>n(cU(o.target.value));return g.jsx(Jo,{label:r("parameters.sampler"),value:e,onChange:i,validValues:t.format==="diffusers"?M5e:T5e,styleClass:"main-settings-block",minWidth:"9rem"})}function xD(){const e=Te(),t=le(o=>o.generation.steps),n=le(o=>o.ui.shouldUseSliders),{t:r}=De(),i=o=>e(xk(o));return n?g.jsx(Dn,{label:r("parameters.steps"),min:1,step:1,onChange:i,handleReset:()=>e(xk(20)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0,sliderMarkRightOffset:-6,sliderNumberInputProps:{max:9999}}):g.jsx(lc,{label:r("parameters.steps"),min:1,max:9999,step:1,onChange:i,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function SD(){const e=le(o=>o.generation.width),t=le(o=>o.ui.shouldUseSliders),n=le(Br),{t:r}=De(),i=Te();return t?g.jsx(Dn,{isSliderDisabled:n==="unifiedCanvas",isInputDisabled:n==="unifiedCanvas",isResetDisabled:n==="unifiedCanvas",label:r("parameters.width"),value:e,min:64,step:64,max:2048,onChange:o=>i(dS(o)),handleReset:()=>i(dS(512)),withInput:!0,withReset:!0,withSliderMarks:!0,sliderMarkRightOffset:-8,inputWidth:"6.2rem",inputReadOnly:!0,sliderNumberInputProps:{max:15360}}):g.jsx(Jo,{isDisabled:n==="unifiedCanvas",label:r("parameters.width"),value:e,flexGrow:1,onChange:o=>i(dS(Number(o.target.value))),validValues:L5e,styleClass:"main-settings-block",width:"5.5rem"})}function dP(){const{t:e}=De(),t=le(r=>r.ui.shouldUseSliders),n={main:{header:`${e("parameters.general")}`,feature:void 0,content:t?g.jsxs(_e,{flexDir:"column",rowGap:2,children:[g.jsx(yD,{}),g.jsx(xD,{}),g.jsx(mD,{}),g.jsx(SD,{}),g.jsx(vD,{}),g.jsx(bD,{})]}):g.jsxs(_e,{flexDirection:"column",rowGap:2,children:[g.jsxs(_e,{gap:2,children:[g.jsx(yD,{}),g.jsx(xD,{}),g.jsx(mD,{})]}),g.jsxs(_e,{children:[g.jsx(SD,{}),g.jsx(vD,{}),g.jsx(bD,{})]})]})}};return g.jsx(t0,{accordionInfo:n})}const mPe=lt($E,({shouldLoopback:e})=>e),vPe=()=>{const e=Te(),t=le(mPe),{t:n}=De();return g.jsx(Ye,{"aria-label":n("parameters.toggleLoopback"),tooltip:n("parameters.toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:g.jsx(Ake,{}),onClick:()=>{e(H3e(!t))}})},fP=()=>{const e=le(Br);return g.jsxs("div",{className:"process-buttons",children:[g.jsx(rP,{}),e==="img2img"&&g.jsx(vPe,{}),g.jsx(tP,{})]})},hP=()=>{const e=le(r=>r.generation.negativePrompt),t=Te(),{t:n}=De();return g.jsx(sn,{children:g.jsx(J8,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(Dy(r.target.value)),background:"var(--prompt-bg-color)",placeholder:n("parameters.negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},yPe=lt([e=>e.generation,Br],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),pP=()=>{const e=Te(),{prompt:t,activeTabName:n}=le(yPe),{isReady:r}=le(lq),i=S.useRef(null),{t:o}=De(),a=l=>{e(a4(l.target.value))};Je("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e(Vk(n)))};return g.jsx("div",{className:"prompt-bar",children:g.jsx(sn,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:g.jsx(J8,{id:"prompt",name:"prompt",placeholder:o("parameters.promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},hq=""+new URL("logo-13003d72.png",import.meta.url).href,bPe=lt(fp,e=>{const{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}=e;return{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),gP=e=>{const t=Te(),{shouldShowParametersPanel:n,shouldHoldParametersPanelOpen:r,shouldPinParametersPanel:i}=le(bPe),o=S.useRef(null),a=S.useRef(null),s=S.useRef(null),{children:l}=e;Je("o",()=>{t(Fh(!n)),i&&setTimeout(()=>t(Li(!0)),400)},[n,i]),Je("esc",()=>{t(Fh(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Je("shift+o",()=>{m(),t(Li(!0))},[i]);const u=S.useCallback(()=>{i||(t(R4e(a.current?a.current.scrollTop:0)),t(Fh(!1)),t(I4e(!1)))},[t,i]),d=()=>{s.current=window.setTimeout(()=>u(),500)},p=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(D4e(!i)),t(Li(!0))};return S.useEffect(()=>{function y(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[u]),g.jsx(mG,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:g.jsx("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:p,onMouseOver:i?void 0:p,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:g.jsx("div",{className:"parameters-panel-margin",children:g.jsxs("div",{className:"parameters-panel",ref:a,onMouseLeave:y=>{y.target!==a.current?p():!i&&d()},children:[g.jsx(si,{label:"Pin Options Panel",children:g.jsx("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:m,children:i?g.jsx(dG,{}):g.jsx(fG,{})})}),!i&&g.jsxs("div",{className:"invoke-ai-logo-wrapper",children:[g.jsx("img",{src:hq,alt:"invoke-ai-logo"}),g.jsxs("h1",{children:["invoke ",g.jsx("strong",{children:"ai"})]})]}),l]})})})})};function xPe(){const e=Te(),t=le(i=>i.generation.shouldFitToWidthHeight),n=i=>e(hU(i.target.checked)),{t:r}=De();return g.jsx(_a,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function pq(e){const{t}=De(),{label:n=`${t("parameters.strength")}`,styleClass:r}=e,i=le(l=>l.generation.img2imgStrength),o=Te(),a=l=>o(yk(l)),s=()=>{o(yk(.75))};return g.jsx(Dn,{label:n,step:.01,min:.01,max:1,onChange:a,value:i,isInteger:!1,styleClass:r,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:s})}function SPe(){const{t:e}=De(),t={imageToImage:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:g.jsxs(_e,{gap:2,flexDir:"column",children:[g.jsx(pq,{label:e("parameters.img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),g.jsx(xPe,{})]})}};return g.jsx(t0,{accordionInfo:t})}function wPe(){const{t:e}=De(),t={seed:{header:`${e("parameters.seed")}`,feature:oo.SEED,content:g.jsx(lP,{})},variations:{header:`${e("parameters.variations")}`,feature:oo.VARIATIONS,content:g.jsx(cP,{}),additionalHeaderComponents:g.jsx(uP,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:oo.FACE_CORRECTION,content:g.jsx(jE,{}),additionalHeaderComponents:g.jsx(cq,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:oo.UPSCALE,content:g.jsx(NE,{}),additionalHeaderComponents:g.jsx(fq,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:g.jsx(aP,{}),additionalHeaderComponents:g.jsx(sP,{})},other:{header:`${e("parameters.otherOptions")}`,feature:oo.OTHER,content:g.jsx(iPe,{})}};return g.jsxs(gP,{children:[g.jsxs(_e,{flexDir:"column",rowGap:"0.5rem",children:[g.jsx(pP,{}),g.jsx(hP,{})]}),g.jsx(fP,{}),g.jsx(dP,{}),g.jsx(SPe,{}),g.jsx(t0,{accordionInfo:t})]})}function CPe(){return g.jsx(oP,{optionsPanel:g.jsx(wPe,{}),children:g.jsx(tPe,{})})}const _Pe=()=>g.jsx("div",{className:"workarea-single-view",children:g.jsx("div",{className:"text-to-image-area",children:g.jsx(uq,{})})});function kPe(e){const{active:t=!0,width:n="1rem",height:r="1.3rem",side:i="right"}=e;return g.jsxs(g.Fragment,{children:[i==="right"&&g.jsx(ao,{width:n,height:r,margin:"-0.5rem 0.5rem 0 0.5rem",borderLeft:t?"3px solid var(--subhook-color)":"3px solid var(--tab-hover-color)",borderBottom:t?"3px solid var(--subhook-color)":"3px solid var(--tab-hover-color)"}),i==="left"&&g.jsx(ao,{width:n,height:r,margin:"-0.5rem 0.5rem 0 0.5rem",borderRight:t?"3px solid var(--subhook-color)":"3px solid var(--tab-hover-color)",borderBottom:t?"3px solid var(--subhook-color)":"3px solid var(--tab-hover-color)"})]})}const EPe=lt([$E],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),PPe=()=>{const{hiresFix:e,hiresStrength:t}=le(EPe),n=Te(),{t:r}=De(),i=a=>{n(uR(a))},o=()=>{n(uR(.75))};return g.jsxs(_e,{children:[g.jsx(kPe,{active:e}),g.jsx(Dn,{label:r("parameters.hiresStrength"),step:.01,min:.01,max:.99,onChange:i,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:o,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,sliderMarkRightOffset:-7})]})},TPe=()=>{const e=Te(),t=le(i=>i.postprocessing.hiresFix),{t:n}=De(),r=i=>e(mU(i.target.checked));return g.jsxs(_e,{rowGap:"0.8rem",direction:"column",children:[g.jsx(_a,{label:n("parameters.hiresOptim"),fontSize:"md",isChecked:t,onChange:r}),g.jsx(PPe,{})]})},MPe=()=>g.jsxs(_e,{gap:2,direction:"column",children:[g.jsx(dq,{}),g.jsx(TPe,{})]});function LPe(){const{t:e}=De(),t={seed:{header:`${e("parameters.seed")}`,feature:oo.SEED,content:g.jsx(lP,{})},variations:{header:`${e("parameters.variations")}`,feature:oo.VARIATIONS,content:g.jsx(cP,{}),additionalHeaderComponents:g.jsx(uP,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:oo.FACE_CORRECTION,content:g.jsx(jE,{}),additionalHeaderComponents:g.jsx(cq,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:oo.UPSCALE,content:g.jsx(NE,{}),additionalHeaderComponents:g.jsx(fq,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:g.jsx(aP,{}),additionalHeaderComponents:g.jsx(sP,{})},other:{header:`${e("parameters.otherOptions")}`,feature:oo.OTHER,content:g.jsx(MPe,{})}};return g.jsxs(gP,{children:[g.jsxs(_e,{flexDir:"column",rowGap:"0.5rem",children:[g.jsx(pP,{}),g.jsx(hP,{})]}),g.jsx(fP,{}),g.jsx(dP,{}),g.jsx(t0,{accordionInfo:t})]})}function APe(){return g.jsx(oP,{optionsPanel:g.jsx(LPe,{}),children:g.jsx(_Pe,{})})}var s7={},OPe={get exports(){return s7},set exports(e){s7=e}};/** * @license React * react-reconciler.production.min.js * @@ -513,17 +513,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var APe=function(t){var n={},r=S,i=Th,o=Object.assign;function a(f){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+f,x=1;xae||M[U]!==R[ae]){var he=` -`+M[U].replace(" at new "," at ");return f.displayName&&he.includes("")&&(he=he.replace("",f.displayName)),he}while(1<=U&&0<=ae);break}}}finally{il=!1,Error.prepareStackTrace=x}return(f=f?f.displayName||f.name:"")?hu(f):""}var kp=Object.prototype.hasOwnProperty,wc=[],ol=-1;function ra(f){return{current:f}}function Mn(f){0>ol||(f.current=wc[ol],wc[ol]=null,ol--)}function wn(f,h){ol++,wc[ol]=f.current,f.current=h}var ia={},Hr=ra(ia),ui=ra(!1),oa=ia;function al(f,h){var x=f.type.contextTypes;if(!x)return ia;var P=f.stateNode;if(P&&P.__reactInternalMemoizedUnmaskedChildContext===h)return P.__reactInternalMemoizedMaskedChildContext;var M={},R;for(R in x)M[R]=h[R];return P&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=h,f.__reactInternalMemoizedMaskedChildContext=M),M}function ci(f){return f=f.childContextTypes,f!=null}function Ss(){Mn(ui),Mn(Hr)}function yf(f,h,x){if(Hr.current!==ia)throw Error(a(168));wn(Hr,h),wn(ui,x)}function gu(f,h,x){var P=f.stateNode;if(h=h.childContextTypes,typeof P.getChildContext!="function")return x;P=P.getChildContext();for(var M in P)if(!(M in h))throw Error(a(108,N(f)||"Unknown",M));return o({},x,P)}function ws(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||ia,oa=Hr.current,wn(Hr,f),wn(ui,ui.current),!0}function bf(f,h,x){var P=f.stateNode;if(!P)throw Error(a(169));x?(f=gu(f,h,oa),P.__reactInternalMemoizedMergedChildContext=f,Mn(ui),Mn(Hr),wn(Hr,f)):Mn(ui),wn(ui,x)}var Ri=Math.clz32?Math.clz32:xf,Ep=Math.log,Pp=Math.LN2;function xf(f){return f>>>=0,f===0?32:31-(Ep(f)/Pp|0)|0}var sl=64,Mo=4194304;function ll(f){switch(f&-f){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: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 f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function mu(f,h){var x=f.pendingLanes;if(x===0)return 0;var P=0,M=f.suspendedLanes,R=f.pingedLanes,U=x&268435455;if(U!==0){var ae=U&~M;ae!==0?P=ll(ae):(R&=U,R!==0&&(P=ll(R)))}else U=x&~M,U!==0?P=ll(U):R!==0&&(P=ll(R));if(P===0)return 0;if(h!==0&&h!==P&&!(h&M)&&(M=P&-P,R=h&-h,M>=R||M===16&&(R&4194240)!==0))return h;if(P&4&&(P|=x&16),h=f.entangledLanes,h!==0)for(f=f.entanglements,h&=P;0x;x++)h.push(f);return h}function Na(f,h,x){f.pendingLanes|=h,h!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,h=31-Ri(h),f[h]=x}function wf(f,h){var x=f.pendingLanes&~h;f.pendingLanes=h,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=h,f.mutableReadLanes&=h,f.entangledLanes&=h,h=f.entanglements;var P=f.eventTimes;for(f=f.expirationTimes;0>=U,M-=U,uo=1<<32-Ri(h)+M|x<Vt?(ti=Lt,Lt=null):ti=Lt.sibling;var Zt=it(ge,Lt,ve[Vt],Je);if(Zt===null){Lt===null&&(Lt=ti);break}f&&Lt&&Zt.alternate===null&&h(ge,Lt),ue=R(Zt,ue,Vt),Rt===null?Oe=Zt:Rt.sibling=Zt,Rt=Zt,Lt=ti}if(Vt===ve.length)return x(ge,Lt),zn&&ul(ge,Vt),Oe;if(Lt===null){for(;VtVt?(ti=Lt,Lt=null):ti=Lt.sibling;var As=it(ge,Lt,Zt.value,Je);if(As===null){Lt===null&&(Lt=ti);break}f&&Lt&&As.alternate===null&&h(ge,Lt),ue=R(As,ue,Vt),Rt===null?Oe=As:Rt.sibling=As,Rt=As,Lt=ti}if(Zt.done)return x(ge,Lt),zn&&ul(ge,Vt),Oe;if(Lt===null){for(;!Zt.done;Vt++,Zt=ve.next())Zt=Ot(ge,Zt.value,Je),Zt!==null&&(ue=R(Zt,ue,Vt),Rt===null?Oe=Zt:Rt.sibling=Zt,Rt=Zt);return zn&&ul(ge,Vt),Oe}for(Lt=P(ge,Lt);!Zt.done;Vt++,Zt=ve.next())Zt=Wn(Lt,ge,Vt,Zt.value,Je),Zt!==null&&(f&&Zt.alternate!==null&&Lt.delete(Zt.key===null?Vt:Zt.key),ue=R(Zt,ue,Vt),Rt===null?Oe=Zt:Rt.sibling=Zt,Rt=Zt);return f&&Lt.forEach(function(ki){return h(ge,ki)}),zn&&ul(ge,Vt),Oe}function ma(ge,ue,ve,Je){if(typeof ve=="object"&&ve!==null&&ve.type===d&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case l:e:{for(var Oe=ve.key,Rt=ue;Rt!==null;){if(Rt.key===Oe){if(Oe=ve.type,Oe===d){if(Rt.tag===7){x(ge,Rt.sibling),ue=M(Rt,ve.props.children),ue.return=ge,ge=ue;break e}}else if(Rt.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===T&&U0(Oe)===Rt.type){x(ge,Rt.sibling),ue=M(Rt,ve.props),ue.ref=Ba(ge,Rt,ve),ue.return=ge,ge=ue;break e}x(ge,Rt);break}else h(ge,Rt);Rt=Rt.sibling}ve.type===d?(ue=Cl(ve.props.children,ge.mode,Je,ve.key),ue.return=ge,ge=ue):(Je=Xf(ve.type,ve.key,ve.props,null,ge.mode,Je),Je.ref=Ba(ge,ue,ve),Je.return=ge,ge=Je)}return U(ge);case u:e:{for(Rt=ve.key;ue!==null;){if(ue.key===Rt)if(ue.tag===4&&ue.stateNode.containerInfo===ve.containerInfo&&ue.stateNode.implementation===ve.implementation){x(ge,ue.sibling),ue=M(ue,ve.children||[]),ue.return=ge,ge=ue;break e}else{x(ge,ue);break}else h(ge,ue);ue=ue.sibling}ue=_l(ve,ge.mode,Je),ue.return=ge,ge=ue}return U(ge);case T:return Rt=ve._init,ma(ge,ue,Rt(ve._payload),Je)}if(H(ve))return Ln(ge,ue,ve,Je);if(D(ve))return gr(ge,ue,ve,Je);Qi(ge,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,ue!==null&&ue.tag===6?(x(ge,ue.sibling),ue=M(ue,ve),ue.return=ge,ge=ue):(x(ge,ue),ue=pg(ve,ge.mode,Je),ue.return=ge,ge=ue),U(ge)):x(ge,ue)}return ma}var Rc=j2(!0),N2=j2(!1),Rf={},Ro=ra(Rf),za=ra(Rf),ie=ra(Rf);function ye(f){if(f===Rf)throw Error(a(174));return f}function me(f,h){wn(ie,h),wn(za,f),wn(Ro,Rf),f=Q(h),Mn(Ro),wn(Ro,f)}function rt(){Mn(Ro),Mn(za),Mn(ie)}function Mt(f){var h=ye(ie.current),x=ye(Ro.current);h=q(x,f.type,h),x!==h&&(wn(za,f),wn(Ro,h))}function en(f){za.current===f&&(Mn(Ro),Mn(za))}var Nt=ra(0);function dn(f){for(var h=f;h!==null;){if(h.tag===13){var x=h.memoizedState;if(x!==null&&(x=x.dehydrated,x===null||xc(x)||vf(x)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if(h.flags&128)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===f)break;for(;h.sibling===null;){if(h.return===null||h.return===f)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var If=[];function G0(){for(var f=0;fx?x:4,f(!0);var P=Ic.transition;Ic.transition={};try{f(!1),h()}finally{Gt=x,Ic.transition=P}}function zc(){return ji().memoizedState}function ev(f,h,x){var P=qr(f);if(x={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null},Wc(f))Vc(h,x);else if(x=Oc(f,h,x,P),x!==null){var M=_i();jo(x,f,P,M),Bf(x,h,P)}}function Hc(f,h,x){var P=qr(f),M={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null};if(Wc(f))Vc(h,M);else{var R=f.alternate;if(f.lanes===0&&(R===null||R.lanes===0)&&(R=h.lastRenderedReducer,R!==null))try{var U=h.lastRenderedState,ae=R(U,x);if(M.hasEagerState=!0,M.eagerState=ae,G(ae,U)){var he=h.interleaved;he===null?(M.next=M,Af(h)):(M.next=he.next,he.next=M),h.interleaved=M;return}}catch{}finally{}x=Oc(f,h,M,P),x!==null&&(M=_i(),jo(x,f,P,M),Bf(x,h,P))}}function Wc(f){var h=f.alternate;return f===Cn||h!==null&&h===Cn}function Vc(f,h){Df=an=!0;var x=f.pending;x===null?h.next=h:(h.next=x.next,x.next=h),f.pending=h}function Bf(f,h,x){if(x&4194240){var P=h.lanes;P&=f.pendingLanes,x|=P,h.lanes=x,vu(f,x)}}var ks={readContext:co,useCallback:xi,useContext:xi,useEffect:xi,useImperativeHandle:xi,useInsertionEffect:xi,useLayoutEffect:xi,useMemo:xi,useReducer:xi,useRef:xi,useState:xi,useDebugValue:xi,useDeferredValue:xi,useTransition:xi,useMutableSource:xi,useSyncExternalStore:xi,useId:xi,unstable_isNewReconciler:!1},R4={readContext:co,useCallback:function(f,h){return fi().memoizedState=[f,h===void 0?null:h],f},useContext:co,useEffect:B2,useImperativeHandle:function(f,h,x){return x=x!=null?x.concat([f]):null,Su(4194308,4,Or.bind(null,h,f),x)},useLayoutEffect:function(f,h){return Su(4194308,4,f,h)},useInsertionEffect:function(f,h){return Su(4,2,f,h)},useMemo:function(f,h){var x=fi();return h=h===void 0?null:h,f=f(),x.memoizedState=[f,h],f},useReducer:function(f,h,x){var P=fi();return h=x!==void 0?x(h):h,P.memoizedState=P.baseState=h,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:h},P.queue=f,f=f.dispatch=ev.bind(null,Cn,f),[P.memoizedState,f]},useRef:function(f){var h=fi();return f={current:f},h.memoizedState=f},useState:F2,useDebugValue:Z0,useDeferredValue:function(f){return fi().memoizedState=f},useTransition:function(){var f=F2(!1),h=f[0];return f=J0.bind(null,f[1]),fi().memoizedState=f,[h,f]},useMutableSource:function(){},useSyncExternalStore:function(f,h,x){var P=Cn,M=fi();if(zn){if(x===void 0)throw Error(a(407));x=x()}else{if(x=h(),ei===null)throw Error(a(349));xu&30||X0(P,h,x)}M.memoizedState=x;var R={value:x,getSnapshot:h};return M.queue=R,B2(fl.bind(null,P,R,f),[f]),P.flags|=2048,$f(9,Fc.bind(null,P,R,x,h),void 0,null),x},useId:function(){var f=fi(),h=ei.identifierPrefix;if(zn){var x=$a,P=uo;x=(P&~(1<<32-Ri(P)-1)).toString(32)+x,h=":"+h+"R"+x,x=Dc++,0ae||M[V]!==R[ae]){var he=` +`+M[V].replace(" at new "," at ");return f.displayName&&he.includes("")&&(he=he.replace("",f.displayName)),he}while(1<=V&&0<=ae);break}}}finally{il=!1,Error.prepareStackTrace=x}return(f=f?f.displayName||f.name:"")?hu(f):""}var kp=Object.prototype.hasOwnProperty,wc=[],ol=-1;function ra(f){return{current:f}}function Mn(f){0>ol||(f.current=wc[ol],wc[ol]=null,ol--)}function wn(f,h){ol++,wc[ol]=f.current,f.current=h}var ia={},Hr=ra(ia),ui=ra(!1),oa=ia;function al(f,h){var x=f.type.contextTypes;if(!x)return ia;var P=f.stateNode;if(P&&P.__reactInternalMemoizedUnmaskedChildContext===h)return P.__reactInternalMemoizedMaskedChildContext;var M={},R;for(R in x)M[R]=h[R];return P&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=h,f.__reactInternalMemoizedMaskedChildContext=M),M}function ci(f){return f=f.childContextTypes,f!=null}function Ss(){Mn(ui),Mn(Hr)}function yf(f,h,x){if(Hr.current!==ia)throw Error(a(168));wn(Hr,h),wn(ui,x)}function gu(f,h,x){var P=f.stateNode;if(h=h.childContextTypes,typeof P.getChildContext!="function")return x;P=P.getChildContext();for(var M in P)if(!(M in h))throw Error(a(108,N(f)||"Unknown",M));return o({},x,P)}function ws(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||ia,oa=Hr.current,wn(Hr,f),wn(ui,ui.current),!0}function bf(f,h,x){var P=f.stateNode;if(!P)throw Error(a(169));x?(f=gu(f,h,oa),P.__reactInternalMemoizedMergedChildContext=f,Mn(ui),Mn(Hr),wn(Hr,f)):Mn(ui),wn(ui,x)}var Ri=Math.clz32?Math.clz32:xf,Ep=Math.log,Pp=Math.LN2;function xf(f){return f>>>=0,f===0?32:31-(Ep(f)/Pp|0)|0}var sl=64,Mo=4194304;function ll(f){switch(f&-f){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: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 f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function mu(f,h){var x=f.pendingLanes;if(x===0)return 0;var P=0,M=f.suspendedLanes,R=f.pingedLanes,V=x&268435455;if(V!==0){var ae=V&~M;ae!==0?P=ll(ae):(R&=V,R!==0&&(P=ll(R)))}else V=x&~M,V!==0?P=ll(V):R!==0&&(P=ll(R));if(P===0)return 0;if(h!==0&&h!==P&&!(h&M)&&(M=P&-P,R=h&-h,M>=R||M===16&&(R&4194240)!==0))return h;if(P&4&&(P|=x&16),h=f.entangledLanes,h!==0)for(f=f.entanglements,h&=P;0x;x++)h.push(f);return h}function $a(f,h,x){f.pendingLanes|=h,h!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,h=31-Ri(h),f[h]=x}function wf(f,h){var x=f.pendingLanes&~h;f.pendingLanes=h,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=h,f.mutableReadLanes&=h,f.entangledLanes&=h,h=f.entanglements;var P=f.eventTimes;for(f=f.expirationTimes;0>=V,M-=V,uo=1<<32-Ri(h)+M|x<Ut?(ti=At,At=null):ti=At.sibling;var Qt=it(ge,At,ve[Ut],et);if(Qt===null){At===null&&(At=ti);break}f&&At&&Qt.alternate===null&&h(ge,At),ue=R(Qt,ue,Ut),It===null?Oe=Qt:It.sibling=Qt,It=Qt,At=ti}if(Ut===ve.length)return x(ge,At),zn&&ul(ge,Ut),Oe;if(At===null){for(;UtUt?(ti=At,At=null):ti=At.sibling;var As=it(ge,At,Qt.value,et);if(As===null){At===null&&(At=ti);break}f&&At&&As.alternate===null&&h(ge,At),ue=R(As,ue,Ut),It===null?Oe=As:It.sibling=As,It=As,At=ti}if(Qt.done)return x(ge,At),zn&&ul(ge,Ut),Oe;if(At===null){for(;!Qt.done;Ut++,Qt=ve.next())Qt=Rt(ge,Qt.value,et),Qt!==null&&(ue=R(Qt,ue,Ut),It===null?Oe=Qt:It.sibling=Qt,It=Qt);return zn&&ul(ge,Ut),Oe}for(At=P(ge,At);!Qt.done;Ut++,Qt=ve.next())Qt=Wn(At,ge,Ut,Qt.value,et),Qt!==null&&(f&&Qt.alternate!==null&&At.delete(Qt.key===null?Ut:Qt.key),ue=R(Qt,ue,Ut),It===null?Oe=Qt:It.sibling=Qt,It=Qt);return f&&At.forEach(function(ki){return h(ge,ki)}),zn&&ul(ge,Ut),Oe}function ma(ge,ue,ve,et){if(typeof ve=="object"&&ve!==null&&ve.type===d&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case l:e:{for(var Oe=ve.key,It=ue;It!==null;){if(It.key===Oe){if(Oe=ve.type,Oe===d){if(It.tag===7){x(ge,It.sibling),ue=M(It,ve.props.children),ue.return=ge,ge=ue;break e}}else if(It.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===T&&V0(Oe)===It.type){x(ge,It.sibling),ue=M(It,ve.props),ue.ref=za(ge,It,ve),ue.return=ge,ge=ue;break e}x(ge,It);break}else h(ge,It);It=It.sibling}ve.type===d?(ue=Cl(ve.props.children,ge.mode,et,ve.key),ue.return=ge,ge=ue):(et=Xf(ve.type,ve.key,ve.props,null,ge.mode,et),et.ref=za(ge,ue,ve),et.return=ge,ge=et)}return V(ge);case u:e:{for(It=ve.key;ue!==null;){if(ue.key===It)if(ue.tag===4&&ue.stateNode.containerInfo===ve.containerInfo&&ue.stateNode.implementation===ve.implementation){x(ge,ue.sibling),ue=M(ue,ve.children||[]),ue.return=ge,ge=ue;break e}else{x(ge,ue);break}else h(ge,ue);ue=ue.sibling}ue=_l(ve,ge.mode,et),ue.return=ge,ge=ue}return V(ge);case T:return It=ve._init,ma(ge,ue,It(ve._payload),et)}if(H(ve))return Ln(ge,ue,ve,et);if(D(ve))return gr(ge,ue,ve,et);Qi(ge,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,ue!==null&&ue.tag===6?(x(ge,ue.sibling),ue=M(ue,ve),ue.return=ge,ge=ue):(x(ge,ue),ue=pg(ve,ge.mode,et),ue.return=ge,ge=ue),V(ge)):x(ge,ue)}return ma}var Rc=j2(!0),N2=j2(!1),Rf={},Ro=ra(Rf),Ha=ra(Rf),ie=ra(Rf);function be(f){if(f===Rf)throw Error(a(174));return f}function me(f,h){wn(ie,h),wn(Ha,f),wn(Ro,Rf),f=Q(h),Mn(Ro),wn(Ro,f)}function rt(){Mn(Ro),Mn(Ha),Mn(ie)}function Lt(f){var h=be(ie.current),x=be(Ro.current);h=q(x,f.type,h),x!==h&&(wn(Ha,f),wn(Ro,h))}function en(f){Ha.current===f&&(Mn(Ro),Mn(Ha))}var Nt=ra(0);function dn(f){for(var h=f;h!==null;){if(h.tag===13){var x=h.memoizedState;if(x!==null&&(x=x.dehydrated,x===null||xc(x)||vf(x)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if(h.flags&128)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===f)break;for(;h.sibling===null;){if(h.return===null||h.return===f)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var If=[];function G0(){for(var f=0;fx?x:4,f(!0);var P=Ic.transition;Ic.transition={};try{f(!1),h()}finally{Gt=x,Ic.transition=P}}function zc(){return ji().memoizedState}function ev(f,h,x){var P=qr(f);if(x={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null},Wc(f))Uc(h,x);else if(x=Oc(f,h,x,P),x!==null){var M=_i();jo(x,f,P,M),Bf(x,h,P)}}function Hc(f,h,x){var P=qr(f),M={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null};if(Wc(f))Uc(h,M);else{var R=f.alternate;if(f.lanes===0&&(R===null||R.lanes===0)&&(R=h.lastRenderedReducer,R!==null))try{var V=h.lastRenderedState,ae=R(V,x);if(M.hasEagerState=!0,M.eagerState=ae,G(ae,V)){var he=h.interleaved;he===null?(M.next=M,Af(h)):(M.next=he.next,he.next=M),h.interleaved=M;return}}catch{}finally{}x=Oc(f,h,M,P),x!==null&&(M=_i(),jo(x,f,P,M),Bf(x,h,P))}}function Wc(f){var h=f.alternate;return f===Cn||h!==null&&h===Cn}function Uc(f,h){Df=an=!0;var x=f.pending;x===null?h.next=h:(h.next=x.next,x.next=h),f.pending=h}function Bf(f,h,x){if(x&4194240){var P=h.lanes;P&=f.pendingLanes,x|=P,h.lanes=x,vu(f,x)}}var ks={readContext:co,useCallback:xi,useContext:xi,useEffect:xi,useImperativeHandle:xi,useInsertionEffect:xi,useLayoutEffect:xi,useMemo:xi,useReducer:xi,useRef:xi,useState:xi,useDebugValue:xi,useDeferredValue:xi,useTransition:xi,useMutableSource:xi,useSyncExternalStore:xi,useId:xi,unstable_isNewReconciler:!1},R4={readContext:co,useCallback:function(f,h){return fi().memoizedState=[f,h===void 0?null:h],f},useContext:co,useEffect:B2,useImperativeHandle:function(f,h,x){return x=x!=null?x.concat([f]):null,Su(4194308,4,Or.bind(null,h,f),x)},useLayoutEffect:function(f,h){return Su(4194308,4,f,h)},useInsertionEffect:function(f,h){return Su(4,2,f,h)},useMemo:function(f,h){var x=fi();return h=h===void 0?null:h,f=f(),x.memoizedState=[f,h],f},useReducer:function(f,h,x){var P=fi();return h=x!==void 0?x(h):h,P.memoizedState=P.baseState=h,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:h},P.queue=f,f=f.dispatch=ev.bind(null,Cn,f),[P.memoizedState,f]},useRef:function(f){var h=fi();return f={current:f},h.memoizedState=f},useState:F2,useDebugValue:Z0,useDeferredValue:function(f){return fi().memoizedState=f},useTransition:function(){var f=F2(!1),h=f[0];return f=J0.bind(null,f[1]),fi().memoizedState=f,[h,f]},useMutableSource:function(){},useSyncExternalStore:function(f,h,x){var P=Cn,M=fi();if(zn){if(x===void 0)throw Error(a(407));x=x()}else{if(x=h(),ei===null)throw Error(a(349));xu&30||X0(P,h,x)}M.memoizedState=x;var R={value:x,getSnapshot:h};return M.queue=R,B2(fl.bind(null,P,R,f),[f]),P.flags|=2048,$f(9,Fc.bind(null,P,R,x,h),void 0,null),x},useId:function(){var f=fi(),h=ei.identifierPrefix;if(zn){var x=Fa,P=uo;x=(P&~(1<<32-Ri(P)-1)).toString(32)+x,h=":"+h+"R"+x,x=Dc++,0ig&&(h.flags|=128,P=!0,qc(M,!1),h.lanes=4194304)}else{if(!P)if(f=dn(R),f!==null){if(h.flags|=128,P=!0,f=f.updateQueue,f!==null&&(h.updateQueue=f,h.flags|=4),qc(M,!0),M.tail===null&&M.tailMode==="hidden"&&!R.alternate&&!zn)return Si(h),null}else 2*Xn()-M.renderingStartTime>ig&&x!==1073741824&&(h.flags|=128,P=!0,qc(M,!1),h.lanes=4194304);M.isBackwards?(R.sibling=h.child,h.child=R):(f=M.last,f!==null?f.sibling=R:h.child=R,M.last=R)}return M.tail!==null?(h=M.tail,M.rendering=h,M.tail=h.sibling,M.renderingStartTime=Xn(),h.sibling=null,f=Nt.current,wn(Nt,P?f&1|2:f&1),h):(Si(h),null);case 22:case 23:return nd(),x=h.memoizedState!==null,f!==null&&f.memoizedState!==null!==x&&(h.flags|=8192),x&&h.mode&1?ho&1073741824&&(Si(h),Ce&&h.subtreeFlags&6&&(h.flags|=8192)):Si(h),null;case 24:return null;case 25:return null}throw Error(a(156,h.tag))}function lv(f,h){switch(z0(h),h.tag){case 1:return ci(h.type)&&Ss(),f=h.flags,f&65536?(h.flags=f&-65537|128,h):null;case 3:return rt(),Mn(ui),Mn(Hr),G0(),f=h.flags,f&65536&&!(f&128)?(h.flags=f&-65537|128,h):null;case 5:return en(h),null;case 13:if(Mn(Nt),f=h.memoizedState,f!==null&&f.dehydrated!==null){if(h.alternate===null)throw Error(a(340));Mc()}return f=h.flags,f&65536?(h.flags=f&-65537|128,h):null;case 19:return Mn(Nt),null;case 4:return rt(),null;case 10:return Mf(h.type._context),null;case 22:case 23:return nd(),null;case 24:return null;default:return null}}var pl=!1,Vr=!1,F4=typeof WeakSet=="function"?WeakSet:Set,st=null;function Kc(f,h){var x=f.ref;if(x!==null)if(typeof x=="function")try{x(null)}catch(P){Qn(f,h,P)}else x.current=null}function fa(f,h,x){try{x()}catch(P){Qn(f,h,P)}}var Up=!1;function Cu(f,h){for(X(f.containerInfo),st=h;st!==null;)if(f=st,h=f.child,(f.subtreeFlags&1028)!==0&&h!==null)h.return=f,st=h;else for(;st!==null;){f=st;try{var x=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var P=x.memoizedProps,M=x.memoizedState,R=f.stateNode,U=R.getSnapshotBeforeUpdate(f.elementType===f.type?P:sa(f.type,P),M);R.__reactInternalSnapshotBeforeUpdate=U}break;case 3:Ce&&Xi(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(ae){Qn(f,f.return,ae)}if(h=f.sibling,h!==null){h.return=f.return,st=h;break}st=f.return}return x=Up,Up=!1,x}function wi(f,h,x){var P=h.updateQueue;if(P=P!==null?P.lastEffect:null,P!==null){var M=P=P.next;do{if((M.tag&f)===f){var R=M.destroy;M.destroy=void 0,R!==void 0&&fa(h,x,R)}M=M.next}while(M!==P)}}function Gp(f,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var x=h=h.next;do{if((x.tag&f)===f){var P=x.create;x.destroy=P()}x=x.next}while(x!==h)}}function qp(f){var h=f.ref;if(h!==null){var x=f.stateNode;switch(f.tag){case 5:f=Y(x);break;default:f=x}typeof h=="function"?h(f):h.current=f}}function uv(f){var h=f.alternate;h!==null&&(f.alternate=null,uv(h)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(h=f.stateNode,h!==null&>(h)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Yc(f){return f.tag===5||f.tag===3||f.tag===4}function Ps(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Yc(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function Kp(f,h,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,h?zr(x,f,h):Ct(x,f);else if(P!==4&&(f=f.child,f!==null))for(Kp(f,h,x),f=f.sibling;f!==null;)Kp(f,h,x),f=f.sibling}function cv(f,h,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,h?pt(x,f,h):Me(x,f);else if(P!==4&&(f=f.child,f!==null))for(cv(f,h,x),f=f.sibling;f!==null;)cv(f,h,x),f=f.sibling}var Ir=null,ha=!1;function pa(f,h,x){for(x=x.child;x!==null;)Ur(f,h,x),x=x.sibling}function Ur(f,h,x){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(cn,x)}catch{}switch(x.tag){case 5:Vr||Kc(x,h);case 6:if(Ce){var P=Ir,M=ha;Ir=null,pa(f,h,x),Ir=P,ha=M,Ir!==null&&(ha?Bn(Ir,x.stateNode):rr(Ir,x.stateNode))}else pa(f,h,x);break;case 18:Ce&&Ir!==null&&(ha?j0(Ir,x.stateNode):D0(Ir,x.stateNode));break;case 4:Ce?(P=Ir,M=ha,Ir=x.stateNode.containerInfo,ha=!0,pa(f,h,x),Ir=P,ha=M):(et&&(P=x.stateNode.containerInfo,M=ja(P),bc(P,M)),pa(f,h,x));break;case 0:case 11:case 14:case 15:if(!Vr&&(P=x.updateQueue,P!==null&&(P=P.lastEffect,P!==null))){M=P=P.next;do{var R=M,U=R.destroy;R=R.tag,U!==void 0&&(R&2||R&4)&&fa(x,h,U),M=M.next}while(M!==P)}pa(f,h,x);break;case 1:if(!Vr&&(Kc(x,h),P=x.stateNode,typeof P.componentWillUnmount=="function"))try{P.props=x.memoizedProps,P.state=x.memoizedState,P.componentWillUnmount()}catch(ae){Qn(x,h,ae)}pa(f,h,x);break;case 21:pa(f,h,x);break;case 22:x.mode&1?(Vr=(P=Vr)||x.memoizedState!==null,pa(f,h,x),Vr=P):pa(f,h,x);break;default:pa(f,h,x)}}function Yp(f){var h=f.updateQueue;if(h!==null){f.updateQueue=null;var x=f.stateNode;x===null&&(x=f.stateNode=new F4),h.forEach(function(P){var M=ib.bind(null,f,P);x.has(P)||(x.add(P),P.then(M,M))})}}function Io(f,h){var x=h.deletions;if(x!==null)for(var P=0;P";case Jp:return":has("+(hv(f)||"")+")";case eg:return'[role="'+f.value+'"]';case tg:return'"'+f.value+'"';case Xc:return'[data-testname="'+f.value+'"]';default:throw Error(a(365))}}function Zc(f,h){var x=[];f=[f,0];for(var P=0;PM&&(M=U),P&=~R}if(P=M,P=Xn()-P,P=(120>P?120:480>P?480:1080>P?1080:1920>P?1920:3e3>P?3e3:4320>P?4320:1960*B4(P/1960))-P,10f?16:f,Tt===null)var P=!1;else{if(f=Tt,Tt=null,og=0,Wt&6)throw Error(a(331));var M=Wt;for(Wt|=4,st=f.current;st!==null;){var R=st,U=R.child;if(st.flags&16){var ae=R.deletions;if(ae!==null){for(var he=0;heXn()-mv?xl(f,0):gv|=x),pi(f,h)}function Sv(f,h){h===0&&(f.mode&1?(h=Mo,Mo<<=1,!(Mo&130023424)&&(Mo=4194304)):h=1);var x=_i();f=la(f,h),f!==null&&(Na(f,h,x),pi(f,x))}function H4(f){var h=f.memoizedState,x=0;h!==null&&(x=h.retryLane),Sv(f,x)}function ib(f,h){var x=0;switch(f.tag){case 13:var P=f.stateNode,M=f.memoizedState;M!==null&&(x=M.retryLane);break;case 19:P=f.stateNode;break;default:throw Error(a(314))}P!==null&&P.delete(h),Sv(f,x)}var wv;wv=function(f,h,x){if(f!==null)if(f.memoizedProps!==h.pendingProps||ui.current)Ji=!0;else{if(!(f.lanes&x)&&!(h.flags&128))return Ji=!1,N4(f,h,x);Ji=!!(f.flags&131072)}else Ji=!1,zn&&h.flags&1048576&&B0(h,Ar,h.index);switch(h.lanes=0,h.tag){case 2:var P=h.type;Ha(f,h),f=h.pendingProps;var M=al(h,Hr.current);Ac(h,x),M=K0(null,h,P,f,M,x);var R=jc();return h.flags|=1,typeof M=="object"&&M!==null&&typeof M.render=="function"&&M.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,ci(P)?(R=!0,ws(h)):R=!1,h.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,W0(h),M.updater=ua,h.stateNode=M,M._reactInternals=h,V0(h,P,f,x),h=ca(null,h,P,!0,R,x)):(h.tag=0,zn&&R&&Ii(h),Ni(null,h,M,x),h=h.child),h;case 16:P=h.elementType;e:{switch(Ha(f,h),f=h.pendingProps,M=P._init,P=M(P._payload),h.type=P,M=h.tag=fg(P),f=sa(P,f),M){case 0:h=rv(null,h,P,f,x);break e;case 1:h=Y2(null,h,P,f,x);break e;case 11:h=U2(null,h,P,f,x);break e;case 14:h=hl(null,h,P,sa(P.type,f),x);break e}throw Error(a(306,P,""))}return h;case 0:return P=h.type,M=h.pendingProps,M=h.elementType===P?M:sa(P,M),rv(f,h,P,M,x);case 1:return P=h.type,M=h.pendingProps,M=h.elementType===P?M:sa(P,M),Y2(f,h,P,M,x);case 3:e:{if(X2(h),f===null)throw Error(a(387));P=h.pendingProps,R=h.memoizedState,M=R.element,O2(f,h),jp(h,P,null,x);var U=h.memoizedState;if(P=U.element,yt&&R.isDehydrated)if(R={element:P,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},h.updateQueue.baseState=R,h.memoizedState=R,h.flags&256){M=Uc(Error(a(423)),h),h=Z2(f,h,P,x,M);break e}else if(P!==M){M=Uc(Error(a(424)),h),h=Z2(f,h,P,x,M);break e}else for(yt&&(Ao=T0(h.stateNode.containerInfo),Zn=h,zn=!0,Zi=null,Oo=!1),x=N2(h,null,P,x),h.child=x;x;)x.flags=x.flags&-3|4096,x=x.sibling;else{if(Mc(),P===M){h=Es(f,h,x);break e}Ni(f,h,P,x)}h=h.child}return h;case 5:return Mt(h),f===null&&kf(h),P=h.type,M=h.pendingProps,R=f!==null?f.memoizedProps:null,U=M.children,Ae(P,M)?U=null:R!==null&&Ae(P,R)&&(h.flags|=32),K2(f,h),Ni(f,h,U,x),h.child;case 6:return f===null&&kf(h),null;case 13:return Q2(f,h,x);case 4:return me(h,h.stateNode.containerInfo),P=h.pendingProps,f===null?h.child=Rc(h,null,P,x):Ni(f,h,P,x),h.child;case 11:return P=h.type,M=h.pendingProps,M=h.elementType===P?M:sa(P,M),U2(f,h,P,M,x);case 7:return Ni(f,h,h.pendingProps,x),h.child;case 8:return Ni(f,h,h.pendingProps.children,x),h.child;case 12:return Ni(f,h,h.pendingProps.children,x),h.child;case 10:e:{if(P=h.type._context,M=h.pendingProps,R=h.memoizedProps,U=M.value,A2(h,P,U),R!==null)if(G(R.value,U)){if(R.children===M.children&&!ui.current){h=Es(f,h,x);break e}}else for(R=h.child,R!==null&&(R.return=h);R!==null;){var ae=R.dependencies;if(ae!==null){U=R.child;for(var he=ae.firstContext;he!==null;){if(he.context===P){if(R.tag===1){he=_s(-1,x&-x),he.tag=2;var He=R.updateQueue;if(He!==null){He=He.shared;var ct=He.pending;ct===null?he.next=he:(he.next=ct.next,ct.next=he),He.pending=he}}R.lanes|=x,he=R.alternate,he!==null&&(he.lanes|=x),Lf(R.return,x,h),ae.lanes|=x;break}he=he.next}}else if(R.tag===10)U=R.type===h.type?null:R.child;else if(R.tag===18){if(U=R.return,U===null)throw Error(a(341));U.lanes|=x,ae=U.alternate,ae!==null&&(ae.lanes|=x),Lf(U,x,h),U=R.sibling}else U=R.child;if(U!==null)U.return=R;else for(U=R;U!==null;){if(U===h){U=null;break}if(R=U.sibling,R!==null){R.return=U.return,U=R;break}U=U.return}R=U}Ni(f,h,M.children,x),h=h.child}return h;case 9:return M=h.type,P=h.pendingProps.children,Ac(h,x),M=co(M),P=P(M),h.flags|=1,Ni(f,h,P,x),h.child;case 14:return P=h.type,M=sa(P,h.pendingProps),M=sa(P.type,M),hl(f,h,P,M,x);case 15:return G2(f,h,h.type,h.pendingProps,x);case 17:return P=h.type,M=h.pendingProps,M=h.elementType===P?M:sa(P,M),Ha(f,h),h.tag=1,ci(P)?(f=!0,ws(h)):f=!1,Ac(h,x),I2(h,P,M),V0(h,P,M,x),ca(null,h,P,!0,f,x);case 19:return eb(f,h,x);case 22:return q2(f,h,x)}throw Error(a(156,h.tag))};function Bi(f,h){return Ec(f,h)}function Wa(f,h,x,P){this.tag=f,this.key=x,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=P,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function No(f,h,x,P){return new Wa(f,h,x,P)}function Cv(f){return f=f.prototype,!(!f||!f.isReactComponent)}function fg(f){if(typeof f=="function")return Cv(f)?1:0;if(f!=null){if(f=f.$$typeof,f===w)return 11;if(f===k)return 14}return 2}function go(f,h){var x=f.alternate;return x===null?(x=No(f.tag,h,f.key,f.mode),x.elementType=f.elementType,x.type=f.type,x.stateNode=f.stateNode,x.alternate=f,f.alternate=x):(x.pendingProps=h,x.type=f.type,x.flags=0,x.subtreeFlags=0,x.deletions=null),x.flags=f.flags&14680064,x.childLanes=f.childLanes,x.lanes=f.lanes,x.child=f.child,x.memoizedProps=f.memoizedProps,x.memoizedState=f.memoizedState,x.updateQueue=f.updateQueue,h=f.dependencies,x.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},x.sibling=f.sibling,x.index=f.index,x.ref=f.ref,x}function Xf(f,h,x,P,M,R){var U=2;if(P=f,typeof f=="function")Cv(f)&&(U=1);else if(typeof f=="string")U=5;else e:switch(f){case d:return Cl(x.children,M,R,h);case p:U=8,M|=8;break;case m:return f=No(12,x,h,M|2),f.elementType=m,f.lanes=R,f;case E:return f=No(13,x,h,M),f.elementType=E,f.lanes=R,f;case _:return f=No(19,x,h,M),f.elementType=_,f.lanes=R,f;case L:return hg(x,M,R,h);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case y:U=10;break e;case b:U=9;break e;case w:U=11;break e;case k:U=14;break e;case T:U=16,P=null;break e}throw Error(a(130,f==null?f:typeof f,""))}return h=No(U,x,h,M),h.elementType=f,h.type=P,h.lanes=R,h}function Cl(f,h,x,P){return f=No(7,f,P,h),f.lanes=x,f}function hg(f,h,x,P){return f=No(22,f,P,h),f.elementType=L,f.lanes=x,f.stateNode={isHidden:!1},f}function pg(f,h,x){return f=No(6,f,null,h),f.lanes=x,f}function _l(f,h,x){return h=No(4,f.children!==null?f.children:[],f.key,h),h.lanes=x,h.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},h}function Zf(f,h,x,P,M){this.tag=h,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=nt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=kc(0),this.expirationTimes=kc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kc(0),this.identifierPrefix=P,this.onRecoverableError=M,yt&&(this.mutableSourceEagerHydrationData=null)}function ob(f,h,x,P,M,R,U,ae,he){return f=new Zf(f,h,x,ae,he),h===1?(h=1,R===!0&&(h|=8)):h=0,R=No(3,null,null,h),f.current=R,R.stateNode=f,R.memoizedState={element:P,isDehydrated:x,cache:null,transitions:null,pendingSuspenseBoundaries:null},W0(R),f}function _v(f){if(!f)return ia;f=f._reactInternals;e:{if(V(f)!==f||f.tag!==1)throw Error(a(170));var h=f;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(ci(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(a(171))}if(f.tag===1){var x=f.type;if(ci(x))return gu(f,x,h)}return h}function kv(f){var h=f._reactInternals;if(h===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=ne(h),f===null?null:f.stateNode}function Qf(f,h){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var x=f.retryLane;f.retryLane=x!==0&&x=He&&R>=Ot&&M<=ct&&U<=it){f.splice(h,1);break}else if(P!==He||x.width!==he.width||itU){if(!(R!==Ot||x.height!==he.height||ctM)){He>P&&(he.width+=He-P,he.x=P),ctR&&(he.height+=Ot-R,he.y=R),itx&&(x=U)),Uig&&(h.flags|=128,P=!0,qc(M,!1),h.lanes=4194304)}else{if(!P)if(f=dn(R),f!==null){if(h.flags|=128,P=!0,f=f.updateQueue,f!==null&&(h.updateQueue=f,h.flags|=4),qc(M,!0),M.tail===null&&M.tailMode==="hidden"&&!R.alternate&&!zn)return Si(h),null}else 2*Xn()-M.renderingStartTime>ig&&x!==1073741824&&(h.flags|=128,P=!0,qc(M,!1),h.lanes=4194304);M.isBackwards?(R.sibling=h.child,h.child=R):(f=M.last,f!==null?f.sibling=R:h.child=R,M.last=R)}return M.tail!==null?(h=M.tail,M.rendering=h,M.tail=h.sibling,M.renderingStartTime=Xn(),h.sibling=null,f=Nt.current,wn(Nt,P?f&1|2:f&1),h):(Si(h),null);case 22:case 23:return nd(),x=h.memoizedState!==null,f!==null&&f.memoizedState!==null!==x&&(h.flags|=8192),x&&h.mode&1?ho&1073741824&&(Si(h),Be&&h.subtreeFlags&6&&(h.flags|=8192)):Si(h),null;case 24:return null;case 25:return null}throw Error(a(156,h.tag))}function lv(f,h){switch(z0(h),h.tag){case 1:return ci(h.type)&&Ss(),f=h.flags,f&65536?(h.flags=f&-65537|128,h):null;case 3:return rt(),Mn(ui),Mn(Hr),G0(),f=h.flags,f&65536&&!(f&128)?(h.flags=f&-65537|128,h):null;case 5:return en(h),null;case 13:if(Mn(Nt),f=h.memoizedState,f!==null&&f.dehydrated!==null){if(h.alternate===null)throw Error(a(340));Mc()}return f=h.flags,f&65536?(h.flags=f&-65537|128,h):null;case 19:return Mn(Nt),null;case 4:return rt(),null;case 10:return Mf(h.type._context),null;case 22:case 23:return nd(),null;case 24:return null;default:return null}}var pl=!1,Ur=!1,F4=typeof WeakSet=="function"?WeakSet:Set,st=null;function Kc(f,h){var x=f.ref;if(x!==null)if(typeof x=="function")try{x(null)}catch(P){Qn(f,h,P)}else x.current=null}function fa(f,h,x){try{x()}catch(P){Qn(f,h,P)}}var Vp=!1;function Cu(f,h){for(X(f.containerInfo),st=h;st!==null;)if(f=st,h=f.child,(f.subtreeFlags&1028)!==0&&h!==null)h.return=f,st=h;else for(;st!==null;){f=st;try{var x=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var P=x.memoizedProps,M=x.memoizedState,R=f.stateNode,V=R.getSnapshotBeforeUpdate(f.elementType===f.type?P:sa(f.type,P),M);R.__reactInternalSnapshotBeforeUpdate=V}break;case 3:Be&&Xi(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(ae){Qn(f,f.return,ae)}if(h=f.sibling,h!==null){h.return=f.return,st=h;break}st=f.return}return x=Vp,Vp=!1,x}function wi(f,h,x){var P=h.updateQueue;if(P=P!==null?P.lastEffect:null,P!==null){var M=P=P.next;do{if((M.tag&f)===f){var R=M.destroy;M.destroy=void 0,R!==void 0&&fa(h,x,R)}M=M.next}while(M!==P)}}function Gp(f,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var x=h=h.next;do{if((x.tag&f)===f){var P=x.create;x.destroy=P()}x=x.next}while(x!==h)}}function qp(f){var h=f.ref;if(h!==null){var x=f.stateNode;switch(f.tag){case 5:f=Y(x);break;default:f=x}typeof h=="function"?h(f):h.current=f}}function uv(f){var h=f.alternate;h!==null&&(f.alternate=null,uv(h)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(h=f.stateNode,h!==null&&mt(h)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Yc(f){return f.tag===5||f.tag===3||f.tag===4}function Ps(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Yc(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function Kp(f,h,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,h?zr(x,f,h):Ct(x,f);else if(P!==4&&(f=f.child,f!==null))for(Kp(f,h,x),f=f.sibling;f!==null;)Kp(f,h,x),f=f.sibling}function cv(f,h,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,h?pt(x,f,h):Me(x,f);else if(P!==4&&(f=f.child,f!==null))for(cv(f,h,x),f=f.sibling;f!==null;)cv(f,h,x),f=f.sibling}var Ir=null,ha=!1;function pa(f,h,x){for(x=x.child;x!==null;)Vr(f,h,x),x=x.sibling}function Vr(f,h,x){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(cn,x)}catch{}switch(x.tag){case 5:Ur||Kc(x,h);case 6:if(Be){var P=Ir,M=ha;Ir=null,pa(f,h,x),Ir=P,ha=M,Ir!==null&&(ha?Bn(Ir,x.stateNode):rr(Ir,x.stateNode))}else pa(f,h,x);break;case 18:Be&&Ir!==null&&(ha?j0(Ir,x.stateNode):D0(Ir,x.stateNode));break;case 4:Be?(P=Ir,M=ha,Ir=x.stateNode.containerInfo,ha=!0,pa(f,h,x),Ir=P,ha=M):(Ae&&(P=x.stateNode.containerInfo,M=Na(P),bc(P,M)),pa(f,h,x));break;case 0:case 11:case 14:case 15:if(!Ur&&(P=x.updateQueue,P!==null&&(P=P.lastEffect,P!==null))){M=P=P.next;do{var R=M,V=R.destroy;R=R.tag,V!==void 0&&(R&2||R&4)&&fa(x,h,V),M=M.next}while(M!==P)}pa(f,h,x);break;case 1:if(!Ur&&(Kc(x,h),P=x.stateNode,typeof P.componentWillUnmount=="function"))try{P.props=x.memoizedProps,P.state=x.memoizedState,P.componentWillUnmount()}catch(ae){Qn(x,h,ae)}pa(f,h,x);break;case 21:pa(f,h,x);break;case 22:x.mode&1?(Ur=(P=Ur)||x.memoizedState!==null,pa(f,h,x),Ur=P):pa(f,h,x);break;default:pa(f,h,x)}}function Yp(f){var h=f.updateQueue;if(h!==null){f.updateQueue=null;var x=f.stateNode;x===null&&(x=f.stateNode=new F4),h.forEach(function(P){var M=ib.bind(null,f,P);x.has(P)||(x.add(P),P.then(M,M))})}}function Io(f,h){var x=h.deletions;if(x!==null)for(var P=0;P";case Jp:return":has("+(hv(f)||"")+")";case eg:return'[role="'+f.value+'"]';case tg:return'"'+f.value+'"';case Xc:return'[data-testname="'+f.value+'"]';default:throw Error(a(365))}}function Zc(f,h){var x=[];f=[f,0];for(var P=0;PM&&(M=V),P&=~R}if(P=M,P=Xn()-P,P=(120>P?120:480>P?480:1080>P?1080:1920>P?1920:3e3>P?3e3:4320>P?4320:1960*B4(P/1960))-P,10f?16:f,Tt===null)var P=!1;else{if(f=Tt,Tt=null,og=0,Wt&6)throw Error(a(331));var M=Wt;for(Wt|=4,st=f.current;st!==null;){var R=st,V=R.child;if(st.flags&16){var ae=R.deletions;if(ae!==null){for(var he=0;heXn()-mv?xl(f,0):gv|=x),pi(f,h)}function Sv(f,h){h===0&&(f.mode&1?(h=Mo,Mo<<=1,!(Mo&130023424)&&(Mo=4194304)):h=1);var x=_i();f=la(f,h),f!==null&&($a(f,h,x),pi(f,x))}function H4(f){var h=f.memoizedState,x=0;h!==null&&(x=h.retryLane),Sv(f,x)}function ib(f,h){var x=0;switch(f.tag){case 13:var P=f.stateNode,M=f.memoizedState;M!==null&&(x=M.retryLane);break;case 19:P=f.stateNode;break;default:throw Error(a(314))}P!==null&&P.delete(h),Sv(f,x)}var wv;wv=function(f,h,x){if(f!==null)if(f.memoizedProps!==h.pendingProps||ui.current)Ji=!0;else{if(!(f.lanes&x)&&!(h.flags&128))return Ji=!1,N4(f,h,x);Ji=!!(f.flags&131072)}else Ji=!1,zn&&h.flags&1048576&&B0(h,Ar,h.index);switch(h.lanes=0,h.tag){case 2:var P=h.type;Wa(f,h),f=h.pendingProps;var M=al(h,Hr.current);Ac(h,x),M=K0(null,h,P,f,M,x);var R=jc();return h.flags|=1,typeof M=="object"&&M!==null&&typeof M.render=="function"&&M.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,ci(P)?(R=!0,ws(h)):R=!1,h.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,W0(h),M.updater=ua,h.stateNode=M,M._reactInternals=h,U0(h,P,f,x),h=ca(null,h,P,!0,R,x)):(h.tag=0,zn&&R&&Ii(h),Ni(null,h,M,x),h=h.child),h;case 16:P=h.elementType;e:{switch(Wa(f,h),f=h.pendingProps,M=P._init,P=M(P._payload),h.type=P,M=h.tag=fg(P),f=sa(P,f),M){case 0:h=rv(null,h,P,f,x);break e;case 1:h=Y2(null,h,P,f,x);break e;case 11:h=V2(null,h,P,f,x);break e;case 14:h=hl(null,h,P,sa(P.type,f),x);break e}throw Error(a(306,P,""))}return h;case 0:return P=h.type,M=h.pendingProps,M=h.elementType===P?M:sa(P,M),rv(f,h,P,M,x);case 1:return P=h.type,M=h.pendingProps,M=h.elementType===P?M:sa(P,M),Y2(f,h,P,M,x);case 3:e:{if(X2(h),f===null)throw Error(a(387));P=h.pendingProps,R=h.memoizedState,M=R.element,O2(f,h),jp(h,P,null,x);var V=h.memoizedState;if(P=V.element,bt&&R.isDehydrated)if(R={element:P,isDehydrated:!1,cache:V.cache,pendingSuspenseBoundaries:V.pendingSuspenseBoundaries,transitions:V.transitions},h.updateQueue.baseState=R,h.memoizedState=R,h.flags&256){M=Vc(Error(a(423)),h),h=Z2(f,h,P,x,M);break e}else if(P!==M){M=Vc(Error(a(424)),h),h=Z2(f,h,P,x,M);break e}else for(bt&&(Ao=T0(h.stateNode.containerInfo),Zn=h,zn=!0,Zi=null,Oo=!1),x=N2(h,null,P,x),h.child=x;x;)x.flags=x.flags&-3|4096,x=x.sibling;else{if(Mc(),P===M){h=Es(f,h,x);break e}Ni(f,h,P,x)}h=h.child}return h;case 5:return Lt(h),f===null&&kf(h),P=h.type,M=h.pendingProps,R=f!==null?f.memoizedProps:null,V=M.children,Le(P,M)?V=null:R!==null&&Le(P,R)&&(h.flags|=32),K2(f,h),Ni(f,h,V,x),h.child;case 6:return f===null&&kf(h),null;case 13:return Q2(f,h,x);case 4:return me(h,h.stateNode.containerInfo),P=h.pendingProps,f===null?h.child=Rc(h,null,P,x):Ni(f,h,P,x),h.child;case 11:return P=h.type,M=h.pendingProps,M=h.elementType===P?M:sa(P,M),V2(f,h,P,M,x);case 7:return Ni(f,h,h.pendingProps,x),h.child;case 8:return Ni(f,h,h.pendingProps.children,x),h.child;case 12:return Ni(f,h,h.pendingProps.children,x),h.child;case 10:e:{if(P=h.type._context,M=h.pendingProps,R=h.memoizedProps,V=M.value,A2(h,P,V),R!==null)if(G(R.value,V)){if(R.children===M.children&&!ui.current){h=Es(f,h,x);break e}}else for(R=h.child,R!==null&&(R.return=h);R!==null;){var ae=R.dependencies;if(ae!==null){V=R.child;for(var he=ae.firstContext;he!==null;){if(he.context===P){if(R.tag===1){he=_s(-1,x&-x),he.tag=2;var We=R.updateQueue;if(We!==null){We=We.shared;var ct=We.pending;ct===null?he.next=he:(he.next=ct.next,ct.next=he),We.pending=he}}R.lanes|=x,he=R.alternate,he!==null&&(he.lanes|=x),Lf(R.return,x,h),ae.lanes|=x;break}he=he.next}}else if(R.tag===10)V=R.type===h.type?null:R.child;else if(R.tag===18){if(V=R.return,V===null)throw Error(a(341));V.lanes|=x,ae=V.alternate,ae!==null&&(ae.lanes|=x),Lf(V,x,h),V=R.sibling}else V=R.child;if(V!==null)V.return=R;else for(V=R;V!==null;){if(V===h){V=null;break}if(R=V.sibling,R!==null){R.return=V.return,V=R;break}V=V.return}R=V}Ni(f,h,M.children,x),h=h.child}return h;case 9:return M=h.type,P=h.pendingProps.children,Ac(h,x),M=co(M),P=P(M),h.flags|=1,Ni(f,h,P,x),h.child;case 14:return P=h.type,M=sa(P,h.pendingProps),M=sa(P.type,M),hl(f,h,P,M,x);case 15:return G2(f,h,h.type,h.pendingProps,x);case 17:return P=h.type,M=h.pendingProps,M=h.elementType===P?M:sa(P,M),Wa(f,h),h.tag=1,ci(P)?(f=!0,ws(h)):f=!1,Ac(h,x),I2(h,P,M),U0(h,P,M,x),ca(null,h,P,!0,f,x);case 19:return eb(f,h,x);case 22:return q2(f,h,x)}throw Error(a(156,h.tag))};function Bi(f,h){return Ec(f,h)}function Ua(f,h,x,P){this.tag=f,this.key=x,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=P,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function No(f,h,x,P){return new Ua(f,h,x,P)}function Cv(f){return f=f.prototype,!(!f||!f.isReactComponent)}function fg(f){if(typeof f=="function")return Cv(f)?1:0;if(f!=null){if(f=f.$$typeof,f===w)return 11;if(f===k)return 14}return 2}function go(f,h){var x=f.alternate;return x===null?(x=No(f.tag,h,f.key,f.mode),x.elementType=f.elementType,x.type=f.type,x.stateNode=f.stateNode,x.alternate=f,f.alternate=x):(x.pendingProps=h,x.type=f.type,x.flags=0,x.subtreeFlags=0,x.deletions=null),x.flags=f.flags&14680064,x.childLanes=f.childLanes,x.lanes=f.lanes,x.child=f.child,x.memoizedProps=f.memoizedProps,x.memoizedState=f.memoizedState,x.updateQueue=f.updateQueue,h=f.dependencies,x.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},x.sibling=f.sibling,x.index=f.index,x.ref=f.ref,x}function Xf(f,h,x,P,M,R){var V=2;if(P=f,typeof f=="function")Cv(f)&&(V=1);else if(typeof f=="string")V=5;else e:switch(f){case d:return Cl(x.children,M,R,h);case p:V=8,M|=8;break;case m:return f=No(12,x,h,M|2),f.elementType=m,f.lanes=R,f;case E:return f=No(13,x,h,M),f.elementType=E,f.lanes=R,f;case _:return f=No(19,x,h,M),f.elementType=_,f.lanes=R,f;case L:return hg(x,M,R,h);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case y:V=10;break e;case b:V=9;break e;case w:V=11;break e;case k:V=14;break e;case T:V=16,P=null;break e}throw Error(a(130,f==null?f:typeof f,""))}return h=No(V,x,h,M),h.elementType=f,h.type=P,h.lanes=R,h}function Cl(f,h,x,P){return f=No(7,f,P,h),f.lanes=x,f}function hg(f,h,x,P){return f=No(22,f,P,h),f.elementType=L,f.lanes=x,f.stateNode={isHidden:!1},f}function pg(f,h,x){return f=No(6,f,null,h),f.lanes=x,f}function _l(f,h,x){return h=No(4,f.children!==null?f.children:[],f.key,h),h.lanes=x,h.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},h}function Zf(f,h,x,P,M){this.tag=h,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=tt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=kc(0),this.expirationTimes=kc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kc(0),this.identifierPrefix=P,this.onRecoverableError=M,bt&&(this.mutableSourceEagerHydrationData=null)}function ob(f,h,x,P,M,R,V,ae,he){return f=new Zf(f,h,x,ae,he),h===1?(h=1,R===!0&&(h|=8)):h=0,R=No(3,null,null,h),f.current=R,R.stateNode=f,R.memoizedState={element:P,isDehydrated:x,cache:null,transitions:null,pendingSuspenseBoundaries:null},W0(R),f}function _v(f){if(!f)return ia;f=f._reactInternals;e:{if(U(f)!==f||f.tag!==1)throw Error(a(170));var h=f;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(ci(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(a(171))}if(f.tag===1){var x=f.type;if(ci(x))return gu(f,x,h)}return h}function kv(f){var h=f._reactInternals;if(h===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=ne(h),f===null?null:f.stateNode}function Qf(f,h){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var x=f.retryLane;f.retryLane=x!==0&&x=We&&R>=Rt&&M<=ct&&V<=it){f.splice(h,1);break}else if(P!==We||x.width!==he.width||itV){if(!(R!==Rt||x.height!==he.height||ctM)){We>P&&(he.width+=We-P,he.x=P),ctR&&(he.height+=Rt-R,he.y=R),itx&&(x=V)),V ")+` No matching component was found for: - `)+f.join(" > ")}return null},n.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return Y(f.child.stateNode);default:return f.child.stateNode}},n.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:gg,findFiberByHostInstance:f.findFiberByHostInstance||Ev,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)f=!0;else{try{cn=h.inject(f),qt=h}catch{}f=!!h.checkDCE}}return f},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(f,h,x,P){if(!se)throw Error(a(363));f=pv(f,h);var M=Dt(f,x,P).disconnect;return{disconnect:function(){M()}}},n.registerMutableSourceForHydration=function(f,h){var x=h._getVersion;x=x(h._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[h,x]:f.mutableSourceEagerHydrationData.push(h,x)},n.runWithPriority=function(f,h){var x=Gt;try{return Gt=f,h()}finally{Gt=x}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(f,h,x,P){var M=h.current,R=_i(),U=qr(M);return x=_v(x),h.context===null?h.context=x:h.pendingContext=x,h=_s(R,U),h.payload={element:f},P=P===void 0?null:P,P!==null&&(h.callback=P),f=dl(M,h,U),f!==null&&(jo(f,M,U,R),Dp(f,M,U)),U},n};(function(e){e.exports=APe})(LPe);const OPe=C7(s7);var F3={},RPe={get exports(){return F3},set exports(e){F3=e}},vp={};/** + `)+f.join(" > ")}return null},n.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return Y(f.child.stateNode);default:return f.child.stateNode}},n.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:gg,findFiberByHostInstance:f.findFiberByHostInstance||Ev,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)f=!0;else{try{cn=h.inject(f),qt=h}catch{}f=!!h.checkDCE}}return f},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(f,h,x,P){if(!se)throw Error(a(363));f=pv(f,h);var M=Mt(f,x,P).disconnect;return{disconnect:function(){M()}}},n.registerMutableSourceForHydration=function(f,h){var x=h._getVersion;x=x(h._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[h,x]:f.mutableSourceEagerHydrationData.push(h,x)},n.runWithPriority=function(f,h){var x=Gt;try{return Gt=f,h()}finally{Gt=x}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(f,h,x,P){var M=h.current,R=_i(),V=qr(M);return x=_v(x),h.context===null?h.context=x:h.pendingContext=x,h=_s(R,V),h.payload={element:f},P=P===void 0?null:P,P!==null&&(h.callback=P),f=dl(M,h,V),f!==null&&(jo(f,M,V,R),Dp(f,M,V)),V},n};(function(e){e.exports=RPe})(OPe);const IPe=C7(s7);var F3={},DPe={get exports(){return F3},set exports(e){F3=e}},vp={};/** * @license React * react-reconciler-constants.production.min.js * @@ -531,14 +531,14 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */vp.ConcurrentRoot=1;vp.ContinuousEventPriority=4;vp.DefaultEventPriority=16;vp.DiscreteEventPriority=1;vp.IdleEventPriority=536870912;vp.LegacyRoot=0;(function(e){e.exports=vp})(RPe);const SD={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let wD=!1,CD=!1;const gP=".react-konva-event",IPe=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. + */vp.ConcurrentRoot=1;vp.ContinuousEventPriority=4;vp.DefaultEventPriority=16;vp.DiscreteEventPriority=1;vp.IdleEventPriority=536870912;vp.LegacyRoot=0;(function(e){e.exports=vp})(DPe);const wD={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let CD=!1,_D=!1;const mP=".react-konva-event",jPe=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. Position of a node will be changed during drag&drop, so you should update state of the react app as well. Consider to add onDragMove or onDragEnd events. For more info see: https://github.com/konvajs/react-konva/issues/256 -`,DPe=`ReactKonva: You are using "zIndex" attribute for a Konva node. +`,NPe=`ReactKonva: You are using "zIndex" attribute for a Konva node. react-konva may get confused with ordering. Just define correct order of elements in your render function of a component. For more info see: https://github.com/konvajs/react-konva/issues/194 -`,jPe={};function _4(e,t,n=jPe){if(!wD&&"zIndex"in t&&(console.warn(DPe),wD=!0),!CD&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(IPe),CD=!0)}for(var o in n)if(!SD[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var d=t._useStrictMode,p={},m=!1;const y={};for(var o in t)if(!SD[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(y[l]=t[o])}!a&&(t[o]!==n[o]||d&&t[o]!==e.getAttr(o))&&(m=!0,p[o]=t[o])}m&&(e.setAttrs(p),hf(e));for(var l in y)e.on(l+gP,y[l])}function hf(e){if(!ft.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const pq={},NPe={};Qh.Node.prototype._applyProps=_4;function $Pe(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),hf(e)}function FPe(e,t,n){let r=Qh[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" 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`),r=Qh.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return _4(l,o),l}function BPe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function zPe(e,t,n){return!1}function HPe(e){return e}function WPe(){return null}function VPe(){return null}function UPe(e,t,n,r){return NPe}function GPe(){}function qPe(e){}function KPe(e,t){return!1}function YPe(){return pq}function XPe(){return pq}const ZPe=setTimeout,QPe=clearTimeout,JPe=-1;function eTe(e,t){return!1}const tTe=!1,nTe=!0,rTe=!0;function iTe(e,t){t.parent===e?t.moveToTop():e.add(t),hf(e)}function oTe(e,t){t.parent===e?t.moveToTop():e.add(t),hf(e)}function gq(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),hf(e)}function aTe(e,t,n){gq(e,t,n)}function sTe(e,t){t.destroy(),t.off(gP),hf(e)}function lTe(e,t){t.destroy(),t.off(gP),hf(e)}function uTe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function cTe(e,t,n){}function dTe(e,t,n,r,i){_4(e,i,r)}function fTe(e){e.hide(),hf(e)}function hTe(e){}function pTe(e,t){(t.visible==null||t.visible)&&e.show()}function gTe(e,t){}function mTe(e){}function vTe(){}const yTe=()=>F3.DefaultEventPriority,bTe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:iTe,appendChildToContainer:oTe,appendInitialChild:$Pe,cancelTimeout:QPe,clearContainer:mTe,commitMount:cTe,commitTextUpdate:uTe,commitUpdate:dTe,createInstance:FPe,createTextInstance:BPe,detachDeletedInstance:vTe,finalizeInitialChildren:zPe,getChildHostContext:XPe,getCurrentEventPriority:yTe,getPublicInstance:HPe,getRootHostContext:YPe,hideInstance:fTe,hideTextInstance:hTe,idlePriority:Th.unstable_IdlePriority,insertBefore:gq,insertInContainerBefore:aTe,isPrimaryRenderer:tTe,noTimeout:JPe,now:Th.unstable_now,prepareForCommit:WPe,preparePortalMount:VPe,prepareUpdate:UPe,removeChild:sTe,removeChildFromContainer:lTe,resetAfterCommit:GPe,resetTextContent:qPe,run:Th.unstable_runWithPriority,scheduleTimeout:ZPe,shouldDeprioritizeSubtree:KPe,shouldSetTextContent:eTe,supportsMutation:rTe,unhideInstance:pTe,unhideTextInstance:gTe,warnsIfNotActing:nTe},Symbol.toStringTag,{value:"Module"}));var xTe=Object.defineProperty,STe=Object.defineProperties,wTe=Object.getOwnPropertyDescriptors,_D=Object.getOwnPropertySymbols,CTe=Object.prototype.hasOwnProperty,_Te=Object.prototype.propertyIsEnumerable,kD=(e,t,n)=>t in e?xTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ED=(e,t)=>{for(var n in t||(t={}))CTe.call(t,n)&&kD(e,n,t[n]);if(_D)for(var n of _D(t))_Te.call(t,n)&&kD(e,n,t[n]);return e},kTe=(e,t)=>STe(e,wTe(t));function mq(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=mq(r,t,n);if(i)return i;r=t?null:r.sibling}}function vq(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const mP=vq(S.createContext(null));class yq extends S.Component{render(){return S.createElement(mP.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:ETe,ReactCurrentDispatcher:PTe}=S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function TTe(){const e=S.useContext(mP);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=S.useId();return S.useMemo(()=>{var r;return(r=ETe.current)!=null?r:mq(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}function MTe(){var e,t;const n=TTe(),[r]=S.useState(()=>new Map);r.clear();let i=n;for(;i;){const o=(e=i.type)==null?void 0:e._context;o&&o!==mP&&!r.has(o)&&r.set(o,(t=PTe.current)==null?void 0:t.readContext(vq(o))),i=i.return}return S.useMemo(()=>Array.from(r.keys()).reduce((o,a)=>s=>S.createElement(o,null,S.createElement(a.Provider,kTe(ED({},s),{value:r.get(a)}))),o=>S.createElement(yq,ED({},o))),[r])}function LTe(e){const t=qe.useRef();return qe.useLayoutEffect(()=>{t.current=e}),t.current}const ATe=e=>{const t=qe.useRef(),n=qe.useRef(),r=qe.useRef(),i=LTe(e),o=MTe(),a=s=>{const{forwardedRef:l}=e;l&&(typeof l=="function"?l(s):l.current=s)};return qe.useLayoutEffect(()=>(n.current=new Qh.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=S1.createContainer(n.current,F3.LegacyRoot,!1,null),S1.updateContainer(qe.createElement(o,{},e.children),r.current),()=>{Qh.isBrowser&&(a(null),S1.updateContainer(null,r.current,null),n.current.destroy())}),[]),qe.useLayoutEffect(()=>{a(n.current),_4(n.current,e,i),S1.updateContainer(qe.createElement(o,{},e.children),r.current,null)}),qe.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},t1="Layer",uc="Group",cc="Rect",ah="Circle",B3="Line",bq="Image",OTe="Transformer",S1=OPe(bTe);S1.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:qe.version,rendererPackageName:"react-konva"});const RTe=qe.forwardRef((e,t)=>qe.createElement(yq,{},qe.createElement(ATe,{...e,forwardedRef:t}))),ITe=lt([rn,Lr],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),DTe=()=>{const e=Le(),{tool:t,isStaging:n,isMovingBoundingBox:r}=le(ITe);return{handleDragStart:S.useCallback(()=>{(t==="move"||n)&&!r&&e(w3(!0))},[e,r,n,t]),handleDragMove:S.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(ZW(o))},[e,r,n,t]),handleDragEnd:S.useCallback(()=>{(t==="move"||n)&&!r&&e(w3(!1))},[e,r,n,t])}},jTe=lt([rn,Br,Lr],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),NTe=()=>{const e=Le(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=le(jTe),s=S.useRef(null),l=IU(),u=()=>e(mE());Ze(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const d=()=>e(p2(!o));Ze(["h"],()=>{d()},{enabled:()=>!i,preventDefault:!0},[o]),Ze(["n"],()=>{e(_3(!a))},{enabled:!0,preventDefault:!0},[a]),Ze("esc",()=>{e(s3e())},{enabled:()=>!0,preventDefault:!0}),Ze("shift+h",()=>{e(p3e(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),Ze(["space"],p=>{p.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(Jl("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(Jl(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},vP=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},xq=()=>{const e=Le(),t=Qs(),n=IU();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=$g.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(d3e({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(e3e())}}},$Te=lt([Br,rn,Lr],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),FTe=e=>{const t=Le(),{tool:n,isStaging:r}=le($Te),{commitColorUnderCursor:i}=xq();return S.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(w3(!0));return}if(n==="colorPicker"){i();return}const a=vP(e.current);a&&(o.evt.preventDefault(),t(HW(!0)),t(JSe([a.x,a.y])))},[e,n,r,t,i])},BTe=lt([Br,rn,Lr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),zTe=(e,t,n)=>{const r=Le(),{isDrawing:i,tool:o,isStaging:a}=le(BTe),{updateColorUnderCursor:s}=xq();return S.useCallback(()=>{if(!e.current)return;const l=vP(e.current);if(l){if(r(f3e(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(FW([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},HTe=()=>{const e=Le();return S.useCallback(()=>{e(r3e())},[e])},WTe=lt([Br,rn,Lr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),VTe=(e,t)=>{const n=Le(),{tool:r,isDrawing:i,isStaging:o}=le(WTe);return S.useCallback(()=>{if(r==="move"||o){n(w3(!1));return}if(!t.current&&i&&e.current){const a=vP(e.current);if(!a)return;n(FW([a.x,a.y]))}else t.current=!1;n(HW(!1))},[t,n,i,o,e,r])},UTe=lt([rn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),GTe=e=>{const t=Le(),{isMoveStageKeyHeld:n,stageScale:r}=le(UTe);return S.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=Te.clamp(r*HSe**s,WSe,VSe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(m3e(l)),t(ZW(u))},[e,n,r,t])},qTe=lt(rn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),KTe=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=le(qTe);return g.jsxs(uc,{children:[g.jsx(cc,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),g.jsx(cc,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},YTe=lt([rn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),XTe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},ZTe=()=>{const{colorMode:e}=Jy(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=le(YTe),[i,o]=S.useState([]),a=S.useCallback(s=>s/t,[t]);return S.useLayoutEffect(()=>{const s=XTe[e],{width:l,height:u}=r,{x:d,y:p}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(d),y:a(p)}},y={x:Math.ceil(a(d)/64)*64,y:Math.ceil(a(p)/64)*64},b={x1:-y.x,y1:-y.y,x2:a(l)-y.x+64,y2:a(u)-y.y+64},E={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},_=E.x2-E.x1,k=E.y2-E.y1,T=Math.round(_/64)+1,L=Math.round(k/64)+1,O=Te.range(0,T).map(I=>g.jsx(B3,{x:E.x1+I*64,y:E.y1,points:[0,0,0,k],stroke:s,strokeWidth:1},`x_${I}`)),D=Te.range(0,L).map(I=>g.jsx(B3,{x:E.x1,y:E.y1+I*64,points:[0,0,_,0],stroke:s,strokeWidth:1},`y_${I}`));o(O.concat(D))},[t,n,r,e,a]),g.jsx(uc,{children:i})},QTe=lt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),JTe=e=>{const{...t}=e,n=le(QTe),[r,i]=S.useState(null);if(S.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?g.jsx(bq,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},zh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},eMe=lt(rn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:zh(t)}}),PD=e=>`data:image/svg+xml;utf8, +`,$Pe={};function _4(e,t,n=$Pe){if(!CD&&"zIndex"in t&&(console.warn(NPe),CD=!0),!_D&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(jPe),_D=!0)}for(var o in n)if(!wD[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var d=t._useStrictMode,p={},m=!1;const y={};for(var o in t)if(!wD[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(y[l]=t[o])}!a&&(t[o]!==n[o]||d&&t[o]!==e.getAttr(o))&&(m=!0,p[o]=t[o])}m&&(e.setAttrs(p),hf(e));for(var l in y)e.on(l+mP,y[l])}function hf(e){if(!ft.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const gq={},FPe={};Qh.Node.prototype._applyProps=_4;function BPe(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),hf(e)}function zPe(e,t,n){let r=Qh[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" 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`),r=Qh.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return _4(l,o),l}function HPe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function WPe(e,t,n){return!1}function UPe(e){return e}function VPe(){return null}function GPe(){return null}function qPe(e,t,n,r){return FPe}function KPe(){}function YPe(e){}function XPe(e,t){return!1}function ZPe(){return gq}function QPe(){return gq}const JPe=setTimeout,eTe=clearTimeout,tTe=-1;function nTe(e,t){return!1}const rTe=!1,iTe=!0,oTe=!0;function aTe(e,t){t.parent===e?t.moveToTop():e.add(t),hf(e)}function sTe(e,t){t.parent===e?t.moveToTop():e.add(t),hf(e)}function mq(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),hf(e)}function lTe(e,t,n){mq(e,t,n)}function uTe(e,t){t.destroy(),t.off(mP),hf(e)}function cTe(e,t){t.destroy(),t.off(mP),hf(e)}function dTe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function fTe(e,t,n){}function hTe(e,t,n,r,i){_4(e,i,r)}function pTe(e){e.hide(),hf(e)}function gTe(e){}function mTe(e,t){(t.visible==null||t.visible)&&e.show()}function vTe(e,t){}function yTe(e){}function bTe(){}const xTe=()=>F3.DefaultEventPriority,STe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:aTe,appendChildToContainer:sTe,appendInitialChild:BPe,cancelTimeout:eTe,clearContainer:yTe,commitMount:fTe,commitTextUpdate:dTe,commitUpdate:hTe,createInstance:zPe,createTextInstance:HPe,detachDeletedInstance:bTe,finalizeInitialChildren:WPe,getChildHostContext:QPe,getCurrentEventPriority:xTe,getPublicInstance:UPe,getRootHostContext:ZPe,hideInstance:pTe,hideTextInstance:gTe,idlePriority:Th.unstable_IdlePriority,insertBefore:mq,insertInContainerBefore:lTe,isPrimaryRenderer:rTe,noTimeout:tTe,now:Th.unstable_now,prepareForCommit:VPe,preparePortalMount:GPe,prepareUpdate:qPe,removeChild:uTe,removeChildFromContainer:cTe,resetAfterCommit:KPe,resetTextContent:YPe,run:Th.unstable_runWithPriority,scheduleTimeout:JPe,shouldDeprioritizeSubtree:XPe,shouldSetTextContent:nTe,supportsMutation:oTe,unhideInstance:mTe,unhideTextInstance:vTe,warnsIfNotActing:iTe},Symbol.toStringTag,{value:"Module"}));var wTe=Object.defineProperty,CTe=Object.defineProperties,_Te=Object.getOwnPropertyDescriptors,kD=Object.getOwnPropertySymbols,kTe=Object.prototype.hasOwnProperty,ETe=Object.prototype.propertyIsEnumerable,ED=(e,t,n)=>t in e?wTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PD=(e,t)=>{for(var n in t||(t={}))kTe.call(t,n)&&ED(e,n,t[n]);if(kD)for(var n of kD(t))ETe.call(t,n)&&ED(e,n,t[n]);return e},PTe=(e,t)=>CTe(e,_Te(t));function vq(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=vq(r,t,n);if(i)return i;r=t?null:r.sibling}}function yq(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const vP=yq(S.createContext(null));class bq extends S.Component{render(){return S.createElement(vP.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:TTe,ReactCurrentDispatcher:MTe}=S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function LTe(){const e=S.useContext(vP);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=S.useId();return S.useMemo(()=>{var r;return(r=TTe.current)!=null?r:vq(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}function ATe(){var e,t;const n=LTe(),[r]=S.useState(()=>new Map);r.clear();let i=n;for(;i;){const o=(e=i.type)==null?void 0:e._context;o&&o!==vP&&!r.has(o)&&r.set(o,(t=MTe.current)==null?void 0:t.readContext(yq(o))),i=i.return}return S.useMemo(()=>Array.from(r.keys()).reduce((o,a)=>s=>S.createElement(o,null,S.createElement(a.Provider,PTe(PD({},s),{value:r.get(a)}))),o=>S.createElement(bq,PD({},o))),[r])}function OTe(e){const t=Ke.useRef();return Ke.useLayoutEffect(()=>{t.current=e}),t.current}const RTe=e=>{const t=Ke.useRef(),n=Ke.useRef(),r=Ke.useRef(),i=OTe(e),o=ATe(),a=s=>{const{forwardedRef:l}=e;l&&(typeof l=="function"?l(s):l.current=s)};return Ke.useLayoutEffect(()=>(n.current=new Qh.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=S1.createContainer(n.current,F3.LegacyRoot,!1,null),S1.updateContainer(Ke.createElement(o,{},e.children),r.current),()=>{Qh.isBrowser&&(a(null),S1.updateContainer(null,r.current,null),n.current.destroy())}),[]),Ke.useLayoutEffect(()=>{a(n.current),_4(n.current,e,i),S1.updateContainer(Ke.createElement(o,{},e.children),r.current,null)}),Ke.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},t1="Layer",uc="Group",cc="Rect",ah="Circle",B3="Line",xq="Image",ITe="Transformer",S1=IPe(STe);S1.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:Ke.version,rendererPackageName:"react-konva"});const DTe=Ke.forwardRef((e,t)=>Ke.createElement(bq,{},Ke.createElement(RTe,{...e,forwardedRef:t}))),jTe=lt([rn,Lr],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),NTe=()=>{const e=Te(),{tool:t,isStaging:n,isMovingBoundingBox:r}=le(jTe);return{handleDragStart:S.useCallback(()=>{(t==="move"||n)&&!r&&e(w3(!0))},[e,r,n,t]),handleDragMove:S.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(QW(o))},[e,r,n,t]),handleDragEnd:S.useCallback(()=>{(t==="move"||n)&&!r&&e(w3(!1))},[e,r,n,t])}},$Te=lt([rn,Br,Lr],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),FTe=()=>{const e=Te(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=le($Te),s=S.useRef(null),l=DV(),u=()=>e(mE());Je(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const d=()=>e(p2(!o));Je(["h"],()=>{d()},{enabled:()=>!i,preventDefault:!0},[o]),Je(["n"],()=>{e(_3(!a))},{enabled:!0,preventDefault:!0},[a]),Je("esc",()=>{e(l3e())},{enabled:()=>!0,preventDefault:!0}),Je("shift+h",()=>{e(g3e(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),Je(["space"],p=>{p.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(Jl("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(Jl(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},yP=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},Sq=()=>{const e=Te(),t=Qs(),n=DV();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=$g.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(f3e({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(t3e())}}},BTe=lt([Br,rn,Lr],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),zTe=e=>{const t=Te(),{tool:n,isStaging:r}=le(BTe),{commitColorUnderCursor:i}=Sq();return S.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(w3(!0));return}if(n==="colorPicker"){i();return}const a=yP(e.current);a&&(o.evt.preventDefault(),t(WW(!0)),t(e3e([a.x,a.y])))},[e,n,r,t,i])},HTe=lt([Br,rn,Lr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),WTe=(e,t,n)=>{const r=Te(),{isDrawing:i,tool:o,isStaging:a}=le(HTe),{updateColorUnderCursor:s}=Sq();return S.useCallback(()=>{if(!e.current)return;const l=yP(e.current);if(l){if(r(h3e(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(BW([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},UTe=()=>{const e=Te();return S.useCallback(()=>{e(i3e())},[e])},VTe=lt([Br,rn,Lr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),GTe=(e,t)=>{const n=Te(),{tool:r,isDrawing:i,isStaging:o}=le(VTe);return S.useCallback(()=>{if(r==="move"||o){n(w3(!1));return}if(!t.current&&i&&e.current){const a=yP(e.current);if(!a)return;n(BW([a.x,a.y]))}else t.current=!1;n(WW(!1))},[t,n,i,o,e,r])},qTe=lt([rn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),KTe=e=>{const t=Te(),{isMoveStageKeyHeld:n,stageScale:r}=le(qTe);return S.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=Pe.clamp(r*WSe**s,USe,VSe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(v3e(l)),t(QW(u))},[e,n,r,t])},YTe=lt(rn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),XTe=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=le(YTe);return g.jsxs(uc,{children:[g.jsx(cc,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),g.jsx(cc,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},ZTe=lt([rn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),QTe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},JTe=()=>{const{colorMode:e}=Jy(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=le(ZTe),[i,o]=S.useState([]),a=S.useCallback(s=>s/t,[t]);return S.useLayoutEffect(()=>{const s=QTe[e],{width:l,height:u}=r,{x:d,y:p}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(d),y:a(p)}},y={x:Math.ceil(a(d)/64)*64,y:Math.ceil(a(p)/64)*64},b={x1:-y.x,y1:-y.y,x2:a(l)-y.x+64,y2:a(u)-y.y+64},E={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},_=E.x2-E.x1,k=E.y2-E.y1,T=Math.round(_/64)+1,L=Math.round(k/64)+1,O=Pe.range(0,T).map(I=>g.jsx(B3,{x:E.x1+I*64,y:E.y1,points:[0,0,0,k],stroke:s,strokeWidth:1},`x_${I}`)),D=Pe.range(0,L).map(I=>g.jsx(B3,{x:E.x1,y:E.y1+I*64,points:[0,0,_,0],stroke:s,strokeWidth:1},`y_${I}`));o(O.concat(D))},[t,n,r,e,a]),g.jsx(uc,{children:i})},eMe=lt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),tMe=e=>{const{...t}=e,n=le(eMe),[r,i]=S.useState(null);if(S.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?g.jsx(xq,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},zh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},nMe=lt(rn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:zh(t)}}),TD=e=>`data:image/svg+xml;utf8, @@ -616,9 +616,9 @@ For more info see: https://github.com/konvajs/react-konva/issues/194 -`.replaceAll("black",e),tMe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=le(eMe),[a,s]=S.useState(null),[l,u]=S.useState(0),d=S.useRef(null),p=S.useCallback(()=>{u(l+1),setTimeout(p,500)},[l]);return S.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=PD(n)},[a,n]),S.useEffect(()=>{a&&(a.src=PD(n))},[a,n]),S.useEffect(()=>{const m=setInterval(()=>u(y=>(y+1)%5),50);return()=>clearInterval(m)},[]),!a||!Te.isNumber(r.x)||!Te.isNumber(r.y)||!Te.isNumber(o)||!Te.isNumber(i.width)||!Te.isNumber(i.height)?null:g.jsx(cc,{ref:d,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:Te.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},nMe=lt([rn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),rMe=e=>{const{...t}=e,{objects:n}=le(nMe);return g.jsx(uc,{listening:!1,...t,children:n.filter(gE).map((r,i)=>g.jsx(B3,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})};var sh=S,iMe=function(t,n,r){const i=sh.useRef("loading"),o=sh.useRef(),[a,s]=sh.useState(0),l=sh.useRef(),u=sh.useRef(),d=sh.useRef();return(l.current!==t||u.current!==n||d.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,d.current=r),sh.useLayoutEffect(function(){if(!t)return;var p=document.createElement("img");function m(){i.current="loaded",o.current=p,s(Math.random())}function y(){i.current="failed",o.current=void 0,s(Math.random())}return p.addEventListener("load",m),p.addEventListener("error",y),n&&(p.crossOrigin=n),r&&(p.referrerpolicy=r),p.src=t,function(){p.removeEventListener("load",m),p.removeEventListener("error",y)}},[t,n,r]),[o.current,i.current]};const Sq=e=>{const{url:t,x:n,y:r}=e,[i]=iMe(t);return g.jsx(bq,{x:n,y:r,image:i,listening:!1})},oMe=lt([rn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),aMe=()=>{const{objects:e}=le(oMe);return e?g.jsx(uc,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(S3(t))return g.jsx(Sq,{x:t.x,y:t.y,url:t.image.url},n);if(qSe(t)){const r=g.jsx(B3,{points:t.points,stroke:t.color?zh(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?g.jsx(uc,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(KSe(t))return g.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:zh(t.color)},n);if(YSe(t))return g.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},sMe=lt([rn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),lMe=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=le(sMe);return g.jsxs(uc,{...t,children:[r&&n&&g.jsx(Sq,{url:n.image.url,x:o,y:a}),i&&g.jsxs(uc,{children:[g.jsx(cc,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),g.jsx(cc,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},uMe=lt([rn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),cMe=()=>{const e=Le(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=le(uMe),{t:o}=De(),a=S.useCallback(()=>{e(ZO(!0))},[e]),s=S.useCallback(()=>{e(ZO(!1))},[e]);Ze(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),Ze(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),Ze(["enter"],()=>{d()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(o3e()),u=()=>e(i3e()),d=()=>e(t3e());return r?g.jsx(ke,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ke,{tooltip:`${o("unifiedCanvas.previous")} (Left)`,"aria-label":`${o("unifiedCanvas.previous")} (Left)`,icon:g.jsx(dke,{}),onClick:l,"data-selected":!0,isDisabled:t}),g.jsx(Ke,{tooltip:`${o("unifiedCanvas.next")} (Right)`,"aria-label":`${o("unifiedCanvas.next")} (Right)`,icon:g.jsx(fke,{}),onClick:u,"data-selected":!0,isDisabled:n}),g.jsx(Ke,{tooltip:`${o("unifiedCanvas.accept")} (Enter)`,"aria-label":`${o("unifiedCanvas.accept")} (Enter)`,icon:g.jsx(FE,{}),onClick:d,"data-selected":!0}),g.jsx(Ke,{tooltip:o("unifiedCanvas.showHide"),"aria-label":o("unifiedCanvas.showHide"),"data-alert":!i,icon:i?g.jsx(bke,{}):g.jsx(yke,{}),onClick:()=>e(g3e(!i)),"data-selected":!0}),g.jsx(Ke,{tooltip:o("unifiedCanvas.saveToGallery"),"aria-label":o("unifiedCanvas.saveToGallery"),icon:g.jsx(zE,{}),onClick:()=>e(h_e(r.image.url)),"data-selected":!0}),g.jsx(Ke,{tooltip:o("unifiedCanvas.discardAll"),"aria-label":o("unifiedCanvas.discardAll"),icon:g.jsx(b2,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(n3e()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},cm=e=>Math.round(e*100)/100,dMe=lt([rn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${cm(n)}, ${cm(r)})`}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}});function fMe(){const{cursorCoordinatesString:e}=le(dMe),{t}=De();return g.jsx("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const hMe=lt([rn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:d},stageScale:p,shouldShowCanvasDebugInfo:m,layer:y,boundingBoxScaleMethod:b,shouldPreserveMaskedArea:w}=e;let E="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(E="var(--status-working-color)"),{activeLayerColor:y==="mask"?"var(--status-working-color)":"inherit",activeLayerString:y.charAt(0).toUpperCase()+y.slice(1),boundingBoxColor:E,boundingBoxCoordinatesString:`(${cm(u)}, ${cm(d)})`,boundingBoxDimensionsString:`${o}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${cm(r)}×${cm(i)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(p*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none",shouldPreserveMaskedArea:w}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),pMe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:d,shouldShowBoundingBox:p,shouldPreserveMaskedArea:m}=le(hMe),{t:y}=De();return g.jsxs("div",{className:"canvas-status-text",children:[g.jsx("div",{style:{color:e},children:`${y("unifiedCanvas.activeLayer")}: ${t}`}),g.jsx("div",{children:`${y("unifiedCanvas.canvasScale")}: ${u}%`}),m&&g.jsx("div",{style:{color:"var(--status-working-color)"},children:"Preserve Masked Area: On"}),p&&g.jsx("div",{style:{color:n},children:`${y("unifiedcanvas:boundingBox")}: ${i}`}),a&&g.jsx("div",{style:{color:n},children:`${y("unifiedcanvas:scaledBoundingBox")}: ${o}`}),d&&g.jsxs(g.Fragment,{children:[g.jsx("div",{children:`${y("unifiedcanvas:boundingBoxPosition")}: ${r}`}),g.jsx("div",{children:`${y("unifiedcanvas:canvasDimensions")}: ${l}`}),g.jsx("div",{children:`${y("unifiedcanvas:canvasPosition")}: ${s}`}),g.jsx(fMe,{})]})]})},gMe=lt(rn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),mMe=e=>{const{...t}=e,n=Le(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:d,hitStrokeWidth:p}=le(gMe),m=S.useRef(null),y=S.useRef(null),[b,w]=S.useState(!1);S.useEffect(()=>{var ne;!m.current||!y.current||(m.current.nodes([y.current]),(ne=m.current.getLayer())==null||ne.batchDraw())},[]);const E=64*l,_=S.useCallback(ne=>{if(!u){n(DC({x:Math.floor(ne.target.x()),y:Math.floor(ne.target.y())}));return}const z=ne.target.x(),$=ne.target.y(),H=Hl(z,64),Y=Hl($,64);ne.target.x(H),ne.target.y(Y),n(DC({x:H,y:Y}))},[n,u]),k=S.useCallback(()=>{if(!y.current)return;const ne=y.current,z=ne.scaleX(),$=ne.scaleY(),H=Math.round(ne.width()*z),Y=Math.round(ne.height()*$),Q=Math.round(ne.x()),q=Math.round(ne.y());n(p1({width:H,height:Y})),n(DC({x:u?Cd(Q,64):Q,y:u?Cd(q,64):q})),ne.scaleX(1),ne.scaleY(1)},[n,u]),T=S.useCallback((ne,z,$)=>{const H=ne.x%E,Y=ne.y%E;return{x:Cd(z.x,E)+H,y:Cd(z.y,E)+Y}},[E]),L=()=>{n(NC(!0))},O=()=>{n(NC(!1)),n(jC(!1)),n(Jb(!1)),w(!1)},D=()=>{n(jC(!0))},I=()=>{n(NC(!1)),n(jC(!1)),n(Jb(!1)),w(!1)},N=()=>{w(!0)},V=()=>{!s&&!a&&w(!1)},B=()=>{n(Jb(!0))},K=()=>{n(Jb(!1))};return g.jsxs(uc,{...t,children:[g.jsx(cc,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:B,onMouseOver:B,onMouseLeave:K,onMouseOut:K}),g.jsx(cc,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:p,listening:!o&&d==="move",onDragStart:D,onDragEnd:I,onDragMove:_,onMouseDown:D,onMouseOut:V,onMouseOver:N,onMouseEnter:N,onMouseUp:I,onTransform:k,onTransformEnd:O,ref:y,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),g.jsx(OTe,{anchorCornerRadius:3,anchorDragBoundFunc:T,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:d==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&d==="move",onDragStart:D,onDragEnd:I,onMouseDown:L,onMouseUp:O,onTransformEnd:O,ref:m,rotateEnabled:!1})]})},vMe=lt(rn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:d,stageScale:p,stageDimensions:m,boundingBoxCoordinates:y,boundingBoxDimensions:b,shouldRestrictStrokesToBox:w}=e,E=w?{clipX:y.x,clipY:y.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:YO/p,colorPickerInnerRadius:(YO-mk+1)/p,maskColorString:zh({...i,a:.5}),brushColorString:zh(o),colorPickerColorString:zh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||d||!t)&&l,strokeWidth:1.5/p,dotRadius:1.5/p,clip:E}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),yMe=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:d,brushColorString:p,colorPickerColorString:m,colorPickerInnerRadius:y,colorPickerOuterRadius:b,clip:w}=le(vMe);return l?g.jsxs(uc,{listening:!1,...w,...t,children:[a==="colorPicker"?g.jsxs(g.Fragment,{children:[g.jsx(ah,{x:n,y:r,radius:b,stroke:p,strokeWidth:mk,strokeScaleEnabled:!1}),g.jsx(ah,{x:n,y:r,radius:y,stroke:m,strokeWidth:mk,strokeScaleEnabled:!1})]}):g.jsxs(g.Fragment,{children:[g.jsx(ah,{x:n,y:r,radius:i,fill:s==="mask"?o:p,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),g.jsx(ah,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:d*2,strokeEnabled:!0,listening:!1}),g.jsx(ah,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:d,strokeEnabled:!0,listening:!1})]}),g.jsx(ah,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),g.jsx(ah,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},bMe=lt([rn,Lr],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:d,isMovingStage:p,shouldShowIntermediates:m,shouldShowGrid:y,shouldRestrictStrokesToBox:b}=e;let w="none";return d==="move"||t?p?w="grabbing":w="grab":o?w=void 0:b&&!a&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:y,stageCoordinates:u,stageCursor:w,stageDimensions:l,stageScale:r,tool:d,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),wq=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:d}=le(bMe);NTe();const p=S.useRef(null),m=S.useRef(null),y=S.useCallback(V=>{U6e(V),p.current=V},[]),b=S.useCallback(V=>{V6e(V),m.current=V},[]),w=S.useRef({x:0,y:0}),E=S.useRef(!1),_=GTe(p),k=FTe(p),T=VTe(p,E),L=zTe(p,E,w),O=HTe(),{handleDragStart:D,handleDragMove:I,handleDragEnd:N}=DTe();return g.jsx("div",{className:"inpainting-canvas-container",children:g.jsxs("div",{className:"inpainting-canvas-wrapper",children:[g.jsxs(RTe,{tabIndex:-1,ref:y,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:k,onTouchMove:L,onTouchEnd:T,onMouseDown:k,onMouseLeave:O,onMouseMove:L,onMouseUp:T,onDragStart:D,onDragMove:I,onDragEnd:N,onContextMenu:V=>V.evt.preventDefault(),onWheel:_,draggable:(l==="move"||u)&&!t,children:[g.jsx(t1,{id:"grid",visible:r,children:g.jsx(ZTe,{})}),g.jsx(t1,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:g.jsx(aMe,{})}),g.jsxs(t1,{id:"mask",visible:e,listening:!1,children:[g.jsx(rMe,{visible:!0,listening:!1}),g.jsx(tMe,{listening:!1})]}),g.jsx(t1,{children:g.jsx(KTe,{})}),g.jsxs(t1,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&g.jsx(yMe,{visible:l!=="move",listening:!1}),g.jsx(lMe,{visible:u}),d&&g.jsx(JTe,{}),g.jsx(mMe,{visible:n&&!u})]})]}),g.jsx(pMe,{}),g.jsx(cMe,{})]})})},xMe=lt(rn,oG,Br,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),Cq=()=>{const e=Le(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=le(xMe),o=S.useRef(null);return S.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(c3e({width:a,height:s})),e(i?l3e():i4()),e(Li(!1))},0)},[e,r,t,n,i]),g.jsx("div",{ref:o,className:"inpainting-canvas-area",children:g.jsx(h0,{thickness:"2px",speed:"1s",size:"xl"})})},SMe=lt([rn,Br,hr],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}});function _q(){const e=Le(),{canRedo:t,activeTabName:n}=le(SMe),{t:r}=De(),i=()=>{e(a3e())};return Ze(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),g.jsx(Ke,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:g.jsx(Lke,{}),onClick:i,isDisabled:!t})}const wMe=lt([rn,Br,hr],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}});function kq(){const e=Le(),{t}=De(),{canUndo:n,activeTabName:r}=le(wMe),i=()=>{e(v3e())};return Ze(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),g.jsx(Ke,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:g.jsx(Ike,{}),onClick:i,isDisabled:!n})}const CMe=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");o&&(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},_Me=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},kMe=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),d=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:a,y:s,width:l,height:u},p=e.toDataURL(d);return e.scale(i),{dataURL:p,boundingBox:{x:o.x,y:o.y,width:l,height:u}}},EMe={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Td=(e=EMe)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(E4e("Exporting Image")),t(_d(!1));const u=n(),{stageScale:d,boundingBoxCoordinates:p,boundingBoxDimensions:m,stageCoordinates:y}=u.canvas,b=Qs();if(!b){t(wa(!1)),t(_d(!0));return}const{dataURL:w,boundingBox:E}=kMe(b,d,y,i?{...p,...m}:void 0);if(!w){t(wa(!1)),t(_d(!0));return}const _=new FormData;_.append("data",JSON.stringify({dataURL:w,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const T=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:_})).json(),{url:L,width:O,height:D}=T,I={uuid:um(),category:o?"result":"user",...T};a&&(_Me(L),t($u({title:Et.t("toast.downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(CMe(L,O,D),t($u({title:Et.t("toast.imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(sm({image:I,category:"result"})),t($u({title:Et.t("toast.imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(h3e({kind:"image",layer:"base",...E,image:I})),t($u({title:Et.t("toast.canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(wa(!1)),t(hh(Et.t("common.statusConnected"))),t(_d(!0))};function PMe(){const e=le(Lr),t=Qs(),n=le(s=>s.system.isProcessing),r=le(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Le(),{t:o}=De();Ze(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Td({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return g.jsx(Ke,{"aria-label":`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:g.jsx(Jm,{}),onClick:a,isDisabled:e})}function TMe(){const e=Le(),{t}=De(),n=Qs(),r=le(Lr),i=le(s=>s.system.isProcessing),o=le(s=>s.canvas.shouldCropToBoundingBoxOnSave);Ze(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(Td({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return g.jsx(Ke,{"aria-label":`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:g.jsx(BE,{}),onClick:a,isDisabled:r})}function MMe(){const e=le(Lr),{openUploader:t}=DE(),{t:n}=De();return g.jsx(Ke,{"aria-label":n("common.upload"),tooltip:n("common.upload"),icon:g.jsx(g4,{}),onClick:t,isDisabled:e})}const LMe=lt([rn,Lr],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}});function AMe(){const e=Le(),{t}=De(),{layer:n,isMaskEnabled:r,isStaging:i}=le(LMe),o=()=>{e(C3(n==="mask"?"base":"mask"))};Ze(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(C3(l)),l==="mask"&&!r&&e(p2(!0))};return g.jsx(Jo,{tooltip:`${t("unifiedCanvas.layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:DW,onChange:a,isDisabled:i})}function OMe(){const e=Le(),{t}=De(),n=Qs(),r=le(Lr),i=le(a=>a.system.isProcessing);Ze(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(Td({cropVisible:!1,shouldSetAsInitialImage:!0}))};return g.jsx(Ke,{"aria-label":`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:g.jsx(rG,{}),onClick:o,isDisabled:r})}function RMe(){const e=le(o=>o.canvas.tool),t=le(Lr),n=Le(),{t:r}=De();Ze(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(Jl("move"));return g.jsx(Ke,{"aria-label":`${r("unifiedCanvas.move")} (V)`,tooltip:`${r("unifiedCanvas.move")} (V)`,icon:g.jsx(ZU,{}),"data-selected":e==="move"||t,onClick:i})}function IMe(){const e=le(i=>i.ui.shouldPinParametersPanel),t=Le(),{t:n}=De(),r=()=>{t(Fh(!0)),e&&setTimeout(()=>t(Li(!0)),400)};return g.jsxs(ke,{flexDirection:"column",gap:"0.5rem",children:[g.jsx(Ke,{tooltip:`${n("parameters.showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("parameters.showOptionsPanel"),onClick:r,children:g.jsx(HE,{})}),g.jsx(ke,{children:g.jsx(rP,{iconButton:!0})}),g.jsx(ke,{children:g.jsx(tP,{width:"100%",height:"40px",btnGroupWidth:"100%"})})]})}function DMe(){const e=Le(),{t}=De(),n=le(Lr),r=()=>{e(vE()),e(i4())};return g.jsx(Ke,{"aria-label":t("unifiedCanvas.clearCanvas"),tooltip:t("unifiedCanvas.clearCanvas"),icon:g.jsx(hp,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function Eq(e,t,n=250){const[r,i]=S.useState(0);return S.useEffect(()=>{const o=setTimeout(()=>{r===1&&e(),i(0)},n);return r===2&&t(),()=>clearTimeout(o)},[r,e,t,n]),()=>i(o=>o+1)}function jMe(){const e=Qs(),t=Le(),{t:n}=De();Ze(["r"],()=>{i()},{enabled:()=>!0,preventDefault:!0},[e]);const r=Eq(()=>i(!1),()=>i(!0)),i=(o=!1)=>{const a=Qs();if(!a)return;const s=a.getClientRect({skipTransform:!0});t(zW({contentRect:s,shouldScaleTo1:o}))};return g.jsx(Ke,{"aria-label":`${n("unifiedCanvas.resetView")} (R)`,tooltip:`${n("unifiedCanvas.resetView")} (R)`,icon:g.jsx(JU,{}),onClick:r})}function NMe(){const e=le(Lr),t=Qs(),n=le(s=>s.system.isProcessing),r=le(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Le(),{t:o}=De();Ze(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Td({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return g.jsx(Ke,{"aria-label":`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:g.jsx(zE,{}),onClick:a,isDisabled:e})}const $Me=lt([rn,Lr,hr],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),FMe=()=>{const e=Le(),{t}=De(),{tool:n,isStaging:r}=le($Me);Ze(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),Ze(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),Ze(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),Ze(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),Ze(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(Jl("brush")),o=()=>e(Jl("eraser")),a=()=>e(Jl("colorPicker")),s=()=>e($W()),l=()=>e(NW());return g.jsxs(ke,{flexDirection:"column",gap:"0.5rem",children:[g.jsxs(Gi,{children:[g.jsx(Ke,{"aria-label":`${t("unifiedCanvas.brush")} (B)`,tooltip:`${t("unifiedCanvas.brush")} (B)`,icon:g.jsx(iG,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),g.jsx(Ke,{"aria-label":`${t("unifiedCanvas.eraser")} (E)`,tooltip:`${t("unifiedCanvas.eraser")} (B)`,icon:g.jsx(eG,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),g.jsxs(Gi,{children:[g.jsx(Ke,{"aria-label":`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:g.jsx(nG,{}),isDisabled:r,onClick:s}),g.jsx(Ke,{"aria-label":`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:g.jsx(b2,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),g.jsx(Ke,{"aria-label":`${t("unifiedCanvas.colorPicker")} (C)`,tooltip:`${t("unifiedCanvas.colorPicker")} (C)`,icon:g.jsx(tG,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},k4=Xe((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:d,onClose:p}=Kd(),m=S.useRef(null),y=()=>{r(),p()},b=()=>{o&&o(),p()};return g.jsxs(g.Fragment,{children:[S.cloneElement(l,{onClick:d,ref:t}),g.jsx(FH,{isOpen:u,leastDestructiveRef:m,onClose:p,children:g.jsx(oc,{children:g.jsxs(BH,{className:"modal",children:[g.jsx(op,{fontSize:"lg",fontWeight:"bold",children:s}),g.jsx(Xm,{children:a}),g.jsxs(Hw,{children:[g.jsx(ss,{ref:m,onClick:b,className:"modal-close-btn",children:i}),g.jsx(ss,{colorScheme:"red",onClick:y,ml:3,children:n})]})]})})})]})}),Pq=()=>{const e=le(Lr),t=Le(),{t:n}=De(),r=()=>{t(p_e()),t(vE()),t(BW())};return g.jsxs(k4,{title:n("unifiedCanvas.emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedCanvas.emptyFolder"),triggerComponent:g.jsx(On,{leftIcon:g.jsx(hp,{}),size:"sm",isDisabled:e,children:n("unifiedCanvas.emptyTempImageFolder")}),children:[g.jsx("p",{children:n("unifiedCanvas.emptyTempImagesFolderMessage")}),g.jsx("br",{}),g.jsx("p",{children:n("unifiedCanvas.emptyTempImagesFolderConfirm")})]})},Tq=()=>{const e=le(Lr),t=Le(),{t:n}=De();return g.jsxs(k4,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(BW()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:g.jsx(On,{size:"sm",leftIcon:g.jsx(hp,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[g.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),g.jsx("br",{}),g.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},BMe=lt([rn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),zMe=()=>{const e=Le(),{t}=De(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=le(BMe);return g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ke,{tooltip:t("unifiedCanvas.canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedCanvas.canvasSettings"),icon:g.jsx(WE,{})}),children:g.jsxs(ke,{direction:"column",gap:"0.5rem",children:[g.jsx(Gn,{label:t("unifiedCanvas.showIntermediates"),isChecked:o,onChange:a=>e(XW(a.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:a=>e(VW(a.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:a=>e(UW(a.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:i,onChange:a=>e(KW(a.target.checked))}),g.jsx(Tq,{}),g.jsx(Pq,{})]})})},HMe=()=>{const e=le(t=>t.ui.shouldShowParametersPanel);return g.jsxs(ke,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[g.jsx(AMe,{}),g.jsx(FMe,{}),g.jsxs(ke,{gap:"0.5rem",children:[g.jsx(RMe,{}),g.jsx(jMe,{})]}),g.jsxs(ke,{columnGap:"0.5rem",children:[g.jsx(OMe,{}),g.jsx(NMe,{})]}),g.jsxs(ke,{columnGap:"0.5rem",children:[g.jsx(PMe,{}),g.jsx(TMe,{})]}),g.jsxs(ke,{gap:"0.5rem",children:[g.jsx(kq,{}),g.jsx(_q,{})]}),g.jsxs(ke,{gap:"0.5rem",children:[g.jsx(MMe,{}),g.jsx(DMe,{})]}),g.jsx(zMe,{}),!e&&g.jsx(IMe,{})]})};function WMe(){const e=Le(),t=le(i=>i.canvas.brushSize),{t:n}=De(),r=le(Lr);return Ze(["BracketLeft"],()=>{e(Lm(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),Ze(["BracketRight"],()=>{e(Lm(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),g.jsx(Dn,{label:n("unifiedCanvas.brushSize"),value:t,withInput:!0,onChange:i=>e(Lm(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function E4(){return(E4=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function l7(e){var t=S.useRef(e),n=S.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var n0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:E.buttons>0)&&i.current?o(TD(i.current,E,s.current)):w(!1)},b=function(){return w(!1)};function w(E){var _=l.current,k=u7(i.current),T=E?k.addEventListener:k.removeEventListener;T(_?"touchmove":"mousemove",y),T(_?"touchend":"mouseup",b)}return[function(E){var _=E.nativeEvent,k=i.current;if(k&&(MD(_),!function(L,O){return O&&!X1(L)}(_,l.current)&&k)){if(X1(_)){l.current=!0;var T=_.changedTouches||[];T.length&&(s.current=T[0].identifier)}k.focus(),o(TD(k,_,s.current)),w(!0)}},function(E){var _=E.which||E.keyCode;_<37||_>40||(E.preventDefault(),a({left:_===39?.05:_===37?-.05:0,top:_===40?.05:_===38?-.05:0}))},w]},[a,o]),d=u[0],p=u[1],m=u[2];return S.useEffect(function(){return m},[m]),qe.createElement("div",E4({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:p,tabIndex:0,role:"slider"}))}),P4=function(e){return e.filter(Boolean).join(" ")},bP=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=P4(["react-colorful__pointer",e.className]);return qe.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},qe.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Co=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},Lq=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Co(e.h),s:Co(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Co(i/2),a:Co(r,2)}},c7=function(e){var t=Lq(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},l6=function(e){var t=Lq(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},VMe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:Co(255*[r,s,a,a,l,r][u]),g:Co(255*[l,r,r,s,a,a][u]),b:Co(255*[a,a,l,r,r,s][u]),a:Co(i,2)}},UMe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Co(60*(s<0?s+6:s)),s:Co(o?a/o*100:0),v:Co(o/255*100),a:i}},GMe=qe.memo(function(e){var t=e.hue,n=e.onChange,r=P4(["react-colorful__hue",e.className]);return qe.createElement("div",{className:r},qe.createElement(yP,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:n0(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Co(t),"aria-valuemax":"360","aria-valuemin":"0"},qe.createElement(bP,{className:"react-colorful__hue-pointer",left:t/360,color:c7({h:t,s:100,v:100,a:1})})))}),qMe=qe.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:c7({h:t.h,s:100,v:100,a:1})};return qe.createElement("div",{className:"react-colorful__saturation",style:r},qe.createElement(yP,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:n0(t.s+100*i.left,0,100),v:n0(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Co(t.s)+"%, Brightness "+Co(t.v)+"%"},qe.createElement(bP,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:c7(t)})))}),Aq=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function KMe(e,t,n){var r=l7(n),i=S.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=S.useRef({color:t,hsva:o});S.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),S.useEffect(function(){var u;Aq(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=S.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var YMe=typeof window<"u"?S.useLayoutEffect:S.useEffect,XMe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},LD=new Map,ZMe=function(e){YMe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!LD.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,LD.set(t,n);var r=XMe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},QMe=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+l6(Object.assign({},n,{a:0}))+", "+l6(Object.assign({},n,{a:1}))+")"},o=P4(["react-colorful__alpha",t]),a=Co(100*n.a);return qe.createElement("div",{className:o},qe.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),qe.createElement(yP,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:n0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},qe.createElement(bP,{className:"react-colorful__alpha-pointer",left:n.a,color:l6(n)})))},JMe=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=Mq(e,["className","colorModel","color","onChange"]),s=S.useRef(null);ZMe(s);var l=KMe(n,i,o),u=l[0],d=l[1],p=P4(["react-colorful",t]);return qe.createElement("div",E4({},a,{ref:s,className:p}),qe.createElement(qMe,{hsva:u,onChange:d}),qe.createElement(GMe,{hue:u.h,onChange:d}),qe.createElement(QMe,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},eLe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:UMe,fromHsva:VMe,equal:Aq},tLe=function(e){return qe.createElement(JMe,E4({},e,{colorModel:eLe}))};const z3=e=>{const{styleClass:t,...n}=e;return g.jsx(tLe,{className:`invokeai__color-picker ${t}`,...n})},nLe=lt([rn,Lr],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}});function rLe(){const e=Le(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=le(nLe),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return Ze(["shift+BracketLeft"],()=>{e(Mm({...t,a:Te.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),Ze(["shift+BracketRight"],()=>{e(Mm({...t,a:Te.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(ao,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:g.jsxs(ke,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&g.jsx(z3,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e(Mm(a))}),r==="mask"&&g.jsx(z3,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(WW(a))})]})})}function Oq(){return g.jsxs(ke,{columnGap:"1rem",alignItems:"center",children:[g.jsx(WMe,{}),g.jsx(rLe,{})]})}function iLe(){const e=Le(),t=le(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=De();return g.jsx(Gn,{label:n("unifiedCanvas.betaLimitToBox"),isChecked:t,onChange:r=>e(QW(r.target.checked))})}function oLe(){return g.jsxs(ke,{gap:"1rem",alignItems:"center",children:[g.jsx(Oq,{}),g.jsx(iLe,{})]})}function aLe(){const e=Le(),{t}=De(),n=()=>e(mE());return g.jsx(On,{size:"sm",leftIcon:g.jsx(hp,{}),onClick:n,tooltip:`${t("unifiedCanvas.clearMask")} (Shift+C)`,children:t("unifiedCanvas.betaClear")})}function sLe(){const e=le(i=>i.canvas.isMaskEnabled),t=Le(),{t:n}=De(),r=()=>t(p2(!e));return g.jsx(Gn,{label:`${n("unifiedCanvas.enableMask")} (H)`,isChecked:e,onChange:r})}function lLe(){const e=Le(),{t}=De(),n=le(r=>r.canvas.shouldPreserveMaskedArea);return g.jsx(Gn,{label:t("unifiedCanvas.betaPreserveMasked"),isChecked:n,onChange:r=>e(qW(r.target.checked))})}function uLe(){return g.jsxs(ke,{gap:"1rem",alignItems:"center",children:[g.jsx(Oq,{}),g.jsx(sLe,{}),g.jsx(lLe,{}),g.jsx(aLe,{})]})}function cLe(){const e=le(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Le(),{t:n}=De();return g.jsx(Gn,{label:n("unifiedCanvas.betaDarkenOutside"),isChecked:e,onChange:r=>t(GW(r.target.checked))})}function dLe(){const e=le(r=>r.canvas.shouldShowGrid),t=Le(),{t:n}=De();return g.jsx(Gn,{label:n("unifiedCanvas.showGrid"),isChecked:e,onChange:r=>t(YW(r.target.checked))})}function fLe(){const e=le(i=>i.canvas.shouldSnapToGrid),t=Le(),{t:n}=De(),r=i=>t(_3(i.target.checked));return g.jsx(Gn,{label:`${n("unifiedCanvas.snapToGrid")} (N)`,isChecked:e,onChange:r})}function hLe(){return g.jsxs(ke,{alignItems:"center",gap:"1rem",children:[g.jsx(dLe,{}),g.jsx(fLe,{}),g.jsx(cLe,{})]})}const pLe=lt([rn],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}});function gLe(){const{tool:e,layer:t}=le(pLe);return g.jsxs(ke,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&g.jsx(oLe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&g.jsx(uLe,{}),e=="move"&&g.jsx(hLe,{})]})}const mLe=lt([rn],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),vLe=()=>{const e=Le(),{doesCanvasNeedScaling:t}=le(mLe);return S.useLayoutEffect(()=>{e(Li(!0));const n=Te.debounce(()=>{e(Li(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),g.jsx("div",{className:"workarea-single-view",children:g.jsxs(ke,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[g.jsx(HMe,{}),g.jsxs(ke,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[g.jsx(gLe,{}),t?g.jsx(Cq,{}):g.jsx(wq,{})]})]})})},yLe=lt([rn,Lr],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:zh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),bLe=()=>{const e=Le(),{t}=De(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=le(yLe);Ze(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),Ze(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),Ze(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(C3(n==="mask"?"base":"mask"))},l=()=>e(mE()),u=()=>e(p2(!i));return g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Gi,{children:g.jsx(Ke,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:g.jsx(_ke,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:g.jsxs(ke,{direction:"column",gap:"0.5rem",children:[g.jsx(Gn,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:i,onChange:u}),g.jsx(Gn,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:o,onChange:d=>e(qW(d.target.checked))}),g.jsx(z3,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:d=>e(WW(d))}),g.jsxs(On,{size:"sm",leftIcon:g.jsx(hp,{}),onClick:l,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},xLe=lt([rn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),SLe=()=>{const e=Le(),{t}=De(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=le(xLe);Ze(["n"],()=>{e(_3(!l))},{enabled:!0,preventDefault:!0},[l]);const d=p=>e(_3(p.target.checked));return g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ke,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:g.jsx(WE,{})}),children:g.jsxs(ke,{direction:"column",gap:"0.5rem",children:[g.jsx(Gn,{label:t("unifiedCanvas.showIntermediates"),isChecked:s,onChange:p=>e(XW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.showGrid"),isChecked:a,onChange:p=>e(YW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.snapToGrid"),isChecked:l,onChange:d}),g.jsx(Gn,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:i,onChange:p=>e(GW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:p=>e(VW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:p=>e(UW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:u,onChange:p=>e(QW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:o,onChange:p=>e(KW(p.target.checked))}),g.jsx(Tq,{}),g.jsx(Pq,{})]})})},wLe=lt([rn,Lr,hr],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),CLe=()=>{const e=Le(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=le(wLe),{t:o}=De();Ze(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),Ze(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),Ze(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),Ze(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),Ze(["delete","backspace"],()=>{d()},{enabled:()=>!i,preventDefault:!0}),Ze(["BracketLeft"],()=>{e(Lm(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),Ze(["BracketRight"],()=>{e(Lm(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),Ze(["shift+BracketLeft"],()=>{e(Mm({...n,a:Te.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),Ze(["shift+BracketRight"],()=>{e(Mm({...n,a:Te.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(Jl("brush")),s=()=>e(Jl("eraser")),l=()=>e(Jl("colorPicker")),u=()=>e($W()),d=()=>e(NW());return g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ke,{"aria-label":`${o("unifiedCanvas.brush")} (B)`,tooltip:`${o("unifiedCanvas.brush")} (B)`,icon:g.jsx(iG,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),g.jsx(Ke,{"aria-label":`${o("unifiedCanvas.eraser")} (E)`,tooltip:`${o("unifiedCanvas.eraser")} (E)`,icon:g.jsx(eG,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),g.jsx(Ke,{"aria-label":`${o("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:g.jsx(nG,{}),isDisabled:i,onClick:u}),g.jsx(Ke,{"aria-label":`${o("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:g.jsx(b2,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:d}),g.jsx(Ke,{"aria-label":`${o("unifiedCanvas.colorPicker")} (C)`,tooltip:`${o("unifiedCanvas.colorPicker")} (C)`,icon:g.jsx(tG,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ke,{"aria-label":o("unifiedCanvas.brushOptions"),tooltip:o("unifiedCanvas.brushOptions"),icon:g.jsx(HE,{})}),children:g.jsxs(ke,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[g.jsx(ke,{gap:"1rem",justifyContent:"space-between",children:g.jsx(Dn,{label:o("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:p=>e(Lm(p)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),g.jsx(z3,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:p=>e(Mm(p))})]})})]})},_Le=lt([hr,rn,Lr],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),kLe=()=>{const e=Le(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=le(_Le),s=Qs(),{t:l}=De(),{openUploader:u}=DE();Ze(["v"],()=>{d()},{enabled:()=>!n,preventDefault:!0},[]),Ze(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[s]),Ze(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ze(["shift+s"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ze(["meta+c","ctrl+c"],()=>{E()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ze(["shift+d"],()=>{_()},{enabled:()=>!n,preventDefault:!0},[s,t]);const d=()=>e(Jl("move")),p=Eq(()=>m(!1),()=>m(!0)),m=(T=!1)=>{const L=Qs();if(!L)return;const O=L.getClientRect({skipTransform:!0});e(zW({contentRect:O,shouldScaleTo1:T}))},y=()=>{e(vE()),e(i4())},b=()=>{e(Td({cropVisible:!1,shouldSetAsInitialImage:!0}))},w=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},E=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},_=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},k=T=>{const L=T.target.value;e(C3(L)),L==="mask"&&!r&&e(p2(!0))};return g.jsxs("div",{className:"inpainting-settings",children:[g.jsx(Jo,{tooltip:`${l("unifiedCanvas.layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:DW,onChange:k,isDisabled:n}),g.jsx(bLe,{}),g.jsx(CLe,{}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ke,{"aria-label":`${l("unifiedCanvas.move")} (V)`,tooltip:`${l("unifiedCanvas.move")} (V)`,icon:g.jsx(ZU,{}),"data-selected":o==="move"||n,onClick:d}),g.jsx(Ke,{"aria-label":`${l("unifiedCanvas.resetView")} (R)`,tooltip:`${l("unifiedCanvas.resetView")} (R)`,icon:g.jsx(JU,{}),onClick:p})]}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ke,{"aria-label":`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:g.jsx(rG,{}),onClick:b,isDisabled:n}),g.jsx(Ke,{"aria-label":`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:g.jsx(zE,{}),onClick:w,isDisabled:n}),g.jsx(Ke,{"aria-label":`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:g.jsx(Jm,{}),onClick:E,isDisabled:n}),g.jsx(Ke,{"aria-label":`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:g.jsx(BE,{}),onClick:_,isDisabled:n})]}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(kq,{}),g.jsx(_q,{})]}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ke,{"aria-label":`${l("common.upload")}`,tooltip:`${l("common.upload")}`,icon:g.jsx(g4,{}),onClick:u,isDisabled:n}),g.jsx(Ke,{"aria-label":`${l("unifiedCanvas.clearCanvas")}`,tooltip:`${l("unifiedCanvas.clearCanvas")}`,icon:g.jsx(hp,{}),onClick:y,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),g.jsx(Gi,{isAttached:!0,children:g.jsx(SLe,{})})]})},ELe=lt([rn],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),PLe=()=>{const e=Le(),{doesCanvasNeedScaling:t}=le(ELe);return S.useLayoutEffect(()=>{e(Li(!0));const n=Te.debounce(()=>{e(Li(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),g.jsx("div",{className:"workarea-single-view",children:g.jsx("div",{className:"workarea-split-view-left",children:g.jsxs("div",{className:"inpainting-main-area",children:[g.jsx(kLe,{}),g.jsx("div",{className:"inpainting-canvas-area",children:t?g.jsx(Cq,{}):g.jsx(wq,{})})]})})})},TLe=lt(rn,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),MLe=()=>{const e=Le(),{boundingBoxDimensions:t}=le(TLe),{t:n}=De(),r=s=>{e(p1({...t,width:Math.floor(s)}))},i=s=>{e(p1({...t,height:Math.floor(s)}))},o=()=>{e(p1({...t,width:Math.floor(512)}))},a=()=>{e(p1({...t,height:Math.floor(512)}))};return g.jsxs(ke,{direction:"column",gap:2,children:[g.jsx(Dn,{label:n("parameters.width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:o,sliderMarkRightOffset:-7}),g.jsx(Dn,{label:n("parameters.height"),min:64,max:1024,step:64,value:t.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:a,sliderMarkRightOffset:-7})]})},LLe=lt([nP,hr,rn],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),ALe=()=>{const e=Le(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=le(LLe),{t:s}=De(),l=y=>{e(ex({...a,width:Math.floor(y)}))},u=y=>{e(ex({...a,height:Math.floor(y)}))},d=()=>{e(ex({...a,width:Math.floor(512)}))},p=()=>{e(ex({...a,height:Math.floor(512)}))},m=y=>{e(u3e(y.target.value))};return g.jsxs(ke,{direction:"column",gap:4,children:[g.jsx(Jo,{label:s("parameters.scaleBeforeProcessing"),validValues:GSe,value:i,onChange:m}),g.jsx(Dn,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters.scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:d,sliderMarkRightOffset:-7}),g.jsx(Dn,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters.scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:p,sliderMarkRightOffset:-7}),g.jsx(Jo,{label:s("parameters.infillMethod"),value:n,validValues:r,onChange:y=>e(sV(y.target.value))}),g.jsx(Dn,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("parameters.tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:y=>{e(iR(y))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(iR(32))}})]})};function OLe(){const e=Le(),t=le(r=>r.generation.seamBlur),{t:n}=De();return g.jsx(Dn,{sliderMarkRightOffset:-4,label:n("parameters.seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(eR(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(eR(16))}})}function RLe(){const e=Le(),{t}=De(),n=le(r=>r.generation.seamSize);return g.jsx(Dn,{sliderMarkRightOffset:-6,label:t("parameters.seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(tR(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(tR(96))})}function ILe(){const{t:e}=De(),t=le(r=>r.generation.seamSteps),n=Le();return g.jsx(Dn,{sliderMarkRightOffset:-4,label:e("parameters.seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(nR(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(nR(30))}})}function DLe(){const e=Le(),{t}=De(),n=le(r=>r.generation.seamStrength);return g.jsx(Dn,{sliderMarkRightOffset:-7,label:t("parameters.seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(rR(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(rR(.7))}})}const jLe=()=>g.jsxs(ke,{direction:"column",gap:2,children:[g.jsx(RLe,{}),g.jsx(OLe,{}),g.jsx(DLe,{}),g.jsx(ILe,{})]});function NLe(){return g.jsx(aP,{})}function $Le(){const{t:e}=De(),t={seed:{header:`${e("parameters.seed")}`,feature:oo.SEED,content:g.jsx(sP,{})},boundingBox:{header:`${e("parameters.boundingBoxHeader")}`,feature:oo.BOUNDING_BOX,content:g.jsx(MLe,{})},seamCorrection:{header:`${e("parameters.seamCorrectionHeader")}`,feature:oo.SEAM_CORRECTION,content:g.jsx(jLe,{})},infillAndScaling:{header:`${e("parameters.infillScalingHeader")}`,feature:oo.INFILL_AND_SCALING,content:g.jsx(ALe,{})},variations:{header:`${e("parameters.variations")}`,feature:oo.VARIATIONS,content:g.jsx(uP,{}),additionalHeaderComponents:g.jsx(lP,{})},output:{header:`${e("parameters.otherOptions")}`,content:g.jsx(NLe,{})}},n={unifiedCanvasImg2Img:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:g.jsx(hq,{label:e("parameters.img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"})}};return g.jsxs(pP,{children:[g.jsxs(ke,{flexDir:"column",rowGap:"0.5rem",children:[g.jsx(hP,{}),g.jsx(fP,{})]}),g.jsx(dP,{}),g.jsx(cP,{}),g.jsx(t0,{accordionInfo:n}),g.jsx(t0,{accordionInfo:t})]})}function FLe(){const e=le(t=>t.ui.shouldUseCanvasBetaLayout);return g.jsx(oP,{optionsPanel:g.jsx($Le,{}),styleClass:"inpainting-workarea-overrides",children:e?g.jsx(vLe,{}):g.jsx(PLe,{})})}const Za={txt2img:{title:g.jsx(L_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(MPe,{}),tooltip:"Text To Image"},img2img:{title:g.jsx(P_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(SPe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:g.jsx(O_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(FLe,{}),tooltip:"Unified Canvas"},nodes:{title:g.jsx(T_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(C_e,{}),tooltip:"Nodes"},postprocess:{title:g.jsx(M_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(__e,{}),tooltip:"Post Processing"},training:{title:g.jsx(A_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(k_e,{}),tooltip:"Training"}};function BLe(){Za.txt2img.tooltip=Et.t("common.text2img"),Za.img2img.tooltip=Et.t("common.img2img"),Za.unifiedCanvas.tooltip=Et.t("common.unifiedCanvas"),Za.nodes.tooltip=Et.t("common.nodes"),Za.postprocess.tooltip=Et.t("common.postProcessing"),Za.training.tooltip=Et.t("common.training")}function zLe(){const e=le(w_e),t=le(u=>u.lightbox.isLightboxOpen),{shouldShowGallery:n,shouldShowParametersPanel:r,shouldPinGallery:i,shouldPinParametersPanel:o}=le(iP);E_e(BLe);const a=Le();Ze("1",()=>{a(Wo(0))}),Ze("2",()=>{a(Wo(1))}),Ze("3",()=>{a(Wo(2))}),Ze("4",()=>{a(Wo(3))}),Ze("5",()=>{a(Wo(4))}),Ze("6",()=>{a(Wo(5))}),Ze("z",()=>{a(Om(!t))},[t]),Ze("f",()=>{n||r?(a(Fh(!1)),a(Am(!1))):(a(Fh(!0)),a(Am(!0))),(i||o)&&setTimeout(()=>a(Li(!0)),400)},[n,r]);const s=()=>{const u=[];return Object.keys(Za).forEach(d=>{u.push(g.jsx(si,{hasArrow:!0,label:Za[d].tooltip,placement:"right",children:g.jsx(lW,{children:Za[d].title})},d))}),u},l=()=>{const u=[];return Object.keys(Za).forEach(d=>{u.push(g.jsx(aW,{className:"app-tabs-panel",children:Za[d].workarea},d))}),u};return g.jsxs(oW,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:u=>{a(Wo(u))},children:[g.jsx("div",{className:"app-tabs-list",children:s()}),g.jsx(sW,{className:"app-tabs-panels",children:t?g.jsx(zEe,{}):l()})]})}var HLe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function _2(e,t){var n=WLe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function WLe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=HLe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var VLe=[".DS_Store","Thumbs.db"];function ULe(e){return d0(this,void 0,void 0,function(){return f0(this,function(t){return H3(e)&&GLe(e.dataTransfer)?[2,XLe(e.dataTransfer,e.type)]:qLe(e)?[2,KLe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,YLe(e)]:[2,[]]})})}function GLe(e){return H3(e)}function qLe(e){return H3(e)&&H3(e.target)}function H3(e){return typeof e=="object"&&e!==null}function KLe(e){return d7(e.target.files).map(function(t){return _2(t)})}function YLe(e){return d0(this,void 0,void 0,function(){var t;return f0(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return _2(r)})]}})})}function XLe(e,t){return d0(this,void 0,void 0,function(){var n,r;return f0(this,function(i){switch(i.label){case 0:return e.items?(n=d7(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(ZLe))]):[3,2];case 1:return r=i.sent(),[2,AD(Rq(r))];case 2:return[2,AD(d7(e.files).map(function(o){return _2(o)}))]}})})}function AD(e){return e.filter(function(t){return VLe.indexOf(t.name)===-1})}function d7(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,jD(n)];if(e.sizen)return[!1,jD(n)]}return[!0,null]}function Sh(e){return e!=null}function hAe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=Nq(l,n),d=Hy(u,1),p=d[0],m=$q(l,r,i),y=Hy(m,1),b=y[0],w=s?s(l):null;return p&&b&&!w})}function W3(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ex(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function $D(e){e.preventDefault()}function pAe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function gAe(e){return e.indexOf("Edge/")!==-1}function mAe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return pAe(e)||gAe(e)}function Ml(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function RAe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var xP=S.forwardRef(function(e,t){var n=e.children,r=V3(e,wAe),i=Wq(r),o=i.open,a=V3(i,CAe);return S.useImperativeHandle(t,function(){return{open:o}},[o]),qe.createElement(S.Fragment,null,n(_r(_r({},a),{},{open:o})))});xP.displayName="Dropzone";var Hq={disabled:!1,getFilesFromEvent:ULe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};xP.defaultProps=Hq;xP.propTypes={children:An.func,accept:An.objectOf(An.arrayOf(An.string)),multiple:An.bool,preventDropOnDocument:An.bool,noClick:An.bool,noKeyboard:An.bool,noDrag:An.bool,noDragEventsBubbling:An.bool,minSize:An.number,maxSize:An.number,maxFiles:An.number,disabled:An.bool,getFilesFromEvent:An.func,onFileDialogCancel:An.func,onFileDialogOpen:An.func,useFsAccessApi:An.bool,autoFocus:An.bool,onDragEnter:An.func,onDragLeave:An.func,onDragOver:An.func,onDrop:An.func,onDropAccepted:An.func,onDropRejected:An.func,onError:An.func,validator:An.func};var g7={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Wq(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_r(_r({},Hq),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,p=t.onDragOver,m=t.onDrop,y=t.onDropAccepted,b=t.onDropRejected,w=t.onFileDialogCancel,E=t.onFileDialogOpen,_=t.useFsAccessApi,k=t.autoFocus,T=t.preventDropOnDocument,L=t.noClick,O=t.noKeyboard,D=t.noDrag,I=t.noDragEventsBubbling,N=t.onError,V=t.validator,B=S.useMemo(function(){return bAe(n)},[n]),K=S.useMemo(function(){return yAe(n)},[n]),ne=S.useMemo(function(){return typeof E=="function"?E:BD},[E]),z=S.useMemo(function(){return typeof w=="function"?w:BD},[w]),$=S.useRef(null),H=S.useRef(null),Y=S.useReducer(IAe,g7),Q=u6(Y,2),q=Q[0],X=Q[1],ee=q.isFocused,fe=q.isFileDialogActive,Ee=S.useRef(typeof window<"u"&&window.isSecureContext&&_&&vAe()),we=function(){!Ee.current&&fe&&setTimeout(function(){if(H.current){var je=H.current.files;je.length||(X({type:"closeDialog"}),z())}},300)};S.useEffect(function(){return window.addEventListener("focus",we,!1),function(){window.removeEventListener("focus",we,!1)}},[H,fe,z,Ee]);var xe=S.useRef([]),Ae=function(je){$.current&&$.current.contains(je.target)||(je.preventDefault(),xe.current=[])};S.useEffect(function(){return T&&(document.addEventListener("dragover",$D,!1),document.addEventListener("drop",Ae,!1)),function(){T&&(document.removeEventListener("dragover",$D),document.removeEventListener("drop",Ae))}},[$,T]),S.useEffect(function(){return!r&&k&&$.current&&$.current.focus(),function(){}},[$,k,r]);var Se=S.useCallback(function(be){N?N(be):console.error(be)},[N]),Qe=S.useCallback(function(be){be.preventDefault(),be.persist(),se(be),xe.current=[].concat(EAe(xe.current),[be.target]),Ex(be)&&Promise.resolve(i(be)).then(function(je){if(!(W3(be)&&!I)){var bt=je.length,Dt=bt>0&&hAe({files:je,accept:B,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:V}),Me=bt>0&&!Dt;X({isDragAccept:Dt,isDragReject:Me,isDragActive:!0,type:"setDraggedFiles"}),u&&u(be)}}).catch(function(je){return Se(je)})},[i,u,Se,I,B,a,o,s,l,V]),Ye=S.useCallback(function(be){be.preventDefault(),be.persist(),se(be);var je=Ex(be);if(je&&be.dataTransfer)try{be.dataTransfer.dropEffect="copy"}catch{}return je&&p&&p(be),!1},[p,I]),nt=S.useCallback(function(be){be.preventDefault(),be.persist(),se(be);var je=xe.current.filter(function(Dt){return $.current&&$.current.contains(Dt)}),bt=je.indexOf(be.target);bt!==-1&&je.splice(bt,1),xe.current=je,!(je.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ex(be)&&d&&d(be))},[$,d,I]),vt=S.useCallback(function(be,je){var bt=[],Dt=[];be.forEach(function(Me){var Ct=Nq(Me,B),zt=u6(Ct,2),$n=zt[0],Ge=zt[1],pt=$q(Me,a,o),zr=u6(pt,2),rr=zr[0],Bn=zr[1],li=V?V(Me):null;if($n&&rr&&!li)bt.push(Me);else{var vs=[Ge,Bn];li&&(vs=vs.concat(li)),Dt.push({file:Me,errors:vs.filter(function(tl){return tl})})}}),(!s&&bt.length>1||s&&l>=1&&bt.length>l)&&(bt.forEach(function(Me){Dt.push({file:Me,errors:[fAe]})}),bt.splice(0)),X({acceptedFiles:bt,fileRejections:Dt,type:"setFiles"}),m&&m(bt,Dt,je),Dt.length>0&&b&&b(Dt,je),bt.length>0&&y&&y(bt,je)},[X,s,B,a,o,l,m,y,b,V]),Ce=S.useCallback(function(be){be.preventDefault(),be.persist(),se(be),xe.current=[],Ex(be)&&Promise.resolve(i(be)).then(function(je){W3(be)&&!I||vt(je,be)}).catch(function(je){return Se(je)}),X({type:"reset"})},[i,vt,Se,I]),et=S.useCallback(function(){if(Ee.current){X({type:"openDialog"}),ne();var be={multiple:s,types:K};window.showOpenFilePicker(be).then(function(je){return i(je)}).then(function(je){vt(je,null),X({type:"closeDialog"})}).catch(function(je){xAe(je)?(z(je),X({type:"closeDialog"})):SAe(je)?(Ee.current=!1,H.current?(H.current.value=null,H.current.click()):Se(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Se(je)});return}H.current&&(X({type:"openDialog"}),ne(),H.current.value=null,H.current.click())},[X,ne,z,_,vt,Se,K,s]),yt=S.useCallback(function(be){!$.current||!$.current.isEqualNode(be.target)||(be.key===" "||be.key==="Enter"||be.keyCode===32||be.keyCode===13)&&(be.preventDefault(),et())},[$,et]),ze=S.useCallback(function(){X({type:"focus"})},[]),at=S.useCallback(function(){X({type:"blur"})},[]),jt=S.useCallback(function(){L||(mAe()?setTimeout(et,0):et())},[L,et]),gt=function(je){return r?null:je},Jt=function(je){return O?null:gt(je)},on=function(je){return D?null:gt(je)},se=function(je){I&&je.stopPropagation()},Ie=S.useMemo(function(){return function(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},je=be.refKey,bt=je===void 0?"ref":je,Dt=be.role,Me=be.onKeyDown,Ct=be.onFocus,zt=be.onBlur,$n=be.onClick,Ge=be.onDragEnter,pt=be.onDragOver,zr=be.onDragLeave,rr=be.onDrop,Bn=V3(be,_Ae);return _r(_r(p7({onKeyDown:Jt(Ml(Me,yt)),onFocus:Jt(Ml(Ct,ze)),onBlur:Jt(Ml(zt,at)),onClick:gt(Ml($n,jt)),onDragEnter:on(Ml(Ge,Qe)),onDragOver:on(Ml(pt,Ye)),onDragLeave:on(Ml(zr,nt)),onDrop:on(Ml(rr,Ce)),role:typeof Dt=="string"&&Dt!==""?Dt:"presentation"},bt,$),!r&&!O?{tabIndex:0}:{}),Bn)}},[$,yt,ze,at,jt,Qe,Ye,nt,Ce,O,D,r]),Ne=S.useCallback(function(be){be.stopPropagation()},[]),Ue=S.useMemo(function(){return function(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},je=be.refKey,bt=je===void 0?"ref":je,Dt=be.onChange,Me=be.onClick,Ct=V3(be,kAe),zt=p7({accept:B,multiple:s,type:"file",style:{display:"none"},onChange:gt(Ml(Dt,Ce)),onClick:gt(Ml(Me,Ne)),tabIndex:-1},bt,H);return _r(_r({},zt),Ct)}},[H,n,s,Ce,r]);return _r(_r({},q),{},{isFocused:ee&&!r,getRootProps:Ie,getInputProps:Ue,rootRef:$,inputRef:H,open:gt(et)})}function IAe(e,t){switch(t.type){case"focus":return _r(_r({},e),{},{isFocused:!0});case"blur":return _r(_r({},e),{},{isFocused:!1});case"openDialog":return _r(_r({},g7),{},{isFileDialogActive:!0});case"closeDialog":return _r(_r({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _r(_r({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _r(_r({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return _r({},g7);default:return e}}function BD(){}const DAe=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return Ze("esc",()=>{i(!1)}),g.jsxs("div",{className:"dropzone-container",children:[t&&g.jsx("div",{className:"dropzone-overlay is-drag-accept",children:g.jsxs(jh,{size:"lg",children:["Upload Image",r]})}),n&&g.jsxs("div",{className:"dropzone-overlay is-drag-reject",children:[g.jsx(jh,{size:"lg",children:"Invalid Upload"}),g.jsx(jh,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},jAe=e=>{const{children:t}=e,n=Le(),r=le(Br),i=s2({}),{t:o}=De(),[a,s]=S.useState(!1),{setOpenUploader:l}=DE(),u=S.useCallback(T=>{s(!0);const L=T.errors.reduce((O,D)=>`${O} -${D.message}`,"");i({title:o("toast.uploadFailed"),description:L,status:"error",isClosable:!0})},[o,i]),d=S.useCallback(async T=>{n(MI({imageFile:T}))},[n]),p=S.useCallback((T,L)=>{L.forEach(O=>{u(O)}),T.forEach(O=>{d(O)})},[d,u]),{getRootProps:m,getInputProps:y,isDragAccept:b,isDragReject:w,isDragActive:E,open:_}=Wq({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:p,onDragOver:()=>s(!0),maxFiles:1});l(_),S.useEffect(()=>{const T=L=>{var N;const O=(N=L.clipboardData)==null?void 0:N.items;if(!O)return;const D=[];for(const V of O)V.kind==="file"&&["image/png","image/jpg"].includes(V.type)&&D.push(V);if(!D.length)return;if(L.stopImmediatePropagation(),D.length>1){i({description:o("toast.uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const I=D[0].getAsFile();if(!I){i({description:o("toast.uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(MI({imageFile:I}))};return document.addEventListener("paste",T),()=>{document.removeEventListener("paste",T)}},[o,n,i,r]);const k=["img2img","unifiedCanvas"].includes(r)?` to ${Za[r].tooltip}`:"";return g.jsx(IE.Provider,{value:_,children:g.jsxs("div",{...m({style:{}}),onKeyDown:T=>{T.key},children:[g.jsx("input",{...y()}),t,E&&a&&g.jsx(DAe,{isDragAccept:b,isDragReject:w,overlaySecondaryText:k,setIsHandlingUpload:s})]})})},NAe=lt(hr,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),$Ae=lt(hr,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),FAe=()=>{const e=Le(),t=le(NAe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=le($Ae),[o,a]=S.useState(!0),s=S.useRef(null);S.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(RV()),e(zC(!n))};Ze("`",()=>{e(zC(!n))},[n]),Ze("esc",()=>{e(zC(!1))});const u=()=>{s.current&&o&&s.current.scrollTop{const{timestamp:m,message:y,level:b}=d;return g.jsxs("div",{className:`console-entry console-${b}-color`,children:[g.jsxs("p",{className:"console-timestamp",children:[m,":"]}),g.jsx("p",{className:"console-message",children:y})]},p)})})}),n&&g.jsx(si,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:g.jsx(ls,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:g.jsx(cke,{}),onClick:()=>a(!o)})}),g.jsx(si,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:g.jsx(ls,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?g.jsx(kke,{}):g.jsx(QU,{}),onClick:l})})]})},BAe=lt(hr,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),zAe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=le(BAe),i=t?Math.round(t*100/n):0;return g.jsx(UH,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function HAe(e){const{title:t,hotkey:n,description:r}=e;return g.jsxs("div",{className:"hotkey-modal-item",children:[g.jsxs("div",{className:"hotkey-info",children:[g.jsx("p",{className:"hotkey-title",children:t}),r&&g.jsx("p",{className:"hotkey-description",children:r})]}),g.jsx("div",{className:"hotkey-key",children:n})]})}function WAe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Kd(),{t:i}=De(),o=[{title:i("hotkeys.invoke.title"),desc:i("hotkeys.invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys.cancel.title"),desc:i("hotkeys.cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys.focusPrompt.title"),desc:i("hotkeys.focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys.toggleOptions.title"),desc:i("hotkeys.toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys.pinOptions.title"),desc:i("hotkeys.pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys.toggleViewer.title"),desc:i("hotkeys.toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys.toggleGallery.title"),desc:i("hotkeys.toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys.maximizeWorkSpace.title"),desc:i("hotkeys.maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys.changeTabs.title"),desc:i("hotkeys.changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys.consoleToggle.title"),desc:i("hotkeys.consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys.setPrompt.title"),desc:i("hotkeys.setPrompt.desc"),hotkey:"P"},{title:i("hotkeys.setSeed.title"),desc:i("hotkeys.setSeed.desc"),hotkey:"S"},{title:i("hotkeys.setParameters.title"),desc:i("hotkeys.setParameters.desc"),hotkey:"A"},{title:i("hotkeys.restoreFaces.title"),desc:i("hotkeys.restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys.upscale.title"),desc:i("hotkeys.upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys.showInfo.title"),desc:i("hotkeys.showInfo.desc"),hotkey:"I"},{title:i("hotkeys.sendToImageToImage.title"),desc:i("hotkeys.sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys.deleteImage.title"),desc:i("hotkeys.deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys.closePanels.title"),desc:i("hotkeys.closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys.previousImage.title"),desc:i("hotkeys.previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys.nextImage.title"),desc:i("hotkeys.nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys.toggleGalleryPin.title"),desc:i("hotkeys.toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys.increaseGalleryThumbSize.title"),desc:i("hotkeys.increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys.decreaseGalleryThumbSize.title"),desc:i("hotkeys.decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys.selectBrush.title"),desc:i("hotkeys.selectBrush.desc"),hotkey:"B"},{title:i("hotkeys.selectEraser.title"),desc:i("hotkeys.selectEraser.desc"),hotkey:"E"},{title:i("hotkeys.decreaseBrushSize.title"),desc:i("hotkeys.decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys.increaseBrushSize.title"),desc:i("hotkeys.increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys.decreaseBrushOpacity.title"),desc:i("hotkeys.decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys.increaseBrushOpacity.title"),desc:i("hotkeys.increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys.moveTool.title"),desc:i("hotkeys.moveTool.desc"),hotkey:"V"},{title:i("hotkeys.fillBoundingBox.title"),desc:i("hotkeys.fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys.eraseBoundingBox.title"),desc:i("hotkeys.eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys.colorPicker.title"),desc:i("hotkeys.colorPicker.desc"),hotkey:"C"},{title:i("hotkeys.toggleSnap.title"),desc:i("hotkeys.toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys.quickToggleMove.title"),desc:i("hotkeys.quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys.toggleLayer.title"),desc:i("hotkeys.toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys.clearMask.title"),desc:i("hotkeys.clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys.hideMask.title"),desc:i("hotkeys.hideMask.desc"),hotkey:"H"},{title:i("hotkeys.showHideBoundingBox.title"),desc:i("hotkeys.showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys.mergeVisible.title"),desc:i("hotkeys.mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys.saveToGallery.title"),desc:i("hotkeys.saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys.copyToClipboard.title"),desc:i("hotkeys.copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys.downloadImage.title"),desc:i("hotkeys.downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys.undoStroke.title"),desc:i("hotkeys.undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys.redoStroke.title"),desc:i("hotkeys.redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys.resetView.title"),desc:i("hotkeys.resetView.desc"),hotkey:"R"},{title:i("hotkeys.previousStagingImage.title"),desc:i("hotkeys.previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys.nextStagingImage.title"),desc:i("hotkeys.nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys.acceptStagingImage.title"),desc:i("hotkeys.acceptStagingImage.desc"),hotkey:"Enter"}],u=d=>{const p=[];return d.forEach((m,y)=>{p.push(g.jsx(HAe,{title:m.title,description:m.desc,hotkey:m.hotkey},y))}),g.jsx("div",{className:"hotkey-modal-category",children:p})};return g.jsxs(g.Fragment,{children:[S.cloneElement(e,{onClick:n}),g.jsxs(Yd,{isOpen:t,onClose:r,children:[g.jsx(oc,{}),g.jsxs(Xd,{className:" modal hotkeys-modal",children:[g.jsx(g0,{className:"modal-close-btn"}),g.jsx("h1",{children:"Keyboard Shorcuts"}),g.jsx("div",{className:"hotkeys-modal-items",children:g.jsxs(f8,{allowMultiple:!0,children:[g.jsxs(rm,{children:[g.jsxs(tm,{className:"hotkeys-modal-button",children:[g.jsx("h2",{children:i("hotkeys.appHotkeys")}),g.jsx(nm,{})]}),g.jsx(om,{children:u(o)})]}),g.jsxs(rm,{children:[g.jsxs(tm,{className:"hotkeys-modal-button",children:[g.jsx("h2",{children:i("hotkeys.generalHotkeys")}),g.jsx(nm,{})]}),g.jsx(om,{children:u(a)})]}),g.jsxs(rm,{children:[g.jsxs(tm,{className:"hotkeys-modal-button",children:[g.jsx("h2",{children:i("hotkeys.galleryHotkeys")}),g.jsx(nm,{})]}),g.jsx(om,{children:u(s)})]}),g.jsxs(rm,{children:[g.jsxs(tm,{className:"hotkeys-modal-button",children:[g.jsx("h2",{children:i("hotkeys.unifiedCanvasHotkeys")}),g.jsx(nm,{})]}),g.jsx(om,{children:u(l)})]})]})})]})]})]})}var zD=Array.isArray,HD=Object.keys,VAe=Object.prototype.hasOwnProperty,UAe=typeof Element<"u";function m7(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=zD(e),r=zD(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!m7(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var p=HD(e);if(o=p.length,o!==HD(t).length)return!1;for(i=o;i--!==0;)if(!VAe.call(t,p[i]))return!1;if(UAe&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=p[i],!(a==="_owner"&&e.$$typeof)&&!m7(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var md=function(t,n){try{return m7(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},GAe=function(t){return qAe(t)&&!KAe(t)};function qAe(e){return!!e&&typeof e=="object"}function KAe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||ZAe(e)}var YAe=typeof Symbol=="function"&&Symbol.for,XAe=YAe?Symbol.for("react.element"):60103;function ZAe(e){return e.$$typeof===XAe}function QAe(e){return Array.isArray(e)?[]:{}}function U3(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Wy(QAe(e),e,t):e}function JAe(e,t,n){return e.concat(t).map(function(r){return U3(r,n)})}function eOe(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=U3(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=U3(t[i],n):r[i]=Wy(e[i],t[i],n)}),r}function Wy(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||JAe,n.isMergeableObject=n.isMergeableObject||GAe;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):eOe(e,t,n):U3(t,n)}Wy.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Wy(r,i,n)},{})};var v7=Wy,tOe=typeof global=="object"&&global&&global.Object===Object&&global;const Vq=tOe;var nOe=typeof self=="object"&&self&&self.Object===Object&&self,rOe=Vq||nOe||Function("return this")();const du=rOe;var iOe=du.Symbol;const tf=iOe;var Uq=Object.prototype,oOe=Uq.hasOwnProperty,aOe=Uq.toString,n1=tf?tf.toStringTag:void 0;function sOe(e){var t=oOe.call(e,n1),n=e[n1];try{e[n1]=void 0;var r=!0}catch{}var i=aOe.call(e);return r&&(t?e[n1]=n:delete e[n1]),i}var lOe=Object.prototype,uOe=lOe.toString;function cOe(e){return uOe.call(e)}var dOe="[object Null]",fOe="[object Undefined]",WD=tf?tf.toStringTag:void 0;function yp(e){return e==null?e===void 0?fOe:dOe:WD&&WD in Object(e)?sOe(e):cOe(e)}function Gq(e,t){return function(n){return e(t(n))}}var hOe=Gq(Object.getPrototypeOf,Object);const SP=hOe;function bp(e){return e!=null&&typeof e=="object"}var pOe="[object Object]",gOe=Function.prototype,mOe=Object.prototype,qq=gOe.toString,vOe=mOe.hasOwnProperty,yOe=qq.call(Object);function VD(e){if(!bp(e)||yp(e)!=pOe)return!1;var t=SP(e);if(t===null)return!0;var n=vOe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&qq.call(n)==yOe}function bOe(){this.__data__=[],this.size=0}function Kq(e,t){return e===t||e!==e&&t!==t}function T4(e,t){for(var n=e.length;n--;)if(Kq(e[n][0],t))return n;return-1}var xOe=Array.prototype,SOe=xOe.splice;function wOe(e){var t=this.__data__,n=T4(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():SOe.call(t,n,1),--this.size,!0}function COe(e){var t=this.__data__,n=T4(t,e);return n<0?void 0:t[n][1]}function _Oe(e){return T4(this.__data__,e)>-1}function kOe(e,t){var n=this.__data__,r=T4(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function yc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=ORe}var RRe="[object Arguments]",IRe="[object Array]",DRe="[object Boolean]",jRe="[object Date]",NRe="[object Error]",$Re="[object Function]",FRe="[object Map]",BRe="[object Number]",zRe="[object Object]",HRe="[object RegExp]",WRe="[object Set]",VRe="[object String]",URe="[object WeakMap]",GRe="[object ArrayBuffer]",qRe="[object DataView]",KRe="[object Float32Array]",YRe="[object Float64Array]",XRe="[object Int8Array]",ZRe="[object Int16Array]",QRe="[object Int32Array]",JRe="[object Uint8Array]",eIe="[object Uint8ClampedArray]",tIe="[object Uint16Array]",nIe="[object Uint32Array]",ar={};ar[KRe]=ar[YRe]=ar[XRe]=ar[ZRe]=ar[QRe]=ar[JRe]=ar[eIe]=ar[tIe]=ar[nIe]=!0;ar[RRe]=ar[IRe]=ar[GRe]=ar[DRe]=ar[qRe]=ar[jRe]=ar[NRe]=ar[$Re]=ar[FRe]=ar[BRe]=ar[zRe]=ar[HRe]=ar[WRe]=ar[VRe]=ar[URe]=!1;function rIe(e){return bp(e)&&tK(e.length)&&!!ar[yp(e)]}function wP(e){return function(t){return e(t)}}var nK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Z1=nK&&typeof module=="object"&&module&&!module.nodeType&&module,iIe=Z1&&Z1.exports===nK,d6=iIe&&Vq.process,oIe=function(){try{var e=Z1&&Z1.require&&Z1.require("util").types;return e||d6&&d6.binding&&d6.binding("util")}catch{}}();const r0=oIe;var XD=r0&&r0.isTypedArray,aIe=XD?wP(XD):rIe;const sIe=aIe;var lIe=Object.prototype,uIe=lIe.hasOwnProperty;function rK(e,t){var n=E2(e),r=!n&&CRe(e),i=!n&&!r&&eK(e),o=!n&&!r&&!i&&sIe(e),a=n||r||i||o,s=a?yRe(e.length,String):[],l=s.length;for(var u in e)(t||uIe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ARe(u,l)))&&s.push(u);return s}var cIe=Object.prototype;function CP(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||cIe;return e===n}var dIe=Gq(Object.keys,Object);const fIe=dIe;var hIe=Object.prototype,pIe=hIe.hasOwnProperty;function gIe(e){if(!CP(e))return fIe(e);var t=[];for(var n in Object(e))pIe.call(e,n)&&n!="constructor"&&t.push(n);return t}function iK(e){return e!=null&&tK(e.length)&&!Yq(e)}function _P(e){return iK(e)?rK(e):gIe(e)}function mIe(e,t){return e&&L4(t,_P(t),e)}function vIe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var yIe=Object.prototype,bIe=yIe.hasOwnProperty;function xIe(e){if(!k2(e))return vIe(e);var t=CP(e),n=[];for(var r in e)r=="constructor"&&(t||!bIe.call(e,r))||n.push(r);return n}function kP(e){return iK(e)?rK(e,!0):xIe(e)}function SIe(e,t){return e&&L4(t,kP(t),e)}var oK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ZD=oK&&typeof module=="object"&&module&&!module.nodeType&&module,wIe=ZD&&ZD.exports===oK,QD=wIe?du.Buffer:void 0,JD=QD?QD.allocUnsafe:void 0;function CIe(e,t){if(t)return e.slice();var n=e.length,r=JD?JD(n):new e.constructor(n);return e.copy(r),r}function aK(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function gj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var mj=function(t){return Array.isArray(t)&&t.length===0},Ho=function(t){return typeof t=="function"},A4=function(t){return t!==null&&typeof t=="object"},Sje=function(t){return String(Math.floor(Number(t)))===t},f6=function(t){return Object.prototype.toString.call(t)==="[object String]"},vK=function(t){return S.Children.count(t)===0},h6=function(t){return A4(t)&&Ho(t.then)};function Vi(e,t,n,r){r===void 0&&(r=0);for(var i=mK(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function yK(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?Ie.map(function(Ue){return N(Ue,Vi(se,Ue))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Ne).then(function(Ue){return Ue.reduce(function(be,je,bt){return je==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||je&&(be=tu(be,Ie[bt],je)),be},{})})},[N]),B=S.useCallback(function(se){return Promise.all([V(se),m.validationSchema?I(se):{},m.validate?D(se):{}]).then(function(Ie){var Ne=Ie[0],Ue=Ie[1],be=Ie[2],je=v7.all([Ne,Ue,be],{arrayMerge:Pje});return je})},[m.validate,m.validationSchema,V,D,I]),K=Ga(function(se){return se===void 0&&(se=L.values),O({type:"SET_ISVALIDATING",payload:!0}),B(se).then(function(Ie){return _.current&&(O({type:"SET_ISVALIDATING",payload:!1}),O({type:"SET_ERRORS",payload:Ie})),Ie})});S.useEffect(function(){a&&_.current===!0&&md(y.current,m.initialValues)&&K(y.current)},[a,K]);var ne=S.useCallback(function(se){var Ie=se&&se.values?se.values:y.current,Ne=se&&se.errors?se.errors:b.current?b.current:m.initialErrors||{},Ue=se&&se.touched?se.touched:w.current?w.current:m.initialTouched||{},be=se&&se.status?se.status:E.current?E.current:m.initialStatus;y.current=Ie,b.current=Ne,w.current=Ue,E.current=be;var je=function(){O({type:"RESET_FORM",payload:{isSubmitting:!!se&&!!se.isSubmitting,errors:Ne,touched:Ue,status:be,values:Ie,isValidating:!!se&&!!se.isValidating,submitCount:se&&se.submitCount&&typeof se.submitCount=="number"?se.submitCount:0}})};if(m.onReset){var bt=m.onReset(L.values,Ce);h6(bt)?bt.then(je):je()}else je()},[m.initialErrors,m.initialStatus,m.initialTouched]);S.useEffect(function(){_.current===!0&&!md(y.current,m.initialValues)&&(u&&(y.current=m.initialValues,ne()),a&&K(y.current))},[u,m.initialValues,ne,a,K]),S.useEffect(function(){u&&_.current===!0&&!md(b.current,m.initialErrors)&&(b.current=m.initialErrors||lh,O({type:"SET_ERRORS",payload:m.initialErrors||lh}))},[u,m.initialErrors]),S.useEffect(function(){u&&_.current===!0&&!md(w.current,m.initialTouched)&&(w.current=m.initialTouched||Px,O({type:"SET_TOUCHED",payload:m.initialTouched||Px}))},[u,m.initialTouched]),S.useEffect(function(){u&&_.current===!0&&!md(E.current,m.initialStatus)&&(E.current=m.initialStatus,O({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var z=Ga(function(se){if(k.current[se]&&Ho(k.current[se].validate)){var Ie=Vi(L.values,se),Ne=k.current[se].validate(Ie);return h6(Ne)?(O({type:"SET_ISVALIDATING",payload:!0}),Ne.then(function(Ue){return Ue}).then(function(Ue){O({type:"SET_FIELD_ERROR",payload:{field:se,value:Ue}}),O({type:"SET_ISVALIDATING",payload:!1})})):(O({type:"SET_FIELD_ERROR",payload:{field:se,value:Ne}}),Promise.resolve(Ne))}else if(m.validationSchema)return O({type:"SET_ISVALIDATING",payload:!0}),I(L.values,se).then(function(Ue){return Ue}).then(function(Ue){O({type:"SET_FIELD_ERROR",payload:{field:se,value:Ue[se]}}),O({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),$=S.useCallback(function(se,Ie){var Ne=Ie.validate;k.current[se]={validate:Ne}},[]),H=S.useCallback(function(se){delete k.current[se]},[]),Y=Ga(function(se,Ie){O({type:"SET_TOUCHED",payload:se});var Ne=Ie===void 0?i:Ie;return Ne?K(L.values):Promise.resolve()}),Q=S.useCallback(function(se){O({type:"SET_ERRORS",payload:se})},[]),q=Ga(function(se,Ie){var Ne=Ho(se)?se(L.values):se;O({type:"SET_VALUES",payload:Ne});var Ue=Ie===void 0?n:Ie;return Ue?K(Ne):Promise.resolve()}),X=S.useCallback(function(se,Ie){O({type:"SET_FIELD_ERROR",payload:{field:se,value:Ie}})},[]),ee=Ga(function(se,Ie,Ne){O({type:"SET_FIELD_VALUE",payload:{field:se,value:Ie}});var Ue=Ne===void 0?n:Ne;return Ue?K(tu(L.values,se,Ie)):Promise.resolve()}),fe=S.useCallback(function(se,Ie){var Ne=Ie,Ue=se,be;if(!f6(se)){se.persist&&se.persist();var je=se.target?se.target:se.currentTarget,bt=je.type,Dt=je.name,Me=je.id,Ct=je.value,zt=je.checked,$n=je.outerHTML,Ge=je.options,pt=je.multiple;Ne=Ie||Dt||Me,Ue=/number|range/.test(bt)?(be=parseFloat(Ct),isNaN(be)?"":be):/checkbox/.test(bt)?Mje(Vi(L.values,Ne),zt,Ct):Ge&&pt?Tje(Ge):Ct}Ne&&ee(Ne,Ue)},[ee,L.values]),Ee=Ga(function(se){if(f6(se))return function(Ie){return fe(Ie,se)};fe(se)}),we=Ga(function(se,Ie,Ne){Ie===void 0&&(Ie=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:se,value:Ie}});var Ue=Ne===void 0?i:Ne;return Ue?K(L.values):Promise.resolve()}),xe=S.useCallback(function(se,Ie){se.persist&&se.persist();var Ne=se.target,Ue=Ne.name,be=Ne.id,je=Ne.outerHTML,bt=Ie||Ue||be;we(bt,!0)},[we]),Ae=Ga(function(se){if(f6(se))return function(Ie){return xe(Ie,se)};xe(se)}),Se=S.useCallback(function(se){Ho(se)?O({type:"SET_FORMIK_STATE",payload:se}):O({type:"SET_FORMIK_STATE",payload:function(){return se}})},[]),Qe=S.useCallback(function(se){O({type:"SET_STATUS",payload:se})},[]),Ye=S.useCallback(function(se){O({type:"SET_ISSUBMITTING",payload:se})},[]),nt=Ga(function(){return O({type:"SUBMIT_ATTEMPT"}),K().then(function(se){var Ie=se instanceof Error,Ne=!Ie&&Object.keys(se).length===0;if(Ne){var Ue;try{if(Ue=et(),Ue===void 0)return}catch(be){throw be}return Promise.resolve(Ue).then(function(be){return _.current&&O({type:"SUBMIT_SUCCESS"}),be}).catch(function(be){if(_.current)throw O({type:"SUBMIT_FAILURE"}),be})}else if(_.current&&(O({type:"SUBMIT_FAILURE"}),Ie))throw se})}),vt=Ga(function(se){se&&se.preventDefault&&Ho(se.preventDefault)&&se.preventDefault(),se&&se.stopPropagation&&Ho(se.stopPropagation)&&se.stopPropagation(),nt().catch(function(Ie){console.warn("Warning: An unhandled error was caught from submitForm()",Ie)})}),Ce={resetForm:ne,validateForm:K,validateField:z,setErrors:Q,setFieldError:X,setFieldTouched:we,setFieldValue:ee,setStatus:Qe,setSubmitting:Ye,setTouched:Y,setValues:q,setFormikState:Se,submitForm:nt},et=Ga(function(){return d(L.values,Ce)}),yt=Ga(function(se){se&&se.preventDefault&&Ho(se.preventDefault)&&se.preventDefault(),se&&se.stopPropagation&&Ho(se.stopPropagation)&&se.stopPropagation(),ne()}),ze=S.useCallback(function(se){return{value:Vi(L.values,se),error:Vi(L.errors,se),touched:!!Vi(L.touched,se),initialValue:Vi(y.current,se),initialTouched:!!Vi(w.current,se),initialError:Vi(b.current,se)}},[L.errors,L.touched,L.values]),at=S.useCallback(function(se){return{setValue:function(Ne,Ue){return ee(se,Ne,Ue)},setTouched:function(Ne,Ue){return we(se,Ne,Ue)},setError:function(Ne){return X(se,Ne)}}},[ee,we,X]),jt=S.useCallback(function(se){var Ie=A4(se),Ne=Ie?se.name:se,Ue=Vi(L.values,Ne),be={name:Ne,value:Ue,onChange:Ee,onBlur:Ae};if(Ie){var je=se.type,bt=se.value,Dt=se.as,Me=se.multiple;je==="checkbox"?bt===void 0?be.checked=!!Ue:(be.checked=!!(Array.isArray(Ue)&&~Ue.indexOf(bt)),be.value=bt):je==="radio"?(be.checked=Ue===bt,be.value=bt):Dt==="select"&&Me&&(be.value=be.value||[],be.multiple=!0)}return be},[Ae,Ee,L.values]),gt=S.useMemo(function(){return!md(y.current,L.values)},[y.current,L.values]),Jt=S.useMemo(function(){return typeof s<"u"?gt?L.errors&&Object.keys(L.errors).length===0:s!==!1&&Ho(s)?s(m):s:L.errors&&Object.keys(L.errors).length===0},[s,gt,L.errors,m]),on=Un({},L,{initialValues:y.current,initialErrors:b.current,initialTouched:w.current,initialStatus:E.current,handleBlur:Ae,handleChange:Ee,handleReset:yt,handleSubmit:vt,resetForm:ne,setErrors:Q,setFormikState:Se,setFieldTouched:we,setFieldValue:ee,setFieldError:X,setStatus:Qe,setSubmitting:Ye,setTouched:Y,setValues:q,submitForm:nt,validateForm:K,validateField:z,isValid:Jt,dirty:gt,unregisterField:H,registerField:$,getFieldProps:jt,getFieldMeta:ze,getFieldHelpers:at,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return on}function P2(e){var t=_je(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return S.useImperativeHandle(o,function(){return t}),S.createElement(wje,{value:t},n?S.createElement(n,t):i?i(t):r?Ho(r)?r(t):vK(r)?null:S.Children.only(r):null)}function kje(e){var t={};if(e.inner){if(e.inner.length===0)return tu(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Vi(t,a.path)||(t=tu(t,a.path,a.message))}}return t}function Eje(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=w7(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function w7(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||VD(i)?w7(i):i!==""?i:void 0}):VD(e[r])?t[r]=w7(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function Pje(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?v7(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=v7(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function Tje(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function Mje(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var Lje=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?S.useLayoutEffect:S.useEffect;function Ga(e){var t=S.useRef(e);return Lje(function(){t.current=e}),S.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(Un({},t,{length:n+1}))}else return[]},Dje=function(e){xje(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,d=l.formik.setFormikState;d(function(p){var m=typeof s=="function"?s:o,y=typeof a=="function"?a:o,b=tu(p.values,u,o(Vi(p.values,u))),w=s?m(Vi(p.errors,u)):void 0,E=a?y(Vi(p.touched,u)):void 0;return mj(w)&&(w=void 0),mj(E)&&(E=void 0),Un({},p,{values:b,errors:s?tu(p.errors,u,w):p.errors,touched:a?tu(p.touched,u,E):p.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(i0(a),[bje(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return Rje(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return Oje(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return p6(s,o,a)},function(s){return p6(s,o,null)},function(s){return p6(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return Ije(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(gj(i)),i.pop=i.pop.bind(gj(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!md(Vi(i.formik.values,i.name),Vi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?i0(a):[];return o||(o=s[i]),Ho(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,d=o.formik,p=Ph(d,["validate","validationSchema"]),m=Un({},i,{form:p,name:u});return a?S.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):vK(l)?null:S.Children.only(l):null},t}(S.Component);Dje.defaultProps={validateOnChange:!0};function jje(e){const{model:t}=e,r=le(b=>b.system.model_list)[t],i=Le(),{t:o}=De(),a=le(b=>b.system.isProcessing),s=le(b=>b.system.isConnected),[l,u]=S.useState("same"),[d,p]=S.useState("");S.useEffect(()=>{u("same")},[t]);const m=()=>{u("same")},y=()=>{i(d_e({model_name:t,save_location:l,custom_location:l==="custom"&&d!==""?d:null}))};return g.jsxs(k4,{title:`${o("modelManager.convert")} ${t}`,acceptCallback:y,cancelCallback:m,acceptButtonText:`${o("modelManager.convert")}`,triggerComponent:g.jsxs(On,{size:"sm","aria-label":o("modelManager.convertToDiffusers"),isDisabled:r.status==="active"||a||!s,className:" modal-close-btn",marginRight:"2rem",children:["🧨 ",o("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[g.jsxs(ke,{flexDirection:"column",rowGap:4,children:[g.jsx(It,{children:o("modelManager.convertToDiffusersHelpText1")}),g.jsxs(nH,{children:[g.jsx(d1,{children:o("modelManager.convertToDiffusersHelpText2")}),g.jsx(d1,{children:o("modelManager.convertToDiffusersHelpText3")}),g.jsx(d1,{children:o("modelManager.convertToDiffusersHelpText4")}),g.jsx(d1,{children:o("modelManager.convertToDiffusersHelpText5")})]}),g.jsx(It,{children:o("modelManager.convertToDiffusersHelpText6")})]}),g.jsxs(ke,{flexDir:"column",gap:4,children:[g.jsxs(ke,{marginTop:"1rem",flexDir:"column",gap:2,children:[g.jsx(It,{fontWeight:"bold",children:o("modelManager.convertToDiffusersSaveLocation")}),g.jsx(Oy,{value:l,onChange:b=>u(b),children:g.jsxs(ke,{gap:4,children:[g.jsx(Uo,{value:"same",children:g.jsx(si,{label:"Save converted model in the same folder",children:o("modelManager.sameFolder")})}),g.jsx(Uo,{value:"root",children:g.jsx(si,{label:"Save converted model in the InvokeAI root folder",children:o("modelManager.invokeRoot")})}),g.jsx(Uo,{value:"custom",children:g.jsx(si,{label:"Save converted model in a custom folder",children:o("modelManager.custom")})})]})})]}),l==="custom"&&g.jsxs(ke,{flexDirection:"column",rowGap:2,children:[g.jsx(It,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:o("modelManager.customSaveLocation")}),g.jsx(qn,{value:d,onChange:b=>{b.target.value!==""&&p(b.target.value)},width:"25rem"})]})]})]})}const Nje=lt([hr],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),vj=64,yj=2048;function $je(){const{openModel:e,model_list:t}=le(Nje),n=le(l=>l.system.isProcessing),r=Le(),{t:i}=De(),[o,a]=S.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});S.useEffect(()=>{var l,u,d,p,m,y,b;if(e){const w=Te.pickBy(t,(E,_)=>Te.isEqual(_,e));a({name:e,description:(l=w[e])==null?void 0:l.description,config:(u=w[e])==null?void 0:u.config,weights:(d=w[e])==null?void 0:d.weights,vae:(p=w[e])==null?void 0:p.vae,width:(m=w[e])==null?void 0:m.width,height:(y=w[e])==null?void 0:y.height,default:(b=w[e])==null?void 0:b.default,format:"ckpt"})}},[t,e]);const s=l=>{r(y2({...l,width:Number(l.width),height:Number(l.height)}))};return e?g.jsxs(ke,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[g.jsxs(ke,{alignItems:"center",gap:4,justifyContent:"space-between",children:[g.jsx(It,{fontSize:"lg",fontWeight:"bold",children:e}),g.jsx(jje,{model:e})]}),g.jsx(ke,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:g.jsx(P2,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>g.jsx("form",{onSubmit:l,children:g.jsxs(hn,{rowGap:"0.5rem",alignItems:"start",children:[g.jsxs(sn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"description",fontSize:"sm",children:i("modelManager.description")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?g.jsx(lr,{children:u.description}):g.jsx(sr,{margin:0,children:i("modelManager.descriptionValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.config&&d.config,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"config",fontSize:"sm",children:i("modelManager.config")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"config",name:"config",type:"text",width:"lg"}),u.config&&d.config?g.jsx(lr,{children:u.config}):g.jsx(sr,{margin:0,children:i("modelManager.configValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.weights&&d.weights,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"config",fontSize:"sm",children:i("modelManager.modelLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"weights",name:"weights",type:"text",width:"lg"}),u.weights&&d.weights?g.jsx(lr,{children:u.weights}):g.jsx(sr,{margin:0,children:i("modelManager.modelLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.vae&&d.vae,children:[g.jsx(Sn,{htmlFor:"vae",fontSize:"sm",children:i("modelManager.vaeLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae",name:"vae",type:"text",width:"lg"}),u.vae&&d.vae?g.jsx(lr,{children:u.vae}):g.jsx(sr,{margin:0,children:i("modelManager.vaeLocationValidationMsg")})]})]}),g.jsxs(u2,{width:"100%",children:[g.jsxs(sn,{isInvalid:!!u.width&&d.width,children:[g.jsx(Sn,{htmlFor:"width",fontSize:"sm",children:i("modelManager.width")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{id:"width",name:"width",children:({field:p,form:m})=>g.jsx(lc,{id:"width",name:"width",min:vj,max:yj,step:64,value:m.values.width,onChange:y=>m.setFieldValue(p.name,Number(y))})}),u.width&&d.width?g.jsx(lr,{children:u.width}):g.jsx(sr,{margin:0,children:i("modelManager.widthValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.height&&d.height,children:[g.jsx(Sn,{htmlFor:"height",fontSize:"sm",children:i("modelManager.height")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{id:"height",name:"height",children:({field:p,form:m})=>g.jsx(lc,{id:"height",name:"height",min:vj,max:yj,step:64,value:m.values.height,onChange:y=>m.setFieldValue(p.name,Number(y))})}),u.height&&d.height?g.jsx(lr,{children:u.height}):g.jsx(sr,{margin:0,children:i("modelManager.heightValidationMsg")})]})]})]}),g.jsx(On,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelManager.updateModel")})]})})})})]}):g.jsx(ke,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:g.jsx(It,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const Fje=lt([hr],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}});function Bje(){const{openModel:e,model_list:t}=le(Fje),n=le(l=>l.system.isProcessing),r=Le(),{t:i}=De(),[o,a]=S.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});S.useEffect(()=>{var l,u,d,p,m,y,b,w,E,_,k,T,L,O,D,I;if(e){const N=Te.pickBy(t,(V,B)=>Te.isEqual(B,e));a({name:e,description:(l=N[e])==null?void 0:l.description,path:(u=N[e])!=null&&u.path&&((d=N[e])==null?void 0:d.path)!=="None"?(p=N[e])==null?void 0:p.path:"",repo_id:(m=N[e])!=null&&m.repo_id&&((y=N[e])==null?void 0:y.repo_id)!=="None"?(b=N[e])==null?void 0:b.repo_id:"",vae:{repo_id:(E=(w=N[e])==null?void 0:w.vae)!=null&&E.repo_id?(k=(_=N[e])==null?void 0:_.vae)==null?void 0:k.repo_id:"",path:(L=(T=N[e])==null?void 0:T.vae)!=null&&L.path?(D=(O=N[e])==null?void 0:O.vae)==null?void 0:D.path:""},default:(I=N[e])==null?void 0:I.default,format:"diffusers"})}},[t,e]);const s=l=>{const u=l;l.path===""&&delete u.path,l.repo_id===""&&delete u.repo_id,l.vae.path===""&&delete u.vae.path,l.vae.repo_id===""&&delete u.vae.repo_id,r(y2(l))};return e?g.jsxs(ke,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[g.jsx(ke,{alignItems:"center",children:g.jsx(It,{fontSize:"lg",fontWeight:"bold",children:e})}),g.jsx(ke,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:g.jsx(P2,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>{var p,m,y,b,w,E,_,k,T,L;return g.jsx("form",{onSubmit:l,children:g.jsxs(hn,{rowGap:"0.5rem",alignItems:"start",children:[g.jsxs(sn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"description",fontSize:"sm",children:i("modelManager.description")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?g.jsx(lr,{children:u.description}):g.jsx(sr,{margin:0,children:i("modelManager.descriptionValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.path&&d.path,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"path",fontSize:"sm",children:i("modelManager.modelLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"path",name:"path",type:"text",width:"lg"}),u.path&&d.path?g.jsx(lr,{children:u.path}):g.jsx(sr,{margin:0,children:i("modelManager.modelLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.repo_id&&d.repo_id,children:[g.jsx(Sn,{htmlFor:"repo_id",fontSize:"sm",children:i("modelManager.repo_id")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"repo_id",name:"repo_id",type:"text",width:"lg"}),u.repo_id&&d.repo_id?g.jsx(lr,{children:u.repo_id}):g.jsx(sr,{margin:0,children:i("modelManager.repoIDValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!((p=u.vae)!=null&&p.path)&&((m=d.vae)==null?void 0:m.path),children:[g.jsx(Sn,{htmlFor:"vae.path",fontSize:"sm",children:i("modelManager.vaeLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae.path",name:"vae.path",type:"text",width:"lg"}),(y=u.vae)!=null&&y.path&&((b=d.vae)!=null&&b.path)?g.jsx(lr,{children:(w=u.vae)==null?void 0:w.path}):g.jsx(sr,{margin:0,children:i("modelManager.vaeLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!((E=u.vae)!=null&&E.repo_id)&&((_=d.vae)==null?void 0:_.repo_id),children:[g.jsx(Sn,{htmlFor:"vae.repo_id",fontSize:"sm",children:i("modelManager.vaeRepoID")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"lg"}),(k=u.vae)!=null&&k.repo_id&&((T=d.vae)!=null&&T.repo_id)?g.jsx(lr,{children:(L=u.vae)==null?void 0:L.repo_id}):g.jsx(sr,{margin:0,children:i("modelManager.vaeRepoIDValidationMsg")})]})]}),g.jsx(On,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelManager.updateModel")})]})})}})})]}):g.jsx(ke,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:g.jsx(It,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const xK=lt([hr],e=>{const{model_list:t}=e,n=[];return Te.forEach(t,r=>{n.push(r.weights)}),n});function zje(){const{t:e}=De();return g.jsx(ao,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelManager.modelExists")})}function bj({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=le(xK),i=o=>{t.includes(o.target.value)?n(Te.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return g.jsxs(ao,{position:"relative",children:[r.includes(e.location)?g.jsx(zje,{}):null,g.jsx(Gn,{value:e.name,label:g.jsx(g.Fragment,{children:g.jsxs(hn,{alignItems:"start",children:[g.jsx("p",{style:{fontWeight:"bold"},children:e.name}),g.jsx("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function Hje(){const e=Le(),{t}=De(),n=le(T=>T.system.searchFolder),r=le(T=>T.system.foundModels),i=le(xK),o=le(T=>T.ui.shouldShowExistingModelsInSearch),a=le(T=>T.system.isProcessing),[s,l]=qe.useState([]),[u,d]=qe.useState("v1"),[p,m]=qe.useState(""),y=()=>{e(IV(null)),e(DV(null)),l([])},b=T=>{e(PI(T.checkpointFolder))},w=()=>{l([]),r&&r.forEach(T=>{i.includes(T.location)||l(L=>[...L,T.name])})},E=()=>{l([])},_=()=>{const T=r==null?void 0:r.filter(O=>s.includes(O.name)),L={v1:"configs/stable-diffusion/v1-inference.yaml",v2:"configs/stable-diffusion/v2-inference-v.yaml",inpainting:"configs/stable-diffusion/v1-inpainting-inference.yaml",custom:p};T==null||T.forEach(O=>{const D={name:O.name,description:"",config:L[u],weights:O.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(y2(D))}),l([])},k=()=>{const T=[],L=[];return r&&r.forEach((O,D)=>{i.includes(O.location)?L.push(g.jsx(bj,{model:O,modelsToAdd:s,setModelsToAdd:l},D)):T.push(g.jsx(bj,{model:O,modelsToAdd:s,setModelsToAdd:l},D))}),g.jsxs(g.Fragment,{children:[T,o&&L]})};return g.jsxs(g.Fragment,{children:[n?g.jsxs(ke,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[g.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelManager.checkpointFolder")}),g.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),g.jsx(Ke,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:g.jsx(p4,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(PI(n))}),g.jsx(Ke,{"aria-label":t("modelManager.clearCheckpointFolder"),icon:g.jsx(b2,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:y})]}):g.jsx(P2,{initialValues:{checkpointFolder:""},onSubmit:T=>{b(T)},children:({handleSubmit:T})=>g.jsx("form",{onSubmit:T,children:g.jsxs(u2,{columnGap:"0.5rem",children:[g.jsx(sn,{isRequired:!0,width:"max-content",children:g.jsx(ur,{as:qn,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelManager.checkpointFolder")})}),g.jsx(Ke,{icon:g.jsx(e7e,{}),"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),type:"submit",disabled:a})]})})}),r&&g.jsxs(ke,{flexDirection:"column",rowGap:"1rem",children:[g.jsxs(ke,{justifyContent:"space-between",alignItems:"center",children:[g.jsxs("p",{children:[t("modelManager.modelsFound"),": ",r.length]}),g.jsxs("p",{children:[t("modelManager.selected"),": ",s.length]})]}),g.jsxs(ke,{columnGap:"0.5rem",justifyContent:"space-between",children:[g.jsxs(ke,{columnGap:"0.5rem",children:[g.jsx(On,{isDisabled:s.length===r.length,onClick:w,children:t("modelManager.selectAll")}),g.jsx(On,{isDisabled:s.length===0,onClick:E,children:t("modelManager.deselectAll")}),g.jsx(Gn,{label:t("modelManager.showExisting"),isChecked:o,onChange:()=>e(j4e(!o))})]}),g.jsx(On,{isDisabled:s.length===0,onClick:_,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelManager.addSelected")})]}),g.jsxs(ke,{gap:4,backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.2rem",flexDirection:"column",children:[g.jsxs(ke,{gap:4,children:[g.jsx(It,{fontWeight:"bold",color:"var(--text-color-secondary)",children:"Pick Model Type:"}),g.jsx(Oy,{value:u,onChange:T=>d(T),defaultValue:"v1",name:"model_type",children:g.jsxs(ke,{gap:4,children:[g.jsx(Uo,{value:"v1",children:t("modelManager.v1")}),g.jsx(Uo,{value:"v2",children:t("modelManager.v2")}),g.jsx(Uo,{value:"inpainting",children:t("modelManager.inpainting")}),g.jsx(Uo,{value:"custom",children:t("modelManager.customConfig")})]})})]}),u==="custom"&&g.jsxs(ke,{flexDirection:"column",rowGap:2,children:[g.jsx(It,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:t("modelManager.pathToCustomConfig")}),g.jsx(qn,{value:p,onChange:T=>{T.target.value!==""&&m(T.target.value)},width:"42.5rem"})]})]}),g.jsxs(ke,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&g.jsx(It,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelManager.selectAndAdd")}):g.jsx(It,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelManager.noModelsFound")}),k()]})]})]})}const xj=64,Sj=2048;function Wje(){const e=Le(),{t}=De(),n=le(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function i(u){let d;return r(u)&&(d=t("modelManager.cannotUseSpaces")),d}const o={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=u=>{e(y2(u)),e(Bh(null))},[s,l]=qe.useState(!1);return g.jsxs(g.Fragment,{children:[g.jsx(Ke,{"aria-label":t("common.back"),tooltip:t("common.back"),onClick:()=>e(Bh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:g.jsx(HU,{})}),g.jsx(Hje,{}),g.jsx(Gn,{label:t("modelManager.addManually"),isChecked:s,onChange:()=>l(!s)}),s&&g.jsx(P2,{initialValues:o,onSubmit:a,children:({handleSubmit:u,errors:d,touched:p})=>g.jsx("form",{onSubmit:u,children:g.jsxs(hn,{rowGap:"0.5rem",children:[g.jsx(It,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelManager.manual")}),g.jsxs(sn,{isInvalid:!!d.name&&p.name,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"name",name:"name",type:"text",validate:i,width:"2xl"}),d.name&&p.name?g.jsx(lr,{children:d.name}):g.jsx(sr,{margin:0,children:t("modelManager.nameValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!d.description&&p.description,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"description",name:"description",type:"text",width:"2xl"}),d.description&&p.description?g.jsx(lr,{children:d.description}):g.jsx(sr,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!d.config&&p.config,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"config",fontSize:"sm",children:t("modelManager.config")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"config",name:"config",type:"text",width:"2xl"}),d.config&&p.config?g.jsx(lr,{children:d.config}):g.jsx(sr,{margin:0,children:t("modelManager.configValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!d.weights&&p.weights,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"config",fontSize:"sm",children:t("modelManager.modelLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"weights",name:"weights",type:"text",width:"2xl"}),d.weights&&p.weights?g.jsx(lr,{children:d.weights}):g.jsx(sr,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!d.vae&&p.vae,children:[g.jsx(Sn,{htmlFor:"vae",fontSize:"sm",children:t("modelManager.vaeLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae",name:"vae",type:"text",width:"2xl"}),d.vae&&p.vae?g.jsx(lr,{children:d.vae}):g.jsx(sr,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),g.jsxs(u2,{width:"100%",children:[g.jsxs(sn,{isInvalid:!!d.width&&p.width,children:[g.jsx(Sn,{htmlFor:"width",fontSize:"sm",children:t("modelManager.width")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{id:"width",name:"width",children:({field:m,form:y})=>g.jsx(lc,{id:"width",name:"width",min:xj,max:Sj,step:64,width:"90%",value:y.values.width,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.width&&p.width?g.jsx(lr,{children:d.width}):g.jsx(sr,{margin:0,children:t("modelManager.widthValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!d.height&&p.height,children:[g.jsx(Sn,{htmlFor:"height",fontSize:"sm",children:t("modelManager.height")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{id:"height",name:"height",children:({field:m,form:y})=>g.jsx(lc,{id:"height",name:"height",min:xj,max:Sj,width:"90%",step:64,value:y.values.height,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.height&&p.height?g.jsx(lr,{children:d.height}):g.jsx(sr,{margin:0,children:t("modelManager.heightValidationMsg")})]})]})]}),g.jsx(On,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelManager.addModel")})]})})})]})}function Tx({children:e}){return g.jsx(ke,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:e})}function Vje(){const e=Le(),{t}=De(),n=le(s=>s.system.isProcessing);function r(s){return/\s/.test(s)}function i(s){let l;return r(s)&&(l=t("modelManager.cannotUseSpaces")),l}const o={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=s=>{const l=s;s.path===""&&delete l.path,s.repo_id===""&&delete l.repo_id,s.vae.path===""&&delete l.vae.path,s.vae.repo_id===""&&delete l.vae.repo_id,e(y2(l)),e(Bh(null))};return g.jsxs(ke,{children:[g.jsx(Ke,{"aria-label":t("common.back"),tooltip:t("common.back"),onClick:()=>e(Bh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:g.jsx(HU,{})}),g.jsx(P2,{initialValues:o,onSubmit:a,children:({handleSubmit:s,errors:l,touched:u})=>{var d,p,m,y,b,w,E,_,k,T;return g.jsx("form",{onSubmit:s,children:g.jsxs(hn,{rowGap:"0.5rem",children:[g.jsx(Tx,{children:g.jsxs(sn,{isInvalid:!!l.name&&u.name,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"name",name:"name",type:"text",validate:i,width:"2xl",isRequired:!0}),l.name&&u.name?g.jsx(lr,{children:l.name}):g.jsx(sr,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),g.jsx(Tx,{children:g.jsxs(sn,{isInvalid:!!l.description&&u.description,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),l.description&&u.description?g.jsx(lr,{children:l.description}):g.jsx(sr,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),g.jsxs(Tx,{children:[g.jsx(It,{fontWeight:"bold",fontSize:"sm",children:t("modelManager.formMessageDiffusersModelLocation")}),g.jsx(It,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelManager.formMessageDiffusersModelLocationDesc")}),g.jsxs(sn,{isInvalid:!!l.path&&u.path,children:[g.jsx(Sn,{htmlFor:"path",fontSize:"sm",children:t("modelManager.modelLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"path",name:"path",type:"text",width:"2xl"}),l.path&&u.path?g.jsx(lr,{children:l.path}):g.jsx(sr,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!l.repo_id&&u.repo_id,children:[g.jsx(Sn,{htmlFor:"repo_id",fontSize:"sm",children:t("modelManager.repo_id")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),l.repo_id&&u.repo_id?g.jsx(lr,{children:l.repo_id}):g.jsx(sr,{margin:0,children:t("modelManager.repoIDValidationMsg")})]})]})]}),g.jsxs(Tx,{children:[g.jsx(It,{fontWeight:"bold",children:t("modelManager.formMessageDiffusersVAELocation")}),g.jsx(It,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelManager.formMessageDiffusersVAELocationDesc")}),g.jsxs(sn,{isInvalid:!!((d=l.vae)!=null&&d.path)&&((p=u.vae)==null?void 0:p.path),children:[g.jsx(Sn,{htmlFor:"vae.path",fontSize:"sm",children:t("modelManager.vaeLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(m=l.vae)!=null&&m.path&&((y=u.vae)!=null&&y.path)?g.jsx(lr,{children:(b=l.vae)==null?void 0:b.path}):g.jsx(sr,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!((w=l.vae)!=null&&w.repo_id)&&((E=u.vae)==null?void 0:E.repo_id),children:[g.jsx(Sn,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelManager.vaeRepoID")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(_=l.vae)!=null&&_.repo_id&&((k=u.vae)!=null&&k.repo_id)?g.jsx(lr,{children:(T=l.vae)==null?void 0:T.repo_id}):g.jsx(sr,{margin:0,children:t("modelManager.vaeRepoIDValidationMsg")})]})]})]}),g.jsx(On,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelManager.addModel")})]})})}})]})}function wj({text:e,onClick:t}){return g.jsx(ke,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:t,children:g.jsx(It,{fontWeight:"bold",children:e})})}function Uje(){const{isOpen:e,onOpen:t,onClose:n}=Kd(),r=le(s=>s.ui.addNewModelUIOption),i=Le(),{t:o}=De(),a=()=>{n(),i(Bh(null))};return g.jsxs(g.Fragment,{children:[g.jsx(On,{"aria-label":o("modelManager.addNewModel"),tooltip:o("modelManager.addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:g.jsxs(ke,{columnGap:"0.5rem",alignItems:"center",children:[g.jsx(b2,{}),o("modelManager.addNew")]})}),g.jsxs(Yd,{isOpen:e,onClose:a,size:"3xl",closeOnOverlayClick:!1,children:[g.jsx(oc,{}),g.jsxs(Xd,{className:"modal add-model-modal",fontFamily:"Inter",margin:"auto",children:[g.jsx(op,{children:o("modelManager.addNewModel")}),g.jsx(g0,{marginTop:"0.3rem"}),g.jsxs(Xm,{className:"add-model-modal-body",children:[r==null&&g.jsxs(ke,{columnGap:"1rem",children:[g.jsx(wj,{text:o("modelManager.addCheckpointModel"),onClick:()=>i(Bh("ckpt"))}),g.jsx(wj,{text:o("modelManager.addDiffuserModel"),onClick:()=>i(Bh("diffusers"))})]}),r=="ckpt"&&g.jsx(Wje,{}),r=="diffusers"&&g.jsx(Vje,{})]})]})]})]})}function Mx(e){const{isProcessing:t,isConnected:n}=le(y=>y.system),r=le(y=>y.system.openModel),{t:i}=De(),o=Le(),{name:a,status:s,description:l}=e,u=()=>{o(jU(a))},d=()=>{o(UR(a))},p=()=>{o(c_e(a)),o(UR(null))},m=()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}};return g.jsxs(ke,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[g.jsx(ao,{onClick:d,cursor:"pointer",children:g.jsx(si,{label:l,hasArrow:!0,placement:"bottom",children:g.jsx(It,{fontWeight:"bold",children:a})})}),g.jsx(iH,{onClick:d,cursor:"pointer"}),g.jsxs(ke,{gap:2,alignItems:"center",children:[g.jsx(It,{color:m(),children:s}),g.jsx(ss,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelManager.load")}),g.jsx(Ke,{icon:g.jsx(Bke,{}),size:"sm",onClick:d,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),g.jsx(k4,{title:i("modelManager.deleteModel"),acceptCallback:p,acceptButtonText:i("modelManager.delete"),triggerComponent:g.jsx(Ke,{icon:g.jsx(zke,{}),size:"sm","aria-label":i("modelManager.deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:g.jsxs(ke,{rowGap:"1rem",flexDirection:"column",children:[g.jsx("p",{style:{fontWeight:"bold"},children:i("modelManager.deleteMsg1")}),g.jsx("p",{style:{color:"var(--text-color-secondary"},children:i("modelManager.deleteMsg2")})]})})]})]})}function Gje(){const e=Le(),{isOpen:t,onOpen:n,onClose:r}=Kd(),i=le(q_e),{t:o}=De(),[a,s]=S.useState(Object.keys(i)[0]),[l,u]=S.useState(Object.keys(i)[1]),[d,p]=S.useState("none"),[m,y]=S.useState(""),[b,w]=S.useState(.5),[E,_]=S.useState("weighted_sum"),[k,T]=S.useState("root"),[L,O]=S.useState(""),[D,I]=S.useState(!1),N=Object.keys(i).filter(z=>{if(z!==l&&z!==d)return z}),V=Object.keys(i).filter(z=>{if(z!==a&&z!==d)return z}),B=["none",...Object.keys(i).filter(z=>{if(z!==a&&z!==l)return z})],K=le(z=>z.system.isProcessing),ne=()=>{let z=[a,l,d];z=z.filter(H=>H!=="none");const $={models_to_merge:z,merged_model_name:m!==""?m:z.join("-"),alpha:b,interp:E,model_merge_save_path:k==="root"?null:L,force:D};e(f_e($))};return g.jsxs(g.Fragment,{children:[g.jsx(On,{onClick:n,className:"modal-close-btn",size:"sm",children:g.jsx(ke,{columnGap:"0.5rem",alignItems:"center",children:o("modelManager.mergeModels")})}),g.jsxs(Yd,{isOpen:t,onClose:r,size:"4xl",closeOnOverlayClick:!1,children:[g.jsx(oc,{}),g.jsxs(Xd,{className:"modal",fontFamily:"Inter",margin:"auto",children:[g.jsx(op,{children:o("modelManager.mergeModels")}),g.jsx(g0,{}),g.jsxs(ke,{flexDirection:"column",padding:"1rem",rowGap:4,children:[g.jsxs(ke,{flexDirection:"column",marginBottom:"1rem",padding:"1rem",borderRadius:"0.3rem",backgroundColor:"var(--background-color)",rowGap:1,children:[g.jsx(It,{children:o("modelManager.modelMergeHeaderHelp1")}),g.jsx(It,{fontSize:"0.9rem",color:"var(--text-color-secondary)",children:o("modelManager.modelMergeHeaderHelp2")})]}),g.jsxs(ke,{columnGap:4,children:[g.jsx(Jo,{label:o("modelManager.modelOne"),validValues:N,onChange:z=>s(z.target.value)}),g.jsx(Jo,{label:o("modelManager.modelTwo"),validValues:V,onChange:z=>u(z.target.value)}),g.jsx(Jo,{label:o("modelManager.modelThree"),validValues:B,onChange:z=>{z.target.value!=="none"?(p(z.target.value),_("add_difference")):(p("none"),_("weighted_sum"))}})]}),g.jsx(qn,{label:o("modelManager.mergedModelName"),value:m,onChange:z=>y(z.target.value)}),g.jsxs(ke,{flexDir:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.2rem",rowGap:2,children:[g.jsx(Dn,{label:o("modelManager.alpha"),min:.01,max:.99,step:.01,value:b,onChange:z=>w(z),withInput:!0,withReset:!0,handleReset:()=>w(.5),withSliderMarks:!0,sliderMarkRightOffset:-7}),g.jsx(It,{fontSize:"0.9rem",color:"var(--text-color-secondary)",children:o("modelManager.modelMergeAlphaHelp")})]}),g.jsxs(ke,{columnGap:4,backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.2rem",children:[g.jsx(It,{fontWeight:"bold",fontSize:"0.9rem",color:"var(--text-color-secondary)",children:o("modelManager.interpolationType")}),g.jsx(Oy,{value:E,onChange:z=>_(z),children:g.jsx(ke,{columnGap:4,children:d==="none"?g.jsxs(g.Fragment,{children:[g.jsx(Uo,{value:"weighted_sum",children:"weighted_sum"}),g.jsx(Uo,{value:"sigmoid",children:"sigmoid"}),g.jsx(Uo,{value:"inv_sigmoid",children:"inv_sigmoid"})]}):g.jsx(Uo,{value:"add_difference",children:g.jsx(si,{label:o("modelmanager:modelMergeInterpAddDifferenceHelp"),children:"add_difference"})})})})]}),g.jsxs(ke,{gap:4,flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.2rem",children:[g.jsxs(ke,{columnGap:4,children:[g.jsx(It,{fontWeight:"bold",fontSize:"0.9rem",color:"var(--text-color-secondary)",children:o("modelManager.mergedModelSaveLocation")}),g.jsx(Oy,{value:k,onChange:z=>T(z),children:g.jsxs(ke,{columnGap:4,children:[g.jsx(Uo,{value:"root",children:o("modelManager.invokeAIFolder")}),g.jsx(Uo,{value:"custom",children:o("modelManager.custom")})]})})]}),k==="custom"&&g.jsx(qn,{label:o("modelManager.mergedModelCustomSaveLocation"),value:L,onChange:z=>O(z.target.value)})]}),g.jsx(Gn,{label:o("modelManager.ignoreMismatch"),isChecked:D,onChange:z=>I(z.target.checked),fontWeight:"bold"}),g.jsx(On,{onClick:ne,isLoading:K,isDisabled:k==="custom"&&L==="",className:"modal modal-close-btn",children:o("modelManager.merge")})]})]})]})]})}const qje=lt(hr,e=>Te.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:Te.isEqual}});function g6({label:e,isActive:t,onClick:n}){return g.jsx(On,{onClick:n,isActive:t,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:e})}const Kje=()=>{const e=le(qje),[t,n]=qe.useState(!1);qe.useEffect(()=>{const m=setTimeout(()=>{n(!0)},200);return()=>clearTimeout(m)},[]);const[r,i]=S.useState(""),[o,a]=S.useState("all"),[s,l]=S.useTransition(),{t:u}=De(),d=m=>{l(()=>{i(m.target.value)})},p=S.useMemo(()=>{const m=[],y=[],b=[],w=[];return e.forEach((E,_)=>{E.name.toLowerCase().includes(r.toLowerCase())&&(b.push(g.jsx(Mx,{name:E.name,status:E.status,description:E.description},_)),E.format===o&&w.push(g.jsx(Mx,{name:E.name,status:E.status,description:E.description},_))),E.format!=="diffusers"?m.push(g.jsx(Mx,{name:E.name,status:E.status,description:E.description},_)):y.push(g.jsx(Mx,{name:E.name,status:E.status,description:E.description},_))}),r!==""?o==="all"?g.jsx(ao,{marginTop:"1rem",children:b}):g.jsx(ao,{marginTop:"1rem",children:w}):g.jsxs(ke,{flexDirection:"column",rowGap:"1.5rem",children:[o==="all"&&g.jsxs(g.Fragment,{children:[g.jsxs(ao,{children:[g.jsx(It,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:u("modelManager.checkpointModels")}),m]}),g.jsxs(ao,{children:[g.jsx(It,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:u("modelManager.diffusersModels")}),y]})]}),o==="ckpt"&&g.jsx(ke,{flexDirection:"column",marginTop:"1rem",children:m}),o==="diffusers"&&g.jsx(ke,{flexDirection:"column",marginTop:"1rem",children:y})]})},[e,r,u,o]);return g.jsxs(ke,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[g.jsxs(ke,{justifyContent:"space-between",children:[g.jsx(It,{fontSize:"1.4rem",fontWeight:"bold",children:u("modelManager.availableModels")}),g.jsxs(ke,{gap:2,children:[g.jsx(Uje,{}),g.jsx(Gje,{})]})]}),g.jsx(qn,{onChange:d,label:u("modelManager.search")}),g.jsxs(ke,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[g.jsxs(ke,{columnGap:"0.5rem",children:[g.jsx(g6,{label:u("modelManager.allModels"),onClick:()=>a("all"),isActive:o==="all"}),g.jsx(g6,{label:u("modelManager.checkpointModels"),onClick:()=>a("ckpt"),isActive:o==="ckpt"}),g.jsx(g6,{label:u("modelManager.diffusersModels"),onClick:()=>a("diffusers"),isActive:o==="diffusers"})]}),t?p:g.jsx(ke,{width:"100%",minHeight:"30rem",justifyContent:"center",alignItems:"center",children:g.jsx(h0,{})})]})]})};function Yje({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Kd(),i=le(s=>s.system.model_list),o=le(s=>s.system.openModel),{t:a}=De();return g.jsxs(g.Fragment,{children:[S.cloneElement(e,{onClick:n}),g.jsxs(Yd,{isOpen:t,onClose:r,size:"6xl",children:[g.jsx(oc,{}),g.jsxs(Xd,{className:"modal",fontFamily:"Inter",children:[g.jsx(g0,{className:"modal-close-btn"}),g.jsx(op,{fontWeight:"bold",children:a("modelManager.modelManager")}),g.jsxs(ke,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[g.jsx(Kje,{}),o&&i[o].format==="diffusers"?g.jsx(Bje,{}):g.jsx($je,{})]})]})]})]})}const Xje=lt([hr],e=>{const{isProcessing:t,model_list:n}=e;return{models:Te.map(n,(i,o)=>o),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),Zje=()=>{const e=Le(),{models:t,isProcessing:n}=le(Xje),r=le(WU),i=o=>{e(jU(o.target.value))};return g.jsx(ke,{style:{paddingLeft:"0.3rem"},children:g.jsx(Jo,{style:{fontSize:"0.8rem"},tooltip:r.description,isDisabled:n,value:r.name,validValues:t,onChange:i})})},Qje=lt([hr,fp],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l,shouldUseSliders:u}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:Te.map(o,(d,p)=>p),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l,shouldUseSliders:u}},{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),Jje=({children:e})=>{const t=Le(),{t:n}=De(),r=le(T=>T.generation.steps),{isOpen:i,onOpen:o,onClose:a}=Kd(),{isOpen:s,onOpen:l,onClose:u}=Kd(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:p,shouldDisplayGuides:m,saveIntermediatesInterval:y,enableImageDebugging:b,shouldUseCanvasBetaLayout:w,shouldUseSliders:E}=le(Qje),_=()=>{FU.purge().then(()=>{a(),l()})},k=T=>{T>r&&(T=r),T<1&&(T=1),t(w4e(T))};return g.jsxs(g.Fragment,{children:[S.cloneElement(e,{onClick:o}),g.jsxs(Yd,{isOpen:i,onClose:a,size:"lg",children:[g.jsx(oc,{}),g.jsxs(Xd,{className:"modal settings-modal",children:[g.jsx(op,{className:"settings-modal-header",children:n("common.settingsLabel")}),g.jsx(g0,{className:"modal-close-btn"}),g.jsxs(Xm,{className:"settings-modal-content",children:[g.jsxs("div",{className:"settings-modal-items",children:[g.jsxs("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[g.jsx(Jo,{label:n("settings.displayInProgress"),validValues:O5e,value:d,onChange:T=>t(h4e(T.target.value))}),d==="full-res"&&g.jsx(lc,{label:n("settings.saveSteps"),min:1,max:r,step:1,onChange:k,value:y,width:"auto",textAlign:"center"})]}),g.jsx(Ja,{styleClass:"settings-modal-item",label:n("settings.confirmOnDelete"),isChecked:p,onChange:T=>t(OV(T.target.checked))}),g.jsx(Ja,{styleClass:"settings-modal-item",label:n("settings.displayHelpIcons"),isChecked:m,onChange:T=>t(v4e(T.target.checked))}),g.jsx(Ja,{styleClass:"settings-modal-item",label:n("settings.useCanvasBeta"),isChecked:w,onChange:T=>t(D4e(T.target.checked))}),g.jsx(Ja,{styleClass:"settings-modal-item",label:n("settings.useSlidersForAll"),isChecked:E,onChange:T=>t(N4e(T.target.checked))})]}),g.jsxs("div",{className:"settings-modal-items",children:[g.jsx("h2",{style:{fontWeight:"bold"},children:"Developer"}),g.jsx(Ja,{styleClass:"settings-modal-item",label:n("settings.enableImageDebugging"),isChecked:b,onChange:T=>t(C4e(T.target.checked))})]}),g.jsxs("div",{className:"settings-modal-reset",children:[g.jsx(jh,{size:"md",children:n("settings.resetWebUI")}),g.jsx(ss,{colorScheme:"red",onClick:_,children:n("settings.resetWebUI")}),g.jsx(It,{children:n("settings.resetWebUIDesc1")}),g.jsx(It,{children:n("settings.resetWebUIDesc2")})]})]}),g.jsx(Hw,{children:g.jsx(ss,{onClick:a,className:"modal-close-btn",children:n("common.close")})})]})]}),g.jsxs(Yd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[g.jsx(oc,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),g.jsx(Xd,{children:g.jsx(Xm,{pb:6,pt:6,children:g.jsx(ke,{justifyContent:"center",children:g.jsx(It,{fontSize:"lg",children:g.jsx(It,{children:n("settings.resetComplete")})})})})})]})]})},eNe=lt(hr,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:Te.isEqual}}),tNe=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=le(eNe),s=Le(),{t:l}=De();let u;e&&!o?u="status-good":u="status-bad";let d=i;[l("common.statusGenerating"),l("common.statusPreparing"),l("common.statusSavingImage"),l("common.statusRestoringFaces"),l("common.statusUpscaling")].includes(d)&&(u="status-working"),d&&t&&r>1&&(d=`${l(d)} (${n}/${r})`);const m=o&&!a?"Click to clear, check logs for details":void 0,y=o&&!a?"pointer":"initial",b=()=>{(o||!a)&&s(RV())};return g.jsx(si,{label:m,children:g.jsx(It,{cursor:y,onClick:b,className:`status ${u}`,children:l(d)})})};function nNe(){const{t:e}=De(),{setColorMode:t,colorMode:n}=Jy(),r=Le(),i=le(l=>l.ui.currentTheme),o={dark:e("common.darkTheme"),light:e("common.lightTheme"),green:e("common.greenTheme")};S.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(L4e(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(g.jsx(On,{style:{width:"6rem"},leftIcon:i===u?g.jsx(FE,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ke,{"aria-label":e("common.themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:g.jsx(Eke,{})}),children:g.jsx(hn,{align:"stretch",children:s()})})}function rNe(){const{t:e,i18n:t}=De(),n={ar:e("common.langArabic",{lng:"ar"}),nl:e("common.langDutch",{lng:"nl"}),en:e("common.langEnglish",{lng:"en"}),fr:e("common.langFrench",{lng:"fr"}),de:e("common.langGerman",{lng:"de"}),it:e("common.langItalian",{lng:"it"}),ja:e("common.langJapanese",{lng:"ja"}),pl:e("common.langPolish",{lng:"pl"}),pt_Br:e("common.langBrPortuguese",{lng:"pt_Br"}),ru:e("common.langRussian",{lng:"ru"}),zh_Cn:e("common.langSimplifiedChinese",{lng:"zh_Cn"}),es:e("common.langSpanish",{lng:"es"}),uk:e("common.langUkranian",{lng:"ua"})},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(g.jsx(On,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ke,{"aria-label":e("common.languagePickerLabel"),tooltip:e("common.languagePickerLabel"),icon:g.jsx(Cke,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:g.jsx(hn,{children:r()})})}const iNe=()=>{const{t:e}=De(),t=le(n=>n.system.app_version);return g.jsxs("div",{className:"site-header",children:[g.jsxs("div",{className:"site-header-left-side",children:[g.jsx("img",{src:fq,alt:"invoke-ai-logo"}),g.jsxs(ke,{alignItems:"center",columnGap:"0.6rem",children:[g.jsxs(It,{fontSize:"1.4rem",children:["invoke ",g.jsx("strong",{children:"ai"})]}),g.jsx(It,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),g.jsxs("div",{className:"site-header-right-side",children:[g.jsx(tNe,{}),g.jsx(Zje,{}),g.jsx(Yje,{children:g.jsx(Ke,{"aria-label":e("modelManager.modelManager"),tooltip:e("modelManager.modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:g.jsx(gke,{})})}),g.jsx(WAe,{children:g.jsx(Ke,{"aria-label":e("common.hotkeysLabel"),tooltip:e("common.hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:g.jsx(wke,{})})}),g.jsx(nNe,{}),g.jsx(rNe,{}),g.jsx(Ke,{"aria-label":e("common.reportBugLabel"),tooltip:e("common.reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:g.jsx(Nh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:g.jsx(pke,{})})}),g.jsx(Ke,{"aria-label":e("common.githubLabel"),tooltip:e("common.githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:g.jsx(Nh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:g.jsx(uke,{})})}),g.jsx(Ke,{"aria-label":e("common.discordLabel"),tooltip:e("common.discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:g.jsx(Nh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:g.jsx(lke,{})})}),g.jsx(Jje,{children:g.jsx(Ke,{"aria-label":e("common.settingsLabel"),tooltip:e("common.settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:g.jsx(n7e,{})})})]})]})};function oNe(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const aNe=()=>{const e=Le(),t=le(G_e),n=s2();S.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(k4e())},[e,n,t])},sNe=()=>{const e=Le(),{shouldShowGalleryButton:t,shouldPinGallery:n}=le(iP),r=()=>{e(Am(!0)),n&&e(Li(!0))};return t?g.jsx(Ke,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:r,children:g.jsx(fG,{})}):null};oNe();const lNe=()=>(aNe(),g.jsxs("div",{className:"App",children:[g.jsxs(jAe,{children:[g.jsx(zAe,{}),g.jsxs("div",{className:"app-content",children:[g.jsx(iNe,{}),g.jsx(zLe,{})]}),g.jsx("div",{className:"app-console",children:g.jsx(FAe,{})})]}),g.jsx(VEe,{}),g.jsx(sNe,{})]})),Cj=()=>g.jsx(ke,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:g.jsx(h0,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})});const uNe=zj({key:"invokeai-style-cache",prepend:!0});ok.createRoot(document.getElementById("root")).render(g.jsx(qe.StrictMode,{children:g.jsx(fxe,{store:$U,children:g.jsx(mW,{loading:g.jsx(Cj,{}),persistor:FU,children:g.jsx(see,{value:uNe,children:g.jsx(Age,{children:g.jsx(qe.Suspense,{fallback:g.jsx(Cj,{}),children:g.jsx(lNe,{})})})})})})})); +`.replaceAll("black",e),rMe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=le(nMe),[a,s]=S.useState(null),[l,u]=S.useState(0),d=S.useRef(null),p=S.useCallback(()=>{u(l+1),setTimeout(p,500)},[l]);return S.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=TD(n)},[a,n]),S.useEffect(()=>{a&&(a.src=TD(n))},[a,n]),S.useEffect(()=>{const m=setInterval(()=>u(y=>(y+1)%5),50);return()=>clearInterval(m)},[]),!a||!Pe.isNumber(r.x)||!Pe.isNumber(r.y)||!Pe.isNumber(o)||!Pe.isNumber(i.width)||!Pe.isNumber(i.height)?null:g.jsx(cc,{ref:d,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:Pe.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},iMe=lt([rn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),oMe=e=>{const{...t}=e,{objects:n}=le(iMe);return g.jsx(uc,{listening:!1,...t,children:n.filter(gE).map((r,i)=>g.jsx(B3,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})};var sh=S,aMe=function(t,n,r){const i=sh.useRef("loading"),o=sh.useRef(),[a,s]=sh.useState(0),l=sh.useRef(),u=sh.useRef(),d=sh.useRef();return(l.current!==t||u.current!==n||d.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,d.current=r),sh.useLayoutEffect(function(){if(!t)return;var p=document.createElement("img");function m(){i.current="loaded",o.current=p,s(Math.random())}function y(){i.current="failed",o.current=void 0,s(Math.random())}return p.addEventListener("load",m),p.addEventListener("error",y),n&&(p.crossOrigin=n),r&&(p.referrerpolicy=r),p.src=t,function(){p.removeEventListener("load",m),p.removeEventListener("error",y)}},[t,n,r]),[o.current,i.current]};const wq=e=>{const{url:t,x:n,y:r}=e,[i]=aMe(t);return g.jsx(xq,{x:n,y:r,image:i,listening:!1})},sMe=lt([rn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),lMe=()=>{const{objects:e}=le(sMe);return e?g.jsx(uc,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(S3(t))return g.jsx(wq,{x:t.x,y:t.y,url:t.image.url},n);if(KSe(t)){const r=g.jsx(B3,{points:t.points,stroke:t.color?zh(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?g.jsx(uc,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(YSe(t))return g.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:zh(t.color)},n);if(XSe(t))return g.jsx(cc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},uMe=lt([rn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),cMe=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=le(uMe);return g.jsxs(uc,{...t,children:[r&&n&&g.jsx(wq,{url:n.image.url,x:o,y:a}),i&&g.jsxs(uc,{children:[g.jsx(cc,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),g.jsx(cc,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},dMe=lt([rn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),fMe=()=>{const e=Te(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=le(dMe),{t:o}=De(),a=S.useCallback(()=>{e(QO(!0))},[e]),s=S.useCallback(()=>{e(QO(!1))},[e]);Je(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),Je(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),Je(["enter"],()=>{d()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(a3e()),u=()=>e(o3e()),d=()=>e(n3e());return r?g.jsx(_e,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ye,{tooltip:`${o("unifiedCanvas.previous")} (Left)`,"aria-label":`${o("unifiedCanvas.previous")} (Left)`,icon:g.jsx(hke,{}),onClick:l,"data-selected":!0,isDisabled:t}),g.jsx(Ye,{tooltip:`${o("unifiedCanvas.next")} (Right)`,"aria-label":`${o("unifiedCanvas.next")} (Right)`,icon:g.jsx(pke,{}),onClick:u,"data-selected":!0,isDisabled:n}),g.jsx(Ye,{tooltip:`${o("unifiedCanvas.accept")} (Enter)`,"aria-label":`${o("unifiedCanvas.accept")} (Enter)`,icon:g.jsx(FE,{}),onClick:d,"data-selected":!0}),g.jsx(Ye,{tooltip:o("unifiedCanvas.showHide"),"aria-label":o("unifiedCanvas.showHide"),"data-alert":!i,icon:i?g.jsx(Ske,{}):g.jsx(xke,{}),onClick:()=>e(m3e(!i)),"data-selected":!0}),g.jsx(Ye,{tooltip:o("unifiedCanvas.saveToGallery"),"aria-label":o("unifiedCanvas.saveToGallery"),icon:g.jsx(zE,{}),onClick:()=>e(g_e(r.image.url)),"data-selected":!0}),g.jsx(Ye,{tooltip:o("unifiedCanvas.discardAll"),"aria-label":o("unifiedCanvas.discardAll"),icon:g.jsx(b2,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(r3e()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},cm=e=>Math.round(e*100)/100,hMe=lt([rn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${cm(n)}, ${cm(r)})`}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});function pMe(){const{cursorCoordinatesString:e}=le(hMe),{t}=De();return g.jsx("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const gMe=lt([rn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:d},stageScale:p,shouldShowCanvasDebugInfo:m,layer:y,boundingBoxScaleMethod:b,shouldPreserveMaskedArea:w}=e;let E="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(E="var(--status-working-color)"),{activeLayerColor:y==="mask"?"var(--status-working-color)":"inherit",activeLayerString:y.charAt(0).toUpperCase()+y.slice(1),boundingBoxColor:E,boundingBoxCoordinatesString:`(${cm(u)}, ${cm(d)})`,boundingBoxDimensionsString:`${o}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${cm(r)}×${cm(i)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(p*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none",shouldPreserveMaskedArea:w}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),mMe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:d,shouldShowBoundingBox:p,shouldPreserveMaskedArea:m}=le(gMe),{t:y}=De();return g.jsxs("div",{className:"canvas-status-text",children:[g.jsx("div",{style:{color:e},children:`${y("unifiedCanvas.activeLayer")}: ${t}`}),g.jsx("div",{children:`${y("unifiedCanvas.canvasScale")}: ${u}%`}),m&&g.jsx("div",{style:{color:"var(--status-working-color)"},children:"Preserve Masked Area: On"}),p&&g.jsx("div",{style:{color:n},children:`${y("unifiedcanvas:boundingBox")}: ${i}`}),a&&g.jsx("div",{style:{color:n},children:`${y("unifiedcanvas:scaledBoundingBox")}: ${o}`}),d&&g.jsxs(g.Fragment,{children:[g.jsx("div",{children:`${y("unifiedcanvas:boundingBoxPosition")}: ${r}`}),g.jsx("div",{children:`${y("unifiedcanvas:canvasDimensions")}: ${l}`}),g.jsx("div",{children:`${y("unifiedcanvas:canvasPosition")}: ${s}`}),g.jsx(pMe,{})]})]})},vMe=lt(rn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),yMe=e=>{const{...t}=e,n=Te(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:d,hitStrokeWidth:p}=le(vMe),m=S.useRef(null),y=S.useRef(null),[b,w]=S.useState(!1);S.useEffect(()=>{var ne;!m.current||!y.current||(m.current.nodes([y.current]),(ne=m.current.getLayer())==null||ne.batchDraw())},[]);const E=64*l,_=S.useCallback(ne=>{if(!u){n(DC({x:Math.floor(ne.target.x()),y:Math.floor(ne.target.y())}));return}const z=ne.target.x(),$=ne.target.y(),H=Hl(z,64),Y=Hl($,64);ne.target.x(H),ne.target.y(Y),n(DC({x:H,y:Y}))},[n,u]),k=S.useCallback(()=>{if(!y.current)return;const ne=y.current,z=ne.scaleX(),$=ne.scaleY(),H=Math.round(ne.width()*z),Y=Math.round(ne.height()*$),Q=Math.round(ne.x()),q=Math.round(ne.y());n(p1({width:H,height:Y})),n(DC({x:u?Cd(Q,64):Q,y:u?Cd(q,64):q})),ne.scaleX(1),ne.scaleY(1)},[n,u]),T=S.useCallback((ne,z,$)=>{const H=ne.x%E,Y=ne.y%E;return{x:Cd(z.x,E)+H,y:Cd(z.y,E)+Y}},[E]),L=()=>{n(NC(!0))},O=()=>{n(NC(!1)),n(jC(!1)),n(Jb(!1)),w(!1)},D=()=>{n(jC(!0))},I=()=>{n(NC(!1)),n(jC(!1)),n(Jb(!1)),w(!1)},N=()=>{w(!0)},U=()=>{!s&&!a&&w(!1)},B=()=>{n(Jb(!0))},K=()=>{n(Jb(!1))};return g.jsxs(uc,{...t,children:[g.jsx(cc,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:B,onMouseOver:B,onMouseLeave:K,onMouseOut:K}),g.jsx(cc,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:p,listening:!o&&d==="move",onDragStart:D,onDragEnd:I,onDragMove:_,onMouseDown:D,onMouseOut:U,onMouseOver:N,onMouseEnter:N,onMouseUp:I,onTransform:k,onTransformEnd:O,ref:y,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),g.jsx(ITe,{anchorCornerRadius:3,anchorDragBoundFunc:T,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:d==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&d==="move",onDragStart:D,onDragEnd:I,onMouseDown:L,onMouseUp:O,onTransformEnd:O,ref:m,rotateEnabled:!1})]})},bMe=lt(rn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:d,stageScale:p,stageDimensions:m,boundingBoxCoordinates:y,boundingBoxDimensions:b,shouldRestrictStrokesToBox:w}=e,E=w?{clipX:y.x,clipY:y.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:XO/p,colorPickerInnerRadius:(XO-mk+1)/p,maskColorString:zh({...i,a:.5}),brushColorString:zh(o),colorPickerColorString:zh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||d||!t)&&l,strokeWidth:1.5/p,dotRadius:1.5/p,clip:E}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),xMe=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:d,brushColorString:p,colorPickerColorString:m,colorPickerInnerRadius:y,colorPickerOuterRadius:b,clip:w}=le(bMe);return l?g.jsxs(uc,{listening:!1,...w,...t,children:[a==="colorPicker"?g.jsxs(g.Fragment,{children:[g.jsx(ah,{x:n,y:r,radius:b,stroke:p,strokeWidth:mk,strokeScaleEnabled:!1}),g.jsx(ah,{x:n,y:r,radius:y,stroke:m,strokeWidth:mk,strokeScaleEnabled:!1})]}):g.jsxs(g.Fragment,{children:[g.jsx(ah,{x:n,y:r,radius:i,fill:s==="mask"?o:p,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),g.jsx(ah,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:d*2,strokeEnabled:!0,listening:!1}),g.jsx(ah,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:d,strokeEnabled:!0,listening:!1})]}),g.jsx(ah,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),g.jsx(ah,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},SMe=lt([rn,Lr],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:d,isMovingStage:p,shouldShowIntermediates:m,shouldShowGrid:y,shouldRestrictStrokesToBox:b}=e;let w="none";return d==="move"||t?p?w="grabbing":w="grab":o?w=void 0:b&&!a&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:y,stageCoordinates:u,stageCursor:w,stageDimensions:l,stageScale:r,tool:d,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),Cq=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:d}=le(SMe);FTe();const p=S.useRef(null),m=S.useRef(null),y=S.useCallback(U=>{q6e(U),p.current=U},[]),b=S.useCallback(U=>{G6e(U),m.current=U},[]),w=S.useRef({x:0,y:0}),E=S.useRef(!1),_=KTe(p),k=zTe(p),T=GTe(p,E),L=WTe(p,E,w),O=UTe(),{handleDragStart:D,handleDragMove:I,handleDragEnd:N}=NTe();return g.jsx("div",{className:"inpainting-canvas-container",children:g.jsxs("div",{className:"inpainting-canvas-wrapper",children:[g.jsxs(DTe,{tabIndex:-1,ref:y,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:k,onTouchMove:L,onTouchEnd:T,onMouseDown:k,onMouseLeave:O,onMouseMove:L,onMouseUp:T,onDragStart:D,onDragMove:I,onDragEnd:N,onContextMenu:U=>U.evt.preventDefault(),onWheel:_,draggable:(l==="move"||u)&&!t,children:[g.jsx(t1,{id:"grid",visible:r,children:g.jsx(JTe,{})}),g.jsx(t1,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:g.jsx(lMe,{})}),g.jsxs(t1,{id:"mask",visible:e,listening:!1,children:[g.jsx(oMe,{visible:!0,listening:!1}),g.jsx(rMe,{listening:!1})]}),g.jsx(t1,{children:g.jsx(XTe,{})}),g.jsxs(t1,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&g.jsx(xMe,{visible:l!=="move",listening:!1}),g.jsx(cMe,{visible:u}),d&&g.jsx(tMe,{}),g.jsx(yMe,{visible:n&&!u})]})]}),g.jsx(mMe,{}),g.jsx(fMe,{})]})})},wMe=lt(rn,aG,Br,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),_q=()=>{const e=Te(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=le(wMe),o=S.useRef(null);return S.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(d3e({width:a,height:s})),e(i?u3e():i4()),e(Li(!1))},0)},[e,r,t,n,i]),g.jsx("div",{ref:o,className:"inpainting-canvas-area",children:g.jsx(h0,{thickness:"2px",speed:"1s",size:"xl"})})},CMe=lt([rn,Br,hr],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});function kq(){const e=Te(),{canRedo:t,activeTabName:n}=le(CMe),{t:r}=De(),i=()=>{e(s3e())};return Je(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),g.jsx(Ye,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:g.jsx(Oke,{}),onClick:i,isDisabled:!t})}const _Me=lt([rn,Br,hr],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});function Eq(){const e=Te(),{t}=De(),{canUndo:n,activeTabName:r}=le(_Me),i=()=>{e(y3e())};return Je(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),g.jsx(Ye,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:g.jsx(jke,{}),onClick:i,isDisabled:!n})}const kMe=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");o&&(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},EMe=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},PMe=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),d=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:a,y:s,width:l,height:u},p=e.toDataURL(d);return e.scale(i),{dataURL:p,boundingBox:{x:o.x,y:o.y,width:l,height:u}}},TMe={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Td=(e=TMe)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(T4e("Exporting Image")),t(_d(!1));const u=n(),{stageScale:d,boundingBoxCoordinates:p,boundingBoxDimensions:m,stageCoordinates:y}=u.canvas,b=Qs();if(!b){t(wa(!1)),t(_d(!0));return}const{dataURL:w,boundingBox:E}=PMe(b,d,y,i?{...p,...m}:void 0);if(!w){t(wa(!1)),t(_d(!0));return}const _=new FormData;_.append("data",JSON.stringify({dataURL:w,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const T=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:_})).json(),{url:L,width:O,height:D}=T,I={uuid:um(),category:o?"result":"user",...T};a&&(EMe(L),t($u({title:Et.t("toast.downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(kMe(L,O,D),t($u({title:Et.t("toast.imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(sm({image:I,category:"result"})),t($u({title:Et.t("toast.imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(p3e({kind:"image",layer:"base",...E,image:I})),t($u({title:Et.t("toast.canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(wa(!1)),t(hh(Et.t("common.statusConnected"))),t(_d(!0))};function MMe(){const e=le(Lr),t=Qs(),n=le(s=>s.system.isProcessing),r=le(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Te(),{t:o}=De();Je(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Td({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return g.jsx(Ye,{"aria-label":`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:g.jsx(Jm,{}),onClick:a,isDisabled:e})}function LMe(){const e=Te(),{t}=De(),n=Qs(),r=le(Lr),i=le(s=>s.system.isProcessing),o=le(s=>s.canvas.shouldCropToBoundingBoxOnSave);Je(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(Td({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return g.jsx(Ye,{"aria-label":`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:g.jsx(BE,{}),onClick:a,isDisabled:r})}function AMe(){const e=le(Lr),{openUploader:t}=DE(),{t:n}=De();return g.jsx(Ye,{"aria-label":n("common.upload"),tooltip:n("common.upload"),icon:g.jsx(g4,{}),onClick:t,isDisabled:e})}const OMe=lt([rn,Lr],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});function RMe(){const e=Te(),{t}=De(),{layer:n,isMaskEnabled:r,isStaging:i}=le(OMe),o=()=>{e(C3(n==="mask"?"base":"mask"))};Je(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(C3(l)),l==="mask"&&!r&&e(p2(!0))};return g.jsx(Jo,{tooltip:`${t("unifiedCanvas.layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:jW,onChange:a,isDisabled:i})}function IMe(){const e=Te(),{t}=De(),n=Qs(),r=le(Lr),i=le(a=>a.system.isProcessing);Je(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(Td({cropVisible:!1,shouldSetAsInitialImage:!0}))};return g.jsx(Ye,{"aria-label":`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:g.jsx(iG,{}),onClick:o,isDisabled:r})}function DMe(){const e=le(o=>o.canvas.tool),t=le(Lr),n=Te(),{t:r}=De();Je(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(Jl("move"));return g.jsx(Ye,{"aria-label":`${r("unifiedCanvas.move")} (V)`,tooltip:`${r("unifiedCanvas.move")} (V)`,icon:g.jsx(QV,{}),"data-selected":e==="move"||t,onClick:i})}function jMe(){const e=le(i=>i.ui.shouldPinParametersPanel),t=Te(),{t:n}=De(),r=()=>{t(Fh(!0)),e&&setTimeout(()=>t(Li(!0)),400)};return g.jsxs(_e,{flexDirection:"column",gap:"0.5rem",children:[g.jsx(Ye,{tooltip:`${n("parameters.showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("parameters.showOptionsPanel"),onClick:r,children:g.jsx(HE,{})}),g.jsx(_e,{children:g.jsx(rP,{iconButton:!0})}),g.jsx(_e,{children:g.jsx(tP,{width:"100%",height:"40px",btnGroupWidth:"100%"})})]})}function NMe(){const e=Te(),{t}=De(),n=le(Lr),r=()=>{e(vE()),e(i4())};return g.jsx(Ye,{"aria-label":t("unifiedCanvas.clearCanvas"),tooltip:t("unifiedCanvas.clearCanvas"),icon:g.jsx(hp,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function Pq(e,t,n=250){const[r,i]=S.useState(0);return S.useEffect(()=>{const o=setTimeout(()=>{r===1&&e(),i(0)},n);return r===2&&t(),()=>clearTimeout(o)},[r,e,t,n]),()=>i(o=>o+1)}function $Me(){const e=Qs(),t=Te(),{t:n}=De();Je(["r"],()=>{i()},{enabled:()=>!0,preventDefault:!0},[e]);const r=Pq(()=>i(!1),()=>i(!0)),i=(o=!1)=>{const a=Qs();if(!a)return;const s=a.getClientRect({skipTransform:!0});t(HW({contentRect:s,shouldScaleTo1:o}))};return g.jsx(Ye,{"aria-label":`${n("unifiedCanvas.resetView")} (R)`,tooltip:`${n("unifiedCanvas.resetView")} (R)`,icon:g.jsx(eG,{}),onClick:r})}function FMe(){const e=le(Lr),t=Qs(),n=le(s=>s.system.isProcessing),r=le(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Te(),{t:o}=De();Je(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Td({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return g.jsx(Ye,{"aria-label":`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:g.jsx(zE,{}),onClick:a,isDisabled:e})}const BMe=lt([rn,Lr,hr],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),zMe=()=>{const e=Te(),{t}=De(),{tool:n,isStaging:r}=le(BMe);Je(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),Je(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),Je(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),Je(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),Je(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(Jl("brush")),o=()=>e(Jl("eraser")),a=()=>e(Jl("colorPicker")),s=()=>e(FW()),l=()=>e($W());return g.jsxs(_e,{flexDirection:"column",gap:"0.5rem",children:[g.jsxs(Gi,{children:[g.jsx(Ye,{"aria-label":`${t("unifiedCanvas.brush")} (B)`,tooltip:`${t("unifiedCanvas.brush")} (B)`,icon:g.jsx(oG,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),g.jsx(Ye,{"aria-label":`${t("unifiedCanvas.eraser")} (E)`,tooltip:`${t("unifiedCanvas.eraser")} (B)`,icon:g.jsx(tG,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),g.jsxs(Gi,{children:[g.jsx(Ye,{"aria-label":`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:g.jsx(rG,{}),isDisabled:r,onClick:s}),g.jsx(Ye,{"aria-label":`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:g.jsx(b2,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),g.jsx(Ye,{"aria-label":`${t("unifiedCanvas.colorPicker")} (C)`,tooltip:`${t("unifiedCanvas.colorPicker")} (C)`,icon:g.jsx(nG,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},k4=Ze((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:d,onClose:p}=Kd(),m=S.useRef(null),y=()=>{r(),p()},b=()=>{o&&o(),p()};return g.jsxs(g.Fragment,{children:[S.cloneElement(l,{onClick:d,ref:t}),g.jsx(BH,{isOpen:u,leastDestructiveRef:m,onClose:p,children:g.jsx(oc,{children:g.jsxs(zH,{className:"modal",children:[g.jsx(op,{fontSize:"lg",fontWeight:"bold",children:s}),g.jsx(Xm,{children:a}),g.jsxs(Hw,{children:[g.jsx(ss,{ref:m,onClick:b,className:"modal-close-btn",children:i}),g.jsx(ss,{colorScheme:"red",onClick:y,ml:3,children:n})]})]})})})]})}),Tq=()=>{const e=le(Lr),t=Te(),{t:n}=De(),r=()=>{t(m_e()),t(vE()),t(zW())};return g.jsxs(k4,{title:n("unifiedCanvas.emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedCanvas.emptyFolder"),triggerComponent:g.jsx(On,{leftIcon:g.jsx(hp,{}),size:"sm",isDisabled:e,children:n("unifiedCanvas.emptyTempImageFolder")}),children:[g.jsx("p",{children:n("unifiedCanvas.emptyTempImagesFolderMessage")}),g.jsx("br",{}),g.jsx("p",{children:n("unifiedCanvas.emptyTempImagesFolderConfirm")})]})},Mq=()=>{const e=le(Lr),t=Te(),{t:n}=De();return g.jsxs(k4,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(zW()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:g.jsx(On,{size:"sm",leftIcon:g.jsx(hp,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[g.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),g.jsx("br",{}),g.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},HMe=lt([rn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),WMe=()=>{const e=Te(),{t}=De(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=le(HMe);return g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ye,{tooltip:t("unifiedCanvas.canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedCanvas.canvasSettings"),icon:g.jsx(WE,{})}),children:g.jsxs(_e,{direction:"column",gap:"0.5rem",children:[g.jsx(Gn,{label:t("unifiedCanvas.showIntermediates"),isChecked:o,onChange:a=>e(ZW(a.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:a=>e(VW(a.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:a=>e(GW(a.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:i,onChange:a=>e(YW(a.target.checked))}),g.jsx(Mq,{}),g.jsx(Tq,{})]})})},UMe=()=>{const e=le(t=>t.ui.shouldShowParametersPanel);return g.jsxs(_e,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[g.jsx(RMe,{}),g.jsx(zMe,{}),g.jsxs(_e,{gap:"0.5rem",children:[g.jsx(DMe,{}),g.jsx($Me,{})]}),g.jsxs(_e,{columnGap:"0.5rem",children:[g.jsx(IMe,{}),g.jsx(FMe,{})]}),g.jsxs(_e,{columnGap:"0.5rem",children:[g.jsx(MMe,{}),g.jsx(LMe,{})]}),g.jsxs(_e,{gap:"0.5rem",children:[g.jsx(Eq,{}),g.jsx(kq,{})]}),g.jsxs(_e,{gap:"0.5rem",children:[g.jsx(AMe,{}),g.jsx(NMe,{})]}),g.jsx(WMe,{}),!e&&g.jsx(jMe,{})]})};function VMe(){const e=Te(),t=le(i=>i.canvas.brushSize),{t:n}=De(),r=le(Lr);return Je(["BracketLeft"],()=>{e(Lm(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),Je(["BracketRight"],()=>{e(Lm(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),g.jsx(Dn,{label:n("unifiedCanvas.brushSize"),value:t,withInput:!0,onChange:i=>e(Lm(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function E4(){return(E4=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function l7(e){var t=S.useRef(e),n=S.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var n0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:E.buttons>0)&&i.current?o(MD(i.current,E,s.current)):w(!1)},b=function(){return w(!1)};function w(E){var _=l.current,k=u7(i.current),T=E?k.addEventListener:k.removeEventListener;T(_?"touchmove":"mousemove",y),T(_?"touchend":"mouseup",b)}return[function(E){var _=E.nativeEvent,k=i.current;if(k&&(LD(_),!function(L,O){return O&&!X1(L)}(_,l.current)&&k)){if(X1(_)){l.current=!0;var T=_.changedTouches||[];T.length&&(s.current=T[0].identifier)}k.focus(),o(MD(k,_,s.current)),w(!0)}},function(E){var _=E.which||E.keyCode;_<37||_>40||(E.preventDefault(),a({left:_===39?.05:_===37?-.05:0,top:_===40?.05:_===38?-.05:0}))},w]},[a,o]),d=u[0],p=u[1],m=u[2];return S.useEffect(function(){return m},[m]),Ke.createElement("div",E4({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:p,tabIndex:0,role:"slider"}))}),P4=function(e){return e.filter(Boolean).join(" ")},xP=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=P4(["react-colorful__pointer",e.className]);return Ke.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},Ke.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Co=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},Aq=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Co(e.h),s:Co(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Co(i/2),a:Co(r,2)}},c7=function(e){var t=Aq(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},l6=function(e){var t=Aq(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},GMe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:Co(255*[r,s,a,a,l,r][u]),g:Co(255*[l,r,r,s,a,a][u]),b:Co(255*[a,a,l,r,r,s][u]),a:Co(i,2)}},qMe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Co(60*(s<0?s+6:s)),s:Co(o?a/o*100:0),v:Co(o/255*100),a:i}},KMe=Ke.memo(function(e){var t=e.hue,n=e.onChange,r=P4(["react-colorful__hue",e.className]);return Ke.createElement("div",{className:r},Ke.createElement(bP,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:n0(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Co(t),"aria-valuemax":"360","aria-valuemin":"0"},Ke.createElement(xP,{className:"react-colorful__hue-pointer",left:t/360,color:c7({h:t,s:100,v:100,a:1})})))}),YMe=Ke.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:c7({h:t.h,s:100,v:100,a:1})};return Ke.createElement("div",{className:"react-colorful__saturation",style:r},Ke.createElement(bP,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:n0(t.s+100*i.left,0,100),v:n0(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Co(t.s)+"%, Brightness "+Co(t.v)+"%"},Ke.createElement(xP,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:c7(t)})))}),Oq=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function XMe(e,t,n){var r=l7(n),i=S.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=S.useRef({color:t,hsva:o});S.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),S.useEffect(function(){var u;Oq(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=S.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var ZMe=typeof window<"u"?S.useLayoutEffect:S.useEffect,QMe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},AD=new Map,JMe=function(e){ZMe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!AD.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,AD.set(t,n);var r=QMe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},eLe=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+l6(Object.assign({},n,{a:0}))+", "+l6(Object.assign({},n,{a:1}))+")"},o=P4(["react-colorful__alpha",t]),a=Co(100*n.a);return Ke.createElement("div",{className:o},Ke.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),Ke.createElement(bP,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:n0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},Ke.createElement(xP,{className:"react-colorful__alpha-pointer",left:n.a,color:l6(n)})))},tLe=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=Lq(e,["className","colorModel","color","onChange"]),s=S.useRef(null);JMe(s);var l=XMe(n,i,o),u=l[0],d=l[1],p=P4(["react-colorful",t]);return Ke.createElement("div",E4({},a,{ref:s,className:p}),Ke.createElement(YMe,{hsva:u,onChange:d}),Ke.createElement(KMe,{hue:u.h,onChange:d}),Ke.createElement(eLe,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},nLe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:qMe,fromHsva:GMe,equal:Oq},rLe=function(e){return Ke.createElement(tLe,E4({},e,{colorModel:nLe}))};const z3=e=>{const{styleClass:t,...n}=e;return g.jsx(rLe,{className:`invokeai__color-picker ${t}`,...n})},iLe=lt([rn,Lr],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});function oLe(){const e=Te(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=le(iLe),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return Je(["shift+BracketLeft"],()=>{e(Mm({...t,a:Pe.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),Je(["shift+BracketRight"],()=>{e(Mm({...t,a:Pe.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(ao,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:g.jsxs(_e,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&g.jsx(z3,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e(Mm(a))}),r==="mask"&&g.jsx(z3,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(UW(a))})]})})}function Rq(){return g.jsxs(_e,{columnGap:"1rem",alignItems:"center",children:[g.jsx(VMe,{}),g.jsx(oLe,{})]})}function aLe(){const e=Te(),t=le(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=De();return g.jsx(Gn,{label:n("unifiedCanvas.betaLimitToBox"),isChecked:t,onChange:r=>e(JW(r.target.checked))})}function sLe(){return g.jsxs(_e,{gap:"1rem",alignItems:"center",children:[g.jsx(Rq,{}),g.jsx(aLe,{})]})}function lLe(){const e=Te(),{t}=De(),n=()=>e(mE());return g.jsx(On,{size:"sm",leftIcon:g.jsx(hp,{}),onClick:n,tooltip:`${t("unifiedCanvas.clearMask")} (Shift+C)`,children:t("unifiedCanvas.betaClear")})}function uLe(){const e=le(i=>i.canvas.isMaskEnabled),t=Te(),{t:n}=De(),r=()=>t(p2(!e));return g.jsx(Gn,{label:`${n("unifiedCanvas.enableMask")} (H)`,isChecked:e,onChange:r})}function cLe(){const e=Te(),{t}=De(),n=le(r=>r.canvas.shouldPreserveMaskedArea);return g.jsx(Gn,{label:t("unifiedCanvas.betaPreserveMasked"),isChecked:n,onChange:r=>e(KW(r.target.checked))})}function dLe(){return g.jsxs(_e,{gap:"1rem",alignItems:"center",children:[g.jsx(Rq,{}),g.jsx(uLe,{}),g.jsx(cLe,{}),g.jsx(lLe,{})]})}function fLe(){const e=le(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Te(),{t:n}=De();return g.jsx(Gn,{label:n("unifiedCanvas.betaDarkenOutside"),isChecked:e,onChange:r=>t(qW(r.target.checked))})}function hLe(){const e=le(r=>r.canvas.shouldShowGrid),t=Te(),{t:n}=De();return g.jsx(Gn,{label:n("unifiedCanvas.showGrid"),isChecked:e,onChange:r=>t(XW(r.target.checked))})}function pLe(){const e=le(i=>i.canvas.shouldSnapToGrid),t=Te(),{t:n}=De(),r=i=>t(_3(i.target.checked));return g.jsx(Gn,{label:`${n("unifiedCanvas.snapToGrid")} (N)`,isChecked:e,onChange:r})}function gLe(){return g.jsxs(_e,{alignItems:"center",gap:"1rem",children:[g.jsx(hLe,{}),g.jsx(pLe,{}),g.jsx(fLe,{})]})}const mLe=lt([rn],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});function vLe(){const{tool:e,layer:t}=le(mLe);return g.jsxs(_e,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&g.jsx(sLe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&g.jsx(dLe,{}),e=="move"&&g.jsx(gLe,{})]})}const yLe=lt([rn],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),bLe=()=>{const e=Te(),{doesCanvasNeedScaling:t}=le(yLe);return S.useLayoutEffect(()=>{e(Li(!0));const n=Pe.debounce(()=>{e(Li(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),g.jsx("div",{className:"workarea-single-view",children:g.jsxs(_e,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[g.jsx(UMe,{}),g.jsxs(_e,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[g.jsx(vLe,{}),t?g.jsx(_q,{}):g.jsx(Cq,{})]})]})})},xLe=lt([rn,Lr],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:zh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),SLe=()=>{const e=Te(),{t}=De(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=le(xLe);Je(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),Je(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),Je(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(C3(n==="mask"?"base":"mask"))},l=()=>e(mE()),u=()=>e(p2(!i));return g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Gi,{children:g.jsx(Ye,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:g.jsx(Eke,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:g.jsxs(_e,{direction:"column",gap:"0.5rem",children:[g.jsx(Gn,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:i,onChange:u}),g.jsx(Gn,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:o,onChange:d=>e(KW(d.target.checked))}),g.jsx(z3,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:d=>e(UW(d))}),g.jsxs(On,{size:"sm",leftIcon:g.jsx(hp,{}),onClick:l,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},wLe=lt([rn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),CLe=()=>{const e=Te(),{t}=De(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=le(wLe);Je(["n"],()=>{e(_3(!l))},{enabled:!0,preventDefault:!0},[l]);const d=p=>e(_3(p.target.checked));return g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ye,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:g.jsx(WE,{})}),children:g.jsxs(_e,{direction:"column",gap:"0.5rem",children:[g.jsx(Gn,{label:t("unifiedCanvas.showIntermediates"),isChecked:s,onChange:p=>e(ZW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.showGrid"),isChecked:a,onChange:p=>e(XW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.snapToGrid"),isChecked:l,onChange:d}),g.jsx(Gn,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:i,onChange:p=>e(qW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:p=>e(VW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:p=>e(GW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:u,onChange:p=>e(JW(p.target.checked))}),g.jsx(Gn,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:o,onChange:p=>e(YW(p.target.checked))}),g.jsx(Mq,{}),g.jsx(Tq,{})]})})},_Le=lt([rn,Lr,hr],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),kLe=()=>{const e=Te(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=le(_Le),{t:o}=De();Je(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),Je(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),Je(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),Je(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),Je(["delete","backspace"],()=>{d()},{enabled:()=>!i,preventDefault:!0}),Je(["BracketLeft"],()=>{e(Lm(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),Je(["BracketRight"],()=>{e(Lm(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),Je(["shift+BracketLeft"],()=>{e(Mm({...n,a:Pe.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),Je(["shift+BracketRight"],()=>{e(Mm({...n,a:Pe.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(Jl("brush")),s=()=>e(Jl("eraser")),l=()=>e(Jl("colorPicker")),u=()=>e(FW()),d=()=>e($W());return g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ye,{"aria-label":`${o("unifiedCanvas.brush")} (B)`,tooltip:`${o("unifiedCanvas.brush")} (B)`,icon:g.jsx(oG,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),g.jsx(Ye,{"aria-label":`${o("unifiedCanvas.eraser")} (E)`,tooltip:`${o("unifiedCanvas.eraser")} (E)`,icon:g.jsx(tG,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),g.jsx(Ye,{"aria-label":`${o("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:g.jsx(rG,{}),isDisabled:i,onClick:u}),g.jsx(Ye,{"aria-label":`${o("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:g.jsx(b2,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:d}),g.jsx(Ye,{"aria-label":`${o("unifiedCanvas.colorPicker")} (C)`,tooltip:`${o("unifiedCanvas.colorPicker")} (C)`,icon:g.jsx(nG,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ye,{"aria-label":o("unifiedCanvas.brushOptions"),tooltip:o("unifiedCanvas.brushOptions"),icon:g.jsx(HE,{})}),children:g.jsxs(_e,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[g.jsx(_e,{gap:"1rem",justifyContent:"space-between",children:g.jsx(Dn,{label:o("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:p=>e(Lm(p)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),g.jsx(z3,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:p=>e(Mm(p))})]})})]})},ELe=lt([hr,rn,Lr],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),PLe=()=>{const e=Te(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=le(ELe),s=Qs(),{t:l}=De(),{openUploader:u}=DE();Je(["v"],()=>{d()},{enabled:()=>!n,preventDefault:!0},[]),Je(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[s]),Je(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),Je(["shift+s"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[s,t]),Je(["meta+c","ctrl+c"],()=>{E()},{enabled:()=>!n,preventDefault:!0},[s,t]),Je(["shift+d"],()=>{_()},{enabled:()=>!n,preventDefault:!0},[s,t]);const d=()=>e(Jl("move")),p=Pq(()=>m(!1),()=>m(!0)),m=(T=!1)=>{const L=Qs();if(!L)return;const O=L.getClientRect({skipTransform:!0});e(HW({contentRect:O,shouldScaleTo1:T}))},y=()=>{e(vE()),e(i4())},b=()=>{e(Td({cropVisible:!1,shouldSetAsInitialImage:!0}))},w=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},E=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},_=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},k=T=>{const L=T.target.value;e(C3(L)),L==="mask"&&!r&&e(p2(!0))};return g.jsxs("div",{className:"inpainting-settings",children:[g.jsx(Jo,{tooltip:`${l("unifiedCanvas.layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:jW,onChange:k,isDisabled:n}),g.jsx(SLe,{}),g.jsx(kLe,{}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ye,{"aria-label":`${l("unifiedCanvas.move")} (V)`,tooltip:`${l("unifiedCanvas.move")} (V)`,icon:g.jsx(QV,{}),"data-selected":o==="move"||n,onClick:d}),g.jsx(Ye,{"aria-label":`${l("unifiedCanvas.resetView")} (R)`,tooltip:`${l("unifiedCanvas.resetView")} (R)`,icon:g.jsx(eG,{}),onClick:p})]}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ye,{"aria-label":`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:g.jsx(iG,{}),onClick:b,isDisabled:n}),g.jsx(Ye,{"aria-label":`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:g.jsx(zE,{}),onClick:w,isDisabled:n}),g.jsx(Ye,{"aria-label":`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:g.jsx(Jm,{}),onClick:E,isDisabled:n}),g.jsx(Ye,{"aria-label":`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:g.jsx(BE,{}),onClick:_,isDisabled:n})]}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Eq,{}),g.jsx(kq,{})]}),g.jsxs(Gi,{isAttached:!0,children:[g.jsx(Ye,{"aria-label":`${l("common.upload")}`,tooltip:`${l("common.upload")}`,icon:g.jsx(g4,{}),onClick:u,isDisabled:n}),g.jsx(Ye,{"aria-label":`${l("unifiedCanvas.clearCanvas")}`,tooltip:`${l("unifiedCanvas.clearCanvas")}`,icon:g.jsx(hp,{}),onClick:y,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),g.jsx(Gi,{isAttached:!0,children:g.jsx(CLe,{})})]})},TLe=lt([rn],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),MLe=()=>{const e=Te(),{doesCanvasNeedScaling:t}=le(TLe);return S.useLayoutEffect(()=>{e(Li(!0));const n=Pe.debounce(()=>{e(Li(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),g.jsx("div",{className:"workarea-single-view",children:g.jsx("div",{className:"workarea-split-view-left",children:g.jsxs("div",{className:"inpainting-main-area",children:[g.jsx(PLe,{}),g.jsx("div",{className:"inpainting-canvas-area",children:t?g.jsx(_q,{}):g.jsx(Cq,{})})]})})})},LLe=lt(rn,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),ALe=()=>{const e=Te(),{boundingBoxDimensions:t}=le(LLe),{t:n}=De(),r=s=>{e(p1({...t,width:Math.floor(s)}))},i=s=>{e(p1({...t,height:Math.floor(s)}))},o=()=>{e(p1({...t,width:Math.floor(512)}))},a=()=>{e(p1({...t,height:Math.floor(512)}))};return g.jsxs(_e,{direction:"column",gap:2,children:[g.jsx(Dn,{label:n("parameters.width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:o,sliderMarkRightOffset:-7}),g.jsx(Dn,{label:n("parameters.height"),min:64,max:1024,step:64,value:t.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:a,sliderMarkRightOffset:-7})]})},OLe=lt([nP,hr,rn],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),RLe=()=>{const e=Te(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=le(OLe),{t:s}=De(),l=y=>{e(ex({...a,width:Math.floor(y)}))},u=y=>{e(ex({...a,height:Math.floor(y)}))},d=()=>{e(ex({...a,width:Math.floor(512)}))},p=()=>{e(ex({...a,height:Math.floor(512)}))},m=y=>{e(c3e(y.target.value))};return g.jsxs(_e,{direction:"column",gap:4,children:[g.jsx(Jo,{label:s("parameters.scaleBeforeProcessing"),validValues:qSe,value:i,onChange:m}),g.jsx(Dn,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters.scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:d,sliderMarkRightOffset:-7}),g.jsx(Dn,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters.scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:p,sliderMarkRightOffset:-7}),g.jsx(Jo,{label:s("parameters.infillMethod"),value:n,validValues:r,onChange:y=>e(lU(y.target.value))}),g.jsx(Dn,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("parameters.tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:y=>{e(oR(y))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(oR(32))}})]})};function ILe(){const e=Te(),t=le(r=>r.generation.seamBlur),{t:n}=De();return g.jsx(Dn,{sliderMarkRightOffset:-4,label:n("parameters.seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(tR(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(tR(16))}})}function DLe(){const e=Te(),{t}=De(),n=le(r=>r.generation.seamSize);return g.jsx(Dn,{sliderMarkRightOffset:-6,label:t("parameters.seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(nR(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(nR(96))})}function jLe(){const{t:e}=De(),t=le(r=>r.generation.seamSteps),n=Te();return g.jsx(Dn,{sliderMarkRightOffset:-4,label:e("parameters.seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(rR(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(rR(30))}})}function NLe(){const e=Te(),{t}=De(),n=le(r=>r.generation.seamStrength);return g.jsx(Dn,{sliderMarkRightOffset:-7,label:t("parameters.seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(iR(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(iR(.7))}})}const $Le=()=>g.jsxs(_e,{direction:"column",gap:2,children:[g.jsx(DLe,{}),g.jsx(ILe,{}),g.jsx(NLe,{}),g.jsx(jLe,{})]});function FLe(){const{t:e}=De(),t={seed:{header:`${e("parameters.seed")}`,feature:oo.SEED,content:g.jsx(lP,{})},boundingBox:{header:`${e("parameters.boundingBoxHeader")}`,feature:oo.BOUNDING_BOX,content:g.jsx(ALe,{})},seamCorrection:{header:`${e("parameters.seamCorrectionHeader")}`,feature:oo.SEAM_CORRECTION,content:g.jsx($Le,{})},infillAndScaling:{header:`${e("parameters.infillScalingHeader")}`,feature:oo.INFILL_AND_SCALING,content:g.jsx(RLe,{})},variations:{header:`${e("parameters.variations")}`,feature:oo.VARIATIONS,content:g.jsx(cP,{}),additionalHeaderComponents:g.jsx(uP,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:g.jsx(aP,{}),additionalHeaderComponents:g.jsx(sP,{})}},n={unifiedCanvasImg2Img:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:g.jsx(pq,{label:e("parameters.img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"})}};return g.jsxs(gP,{children:[g.jsxs(_e,{flexDir:"column",rowGap:"0.5rem",children:[g.jsx(pP,{}),g.jsx(hP,{})]}),g.jsx(fP,{}),g.jsx(dP,{}),g.jsx(t0,{accordionInfo:n}),g.jsx(t0,{accordionInfo:t})]})}function BLe(){const e=le(t=>t.ui.shouldUseCanvasBetaLayout);return g.jsx(oP,{optionsPanel:g.jsx(FLe,{}),styleClass:"inpainting-workarea-overrides",children:e?g.jsx(bLe,{}):g.jsx(MLe,{})})}const Qa={txt2img:{title:g.jsx(O_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(APe,{}),tooltip:"Text To Image"},img2img:{title:g.jsx(M_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(CPe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:g.jsx(I_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(BLe,{}),tooltip:"Unified Canvas"},nodes:{title:g.jsx(L_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(k_e,{}),tooltip:"Nodes"},postprocess:{title:g.jsx(A_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(E_e,{}),tooltip:"Post Processing"},training:{title:g.jsx(R_e,{fill:"black",boxSize:"2.5rem"}),workarea:g.jsx(P_e,{}),tooltip:"Training"}};function zLe(){Qa.txt2img.tooltip=Et.t("common.text2img"),Qa.img2img.tooltip=Et.t("common.img2img"),Qa.unifiedCanvas.tooltip=Et.t("common.unifiedCanvas"),Qa.nodes.tooltip=Et.t("common.nodes"),Qa.postprocess.tooltip=Et.t("common.postProcessing"),Qa.training.tooltip=Et.t("common.training")}function HLe(){const e=le(__e),t=le(u=>u.lightbox.isLightboxOpen),{shouldShowGallery:n,shouldShowParametersPanel:r,shouldPinGallery:i,shouldPinParametersPanel:o}=le(iP);T_e(zLe);const a=Te();Je("1",()=>{a(Wo(0))}),Je("2",()=>{a(Wo(1))}),Je("3",()=>{a(Wo(2))}),Je("4",()=>{a(Wo(3))}),Je("5",()=>{a(Wo(4))}),Je("6",()=>{a(Wo(5))}),Je("z",()=>{a(Om(!t))},[t]),Je("f",()=>{n||r?(a(Fh(!1)),a(Am(!1))):(a(Fh(!0)),a(Am(!0))),(i||o)&&setTimeout(()=>a(Li(!0)),400)},[n,r]);const s=()=>{const u=[];return Object.keys(Qa).forEach(d=>{u.push(g.jsx(si,{hasArrow:!0,label:Qa[d].tooltip,placement:"right",children:g.jsx(uW,{children:Qa[d].title})},d))}),u},l=()=>{const u=[];return Object.keys(Qa).forEach(d=>{u.push(g.jsx(sW,{className:"app-tabs-panel",children:Qa[d].workarea},d))}),u};return g.jsxs(aW,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:u=>{a(Wo(u))},children:[g.jsx("div",{className:"app-tabs-list",children:s()}),g.jsx(lW,{className:"app-tabs-panels",children:t?g.jsx(WEe,{}):l()})]})}var WLe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function _2(e,t){var n=ULe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function ULe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=WLe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var VLe=[".DS_Store","Thumbs.db"];function GLe(e){return d0(this,void 0,void 0,function(){return f0(this,function(t){return H3(e)&&qLe(e.dataTransfer)?[2,ZLe(e.dataTransfer,e.type)]:KLe(e)?[2,YLe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,XLe(e)]:[2,[]]})})}function qLe(e){return H3(e)}function KLe(e){return H3(e)&&H3(e.target)}function H3(e){return typeof e=="object"&&e!==null}function YLe(e){return d7(e.target.files).map(function(t){return _2(t)})}function XLe(e){return d0(this,void 0,void 0,function(){var t;return f0(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return _2(r)})]}})})}function ZLe(e,t){return d0(this,void 0,void 0,function(){var n,r;return f0(this,function(i){switch(i.label){case 0:return e.items?(n=d7(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(QLe))]):[3,2];case 1:return r=i.sent(),[2,OD(Iq(r))];case 2:return[2,OD(d7(e.files).map(function(o){return _2(o)}))]}})})}function OD(e){return e.filter(function(t){return VLe.indexOf(t.name)===-1})}function d7(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,ND(n)];if(e.sizen)return[!1,ND(n)]}return[!0,null]}function Sh(e){return e!=null}function pAe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=$q(l,n),d=Hy(u,1),p=d[0],m=Fq(l,r,i),y=Hy(m,1),b=y[0],w=s?s(l):null;return p&&b&&!w})}function W3(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ex(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function FD(e){e.preventDefault()}function gAe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function mAe(e){return e.indexOf("Edge/")!==-1}function vAe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return gAe(e)||mAe(e)}function Ml(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function IAe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var SP=S.forwardRef(function(e,t){var n=e.children,r=U3(e,CAe),i=Uq(r),o=i.open,a=U3(i,_Ae);return S.useImperativeHandle(t,function(){return{open:o}},[o]),Ke.createElement(S.Fragment,null,n(_r(_r({},a),{},{open:o})))});SP.displayName="Dropzone";var Wq={disabled:!1,getFilesFromEvent:GLe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};SP.defaultProps=Wq;SP.propTypes={children:An.func,accept:An.objectOf(An.arrayOf(An.string)),multiple:An.bool,preventDropOnDocument:An.bool,noClick:An.bool,noKeyboard:An.bool,noDrag:An.bool,noDragEventsBubbling:An.bool,minSize:An.number,maxSize:An.number,maxFiles:An.number,disabled:An.bool,getFilesFromEvent:An.func,onFileDialogCancel:An.func,onFileDialogOpen:An.func,useFsAccessApi:An.bool,autoFocus:An.bool,onDragEnter:An.func,onDragLeave:An.func,onDragOver:An.func,onDrop:An.func,onDropAccepted:An.func,onDropRejected:An.func,onError:An.func,validator:An.func};var g7={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Uq(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_r(_r({},Wq),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,p=t.onDragOver,m=t.onDrop,y=t.onDropAccepted,b=t.onDropRejected,w=t.onFileDialogCancel,E=t.onFileDialogOpen,_=t.useFsAccessApi,k=t.autoFocus,T=t.preventDropOnDocument,L=t.noClick,O=t.noKeyboard,D=t.noDrag,I=t.noDragEventsBubbling,N=t.onError,U=t.validator,B=S.useMemo(function(){return xAe(n)},[n]),K=S.useMemo(function(){return bAe(n)},[n]),ne=S.useMemo(function(){return typeof E=="function"?E:zD},[E]),z=S.useMemo(function(){return typeof w=="function"?w:zD},[w]),$=S.useRef(null),H=S.useRef(null),Y=S.useReducer(DAe,g7),Q=u6(Y,2),q=Q[0],X=Q[1],ee=q.isFocused,fe=q.isFileDialogActive,ke=S.useRef(typeof window<"u"&&window.isSecureContext&&_&&yAe()),we=function(){!ke.current&&fe&&setTimeout(function(){if(H.current){var je=H.current.files;je.length||(X({type:"closeDialog"}),z())}},300)};S.useEffect(function(){return window.addEventListener("focus",we,!1),function(){window.removeEventListener("focus",we,!1)}},[H,fe,z,ke]);var xe=S.useRef([]),Le=function(je){$.current&&$.current.contains(je.target)||(je.preventDefault(),xe.current=[])};S.useEffect(function(){return T&&(document.addEventListener("dragover",FD,!1),document.addEventListener("drop",Le,!1)),function(){T&&(document.removeEventListener("dragover",FD),document.removeEventListener("drop",Le))}},[$,T]),S.useEffect(function(){return!r&&k&&$.current&&$.current.focus(),function(){}},[$,k,r]);var Se=S.useCallback(function(ye){N?N(ye):console.error(ye)},[N]),Qe=S.useCallback(function(ye){ye.preventDefault(),ye.persist(),se(ye),xe.current=[].concat(PAe(xe.current),[ye.target]),Ex(ye)&&Promise.resolve(i(ye)).then(function(je){if(!(W3(ye)&&!I)){var vt=je.length,Mt=vt>0&&pAe({files:je,accept:B,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:U}),Me=vt>0&&!Mt;X({isDragAccept:Mt,isDragReject:Me,isDragActive:!0,type:"setDraggedFiles"}),u&&u(ye)}}).catch(function(je){return Se(je)})},[i,u,Se,I,B,a,o,s,l,U]),Xe=S.useCallback(function(ye){ye.preventDefault(),ye.persist(),se(ye);var je=Ex(ye);if(je&&ye.dataTransfer)try{ye.dataTransfer.dropEffect="copy"}catch{}return je&&p&&p(ye),!1},[p,I]),tt=S.useCallback(function(ye){ye.preventDefault(),ye.persist(),se(ye);var je=xe.current.filter(function(Mt){return $.current&&$.current.contains(Mt)}),vt=je.indexOf(ye.target);vt!==-1&&je.splice(vt,1),xe.current=je,!(je.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ex(ye)&&d&&d(ye))},[$,d,I]),yt=S.useCallback(function(ye,je){var vt=[],Mt=[];ye.forEach(function(Me){var Ct=$q(Me,B),zt=u6(Ct,2),$n=zt[0],qe=zt[1],pt=Fq(Me,a,o),zr=u6(pt,2),rr=zr[0],Bn=zr[1],li=U?U(Me):null;if($n&&rr&&!li)vt.push(Me);else{var vs=[qe,Bn];li&&(vs=vs.concat(li)),Mt.push({file:Me,errors:vs.filter(function(tl){return tl})})}}),(!s&&vt.length>1||s&&l>=1&&vt.length>l)&&(vt.forEach(function(Me){Mt.push({file:Me,errors:[hAe]})}),vt.splice(0)),X({acceptedFiles:vt,fileRejections:Mt,type:"setFiles"}),m&&m(vt,Mt,je),Mt.length>0&&b&&b(Mt,je),vt.length>0&&y&&y(vt,je)},[X,s,B,a,o,l,m,y,b,U]),Be=S.useCallback(function(ye){ye.preventDefault(),ye.persist(),se(ye),xe.current=[],Ex(ye)&&Promise.resolve(i(ye)).then(function(je){W3(ye)&&!I||yt(je,ye)}).catch(function(je){return Se(je)}),X({type:"reset"})},[i,yt,Se,I]),Ae=S.useCallback(function(){if(ke.current){X({type:"openDialog"}),ne();var ye={multiple:s,types:K};window.showOpenFilePicker(ye).then(function(je){return i(je)}).then(function(je){yt(je,null),X({type:"closeDialog"})}).catch(function(je){SAe(je)?(z(je),X({type:"closeDialog"})):wAe(je)?(ke.current=!1,H.current?(H.current.value=null,H.current.click()):Se(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Se(je)});return}H.current&&(X({type:"openDialog"}),ne(),H.current.value=null,H.current.click())},[X,ne,z,_,yt,Se,K,s]),bt=S.useCallback(function(ye){!$.current||!$.current.isEqualNode(ye.target)||(ye.key===" "||ye.key==="Enter"||ye.keyCode===32||ye.keyCode===13)&&(ye.preventDefault(),Ae())},[$,Ae]),Fe=S.useCallback(function(){X({type:"focus"})},[]),at=S.useCallback(function(){X({type:"blur"})},[]),jt=S.useCallback(function(){L||(vAe()?setTimeout(Ae,0):Ae())},[L,Ae]),mt=function(je){return r?null:je},Zt=function(je){return O?null:mt(je)},on=function(je){return D?null:mt(je)},se=function(je){I&&je.stopPropagation()},Ie=S.useMemo(function(){return function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},je=ye.refKey,vt=je===void 0?"ref":je,Mt=ye.role,Me=ye.onKeyDown,Ct=ye.onFocus,zt=ye.onBlur,$n=ye.onClick,qe=ye.onDragEnter,pt=ye.onDragOver,zr=ye.onDragLeave,rr=ye.onDrop,Bn=U3(ye,kAe);return _r(_r(p7({onKeyDown:Zt(Ml(Me,bt)),onFocus:Zt(Ml(Ct,Fe)),onBlur:Zt(Ml(zt,at)),onClick:mt(Ml($n,jt)),onDragEnter:on(Ml(qe,Qe)),onDragOver:on(Ml(pt,Xe)),onDragLeave:on(Ml(zr,tt)),onDrop:on(Ml(rr,Be)),role:typeof Mt=="string"&&Mt!==""?Mt:"presentation"},vt,$),!r&&!O?{tabIndex:0}:{}),Bn)}},[$,bt,Fe,at,jt,Qe,Xe,tt,Be,O,D,r]),He=S.useCallback(function(ye){ye.stopPropagation()},[]),Ue=S.useMemo(function(){return function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},je=ye.refKey,vt=je===void 0?"ref":je,Mt=ye.onChange,Me=ye.onClick,Ct=U3(ye,EAe),zt=p7({accept:B,multiple:s,type:"file",style:{display:"none"},onChange:mt(Ml(Mt,Be)),onClick:mt(Ml(Me,He)),tabIndex:-1},vt,H);return _r(_r({},zt),Ct)}},[H,n,s,Be,r]);return _r(_r({},q),{},{isFocused:ee&&!r,getRootProps:Ie,getInputProps:Ue,rootRef:$,inputRef:H,open:mt(Ae)})}function DAe(e,t){switch(t.type){case"focus":return _r(_r({},e),{},{isFocused:!0});case"blur":return _r(_r({},e),{},{isFocused:!1});case"openDialog":return _r(_r({},g7),{},{isFileDialogActive:!0});case"closeDialog":return _r(_r({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _r(_r({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _r(_r({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return _r({},g7);default:return e}}function zD(){}const jAe=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return Je("esc",()=>{i(!1)}),g.jsxs("div",{className:"dropzone-container",children:[t&&g.jsx("div",{className:"dropzone-overlay is-drag-accept",children:g.jsxs(jh,{size:"lg",children:["Upload Image",r]})}),n&&g.jsxs("div",{className:"dropzone-overlay is-drag-reject",children:[g.jsx(jh,{size:"lg",children:"Invalid Upload"}),g.jsx(jh,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},NAe=e=>{const{children:t}=e,n=Te(),r=le(Br),i=s2({}),{t:o}=De(),[a,s]=S.useState(!1),{setOpenUploader:l}=DE(),u=S.useCallback(T=>{s(!0);const L=T.errors.reduce((O,D)=>`${O} +${D.message}`,"");i({title:o("toast.uploadFailed"),description:L,status:"error",isClosable:!0})},[o,i]),d=S.useCallback(async T=>{n(LI({imageFile:T}))},[n]),p=S.useCallback((T,L)=>{L.forEach(O=>{u(O)}),T.forEach(O=>{d(O)})},[d,u]),{getRootProps:m,getInputProps:y,isDragAccept:b,isDragReject:w,isDragActive:E,open:_}=Uq({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:p,onDragOver:()=>s(!0),maxFiles:1});l(_),S.useEffect(()=>{const T=L=>{var N;const O=(N=L.clipboardData)==null?void 0:N.items;if(!O)return;const D=[];for(const U of O)U.kind==="file"&&["image/png","image/jpg"].includes(U.type)&&D.push(U);if(!D.length)return;if(L.stopImmediatePropagation(),D.length>1){i({description:o("toast.uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const I=D[0].getAsFile();if(!I){i({description:o("toast.uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(LI({imageFile:I}))};return document.addEventListener("paste",T),()=>{document.removeEventListener("paste",T)}},[o,n,i,r]);const k=["img2img","unifiedCanvas"].includes(r)?` to ${Qa[r].tooltip}`:"";return g.jsx(IE.Provider,{value:_,children:g.jsxs("div",{...m({style:{}}),onKeyDown:T=>{T.key},children:[g.jsx("input",{...y()}),t,E&&a&&g.jsx(jAe,{isDragAccept:b,isDragReject:w,overlaySecondaryText:k,setIsHandlingUpload:s})]})})},$Ae=lt(hr,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),FAe=lt(hr,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),BAe=()=>{const e=Te(),t=le($Ae),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=le(FAe),[o,a]=S.useState(!0),s=S.useRef(null);S.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(IU()),e(zC(!n))};Je("`",()=>{e(zC(!n))},[n]),Je("esc",()=>{e(zC(!1))});const u=()=>{s.current&&o&&s.current.scrollTop{const{timestamp:m,message:y,level:b}=d;return g.jsxs("div",{className:`console-entry console-${b}-color`,children:[g.jsxs("p",{className:"console-timestamp",children:[m,":"]}),g.jsx("p",{className:"console-message",children:y})]},p)})})}),n&&g.jsx(si,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:g.jsx(ls,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:g.jsx(fke,{}),onClick:()=>a(!o)})}),g.jsx(si,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:g.jsx(ls,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?g.jsx(Pke,{}):g.jsx(JV,{}),onClick:l})})]})},zAe=lt(hr,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),HAe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=le(zAe),i=t?Math.round(t*100/n):0;return g.jsx(GH,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function WAe(e){const{title:t,hotkey:n,description:r}=e;return g.jsxs("div",{className:"hotkey-modal-item",children:[g.jsxs("div",{className:"hotkey-info",children:[g.jsx("p",{className:"hotkey-title",children:t}),r&&g.jsx("p",{className:"hotkey-description",children:r})]}),g.jsx("div",{className:"hotkey-key",children:n})]})}function UAe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Kd(),{t:i}=De(),o=[{title:i("hotkeys.invoke.title"),desc:i("hotkeys.invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys.cancel.title"),desc:i("hotkeys.cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys.focusPrompt.title"),desc:i("hotkeys.focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys.toggleOptions.title"),desc:i("hotkeys.toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys.pinOptions.title"),desc:i("hotkeys.pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys.toggleViewer.title"),desc:i("hotkeys.toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys.toggleGallery.title"),desc:i("hotkeys.toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys.maximizeWorkSpace.title"),desc:i("hotkeys.maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys.changeTabs.title"),desc:i("hotkeys.changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys.consoleToggle.title"),desc:i("hotkeys.consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys.setPrompt.title"),desc:i("hotkeys.setPrompt.desc"),hotkey:"P"},{title:i("hotkeys.setSeed.title"),desc:i("hotkeys.setSeed.desc"),hotkey:"S"},{title:i("hotkeys.setParameters.title"),desc:i("hotkeys.setParameters.desc"),hotkey:"A"},{title:i("hotkeys.restoreFaces.title"),desc:i("hotkeys.restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys.upscale.title"),desc:i("hotkeys.upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys.showInfo.title"),desc:i("hotkeys.showInfo.desc"),hotkey:"I"},{title:i("hotkeys.sendToImageToImage.title"),desc:i("hotkeys.sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys.deleteImage.title"),desc:i("hotkeys.deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys.closePanels.title"),desc:i("hotkeys.closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys.previousImage.title"),desc:i("hotkeys.previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys.nextImage.title"),desc:i("hotkeys.nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys.toggleGalleryPin.title"),desc:i("hotkeys.toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys.increaseGalleryThumbSize.title"),desc:i("hotkeys.increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys.decreaseGalleryThumbSize.title"),desc:i("hotkeys.decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys.selectBrush.title"),desc:i("hotkeys.selectBrush.desc"),hotkey:"B"},{title:i("hotkeys.selectEraser.title"),desc:i("hotkeys.selectEraser.desc"),hotkey:"E"},{title:i("hotkeys.decreaseBrushSize.title"),desc:i("hotkeys.decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys.increaseBrushSize.title"),desc:i("hotkeys.increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys.decreaseBrushOpacity.title"),desc:i("hotkeys.decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys.increaseBrushOpacity.title"),desc:i("hotkeys.increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys.moveTool.title"),desc:i("hotkeys.moveTool.desc"),hotkey:"V"},{title:i("hotkeys.fillBoundingBox.title"),desc:i("hotkeys.fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys.eraseBoundingBox.title"),desc:i("hotkeys.eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys.colorPicker.title"),desc:i("hotkeys.colorPicker.desc"),hotkey:"C"},{title:i("hotkeys.toggleSnap.title"),desc:i("hotkeys.toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys.quickToggleMove.title"),desc:i("hotkeys.quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys.toggleLayer.title"),desc:i("hotkeys.toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys.clearMask.title"),desc:i("hotkeys.clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys.hideMask.title"),desc:i("hotkeys.hideMask.desc"),hotkey:"H"},{title:i("hotkeys.showHideBoundingBox.title"),desc:i("hotkeys.showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys.mergeVisible.title"),desc:i("hotkeys.mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys.saveToGallery.title"),desc:i("hotkeys.saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys.copyToClipboard.title"),desc:i("hotkeys.copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys.downloadImage.title"),desc:i("hotkeys.downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys.undoStroke.title"),desc:i("hotkeys.undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys.redoStroke.title"),desc:i("hotkeys.redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys.resetView.title"),desc:i("hotkeys.resetView.desc"),hotkey:"R"},{title:i("hotkeys.previousStagingImage.title"),desc:i("hotkeys.previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys.nextStagingImage.title"),desc:i("hotkeys.nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys.acceptStagingImage.title"),desc:i("hotkeys.acceptStagingImage.desc"),hotkey:"Enter"}],u=d=>{const p=[];return d.forEach((m,y)=>{p.push(g.jsx(WAe,{title:m.title,description:m.desc,hotkey:m.hotkey},y))}),g.jsx("div",{className:"hotkey-modal-category",children:p})};return g.jsxs(g.Fragment,{children:[S.cloneElement(e,{onClick:n}),g.jsxs(Yd,{isOpen:t,onClose:r,children:[g.jsx(oc,{}),g.jsxs(Xd,{className:" modal hotkeys-modal",children:[g.jsx(g0,{className:"modal-close-btn"}),g.jsx("h1",{children:"Keyboard Shorcuts"}),g.jsx("div",{className:"hotkeys-modal-items",children:g.jsxs(f8,{allowMultiple:!0,children:[g.jsxs(rm,{children:[g.jsxs(tm,{className:"hotkeys-modal-button",children:[g.jsx("h2",{children:i("hotkeys.appHotkeys")}),g.jsx(nm,{})]}),g.jsx(om,{children:u(o)})]}),g.jsxs(rm,{children:[g.jsxs(tm,{className:"hotkeys-modal-button",children:[g.jsx("h2",{children:i("hotkeys.generalHotkeys")}),g.jsx(nm,{})]}),g.jsx(om,{children:u(a)})]}),g.jsxs(rm,{children:[g.jsxs(tm,{className:"hotkeys-modal-button",children:[g.jsx("h2",{children:i("hotkeys.galleryHotkeys")}),g.jsx(nm,{})]}),g.jsx(om,{children:u(s)})]}),g.jsxs(rm,{children:[g.jsxs(tm,{className:"hotkeys-modal-button",children:[g.jsx("h2",{children:i("hotkeys.unifiedCanvasHotkeys")}),g.jsx(nm,{})]}),g.jsx(om,{children:u(l)})]})]})})]})]})]})}var HD=Array.isArray,WD=Object.keys,VAe=Object.prototype.hasOwnProperty,GAe=typeof Element<"u";function m7(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=HD(e),r=HD(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!m7(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var p=WD(e);if(o=p.length,o!==WD(t).length)return!1;for(i=o;i--!==0;)if(!VAe.call(t,p[i]))return!1;if(GAe&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=p[i],!(a==="_owner"&&e.$$typeof)&&!m7(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var md=function(t,n){try{return m7(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},qAe=function(t){return KAe(t)&&!YAe(t)};function KAe(e){return!!e&&typeof e=="object"}function YAe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||QAe(e)}var XAe=typeof Symbol=="function"&&Symbol.for,ZAe=XAe?Symbol.for("react.element"):60103;function QAe(e){return e.$$typeof===ZAe}function JAe(e){return Array.isArray(e)?[]:{}}function V3(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Wy(JAe(e),e,t):e}function eOe(e,t,n){return e.concat(t).map(function(r){return V3(r,n)})}function tOe(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=V3(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=V3(t[i],n):r[i]=Wy(e[i],t[i],n)}),r}function Wy(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||eOe,n.isMergeableObject=n.isMergeableObject||qAe;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):tOe(e,t,n):V3(t,n)}Wy.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Wy(r,i,n)},{})};var v7=Wy,nOe=typeof global=="object"&&global&&global.Object===Object&&global;const Vq=nOe;var rOe=typeof self=="object"&&self&&self.Object===Object&&self,iOe=Vq||rOe||Function("return this")();const du=iOe;var oOe=du.Symbol;const tf=oOe;var Gq=Object.prototype,aOe=Gq.hasOwnProperty,sOe=Gq.toString,n1=tf?tf.toStringTag:void 0;function lOe(e){var t=aOe.call(e,n1),n=e[n1];try{e[n1]=void 0;var r=!0}catch{}var i=sOe.call(e);return r&&(t?e[n1]=n:delete e[n1]),i}var uOe=Object.prototype,cOe=uOe.toString;function dOe(e){return cOe.call(e)}var fOe="[object Null]",hOe="[object Undefined]",UD=tf?tf.toStringTag:void 0;function yp(e){return e==null?e===void 0?hOe:fOe:UD&&UD in Object(e)?lOe(e):dOe(e)}function qq(e,t){return function(n){return e(t(n))}}var pOe=qq(Object.getPrototypeOf,Object);const wP=pOe;function bp(e){return e!=null&&typeof e=="object"}var gOe="[object Object]",mOe=Function.prototype,vOe=Object.prototype,Kq=mOe.toString,yOe=vOe.hasOwnProperty,bOe=Kq.call(Object);function VD(e){if(!bp(e)||yp(e)!=gOe)return!1;var t=wP(e);if(t===null)return!0;var n=yOe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Kq.call(n)==bOe}function xOe(){this.__data__=[],this.size=0}function Yq(e,t){return e===t||e!==e&&t!==t}function T4(e,t){for(var n=e.length;n--;)if(Yq(e[n][0],t))return n;return-1}var SOe=Array.prototype,wOe=SOe.splice;function COe(e){var t=this.__data__,n=T4(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():wOe.call(t,n,1),--this.size,!0}function _Oe(e){var t=this.__data__,n=T4(t,e);return n<0?void 0:t[n][1]}function kOe(e){return T4(this.__data__,e)>-1}function EOe(e,t){var n=this.__data__,r=T4(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function yc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=RRe}var IRe="[object Arguments]",DRe="[object Array]",jRe="[object Boolean]",NRe="[object Date]",$Re="[object Error]",FRe="[object Function]",BRe="[object Map]",zRe="[object Number]",HRe="[object Object]",WRe="[object RegExp]",URe="[object Set]",VRe="[object String]",GRe="[object WeakMap]",qRe="[object ArrayBuffer]",KRe="[object DataView]",YRe="[object Float32Array]",XRe="[object Float64Array]",ZRe="[object Int8Array]",QRe="[object Int16Array]",JRe="[object Int32Array]",eIe="[object Uint8Array]",tIe="[object Uint8ClampedArray]",nIe="[object Uint16Array]",rIe="[object Uint32Array]",ar={};ar[YRe]=ar[XRe]=ar[ZRe]=ar[QRe]=ar[JRe]=ar[eIe]=ar[tIe]=ar[nIe]=ar[rIe]=!0;ar[IRe]=ar[DRe]=ar[qRe]=ar[jRe]=ar[KRe]=ar[NRe]=ar[$Re]=ar[FRe]=ar[BRe]=ar[zRe]=ar[HRe]=ar[WRe]=ar[URe]=ar[VRe]=ar[GRe]=!1;function iIe(e){return bp(e)&&nK(e.length)&&!!ar[yp(e)]}function CP(e){return function(t){return e(t)}}var rK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Z1=rK&&typeof module=="object"&&module&&!module.nodeType&&module,oIe=Z1&&Z1.exports===rK,d6=oIe&&Vq.process,aIe=function(){try{var e=Z1&&Z1.require&&Z1.require("util").types;return e||d6&&d6.binding&&d6.binding("util")}catch{}}();const r0=aIe;var ZD=r0&&r0.isTypedArray,sIe=ZD?CP(ZD):iIe;const lIe=sIe;var uIe=Object.prototype,cIe=uIe.hasOwnProperty;function iK(e,t){var n=E2(e),r=!n&&_Re(e),i=!n&&!r&&tK(e),o=!n&&!r&&!i&&lIe(e),a=n||r||i||o,s=a?bRe(e.length,String):[],l=s.length;for(var u in e)(t||cIe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ORe(u,l)))&&s.push(u);return s}var dIe=Object.prototype;function _P(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||dIe;return e===n}var fIe=qq(Object.keys,Object);const hIe=fIe;var pIe=Object.prototype,gIe=pIe.hasOwnProperty;function mIe(e){if(!_P(e))return hIe(e);var t=[];for(var n in Object(e))gIe.call(e,n)&&n!="constructor"&&t.push(n);return t}function oK(e){return e!=null&&nK(e.length)&&!Xq(e)}function kP(e){return oK(e)?iK(e):mIe(e)}function vIe(e,t){return e&&L4(t,kP(t),e)}function yIe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var bIe=Object.prototype,xIe=bIe.hasOwnProperty;function SIe(e){if(!k2(e))return yIe(e);var t=_P(e),n=[];for(var r in e)r=="constructor"&&(t||!xIe.call(e,r))||n.push(r);return n}function EP(e){return oK(e)?iK(e,!0):SIe(e)}function wIe(e,t){return e&&L4(t,EP(t),e)}var aK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,QD=aK&&typeof module=="object"&&module&&!module.nodeType&&module,CIe=QD&&QD.exports===aK,JD=CIe?du.Buffer:void 0,ej=JD?JD.allocUnsafe:void 0;function _Ie(e,t){if(t)return e.slice();var n=e.length,r=ej?ej(n):new e.constructor(n);return e.copy(r),r}function sK(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function mj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var vj=function(t){return Array.isArray(t)&&t.length===0},Ho=function(t){return typeof t=="function"},A4=function(t){return t!==null&&typeof t=="object"},wje=function(t){return String(Math.floor(Number(t)))===t},f6=function(t){return Object.prototype.toString.call(t)==="[object String]"},yK=function(t){return S.Children.count(t)===0},h6=function(t){return A4(t)&&Ho(t.then)};function Ui(e,t,n,r){r===void 0&&(r=0);for(var i=vK(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function bK(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?Ie.map(function(Ue){return N(Ue,Ui(se,Ue))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(He).then(function(Ue){return Ue.reduce(function(ye,je,vt){return je==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||je&&(ye=tu(ye,Ie[vt],je)),ye},{})})},[N]),B=S.useCallback(function(se){return Promise.all([U(se),m.validationSchema?I(se):{},m.validate?D(se):{}]).then(function(Ie){var He=Ie[0],Ue=Ie[1],ye=Ie[2],je=v7.all([He,Ue,ye],{arrayMerge:Tje});return je})},[m.validate,m.validationSchema,U,D,I]),K=qa(function(se){return se===void 0&&(se=L.values),O({type:"SET_ISVALIDATING",payload:!0}),B(se).then(function(Ie){return _.current&&(O({type:"SET_ISVALIDATING",payload:!1}),O({type:"SET_ERRORS",payload:Ie})),Ie})});S.useEffect(function(){a&&_.current===!0&&md(y.current,m.initialValues)&&K(y.current)},[a,K]);var ne=S.useCallback(function(se){var Ie=se&&se.values?se.values:y.current,He=se&&se.errors?se.errors:b.current?b.current:m.initialErrors||{},Ue=se&&se.touched?se.touched:w.current?w.current:m.initialTouched||{},ye=se&&se.status?se.status:E.current?E.current:m.initialStatus;y.current=Ie,b.current=He,w.current=Ue,E.current=ye;var je=function(){O({type:"RESET_FORM",payload:{isSubmitting:!!se&&!!se.isSubmitting,errors:He,touched:Ue,status:ye,values:Ie,isValidating:!!se&&!!se.isValidating,submitCount:se&&se.submitCount&&typeof se.submitCount=="number"?se.submitCount:0}})};if(m.onReset){var vt=m.onReset(L.values,Be);h6(vt)?vt.then(je):je()}else je()},[m.initialErrors,m.initialStatus,m.initialTouched]);S.useEffect(function(){_.current===!0&&!md(y.current,m.initialValues)&&(u&&(y.current=m.initialValues,ne()),a&&K(y.current))},[u,m.initialValues,ne,a,K]),S.useEffect(function(){u&&_.current===!0&&!md(b.current,m.initialErrors)&&(b.current=m.initialErrors||lh,O({type:"SET_ERRORS",payload:m.initialErrors||lh}))},[u,m.initialErrors]),S.useEffect(function(){u&&_.current===!0&&!md(w.current,m.initialTouched)&&(w.current=m.initialTouched||Px,O({type:"SET_TOUCHED",payload:m.initialTouched||Px}))},[u,m.initialTouched]),S.useEffect(function(){u&&_.current===!0&&!md(E.current,m.initialStatus)&&(E.current=m.initialStatus,O({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var z=qa(function(se){if(k.current[se]&&Ho(k.current[se].validate)){var Ie=Ui(L.values,se),He=k.current[se].validate(Ie);return h6(He)?(O({type:"SET_ISVALIDATING",payload:!0}),He.then(function(Ue){return Ue}).then(function(Ue){O({type:"SET_FIELD_ERROR",payload:{field:se,value:Ue}}),O({type:"SET_ISVALIDATING",payload:!1})})):(O({type:"SET_FIELD_ERROR",payload:{field:se,value:He}}),Promise.resolve(He))}else if(m.validationSchema)return O({type:"SET_ISVALIDATING",payload:!0}),I(L.values,se).then(function(Ue){return Ue}).then(function(Ue){O({type:"SET_FIELD_ERROR",payload:{field:se,value:Ue[se]}}),O({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),$=S.useCallback(function(se,Ie){var He=Ie.validate;k.current[se]={validate:He}},[]),H=S.useCallback(function(se){delete k.current[se]},[]),Y=qa(function(se,Ie){O({type:"SET_TOUCHED",payload:se});var He=Ie===void 0?i:Ie;return He?K(L.values):Promise.resolve()}),Q=S.useCallback(function(se){O({type:"SET_ERRORS",payload:se})},[]),q=qa(function(se,Ie){var He=Ho(se)?se(L.values):se;O({type:"SET_VALUES",payload:He});var Ue=Ie===void 0?n:Ie;return Ue?K(He):Promise.resolve()}),X=S.useCallback(function(se,Ie){O({type:"SET_FIELD_ERROR",payload:{field:se,value:Ie}})},[]),ee=qa(function(se,Ie,He){O({type:"SET_FIELD_VALUE",payload:{field:se,value:Ie}});var Ue=He===void 0?n:He;return Ue?K(tu(L.values,se,Ie)):Promise.resolve()}),fe=S.useCallback(function(se,Ie){var He=Ie,Ue=se,ye;if(!f6(se)){se.persist&&se.persist();var je=se.target?se.target:se.currentTarget,vt=je.type,Mt=je.name,Me=je.id,Ct=je.value,zt=je.checked,$n=je.outerHTML,qe=je.options,pt=je.multiple;He=Ie||Mt||Me,Ue=/number|range/.test(vt)?(ye=parseFloat(Ct),isNaN(ye)?"":ye):/checkbox/.test(vt)?Lje(Ui(L.values,He),zt,Ct):qe&&pt?Mje(qe):Ct}He&&ee(He,Ue)},[ee,L.values]),ke=qa(function(se){if(f6(se))return function(Ie){return fe(Ie,se)};fe(se)}),we=qa(function(se,Ie,He){Ie===void 0&&(Ie=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:se,value:Ie}});var Ue=He===void 0?i:He;return Ue?K(L.values):Promise.resolve()}),xe=S.useCallback(function(se,Ie){se.persist&&se.persist();var He=se.target,Ue=He.name,ye=He.id,je=He.outerHTML,vt=Ie||Ue||ye;we(vt,!0)},[we]),Le=qa(function(se){if(f6(se))return function(Ie){return xe(Ie,se)};xe(se)}),Se=S.useCallback(function(se){Ho(se)?O({type:"SET_FORMIK_STATE",payload:se}):O({type:"SET_FORMIK_STATE",payload:function(){return se}})},[]),Qe=S.useCallback(function(se){O({type:"SET_STATUS",payload:se})},[]),Xe=S.useCallback(function(se){O({type:"SET_ISSUBMITTING",payload:se})},[]),tt=qa(function(){return O({type:"SUBMIT_ATTEMPT"}),K().then(function(se){var Ie=se instanceof Error,He=!Ie&&Object.keys(se).length===0;if(He){var Ue;try{if(Ue=Ae(),Ue===void 0)return}catch(ye){throw ye}return Promise.resolve(Ue).then(function(ye){return _.current&&O({type:"SUBMIT_SUCCESS"}),ye}).catch(function(ye){if(_.current)throw O({type:"SUBMIT_FAILURE"}),ye})}else if(_.current&&(O({type:"SUBMIT_FAILURE"}),Ie))throw se})}),yt=qa(function(se){se&&se.preventDefault&&Ho(se.preventDefault)&&se.preventDefault(),se&&se.stopPropagation&&Ho(se.stopPropagation)&&se.stopPropagation(),tt().catch(function(Ie){console.warn("Warning: An unhandled error was caught from submitForm()",Ie)})}),Be={resetForm:ne,validateForm:K,validateField:z,setErrors:Q,setFieldError:X,setFieldTouched:we,setFieldValue:ee,setStatus:Qe,setSubmitting:Xe,setTouched:Y,setValues:q,setFormikState:Se,submitForm:tt},Ae=qa(function(){return d(L.values,Be)}),bt=qa(function(se){se&&se.preventDefault&&Ho(se.preventDefault)&&se.preventDefault(),se&&se.stopPropagation&&Ho(se.stopPropagation)&&se.stopPropagation(),ne()}),Fe=S.useCallback(function(se){return{value:Ui(L.values,se),error:Ui(L.errors,se),touched:!!Ui(L.touched,se),initialValue:Ui(y.current,se),initialTouched:!!Ui(w.current,se),initialError:Ui(b.current,se)}},[L.errors,L.touched,L.values]),at=S.useCallback(function(se){return{setValue:function(He,Ue){return ee(se,He,Ue)},setTouched:function(He,Ue){return we(se,He,Ue)},setError:function(He){return X(se,He)}}},[ee,we,X]),jt=S.useCallback(function(se){var Ie=A4(se),He=Ie?se.name:se,Ue=Ui(L.values,He),ye={name:He,value:Ue,onChange:ke,onBlur:Le};if(Ie){var je=se.type,vt=se.value,Mt=se.as,Me=se.multiple;je==="checkbox"?vt===void 0?ye.checked=!!Ue:(ye.checked=!!(Array.isArray(Ue)&&~Ue.indexOf(vt)),ye.value=vt):je==="radio"?(ye.checked=Ue===vt,ye.value=vt):Mt==="select"&&Me&&(ye.value=ye.value||[],ye.multiple=!0)}return ye},[Le,ke,L.values]),mt=S.useMemo(function(){return!md(y.current,L.values)},[y.current,L.values]),Zt=S.useMemo(function(){return typeof s<"u"?mt?L.errors&&Object.keys(L.errors).length===0:s!==!1&&Ho(s)?s(m):s:L.errors&&Object.keys(L.errors).length===0},[s,mt,L.errors,m]),on=Vn({},L,{initialValues:y.current,initialErrors:b.current,initialTouched:w.current,initialStatus:E.current,handleBlur:Le,handleChange:ke,handleReset:bt,handleSubmit:yt,resetForm:ne,setErrors:Q,setFormikState:Se,setFieldTouched:we,setFieldValue:ee,setFieldError:X,setStatus:Qe,setSubmitting:Xe,setTouched:Y,setValues:q,submitForm:tt,validateForm:K,validateField:z,isValid:Zt,dirty:mt,unregisterField:H,registerField:$,getFieldProps:jt,getFieldMeta:Fe,getFieldHelpers:at,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return on}function P2(e){var t=kje(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return S.useImperativeHandle(o,function(){return t}),S.createElement(Cje,{value:t},n?S.createElement(n,t):i?i(t):r?Ho(r)?r(t):yK(r)?null:S.Children.only(r):null)}function Eje(e){var t={};if(e.inner){if(e.inner.length===0)return tu(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Ui(t,a.path)||(t=tu(t,a.path,a.message))}}return t}function Pje(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=w7(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function w7(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||VD(i)?w7(i):i!==""?i:void 0}):VD(e[r])?t[r]=w7(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function Tje(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?v7(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=v7(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function Mje(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function Lje(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var Aje=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?S.useLayoutEffect:S.useEffect;function qa(e){var t=S.useRef(e);return Aje(function(){t.current=e}),S.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(Vn({},t,{length:n+1}))}else return[]},jje=function(e){Sje(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,d=l.formik.setFormikState;d(function(p){var m=typeof s=="function"?s:o,y=typeof a=="function"?a:o,b=tu(p.values,u,o(Ui(p.values,u))),w=s?m(Ui(p.errors,u)):void 0,E=a?y(Ui(p.touched,u)):void 0;return vj(w)&&(w=void 0),vj(E)&&(E=void 0),Vn({},p,{values:b,errors:s?tu(p.errors,u,w):p.errors,touched:a?tu(p.touched,u,E):p.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(i0(a),[xje(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return Ije(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return Rje(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return p6(s,o,a)},function(s){return p6(s,o,null)},function(s){return p6(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return Dje(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(mj(i)),i.pop=i.pop.bind(mj(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!md(Ui(i.formik.values,i.name),Ui(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?i0(a):[];return o||(o=s[i]),Ho(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,d=o.formik,p=Ph(d,["validate","validationSchema"]),m=Vn({},i,{form:p,name:u});return a?S.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):yK(l)?null:S.Children.only(l):null},t}(S.Component);jje.defaultProps={validateOnChange:!0};function Nje(e){const{model:t}=e,r=le(b=>b.system.model_list)[t],i=Te(),{t:o}=De(),a=le(b=>b.system.isProcessing),s=le(b=>b.system.isConnected),[l,u]=S.useState("same"),[d,p]=S.useState("");S.useEffect(()=>{u("same")},[t]);const m=()=>{u("same")},y=()=>{i(h_e({model_name:t,save_location:l,custom_location:l==="custom"&&d!==""?d:null}))};return g.jsxs(k4,{title:`${o("modelManager.convert")} ${t}`,acceptCallback:y,cancelCallback:m,acceptButtonText:`${o("modelManager.convert")}`,triggerComponent:g.jsxs(On,{size:"sm","aria-label":o("modelManager.convertToDiffusers"),isDisabled:r.status==="active"||a||!s,className:" modal-close-btn",marginRight:"2rem",children:["🧨 ",o("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[g.jsxs(_e,{flexDirection:"column",rowGap:4,children:[g.jsx(Dt,{children:o("modelManager.convertToDiffusersHelpText1")}),g.jsxs(rH,{children:[g.jsx(d1,{children:o("modelManager.convertToDiffusersHelpText2")}),g.jsx(d1,{children:o("modelManager.convertToDiffusersHelpText3")}),g.jsx(d1,{children:o("modelManager.convertToDiffusersHelpText4")}),g.jsx(d1,{children:o("modelManager.convertToDiffusersHelpText5")})]}),g.jsx(Dt,{children:o("modelManager.convertToDiffusersHelpText6")})]}),g.jsxs(_e,{flexDir:"column",gap:4,children:[g.jsxs(_e,{marginTop:"1rem",flexDir:"column",gap:2,children:[g.jsx(Dt,{fontWeight:"bold",children:o("modelManager.convertToDiffusersSaveLocation")}),g.jsx(Oy,{value:l,onChange:b=>u(b),children:g.jsxs(_e,{gap:4,children:[g.jsx(Vo,{value:"same",children:g.jsx(si,{label:"Save converted model in the same folder",children:o("modelManager.sameFolder")})}),g.jsx(Vo,{value:"root",children:g.jsx(si,{label:"Save converted model in the InvokeAI root folder",children:o("modelManager.invokeRoot")})}),g.jsx(Vo,{value:"custom",children:g.jsx(si,{label:"Save converted model in a custom folder",children:o("modelManager.custom")})})]})})]}),l==="custom"&&g.jsxs(_e,{flexDirection:"column",rowGap:2,children:[g.jsx(Dt,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:o("modelManager.customSaveLocation")}),g.jsx(qn,{value:d,onChange:b=>{b.target.value!==""&&p(b.target.value)},width:"25rem"})]})]})]})}const $je=lt([hr],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),yj=64,bj=2048;function Fje(){const{openModel:e,model_list:t}=le($je),n=le(l=>l.system.isProcessing),r=Te(),{t:i}=De(),[o,a]=S.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});S.useEffect(()=>{var l,u,d,p,m,y,b;if(e){const w=Pe.pickBy(t,(E,_)=>Pe.isEqual(_,e));a({name:e,description:(l=w[e])==null?void 0:l.description,config:(u=w[e])==null?void 0:u.config,weights:(d=w[e])==null?void 0:d.weights,vae:(p=w[e])==null?void 0:p.vae,width:(m=w[e])==null?void 0:m.width,height:(y=w[e])==null?void 0:y.height,default:(b=w[e])==null?void 0:b.default,format:"ckpt"})}},[t,e]);const s=l=>{r(y2({...l,width:Number(l.width),height:Number(l.height)}))};return e?g.jsxs(_e,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[g.jsxs(_e,{alignItems:"center",gap:4,justifyContent:"space-between",children:[g.jsx(Dt,{fontSize:"lg",fontWeight:"bold",children:e}),g.jsx(Nje,{model:e})]}),g.jsx(_e,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:g.jsx(P2,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>g.jsx("form",{onSubmit:l,children:g.jsxs(hn,{rowGap:"0.5rem",alignItems:"start",children:[g.jsxs(sn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"description",fontSize:"sm",children:i("modelManager.description")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?g.jsx(lr,{children:u.description}):g.jsx(sr,{margin:0,children:i("modelManager.descriptionValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.config&&d.config,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"config",fontSize:"sm",children:i("modelManager.config")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"config",name:"config",type:"text",width:"lg"}),u.config&&d.config?g.jsx(lr,{children:u.config}):g.jsx(sr,{margin:0,children:i("modelManager.configValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.weights&&d.weights,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"config",fontSize:"sm",children:i("modelManager.modelLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"weights",name:"weights",type:"text",width:"lg"}),u.weights&&d.weights?g.jsx(lr,{children:u.weights}):g.jsx(sr,{margin:0,children:i("modelManager.modelLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.vae&&d.vae,children:[g.jsx(Sn,{htmlFor:"vae",fontSize:"sm",children:i("modelManager.vaeLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae",name:"vae",type:"text",width:"lg"}),u.vae&&d.vae?g.jsx(lr,{children:u.vae}):g.jsx(sr,{margin:0,children:i("modelManager.vaeLocationValidationMsg")})]})]}),g.jsxs(u2,{width:"100%",children:[g.jsxs(sn,{isInvalid:!!u.width&&d.width,children:[g.jsx(Sn,{htmlFor:"width",fontSize:"sm",children:i("modelManager.width")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{id:"width",name:"width",children:({field:p,form:m})=>g.jsx(lc,{id:"width",name:"width",min:yj,max:bj,step:64,value:m.values.width,onChange:y=>m.setFieldValue(p.name,Number(y))})}),u.width&&d.width?g.jsx(lr,{children:u.width}):g.jsx(sr,{margin:0,children:i("modelManager.widthValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.height&&d.height,children:[g.jsx(Sn,{htmlFor:"height",fontSize:"sm",children:i("modelManager.height")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{id:"height",name:"height",children:({field:p,form:m})=>g.jsx(lc,{id:"height",name:"height",min:yj,max:bj,step:64,value:m.values.height,onChange:y=>m.setFieldValue(p.name,Number(y))})}),u.height&&d.height?g.jsx(lr,{children:u.height}):g.jsx(sr,{margin:0,children:i("modelManager.heightValidationMsg")})]})]})]}),g.jsx(On,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelManager.updateModel")})]})})})})]}):g.jsx(_e,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:g.jsx(Dt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const Bje=lt([hr],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});function zje(){const{openModel:e,model_list:t}=le(Bje),n=le(l=>l.system.isProcessing),r=Te(),{t:i}=De(),[o,a]=S.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});S.useEffect(()=>{var l,u,d,p,m,y,b,w,E,_,k,T,L,O,D,I;if(e){const N=Pe.pickBy(t,(U,B)=>Pe.isEqual(B,e));a({name:e,description:(l=N[e])==null?void 0:l.description,path:(u=N[e])!=null&&u.path&&((d=N[e])==null?void 0:d.path)!=="None"?(p=N[e])==null?void 0:p.path:"",repo_id:(m=N[e])!=null&&m.repo_id&&((y=N[e])==null?void 0:y.repo_id)!=="None"?(b=N[e])==null?void 0:b.repo_id:"",vae:{repo_id:(E=(w=N[e])==null?void 0:w.vae)!=null&&E.repo_id?(k=(_=N[e])==null?void 0:_.vae)==null?void 0:k.repo_id:"",path:(L=(T=N[e])==null?void 0:T.vae)!=null&&L.path?(D=(O=N[e])==null?void 0:O.vae)==null?void 0:D.path:""},default:(I=N[e])==null?void 0:I.default,format:"diffusers"})}},[t,e]);const s=l=>{const u=l;l.path===""&&delete u.path,l.repo_id===""&&delete u.repo_id,l.vae.path===""&&delete u.vae.path,l.vae.repo_id===""&&delete u.vae.repo_id,r(y2(l))};return e?g.jsxs(_e,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[g.jsx(_e,{alignItems:"center",children:g.jsx(Dt,{fontSize:"lg",fontWeight:"bold",children:e})}),g.jsx(_e,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:g.jsx(P2,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>{var p,m,y,b,w,E,_,k,T,L;return g.jsx("form",{onSubmit:l,children:g.jsxs(hn,{rowGap:"0.5rem",alignItems:"start",children:[g.jsxs(sn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"description",fontSize:"sm",children:i("modelManager.description")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?g.jsx(lr,{children:u.description}):g.jsx(sr,{margin:0,children:i("modelManager.descriptionValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.path&&d.path,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"path",fontSize:"sm",children:i("modelManager.modelLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"path",name:"path",type:"text",width:"lg"}),u.path&&d.path?g.jsx(lr,{children:u.path}):g.jsx(sr,{margin:0,children:i("modelManager.modelLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!u.repo_id&&d.repo_id,children:[g.jsx(Sn,{htmlFor:"repo_id",fontSize:"sm",children:i("modelManager.repo_id")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"repo_id",name:"repo_id",type:"text",width:"lg"}),u.repo_id&&d.repo_id?g.jsx(lr,{children:u.repo_id}):g.jsx(sr,{margin:0,children:i("modelManager.repoIDValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!((p=u.vae)!=null&&p.path)&&((m=d.vae)==null?void 0:m.path),children:[g.jsx(Sn,{htmlFor:"vae.path",fontSize:"sm",children:i("modelManager.vaeLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae.path",name:"vae.path",type:"text",width:"lg"}),(y=u.vae)!=null&&y.path&&((b=d.vae)!=null&&b.path)?g.jsx(lr,{children:(w=u.vae)==null?void 0:w.path}):g.jsx(sr,{margin:0,children:i("modelManager.vaeLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!((E=u.vae)!=null&&E.repo_id)&&((_=d.vae)==null?void 0:_.repo_id),children:[g.jsx(Sn,{htmlFor:"vae.repo_id",fontSize:"sm",children:i("modelManager.vaeRepoID")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"lg"}),(k=u.vae)!=null&&k.repo_id&&((T=d.vae)!=null&&T.repo_id)?g.jsx(lr,{children:(L=u.vae)==null?void 0:L.repo_id}):g.jsx(sr,{margin:0,children:i("modelManager.vaeRepoIDValidationMsg")})]})]}),g.jsx(On,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelManager.updateModel")})]})})}})})]}):g.jsx(_e,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:g.jsx(Dt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const SK=lt([hr],e=>{const{model_list:t}=e,n=[];return Pe.forEach(t,r=>{n.push(r.weights)}),n});function Hje(){const{t:e}=De();return g.jsx(ao,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelManager.modelExists")})}function xj({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=le(SK),i=o=>{t.includes(o.target.value)?n(Pe.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return g.jsxs(ao,{position:"relative",children:[r.includes(e.location)?g.jsx(Hje,{}):null,g.jsx(Gn,{value:e.name,label:g.jsx(g.Fragment,{children:g.jsxs(hn,{alignItems:"start",children:[g.jsx("p",{style:{fontWeight:"bold"},children:e.name}),g.jsx("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function Wje(){const e=Te(),{t}=De(),n=le(T=>T.system.searchFolder),r=le(T=>T.system.foundModels),i=le(SK),o=le(T=>T.ui.shouldShowExistingModelsInSearch),a=le(T=>T.system.isProcessing),[s,l]=Ke.useState([]),[u,d]=Ke.useState("v1"),[p,m]=Ke.useState(""),y=()=>{e(DU(null)),e(jU(null)),l([])},b=T=>{e(TI(T.checkpointFolder))},w=()=>{l([]),r&&r.forEach(T=>{i.includes(T.location)||l(L=>[...L,T.name])})},E=()=>{l([])},_=()=>{const T=r==null?void 0:r.filter(O=>s.includes(O.name)),L={v1:"configs/stable-diffusion/v1-inference.yaml",v2:"configs/stable-diffusion/v2-inference-v.yaml",inpainting:"configs/stable-diffusion/v1-inpainting-inference.yaml",custom:p};T==null||T.forEach(O=>{const D={name:O.name,description:"",config:L[u],weights:O.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(y2(D))}),l([])},k=()=>{const T=[],L=[];return r&&r.forEach((O,D)=>{i.includes(O.location)?L.push(g.jsx(xj,{model:O,modelsToAdd:s,setModelsToAdd:l},D)):T.push(g.jsx(xj,{model:O,modelsToAdd:s,setModelsToAdd:l},D))}),g.jsxs(g.Fragment,{children:[T,o&&L]})};return g.jsxs(g.Fragment,{children:[n?g.jsxs(_e,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[g.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelManager.checkpointFolder")}),g.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),g.jsx(Ye,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:g.jsx(p4,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(TI(n))}),g.jsx(Ye,{"aria-label":t("modelManager.clearCheckpointFolder"),icon:g.jsx(b2,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:y})]}):g.jsx(P2,{initialValues:{checkpointFolder:""},onSubmit:T=>{b(T)},children:({handleSubmit:T})=>g.jsx("form",{onSubmit:T,children:g.jsxs(u2,{columnGap:"0.5rem",children:[g.jsx(sn,{isRequired:!0,width:"max-content",children:g.jsx(ur,{as:qn,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelManager.checkpointFolder")})}),g.jsx(Ye,{icon:g.jsx(n7e,{}),"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),type:"submit",disabled:a})]})})}),r&&g.jsxs(_e,{flexDirection:"column",rowGap:"1rem",children:[g.jsxs(_e,{justifyContent:"space-between",alignItems:"center",children:[g.jsxs("p",{children:[t("modelManager.modelsFound"),": ",r.length]}),g.jsxs("p",{children:[t("modelManager.selected"),": ",s.length]})]}),g.jsxs(_e,{columnGap:"0.5rem",justifyContent:"space-between",children:[g.jsxs(_e,{columnGap:"0.5rem",children:[g.jsx(On,{isDisabled:s.length===r.length,onClick:w,children:t("modelManager.selectAll")}),g.jsx(On,{isDisabled:s.length===0,onClick:E,children:t("modelManager.deselectAll")}),g.jsx(Gn,{label:t("modelManager.showExisting"),isChecked:o,onChange:()=>e($4e(!o))})]}),g.jsx(On,{isDisabled:s.length===0,onClick:_,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelManager.addSelected")})]}),g.jsxs(_e,{gap:4,backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.2rem",flexDirection:"column",children:[g.jsxs(_e,{gap:4,children:[g.jsx(Dt,{fontWeight:"bold",color:"var(--text-color-secondary)",children:"Pick Model Type:"}),g.jsx(Oy,{value:u,onChange:T=>d(T),defaultValue:"v1",name:"model_type",children:g.jsxs(_e,{gap:4,children:[g.jsx(Vo,{value:"v1",children:t("modelManager.v1")}),g.jsx(Vo,{value:"v2",children:t("modelManager.v2")}),g.jsx(Vo,{value:"inpainting",children:t("modelManager.inpainting")}),g.jsx(Vo,{value:"custom",children:t("modelManager.customConfig")})]})})]}),u==="custom"&&g.jsxs(_e,{flexDirection:"column",rowGap:2,children:[g.jsx(Dt,{fontWeight:"bold",fontSize:"sm",color:"var(--text-color-secondary)",children:t("modelManager.pathToCustomConfig")}),g.jsx(qn,{value:p,onChange:T=>{T.target.value!==""&&m(T.target.value)},width:"42.5rem"})]})]}),g.jsxs(_e,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&g.jsx(Dt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelManager.selectAndAdd")}):g.jsx(Dt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelManager.noModelsFound")}),k()]})]})]})}const Sj=64,wj=2048;function Uje(){const e=Te(),{t}=De(),n=le(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function i(u){let d;return r(u)&&(d=t("modelManager.cannotUseSpaces")),d}const o={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=u=>{e(y2(u)),e(Bh(null))},[s,l]=Ke.useState(!1);return g.jsxs(g.Fragment,{children:[g.jsx(Ye,{"aria-label":t("common.back"),tooltip:t("common.back"),onClick:()=>e(Bh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:g.jsx(WV,{})}),g.jsx(Wje,{}),g.jsx(Gn,{label:t("modelManager.addManually"),isChecked:s,onChange:()=>l(!s)}),s&&g.jsx(P2,{initialValues:o,onSubmit:a,children:({handleSubmit:u,errors:d,touched:p})=>g.jsx("form",{onSubmit:u,children:g.jsxs(hn,{rowGap:"0.5rem",children:[g.jsx(Dt,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelManager.manual")}),g.jsxs(sn,{isInvalid:!!d.name&&p.name,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"name",name:"name",type:"text",validate:i,width:"2xl"}),d.name&&p.name?g.jsx(lr,{children:d.name}):g.jsx(sr,{margin:0,children:t("modelManager.nameValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!d.description&&p.description,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"description",name:"description",type:"text",width:"2xl"}),d.description&&p.description?g.jsx(lr,{children:d.description}):g.jsx(sr,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!d.config&&p.config,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"config",fontSize:"sm",children:t("modelManager.config")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"config",name:"config",type:"text",width:"2xl"}),d.config&&p.config?g.jsx(lr,{children:d.config}):g.jsx(sr,{margin:0,children:t("modelManager.configValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!d.weights&&p.weights,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"config",fontSize:"sm",children:t("modelManager.modelLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"weights",name:"weights",type:"text",width:"2xl"}),d.weights&&p.weights?g.jsx(lr,{children:d.weights}):g.jsx(sr,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!d.vae&&p.vae,children:[g.jsx(Sn,{htmlFor:"vae",fontSize:"sm",children:t("modelManager.vaeLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae",name:"vae",type:"text",width:"2xl"}),d.vae&&p.vae?g.jsx(lr,{children:d.vae}):g.jsx(sr,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),g.jsxs(u2,{width:"100%",children:[g.jsxs(sn,{isInvalid:!!d.width&&p.width,children:[g.jsx(Sn,{htmlFor:"width",fontSize:"sm",children:t("modelManager.width")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{id:"width",name:"width",children:({field:m,form:y})=>g.jsx(lc,{id:"width",name:"width",min:Sj,max:wj,step:64,width:"90%",value:y.values.width,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.width&&p.width?g.jsx(lr,{children:d.width}):g.jsx(sr,{margin:0,children:t("modelManager.widthValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!d.height&&p.height,children:[g.jsx(Sn,{htmlFor:"height",fontSize:"sm",children:t("modelManager.height")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{id:"height",name:"height",children:({field:m,form:y})=>g.jsx(lc,{id:"height",name:"height",min:Sj,max:wj,width:"90%",step:64,value:y.values.height,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.height&&p.height?g.jsx(lr,{children:d.height}):g.jsx(sr,{margin:0,children:t("modelManager.heightValidationMsg")})]})]})]}),g.jsx(On,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelManager.addModel")})]})})})]})}function Tx({children:e}){return g.jsx(_e,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:e})}function Vje(){const e=Te(),{t}=De(),n=le(s=>s.system.isProcessing);function r(s){return/\s/.test(s)}function i(s){let l;return r(s)&&(l=t("modelManager.cannotUseSpaces")),l}const o={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=s=>{const l=s;s.path===""&&delete l.path,s.repo_id===""&&delete l.repo_id,s.vae.path===""&&delete l.vae.path,s.vae.repo_id===""&&delete l.vae.repo_id,e(y2(l)),e(Bh(null))};return g.jsxs(_e,{children:[g.jsx(Ye,{"aria-label":t("common.back"),tooltip:t("common.back"),onClick:()=>e(Bh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:g.jsx(WV,{})}),g.jsx(P2,{initialValues:o,onSubmit:a,children:({handleSubmit:s,errors:l,touched:u})=>{var d,p,m,y,b,w,E,_,k,T;return g.jsx("form",{onSubmit:s,children:g.jsxs(hn,{rowGap:"0.5rem",children:[g.jsx(Tx,{children:g.jsxs(sn,{isInvalid:!!l.name&&u.name,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"name",name:"name",type:"text",validate:i,width:"2xl",isRequired:!0}),l.name&&u.name?g.jsx(lr,{children:l.name}):g.jsx(sr,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),g.jsx(Tx,{children:g.jsxs(sn,{isInvalid:!!l.description&&u.description,isRequired:!0,children:[g.jsx(Sn,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),l.description&&u.description?g.jsx(lr,{children:l.description}):g.jsx(sr,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),g.jsxs(Tx,{children:[g.jsx(Dt,{fontWeight:"bold",fontSize:"sm",children:t("modelManager.formMessageDiffusersModelLocation")}),g.jsx(Dt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelManager.formMessageDiffusersModelLocationDesc")}),g.jsxs(sn,{isInvalid:!!l.path&&u.path,children:[g.jsx(Sn,{htmlFor:"path",fontSize:"sm",children:t("modelManager.modelLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"path",name:"path",type:"text",width:"2xl"}),l.path&&u.path?g.jsx(lr,{children:l.path}):g.jsx(sr,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!l.repo_id&&u.repo_id,children:[g.jsx(Sn,{htmlFor:"repo_id",fontSize:"sm",children:t("modelManager.repo_id")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),l.repo_id&&u.repo_id?g.jsx(lr,{children:l.repo_id}):g.jsx(sr,{margin:0,children:t("modelManager.repoIDValidationMsg")})]})]})]}),g.jsxs(Tx,{children:[g.jsx(Dt,{fontWeight:"bold",children:t("modelManager.formMessageDiffusersVAELocation")}),g.jsx(Dt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelManager.formMessageDiffusersVAELocationDesc")}),g.jsxs(sn,{isInvalid:!!((d=l.vae)!=null&&d.path)&&((p=u.vae)==null?void 0:p.path),children:[g.jsx(Sn,{htmlFor:"vae.path",fontSize:"sm",children:t("modelManager.vaeLocation")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(m=l.vae)!=null&&m.path&&((y=u.vae)!=null&&y.path)?g.jsx(lr,{children:(b=l.vae)==null?void 0:b.path}):g.jsx(sr,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),g.jsxs(sn,{isInvalid:!!((w=l.vae)!=null&&w.repo_id)&&((E=u.vae)==null?void 0:E.repo_id),children:[g.jsx(Sn,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelManager.vaeRepoID")}),g.jsxs(hn,{alignItems:"start",children:[g.jsx(ur,{as:qn,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(_=l.vae)!=null&&_.repo_id&&((k=u.vae)!=null&&k.repo_id)?g.jsx(lr,{children:(T=l.vae)==null?void 0:T.repo_id}):g.jsx(sr,{margin:0,children:t("modelManager.vaeRepoIDValidationMsg")})]})]})]}),g.jsx(On,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelManager.addModel")})]})})}})]})}function Cj({text:e,onClick:t}){return g.jsx(_e,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:t,children:g.jsx(Dt,{fontWeight:"bold",children:e})})}function Gje(){const{isOpen:e,onOpen:t,onClose:n}=Kd(),r=le(s=>s.ui.addNewModelUIOption),i=Te(),{t:o}=De(),a=()=>{n(),i(Bh(null))};return g.jsxs(g.Fragment,{children:[g.jsx(On,{"aria-label":o("modelManager.addNewModel"),tooltip:o("modelManager.addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:g.jsxs(_e,{columnGap:"0.5rem",alignItems:"center",children:[g.jsx(b2,{}),o("modelManager.addNew")]})}),g.jsxs(Yd,{isOpen:e,onClose:a,size:"3xl",closeOnOverlayClick:!1,children:[g.jsx(oc,{}),g.jsxs(Xd,{className:"modal add-model-modal",fontFamily:"Inter",margin:"auto",children:[g.jsx(op,{children:o("modelManager.addNewModel")}),g.jsx(g0,{marginTop:"0.3rem"}),g.jsxs(Xm,{className:"add-model-modal-body",children:[r==null&&g.jsxs(_e,{columnGap:"1rem",children:[g.jsx(Cj,{text:o("modelManager.addCheckpointModel"),onClick:()=>i(Bh("ckpt"))}),g.jsx(Cj,{text:o("modelManager.addDiffuserModel"),onClick:()=>i(Bh("diffusers"))})]}),r=="ckpt"&&g.jsx(Uje,{}),r=="diffusers"&&g.jsx(Vje,{})]})]})]})]})}function Mx(e){const{isProcessing:t,isConnected:n}=le(y=>y.system),r=le(y=>y.system.openModel),{t:i}=De(),o=Te(),{name:a,status:s,description:l}=e,u=()=>{o(NV(a))},d=()=>{o(GR(a))},p=()=>{o(f_e(a)),o(GR(null))},m=()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}};return g.jsxs(_e,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[g.jsx(ao,{onClick:d,cursor:"pointer",children:g.jsx(si,{label:l,hasArrow:!0,placement:"bottom",children:g.jsx(Dt,{fontWeight:"bold",children:a})})}),g.jsx(oH,{onClick:d,cursor:"pointer"}),g.jsxs(_e,{gap:2,alignItems:"center",children:[g.jsx(Dt,{color:m(),children:s}),g.jsx(ss,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelManager.load")}),g.jsx(Ye,{icon:g.jsx(Hke,{}),size:"sm",onClick:d,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),g.jsx(k4,{title:i("modelManager.deleteModel"),acceptCallback:p,acceptButtonText:i("modelManager.delete"),triggerComponent:g.jsx(Ye,{icon:g.jsx(Wke,{}),size:"sm","aria-label":i("modelManager.deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:g.jsxs(_e,{rowGap:"1rem",flexDirection:"column",children:[g.jsx("p",{style:{fontWeight:"bold"},children:i("modelManager.deleteMsg1")}),g.jsx("p",{style:{color:"var(--text-color-secondary"},children:i("modelManager.deleteMsg2")})]})})]})]})}function qje(){const e=Te(),{isOpen:t,onOpen:n,onClose:r}=Kd(),i=le(Y_e),{t:o}=De(),[a,s]=S.useState(Object.keys(i)[0]),[l,u]=S.useState(Object.keys(i)[1]),[d,p]=S.useState("none"),[m,y]=S.useState(""),[b,w]=S.useState(.5),[E,_]=S.useState("weighted_sum"),[k,T]=S.useState("root"),[L,O]=S.useState(""),[D,I]=S.useState(!1),N=Object.keys(i).filter(z=>{if(z!==l&&z!==d)return z}),U=Object.keys(i).filter(z=>{if(z!==a&&z!==d)return z}),B=["none",...Object.keys(i).filter(z=>{if(z!==a&&z!==l)return z})],K=le(z=>z.system.isProcessing),ne=()=>{let z=[a,l,d];z=z.filter(H=>H!=="none");const $={models_to_merge:z,merged_model_name:m!==""?m:z.join("-"),alpha:b,interp:E,model_merge_save_path:k==="root"?null:L,force:D};e(p_e($))};return g.jsxs(g.Fragment,{children:[g.jsx(On,{onClick:n,className:"modal-close-btn",size:"sm",children:g.jsx(_e,{columnGap:"0.5rem",alignItems:"center",children:o("modelManager.mergeModels")})}),g.jsxs(Yd,{isOpen:t,onClose:r,size:"4xl",closeOnOverlayClick:!1,children:[g.jsx(oc,{}),g.jsxs(Xd,{className:"modal",fontFamily:"Inter",margin:"auto",children:[g.jsx(op,{children:o("modelManager.mergeModels")}),g.jsx(g0,{}),g.jsxs(_e,{flexDirection:"column",padding:"1rem",rowGap:4,children:[g.jsxs(_e,{flexDirection:"column",marginBottom:"1rem",padding:"1rem",borderRadius:"0.3rem",backgroundColor:"var(--background-color)",rowGap:1,children:[g.jsx(Dt,{children:o("modelManager.modelMergeHeaderHelp1")}),g.jsx(Dt,{fontSize:"0.9rem",color:"var(--text-color-secondary)",children:o("modelManager.modelMergeHeaderHelp2")})]}),g.jsxs(_e,{columnGap:4,children:[g.jsx(Jo,{label:o("modelManager.modelOne"),validValues:N,onChange:z=>s(z.target.value)}),g.jsx(Jo,{label:o("modelManager.modelTwo"),validValues:U,onChange:z=>u(z.target.value)}),g.jsx(Jo,{label:o("modelManager.modelThree"),validValues:B,onChange:z=>{z.target.value!=="none"?(p(z.target.value),_("add_difference")):(p("none"),_("weighted_sum"))}})]}),g.jsx(qn,{label:o("modelManager.mergedModelName"),value:m,onChange:z=>y(z.target.value)}),g.jsxs(_e,{flexDir:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.2rem",rowGap:2,children:[g.jsx(Dn,{label:o("modelManager.alpha"),min:.01,max:.99,step:.01,value:b,onChange:z=>w(z),withInput:!0,withReset:!0,handleReset:()=>w(.5),withSliderMarks:!0,sliderMarkRightOffset:-7}),g.jsx(Dt,{fontSize:"0.9rem",color:"var(--text-color-secondary)",children:o("modelManager.modelMergeAlphaHelp")})]}),g.jsxs(_e,{columnGap:4,backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.2rem",children:[g.jsx(Dt,{fontWeight:"bold",fontSize:"0.9rem",color:"var(--text-color-secondary)",children:o("modelManager.interpolationType")}),g.jsx(Oy,{value:E,onChange:z=>_(z),children:g.jsx(_e,{columnGap:4,children:d==="none"?g.jsxs(g.Fragment,{children:[g.jsx(Vo,{value:"weighted_sum",children:"weighted_sum"}),g.jsx(Vo,{value:"sigmoid",children:"sigmoid"}),g.jsx(Vo,{value:"inv_sigmoid",children:"inv_sigmoid"})]}):g.jsx(Vo,{value:"add_difference",children:g.jsx(si,{label:o("modelmanager:modelMergeInterpAddDifferenceHelp"),children:"add_difference"})})})})]}),g.jsxs(_e,{gap:4,flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.2rem",children:[g.jsxs(_e,{columnGap:4,children:[g.jsx(Dt,{fontWeight:"bold",fontSize:"0.9rem",color:"var(--text-color-secondary)",children:o("modelManager.mergedModelSaveLocation")}),g.jsx(Oy,{value:k,onChange:z=>T(z),children:g.jsxs(_e,{columnGap:4,children:[g.jsx(Vo,{value:"root",children:o("modelManager.invokeAIFolder")}),g.jsx(Vo,{value:"custom",children:o("modelManager.custom")})]})})]}),k==="custom"&&g.jsx(qn,{label:o("modelManager.mergedModelCustomSaveLocation"),value:L,onChange:z=>O(z.target.value)})]}),g.jsx(Gn,{label:o("modelManager.ignoreMismatch"),isChecked:D,onChange:z=>I(z.target.checked),fontWeight:"bold"}),g.jsx(On,{onClick:ne,isLoading:K,isDisabled:k==="custom"&&L==="",className:"modal modal-close-btn",children:o("modelManager.merge")})]})]})]})]})}const Kje=lt(hr,e=>Pe.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:Pe.isEqual}});function g6({label:e,isActive:t,onClick:n}){return g.jsx(On,{onClick:n,isActive:t,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:e})}const Yje=()=>{const e=le(Kje),[t,n]=Ke.useState(!1);Ke.useEffect(()=>{const m=setTimeout(()=>{n(!0)},200);return()=>clearTimeout(m)},[]);const[r,i]=S.useState(""),[o,a]=S.useState("all"),[s,l]=S.useTransition(),{t:u}=De(),d=m=>{l(()=>{i(m.target.value)})},p=S.useMemo(()=>{const m=[],y=[],b=[],w=[];return e.forEach((E,_)=>{E.name.toLowerCase().includes(r.toLowerCase())&&(b.push(g.jsx(Mx,{name:E.name,status:E.status,description:E.description},_)),E.format===o&&w.push(g.jsx(Mx,{name:E.name,status:E.status,description:E.description},_))),E.format!=="diffusers"?m.push(g.jsx(Mx,{name:E.name,status:E.status,description:E.description},_)):y.push(g.jsx(Mx,{name:E.name,status:E.status,description:E.description},_))}),r!==""?o==="all"?g.jsx(ao,{marginTop:"1rem",children:b}):g.jsx(ao,{marginTop:"1rem",children:w}):g.jsxs(_e,{flexDirection:"column",rowGap:"1.5rem",children:[o==="all"&&g.jsxs(g.Fragment,{children:[g.jsxs(ao,{children:[g.jsx(Dt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:u("modelManager.checkpointModels")}),m]}),g.jsxs(ao,{children:[g.jsx(Dt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:u("modelManager.diffusersModels")}),y]})]}),o==="ckpt"&&g.jsx(_e,{flexDirection:"column",marginTop:"1rem",children:m}),o==="diffusers"&&g.jsx(_e,{flexDirection:"column",marginTop:"1rem",children:y})]})},[e,r,u,o]);return g.jsxs(_e,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[g.jsxs(_e,{justifyContent:"space-between",children:[g.jsx(Dt,{fontSize:"1.4rem",fontWeight:"bold",children:u("modelManager.availableModels")}),g.jsxs(_e,{gap:2,children:[g.jsx(Gje,{}),g.jsx(qje,{})]})]}),g.jsx(qn,{onChange:d,label:u("modelManager.search")}),g.jsxs(_e,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[g.jsxs(_e,{columnGap:"0.5rem",children:[g.jsx(g6,{label:u("modelManager.allModels"),onClick:()=>a("all"),isActive:o==="all"}),g.jsx(g6,{label:u("modelManager.checkpointModels"),onClick:()=>a("ckpt"),isActive:o==="ckpt"}),g.jsx(g6,{label:u("modelManager.diffusersModels"),onClick:()=>a("diffusers"),isActive:o==="diffusers"})]}),t?p:g.jsx(_e,{width:"100%",minHeight:"30rem",justifyContent:"center",alignItems:"center",children:g.jsx(h0,{})})]})]})};function Xje({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Kd(),i=le(s=>s.system.model_list),o=le(s=>s.system.openModel),{t:a}=De();return g.jsxs(g.Fragment,{children:[S.cloneElement(e,{onClick:n}),g.jsxs(Yd,{isOpen:t,onClose:r,size:"6xl",children:[g.jsx(oc,{}),g.jsxs(Xd,{className:"modal",fontFamily:"Inter",children:[g.jsx(g0,{className:"modal-close-btn"}),g.jsx(op,{fontWeight:"bold",children:a("modelManager.modelManager")}),g.jsxs(_e,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[g.jsx(Yje,{}),o&&i[o].format==="diffusers"?g.jsx(zje,{}):g.jsx(Fje,{})]})]})]})]})}const Zje=lt([hr],e=>{const{isProcessing:t,model_list:n}=e;return{models:Pe.map(n,(i,o)=>o),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),Qje=()=>{const e=Te(),{models:t,isProcessing:n}=le(Zje),r=le(UV),i=o=>{e(NV(o.target.value))};return g.jsx(_e,{style:{paddingLeft:"0.3rem"},children:g.jsx(Jo,{style:{fontSize:"0.8rem"},tooltip:r.description,isDisabled:n,value:r.name,validValues:t,onChange:i})})},Jje=lt([hr,fp],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l,shouldUseSliders:u}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:Pe.map(o,(d,p)=>p),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l,shouldUseSliders:u}},{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),eNe=({children:e})=>{const t=Te(),{t:n}=De(),r=le(T=>T.generation.steps),{isOpen:i,onOpen:o,onClose:a}=Kd(),{isOpen:s,onOpen:l,onClose:u}=Kd(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:p,shouldDisplayGuides:m,saveIntermediatesInterval:y,enableImageDebugging:b,shouldUseCanvasBetaLayout:w,shouldUseSliders:E}=le(Jje),_=()=>{BV.purge().then(()=>{a(),l()})},k=T=>{T>r&&(T=r),T<1&&(T=1),t(_4e(T))};return g.jsxs(g.Fragment,{children:[S.cloneElement(e,{onClick:o}),g.jsxs(Yd,{isOpen:i,onClose:a,size:"lg",children:[g.jsx(oc,{}),g.jsxs(Xd,{className:"modal settings-modal",children:[g.jsx(op,{className:"settings-modal-header",children:n("common.settingsLabel")}),g.jsx(g0,{className:"modal-close-btn"}),g.jsxs(Xm,{className:"settings-modal-content",children:[g.jsxs("div",{className:"settings-modal-items",children:[g.jsxs("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[g.jsx(Jo,{label:n("settings.displayInProgress"),validValues:I5e,value:d,onChange:T=>t(g4e(T.target.value))}),d==="full-res"&&g.jsx(lc,{label:n("settings.saveSteps"),min:1,max:r,step:1,onChange:k,value:y,width:"auto",textAlign:"center"})]}),g.jsx(_a,{styleClass:"settings-modal-item",label:n("settings.confirmOnDelete"),isChecked:p,onChange:T=>t(RU(T.target.checked))}),g.jsx(_a,{styleClass:"settings-modal-item",label:n("settings.displayHelpIcons"),isChecked:m,onChange:T=>t(b4e(T.target.checked))}),g.jsx(_a,{styleClass:"settings-modal-item",label:n("settings.useCanvasBeta"),isChecked:w,onChange:T=>t(N4e(T.target.checked))}),g.jsx(_a,{styleClass:"settings-modal-item",label:n("settings.useSlidersForAll"),isChecked:E,onChange:T=>t(F4e(T.target.checked))})]}),g.jsxs("div",{className:"settings-modal-items",children:[g.jsx("h2",{style:{fontWeight:"bold"},children:"Developer"}),g.jsx(_a,{styleClass:"settings-modal-item",label:n("settings.enableImageDebugging"),isChecked:b,onChange:T=>t(k4e(T.target.checked))})]}),g.jsxs("div",{className:"settings-modal-reset",children:[g.jsx(jh,{size:"md",children:n("settings.resetWebUI")}),g.jsx(ss,{colorScheme:"red",onClick:_,children:n("settings.resetWebUI")}),g.jsx(Dt,{children:n("settings.resetWebUIDesc1")}),g.jsx(Dt,{children:n("settings.resetWebUIDesc2")})]})]}),g.jsx(Hw,{children:g.jsx(ss,{onClick:a,className:"modal-close-btn",children:n("common.close")})})]})]}),g.jsxs(Yd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[g.jsx(oc,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),g.jsx(Xd,{children:g.jsx(Xm,{pb:6,pt:6,children:g.jsx(_e,{justifyContent:"center",children:g.jsx(Dt,{fontSize:"lg",children:g.jsx(Dt,{children:n("settings.resetComplete")})})})})})]})]})},tNe=lt(hr,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:Pe.isEqual}}),nNe=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=le(tNe),s=Te(),{t:l}=De();let u;e&&!o?u="status-good":u="status-bad";let d=i;[l("common.statusGenerating"),l("common.statusPreparing"),l("common.statusSavingImage"),l("common.statusRestoringFaces"),l("common.statusUpscaling")].includes(d)&&(u="status-working"),d&&t&&r>1&&(d=`${l(d)} (${n}/${r})`);const m=o&&!a?"Click to clear, check logs for details":void 0,y=o&&!a?"pointer":"initial",b=()=>{(o||!a)&&s(IU())};return g.jsx(si,{label:m,children:g.jsx(Dt,{cursor:y,onClick:b,className:`status ${u}`,children:l(d)})})};function rNe(){const{t:e}=De(),{setColorMode:t,colorMode:n}=Jy(),r=Te(),i=le(l=>l.ui.currentTheme),o={dark:e("common.darkTheme"),light:e("common.lightTheme"),green:e("common.greenTheme")};S.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(O4e(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(g.jsx(On,{style:{width:"6rem"},leftIcon:i===u?g.jsx(FE,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ye,{"aria-label":e("common.themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:g.jsx(Tke,{})}),children:g.jsx(hn,{align:"stretch",children:s()})})}function iNe(){const{t:e,i18n:t}=De(),n={ar:e("common.langArabic",{lng:"ar"}),nl:e("common.langDutch",{lng:"nl"}),en:e("common.langEnglish",{lng:"en"}),fr:e("common.langFrench",{lng:"fr"}),de:e("common.langGerman",{lng:"de"}),it:e("common.langItalian",{lng:"it"}),ja:e("common.langJapanese",{lng:"ja"}),pl:e("common.langPolish",{lng:"pl"}),pt_Br:e("common.langBrPortuguese",{lng:"pt_Br"}),ru:e("common.langRussian",{lng:"ru"}),zh_Cn:e("common.langSimplifiedChinese",{lng:"zh_Cn"}),es:e("common.langSpanish",{lng:"es"}),uk:e("common.langUkranian",{lng:"ua"})},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(g.jsx(On,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return g.jsx(Ys,{trigger:"hover",triggerComponent:g.jsx(Ye,{"aria-label":e("common.languagePickerLabel"),tooltip:e("common.languagePickerLabel"),icon:g.jsx(kke,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:g.jsx(hn,{children:r()})})}const oNe=()=>{const{t:e}=De(),t=le(n=>n.system.app_version);return g.jsxs("div",{className:"site-header",children:[g.jsxs("div",{className:"site-header-left-side",children:[g.jsx("img",{src:hq,alt:"invoke-ai-logo"}),g.jsxs(_e,{alignItems:"center",columnGap:"0.6rem",children:[g.jsxs(Dt,{fontSize:"1.4rem",children:["invoke ",g.jsx("strong",{children:"ai"})]}),g.jsx(Dt,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),g.jsxs("div",{className:"site-header-right-side",children:[g.jsx(nNe,{}),g.jsx(Qje,{}),g.jsx(Xje,{children:g.jsx(Ye,{"aria-label":e("modelManager.modelManager"),tooltip:e("modelManager.modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:g.jsx(vke,{})})}),g.jsx(UAe,{children:g.jsx(Ye,{"aria-label":e("common.hotkeysLabel"),tooltip:e("common.hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:g.jsx(_ke,{})})}),g.jsx(rNe,{}),g.jsx(iNe,{}),g.jsx(Ye,{"aria-label":e("common.reportBugLabel"),tooltip:e("common.reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:g.jsx(Nh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:g.jsx(mke,{})})}),g.jsx(Ye,{"aria-label":e("common.githubLabel"),tooltip:e("common.githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:g.jsx(Nh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:g.jsx(dke,{})})}),g.jsx(Ye,{"aria-label":e("common.discordLabel"),tooltip:e("common.discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:g.jsx(Nh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:g.jsx(cke,{})})}),g.jsx(eNe,{children:g.jsx(Ye,{"aria-label":e("common.settingsLabel"),tooltip:e("common.settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:g.jsx(i7e,{})})})]})]})};function aNe(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const sNe=()=>{const e=Te(),t=le(K_e),n=s2();S.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(P4e())},[e,n,t])},lNe=()=>{const e=Te(),{shouldShowGalleryButton:t,shouldPinGallery:n}=le(iP),r=()=>{e(Am(!0)),n&&e(Li(!0))};return t?g.jsx(Ye,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:r,children:g.jsx(hG,{})}):null};aNe();const uNe=()=>(sNe(),g.jsxs("div",{className:"App",children:[g.jsxs(NAe,{children:[g.jsx(HAe,{}),g.jsxs("div",{className:"app-content",children:[g.jsx(oNe,{}),g.jsx(HLe,{})]}),g.jsx("div",{className:"app-console",children:g.jsx(BAe,{})})]}),g.jsx(GEe,{}),g.jsx(lNe,{})]})),_j=()=>g.jsx(_e,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:g.jsx(h0,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})});const cNe=Hj({key:"invokeai-style-cache",prepend:!0});ok.createRoot(document.getElementById("root")).render(g.jsx(Ke.StrictMode,{children:g.jsx(hxe,{store:FV,children:g.jsx(vW,{loading:g.jsx(_j,{}),persistor:BV,children:g.jsx(lee,{value:cNe,children:g.jsx(Oge,{children:g.jsx(Ke.Suspense,{fallback:g.jsx(_j,{}),children:g.jsx(uNe,{})})})})})})})); diff --git a/invokeai/frontend/dist/index.html b/invokeai/frontend/dist/index.html index e54c24dfbc..b24610d59e 100644 --- a/invokeai/frontend/dist/index.html +++ b/invokeai/frontend/dist/index.html @@ -5,7 +5,7 @@ InvokeAI - A Stable Diffusion Toolkit - + diff --git a/invokeai/frontend/dist/locales/en.json b/invokeai/frontend/dist/locales/en.json index 9ba4f5ba83..c9a3f48c47 100644 --- a/invokeai/frontend/dist/locales/en.json +++ b/invokeai/frontend/dist/locales/en.json @@ -441,6 +441,7 @@ "infillScalingHeader": "Infill and Scaling", "img2imgStrength": "Image To Image Strength", "toggleLoopback": "Toggle Loopback", + "symmetry": "Symmetry", "hSymmetryStep": "H Symmetry Step", "vSymmetryStep": "V Symmetry Step", "invoke": "Invoke", diff --git a/invokeai/frontend/public/locales/en.json b/invokeai/frontend/public/locales/en.json index 9ba4f5ba83..c9a3f48c47 100644 --- a/invokeai/frontend/public/locales/en.json +++ b/invokeai/frontend/public/locales/en.json @@ -441,6 +441,7 @@ "infillScalingHeader": "Infill and Scaling", "img2imgStrength": "Image To Image Strength", "toggleLoopback": "Toggle Loopback", + "symmetry": "Symmetry", "hSymmetryStep": "H Symmetry Step", "vSymmetryStep": "V Symmetry Step", "invoke": "Invoke", diff --git a/invokeai/frontend/src/common/util/parameterTranslation.ts b/invokeai/frontend/src/common/util/parameterTranslation.ts index 95be5a8717..f703a96f4a 100644 --- a/invokeai/frontend/src/common/util/parameterTranslation.ts +++ b/invokeai/frontend/src/common/util/parameterTranslation.ts @@ -65,8 +65,8 @@ export type BackendGenerationParameters = { with_variations?: Array>; variation_amount?: number; enable_image_debugging?: boolean; - h_symmetry_time_pct: number; - v_symmetry_time_pct: number; + h_symmetry_time_pct?: number; + v_symmetry_time_pct?: number; }; export type BackendEsrGanParameters = { @@ -143,6 +143,7 @@ export const frontendToBackendParameters = ( tileSize, variationAmount, width, + shouldUseSymmetry, horizontalSymmetryTimePercentage, verticalSymmetryTimePercentage, } = generationState; @@ -169,23 +170,11 @@ export const frontendToBackendParameters = ( save_intermediates: saveIntermediatesInterval, generation_mode: generationMode, init_mask: '', - h_symmetry_time_pct: horizontalSymmetryTimePercentage, - v_symmetry_time_pct: verticalSymmetryTimePercentage, }; let esrganParameters: false | BackendEsrGanParameters = false; let facetoolParameters: false | BackendFacetoolParameters = false; - generationParameters.h_symmetry_time_pct = Math.max( - 0, - Math.min(1, horizontalSymmetryTimePercentage / steps) - ); - - generationParameters.v_symmetry_time_pct = Math.max( - 0, - Math.min(1, verticalSymmetryTimePercentage / steps) - ); - if (negativePrompt !== '') { generationParameters.prompt = `${prompt} [${negativePrompt}]`; } @@ -194,6 +183,23 @@ export const frontendToBackendParameters = ( ? randomInt(NUMPY_RAND_MIN, NUMPY_RAND_MAX) : seed; + // Symmetry Settings + if (shouldUseSymmetry) { + if (horizontalSymmetryTimePercentage > 0) { + generationParameters.h_symmetry_time_pct = Math.max( + 0, + Math.min(1, horizontalSymmetryTimePercentage / steps) + ); + } + + if (horizontalSymmetryTimePercentage > 0) { + generationParameters.v_symmetry_time_pct = Math.max( + 0, + Math.min(1, verticalSymmetryTimePercentage / steps) + ); + } + } + // txt2img exclusive parameters if (generationMode === 'txt2img') { generationParameters.hires_fix = hiresFix; diff --git a/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/ImageToImageOutputSettings.tsx b/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/ImageToImageOutputSettings.tsx index 1d9e935a8d..f037e79523 100644 --- a/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/ImageToImageOutputSettings.tsx +++ b/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/ImageToImageOutputSettings.tsx @@ -1,12 +1,10 @@ import { Flex } from '@chakra-ui/react'; import SeamlessSettings from './SeamlessSettings'; -import SymmetrySettings from './SymmetrySettings'; const ImageToImageOutputSettings = () => { return ( - ); }; diff --git a/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/OutputSettings.tsx b/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/OutputSettings.tsx index e2a60c2f37..1eaba1eaae 100644 --- a/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/OutputSettings.tsx +++ b/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/OutputSettings.tsx @@ -1,14 +1,12 @@ import { Flex } from '@chakra-ui/react'; import HiresSettings from './HiresSettings'; import SeamlessSettings from './SeamlessSettings'; -import SymmetrySettings from './SymmetrySettings'; const OutputSettings = () => { return ( - ); }; diff --git a/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/SymmetrySettings.tsx b/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/SymmetrySettings.tsx index 2214594190..37bb7bdbda 100644 --- a/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/SymmetrySettings.tsx +++ b/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/SymmetrySettings.tsx @@ -32,7 +32,6 @@ export default function SymmetrySettings() { max={steps} step={1} withInput - inputWidth="6.5rem" withSliderMarks withReset handleReset={() => dispatch(setHorizontalSymmetryTimePercentage(0))} @@ -46,7 +45,6 @@ export default function SymmetrySettings() { max={steps} step={1} withInput - inputWidth="6.5rem" withSliderMarks withReset handleReset={() => dispatch(setVerticalSymmetryTimePercentage(0))} diff --git a/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/SymmetryToggle.tsx b/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/SymmetryToggle.tsx new file mode 100644 index 0000000000..9446271a0e --- /dev/null +++ b/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Output/SymmetryToggle.tsx @@ -0,0 +1,19 @@ +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; +import IAISwitch from 'common/components/IAISwitch'; +import { setShouldUseSymmetry } from 'features/parameters/store/generationSlice'; + +export default function SymmetryToggle() { + const shouldUseSymmetry = useAppSelector( + (state: RootState) => state.generation.shouldUseSymmetry + ); + + const dispatch = useAppDispatch(); + + return ( + dispatch(setShouldUseSymmetry(e.target.checked))} + /> + ); +} diff --git a/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Seed/Threshold.tsx b/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Seed/Threshold.tsx index fa7fc6ea88..ea1721fc61 100644 --- a/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Seed/Threshold.tsx +++ b/invokeai/frontend/src/features/parameters/components/AdvancedParameters/Seed/Threshold.tsx @@ -23,7 +23,7 @@ export default function Threshold() { withInput withReset withSliderMarks - inputWidth="6rem" + sliderMarkRightOffset={-4} /> ); } diff --git a/invokeai/frontend/src/features/parameters/store/generationSlice.ts b/invokeai/frontend/src/features/parameters/store/generationSlice.ts index f057f56ba3..e05c49f3f7 100644 --- a/invokeai/frontend/src/features/parameters/store/generationSlice.ts +++ b/invokeai/frontend/src/features/parameters/store/generationSlice.ts @@ -32,6 +32,7 @@ export interface GenerationState { tileSize: number; variationAmount: number; width: number; + shouldUseSymmetry: boolean; horizontalSymmetryTimePercentage: number; verticalSymmetryTimePercentage: number; } @@ -62,6 +63,7 @@ const initialGenerationState: GenerationState = { tileSize: 32, variationAmount: 0.1, width: 512, + shouldUseSymmetry: false, horizontalSymmetryTimePercentage: 0, verticalSymmetryTimePercentage: 0, }; @@ -329,6 +331,9 @@ export const generationSlice = createSlice({ setInfillMethod: (state, action: PayloadAction) => { state.infillMethod = action.payload; }, + setShouldUseSymmetry: (state, action: PayloadAction) => { + state.shouldUseSymmetry = action.payload; + }, setHorizontalSymmetryTimePercentage: ( state, action: PayloadAction @@ -378,6 +383,7 @@ export const { setTileSize, setVariationAmount, setWidth, + setShouldUseSymmetry, setHorizontalSymmetryTimePercentage, setVerticalSymmetryTimePercentage, } = generationSlice.actions; diff --git a/invokeai/frontend/src/features/ui/components/ImageToImage/ImageToImagePanel.tsx b/invokeai/frontend/src/features/ui/components/ImageToImage/ImageToImagePanel.tsx index c2f5fc349b..531e95f161 100644 --- a/invokeai/frontend/src/features/ui/components/ImageToImage/ImageToImagePanel.tsx +++ b/invokeai/frontend/src/features/ui/components/ImageToImage/ImageToImagePanel.tsx @@ -3,6 +3,8 @@ import { Feature } from 'app/features'; import FaceRestoreSettings from 'features/parameters/components/AdvancedParameters/FaceRestore/FaceRestoreSettings'; import FaceRestoreToggle from 'features/parameters/components/AdvancedParameters/FaceRestore/FaceRestoreToggle'; import ImageToImageOutputSettings from 'features/parameters/components/AdvancedParameters/Output/ImageToImageOutputSettings'; +import SymmetrySettings from 'features/parameters/components/AdvancedParameters/Output/SymmetrySettings'; +import SymmetryToggle from 'features/parameters/components/AdvancedParameters/Output/SymmetryToggle'; import SeedSettings from 'features/parameters/components/AdvancedParameters/Seed/SeedSettings'; import UpscaleSettings from 'features/parameters/components/AdvancedParameters/Upscale/UpscaleSettings'; import UpscaleToggle from 'features/parameters/components/AdvancedParameters/Upscale/UpscaleToggle'; @@ -44,6 +46,11 @@ export default function ImageToImagePanel() { content: , additionalHeaderComponents: , }, + symmetry: { + header: `${t('parameters.symmetry')}`, + content: , + additionalHeaderComponents: , + }, other: { header: `${t('parameters.otherOptions')}`, feature: Feature.OTHER, diff --git a/invokeai/frontend/src/features/ui/components/TextToImage/TextToImagePanel.tsx b/invokeai/frontend/src/features/ui/components/TextToImage/TextToImagePanel.tsx index 4bdadb0a02..ee9f7ace3f 100644 --- a/invokeai/frontend/src/features/ui/components/TextToImage/TextToImagePanel.tsx +++ b/invokeai/frontend/src/features/ui/components/TextToImage/TextToImagePanel.tsx @@ -3,6 +3,8 @@ import { Feature } from 'app/features'; import FaceRestoreSettings from 'features/parameters/components/AdvancedParameters/FaceRestore/FaceRestoreSettings'; import FaceRestoreToggle from 'features/parameters/components/AdvancedParameters/FaceRestore/FaceRestoreToggle'; import OutputSettings from 'features/parameters/components/AdvancedParameters/Output/OutputSettings'; +import SymmetrySettings from 'features/parameters/components/AdvancedParameters/Output/SymmetrySettings'; +import SymmetryToggle from 'features/parameters/components/AdvancedParameters/Output/SymmetryToggle'; import SeedSettings from 'features/parameters/components/AdvancedParameters/Seed/SeedSettings'; import UpscaleSettings from 'features/parameters/components/AdvancedParameters/Upscale/UpscaleSettings'; import UpscaleToggle from 'features/parameters/components/AdvancedParameters/Upscale/UpscaleToggle'; @@ -43,6 +45,11 @@ export default function TextToImagePanel() { content: , additionalHeaderComponents: , }, + symmetry: { + header: `${t('parameters.symmetry')}`, + content: , + additionalHeaderComponents: , + }, other: { header: `${t('parameters.otherOptions')}`, feature: Feature.OTHER, diff --git a/invokeai/frontend/src/features/ui/components/UnifiedCanvas/UnifiedCanvasOtherSettings.tsx b/invokeai/frontend/src/features/ui/components/UnifiedCanvas/UnifiedCanvasOtherSettings.tsx deleted file mode 100644 index 3c1698ecd8..0000000000 --- a/invokeai/frontend/src/features/ui/components/UnifiedCanvas/UnifiedCanvasOtherSettings.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import SymmetrySettings from 'features/parameters/components/AdvancedParameters/Output/SymmetrySettings'; - -export default function UnifiedCanvasOtherSettings() { - return ; -} diff --git a/invokeai/frontend/src/features/ui/components/UnifiedCanvas/UnifiedCanvasPanel.tsx b/invokeai/frontend/src/features/ui/components/UnifiedCanvas/UnifiedCanvasPanel.tsx index 680faf9357..392648075e 100644 --- a/invokeai/frontend/src/features/ui/components/UnifiedCanvas/UnifiedCanvasPanel.tsx +++ b/invokeai/frontend/src/features/ui/components/UnifiedCanvas/UnifiedCanvasPanel.tsx @@ -5,6 +5,8 @@ import BoundingBoxSettings from 'features/parameters/components/AdvancedParamete import InfillAndScalingSettings from 'features/parameters/components/AdvancedParameters/Canvas/InfillAndScalingSettings'; import SeamCorrectionSettings from 'features/parameters/components/AdvancedParameters/Canvas/SeamCorrection/SeamCorrectionSettings'; import ImageToImageStrength from 'features/parameters/components/AdvancedParameters/ImageToImage/ImageToImageStrength'; +import SymmetrySettings from 'features/parameters/components/AdvancedParameters/Output/SymmetrySettings'; +import SymmetryToggle from 'features/parameters/components/AdvancedParameters/Output/SymmetryToggle'; import SeedSettings from 'features/parameters/components/AdvancedParameters/Seed/SeedSettings'; import GenerateVariationsToggle from 'features/parameters/components/AdvancedParameters/Variations/GenerateVariations'; import VariationsSettings from 'features/parameters/components/AdvancedParameters/Variations/VariationsSettings'; @@ -15,7 +17,6 @@ import NegativePromptInput from 'features/parameters/components/PromptInput/Nega import PromptInput from 'features/parameters/components/PromptInput/PromptInput'; import InvokeOptionsPanel from 'features/ui/components/InvokeParametersPanel'; import { useTranslation } from 'react-i18next'; -import UnifiedCanvasOtherSettings from './UnifiedCanvasOtherSettings'; export default function UnifiedCanvasPanel() { const { t } = useTranslation(); @@ -47,9 +48,10 @@ export default function UnifiedCanvasPanel() { content: , additionalHeaderComponents: , }, - output: { - header: `${t('parameters.otherOptions')}`, - content: , + symmetry: { + header: `${t('parameters.symmetry')}`, + content: , + additionalHeaderComponents: , }, }; diff --git a/invokeai/frontend/stats.html b/invokeai/frontend/stats.html index 4a7bcf1e8c..2fd7a3a52c 100644 --- a/invokeai/frontend/stats.html +++ b/invokeai/frontend/stats.html @@ -6157,7 +6157,7 @@ var drawChart = (function (exports) {