mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
170 lines
831 KiB
JavaScript
170 lines
831 KiB
JavaScript
import{t as s0,b as mE,r as gE,i as vE,a as yE,c as bE,d as I4,e as E4,f as O4,g as xE,h as SE,j as wE,k as CE,l as _E,m as kE,n as jE,o as PE,s as IE,p as EE,q as f,u as rt,v as a,I as oo,w as ar,x as Wn,y as Ue,z as Ot,A as ku,B as xt,C as ju,D as Os,E as vo,F as Yr,G as vr,H as OE,J as gv,K as RE,L as Ja,M as tu,N as Xi,O as sn,P as ja,Q as th,R as vv,S as Al,T as yv,U as lc,_ as Jn,V as ME,W as z,X as R4,Y as M4,Z as nx,$ as D4,a0 as nh,a1 as bv,a2 as cc,a3 as DE,a4 as TE,a5 as AE,a6 as NE,a7 as T4,a8 as A4,a9 as rh,aa as Ef,ab as $E,ac as zE,ad as tg,ae as rx,af as N4,ag as $4,ah as uc,ai as ox,aj as sx,ak as LE,al as FE,am as BE,an as HE,ao as VE,ap as ng,aq as ml,ar as rg,as as WE,at as UE,au as GE,av as xv,aw as oh,ax as Of,ay as qE,az as z4,aA as L4,aB as KE,aC as Pu,aD as Sv,aE as YE,aF as QE,aG as XE,aH as ZE,aI as JE,aJ as e8,aK as t8,aL as ax,aM as Be,aN as G,aO as ca,aP as we,aQ as yo,aR as yr,aS as ne,aT as L,aU as Iu,aV as pe,aW as F4,aX as B4,aY as dc,aZ as Qr,a_ as ot,a$ as fr,b0 as Rf,b1 as n8,b2 as ei,b3 as wv,b4 as Mf,b5 as H4,b6 as Cv,b7 as Tt,b8 as _v,b9 as r8,ba as o8,bb as s8,bc as gl,bd as Cs,be as V4,bf as a8,bg as i8,bh as Eu,bi as ut,bj as kv,bk as ti,bl as ix,bm as l8,bn as c8,bo as u8,bp as xf,bq as Ae,br as Rd,bs as Md,bt as nu,bu as ru,bv as lx,bw as Df,bx as cx,by as Tf,bz as ux,bA as a0,bB as dx,bC as i0,bD as fx,bE as Af,bF as px,bG as Gl,bH as hx,bI as ql,bJ as mx,bK as Nf,bL as d8,bM as $f,bN as W4,bO as jv,bP as Pv,bQ as f8,bR as U4,bS as G4,bT as q4,bU as sh,bV as Ii,bW as p8,bX as h8,bY as m8,bZ as g8,b_ as zf,b$ as fc,c0 as K4,c1 as v8,c2 as Y4,c3 as gx,c4 as vx,c5 as y8,c6 as va,c7 as yx,c8 as yt,c9 as Lf,ca as b8,cb as Q4,cc as Xr,cd as x8,ce as er,cf as Yt,cg as l0,ch as qs,ci as Vn,cj as Zn,ck as X4,cl as S8,cm as Z4,cn as bx,co as w8,cp as C8,cq as _8,cr as k8,cs as wr,ct as J4,cu as j8,cv as P8,cw as I8,cx as E8,cy as O8,cz as Iv,cA as Zo,cB as e3,cC as t3,cD as R8,cE as xx,cF as M8,cG as D8,cH as T8,cI as A8,cJ as N8,cK as $8,cL as z8,cM as n3,cN as L8,cO as F8,cP as B8,cQ as H8,cR as V8,cS as W8,cT as U8,cU as Sx,cV as wx,cW as Cx,cX as _x,cY as G8,cZ as q8,c_ as K8,c$ as kx,d0 as Y8,d1 as Q8,d2 as X8,d3 as Z8,d4 as J8,d5 as eO,d6 as tO,d7 as nO,d8 as r3,d9 as es,da as rO,db as oO,dc as sO,dd as ah,de as aO,df as Fr,dg as Ev,dh as o3,di as iO,dj as lO,dk as cO,dl as ts,dm as uO,dn as jx,dp as Px,dq as ni,dr as dO,ds as fO,dt as pO,du as hO,dv as mO,dw as gO,dx as vO,dy as yO,dz as bO,dA as xO,dB as SO,dC as Ov,dD as Rv,dE as wO,dF as Ix,dG as CO,dH as Ex,dI as ns,dJ as _O,dK as kO,dL as Ox,dM as Rx,dN as jO,dO as Mx,dP as PO,dQ as IO,dR as EO,dS as OO,dT as RO,dU as MO,dV as s3,dW as a3,dX as i3,dY as l3,dZ as c3,d_ as Ou,d$ as Dx,e0 as DO,e1 as Kl,e2 as TO,e3 as u3,e4 as Tx,e5 as AO,e6 as ms,e7 as NO,e8 as $O,e9 as d3,ea as f3,eb as zO,ec as Ax,ed as LO,ee as FO,ef as BO,eg as Eo,eh as Ff,ei as HO,ej as Nx,ek as _s,el as ks,em as VO,en as p3,eo as WO,ep as ih,eq as $x,er as h3,es as UO,et as zx,eu as m3,ev as Jo,ew as GO,ex as qO,ey as g3,ez as KO,eA as YO,eB as QO,eC as XO,eD as ZO,eE as JO,eF as e7,eG as t7,eH as n7,eI as r7,eJ as o7,eK as s7,eL as a7,eM as i7,eN as l7,eO as c7,eP as u7,eQ as Lx,eR as d7,eS as Fx,eT as Sf,eU as f7,eV as tn,eW as Bf,eX as v3,eY as Hf,eZ as p7,e_ as h7,e$ as Gs,f0 as y3,f1 as Mv,f2 as Ru,f3 as m7,f4 as g7,f5 as v7,f6 as ya,f7 as b3,f8 as y7,f9 as b7,fa as x3,fb as x7,fc as S7,fd as w7,fe as C7,ff as _7,fg as k7,fh as j7,fi as P7,fj as I7,fk as E7,fl as O7,fm as Bx,fn as R7,fo as M7,fp as D7,fq as T7,fr as A7,fs as N7,ft as og,fu as Us,fv as Dd,fw as sg,fx as ag,fy as Td,fz as Hx,fA as c0,fB as $7,fC as z7,fD as L7,fE as F7,fF as B7,fG as Vf,fH as S3,fI as w3,fJ as H7,fK as V7,fL as C3,fM as _3,fN as k3,fO as j3,fP as P3,fQ as I3,fR as E3,fS as O3,fT as Nl,fU as $l,fV as R3,fW as M3,fX as W7,fY as D3,fZ as T3,f_ as A3,f$ as N3,g0 as $3,g1 as z3,g2 as L3,g3 as Dv,g4 as U7,g5 as G7,g6 as Vx,g7 as q7,g8 as K7,g9 as Wf,ga as Wx,gb as Ux,gc as Gx,gd as qx,ge as Y7,gf as Q7,gg as X7,gh as Z7,gi as J7,gj as eR,gk as tR,gl as nR,gm as rR,gn as oR}from"./index-8888b06f.js";import{u as F3,a as Pa,b as sR,r as Le,f as aR,g as Kx,c as Nt,d as br}from"./MantineProvider-cf4c9af9.js";function iR(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Yx=1/0,lR=17976931348623157e292;function ig(e){if(!e)return e===0?e:0;if(e=s0(e),e===Yx||e===-Yx){var t=e<0?-1:1;return t*lR}return e===e?e:0}var cR=4;function Qx(e){return mE(e,cR)}var uR=function(){return gE.Date.now()};const lg=uR;var dR="Expected a function",fR=Math.max,pR=Math.min;function hR(e,t,n){var r,o,s,i,u,d,p=0,m=!1,h=!1,v=!0;if(typeof e!="function")throw new TypeError(dR);t=s0(t)||0,vE(n)&&(m=!!n.leading,h="maxWait"in n,s=h?fR(s0(n.maxWait)||0,t):s,v="trailing"in n?!!n.trailing:v);function b(R){var O=r,D=o;return r=o=void 0,p=R,i=e.apply(D,O),i}function w(R){return p=R,u=setTimeout(_,t),m?b(R):i}function S(R){var O=R-d,D=R-p,T=t-O;return h?pR(T,s-D):T}function C(R){var O=R-d,D=R-p;return d===void 0||O>=t||O<0||h&&D>=s}function _(){var R=lg();if(C(R))return k(R);u=setTimeout(_,S(R))}function k(R){return u=void 0,v&&r?b(R):(r=o=void 0,i)}function P(){u!==void 0&&clearTimeout(u),p=0,r=d=o=u=void 0}function E(){return u===void 0?i:k(lg())}function I(){var R=lg(),O=C(R);if(r=arguments,o=this,d=R,O){if(u===void 0)return w(d);if(h)return clearTimeout(u),u=setTimeout(_,t),b(d)}return u===void 0&&(u=setTimeout(_,t)),i}return I.cancel=P,I.flush=E,I}function mR(e,t){var n=-1,r=yE(e)?Array(e.length):[];return bE(e,function(o,s,i){r[++n]=t(o,s,i)}),r}function Xs(e,t){var n=I4(e)?E4:mR;return n(e,O4(t))}var gR="[object Number]";function vl(e){return typeof e=="number"||xE(e)&&SE(e)==gR}var vR=Array.prototype,yR=vR.splice;function bR(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==s){var s=o;wE(o)?yR.call(e,o,1):CE(e,o)}}return e}var xR=Math.ceil,SR=Math.max;function wR(e,t,n,r){for(var o=-1,s=SR(xR((t-e)/(n||1)),0),i=Array(s);s--;)i[r?s:++o]=e,e+=n;return i}function CR(e){return function(t,n,r){return r&&typeof r!="number"&&_E(t,n,r)&&(n=r=void 0),t=ig(t),n===void 0?(n=t,t=0):n=ig(n),r=r===void 0?t<n?1:-1:ig(r),wR(t,n,r,e)}}var _R=CR();const Xx=_R;function kR(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,o=[],s=e.length;for(t=O4(t);++r<s;){var i=e[r];t(i,r,e)&&(n.push(i),o.push(r))}return bR(e,o),n}function B3(e){return I4(e)?E4(e,kE):jE(e)?[e]:PE(IE(EE(e)))}function Tv(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Mu(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=f.Children.toArray(e.path),i=rt((u,d)=>a.jsx(oo,{ref:d,viewBox:t,...o,...u,children:s.length?s:a.jsx("path",{fill:"currentColor",d:n})}));return i.displayName=r,i}var jR=Object.defineProperty,PR=(e,t,n)=>t in e?jR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cr=(e,t,n)=>(PR(e,typeof t!="symbol"?t+"":t,n),n);function Zx(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 IR=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function Jx(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function e2(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var u0=typeof window<"u"?f.useLayoutEffect:f.useEffect,Uf=e=>e,ER=class{constructor(){cr(this,"descendants",new Map),cr(this,"register",e=>{if(e!=null)return IR(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),cr(this,"unregister",e=>{this.descendants.delete(e);const t=Zx(Array.from(this.descendants.keys()));this.assignIndex(t)}),cr(this,"destroy",()=>{this.descendants.clear()}),cr(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),cr(this,"count",()=>this.descendants.size),cr(this,"enabledCount",()=>this.enabledValues().length),cr(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),cr(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),cr(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),cr(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),cr(this,"first",()=>this.item(0)),cr(this,"firstEnabled",()=>this.enabledItem(0)),cr(this,"last",()=>this.item(this.descendants.size-1)),cr(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),cr(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),cr(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),cr(this,"next",(e,t=!0)=>{const n=Jx(e,this.count(),t);return this.item(n)}),cr(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Jx(r,this.enabledCount(),t);return this.enabledItem(o)}),cr(this,"prev",(e,t=!0)=>{const n=e2(e,this.count()-1,t);return this.item(n)}),cr(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=e2(r,this.enabledCount()-1,t);return this.enabledItem(o)}),cr(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=Zx(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const o={node:e,index:-1,...t};this.descendants.set(e,o),this.assignIndex(r)})}};function OR(){const e=f.useRef(new ER);return u0(()=>()=>e.current.destroy()),e.current}var[RR,H3]=ar({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function MR(e){const t=H3(),[n,r]=f.useState(-1),o=f.useRef(null);u0(()=>()=>{o.current&&t.unregister(o.current)},[]),u0(()=>{if(!o.current)return;const i=Number(o.current.dataset.index);n!=i&&!Number.isNaN(i)&&r(i)});const s=Uf(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:Wn(s,o)}}function Av(){return[Uf(RR),()=>Uf(H3()),()=>OR(),o=>MR(o)]}var[DR,lh]=ar({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[TR,Nv]=ar({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[AR,$se,NR,$R]=Av(),Kc=rt(function(t,n){const{getButtonProps:r}=Nv(),o=r(t,n),i={display:"flex",alignItems:"center",width:"100%",outline:0,...lh().button};return a.jsx(Ue.button,{...o,className:Ot("chakra-accordion__button",t.className),__css:i})});Kc.displayName="AccordionButton";function zR(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...i}=e;BR(e),HR(e);const u=NR(),[d,p]=f.useState(-1);f.useEffect(()=>()=>{p(-1)},[]);const[m,h]=ku({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:m,setIndex:h,htmlProps:i,getAccordionItemProps:b=>{let w=!1;return b!==null&&(w=Array.isArray(m)?m.includes(b):m===b),{isOpen:w,onChange:C=>{if(b!==null)if(o&&Array.isArray(m)){const _=C?m.concat(b):m.filter(k=>k!==b);h(_)}else C?h(b):s&&h(-1)}}},focusedIndex:d,setFocusedIndex:p,descendants:u}}var[LR,$v]=ar({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function FR(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:i}=$v(),u=f.useRef(null),d=f.useId(),p=r??d,m=`accordion-button-${p}`,h=`accordion-panel-${p}`;VR(e);const{register:v,index:b,descendants:w}=$R({disabled:t&&!n}),{isOpen:S,onChange:C}=s(b===-1?null:b);WR({isOpen:S,isDisabled:t});const _=()=>{C==null||C(!0)},k=()=>{C==null||C(!1)},P=f.useCallback(()=>{C==null||C(!S),i(b)},[b,i,S,C]),E=f.useCallback(D=>{const $={ArrowDown:()=>{const B=w.nextEnabled(b);B==null||B.node.focus()},ArrowUp:()=>{const B=w.prevEnabled(b);B==null||B.node.focus()},Home:()=>{const B=w.firstEnabled();B==null||B.node.focus()},End:()=>{const B=w.lastEnabled();B==null||B.node.focus()}}[D.key];$&&(D.preventDefault(),$(D))},[w,b]),I=f.useCallback(()=>{i(b)},[i,b]),R=f.useCallback(function(T={},$=null){return{...T,type:"button",ref:Wn(v,u,$),id:m,disabled:!!t,"aria-expanded":!!S,"aria-controls":h,onClick:xt(T.onClick,P),onFocus:xt(T.onFocus,I),onKeyDown:xt(T.onKeyDown,E)}},[m,t,S,P,I,E,h,v]),O=f.useCallback(function(T={},$=null){return{...T,ref:$,role:"region",id:h,"aria-labelledby":m,hidden:!S}},[m,S,h]);return{isOpen:S,isDisabled:t,isFocusable:n,onOpen:_,onClose:k,getButtonProps:R,getPanelProps:O,htmlProps:o}}function BR(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;ju({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function HR(e){ju({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 VR(e){ju({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 WR(e){ju({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Yc(e){const{isOpen:t,isDisabled:n}=Nv(),{reduceMotion:r}=$v(),o=Ot("chakra-accordion__icon",e.className),s=lh(),i={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return a.jsx(oo,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:i,...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Yc.displayName="AccordionIcon";var Qc=rt(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...i}=FR(t),d={...lh().container,overflowAnchor:"none"},p=f.useMemo(()=>i,[i]);return a.jsx(TR,{value:p,children:a.jsx(Ue.div,{ref:n,...s,className:Ot("chakra-accordion__item",o),__css:d,children:typeof r=="function"?r({isExpanded:!!i.isOpen,isDisabled:!!i.isDisabled}):r})})});Qc.displayName="AccordionItem";var Ei={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},zc={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function d0(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return zc.slideRight;case"left":return zc.slideLeft;case"bottom":return zc.slideDown;case"top":return zc.slideUp;default:return zc.slideRight}}var Mi={enter:{duration:.2,ease:Ei.easeOut},exit:{duration:.1,ease:Ei.easeIn}},gs={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})},UR=e=>e!=null&&parseInt(e.toString(),10)>0,t2={exit:{height:{duration:.2,ease:Ei.ease},opacity:{duration:.3,ease:Ei.ease}},enter:{height:{duration:.3,ease:Ei.ease},opacity:{duration:.4,ease:Ei.ease}}},GR={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:UR(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:gs.exit(t2.exit,o)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(s=n==null?void 0:n.enter)!=null?s:gs.enter(t2.enter,o)}}},ch=f.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:i="auto",style:u,className:d,transition:p,transitionEnd:m,...h}=e,[v,b]=f.useState(!1);f.useEffect(()=>{const k=setTimeout(()=>{b(!0)});return()=>clearTimeout(k)},[]),ju({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const w=parseFloat(s.toString())>0,S={startingHeight:s,endingHeight:i,animateOpacity:o,transition:v?p:{enter:{duration:0}},transitionEnd:{enter:m==null?void 0:m.enter,exit:r?m==null?void 0:m.exit:{...m==null?void 0:m.exit,display:w?"block":"none"}}},C=r?n:!0,_=n||r?"enter":"exit";return a.jsx(Os,{initial:!1,custom:S,children:C&&a.jsx(vo.div,{ref:t,...h,className:Ot("chakra-collapse",d),style:{overflow:"hidden",display:"block",...u},custom:S,variants:GR,initial:r?"exit":!1,animate:_,exit:"exit"})})});ch.displayName="Collapse";var qR={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:gs.enter(Mi.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:gs.exit(Mi.exit,n),transitionEnd:t==null?void 0:t.exit}}},V3={initial:"exit",animate:"enter",exit:"exit",variants:qR},KR=f.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:i,transitionEnd:u,delay:d,...p}=t,m=o||r?"enter":"exit",h=r?o&&r:!0,v={transition:i,transitionEnd:u,delay:d};return a.jsx(Os,{custom:v,children:h&&a.jsx(vo.div,{ref:n,className:Ot("chakra-fade",s),custom:v,...V3,animate:m,...p})})});KR.displayName="Fade";var YR={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(s=n==null?void 0:n.exit)!=null?s:gs.exit(Mi.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:gs.enter(Mi.enter,n),transitionEnd:e==null?void 0:e.enter}}},W3={initial:"exit",animate:"enter",exit:"exit",variants:YR},QR=f.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:i=.95,className:u,transition:d,transitionEnd:p,delay:m,...h}=t,v=r?o&&r:!0,b=o||r?"enter":"exit",w={initialScale:i,reverse:s,transition:d,transitionEnd:p,delay:m};return a.jsx(Os,{custom:w,children:v&&a.jsx(vo.div,{ref:n,className:Ot("chakra-offset-slide",u),...W3,animate:b,custom:w,...h})})});QR.displayName="ScaleFade";var XR={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,x:e,y:t,transition:(s=n==null?void 0:n.exit)!=null?s:gs.exit(Mi.exit,o),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:gs.enter(Mi.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var i;const u={x:t,y:e};return{opacity:0,transition:(i=n==null?void 0:n.exit)!=null?i:gs.exit(Mi.exit,s),...o?{...u,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...u,...r==null?void 0:r.exit}}}}},f0={initial:"initial",animate:"enter",exit:"exit",variants:XR},ZR=f.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:i,offsetX:u=0,offsetY:d=8,transition:p,transitionEnd:m,delay:h,...v}=t,b=r?o&&r:!0,w=o||r?"enter":"exit",S={offsetX:u,offsetY:d,reverse:s,transition:p,transitionEnd:m,delay:h};return a.jsx(Os,{custom:S,children:b&&a.jsx(vo.div,{ref:n,className:Ot("chakra-offset-slide",i),custom:S,...f0,animate:w,...v})})});ZR.displayName="SlideFade";var n2={exit:{duration:.15,ease:Ei.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},JR={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{var o;const{exit:s}=d0({direction:e});return{...s,transition:(o=t==null?void 0:t.exit)!=null?o:gs.exit(n2.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{var o;const{enter:s}=d0({direction:e});return{...s,transition:(o=n==null?void 0:n.enter)!=null?o:gs.enter(n2.enter,r),transitionEnd:t==null?void 0:t.enter}}},U3=f.forwardRef(function(t,n){const{direction:r="right",style:o,unmountOnExit:s,in:i,className:u,transition:d,transitionEnd:p,delay:m,motionProps:h,...v}=t,b=d0({direction:r}),w=Object.assign({position:"fixed"},b.position,o),S=s?i&&s:!0,C=i||s?"enter":"exit",_={transitionEnd:p,transition:d,direction:r,delay:m};return a.jsx(Os,{custom:_,children:S&&a.jsx(vo.div,{...v,ref:n,initial:"exit",className:Ot("chakra-slide",u),animate:C,exit:"exit",custom:_,variants:JR,style:w,...h})})});U3.displayName="Slide";var Xc=rt(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:i}=$v(),{getPanelProps:u,isOpen:d}=Nv(),p=u(s,n),m=Ot("chakra-accordion__panel",r),h=lh();i||delete p.hidden;const v=a.jsx(Ue.div,{...p,__css:h.panel,className:m});return i?v:a.jsx(ch,{in:d,...o,children:v})});Xc.displayName="AccordionPanel";var G3=rt(function({children:t,reduceMotion:n,...r},o){const s=Yr("Accordion",r),i=vr(r),{htmlProps:u,descendants:d,...p}=zR(i),m=f.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return a.jsx(AR,{value:d,children:a.jsx(LR,{value:m,children:a.jsx(DR,{value:s,children:a.jsx(Ue.div,{ref:o,...u,className:Ot("chakra-accordion",r.className),__css:s.root,children:t})})})})});G3.displayName="Accordion";var eM={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}}},tM={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},dr=rt(function(t,n){const{size:r,colorScheme:o,variant:s,className:i,spacing:u="0.5rem",isAttached:d,isDisabled:p,orientation:m="horizontal",...h}=t,v=Ot("chakra-button__group",i),b=f.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let w={display:"inline-flex",...d?eM[m]:tM[m](u)};const S=m==="vertical";return a.jsx(OE,{value:b,children:a.jsx(Ue.div,{ref:n,role:"group",__css:w,className:v,"data-attached":d?"":void 0,"data-orientation":m,flexDir:S?"column":void 0,...h})})});dr.displayName="ButtonGroup";var[zse,nM]=ar({name:"CheckboxGroupContext",strict:!1});function rM(e){const[t,n]=f.useState(e),[r,o]=f.useState(!1);return e!==t&&(o(!0),n(e)),r}function oM(e){return a.jsx(Ue.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:a.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function sM(e){return a.jsx(Ue.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:a.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function aM(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?sM:oM;return n||t?a.jsx(Ue.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(o,{...r})}):null}var[iM,lM]=ar({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormError />" `}),fo=rt((e,t)=>{const n=Yr("FormError",e),r=vr(e),o=gv();return o!=null&&o.isInvalid?a.jsx(iM,{value:n,children:a.jsx(Ue.div,{...o==null?void 0:o.getErrorMessageProps(r,t),className:Ot("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})}):null});fo.displayName="FormErrorMessage";var cM=rt((e,t)=>{const n=lM(),r=gv();if(!(r!=null&&r.isInvalid))return null;const o=Ot("chakra-form__error-icon",e.className);return a.jsx(oo,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:o,children:a.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"})})});cM.displayName="FormErrorIcon";var zv={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},q3=Ue("span",{baseStyle:zv});q3.displayName="VisuallyHidden";var uM=Ue("input",{baseStyle:zv});uM.displayName="VisuallyHiddenInput";var r2=!1,Du=null,Fi=!1,p0=!1,h0=new Set;function Lv(e,t){h0.forEach(n=>n(e,t))}var dM=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function fM(e){return!(e.metaKey||!dM&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function o2(e){Fi=!0,fM(e)&&(Du="keyboard",Lv("keyboard",e))}function yl(e){if(Du="pointer",e.type==="mousedown"||e.type==="pointerdown"){Fi=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;Lv("pointer",e)}}function pM(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function hM(e){pM(e)&&(Fi=!0,Du="virtual")}function mM(e){e.target===window||e.target===document||(!Fi&&!p0&&(Du="virtual",Lv("virtual",e)),Fi=!1,p0=!1)}function gM(){Fi=!1,p0=!0}function s2(){return Du!=="pointer"}function vM(){if(typeof window>"u"||r2)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Fi=!0,e.apply(this,n)},document.addEventListener("keydown",o2,!0),document.addEventListener("keyup",o2,!0),document.addEventListener("click",hM,!0),window.addEventListener("focus",mM,!0),window.addEventListener("blur",gM,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",yl,!0),document.addEventListener("pointermove",yl,!0),document.addEventListener("pointerup",yl,!0)):(document.addEventListener("mousedown",yl,!0),document.addEventListener("mousemove",yl,!0),document.addEventListener("mouseup",yl,!0)),r2=!0}function K3(e){vM(),e(s2());const t=()=>e(s2());return h0.add(t),()=>{h0.delete(t)}}function yM(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Y3(e={}){const t=RE(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:i,onBlur:u,onFocus:d,"aria-describedby":p}=t,{defaultChecked:m,isChecked:h,isFocusable:v,onChange:b,isIndeterminate:w,name:S,value:C,tabIndex:_=void 0,"aria-label":k,"aria-labelledby":P,"aria-invalid":E,...I}=e,R=yM(I,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),O=Ja(b),D=Ja(u),T=Ja(d),[$,B]=f.useState(!1),[ee,F]=f.useState(!1),[N,H]=f.useState(!1),[K,A]=f.useState(!1);f.useEffect(()=>K3(B),[]);const U=f.useRef(null),[V,W]=f.useState(!0),[re,be]=f.useState(!!m),ce=h!==void 0,se=ce?h:re,X=f.useCallback(ge=>{if(r||n){ge.preventDefault();return}ce||be(se?ge.target.checked:w?!0:ge.target.checked),O==null||O(ge)},[r,n,se,ce,w,O]);tu(()=>{U.current&&(U.current.indeterminate=!!w)},[w]),Xi(()=>{n&&F(!1)},[n,F]),tu(()=>{const ge=U.current;ge!=null&&ge.form&&(ge.form.onreset=()=>{be(!!m)})},[]);const ie=n&&!v,de=f.useCallback(ge=>{ge.key===" "&&A(!0)},[A]),xe=f.useCallback(ge=>{ge.key===" "&&A(!1)},[A]);tu(()=>{if(!U.current)return;U.current.checked!==se&&be(U.current.checked)},[U.current]);const oe=f.useCallback((ge={},Oe=null)=>{const at=Fe=>{ee&&Fe.preventDefault(),A(!0)};return{...ge,ref:Oe,"data-active":sn(K),"data-hover":sn(N),"data-checked":sn(se),"data-focus":sn(ee),"data-focus-visible":sn(ee&&$),"data-indeterminate":sn(w),"data-disabled":sn(n),"data-invalid":sn(s),"data-readonly":sn(r),"aria-hidden":!0,onMouseDown:xt(ge.onMouseDown,at),onMouseUp:xt(ge.onMouseUp,()=>A(!1)),onMouseEnter:xt(ge.onMouseEnter,()=>H(!0)),onMouseLeave:xt(ge.onMouseLeave,()=>H(!1))}},[K,se,n,ee,$,N,w,s,r]),ve=f.useCallback((ge={},Oe=null)=>({...R,...ge,ref:Wn(Oe,at=>{at&&W(at.tagName==="LABEL")}),onClick:xt(ge.onClick,()=>{var at;V||((at=U.current)==null||at.click(),requestAnimationFrame(()=>{var Fe;(Fe=U.current)==null||Fe.focus({preventScroll:!0})}))}),"data-disabled":sn(n),"data-checked":sn(se),"data-invalid":sn(s)}),[R,n,se,s,V]),he=f.useCallback((ge={},Oe=null)=>({...ge,ref:Wn(U,Oe),type:"checkbox",name:S,value:C,id:i,tabIndex:_,onChange:xt(ge.onChange,X),onBlur:xt(ge.onBlur,D,()=>F(!1)),onFocus:xt(ge.onFocus,T,()=>F(!0)),onKeyDown:xt(ge.onKeyDown,de),onKeyUp:xt(ge.onKeyUp,xe),required:o,checked:se,disabled:ie,readOnly:r,"aria-label":k,"aria-labelledby":P,"aria-invalid":E?!!E:s,"aria-describedby":p,"aria-disabled":n,style:zv}),[S,C,i,X,D,T,de,xe,o,se,ie,r,k,P,E,s,p,n,_]),je=f.useCallback((ge={},Oe=null)=>({...ge,ref:Oe,onMouseDown:xt(ge.onMouseDown,bM),"data-disabled":sn(n),"data-checked":sn(se),"data-invalid":sn(s)}),[se,n,s]);return{state:{isInvalid:s,isFocused:ee,isChecked:se,isActive:K,isHovered:N,isIndeterminate:w,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:ve,getCheckboxProps:oe,getInputProps:he,getLabelProps:je,htmlProps:R}}function bM(e){e.preventDefault(),e.stopPropagation()}var xM={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},SM={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},wM=ja({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),CM=ja({from:{opacity:0},to:{opacity:1}}),_M=ja({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Q3=rt(function(t,n){const r=nM(),o={...r,...t},s=Yr("Checkbox",o),i=vr(t),{spacing:u="0.5rem",className:d,children:p,iconColor:m,iconSize:h,icon:v=a.jsx(aM,{}),isChecked:b,isDisabled:w=r==null?void 0:r.isDisabled,onChange:S,inputProps:C,..._}=i;let k=b;r!=null&&r.value&&i.value&&(k=r.value.includes(i.value));let P=S;r!=null&&r.onChange&&i.value&&(P=th(r.onChange,S));const{state:E,getInputProps:I,getCheckboxProps:R,getLabelProps:O,getRootProps:D}=Y3({..._,isDisabled:w,isChecked:k,onChange:P}),T=rM(E.isChecked),$=f.useMemo(()=>({animation:T?E.isIndeterminate?`${CM} 20ms linear, ${_M} 200ms linear`:`${wM} 200ms linear`:void 0,fontSize:h,color:m,...s.icon}),[m,h,T,E.isIndeterminate,s.icon]),B=f.cloneElement(v,{__css:$,isIndeterminate:E.isIndeterminate,isChecked:E.isChecked});return a.jsxs(Ue.label,{__css:{...SM,...s.container},className:Ot("chakra-checkbox",d),...D(),children:[a.jsx("input",{className:"chakra-checkbox__input",...I(C,n)}),a.jsx(Ue.span,{__css:{...xM,...s.control},className:"chakra-checkbox__control",...R(),children:B}),p&&a.jsx(Ue.span,{className:"chakra-checkbox__label",...O(),__css:{marginStart:u,...s.label},children:p})]})});Q3.displayName="Checkbox";var[kM,X3]=ar({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[jM,Z3]=ar({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),J3={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},e6=rt(function(t,n){const{getInputProps:r}=Z3(),o=X3(),s=r(t,n),i=Ot("chakra-editable__input",t.className);return a.jsx(Ue.input,{...s,__css:{outline:0,...J3,...o.input},className:i})});e6.displayName="EditableInput";var t6=rt(function(t,n){const{getPreviewProps:r}=Z3(),o=X3(),s=r(t,n),i=Ot("chakra-editable__preview",t.className);return a.jsx(Ue.span,{...s,__css:{cursor:"text",display:"inline-block",...J3,...o.preview},className:i})});t6.displayName="EditablePreview";function PM(e){return"current"in e}var n6=()=>typeof window<"u";function IM(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var EM=e=>n6()&&e.test(navigator.vendor),OM=e=>n6()&&e.test(IM()),RM=()=>OM(/mac|iphone|ipad|ipod/i),MM=()=>RM()&&EM(/apple/i);function r6(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,i;return(i=(s=t.current)==null?void 0:s.ownerDocument)!=null?i:document};vv(o,"pointerdown",s=>{if(!MM()||!r)return;const i=s.target,d=(n??[t]).some(p=>{const m=PM(p)?p.current:p;return(m==null?void 0:m.contains(i))||m===i});o().activeElement!==i&&d&&(s.preventDefault(),i.focus())})}function a2(e,t){return e?e===t||e.contains(t):!1}function DM(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:i,defaultValue:u,startWithEditView:d,isPreviewFocusable:p=!0,submitOnBlur:m=!0,selectAllOnFocus:h=!0,placeholder:v,onEdit:b,finalFocusRef:w,...S}=e,C=Ja(b),_=!!(d&&!i),[k,P]=f.useState(_),[E,I]=ku({defaultValue:u||"",value:s,onChange:t}),[R,O]=f.useState(E),D=f.useRef(null),T=f.useRef(null),$=f.useRef(null),B=f.useRef(null),ee=f.useRef(null);r6({ref:D,enabled:k,elements:[B,ee]});const F=!k&&!i;tu(()=>{var oe,ve;k&&((oe=D.current)==null||oe.focus(),h&&((ve=D.current)==null||ve.select()))},[]),Xi(()=>{var oe,ve,he,je;if(!k){w?(oe=w.current)==null||oe.focus():(ve=$.current)==null||ve.focus();return}(he=D.current)==null||he.focus(),h&&((je=D.current)==null||je.select()),C==null||C()},[k,C,h]);const N=f.useCallback(()=>{F&&P(!0)},[F]),H=f.useCallback(()=>{O(E)},[E]),K=f.useCallback(()=>{P(!1),I(R),n==null||n(R),o==null||o(R)},[n,o,I,R]),A=f.useCallback(()=>{P(!1),O(E),r==null||r(E),o==null||o(R)},[E,r,o,R]);f.useEffect(()=>{if(k)return;const oe=D.current;(oe==null?void 0:oe.ownerDocument.activeElement)===oe&&(oe==null||oe.blur())},[k]);const U=f.useCallback(oe=>{I(oe.currentTarget.value)},[I]),V=f.useCallback(oe=>{const ve=oe.key,je={Escape:K,Enter:Ne=>{!Ne.shiftKey&&!Ne.metaKey&&A()}}[ve];je&&(oe.preventDefault(),je(oe))},[K,A]),W=f.useCallback(oe=>{const ve=oe.key,je={Escape:K}[ve];je&&(oe.preventDefault(),je(oe))},[K]),re=E.length===0,be=f.useCallback(oe=>{var ve;if(!k)return;const he=oe.currentTarget.ownerDocument,je=(ve=oe.relatedTarget)!=null?ve:he.activeElement,Ne=a2(B.current,je),ge=a2(ee.current,je);!Ne&&!ge&&(m?A():K())},[m,A,K,k]),ce=f.useCallback((oe={},ve=null)=>{const he=F&&p?0:void 0;return{...oe,ref:Wn(ve,T),children:re?v:E,hidden:k,"aria-disabled":Al(i),tabIndex:he,onFocus:xt(oe.onFocus,N,H)}},[i,k,F,p,re,N,H,v,E]),se=f.useCallback((oe={},ve=null)=>({...oe,hidden:!k,placeholder:v,ref:Wn(ve,D),disabled:i,"aria-disabled":Al(i),value:E,onBlur:xt(oe.onBlur,be),onChange:xt(oe.onChange,U),onKeyDown:xt(oe.onKeyDown,V),onFocus:xt(oe.onFocus,H)}),[i,k,be,U,V,H,v,E]),X=f.useCallback((oe={},ve=null)=>({...oe,hidden:!k,placeholder:v,ref:Wn(ve,D),disabled:i,"aria-disabled":Al(i),value:E,onBlur:xt(oe.onBlur,be),onChange:xt(oe.onChange,U),onKeyDown:xt(oe.onKeyDown,W),onFocus:xt(oe.onFocus,H)}),[i,k,be,U,W,H,v,E]),ie=f.useCallback((oe={},ve=null)=>({"aria-label":"Edit",...oe,type:"button",onClick:xt(oe.onClick,N),ref:Wn(ve,$),disabled:i}),[N,i]),de=f.useCallback((oe={},ve=null)=>({...oe,"aria-label":"Submit",ref:Wn(ee,ve),type:"button",onClick:xt(oe.onClick,A),disabled:i}),[A,i]),xe=f.useCallback((oe={},ve=null)=>({"aria-label":"Cancel",id:"cancel",...oe,ref:Wn(B,ve),type:"button",onClick:xt(oe.onClick,K),disabled:i}),[K,i]);return{isEditing:k,isDisabled:i,isValueEmpty:re,value:E,onEdit:N,onCancel:K,onSubmit:A,getPreviewProps:ce,getInputProps:se,getTextareaProps:X,getEditButtonProps:ie,getSubmitButtonProps:de,getCancelButtonProps:xe,htmlProps:S}}var o6=rt(function(t,n){const r=Yr("Editable",t),o=vr(t),{htmlProps:s,...i}=DM(o),{isEditing:u,onSubmit:d,onCancel:p,onEdit:m}=i,h=Ot("chakra-editable",t.className),v=yv(t.children,{isEditing:u,onSubmit:d,onCancel:p,onEdit:m});return a.jsx(jM,{value:i,children:a.jsx(kM,{value:r,children:a.jsx(Ue.div,{ref:n,...s,className:h,children:v})})})});o6.displayName="Editable";var s6={exports:{}},TM="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",AM=TM,NM=AM;function a6(){}function i6(){}i6.resetWarningCache=a6;var $M=function(){function e(r,o,s,i,u,d){if(d!==NM){var p=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 p.name="Invariant Violation",p}}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:i6,resetWarningCache:a6};return n.PropTypes=n,n};s6.exports=$M();var zM=s6.exports;const An=lc(zM);var m0="data-focus-lock",l6="data-focus-lock-disabled",LM="data-no-focus-lock",FM="data-autofocus-inside",BM="data-no-autofocus";function HM(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function VM(e,t){var n=f.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function c6(e,t){return VM(t||null,function(n){return e.forEach(function(r){return HM(r,n)})})}var cg={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},Vs=function(){return Vs=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Vs.apply(this,arguments)};function u6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function pc(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function u(m){try{p(r.next(m))}catch(h){i(h)}}function d(m){try{p(r.throw(m))}catch(h){i(h)}}function p(m){m.done?s(m.value):o(m.value).then(u,d)}p((r=r.apply(e,t||[])).next())})}function hc(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(p){return function(m){return d([p,m])}}function d(p){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,p[0]&&(n=0)),n;)try{if(r=1,o&&(s=p[0]&2?o.return:p[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,p[1])).done)return s;switch(o=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){n.label=p[1];break}if(p[0]===6&&n.label<s[1]){n.label=s[1],s=p;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(p);break}s[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(m){p=[6,m],o=0}finally{r=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function i2(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(u){i={error:u}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function g0(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function d6(e){return e}function f6(e,t){t===void 0&&(t=d6);var n=[],r=!1,o={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(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(u){return u!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var u=n;n=[],u.forEach(s),i=n}var d=function(){var m=i;i=[],m.forEach(s)},p=function(){return Promise.resolve().then(d)};p(),n={push:function(m){i.push(m),p()},filter:function(m){return i=i.filter(m),n}}}};return o}function Fv(e,t){return t===void 0&&(t=d6),f6(e,t)}function p6(e){e===void 0&&(e={});var t=f6(null);return t.options=Vs({async:!0,ssr:!1},e),t}var h6=function(e){var t=e.sideCar,n=u6(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 f.createElement(r,Vs({},n))};h6.isSideCarExport=!0;function WM(e,t){return e.useMedium(t),h6}var m6=Fv({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),g6=Fv(),UM=Fv(),GM=p6({async:!0}),qM=[],Bv=f.forwardRef(function(t,n){var r,o=f.useState(),s=o[0],i=o[1],u=f.useRef(),d=f.useRef(!1),p=f.useRef(null),m=t.children,h=t.disabled,v=t.noFocusGuards,b=t.persistentFocus,w=t.crossFrame,S=t.autoFocus;t.allowTextSelection;var C=t.group,_=t.className,k=t.whiteList,P=t.hasPositiveIndices,E=t.shards,I=E===void 0?qM:E,R=t.as,O=R===void 0?"div":R,D=t.lockProps,T=D===void 0?{}:D,$=t.sideCar,B=t.returnFocus,ee=t.focusOptions,F=t.onActivation,N=t.onDeactivation,H=f.useState({}),K=H[0],A=f.useCallback(function(){p.current=p.current||document&&document.activeElement,u.current&&F&&F(u.current),d.current=!0},[F]),U=f.useCallback(function(){d.current=!1,N&&N(u.current)},[N]);f.useEffect(function(){h||(p.current=null)},[]);var V=f.useCallback(function(de){var xe=p.current;if(xe&&xe.focus){var oe=typeof B=="function"?B(xe):B;if(oe){var ve=typeof oe=="object"?oe:void 0;p.current=null,de?Promise.resolve().then(function(){return xe.focus(ve)}):xe.focus(ve)}}},[B]),W=f.useCallback(function(de){d.current&&m6.useMedium(de)},[]),re=g6.useMedium,be=f.useCallback(function(de){u.current!==de&&(u.current=de,i(de))},[]),ce=Jn((r={},r[l6]=h&&"disabled",r[m0]=C,r),T),se=v!==!0,X=se&&v!=="tail",ie=c6([n,be]);return f.createElement(f.Fragment,null,se&&[f.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:cg}),P?f.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:cg}):null],!h&&f.createElement($,{id:K,sideCar:GM,observed:s,disabled:h,persistentFocus:b,crossFrame:w,autoFocus:S,whiteList:k,shards:I,onActivation:A,onDeactivation:U,returnFocus:V,focusOptions:ee}),f.createElement(O,Jn({ref:ie},ce,{className:_,onBlur:re,onFocus:W}),m),X&&f.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:cg}))});Bv.propTypes={};Bv.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 v6=Bv;function v0(e,t){return v0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},v0(e,t)}function KM(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,v0(e,t)}function YM(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],i;function u(){i=e(s.map(function(p){return p.props})),t(i)}var d=function(p){KM(m,p);function m(){return p.apply(this,arguments)||this}m.peek=function(){return i};var h=m.prototype;return h.componentDidMount=function(){s.push(this),u()},h.componentDidUpdate=function(){u()},h.componentWillUnmount=function(){var b=s.indexOf(this);s.splice(b,1),u()},h.render=function(){return z.createElement(o,this.props)},m}(f.PureComponent);return ME(d,"displayName","SideEffect("+n(o)+")"),d}}var Zs=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},Gf=function(e){return Array.isArray(e)?e:[e]},y6=function(e){return Array.isArray(e)?e[0]:e},QM=function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(e,null);return!t||!t.getPropertyValue?!1:t.getPropertyValue("display")==="none"||t.getPropertyValue("visibility")==="hidden"},b6=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},x6=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},XM=function(e,t){return!e||x6(e)||!QM(e)&&t(b6(e))},S6=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=XM(t,S6.bind(void 0,e));return e.set(t,r),r},ZM=function(e,t){return e&&!x6(e)?t9(e)?t(b6(e)):!1:!0},w6=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=ZM(t,w6.bind(void 0,e));return e.set(t,r),r},C6=function(e){return e.dataset},JM=function(e){return e.tagName==="BUTTON"},_6=function(e){return e.tagName==="INPUT"},k6=function(e){return _6(e)&&e.type==="radio"},e9=function(e){return!((_6(e)||JM(e))&&(e.type==="hidden"||e.disabled))},t9=function(e){var t=e.getAttribute(BM);return![!0,"true",""].includes(t)},Hv=function(e){var t;return!!(e&&(!((t=C6(e))===null||t===void 0)&&t.focusGuard))},qf=function(e){return!Hv(e)},n9=function(e){return!!e},r9=function(e,t){var n=e.tabIndex-t.tabIndex,r=e.index-t.index;if(n){if(!e.tabIndex)return 1;if(!t.tabIndex)return-1}return n||r},j6=function(e,t,n){return Zs(e).map(function(r,o){return{node:r,index:o,tabIndex:n&&r.tabIndex===-1?(r.dataset||{}).focusGuard?0:-1:r.tabIndex}}).filter(function(r){return!t||r.tabIndex>=0}).sort(r9)},o9=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Vv=o9.join(","),s9="".concat(Vv,", [data-focus-guard]"),P6=function(e,t){return Zs((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?s9:Vv)?[r]:[],P6(r))},[])},a9=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?uh([e.contentDocument.body],t):[e]},uh=function(e,t){return e.reduce(function(n,r){var o,s=P6(r,t),i=(o=[]).concat.apply(o,s.map(function(u){return a9(u,t)}));return n.concat(i,r.parentNode?Zs(r.parentNode.querySelectorAll(Vv)).filter(function(u){return u===r}):[])},[])},i9=function(e){var t=e.querySelectorAll("[".concat(FM,"]"));return Zs(t).map(function(n){return uh([n])}).reduce(function(n,r){return n.concat(r)},[])},Wv=function(e,t){return Zs(e).filter(function(n){return S6(t,n)}).filter(function(n){return e9(n)})},l2=function(e,t){return t===void 0&&(t=new Map),Zs(e).filter(function(n){return w6(t,n)})},y0=function(e,t,n){return j6(Wv(uh(e,n),t),!0,n)},c2=function(e,t){return j6(Wv(uh(e),t),!1)},l9=function(e,t){return Wv(i9(e),t)},zl=function(e,t){return e.shadowRoot?zl(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Zs(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?zl(o,t):!1}return zl(n,t)})},c9=function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var o=r+1;o<n;o+=1){var s=e[r].compareDocumentPosition(e[o]);(s&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(s&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(i,u){return!t.has(u)})},I6=function(e){return e.parentNode?I6(e.parentNode):e},Uv=function(e){var t=Gf(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(m0);return n.push.apply(n,o?c9(Zs(I6(r).querySelectorAll("[".concat(m0,'="').concat(o,'"]:not([').concat(l6,'="disabled"])')))):[r]),n},[])},u9=function(e){try{return e()}catch{return}},fu=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?fu(t.shadowRoot):t instanceof HTMLIFrameElement&&u9(function(){return t.contentWindow.document})?fu(t.contentWindow.document):t}},d9=function(e,t){return e===t},f9=function(e,t){return!!Zs(e.querySelectorAll("iframe")).some(function(n){return d9(n,t)})},E6=function(e,t){return t===void 0&&(t=fu(y6(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Uv(e).some(function(n){return zl(n,t)||f9(n,t)})},p9=function(e){e===void 0&&(e=document);var t=fu(e);return t?Zs(e.querySelectorAll("[".concat(LM,"]"))).some(function(n){return zl(n,t)}):!1},h9=function(e,t){return t.filter(k6).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Gv=function(e,t){return k6(e)&&e.name?h9(e,t):e},m9=function(e){var t=new Set;return e.forEach(function(n){return t.add(Gv(n,e))}),e.filter(function(n){return t.has(n)})},u2=function(e){return e[0]&&e.length>1?Gv(e[0],e):e[0]},d2=function(e,t){return e.length>1?e.indexOf(Gv(e[t],e)):t},O6="NEW_FOCUS",g9=function(e,t,n,r){var o=e.length,s=e[0],i=e[o-1],u=Hv(n);if(!(n&&e.indexOf(n)>=0)){var d=n!==void 0?t.indexOf(n):-1,p=r?t.indexOf(r):d,m=r?e.indexOf(r):-1,h=d-p,v=t.indexOf(s),b=t.indexOf(i),w=m9(t),S=n!==void 0?w.indexOf(n):-1,C=S-(r?w.indexOf(r):d),_=d2(e,0),k=d2(e,o-1);if(d===-1||m===-1)return O6;if(!h&&m>=0)return m;if(d<=v&&u&&Math.abs(h)>1)return k;if(d>=b&&u&&Math.abs(h)>1)return _;if(h&&Math.abs(C)>1)return m;if(d<=v)return k;if(d>b)return _;if(h)return Math.abs(h)>1?m:(o+m+h)%o}},v9=function(e){return function(t){var n,r=(n=C6(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},y9=function(e,t,n){var r=e.map(function(s){var i=s.node;return i}),o=l2(r.filter(v9(n)));return o&&o.length?u2(o):u2(l2(t))},b0=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&b0(e.parentNode.host||e.parentNode,t),t},ug=function(e,t){for(var n=b0(e),r=b0(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},R6=function(e,t,n){var r=Gf(e),o=Gf(t),s=r[0],i=!1;return o.filter(Boolean).forEach(function(u){i=ug(i||u,u)||i,n.filter(Boolean).forEach(function(d){var p=ug(s,d);p&&(!i||zl(p,i)?i=p:i=ug(p,i))})}),i},b9=function(e,t){return e.reduce(function(n,r){return n.concat(l9(r,t))},[])},x9=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(n9)},S9=function(e,t){var n=fu(Gf(e).length>0?document:y6(e).ownerDocument),r=Uv(e).filter(qf),o=R6(n||e,e,r),s=new Map,i=c2(r,s),u=y0(r,s).filter(function(b){var w=b.node;return qf(w)});if(!(!u[0]&&(u=i,!u[0]))){var d=c2([o],s).map(function(b){var w=b.node;return w}),p=x9(d,u),m=p.map(function(b){var w=b.node;return w}),h=g9(m,d,n,t);if(h===O6){var v=y9(i,m,b9(r,s));if(v)return{node:v};console.warn("focus-lock: cannot find any node to move focus into");return}return h===void 0?h:p[h]}},w9=function(e){var t=Uv(e).filter(qf),n=R6(e,e,t),r=new Map,o=y0([n],r,!0),s=y0(t,r).filter(function(i){var u=i.node;return qf(u)}).map(function(i){var u=i.node;return u});return o.map(function(i){var u=i.node,d=i.index;return{node:u,index:d,lockItem:s.indexOf(u)>=0,guard:Hv(u)}})},C9=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},dg=0,fg=!1,M6=function(e,t,n){n===void 0&&(n={});var r=S9(e,t);if(!fg&&r){if(dg>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),fg=!0,setTimeout(function(){fg=!1},1);return}dg++,C9(r.node,n.focusOptions),dg--}};function D6(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var _9=function(){return document&&document.activeElement===document.body},k9=function(){return _9()||p9()},Ll=null,El=null,Fl=null,pu=!1,j9=function(){return!0},P9=function(t){return(Ll.whiteList||j9)(t)},I9=function(t,n){Fl={observerNode:t,portaledElement:n}},E9=function(t){return Fl&&Fl.portaledElement===t};function f2(e,t,n,r){var o=null,s=e;do{var i=r[s];if(i.guard)i.node.dataset.focusAutoGuard&&(o=i);else if(i.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var O9=function(t){return t&&"current"in t?t.current:t},R9=function(t){return t?!!pu:pu==="meanwhile"},M9=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},D9=function(t,n){return n.some(function(r){return M9(t,r,r)})},Kf=function(){var t=!1;if(Ll){var n=Ll,r=n.observed,o=n.persistentFocus,s=n.autoFocus,i=n.shards,u=n.crossFrame,d=n.focusOptions,p=r||Fl&&Fl.portaledElement,m=document&&document.activeElement;if(p){var h=[p].concat(i.map(O9).filter(Boolean));if((!m||P9(m))&&(o||R9(u)||!k9()||!El&&s)&&(p&&!(E6(h)||m&&D9(m,h)||E9(m))&&(document&&!El&&m&&!s?(m.blur&&m.blur(),document.body.focus()):(t=M6(h,El,{focusOptions:d}),Fl={})),pu=!1,El=document&&document.activeElement),document){var v=document&&document.activeElement,b=w9(h),w=b.map(function(S){var C=S.node;return C}).indexOf(v);w>-1&&(b.filter(function(S){var C=S.guard,_=S.node;return C&&_.dataset.focusAutoGuard}).forEach(function(S){var C=S.node;return C.removeAttribute("tabIndex")}),f2(w,b.length,1,b),f2(w,-1,-1,b))}}}return t},T6=function(t){Kf()&&t&&(t.stopPropagation(),t.preventDefault())},qv=function(){return D6(Kf)},T9=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||I9(r,n)},A9=function(){return null},A6=function(){pu="just",setTimeout(function(){pu="meanwhile"},0)},N9=function(){document.addEventListener("focusin",T6),document.addEventListener("focusout",qv),window.addEventListener("blur",A6)},$9=function(){document.removeEventListener("focusin",T6),document.removeEventListener("focusout",qv),window.removeEventListener("blur",A6)};function z9(e){return e.filter(function(t){var n=t.disabled;return!n})}function L9(e){var t=e.slice(-1)[0];t&&!Ll&&N9();var n=Ll,r=n&&t&&t.id===n.id;Ll=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(El=null,(!r||n.observed!==t.observed)&&t.onActivation(),Kf(),D6(Kf)):($9(),El=null)}m6.assignSyncMedium(T9);g6.assignMedium(qv);UM.assignMedium(function(e){return e({moveFocusInside:M6,focusInside:E6})});const F9=YM(z9,L9)(A9);var N6=f.forwardRef(function(t,n){return f.createElement(v6,Jn({sideCar:F9,ref:n},t))}),$6=v6.propTypes||{};$6.sideCar;iR($6,["sideCar"]);N6.propTypes={};const p2=N6;var z6=e=>e.hasAttribute("tabindex"),B9=e=>z6(e)&&e.tabIndex===-1;function H9(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function L6(e){return e.parentElement&&L6(e.parentElement)?!0:e.hidden}function V9(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function F6(e){if(!R4(e)||L6(e)||H9(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]():V9(e)?!0:z6(e)}function W9(e){return e?R4(e)&&F6(e)&&!B9(e):!1}var U9=["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]"],G9=U9.join(),q9=e=>e.offsetWidth>0&&e.offsetHeight>0;function B6(e){const t=Array.from(e.querySelectorAll(G9));return t.unshift(e),t.filter(n=>F6(n)&&q9(n))}var h2,K9=(h2=p2.default)!=null?h2:p2,H6=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:i,autoFocus:u,persistentFocus:d,lockFocusAcrossFrames:p}=e,m=f.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&B6(r.current).length===0&&requestAnimationFrame(()=>{var w;(w=r.current)==null||w.focus()})},[t,r]),h=f.useCallback(()=>{var b;(b=n==null?void 0:n.current)==null||b.focus()},[n]),v=o&&!n;return a.jsx(K9,{crossFrame:p,persistentFocus:d,autoFocus:u,disabled:i,onActivation:m,onDeactivation:h,returnFocus:v,children:s})};H6.displayName="FocusLock";function Y9(e,t,n,r){const o=M4(t);return f.useEffect(()=>{var s;const i=(s=nx(n))!=null?s:document;if(t)return i.addEventListener(e,o,r),()=>{i.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=nx(n))!=null?s:document).removeEventListener(e,o,r)}}function Q9(e){const{ref:t,handler:n,enabled:r=!0}=e,o=M4(n),i=f.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;f.useEffect(()=>{if(!r)return;const u=h=>{pg(h,t)&&(i.isPointerDown=!0)},d=h=>{if(i.ignoreEmulatedMouseEvents){i.ignoreEmulatedMouseEvents=!1;return}i.isPointerDown&&n&&pg(h,t)&&(i.isPointerDown=!1,o(h))},p=h=>{i.ignoreEmulatedMouseEvents=!0,n&&i.isPointerDown&&pg(h,t)&&(i.isPointerDown=!1,o(h))},m=D4(t.current);return m.addEventListener("mousedown",u,!0),m.addEventListener("mouseup",d,!0),m.addEventListener("touchstart",u,!0),m.addEventListener("touchend",p,!0),()=>{m.removeEventListener("mousedown",u,!0),m.removeEventListener("mouseup",d,!0),m.removeEventListener("touchstart",u,!0),m.removeEventListener("touchend",p,!0)}},[n,t,o,i,r])}function pg(e,t){var n;const r=e.target;return r&&!D4(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}var[X9,Z9]=ar({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),V6=rt(function(t,n){const r=Yr("Input",t),{children:o,className:s,...i}=vr(t),u=Ot("chakra-input__group",s),d={},p=nh(o),m=r.field;p.forEach(v=>{var b,w;r&&(m&&v.type.id==="InputLeftElement"&&(d.paddingStart=(b=m.height)!=null?b:m.h),m&&v.type.id==="InputRightElement"&&(d.paddingEnd=(w=m.height)!=null?w:m.h),v.type.id==="InputRightAddon"&&(d.borderEndRadius=0),v.type.id==="InputLeftAddon"&&(d.borderStartRadius=0))});const h=p.map(v=>{var b,w;const S=Tv({size:((b=v.props)==null?void 0:b.size)||t.size,variant:((w=v.props)==null?void 0:w.variant)||t.variant});return v.type.id!=="Input"?f.cloneElement(v,S):f.cloneElement(v,Object.assign(S,d,v.props))});return a.jsx(Ue.div,{className:u,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate"},"data-group":!0,...i,children:a.jsx(X9,{value:r,children:h})})});V6.displayName="InputGroup";var J9=Ue("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),dh=rt(function(t,n){var r,o;const{placement:s="left",...i}=t,u=Z9(),d=u.field,m={[s==="left"?"insetStart":"insetEnd"]:"0",width:(r=d==null?void 0:d.height)!=null?r:d==null?void 0:d.h,height:(o=d==null?void 0:d.height)!=null?o:d==null?void 0:d.h,fontSize:d==null?void 0:d.fontSize,...u.element};return a.jsx(J9,{ref:n,__css:m,...i})});dh.id="InputElement";dh.displayName="InputElement";var W6=rt(function(t,n){const{className:r,...o}=t,s=Ot("chakra-input__left-element",r);return a.jsx(dh,{ref:n,placement:"left",className:s,...o})});W6.id="InputLeftElement";W6.displayName="InputLeftElement";var Kv=rt(function(t,n){const{className:r,...o}=t,s=Ot("chakra-input__right-element",r);return a.jsx(dh,{ref:n,placement:"right",className:s,...o})});Kv.id="InputRightElement";Kv.displayName="InputRightElement";var Tu=rt(function(t,n){const{htmlSize:r,...o}=t,s=Yr("Input",o),i=vr(o),u=bv(i),d=Ot("chakra-input",t.className);return a.jsx(Ue.input,{size:r,...u,__css:s.field,ref:n,className:d})});Tu.displayName="Input";Tu.id="Input";var Di=rt(function(t,n){const r=cc("Link",t),{className:o,isExternal:s,...i}=vr(t);return a.jsx(Ue.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:Ot("chakra-link",o),...i,__css:r})});Di.displayName="Link";var[eD,U6]=ar({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),Yv=rt(function(t,n){const r=Yr("List",t),{children:o,styleType:s="none",stylePosition:i,spacing:u,...d}=vr(t),p=nh(o),h=u?{["& > *:not(style) ~ *:not(style)"]:{mt:u}}:{};return a.jsx(eD,{value:r,children:a.jsx(Ue.ul,{ref:n,listStyleType:s,listStylePosition:i,role:"list",__css:{...r.container,...h},...d,children:p})})});Yv.displayName="List";var tD=rt((e,t)=>{const{as:n,...r}=e;return a.jsx(Yv,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});tD.displayName="OrderedList";var fh=rt(function(t,n){const{as:r,...o}=t;return a.jsx(Yv,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});fh.displayName="UnorderedList";var Oo=rt(function(t,n){const r=U6();return a.jsx(Ue.li,{ref:n,...t,__css:r.item})});Oo.displayName="ListItem";var nD=rt(function(t,n){const r=U6();return a.jsx(oo,{ref:n,role:"presentation",...t,__css:r.icon})});nD.displayName="ListIcon";var Bi=rt(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:i,column:u,row:d,autoFlow:p,autoRows:m,templateRows:h,autoColumns:v,templateColumns:b,...w}=t,S={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:i,gridAutoColumns:v,gridColumn:u,gridRow:d,gridAutoFlow:p,gridAutoRows:m,gridTemplateRows:h,gridTemplateColumns:b};return a.jsx(Ue.div,{ref:n,__css:S,...w})});Bi.displayName="Grid";var li=Ue("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});li.displayName="Spacer";var tt=rt(function(t,n){const r=cc("Text",t),{className:o,align:s,decoration:i,casing:u,...d}=vr(t),p=Tv({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return a.jsx(Ue.p,{ref:n,className:Ot("chakra-text",t.className),...p,...d,__css:r})});tt.displayName="Text";var _r=rt((e,t)=>a.jsx(DE,{align:"center",...e,direction:"column",ref:t}));_r.displayName="VStack";function m2(e){return TE(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var wf=rt(function(t,n){const{area:r,colSpan:o,colStart:s,colEnd:i,rowEnd:u,rowSpan:d,rowStart:p,...m}=t,h=Tv({gridArea:r,gridColumn:m2(o),gridRow:m2(d),gridColumnStart:s,gridColumnEnd:i,gridRowStart:p,gridRowEnd:u});return a.jsx(Ue.div,{ref:n,__css:h,...m})});wf.displayName="GridItem";var Hi=rt(function(t,n){const r=cc("Badge",t),{className:o,...s}=vr(t);return a.jsx(Ue.span,{ref:n,className:Ot("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Hi.displayName="Badge";var Ia=rt(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:i,borderWidth:u,borderStyle:d,borderColor:p,...m}=cc("Divider",t),{className:h,orientation:v="horizontal",__css:b,...w}=vr(t),S={vertical:{borderLeftWidth:r||i||u||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||u||"1px",width:"100%"}};return a.jsx(Ue.hr,{ref:n,"aria-orientation":v,...w,__css:{...m,border:"0",borderColor:p,borderStyle:d,...S[v],...b},className:Ot("chakra-divider",h)})});Ia.displayName="Divider";function rD(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function oD(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=f.useState([]),s=f.useRef(),i=()=>{s.current&&(clearTimeout(s.current),s.current=null)},u=()=>{i(),s.current=setTimeout(()=>{o([]),s.current=null},t)};f.useEffect(()=>i,[]);function d(p){return m=>{if(m.key==="Backspace"){const h=[...r];h.pop(),o(h);return}if(rD(m)){const h=r.concat(m.key);n(m)&&(m.preventDefault(),m.stopPropagation()),o(h),p(h.join("")),u()}}}return d}function sD(e,t,n,r){if(t==null)return r;if(!r)return e.find(i=>n(i).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(s=>n(s).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let s;return o.includes(r)?(s=o.indexOf(r)+1,s===o.length&&(s=0),o[s]):(s=e.indexOf(o[0]),e[s])}return r}function aD(){const e=f.useRef(new Map),t=e.current,n=f.useCallback((o,s,i,u)=>{e.current.set(i,{type:s,el:o,options:u}),o.addEventListener(s,i,u)},[]),r=f.useCallback((o,s,i,u)=>{o.removeEventListener(s,i,u),e.current.delete(i)},[]);return f.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function hg(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function G6(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:i,onMouseUp:u,onClick:d,onKeyDown:p,onKeyUp:m,tabIndex:h,onMouseOver:v,onMouseLeave:b,...w}=e,[S,C]=f.useState(!0),[_,k]=f.useState(!1),P=aD(),E=A=>{A&&A.tagName!=="BUTTON"&&C(!1)},I=S?h:h||0,R=n&&!r,O=f.useCallback(A=>{if(n){A.stopPropagation(),A.preventDefault();return}A.currentTarget.focus(),d==null||d(A)},[n,d]),D=f.useCallback(A=>{_&&hg(A)&&(A.preventDefault(),A.stopPropagation(),k(!1),P.remove(document,"keyup",D,!1))},[_,P]),T=f.useCallback(A=>{if(p==null||p(A),n||A.defaultPrevented||A.metaKey||!hg(A.nativeEvent)||S)return;const U=o&&A.key==="Enter";s&&A.key===" "&&(A.preventDefault(),k(!0)),U&&(A.preventDefault(),A.currentTarget.click()),P.add(document,"keyup",D,!1)},[n,S,p,o,s,P,D]),$=f.useCallback(A=>{if(m==null||m(A),n||A.defaultPrevented||A.metaKey||!hg(A.nativeEvent)||S)return;s&&A.key===" "&&(A.preventDefault(),k(!1),A.currentTarget.click())},[s,S,n,m]),B=f.useCallback(A=>{A.button===0&&(k(!1),P.remove(document,"mouseup",B,!1))},[P]),ee=f.useCallback(A=>{if(A.button!==0)return;if(n){A.stopPropagation(),A.preventDefault();return}S||k(!0),A.currentTarget.focus({preventScroll:!0}),P.add(document,"mouseup",B,!1),i==null||i(A)},[n,S,i,P,B]),F=f.useCallback(A=>{A.button===0&&(S||k(!1),u==null||u(A))},[u,S]),N=f.useCallback(A=>{if(n){A.preventDefault();return}v==null||v(A)},[n,v]),H=f.useCallback(A=>{_&&(A.preventDefault(),k(!1)),b==null||b(A)},[_,b]),K=Wn(t,E);return S?{...w,ref:K,type:"button","aria-disabled":R?void 0:n,disabled:R,onClick:O,onMouseDown:i,onMouseUp:u,onKeyUp:m,onKeyDown:p,onMouseOver:v,onMouseLeave:b}:{...w,ref:K,role:"button","data-active":sn(_),"aria-disabled":n?"true":void 0,tabIndex:R?void 0:I,onClick:O,onMouseDown:ee,onMouseUp:F,onKeyUp:$,onKeyDown:T,onMouseOver:N,onMouseLeave:H}}function iD(e){const t=e.current;if(!t)return!1;const n=AE(t);return!n||t.contains(n)?!1:!!W9(n)}function q6(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;Xi(()=>{if(!s||iD(e))return;const i=(o==null?void 0:o.current)||e.current;let u;if(i)return u=requestAnimationFrame(()=>{i.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(u)}},[s,e,o])}var lD={preventScroll:!0,shouldFocus:!1};function cD(e,t=lD){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,i=uD(e)?e.current:e,u=o&&s,d=f.useRef(u),p=f.useRef(s);tu(()=>{!p.current&&s&&(d.current=u),p.current=s},[s,u]);const m=f.useCallback(()=>{if(!(!s||!i||!d.current)&&(d.current=!1,!i.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=B6(i);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[s,r,i,n]);Xi(()=>{m()},[m]),vv(i,"transitionend",m)}function uD(e){return"current"in e}function dD(e){const{ref:t,handler:n,enabled:r=!0}=e,o=Ja(n),i=f.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;f.useEffect(()=>{if(!r)return;const u=h=>{mg(h,t)&&(i.isPointerDown=!0)},d=h=>{if(i.ignoreEmulatedMouseEvents){i.ignoreEmulatedMouseEvents=!1;return}i.isPointerDown&&n&&mg(h,t)&&(i.isPointerDown=!1,o(h))},p=h=>{i.ignoreEmulatedMouseEvents=!0,n&&i.isPointerDown&&mg(h,t)&&(i.isPointerDown=!1,o(h))},m=K6(t.current);return m.addEventListener("mousedown",u,!0),m.addEventListener("mouseup",d,!0),m.addEventListener("touchstart",u,!0),m.addEventListener("touchend",p,!0),()=>{m.removeEventListener("mousedown",u,!0),m.removeEventListener("mouseup",d,!0),m.removeEventListener("touchstart",u,!0),m.removeEventListener("touchend",p,!0)}},[n,t,o,i,r])}function mg(e,t){var n;const r=e.target;return r&&!K6(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function K6(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Y6(e){const{isOpen:t,ref:n}=e,[r,o]=f.useState(t),[s,i]=f.useState(!1);return f.useEffect(()=>{s||(o(t),i(!0))},[t,s,r]),vv(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var d;const p=NE(n.current),m=new p.CustomEvent("animationend",{bubbles:!0});(d=n.current)==null||d.dispatchEvent(m)}}}function Qv(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[fD,pD,hD,mD]=Av(),[gD,Au]=ar({strict:!1,name:"MenuContext"});function vD(e,...t){const n=f.useId(),r=e||n;return f.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function Q6(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function g2(e){return Q6(e).activeElement===e}function yD(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:i,isOpen:u,defaultIsOpen:d,onClose:p,onOpen:m,placement:h="bottom-start",lazyBehavior:v="unmount",direction:b,computePositionOnMount:w=!1,...S}=e,C=f.useRef(null),_=f.useRef(null),k=hD(),P=f.useCallback(()=>{requestAnimationFrame(()=>{var ce;(ce=C.current)==null||ce.focus({preventScroll:!1})})},[]),E=f.useCallback(()=>{const ce=setTimeout(()=>{var se;if(o)(se=o.current)==null||se.focus();else{const X=k.firstEnabled();X&&F(X.index)}});U.current.add(ce)},[k,o]),I=f.useCallback(()=>{const ce=setTimeout(()=>{const se=k.lastEnabled();se&&F(se.index)});U.current.add(ce)},[k]),R=f.useCallback(()=>{m==null||m(),s?E():P()},[s,E,P,m]),{isOpen:O,onOpen:D,onClose:T,onToggle:$}=T4({isOpen:u,defaultIsOpen:d,onClose:p,onOpen:R});dD({enabled:O&&r,ref:C,handler:ce=>{var se;(se=_.current)!=null&&se.contains(ce.target)||T()}});const B=A4({...S,enabled:O||w,placement:h,direction:b}),[ee,F]=f.useState(-1);Xi(()=>{O||F(-1)},[O]),q6(C,{focusRef:_,visible:O,shouldFocus:!0});const N=Y6({isOpen:O,ref:C}),[H,K]=vD(t,"menu-button","menu-list"),A=f.useCallback(()=>{D(),P()},[D,P]),U=f.useRef(new Set([]));jD(()=>{U.current.forEach(ce=>clearTimeout(ce)),U.current.clear()});const V=f.useCallback(()=>{D(),E()},[E,D]),W=f.useCallback(()=>{D(),I()},[D,I]),re=f.useCallback(()=>{var ce,se;const X=Q6(C.current),ie=(ce=C.current)==null?void 0:ce.contains(X.activeElement);if(!(O&&!ie))return;const xe=(se=k.item(ee))==null?void 0:se.node;xe==null||xe.focus()},[O,ee,k]),be=f.useRef(null);return{openAndFocusMenu:A,openAndFocusFirstItem:V,openAndFocusLastItem:W,onTransitionEnd:re,unstable__animationState:N,descendants:k,popper:B,buttonId:H,menuId:K,forceUpdate:B.forceUpdate,orientation:"vertical",isOpen:O,onToggle:$,onOpen:D,onClose:T,menuRef:C,buttonRef:_,focusedIndex:ee,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:F,isLazy:i,lazyBehavior:v,initialFocusRef:o,rafId:be}}function bD(e={},t=null){const n=Au(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:i}=n,u=f.useCallback(d=>{const p=d.key,h={Enter:s,ArrowDown:s,ArrowUp:i}[p];h&&(d.preventDefault(),d.stopPropagation(),h(d))},[s,i]);return{...e,ref:Wn(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":sn(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:xt(e.onClick,r),onKeyDown:xt(e.onKeyDown,u)}}function x0(e){var t;return _D(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function xD(e={},t=null){const n=Au();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");const{focusedIndex:r,setFocusedIndex:o,menuRef:s,isOpen:i,onClose:u,menuId:d,isLazy:p,lazyBehavior:m,unstable__animationState:h}=n,v=pD(),b=oD({preventDefault:_=>_.key!==" "&&x0(_.target)}),w=f.useCallback(_=>{if(!_.currentTarget.contains(_.target))return;const k=_.key,E={Tab:R=>R.preventDefault(),Escape:u,ArrowDown:()=>{const R=v.nextEnabled(r);R&&o(R.index)},ArrowUp:()=>{const R=v.prevEnabled(r);R&&o(R.index)}}[k];if(E){_.preventDefault(),E(_);return}const I=b(R=>{const O=sD(v.values(),R,D=>{var T,$;return($=(T=D==null?void 0:D.node)==null?void 0:T.textContent)!=null?$:""},v.item(r));if(O){const D=v.indexOf(O.node);o(D)}});x0(_.target)&&I(_)},[v,r,b,u,o]),S=f.useRef(!1);i&&(S.current=!0);const C=Qv({wasSelected:S.current,enabled:p,mode:m,isSelected:h.present});return{...e,ref:Wn(s,t),children:C?e.children:null,tabIndex:-1,role:"menu",id:d,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:xt(e.onKeyDown,w)}}function SD(e={}){const{popper:t,isOpen:n}=Au();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function X6(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:i,isDisabled:u,isFocusable:d,closeOnSelect:p,type:m,...h}=e,v=Au(),{setFocusedIndex:b,focusedIndex:w,closeOnSelect:S,onClose:C,menuRef:_,isOpen:k,menuId:P,rafId:E}=v,I=f.useRef(null),R=`${P}-menuitem-${f.useId()}`,{index:O,register:D}=mD({disabled:u&&!d}),T=f.useCallback(A=>{n==null||n(A),!u&&b(O)},[b,O,u,n]),$=f.useCallback(A=>{r==null||r(A),I.current&&!g2(I.current)&&T(A)},[T,r]),B=f.useCallback(A=>{o==null||o(A),!u&&b(-1)},[b,u,o]),ee=f.useCallback(A=>{s==null||s(A),x0(A.currentTarget)&&(p??S)&&C()},[C,s,S,p]),F=f.useCallback(A=>{i==null||i(A),b(O)},[b,i,O]),N=O===w,H=u&&!d;Xi(()=>{k&&(N&&!H&&I.current?(E.current&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame(()=>{var A;(A=I.current)==null||A.focus(),E.current=null})):_.current&&!g2(_.current)&&_.current.focus({preventScroll:!0}))},[N,H,_,k]);const K=G6({onClick:ee,onFocus:F,onMouseEnter:T,onMouseMove:$,onMouseLeave:B,ref:Wn(D,I,t),isDisabled:u,isFocusable:d});return{...h,...K,type:m??K.type,id:R,role:"menuitem",tabIndex:N?0:-1}}function wD(e={},t=null){const{type:n="radio",isChecked:r,...o}=e;return{...X6(o,t),role:`menuitem${n}`,"aria-checked":r}}function CD(e={}){const{children:t,type:n="radio",value:r,defaultValue:o,onChange:s,...i}=e,d=n==="radio"?"":[],[p,m]=ku({defaultValue:o??d,value:r,onChange:s}),h=f.useCallback(w=>{if(n==="radio"&&typeof p=="string"&&m(w),n==="checkbox"&&Array.isArray(p)){const S=p.includes(w)?p.filter(C=>C!==w):p.concat(w);m(S)}},[p,m,n]),b=nh(t).map(w=>{if(w.type.id!=="MenuItemOption")return w;const S=_=>{var k,P;h(w.props.value),(P=(k=w.props).onClick)==null||P.call(k,_)},C=n==="radio"?w.props.value===p:p.includes(w.props.value);return f.cloneElement(w,{type:n,onClick:S,isChecked:C})});return{...i,children:b}}function _D(e){var t;if(!kD(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function kD(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function jD(e,t=[]){return f.useEffect(()=>()=>e(),t)}var[PD,Nu]=ar({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),ph=e=>{const{children:t}=e,n=Yr("Menu",e),r=vr(e),{direction:o}=rh(),{descendants:s,...i}=yD({...r,direction:o}),u=f.useMemo(()=>i,[i]),{isOpen:d,onClose:p,forceUpdate:m}=u;return a.jsx(fD,{value:s,children:a.jsx(gD,{value:u,children:a.jsx(PD,{value:n,children:yv(t,{isOpen:d,onClose:p,forceUpdate:m})})})})};ph.displayName="Menu";var Z6=rt((e,t)=>{const n=Nu();return a.jsx(Ue.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});Z6.displayName="MenuCommand";var J6=rt((e,t)=>{const{type:n,...r}=e,o=Nu(),s=r.as||n?n??void 0:"button",i=f.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return a.jsx(Ue.button,{ref:t,type:s,...r,__css:i})}),Xv=e=>{const{className:t,children:n,...r}=e,o=f.Children.only(n),s=f.isValidElement(o)?f.cloneElement(o,{focusable:"false","aria-hidden":!0,className:Ot("chakra-menu__icon",o.props.className)}):null,i=Ot("chakra-menu__icon-wrapper",t);return a.jsx(Ue.span,{className:i,...r,__css:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s})};Xv.displayName="MenuIcon";var Lr=rt((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:i,...u}=e,d=X6(u,t),m=n||o?a.jsx("span",{style:{pointerEvents:"none",flex:1},children:i}):i;return a.jsxs(J6,{...d,className:Ot("chakra-menu__menuitem",d.className),children:[n&&a.jsx(Xv,{fontSize:"0.8em",marginEnd:r,children:n}),m,o&&a.jsx(Z6,{marginStart:s,children:o})]})});Lr.displayName="MenuItem";var ID={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"}}},ED=Ue(vo.div),$u=rt(function(t,n){var r,o;const{rootProps:s,motionProps:i,...u}=t,{isOpen:d,onTransitionEnd:p,unstable__animationState:m}=Au(),h=xD(u,n),v=SD(s),b=Nu();return a.jsx(Ue.div,{...v,__css:{zIndex:(o=t.zIndex)!=null?o:(r=b.list)==null?void 0:r.zIndex},children:a.jsx(ED,{variants:ID,initial:!1,animate:d?"enter":"exit",__css:{outline:0,...b.list},...i,className:Ot("chakra-menu__menu-list",h.className),...h,onUpdate:p,onAnimationComplete:th(m.onComplete,h.onAnimationComplete)})})});$u.displayName="MenuList";var e5=rt((e,t)=>{const{title:n,children:r,className:o,...s}=e,i=Ot("chakra-menu__group__title",o),u=Nu();return a.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&a.jsx(Ue.p,{className:i,...s,__css:u.groupTitle,children:n}),r]})});e5.displayName="MenuGroup";var Zv=e=>{const{className:t,title:n,...r}=e,o=CD(r);return a.jsx(e5,{title:n,className:Ot("chakra-menu__option-group",t),...o})};Zv.displayName="MenuOptionGroup";var OD=rt((e,t)=>{const n=Nu();return a.jsx(Ue.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),hh=rt((e,t)=>{const{children:n,as:r,...o}=e,s=bD(o,t),i=r||OD;return a.jsx(i,{...s,className:Ot("chakra-menu__menu-button",e.className),children:a.jsx(Ue.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});hh.displayName="MenuButton";var RD=e=>a.jsx("svg",{viewBox:"0 0 14 14",width:"1em",height:"1em",...e,children:a.jsx("polygon",{fill:"currentColor",points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})}),hu=rt((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",...o}=e,s=wD(o,t);return a.jsxs(J6,{...s,className:Ot("chakra-menu__menuitem-option",o.className),children:[n!==null&&a.jsx(Xv,{fontSize:"0.8em",marginEnd:r,opacity:e.isChecked?1:0,children:n||a.jsx(RD,{})}),a.jsx("span",{style:{flex:1},children:s.children})]})});hu.id="MenuItemOption";hu.displayName="MenuItemOption";var MD={slideInBottom:{...f0,custom:{offsetY:16,reverse:!0}},slideInRight:{...f0,custom:{offsetX:16,reverse:!0}},scale:{...W3,custom:{initialScale:.95,reverse:!0}},none:{}},DD=Ue(vo.section),TD=e=>MD[e||"none"],t5=f.forwardRef((e,t)=>{const{preset:n,motionProps:r=TD(n),...o}=e;return a.jsx(DD,{ref:t,...r,...o})});t5.displayName="ModalTransition";var AD=Object.defineProperty,ND=(e,t,n)=>t in e?AD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$D=(e,t,n)=>(ND(e,typeof t!="symbol"?t+"":t,n),n),zD=class{constructor(){$D(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}},S0=new zD;function n5(e,t){const[n,r]=f.useState(0);return f.useEffect(()=>{const o=e.current;if(o){if(t){const s=S0.add(o);r(s)}return()=>{S0.remove(o),r(0)}}},[t,e]),n}var LD=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},bl=new WeakMap,Ad=new WeakMap,Nd={},gg=0,r5=function(e){return e&&(e.host||r5(e.parentNode))},FD=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=r5(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},BD=function(e,t,n,r){var o=FD(t,Array.isArray(e)?e:[e]);Nd[n]||(Nd[n]=new WeakMap);var s=Nd[n],i=[],u=new Set,d=new Set(o),p=function(h){!h||u.has(h)||(u.add(h),p(h.parentNode))};o.forEach(p);var m=function(h){!h||d.has(h)||Array.prototype.forEach.call(h.children,function(v){if(u.has(v))m(v);else{var b=v.getAttribute(r),w=b!==null&&b!=="false",S=(bl.get(v)||0)+1,C=(s.get(v)||0)+1;bl.set(v,S),s.set(v,C),i.push(v),S===1&&w&&Ad.set(v,!0),C===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}})};return m(t),u.clear(),gg++,function(){i.forEach(function(h){var v=bl.get(h)-1,b=s.get(h)-1;bl.set(h,v),s.set(h,b),v||(Ad.has(h)||h.removeAttribute(r),Ad.delete(h)),b||h.removeAttribute(n)}),gg--,gg||(bl=new WeakMap,bl=new WeakMap,Ad=new WeakMap,Nd={})}},HD=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||LD(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),BD(r,o,n,"aria-hidden")):function(){return null}};function VD(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:i=!0,onOverlayClick:u,onEsc:d}=e,p=f.useRef(null),m=f.useRef(null),[h,v,b]=UD(r,"chakra-modal","chakra-modal--header","chakra-modal--body");WD(p,t&&i);const w=n5(p,t),S=f.useRef(null),C=f.useCallback(T=>{S.current=T.target},[]),_=f.useCallback(T=>{T.key==="Escape"&&(T.stopPropagation(),s&&(n==null||n()),d==null||d())},[s,n,d]),[k,P]=f.useState(!1),[E,I]=f.useState(!1),R=f.useCallback((T={},$=null)=>({role:"dialog",...T,ref:Wn($,p),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":k?v:void 0,"aria-describedby":E?b:void 0,onClick:xt(T.onClick,B=>B.stopPropagation())}),[b,E,h,v,k]),O=f.useCallback(T=>{T.stopPropagation(),S.current===T.target&&S0.isTopModal(p.current)&&(o&&(n==null||n()),u==null||u())},[n,o,u]),D=f.useCallback((T={},$=null)=>({...T,ref:Wn($,m),onClick:xt(T.onClick,O),onKeyDown:xt(T.onKeyDown,_),onMouseDown:xt(T.onMouseDown,C)}),[_,C,O]);return{isOpen:t,onClose:n,headerId:v,bodyId:b,setBodyMounted:I,setHeaderMounted:P,dialogRef:p,overlayRef:m,getDialogProps:R,getDialogContainerProps:D,index:w}}function WD(e,t){const n=e.current;f.useEffect(()=>{if(!(!e.current||!t))return HD(e.current)},[t,e,n])}function UD(e,...t){const n=f.useId(),r=e||n;return f.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[GD,mc]=ar({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[qD,Vi]=ar({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),mu=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:o,trapFocus:s,initialFocusRef:i,finalFocusRef:u,returnFocusOnClose:d,blockScrollOnMount:p,allowPinchZoom:m,preserveScrollBarGap:h,motionPreset:v,lockFocusAcrossFrames:b,onCloseComplete:w}=t,S=Yr("Modal",t),_={...VD(t),autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:u,returnFocusOnClose:d,blockScrollOnMount:p,allowPinchZoom:m,preserveScrollBarGap:h,motionPreset:v,lockFocusAcrossFrames:b};return a.jsx(qD,{value:_,children:a.jsx(GD,{value:S,children:a.jsx(Os,{onExitComplete:w,children:_.isOpen&&a.jsx(Ef,{...n,children:r})})})})};mu.displayName="Modal";var Cf="right-scroll-bar-position",_f="width-before-scroll-bar",KD="with-scroll-bars-hidden",YD="--removed-body-scroll-bar-size",o5=p6(),vg=function(){},mh=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:vg,onWheelCapture:vg,onTouchMoveCapture:vg}),o=r[0],s=r[1],i=e.forwardProps,u=e.children,d=e.className,p=e.removeScrollBar,m=e.enabled,h=e.shards,v=e.sideCar,b=e.noIsolation,w=e.inert,S=e.allowPinchZoom,C=e.as,_=C===void 0?"div":C,k=e.gapMode,P=u6(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=v,I=c6([n,t]),R=Vs(Vs({},P),o);return f.createElement(f.Fragment,null,m&&f.createElement(E,{sideCar:o5,removeScrollBar:p,shards:h,noIsolation:b,inert:w,setCallbacks:s,allowPinchZoom:!!S,lockRef:n,gapMode:k}),i?f.cloneElement(f.Children.only(u),Vs(Vs({},R),{ref:I})):f.createElement(_,Vs({},R,{className:d,ref:I}),u))});mh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};mh.classNames={fullWidth:_f,zeroRight:Cf};var v2,QD=function(){if(v2)return v2;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function XD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=QD();return t&&e.setAttribute("nonce",t),e}function ZD(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JD(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var eT=function(){var e=0,t=null;return{add:function(n){e==0&&(t=XD())&&(ZD(t,n),JD(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tT=function(){var e=eT();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},s5=function(){var e=tT(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},nT={left:0,top:0,right:0,gap:0},yg=function(e){return parseInt(e||"",10)||0},rT=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[yg(n),yg(r),yg(o)]},oT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return nT;var t=rT(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])}},sT=s5(),aT=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(KD,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
body {
|
||
overflow: hidden `).concat(r,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
||
padding-left: `.concat(o,`px;
|
||
padding-top: `).concat(s,`px;
|
||
padding-right: `).concat(i,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Cf,` {
|
||
right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(_f,` {
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Cf," .").concat(Cf,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(_f," .").concat(_f,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body {
|
||
`).concat(YD,": ").concat(u,`px;
|
||
}
|
||
`)},iT=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=f.useMemo(function(){return oT(o)},[o]);return f.createElement(sT,{styles:aT(s,!t,o,n?"":"!important")})},w0=!1;if(typeof window<"u")try{var $d=Object.defineProperty({},"passive",{get:function(){return w0=!0,!0}});window.addEventListener("test",$d,$d),window.removeEventListener("test",$d,$d)}catch{w0=!1}var xl=w0?{passive:!1}:!1,lT=function(e){return e.tagName==="TEXTAREA"},a5=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lT(e)&&n[t]==="visible")},cT=function(e){return a5(e,"overflowY")},uT=function(e){return a5(e,"overflowX")},y2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=i5(e,r);if(o){var s=l5(e,r),i=s[1],u=s[2];if(i>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dT=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},fT=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},i5=function(e,t){return e==="v"?cT(t):uT(t)},l5=function(e,t){return e==="v"?dT(t):fT(t)},pT=function(e,t){return e==="h"&&t==="rtl"?-1:1},hT=function(e,t,n,r,o){var s=pT(e,window.getComputedStyle(t).direction),i=s*r,u=n.target,d=t.contains(u),p=!1,m=i>0,h=0,v=0;do{var b=l5(e,u),w=b[0],S=b[1],C=b[2],_=S-C-s*w;(w||_)&&i5(e,u)&&(h+=_,v+=w),u=u.parentNode}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(m&&(o&&h===0||!o&&i>h)||!m&&(o&&v===0||!o&&-i>v))&&(p=!0),p},zd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},b2=function(e){return[e.deltaX,e.deltaY]},x2=function(e){return e&&"current"in e?e.current:e},mT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gT=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},vT=0,Sl=[];function yT(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(vT++)[0],s=f.useState(s5)[0],i=f.useRef(e);f.useEffect(function(){i.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var S=g0([e.lockRef.current],(e.shards||[]).map(x2),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=f.useCallback(function(S,C){if("touches"in S&&S.touches.length===2)return!i.current.allowPinchZoom;var _=zd(S),k=n.current,P="deltaX"in S?S.deltaX:k[0]-_[0],E="deltaY"in S?S.deltaY:k[1]-_[1],I,R=S.target,O=Math.abs(P)>Math.abs(E)?"h":"v";if("touches"in S&&O==="h"&&R.type==="range")return!1;var D=y2(O,R);if(!D)return!0;if(D?I=O:(I=O==="v"?"h":"v",D=y2(O,R)),!D)return!1;if(!r.current&&"changedTouches"in S&&(P||E)&&(r.current=I),!I)return!0;var T=r.current||I;return hT(T,C,S,T==="h"?P:E,!0)},[]),d=f.useCallback(function(S){var C=S;if(!(!Sl.length||Sl[Sl.length-1]!==s)){var _="deltaY"in C?b2(C):zd(C),k=t.current.filter(function(I){return I.name===C.type&&I.target===C.target&&mT(I.delta,_)})[0];if(k&&k.should){C.cancelable&&C.preventDefault();return}if(!k){var P=(i.current.shards||[]).map(x2).filter(Boolean).filter(function(I){return I.contains(C.target)}),E=P.length>0?u(C,P[0]):!i.current.noIsolation;E&&C.cancelable&&C.preventDefault()}}},[]),p=f.useCallback(function(S,C,_,k){var P={name:S,delta:C,target:_,should:k};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(E){return E!==P})},1)},[]),m=f.useCallback(function(S){n.current=zd(S),r.current=void 0},[]),h=f.useCallback(function(S){p(S.type,b2(S),S.target,u(S,e.lockRef.current))},[]),v=f.useCallback(function(S){p(S.type,zd(S),S.target,u(S,e.lockRef.current))},[]);f.useEffect(function(){return Sl.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",d,xl),document.addEventListener("touchmove",d,xl),document.addEventListener("touchstart",m,xl),function(){Sl=Sl.filter(function(S){return S!==s}),document.removeEventListener("wheel",d,xl),document.removeEventListener("touchmove",d,xl),document.removeEventListener("touchstart",m,xl)}},[]);var b=e.removeScrollBar,w=e.inert;return f.createElement(f.Fragment,null,w?f.createElement(s,{styles:gT(o)}):null,b?f.createElement(iT,{gapMode:e.gapMode}):null)}const bT=WM(o5,yT);var c5=f.forwardRef(function(e,t){return f.createElement(mh,Vs({},e,{ref:t,sideCar:bT}))});c5.classNames=mh.classNames;const xT=c5;function ST(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:i,finalFocusRef:u,returnFocusOnClose:d,preserveScrollBarGap:p,lockFocusAcrossFrames:m,isOpen:h}=Vi(),[v,b]=$E();f.useEffect(()=>{!v&&b&&setTimeout(b)},[v,b]);const w=n5(r,h);return a.jsx(H6,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:u,restoreFocus:d,contentRef:r,lockFocusAcrossFrames:m,children:a.jsx(xT,{removeScrollBar:!p,allowPinchZoom:i,enabled:w===1&&s,forwardProps:!0,children:e.children})})}var gu=rt((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...i}=e,{getDialogProps:u,getDialogContainerProps:d}=Vi(),p=u(i,t),m=d(o),h=Ot("chakra-modal__content",n),v=mc(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},w={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{motionPreset:S}=Vi();return a.jsx(ST,{children:a.jsx(Ue.div,{...m,className:"chakra-modal__content-container",tabIndex:-1,__css:w,children:a.jsx(t5,{preset:S,motionProps:s,className:h,...p,__css:b,children:r})})})});gu.displayName="ModalContent";function zu(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(mu,{...n,initialFocusRef:t})}var Lu=rt((e,t)=>a.jsx(gu,{ref:t,role:"alertdialog",...e})),ba=rt((e,t)=>{const{className:n,...r}=e,o=Ot("chakra-modal__footer",n),i={display:"flex",alignItems:"center",justifyContent:"flex-end",...mc().footer};return a.jsx(Ue.footer,{ref:t,...r,__css:i,className:o})});ba.displayName="ModalFooter";var xa=rt((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Vi();f.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=Ot("chakra-modal__header",n),d={flex:0,...mc().header};return a.jsx(Ue.header,{ref:t,className:i,id:o,...r,__css:d})});xa.displayName="ModalHeader";var wT=Ue(vo.div),Sa=rt((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,i=Ot("chakra-modal__overlay",n),d={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...mc().overlay},{motionPreset:p}=Vi(),h=o||(p==="none"?{}:V3);return a.jsx(wT,{...h,__css:d,ref:t,className:i,...s})});Sa.displayName="ModalOverlay";var wa=rt((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Vi();f.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=Ot("chakra-modal__body",n),u=mc();return a.jsx(Ue.div,{ref:t,className:i,id:o,...r,__css:u.body})});wa.displayName="ModalBody";var Jv=rt((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Vi(),i=Ot("chakra-modal__close-btn",r),u=mc();return a.jsx(zE,{ref:t,__css:u.closeButton,className:i,onClick:xt(n,d=>{d.stopPropagation(),s()}),...o})});Jv.displayName="ModalCloseButton";var[CT,Fu]=ar({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[_T,e1]=ar({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function t1(e){const t=f.Children.only(e.children),{getTriggerProps:n}=Fu();return f.cloneElement(t,n(t.props,t.ref))}t1.displayName="PopoverTrigger";var wl={click:"click",hover:"hover"};function kT(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:i=!0,arrowSize:u,arrowShadowColor:d,trigger:p=wl.click,openDelay:m=200,closeDelay:h=200,isLazy:v,lazyBehavior:b="unmount",computePositionOnMount:w,...S}=e,{isOpen:C,onClose:_,onOpen:k,onToggle:P}=T4(e),E=f.useRef(null),I=f.useRef(null),R=f.useRef(null),O=f.useRef(!1),D=f.useRef(!1);C&&(D.current=!0);const[T,$]=f.useState(!1),[B,ee]=f.useState(!1),F=f.useId(),N=o??F,[H,K,A,U]=["popover-trigger","popover-content","popover-header","popover-body"].map(Oe=>`${Oe}-${N}`),{referenceRef:V,getArrowProps:W,getPopperProps:re,getArrowInnerProps:be,forceUpdate:ce}=A4({...S,enabled:C||!!w}),se=Y6({isOpen:C,ref:R});r6({enabled:C,ref:I}),q6(R,{focusRef:I,visible:C,shouldFocus:s&&p===wl.click}),cD(R,{focusRef:r,visible:C,shouldFocus:i&&p===wl.click});const X=Qv({wasSelected:D.current,enabled:v,mode:b,isSelected:se.present}),ie=f.useCallback((Oe={},at=null)=>{const Fe={...Oe,style:{...Oe.style,transformOrigin:tg.transformOrigin.varRef,[tg.arrowSize.var]:u?`${u}px`:void 0,[tg.arrowShadowColor.var]:d},ref:Wn(R,at),children:X?Oe.children:null,id:K,tabIndex:-1,role:"dialog",onKeyDown:xt(Oe.onKeyDown,qe=>{n&&qe.key==="Escape"&&_()}),onBlur:xt(Oe.onBlur,qe=>{const Pt=S2(qe),St=bg(R.current,Pt),zn=bg(I.current,Pt);C&&t&&(!St&&!zn)&&_()}),"aria-labelledby":T?A:void 0,"aria-describedby":B?U:void 0};return p===wl.hover&&(Fe.role="tooltip",Fe.onMouseEnter=xt(Oe.onMouseEnter,()=>{O.current=!0}),Fe.onMouseLeave=xt(Oe.onMouseLeave,qe=>{qe.nativeEvent.relatedTarget!==null&&(O.current=!1,setTimeout(()=>_(),h))})),Fe},[X,K,T,A,B,U,p,n,_,C,t,h,d,u]),de=f.useCallback((Oe={},at=null)=>re({...Oe,style:{visibility:C?"visible":"hidden",...Oe.style}},at),[C,re]),xe=f.useCallback((Oe,at=null)=>({...Oe,ref:Wn(at,E,V)}),[E,V]),oe=f.useRef(),ve=f.useRef(),he=f.useCallback(Oe=>{E.current==null&&V(Oe)},[V]),je=f.useCallback((Oe={},at=null)=>{const Fe={...Oe,ref:Wn(I,at,he),id:H,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":K};return p===wl.click&&(Fe.onClick=xt(Oe.onClick,P)),p===wl.hover&&(Fe.onFocus=xt(Oe.onFocus,()=>{oe.current===void 0&&k()}),Fe.onBlur=xt(Oe.onBlur,qe=>{const Pt=S2(qe),St=!bg(R.current,Pt);C&&t&&St&&_()}),Fe.onKeyDown=xt(Oe.onKeyDown,qe=>{qe.key==="Escape"&&_()}),Fe.onMouseEnter=xt(Oe.onMouseEnter,()=>{O.current=!0,oe.current=window.setTimeout(()=>k(),m)}),Fe.onMouseLeave=xt(Oe.onMouseLeave,()=>{O.current=!1,oe.current&&(clearTimeout(oe.current),oe.current=void 0),ve.current=window.setTimeout(()=>{O.current===!1&&_()},h)})),Fe},[H,C,K,p,he,P,k,t,_,m,h]);f.useEffect(()=>()=>{oe.current&&clearTimeout(oe.current),ve.current&&clearTimeout(ve.current)},[]);const Ne=f.useCallback((Oe={},at=null)=>({...Oe,id:A,ref:Wn(at,Fe=>{$(!!Fe)})}),[A]),ge=f.useCallback((Oe={},at=null)=>({...Oe,id:U,ref:Wn(at,Fe=>{ee(!!Fe)})}),[U]);return{forceUpdate:ce,isOpen:C,onAnimationComplete:se.onComplete,onClose:_,getAnchorProps:xe,getArrowProps:W,getArrowInnerProps:be,getPopoverPositionerProps:de,getPopoverProps:ie,getTriggerProps:je,getHeaderProps:Ne,getBodyProps:ge}}function bg(e,t){return e===t||(e==null?void 0:e.contains(t))}function S2(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function n1(e){const t=Yr("Popover",e),{children:n,...r}=vr(e),o=rh(),s=kT({...r,direction:o.direction});return a.jsx(CT,{value:s,children:a.jsx(_T,{value:t,children:yv(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}n1.displayName="Popover";var xg=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function u5(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:i,shadowColor:u}=e,{getArrowProps:d,getArrowInnerProps:p}=Fu(),m=e1(),h=(t=n??r)!=null?t:o,v=s??i;return a.jsx(Ue.div,{...d(),className:"chakra-popover__arrow-positioner",children:a.jsx(Ue.div,{className:Ot("chakra-popover__arrow",e.className),...p(e),__css:{"--popper-arrow-shadow-color":xg("colors",u),"--popper-arrow-bg":xg("colors",h),"--popper-arrow-shadow":xg("shadows",v),...m.arrow}})})}u5.displayName="PopoverArrow";var d5=rt(function(t,n){const{getBodyProps:r}=Fu(),o=e1();return a.jsx(Ue.div,{...r(t,n),className:Ot("chakra-popover__body",t.className),__css:o.body})});d5.displayName="PopoverBody";function jT(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var PT={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]}}},IT=Ue(vo.section),f5=rt(function(t,n){const{variants:r=PT,...o}=t,{isOpen:s}=Fu();return a.jsx(IT,{ref:n,variants:jT(r),initial:!1,animate:s?"enter":"exit",...o})});f5.displayName="PopoverTransition";var r1=rt(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:i,getPopoverPositionerProps:u,onAnimationComplete:d}=Fu(),p=e1(),m={position:"relative",display:"flex",flexDirection:"column",...p.content};return a.jsx(Ue.div,{...u(r),__css:p.popper,className:"chakra-popover__popper",children:a.jsx(f5,{...o,...i(s,n),onAnimationComplete:th(d,s.onAnimationComplete),className:Ot("chakra-popover__content",t.className),__css:m})})});r1.displayName="PopoverContent";function ET(e,t,n){return(e-t)*100/(n-t)}ja({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});ja({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var OT=ja({"0%":{left:"-40%"},"100%":{left:"100%"}}),RT=ja({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function MT(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:i,role:u="progressbar"}=e,d=ET(t,n,r);return{bind:{"data-indeterminate":i?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":i?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,d):o})(),role:u},percent:d,value:t}}var[DT,TT]=ar({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),AT=rt((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:i,...u}=e,d=MT({value:o,min:n,max:r,isIndeterminate:s,role:i}),m={height:"100%",...TT().filledTrack};return a.jsx(Ue.div,{ref:t,style:{width:`${d.percent}%`,...u.style},...d.bind,...u,__css:m})}),p5=rt((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:i,isAnimated:u,children:d,borderRadius:p,isIndeterminate:m,"aria-label":h,"aria-labelledby":v,"aria-valuetext":b,title:w,role:S,...C}=vr(e),_=Yr("Progress",e),k=p??((n=_.track)==null?void 0:n.borderRadius),P={animation:`${RT} 1s linear infinite`},R={...!m&&i&&u&&P,...m&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${OT} 1s ease infinite normal none running`}},O={overflow:"hidden",position:"relative",..._.track};return a.jsx(Ue.div,{ref:t,borderRadius:k,__css:O,...C,children:a.jsxs(DT,{value:_,children:[a.jsx(AT,{"aria-label":h,"aria-labelledby":v,"aria-valuetext":b,min:o,max:s,value:r,isIndeterminate:m,css:R,borderRadius:k,title:w,role:S}),d]})})});p5.displayName="Progress";function NT(e){return e&&rx(e)&&rx(e.target)}function $T(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:i,isNative:u,...d}=e,[p,m]=f.useState(r||""),h=typeof n<"u",v=h?n:p,b=f.useRef(null),w=f.useCallback(()=>{const I=b.current;if(!I)return;let R="input:not(:disabled):checked";const O=I.querySelector(R);if(O){O.focus();return}R="input:not(:disabled)";const D=I.querySelector(R);D==null||D.focus()},[]),C=`radio-${f.useId()}`,_=o||C,k=f.useCallback(I=>{const R=NT(I)?I.target.value:I;h||m(R),t==null||t(String(R))},[t,h]),P=f.useCallback((I={},R=null)=>({...I,ref:Wn(R,b),role:"radiogroup"}),[]),E=f.useCallback((I={},R=null)=>({...I,ref:R,name:_,[u?"checked":"isChecked"]:v!=null?I.value===v:void 0,onChange(D){k(D)},"data-radiogroup":!0}),[u,_,k,v]);return{getRootProps:P,getRadioProps:E,name:_,ref:b,focus:w,setValue:m,value:v,onChange:k,isDisabled:s,isFocusable:i,htmlProps:d}}var[zT,h5]=ar({name:"RadioGroupContext",strict:!1}),o1=rt((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:i,isDisabled:u,isFocusable:d,...p}=e,{value:m,onChange:h,getRootProps:v,name:b,htmlProps:w}=$T(p),S=f.useMemo(()=>({name:b,size:r,onChange:h,colorScheme:n,value:m,variant:o,isDisabled:u,isFocusable:d}),[b,r,h,n,m,o,u,d]);return a.jsx(zT,{value:S,children:a.jsx(Ue.div,{...v(w,t),className:Ot("chakra-radio-group",i),children:s})})});o1.displayName="RadioGroup";var LT={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function FT(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:i,onChange:u,isInvalid:d,name:p,value:m,id:h,"data-radiogroup":v,"aria-describedby":b,...w}=e,S=`radio-${f.useId()}`,C=gv(),k=!!h5()||!!v;let E=!!C&&!k?C.id:S;E=h??E;const I=o??(C==null?void 0:C.isDisabled),R=s??(C==null?void 0:C.isReadOnly),O=i??(C==null?void 0:C.isRequired),D=d??(C==null?void 0:C.isInvalid),[T,$]=f.useState(!1),[B,ee]=f.useState(!1),[F,N]=f.useState(!1),[H,K]=f.useState(!1),[A,U]=f.useState(!!t),V=typeof n<"u",W=V?n:A;f.useEffect(()=>K3($),[]);const re=f.useCallback(he=>{if(R||I){he.preventDefault();return}V||U(he.target.checked),u==null||u(he)},[V,I,R,u]),be=f.useCallback(he=>{he.key===" "&&K(!0)},[K]),ce=f.useCallback(he=>{he.key===" "&&K(!1)},[K]),se=f.useCallback((he={},je=null)=>({...he,ref:je,"data-active":sn(H),"data-hover":sn(F),"data-disabled":sn(I),"data-invalid":sn(D),"data-checked":sn(W),"data-focus":sn(B),"data-focus-visible":sn(B&&T),"data-readonly":sn(R),"aria-hidden":!0,onMouseDown:xt(he.onMouseDown,()=>K(!0)),onMouseUp:xt(he.onMouseUp,()=>K(!1)),onMouseEnter:xt(he.onMouseEnter,()=>N(!0)),onMouseLeave:xt(he.onMouseLeave,()=>N(!1))}),[H,F,I,D,W,B,R,T]),{onFocus:X,onBlur:ie}=C??{},de=f.useCallback((he={},je=null)=>{const Ne=I&&!r;return{...he,id:E,ref:je,type:"radio",name:p,value:m,onChange:xt(he.onChange,re),onBlur:xt(ie,he.onBlur,()=>ee(!1)),onFocus:xt(X,he.onFocus,()=>ee(!0)),onKeyDown:xt(he.onKeyDown,be),onKeyUp:xt(he.onKeyUp,ce),checked:W,disabled:Ne,readOnly:R,required:O,"aria-invalid":Al(D),"aria-disabled":Al(Ne),"aria-required":Al(O),"data-readonly":sn(R),"aria-describedby":b,style:LT}},[I,r,E,p,m,re,ie,X,be,ce,W,R,O,D,b]);return{state:{isInvalid:D,isFocused:B,isChecked:W,isActive:H,isHovered:F,isDisabled:I,isReadOnly:R,isRequired:O},getCheckboxProps:se,getRadioProps:se,getInputProps:de,getLabelProps:(he={},je=null)=>({...he,ref:je,onMouseDown:xt(he.onMouseDown,BT),"data-disabled":sn(I),"data-checked":sn(W),"data-invalid":sn(D)}),getRootProps:(he,je=null)=>({...he,ref:je,"data-disabled":sn(I),"data-checked":sn(W),"data-invalid":sn(D)}),htmlProps:w}}function BT(e){e.preventDefault(),e.stopPropagation()}function HT(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var Ws=rt((e,t)=>{var n;const r=h5(),{onChange:o,value:s}=e,i=Yr("Radio",{...r,...e}),u=vr(e),{spacing:d="0.5rem",children:p,isDisabled:m=r==null?void 0:r.isDisabled,isFocusable:h=r==null?void 0:r.isFocusable,inputProps:v,...b}=u;let w=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(w=r.value===s);let S=o;r!=null&&r.onChange&&s!=null&&(S=th(r.onChange,o));const C=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:_,getCheckboxProps:k,getLabelProps:P,getRootProps:E,htmlProps:I}=FT({...b,isChecked:w,isFocusable:h,isDisabled:m,onChange:S,name:C}),[R,O]=HT(I,N4),D=k(O),T=_(v,t),$=P(),B=Object.assign({},R,E()),ee={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...i.container},F={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.control},N={userSelect:"none",marginStart:d,...i.label};return a.jsxs(Ue.label,{className:"chakra-radio",...B,__css:ee,children:[a.jsx("input",{className:"chakra-radio__input",...T}),a.jsx(Ue.span,{className:"chakra-radio__control",...D,__css:F}),p&&a.jsx(Ue.span,{className:"chakra-radio__label",...$,__css:N,children:p})]})});Ws.displayName="Radio";var m5=rt(function(t,n){const{children:r,placeholder:o,className:s,...i}=t;return a.jsxs(Ue.select,{...i,ref:n,className:Ot("chakra-select",s),children:[o&&a.jsx("option",{value:"",children:o}),r]})});m5.displayName="SelectField";function VT(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var g5=rt((e,t)=>{var n;const r=Yr("Select",e),{rootProps:o,placeholder:s,icon:i,color:u,height:d,h:p,minH:m,minHeight:h,iconColor:v,iconSize:b,...w}=vr(e),[S,C]=VT(w,N4),_=bv(C),k={width:"100%",height:"fit-content",position:"relative",color:u},P={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return a.jsxs(Ue.div,{className:"chakra-select__wrapper",__css:k,...S,...o,children:[a.jsx(m5,{ref:t,height:p??d,minH:m??h,placeholder:s,..._,__css:P,children:e.children}),a.jsx(v5,{"data-disabled":sn(_.disabled),...(v||u)&&{color:v||u},__css:r.icon,...b&&{fontSize:b},children:i})]})});g5.displayName="Select";var WT=e=>a.jsx("svg",{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),UT=Ue("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),v5=e=>{const{children:t=a.jsx(WT,{}),...n}=e,r=f.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return a.jsx(UT,{...n,className:"chakra-select__icon-wrapper",children:f.isValidElement(t)?r:null})};v5.displayName="SelectIcon";function GT(){const e=f.useRef(!0);return f.useEffect(()=>{e.current=!1},[]),e.current}function qT(e){const t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}var KT=Ue("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),C0=$4("skeleton-start-color"),_0=$4("skeleton-end-color"),YT=ja({from:{opacity:0},to:{opacity:1}}),QT=ja({from:{borderColor:C0.reference,background:C0.reference},to:{borderColor:_0.reference,background:_0.reference}}),y5=rt((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=cc("Skeleton",n),o=GT(),{startColor:s="",endColor:i="",isLoaded:u,fadeDuration:d,speed:p,className:m,fitContent:h,...v}=vr(n),[b,w]=uc("colors",[s,i]),S=qT(u),C=Ot("chakra-skeleton",m),_={...b&&{[C0.variable]:b},...w&&{[_0.variable]:w}};if(u){const k=o||S?"none":`${YT} ${d}s`;return a.jsx(Ue.div,{ref:t,className:C,__css:{animation:k},...v})}return a.jsx(KT,{ref:t,className:C,...v,__css:{width:h?"fit-content":void 0,...r,..._,_dark:{...r._dark,..._},animation:`${p}s linear infinite alternate ${QT}`}})});y5.displayName="Skeleton";function XT(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:i,direction:u="ltr",orientation:d="horizontal",id:p,isDisabled:m,isReadOnly:h,onChangeStart:v,onChangeEnd:b,step:w=1,getAriaValueText:S,"aria-valuetext":C,"aria-label":_,"aria-labelledby":k,name:P,focusThumbOnChange:E=!0,minStepsBetweenThumbs:I=0,...R}=e,O=Ja(v),D=Ja(b),T=Ja(S),$=UE({isReversed:i,direction:u,orientation:d}),[B,ee]=ku({value:o,defaultValue:s??[25,75],onChange:r});if(!Array.isArray(B))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof B}\``);const[F,N]=f.useState(!1),[H,K]=f.useState(!1),[A,U]=f.useState(-1),V=!(m||h),W=f.useRef(B),re=B.map(Re=>ox(Re,t,n)),be=I*w,ce=ZT(re,t,n,be),se=f.useRef({eventSource:null,value:[],valueBounds:[]});se.current.value=re,se.current.valueBounds=ce;const X=re.map(Re=>n-Re+t),de=($?X:re).map(Re=>sx(Re,t,n)),xe=d==="vertical",oe=f.useRef(null),ve=f.useRef(null),he=LE({getNodes(){const Re=ve.current,Je=Re==null?void 0:Re.querySelectorAll("[role=slider]");return Je?Array.from(Je):[]}}),je=f.useId(),ge=GE(p??je),Oe=f.useCallback(Re=>{var Je,it;if(!oe.current)return;se.current.eventSource="pointer";const dt=oe.current.getBoundingClientRect(),{clientX:$t,clientY:hr}=(it=(Je=Re.touches)==null?void 0:Je[0])!=null?it:Re,un=xe?dt.bottom-hr:$t-dt.left,xn=xe?dt.height:dt.width;let xr=un/xn;return $&&(xr=1-xr),FE(xr,t,n)},[xe,$,n,t]),at=(n-t)/10,Fe=w||(n-t)/100,qe=f.useMemo(()=>({setValueAtIndex(Re,Je){if(!V)return;const it=se.current.valueBounds[Re];Je=parseFloat(BE(Je,it.min,Fe)),Je=ox(Je,it.min,it.max);const dt=[...se.current.value];dt[Re]=Je,ee(dt)},setActiveIndex:U,stepUp(Re,Je=Fe){const it=se.current.value[Re],dt=$?it-Je:it+Je;qe.setValueAtIndex(Re,dt)},stepDown(Re,Je=Fe){const it=se.current.value[Re],dt=$?it+Je:it-Je;qe.setValueAtIndex(Re,dt)},reset(){ee(W.current)}}),[Fe,$,ee,V]),Pt=f.useCallback(Re=>{const Je=Re.key,dt={ArrowRight:()=>qe.stepUp(A),ArrowUp:()=>qe.stepUp(A),ArrowLeft:()=>qe.stepDown(A),ArrowDown:()=>qe.stepDown(A),PageUp:()=>qe.stepUp(A,at),PageDown:()=>qe.stepDown(A,at),Home:()=>{const{min:$t}=ce[A];qe.setValueAtIndex(A,$t)},End:()=>{const{max:$t}=ce[A];qe.setValueAtIndex(A,$t)}}[Je];dt&&(Re.preventDefault(),Re.stopPropagation(),dt(Re),se.current.eventSource="keyboard")},[qe,A,at,ce]),{getThumbStyle:St,rootStyle:zn,trackStyle:Y,innerTrackStyle:Ce}=f.useMemo(()=>HE({isReversed:$,orientation:d,thumbRects:he,thumbPercents:de}),[$,d,de,he]),te=f.useCallback(Re=>{var Je;const it=Re??A;if(it!==-1&&E){const dt=ge.getThumb(it),$t=(Je=ve.current)==null?void 0:Je.ownerDocument.getElementById(dt);$t&&setTimeout(()=>$t.focus())}},[E,A,ge]);Xi(()=>{se.current.eventSource==="keyboard"&&(D==null||D(se.current.value))},[re,D]);const fe=Re=>{const Je=Oe(Re)||0,it=se.current.value.map(xn=>Math.abs(xn-Je)),dt=Math.min(...it);let $t=it.indexOf(dt);const hr=it.filter(xn=>xn===dt);hr.length>1&&Je>se.current.value[$t]&&($t=$t+hr.length-1),U($t),qe.setValueAtIndex($t,Je),te($t)},Te=Re=>{if(A==-1)return;const Je=Oe(Re)||0;U(A),qe.setValueAtIndex(A,Je),te(A)};VE(ve,{onPanSessionStart(Re){V&&(N(!0),fe(Re),O==null||O(se.current.value))},onPanSessionEnd(){V&&(N(!1),D==null||D(se.current.value))},onPan(Re){V&&Te(Re)}});const Ke=f.useCallback((Re={},Je=null)=>({...Re,...R,id:ge.root,ref:Wn(Je,ve),tabIndex:-1,"aria-disabled":ng(m),"data-focused":ml(H),style:{...Re.style,...zn}}),[R,m,H,zn,ge]),bt=f.useCallback((Re={},Je=null)=>({...Re,ref:Wn(Je,oe),id:ge.track,"data-disabled":ml(m),style:{...Re.style,...Y}}),[m,Y,ge]),Xt=f.useCallback((Re={},Je=null)=>({...Re,ref:Je,id:ge.innerTrack,style:{...Re.style,...Ce}}),[Ce,ge]),ln=f.useCallback((Re,Je=null)=>{var it;const{index:dt,...$t}=Re,hr=re[dt];if(hr==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${dt}\`. The \`value\` or \`defaultValue\` length is : ${re.length}`);const un=ce[dt];return{...$t,ref:Je,role:"slider",tabIndex:V?0:void 0,id:ge.getThumb(dt),"data-active":ml(F&&A===dt),"aria-valuetext":(it=T==null?void 0:T(hr))!=null?it:C==null?void 0:C[dt],"aria-valuemin":un.min,"aria-valuemax":un.max,"aria-valuenow":hr,"aria-orientation":d,"aria-disabled":ng(m),"aria-readonly":ng(h),"aria-label":_==null?void 0:_[dt],"aria-labelledby":_!=null&&_[dt]||k==null?void 0:k[dt],style:{...Re.style,...St(dt)},onKeyDown:rg(Re.onKeyDown,Pt),onFocus:rg(Re.onFocus,()=>{K(!0),U(dt)}),onBlur:rg(Re.onBlur,()=>{K(!1),U(-1)})}},[ge,re,ce,V,F,A,T,C,d,m,h,_,k,St,Pt,K]),_n=f.useCallback((Re={},Je=null)=>({...Re,ref:Je,id:ge.output,htmlFor:re.map((it,dt)=>ge.getThumb(dt)).join(" "),"aria-live":"off"}),[ge,re]),pr=f.useCallback((Re,Je=null)=>{const{value:it,...dt}=Re,$t=!(it<t||it>n),hr=it>=re[0]&&it<=re[re.length-1];let un=sx(it,t,n);un=$?100-un:un;const xn={position:"absolute",pointerEvents:"none",...WE({orientation:d,vertical:{bottom:`${un}%`},horizontal:{left:`${un}%`}})};return{...dt,ref:Je,id:ge.getMarker(Re.value),role:"presentation","aria-hidden":!0,"data-disabled":ml(m),"data-invalid":ml(!$t),"data-highlighted":ml(hr),style:{...Re.style,...xn}}},[m,$,n,t,d,re,ge]),cn=f.useCallback((Re,Je=null)=>{const{index:it,...dt}=Re;return{...dt,ref:Je,id:ge.getInput(it),type:"hidden",value:re[it],name:Array.isArray(P)?P[it]:`${P}-${it}`}},[P,re,ge]);return{state:{value:re,isFocused:H,isDragging:F,getThumbPercent:Re=>de[Re],getThumbMinValue:Re=>ce[Re].min,getThumbMaxValue:Re=>ce[Re].max},actions:qe,getRootProps:Ke,getTrackProps:bt,getInnerTrackProps:Xt,getThumbProps:ln,getMarkerProps:pr,getInputProps:cn,getOutputProps:_n}}function ZT(e,t,n,r){return e.map((o,s)=>{const i=s===0?t:e[s-1]+r,u=s===e.length-1?n:e[s+1]-r;return{min:i,max:u}})}var[JT,gh]=ar({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[eA,vh]=ar({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),b5=rt(function(t,n){const r={orientation:"horizontal",...t},o=Yr("Slider",r),s=vr(r),{direction:i}=rh();s.direction=i;const{getRootProps:u,...d}=XT(s),p=f.useMemo(()=>({...d,name:r.name}),[d,r.name]);return a.jsx(JT,{value:p,children:a.jsx(eA,{value:o,children:a.jsx(Ue.div,{...u({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});b5.displayName="RangeSlider";var k0=rt(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=gh(),i=vh(),u=r(t,n);return a.jsxs(Ue.div,{...u,className:xv("chakra-slider__thumb",t.className),__css:i.thumb,children:[u.children,s&&a.jsx("input",{...o({index:t.index})})]})});k0.displayName="RangeSliderThumb";var x5=rt(function(t,n){const{getTrackProps:r}=gh(),o=vh(),s=r(t,n);return a.jsx(Ue.div,{...s,className:xv("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});x5.displayName="RangeSliderTrack";var S5=rt(function(t,n){const{getInnerTrackProps:r}=gh(),o=vh(),s=r(t,n);return a.jsx(Ue.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});S5.displayName="RangeSliderFilledTrack";var kf=rt(function(t,n){const{getMarkerProps:r}=gh(),o=vh(),s=r(t,n);return a.jsx(Ue.div,{...s,className:xv("chakra-slider__marker",t.className),__css:o.mark})});kf.displayName="RangeSliderMark";var s1=rt(function(t,n){const r=Yr("Switch",t),{spacing:o="0.5rem",children:s,...i}=vr(t),{state:u,getInputProps:d,getCheckboxProps:p,getRootProps:m,getLabelProps:h}=Y3(i),v=f.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),b=f.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),w=f.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return a.jsxs(Ue.label,{...m(),className:Ot("chakra-switch",t.className),__css:v,children:[a.jsx("input",{className:"chakra-switch__input",...d({},n)}),a.jsx(Ue.span,{...p(),className:"chakra-switch__track",__css:b,children:a.jsx(Ue.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":sn(u.isChecked),"data-hover":sn(u.isHovered)})}),s&&a.jsx(Ue.span,{className:"chakra-switch__label",...h(),__css:w,children:s})]})});s1.displayName="Switch";var[tA,nA,rA,oA]=Av();function sA(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:i,lazyBehavior:u="unmount",orientation:d="horizontal",direction:p="ltr",...m}=e,[h,v]=f.useState(n??0),[b,w]=ku({defaultValue:n??0,value:o,onChange:r});f.useEffect(()=>{o!=null&&v(o)},[o]);const S=rA(),C=f.useId();return{id:`tabs-${(t=e.id)!=null?t:C}`,selectedIndex:b,focusedIndex:h,setSelectedIndex:w,setFocusedIndex:v,isManual:s,isLazy:i,lazyBehavior:u,orientation:d,descendants:S,direction:p,htmlProps:m}}var[aA,yh]=ar({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function iA(e){const{focusedIndex:t,orientation:n,direction:r}=yh(),o=nA(),s=f.useCallback(i=>{const u=()=>{var k;const P=o.nextEnabled(t);P&&((k=P.node)==null||k.focus())},d=()=>{var k;const P=o.prevEnabled(t);P&&((k=P.node)==null||k.focus())},p=()=>{var k;const P=o.firstEnabled();P&&((k=P.node)==null||k.focus())},m=()=>{var k;const P=o.lastEnabled();P&&((k=P.node)==null||k.focus())},h=n==="horizontal",v=n==="vertical",b=i.key,w=r==="ltr"?"ArrowLeft":"ArrowRight",S=r==="ltr"?"ArrowRight":"ArrowLeft",_={[w]:()=>h&&d(),[S]:()=>h&&u(),ArrowDown:()=>v&&u(),ArrowUp:()=>v&&d(),Home:p,End:m}[b];_&&(i.preventDefault(),_(i))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:xt(e.onKeyDown,s)}}function lA(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:o,isManual:s,id:i,setFocusedIndex:u,selectedIndex:d}=yh(),{index:p,register:m}=oA({disabled:t&&!n}),h=p===d,v=()=>{o(p)},b=()=>{u(p),!s&&!(t&&n)&&o(p)},w=G6({...r,ref:Wn(m,e.ref),isDisabled:t,isFocusable:n,onClick:xt(e.onClick,v)}),S="button";return{...w,id:w5(i,p),role:"tab",tabIndex:h?0:-1,type:S,"aria-selected":h,"aria-controls":C5(i,p),onFocus:t?void 0:xt(e.onFocus,b)}}var[cA,uA]=ar({});function dA(e){const t=yh(),{id:n,selectedIndex:r}=t,s=nh(e.children).map((i,u)=>f.createElement(cA,{key:u,value:{isSelected:u===r,id:C5(n,u),tabId:w5(n,u),selectedIndex:r}},i));return{...e,children:s}}function fA(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=yh(),{isSelected:s,id:i,tabId:u}=uA(),d=f.useRef(!1);s&&(d.current=!0);const p=Qv({wasSelected:d.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:p?t:null,role:"tabpanel","aria-labelledby":u,hidden:!s,id:i}}function w5(e,t){return`${e}--tab-${t}`}function C5(e,t){return`${e}--tabpanel-${t}`}var[pA,bh]=ar({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),xh=rt(function(t,n){const r=Yr("Tabs",t),{children:o,className:s,...i}=vr(t),{htmlProps:u,descendants:d,...p}=sA(i),m=f.useMemo(()=>p,[p]),{isFitted:h,...v}=u;return a.jsx(tA,{value:d,children:a.jsx(aA,{value:m,children:a.jsx(pA,{value:r,children:a.jsx(Ue.div,{className:Ot("chakra-tabs",s),ref:n,...v,__css:r.root,children:o})})})})});xh.displayName="Tabs";var Sh=rt(function(t,n){const r=iA({...t,ref:n}),s={display:"flex",...bh().tablist};return a.jsx(Ue.div,{...r,className:Ot("chakra-tabs__tablist",t.className),__css:s})});Sh.displayName="TabList";var wh=rt(function(t,n){const r=fA({...t,ref:n}),o=bh();return a.jsx(Ue.div,{outline:"0",...r,className:Ot("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});wh.displayName="TabPanel";var Ch=rt(function(t,n){const r=dA(t),o=bh();return a.jsx(Ue.div,{...r,width:"100%",ref:n,className:Ot("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});Ch.displayName="TabPanels";var _h=rt(function(t,n){const r=bh(),o=lA({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return a.jsx(Ue.button,{...o,className:Ot("chakra-tabs__tab",t.className),__css:s})});_h.displayName="Tab";function hA(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var mA=["h","minH","height","minHeight"],_5=rt((e,t)=>{const n=cc("Textarea",e),{className:r,rows:o,...s}=vr(e),i=bv(s),u=o?hA(n,mA):n;return a.jsx(Ue.textarea,{ref:t,rows:o,...i,className:Ot("chakra-textarea",r),__css:u})});_5.displayName="Textarea";const k5=({id:e,x:t,y:n,width:r,height:o,style:s,color:i,strokeColor:u,strokeWidth:d,className:p,borderRadius:m,shapeRendering:h,onClick:v})=>{const{background:b,backgroundColor:w}=s||{},S=i||b||w;return a.jsx("rect",{className:oh(["react-flow__minimap-node",p]),x:t,y:n,rx:m,ry:m,width:r,height:o,fill:S,stroke:u,strokeWidth:d,shapeRendering:h,onClick:v?C=>v(C,e):void 0})};k5.displayName="MiniMapNode";var gA=f.memo(k5);const vA=e=>e.nodeOrigin,yA=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),Sg=e=>e instanceof Function?e:()=>e;function bA({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=gA,onClick:i}){const u=Of(yA,Sv),d=Of(vA),p=Sg(t),m=Sg(e),h=Sg(n),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:u.map(b=>{const{x:w,y:S}=qE(b,d).positionAbsolute;return a.jsx(s,{x:w,y:S,width:b.width,height:b.height,style:b.style,className:h(b),color:p(b),borderRadius:r,strokeColor:m(b),strokeWidth:o,shapeRendering:v,onClick:i,id:b.id},b.id)})})}var xA=f.memo(bA);const SA=200,wA=150,CA=e=>{const t=e.getNodes(),n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:t.length>0?XE(ZE(t,e.nodeOrigin),n):n,rfId:e.rfId}},_A="react-flow__minimap-desc";function j5({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:i=2,nodeComponent:u,maskColor:d="rgb(240, 240, 240, 0.6)",maskStrokeColor:p="none",maskStrokeWidth:m=1,position:h="bottom-right",onClick:v,onNodeClick:b,pannable:w=!1,zoomable:S=!1,ariaLabel:C="React Flow mini map",inversePan:_=!1,zoomStep:k=10}){const P=z4(),E=f.useRef(null),{boundingRect:I,viewBB:R,rfId:O}=Of(CA,Sv),D=(e==null?void 0:e.width)??SA,T=(e==null?void 0:e.height)??wA,$=I.width/D,B=I.height/T,ee=Math.max($,B),F=ee*D,N=ee*T,H=5*ee,K=I.x-(F-I.width)/2-H,A=I.y-(N-I.height)/2-H,U=F+H*2,V=N+H*2,W=`${_A}-${O}`,re=f.useRef(0);re.current=ee,f.useEffect(()=>{if(E.current){const se=L4(E.current),X=xe=>{const{transform:oe,d3Selection:ve,d3Zoom:he}=P.getState();if(xe.sourceEvent.type!=="wheel"||!ve||!he)return;const je=-xe.sourceEvent.deltaY*(xe.sourceEvent.deltaMode===1?.05:xe.sourceEvent.deltaMode?1:.002)*k,Ne=oe[2]*Math.pow(2,je);he.scaleTo(ve,Ne)},ie=xe=>{const{transform:oe,d3Selection:ve,d3Zoom:he,translateExtent:je,width:Ne,height:ge}=P.getState();if(xe.sourceEvent.type!=="mousemove"||!ve||!he)return;const Oe=re.current*Math.max(1,oe[2])*(_?-1:1),at={x:oe[0]-xe.sourceEvent.movementX*Oe,y:oe[1]-xe.sourceEvent.movementY*Oe},Fe=[[0,0],[Ne,ge]],qe=YE.translate(at.x,at.y).scale(oe[2]),Pt=he.constrain()(qe,Fe,je);he.transform(ve,Pt)},de=KE().on("zoom",w?ie:null).on("zoom.wheel",S?X:null);return se.call(de),()=>{se.on("zoom",null)}}},[w,S,_,k]);const be=v?se=>{const X=QE(se);v(se,{x:X[0],y:X[1]})}:void 0,ce=b?(se,X)=>{const ie=P.getState().nodeInternals.get(X);b(se,ie)}:void 0;return a.jsx(Pu,{position:h,style:e,className:oh(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:D,height:T,viewBox:`${K} ${A} ${U} ${V}`,role:"img","aria-labelledby":W,ref:E,onClick:be,children:[C&&a.jsx("title",{id:W,children:C}),a.jsx(xA,{onClick:ce,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:u}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${K-H},${A-H}h${U+H*2}v${V+H*2}h${-U-H*2}z
|
||
M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fill:d,fillRule:"evenodd",stroke:p,strokeWidth:m,pointerEvents:"none"})]})})}j5.displayName="MiniMap";var kA=f.memo(j5),vs;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(vs||(vs={}));function jA({color:e,dimensions:t,lineWidth:n}){return a.jsx("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function PA({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const IA={[vs.Dots]:"#91919a",[vs.Lines]:"#eee",[vs.Cross]:"#e2e2e2"},EA={[vs.Dots]:1,[vs.Lines]:1,[vs.Cross]:6},OA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function P5({id:e,variant:t=vs.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:u,className:d}){const p=f.useRef(null),{transform:m,patternId:h}=Of(OA,Sv),v=i||IA[t],b=r||EA[t],w=t===vs.Dots,S=t===vs.Cross,C=Array.isArray(n)?n:[n,n],_=[C[0]*m[2]||1,C[1]*m[2]||1],k=b*m[2],P=S?[k,k]:_,E=w?[k/s,k/s]:[P[0]/s,P[1]/s];return a.jsxs("svg",{className:oh(["react-flow__background",d]),style:{...u,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background",children:[a.jsx("pattern",{id:h+e,x:m[0]%_[0],y:m[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:w?a.jsx(PA,{color:v,radius:k/s}):a.jsx(jA,{dimensions:P,color:v,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${h+e})`})]})}P5.displayName="Background";var RA=f.memo(P5),ou;(function(e){e.Line="line",e.Handle="handle"})(ou||(ou={}));function MA({width:e,prevWidth:t,height:n,prevHeight:r,invertX:o,invertY:s}){const i=e-t,u=n-r,d=[i>0?1:i<0?-1:0,u>0?1:u<0?-1:0];return i&&o&&(d[0]=d[0]*-1),u&&s&&(d[1]=d[1]*-1),d}const I5={width:0,height:0,x:0,y:0},DA={...I5,pointerX:0,pointerY:0,aspectRatio:1};function TA({nodeId:e,position:t,variant:n=ou.Handle,className:r,style:o={},children:s,color:i,minWidth:u=10,minHeight:d=10,maxWidth:p=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:h=!1,shouldResize:v,onResizeStart:b,onResize:w,onResizeEnd:S}){const C=JE(),_=typeof e=="string"?e:C,k=z4(),P=f.useRef(null),E=f.useRef(DA),I=f.useRef(I5),R=e8(),O=n===ou.Line?"right":"bottom-right",D=t??O;f.useEffect(()=>{if(!P.current||!_)return;const ee=L4(P.current),F=D.includes("right")||D.includes("left"),N=D.includes("bottom")||D.includes("top"),H=D.includes("left"),K=D.includes("top"),A=t8().on("start",U=>{const V=k.getState().nodeInternals.get(_),{xSnapped:W,ySnapped:re}=R(U);I.current={width:(V==null?void 0:V.width)??0,height:(V==null?void 0:V.height)??0,x:(V==null?void 0:V.position.x)??0,y:(V==null?void 0:V.position.y)??0},E.current={...I.current,pointerX:W,pointerY:re,aspectRatio:I.current.width/I.current.height},b==null||b(U,{...I.current})}).on("drag",U=>{const{nodeInternals:V,triggerNodeChanges:W}=k.getState(),{xSnapped:re,ySnapped:be}=R(U),ce=V.get(_);if(ce){const se=[],{pointerX:X,pointerY:ie,width:de,height:xe,x:oe,y:ve,aspectRatio:he}=E.current,{x:je,y:Ne,width:ge,height:Oe}=I.current,at=Math.floor(F?re-X:0),Fe=Math.floor(N?be-ie:0);let qe=ax(de+(H?-at:at),u,p),Pt=ax(xe+(K?-Fe:Fe),d,m);if(h){const fe=qe/Pt,Te=F&&N,Ke=F&&!N,bt=N&&!F;qe=fe<=he&&Te||bt?Pt*he:qe,Pt=fe>he&&Te||Ke?qe/he:Pt,qe>=p?(qe=p,Pt=p/he):qe<=u&&(qe=u,Pt=u/he),Pt>=m?(Pt=m,qe=m*he):Pt<=d&&(Pt=d,qe=d*he)}const St=qe!==ge,zn=Pt!==Oe;if(H||K){const fe=H?oe-(qe-de):oe,Te=K?ve-(Pt-xe):ve,Ke=fe!==je&&St,bt=Te!==Ne&&zn;if(Ke||bt){const Xt={id:ce.id,type:"position",position:{x:Ke?fe:je,y:bt?Te:Ne}};se.push(Xt),I.current.x=Xt.position.x,I.current.y=Xt.position.y}}if(St||zn){const fe={id:_,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:qe,height:Pt}};se.push(fe),I.current.width=qe,I.current.height=Pt}if(se.length===0)return;const Y=MA({width:I.current.width,prevWidth:ge,height:I.current.height,prevHeight:Oe,invertX:H,invertY:K}),Ce={...I.current,direction:Y};if((v==null?void 0:v(U,Ce))===!1)return;w==null||w(U,Ce),W(se)}}).on("end",U=>{const V={id:_,type:"dimensions",resizing:!1};S==null||S(U,{...I.current}),k.getState().triggerNodeChanges([V])});return ee.call(A),()=>{ee.on(".drag",null)}},[_,D,u,d,p,m,h,R,b,w,S]);const T=D.split("-"),$=n===ou.Line?"borderColor":"backgroundColor",B=i?{...o,[$]:i}:o;return a.jsx("div",{className:oh(["react-flow__resize-control","nodrag",...T,n,r]),ref:P,style:B,children:s})}var AA=f.memo(TA);let w2=()=>{};const kh=()=>({setOpenUploaderFunction:f.useCallback(t=>{t&&(w2=t)},[]),openUploader:w2});var NA=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 Bu(e,t){var n=$A(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 $A(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=NA.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var zA=[".DS_Store","Thumbs.db"];function LA(e){return pc(this,void 0,void 0,function(){return hc(this,function(t){return Yf(e)&&FA(e.dataTransfer)?[2,WA(e.dataTransfer,e.type)]:BA(e)?[2,HA(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,VA(e)]:[2,[]]})})}function FA(e){return Yf(e)}function BA(e){return Yf(e)&&Yf(e.target)}function Yf(e){return typeof e=="object"&&e!==null}function HA(e){return j0(e.target.files).map(function(t){return Bu(t)})}function VA(e){return pc(this,void 0,void 0,function(){var t;return hc(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 Bu(r)})]}})})}function WA(e,t){return pc(this,void 0,void 0,function(){var n,r;return hc(this,function(o){switch(o.label){case 0:return e.items?(n=j0(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(UA))]):[3,2];case 1:return r=o.sent(),[2,C2(E5(r))];case 2:return[2,C2(j0(e.files).map(function(s){return Bu(s)}))]}})})}function C2(e){return e.filter(function(t){return zA.indexOf(t.name)===-1})}function j0(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function UA(e){if(typeof e.webkitGetAsEntry!="function")return _2(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?O5(t):_2(e)}function E5(e){return e.reduce(function(t,n){return g0(g0([],i2(t),!1),i2(Array.isArray(n)?E5(n):[n]),!1)},[])}function _2(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=Bu(t);return Promise.resolve(n)}function GA(e){return pc(this,void 0,void 0,function(){return hc(this,function(t){return[2,e.isDirectory?O5(e):qA(e)]})})}function O5(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var i=this;t.readEntries(function(u){return pc(i,void 0,void 0,function(){var d,p,m;return hc(this,function(h){switch(h.label){case 0:if(u.length)return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return d=h.sent(),n(d),[3,4];case 3:return p=h.sent(),r(p),[3,4];case 4:return[3,6];case 5:m=Promise.all(u.map(GA)),o.push(m),s(),h.label=6;case 6:return[2]}})})},function(u){r(u)})}s()})}function qA(e){return pc(this,void 0,void 0,function(){return hc(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=Bu(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var KA=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(i){var u=i.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):o===u})}return!0};function k2(e){return XA(e)||QA(e)||M5(e)||YA()}function YA(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QA(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function XA(e){if(Array.isArray(e))return P0(e)}function j2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function P2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j2(Object(n),!0).forEach(function(r){R5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function R5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vu(e,t){return eN(e)||JA(e,t)||M5(e,t)||ZA()}function ZA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M5(e,t){if(e){if(typeof e=="string")return P0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P0(e,t)}}function P0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function JA(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,u;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(d){s=!0,u=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function eN(e){if(Array.isArray(e))return e}var tN="file-invalid-type",nN="file-too-large",rN="file-too-small",oN="too-many-files",sN=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:tN,message:"File type must be ".concat(n)}},I2=function(t){return{code:nN,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},E2=function(t){return{code:rN,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},aN={code:oN,message:"Too many files"};function D5(e,t){var n=e.type==="application/x-moz-file"||KA(e,t);return[n,n?null:sN(t)]}function T5(e,t,n){if(ji(e.size))if(ji(t)&&ji(n)){if(e.size>n)return[!1,I2(n)];if(e.size<t)return[!1,E2(t)]}else{if(ji(t)&&e.size<t)return[!1,E2(t)];if(ji(n)&&e.size>n)return[!1,I2(n)]}return[!0,null]}function ji(e){return e!=null}function iN(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(d){var p=D5(d,n),m=vu(p,1),h=m[0],v=T5(d,r,o),b=vu(v,1),w=b[0],S=u?u(d):null;return h&&w&&!S})}function Qf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ld(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 O2(e){e.preventDefault()}function lN(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function cN(e){return e.indexOf("Edge/")!==-1}function uN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return lN(e)||cN(e)}function Fs(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),i=1;i<o;i++)s[i-1]=arguments[i];return t.some(function(u){return!Qf(r)&&u&&u.apply(void 0,[r].concat(s)),Qf(r)})}}function dN(){return"showOpenFilePicker"in window}function fN(e){if(ji(e)){var t=Object.entries(e).filter(function(n){var r=vu(n,2),o=r[0],s=r[1],i=!0;return A5(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),i=!1),(!Array.isArray(s)||!s.every(N5))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=vu(r,2),s=o[0],i=o[1];return P2(P2({},n),{},R5({},s,i))},{});return[{description:"Files",accept:t}]}return e}function pN(e){if(ji(e))return Object.entries(e).reduce(function(t,n){var r=vu(n,2),o=r[0],s=r[1];return[].concat(k2(t),[o],k2(s))},[]).filter(function(t){return A5(t)||N5(t)}).join(",")}function hN(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function mN(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function A5(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function N5(e){return/^.*\.[\w]+$/.test(e)}var gN=["children"],vN=["open"],yN=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],bN=["refKey","onChange","onClick"];function xN(e){return CN(e)||wN(e)||$5(e)||SN()}function SN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CN(e){if(Array.isArray(e))return I0(e)}function wg(e,t){return jN(e)||kN(e,t)||$5(e,t)||_N()}function _N(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $5(e,t){if(e){if(typeof e=="string")return I0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I0(e,t)}}function I0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kN(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,u;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(d){s=!0,u=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function jN(e){if(Array.isArray(e))return e}function R2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R2(Object(n),!0).forEach(function(r){E0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function E0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xf(e,t){if(e==null)return{};var n=PN(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function PN(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var a1=f.forwardRef(function(e,t){var n=e.children,r=Xf(e,gN),o=i1(r),s=o.open,i=Xf(o,vN);return f.useImperativeHandle(t,function(){return{open:s}},[s]),z.createElement(f.Fragment,null,n(rr(rr({},i),{},{open:s})))});a1.displayName="Dropzone";var z5={disabled:!1,getFilesFromEvent:LA,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};a1.defaultProps=z5;a1.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 O0={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function i1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=rr(rr({},z5),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,u=t.multiple,d=t.maxFiles,p=t.onDragEnter,m=t.onDragLeave,h=t.onDragOver,v=t.onDrop,b=t.onDropAccepted,w=t.onDropRejected,S=t.onFileDialogCancel,C=t.onFileDialogOpen,_=t.useFsAccessApi,k=t.autoFocus,P=t.preventDropOnDocument,E=t.noClick,I=t.noKeyboard,R=t.noDrag,O=t.noDragEventsBubbling,D=t.onError,T=t.validator,$=f.useMemo(function(){return pN(n)},[n]),B=f.useMemo(function(){return fN(n)},[n]),ee=f.useMemo(function(){return typeof C=="function"?C:M2},[C]),F=f.useMemo(function(){return typeof S=="function"?S:M2},[S]),N=f.useRef(null),H=f.useRef(null),K=f.useReducer(IN,O0),A=wg(K,2),U=A[0],V=A[1],W=U.isFocused,re=U.isFileDialogActive,be=f.useRef(typeof window<"u"&&window.isSecureContext&&_&&dN()),ce=function(){!be.current&&re&&setTimeout(function(){if(H.current){var fe=H.current.files;fe.length||(V({type:"closeDialog"}),F())}},300)};f.useEffect(function(){return window.addEventListener("focus",ce,!1),function(){window.removeEventListener("focus",ce,!1)}},[H,re,F,be]);var se=f.useRef([]),X=function(fe){N.current&&N.current.contains(fe.target)||(fe.preventDefault(),se.current=[])};f.useEffect(function(){return P&&(document.addEventListener("dragover",O2,!1),document.addEventListener("drop",X,!1)),function(){P&&(document.removeEventListener("dragover",O2),document.removeEventListener("drop",X))}},[N,P]),f.useEffect(function(){return!r&&k&&N.current&&N.current.focus(),function(){}},[N,k,r]);var ie=f.useCallback(function(te){D?D(te):console.error(te)},[D]),de=f.useCallback(function(te){te.preventDefault(),te.persist(),St(te),se.current=[].concat(xN(se.current),[te.target]),Ld(te)&&Promise.resolve(o(te)).then(function(fe){if(!(Qf(te)&&!O)){var Te=fe.length,Ke=Te>0&&iN({files:fe,accept:$,minSize:i,maxSize:s,multiple:u,maxFiles:d,validator:T}),bt=Te>0&&!Ke;V({isDragAccept:Ke,isDragReject:bt,isDragActive:!0,type:"setDraggedFiles"}),p&&p(te)}}).catch(function(fe){return ie(fe)})},[o,p,ie,O,$,i,s,u,d,T]),xe=f.useCallback(function(te){te.preventDefault(),te.persist(),St(te);var fe=Ld(te);if(fe&&te.dataTransfer)try{te.dataTransfer.dropEffect="copy"}catch{}return fe&&h&&h(te),!1},[h,O]),oe=f.useCallback(function(te){te.preventDefault(),te.persist(),St(te);var fe=se.current.filter(function(Ke){return N.current&&N.current.contains(Ke)}),Te=fe.indexOf(te.target);Te!==-1&&fe.splice(Te,1),se.current=fe,!(fe.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ld(te)&&m&&m(te))},[N,m,O]),ve=f.useCallback(function(te,fe){var Te=[],Ke=[];te.forEach(function(bt){var Xt=D5(bt,$),ln=wg(Xt,2),_n=ln[0],pr=ln[1],cn=T5(bt,i,s),Un=wg(cn,2),Re=Un[0],Je=Un[1],it=T?T(bt):null;if(_n&&Re&&!it)Te.push(bt);else{var dt=[pr,Je];it&&(dt=dt.concat(it)),Ke.push({file:bt,errors:dt.filter(function($t){return $t})})}}),(!u&&Te.length>1||u&&d>=1&&Te.length>d)&&(Te.forEach(function(bt){Ke.push({file:bt,errors:[aN]})}),Te.splice(0)),V({acceptedFiles:Te,fileRejections:Ke,type:"setFiles"}),v&&v(Te,Ke,fe),Ke.length>0&&w&&w(Ke,fe),Te.length>0&&b&&b(Te,fe)},[V,u,$,i,s,d,v,b,w,T]),he=f.useCallback(function(te){te.preventDefault(),te.persist(),St(te),se.current=[],Ld(te)&&Promise.resolve(o(te)).then(function(fe){Qf(te)&&!O||ve(fe,te)}).catch(function(fe){return ie(fe)}),V({type:"reset"})},[o,ve,ie,O]),je=f.useCallback(function(){if(be.current){V({type:"openDialog"}),ee();var te={multiple:u,types:B};window.showOpenFilePicker(te).then(function(fe){return o(fe)}).then(function(fe){ve(fe,null),V({type:"closeDialog"})}).catch(function(fe){hN(fe)?(F(fe),V({type:"closeDialog"})):mN(fe)?(be.current=!1,H.current?(H.current.value=null,H.current.click()):ie(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 <input> was provided."))):ie(fe)});return}H.current&&(V({type:"openDialog"}),ee(),H.current.value=null,H.current.click())},[V,ee,F,_,ve,ie,B,u]),Ne=f.useCallback(function(te){!N.current||!N.current.isEqualNode(te.target)||(te.key===" "||te.key==="Enter"||te.keyCode===32||te.keyCode===13)&&(te.preventDefault(),je())},[N,je]),ge=f.useCallback(function(){V({type:"focus"})},[]),Oe=f.useCallback(function(){V({type:"blur"})},[]),at=f.useCallback(function(){E||(uN()?setTimeout(je,0):je())},[E,je]),Fe=function(fe){return r?null:fe},qe=function(fe){return I?null:Fe(fe)},Pt=function(fe){return R?null:Fe(fe)},St=function(fe){O&&fe.stopPropagation()},zn=f.useMemo(function(){return function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fe=te.refKey,Te=fe===void 0?"ref":fe,Ke=te.role,bt=te.onKeyDown,Xt=te.onFocus,ln=te.onBlur,_n=te.onClick,pr=te.onDragEnter,cn=te.onDragOver,Un=te.onDragLeave,Re=te.onDrop,Je=Xf(te,yN);return rr(rr(E0({onKeyDown:qe(Fs(bt,Ne)),onFocus:qe(Fs(Xt,ge)),onBlur:qe(Fs(ln,Oe)),onClick:Fe(Fs(_n,at)),onDragEnter:Pt(Fs(pr,de)),onDragOver:Pt(Fs(cn,xe)),onDragLeave:Pt(Fs(Un,oe)),onDrop:Pt(Fs(Re,he)),role:typeof Ke=="string"&&Ke!==""?Ke:"presentation"},Te,N),!r&&!I?{tabIndex:0}:{}),Je)}},[N,Ne,ge,Oe,at,de,xe,oe,he,I,R,r]),Y=f.useCallback(function(te){te.stopPropagation()},[]),Ce=f.useMemo(function(){return function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fe=te.refKey,Te=fe===void 0?"ref":fe,Ke=te.onChange,bt=te.onClick,Xt=Xf(te,bN),ln=E0({accept:$,multiple:u,type:"file",style:{display:"none"},onChange:Fe(Fs(Ke,he)),onClick:Fe(Fs(bt,Y)),tabIndex:-1},Te,H);return rr(rr({},ln),Xt)}},[H,n,u,he,r]);return rr(rr({},U),{},{isFocused:W&&!r,getRootProps:zn,getInputProps:Ce,rootRef:N,inputRef:H,open:Fe(je)})}function IN(e,t){switch(t.type){case"focus":return rr(rr({},e),{},{isFocused:!0});case"blur":return rr(rr({},e),{},{isFocused:!1});case"openDialog":return rr(rr({},O0),{},{isFileDialogActive:!0});case"closeDialog":return rr(rr({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return rr(rr({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return rr(rr({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return rr({},O0);default:return e}}function M2(){}function R0(){return R0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R0.apply(this,arguments)}var L5=["shift","alt","meta","mod","ctrl"],EN={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Ka(e){return(EN[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function ON(e){return L5.includes(e)}function Cg(e,t){return t===void 0&&(t=","),e.split(t)}function _g(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(i){return Ka(i)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},s=r.filter(function(i){return!L5.includes(i)});return R0({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&B5([Ka(e.key),Ka(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&H5([Ka(e.key),Ka(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Ya.clear()})})();var Ya=new Set;function F5(e,t){t===void 0&&(t=",");var n=Array.isArray(e)?e:e.split(t);return n.every(function(r){return Ya.has(r.trim().toLowerCase())})}function B5(e){var t=Array.isArray(e)?e:[e];Ya.has("meta")&&Ya.forEach(function(n){return!ON(n)&&Ya.delete(n.toLowerCase())}),t.forEach(function(n){return Ya.add(n.toLowerCase())})}function H5(e){var t=Array.isArray(e)?e:[e];e==="meta"?Ya.clear():t.forEach(function(n){return Ya.delete(n.toLowerCase())})}function RN(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function MN(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function DN(e){return V5(e,["input","textarea","select"])}function V5(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return t instanceof Array?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function TN(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var AN=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,i=n.mod,u=n.shift,d=n.ctrl,p=n.keys,m=t.key,h=t.code,v=t.ctrlKey,b=t.metaKey,w=t.shiftKey,S=t.altKey,C=Ka(h),_=m.toLowerCase();if(!r){if(o===!S&&_!=="alt"||u===!w&&_!=="shift")return!1;if(i){if(!b&&!v)return!1}else if(s===!b&&_!=="meta"&&_!=="os"||d===!v&&_!=="ctrl"&&_!=="control")return!1}return p&&p.length===1&&(p.includes(_)||p.includes(C))?!0:p?F5(p):!p},NN=f.createContext(void 0),$N=function(){return f.useContext(NN)};function W5(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&&W5(e[r],t[r])},!0):e===t}var zN=f.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),LN=function(){return f.useContext(zN)};function FN(e){var t=f.useRef(void 0);return W5(t.current,e)||(t.current=e),t.current}var D2=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},BN=typeof window<"u"?f.useLayoutEffect:f.useEffect;function Ze(e,t,n,r){var o=f.useRef(null),s=f.useRef(!1),i=n instanceof Array?r instanceof Array?void 0:r:n,u=e instanceof Array?e.join(i==null?void 0:i.splitKey):e,d=n instanceof Array?n:r instanceof Array?r:void 0,p=f.useCallback(t,d??[]),m=f.useRef(p);d?m.current=p:m.current=t;var h=FN(i),v=LN(),b=v.enabledScopes,w=$N();return BN(function(){if(!((h==null?void 0:h.enabled)===!1||!TN(b,h==null?void 0:h.scopes))){var S=function(E,I){var R;if(I===void 0&&(I=!1),!(DN(E)&&!V5(E,h==null?void 0:h.enableOnFormTags))&&!(h!=null&&h.ignoreEventWhen!=null&&h.ignoreEventWhen(E))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){D2(E);return}(R=E.target)!=null&&R.isContentEditable&&!(h!=null&&h.enableOnContentEditable)||Cg(u,h==null?void 0:h.splitKey).forEach(function(O){var D,T=_g(O,h==null?void 0:h.combinationKey);if(AN(E,T,h==null?void 0:h.ignoreModifiers)||(D=T.keys)!=null&&D.includes("*")){if(I&&s.current)return;if(RN(E,T,h==null?void 0:h.preventDefault),!MN(E,T,h==null?void 0:h.enabled)){D2(E);return}m.current(E,T),I||(s.current=!0)}})}},C=function(E){E.key!==void 0&&(B5(Ka(E.code)),((h==null?void 0:h.keydown)===void 0&&(h==null?void 0:h.keyup)!==!0||h!=null&&h.keydown)&&S(E))},_=function(E){E.key!==void 0&&(H5(Ka(E.code)),s.current=!1,h!=null&&h.keyup&&S(E,!0))},k=o.current||(i==null?void 0:i.document)||document;return k.addEventListener("keyup",_),k.addEventListener("keydown",C),w&&Cg(u,h==null?void 0:h.splitKey).forEach(function(P){return w.addHotkey(_g(P,h==null?void 0:h.combinationKey,h==null?void 0:h.description))}),function(){k.removeEventListener("keyup",_),k.removeEventListener("keydown",C),w&&Cg(u,h==null?void 0:h.splitKey).forEach(function(P){return w.removeHotkey(_g(P,h==null?void 0:h.combinationKey,h==null?void 0:h.description))})}}},[u,h,b]),o}const HN=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return Ze("esc",()=>{r(!1)}),a.jsx(Be,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:a.jsx(G,{sx:{opacity:.4,width:"100%",height:"100%",flexDirection:"column",rowGap:4,alignItems:"center",justifyContent:"center",bg:"base.900",boxShadow:`inset 0 0 20rem 1rem var(--invokeai-colors-${t?"accent":"error"}-500)`},children:t?a.jsx(ca,{size:"lg",children:"Drop to Upload"}):a.jsxs(a.Fragment,{children:[a.jsx(ca,{size:"lg",children:"Invalid Upload"}),a.jsx(ca,{size:"md",children:"Must be single JPEG or PNG image"})]})})})},VN=we([yo,yr],(e,t)=>{const{isConnected:n,isUploading:r}=e;return{isUploaderDisabled:!n||r,activeTabName:t}}),WN=e=>{const{children:t}=e,n=ne(),{isUploaderDisabled:r,activeTabName:o}=L(VN),s=Iu(),{t:i}=pe(),[u,d]=f.useState(!1),{setOpenUploaderFunction:p}=kh(),m=f.useCallback(E=>{d(!0),s({title:i("toast.uploadFailed"),description:E.errors.map(I=>I.message).join(`
|
||
`),status:"error"})},[i,s]),h=f.useCallback(async E=>{n(F4({file:E,image_category:"user",is_intermediate:!1,postUploadAction:{type:"TOAST_UPLOADED"}}))},[n]),v=f.useCallback((E,I)=>{if(I.length>1){s({title:i("toast.uploadFailed"),description:i("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}I.forEach(R=>{m(R)}),E.forEach(R=>{h(R)})},[i,s,h,m]),{getRootProps:b,getInputProps:w,isDragAccept:S,isDragReject:C,isDragActive:_,inputRef:k,open:P}=i1({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>d(!0),disabled:r,multiple:!1});return f.useEffect(()=>{const E=async I=>{var R,O;k.current&&(R=I.clipboardData)!=null&&R.files&&(k.current.files=I.clipboardData.files,(O=k.current)==null||O.dispatchEvent(new Event("change",{bubbles:!0})))};return p(P),document.addEventListener("paste",E),()=>{document.removeEventListener("paste",E),p(()=>{})}},[k,P,p]),a.jsxs(Be,{...b({style:{}}),onKeyDown:E=>{E.key},children:[a.jsx("input",{...w()}),t,_&&u&&a.jsx(HN,{isDragAccept:S,isDragReject:C,setIsHandlingUpload:d})]})},UN=f.memo(WN),GN=hR(e=>{e(B4(!0))},300),js=()=>(e,t)=>{yr(t())==="unifiedCanvas"&&GN(e)};var qN=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},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)}}(),Cr=globalThis&&globalThis.__assign||function(){return Cr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Cr.apply(this,arguments)},T2={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},A2={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Fd={width:"20px",height:"20px",position:"absolute"},KN={top:Cr(Cr({},T2),{top:"-5px"}),right:Cr(Cr({},A2),{left:void 0,right:"-5px"}),bottom:Cr(Cr({},T2),{top:void 0,bottom:"-5px"}),left:Cr(Cr({},A2),{left:"-5px"}),topRight:Cr(Cr({},Fd),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Cr(Cr({},Fd),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Cr(Cr({},Fd),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Cr(Cr({},Fd),{left:"-10px",top:"-10px",cursor:"nw-resize"})},YN=function(e){qN(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.onMouseDown=function(r){n.props.onResizeStart(r,n.props.direction)},n.onTouchStart=function(r){n.props.onResizeStart(r,n.props.direction)},n}return t.prototype.render=function(){return f.createElement("div",{className:this.props.className||"",style:Cr(Cr({position:"absolute",userSelect:"none"},KN[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(f.PureComponent),QN=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},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)}}(),Bs=globalThis&&globalThis.__assign||function(){return Bs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Bs.apply(this,arguments)},XN={width:"auto",height:"auto"},Bd=function(e,t,n){return Math.max(Math.min(e,n),t)},N2=function(e,t){return Math.round(e/t)*t},Cl=function(e,t){return new RegExp(e,"i").test(t)},Hd=function(e){return!!(e.touches&&e.touches.length)},ZN=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},$2=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(s,i,u){return Math.abs(i-e)<Math.abs(t[s]-e)?u:s},0),o=Math.abs(t[r]-e);return n===0||o<n?t[r]:e},kg=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},Vd=function(e,t,n,r){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var o=Number(e.replace("%",""))/100;return t*o}if(e.endsWith("vw")){var o=Number(e.replace("vw",""))/100;return n*o}if(e.endsWith("vh")){var o=Number(e.replace("vh",""))/100;return r*o}}return e},JN=function(e,t,n,r,o,s,i){return r=Vd(r,e.width,t,n),o=Vd(o,e.height,t,n),s=Vd(s,e.width,t,n),i=Vd(i,e.height,t,n),{maxWidth:typeof r>"u"?void 0:Number(r),maxHeight:typeof o>"u"?void 0:Number(o),minWidth:typeof s>"u"?void 0:Number(s),minHeight:typeof i>"u"?void 0:Number(i)}},e$=["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"],z2="__resizable_base__",t$=function(e){QN(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 o=r.parentNode;if(!o)return null;var s=r.window.document.createElement("div");return s.style.width="100%",s.style.height="100%",s.style.position="absolute",s.style.transform="scale(0, 0)",s.style.left="0",s.style.flex="0 0 100%",s.classList?s.classList.add(z2):s.className+=z2,o.appendChild(s),s},r.removeBase=function(o){var s=r.parentNode;s&&s.removeChild(o)},r.ref=function(o){o&&(r.resizable=o)},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||XN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,s=this.resizable.offsetHeight,i=this.resizable.style.position;i!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:o,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:s,this.resizable.style.position=i}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,o=function(u){if(typeof n.state[u]>"u"||n.state[u]==="auto")return"auto";if(n.propsSize&&n.propsSize[u]&&n.propsSize[u].toString().endsWith("%")){if(n.state[u].toString().endsWith("%"))return n.state[u].toString();var d=n.getParentSize(),p=Number(n.state[u].toString().replace("px","")),m=p/d[u]*100;return m+"%"}return kg(n.state[u])},s=r&&typeof r.width<"u"&&!this.state.isResizing?kg(r.width):o("width"),i=r&&typeof r.height<"u"&&!this.state.isResizing?kg(r.height):o("height");return{width:s,height:i}},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,o=this.parentNode.style.flexWrap;o!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var s={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=o),this.removeBase(n),s},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 o=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof o>"u"||o==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var o=this.props.boundsByDirection,s=this.state.direction,i=o&&Cl("left",s),u=o&&Cl("top",s),d,p;if(this.props.bounds==="parent"){var m=this.parentNode;m&&(d=i?this.resizableRight-this.parentLeft:m.offsetWidth+(this.parentLeft-this.resizableLeft),p=u?this.resizableBottom-this.parentTop:m.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(d=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,p=u?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(d=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),p=u?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return d&&Number.isFinite(d)&&(n=n&&n<d?n:d),p&&Number.isFinite(p)&&(r=r&&r<p?r:p),{maxWidth:n,maxHeight:r}},t.prototype.calculateNewSizeFromDirection=function(n,r){var o=this.props.scale||1,s=this.props.resizeRatio||1,i=this.state,u=i.direction,d=i.original,p=this.props,m=p.lockAspectRatio,h=p.lockAspectRatioExtraHeight,v=p.lockAspectRatioExtraWidth,b=d.width,w=d.height,S=h||0,C=v||0;return Cl("right",u)&&(b=d.width+(n-d.x)*s/o,m&&(w=(b-C)/this.ratio+S)),Cl("left",u)&&(b=d.width-(n-d.x)*s/o,m&&(w=(b-C)/this.ratio+S)),Cl("bottom",u)&&(w=d.height+(r-d.y)*s/o,m&&(b=(w-S)*this.ratio+C)),Cl("top",u)&&(w=d.height-(r-d.y)*s/o,m&&(b=(w-S)*this.ratio+C)),{newWidth:b,newHeight:w}},t.prototype.calculateNewSizeFromAspectRatio=function(n,r,o,s){var i=this.props,u=i.lockAspectRatio,d=i.lockAspectRatioExtraHeight,p=i.lockAspectRatioExtraWidth,m=typeof s.width>"u"?10:s.width,h=typeof o.width>"u"||o.width<0?n:o.width,v=typeof s.height>"u"?10:s.height,b=typeof o.height>"u"||o.height<0?r:o.height,w=d||0,S=p||0;if(u){var C=(v-w)*this.ratio+S,_=(b-w)*this.ratio+S,k=(m-S)/this.ratio+w,P=(h-S)/this.ratio+w,E=Math.max(m,C),I=Math.min(h,_),R=Math.max(v,k),O=Math.min(b,P);n=Bd(n,E,I),r=Bd(r,R,O)}else n=Bd(n,m,h),r=Bd(r,v,b);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 o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left,this.targetTop=o.top}if(this.resizable){var s=this.resizable.getBoundingClientRect(),i=s.left,u=s.top,d=s.right,p=s.bottom;this.resizableLeft=i,this.resizableRight=d,this.resizableTop=u,this.resizableBottom=p}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,s=0;if(n.nativeEvent&&ZN(n.nativeEvent)?(o=n.nativeEvent.clientX,s=n.nativeEvent.clientY):n.nativeEvent&&Hd(n.nativeEvent)&&(o=n.nativeEvent.touches[0].clientX,s=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var i=this.props.onResizeStart(n,r,this.resizable);if(i===!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 u,d=this.window.getComputedStyle(this.resizable);if(d.flexBasis!=="auto"){var p=this.parentNode;if(p){var m=this.window.getComputedStyle(p).flexDirection;this.flexDir=m.startsWith("row")?"row":"column",u=d.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var h={original:{x:o,y:s,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Bs(Bs({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:u};this.setState(h)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Hd(n))try{n.preventDefault(),n.stopPropagation()}catch{}var o=this.props,s=o.maxWidth,i=o.maxHeight,u=o.minWidth,d=o.minHeight,p=Hd(n)?n.touches[0].clientX:n.clientX,m=Hd(n)?n.touches[0].clientY:n.clientY,h=this.state,v=h.direction,b=h.original,w=h.width,S=h.height,C=this.getParentSize(),_=JN(C,this.window.innerWidth,this.window.innerHeight,s,i,u,d);s=_.maxWidth,i=_.maxHeight,u=_.minWidth,d=_.minHeight;var k=this.calculateNewSizeFromDirection(p,m),P=k.newHeight,E=k.newWidth,I=this.calculateNewMaxFromBoundary(s,i);this.props.snap&&this.props.snap.x&&(E=$2(E,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(P=$2(P,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(E,P,{width:I.maxWidth,height:I.maxHeight},{width:u,height:d});if(E=R.newWidth,P=R.newHeight,this.props.grid){var O=N2(E,this.props.grid[0]),D=N2(P,this.props.grid[1]),T=this.props.snapGap||0;E=T===0||Math.abs(O-E)<=T?O:E,P=T===0||Math.abs(D-P)<=T?D:P}var $={width:E-b.width,height:P-b.height};if(w&&typeof w=="string"){if(w.endsWith("%")){var B=E/C.width*100;E=B+"%"}else if(w.endsWith("vw")){var ee=E/this.window.innerWidth*100;E=ee+"vw"}else if(w.endsWith("vh")){var F=E/this.window.innerHeight*100;E=F+"vh"}}if(S&&typeof S=="string"){if(S.endsWith("%")){var B=P/C.height*100;P=B+"%"}else if(S.endsWith("vw")){var ee=P/this.window.innerWidth*100;P=ee+"vw"}else if(S.endsWith("vh")){var F=P/this.window.innerHeight*100;P=F+"vh"}}var N={width:this.createSizeForCssProperty(E,"width"),height:this.createSizeForCssProperty(P,"height")};this.flexDir==="row"?N.flexBasis=N.width:this.flexDir==="column"&&(N.flexBasis=N.height),dc.flushSync(function(){r.setState(N)}),this.props.onResize&&this.props.onResize(n,v,this.resizable,$)}},t.prototype.onMouseUp=function(n){var r=this.state,o=r.isResizing,s=r.direction,i=r.original;if(!(!o||!this.resizable)){var u={width:this.size.width-i.width,height:this.size.height-i.height};this.props.onResizeStop&&this.props.onResizeStop(n,s,this.resizable,u),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Bs(Bs({},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,o=r.enable,s=r.handleStyles,i=r.handleClasses,u=r.handleWrapperStyle,d=r.handleWrapperClass,p=r.handleComponent;if(!o)return null;var m=Object.keys(o).map(function(h){return o[h]!==!1?f.createElement(YN,{key:h,direction:h,onResizeStart:n.onResizeStart,replaceStyles:s&&s[h],className:i&&i[h]},p&&p[h]?p[h]:null):null});return f.createElement("div",{className:d,style:u},m)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(i,u){return e$.indexOf(u)!==-1||(i[u]=n.props[u]),i},{}),o=Bs(Bs(Bs({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&&(o.flexBasis=this.state.flexBasis);var s=this.props.as||"div";return f.createElement(s,Bs({ref:this.ref,style:o,className:this.props.className},r),this.state.isResizing&&f.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}(f.PureComponent);const n$=({direction:e,langDirection:t})=>({top:e==="bottom",right:t!=="rtl"&&e==="left"||t==="rtl"&&e==="right",bottom:e==="top",left:t!=="rtl"&&e==="right"||t==="rtl"&&e==="left"}),r$=({direction:e,minWidth:t,maxWidth:n,minHeight:r,maxHeight:o})=>{const s=t??(["left","right"].includes(e)?10:void 0),i=n??(["left","right"].includes(e)?"95vw":void 0),u=r??(["top","bottom"].includes(e)?10:void 0),d=o??(["top","bottom"].includes(e)?"95vh":void 0);return{...s?{minWidth:s}:{},...i?{maxWidth:i}:{},...u?{minHeight:u}:{},...d?{maxHeight:d}:{}}},la="0.75rem",Wd="1rem",Lc="5px",o$=({isResizable:e,direction:t})=>{const n=`calc((2 * ${la} + ${Lc}) / -2)`;return t==="top"?{containerStyles:{borderBottomWidth:Lc,paddingBottom:Wd},handleStyles:e?{top:{paddingTop:la,paddingBottom:la,bottom:n}}:{}}:t==="left"?{containerStyles:{borderInlineEndWidth:Lc,paddingInlineEnd:Wd},handleStyles:e?{right:{paddingInlineStart:la,paddingInlineEnd:la,insetInlineEnd:n}}:{}}:t==="bottom"?{containerStyles:{borderTopWidth:Lc,paddingTop:Wd},handleStyles:e?{bottom:{paddingTop:la,paddingBottom:la,top:n}}:{}}:t==="right"?{containerStyles:{borderInlineStartWidth:Lc,paddingInlineStart:Wd},handleStyles:e?{left:{paddingInlineStart:la,paddingInlineEnd:la,insetInlineStart:n}}:{}}:{containerStyles:{},handleStyles:{}}},s$=(e,t)=>["top","bottom"].includes(e)?e:e==="left"?t==="rtl"?"right":"left":e==="right"?t==="rtl"?"left":"right":"left",Pe=(e,t)=>n=>n==="light"?e:t,a$=Ue(t$,{shouldForwardProp:e=>!["sx"].includes(e)}),U5=({direction:e="left",isResizable:t,isOpen:n,onClose:r,children:o,initialWidth:s,minWidth:i,maxWidth:u,initialHeight:d,minHeight:p,maxHeight:m,onResizeStart:h,onResizeStop:v,onResize:b,sx:w={}})=>{const S=rh().direction,{colorMode:C}=Qr(),_=f.useRef(null),k=f.useMemo(()=>s??i??(["left","right"].includes(e)?"auto":"100%"),[s,i,e]),P=f.useMemo(()=>d??p??(["top","bottom"].includes(e)?"auto":"100%"),[d,p,e]),[E,I]=f.useState(k),[R,O]=f.useState(P);Q9({ref:_,handler:()=>{r()},enabled:n});const D=f.useMemo(()=>t?n$({direction:e,langDirection:S}):{},[t,S,e]),T=f.useMemo(()=>r$({direction:e,minWidth:i,maxWidth:u,minHeight:p,maxHeight:m}),[i,u,p,m,e]),{containerStyles:$,handleStyles:B}=f.useMemo(()=>o$({isResizable:t,direction:e}),[t,e]),ee=f.useMemo(()=>s$(e,S),[e,S]);return f.useEffect(()=>{["left","right"].includes(e)&&O("100vh"),["top","bottom"].includes(e)&&I("100vw")},[e]),a.jsx(U3,{direction:ee,in:n,motionProps:{initial:!1},style:{width:"full"},children:a.jsx(Be,{ref:_,sx:{width:"full",height:"full"},children:a.jsx(a$,{size:{width:t?E:k,height:t?R:P},enable:D,handleStyles:B,...T,sx:{borderColor:Pe("base.200","base.800")(C),p:4,bg:Pe("base.100","base.900")(C),height:"full",shadow:n?"dark-lg":void 0,...$,...w},onResizeStart:(F,N,H)=>{h&&h(F,N,H)},onResize:(F,N,H,K)=>{b&&b(F,N,H,K)},onResizeStop:(F,N,H,K)=>{["left","right"].includes(N)&&I(Number(E)+K.width),["top","bottom"].includes(N)&&O(Number(R)+K.height),v&&v(F,N,H,K)},children:o})})})},i$=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return a.jsxs(n1,{isLazy:o,...s,children:[a.jsx(t1,{children:t}),a.jsxs(r1,{shadow:"dark-lg",children:[r&&a.jsx(u5,{}),n]})]})},da=f.memo(i$),l$=e=>{const{label:t,...n}=e,{colorMode:r}=Qr();return a.jsx(Q3,{colorScheme:"accent",...n,children:a.jsx(tt,{sx:{fontSize:"sm",color:Pe("base.800","base.200")(r)},children:t})})},En=f.memo(l$);function G5(e){return ot({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 q5(e){return ot({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 c$(e){return ot({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 u$(e){return ot({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 d$(e){return ot({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-352 96c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm112 236.8c0 10.6-10 19.2-22.4 19.2H86.4C74 384 64 375.4 64 364.8v-19.2c0-31.8 30.1-57.6 67.2-57.6h5c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h5c37.1 0 67.2 25.8 67.2 57.6v19.2zM512 312c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-64c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-64c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16z"}}]})(e)}function f$(e){return ot({tag:"svg",attr:{viewBox:"0 0 448 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 34zm192-34l-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.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"}}]})(e)}function p$(e){return ot({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 h$(e){return ot({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 m$(e){return ot({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 g$(e){return ot({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 K5(e){return ot({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 v$(e){return ot({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 y$(e){return ot({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 b$(e){return ot({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 x$(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"}}]})(e)}function l1(e){return ot({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 gc(e){return ot({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 Y5(e){return ot({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 S$(e){return ot({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 c1(e){return ot({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 Q5(e){return ot({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 w$(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"}}]})(e)}function C$(e){return ot({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M176 432c0 44.112-35.888 80-80 80s-80-35.888-80-80 35.888-80 80-80 80 35.888 80 80zM25.26 25.199l13.6 272C39.499 309.972 50.041 320 62.83 320h66.34c12.789 0 23.331-10.028 23.97-22.801l13.6-272C167.425 11.49 156.496 0 142.77 0H49.23C35.504 0 24.575 11.49 25.26 25.199z"}}]})(e)}function _$(e){return ot({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 k$(e){return ot({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 X5(e){return ot({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 j$(e){return ot({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 P$(e){return ot({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 Z5(e){return ot({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 I$(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464,128H272L208,64H48A48,48,0,0,0,0,112V400a48,48,0,0,0,48,48H464a48,48,0,0,0,48-48V176A48,48,0,0,0,464,128ZM359.5,296a16,16,0,0,1-16,16h-64v64a16,16,0,0,1-16,16h-16a16,16,0,0,1-16-16V312h-64a16,16,0,0,1-16-16V280a16,16,0,0,1,16-16h64V200a16,16,0,0,1,16-16h16a16,16,0,0,1,16,16v64h64a16,16,0,0,1,16,16Z"}}]})(e)}function su(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"}}]})(e)}function E$(e){return ot({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"}}]})(e)}function O$(e){return ot({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 R$(e){return ot({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M360 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24 0 90.965 51.016 167.734 120.842 192C75.016 280.266 24 357.035 24 448c-13.255 0-24 10.745-24 24v16c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24 0-90.965-51.016-167.734-120.842-192C308.984 231.734 360 154.965 360 64c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24zm-75.078 384H99.08c17.059-46.797 52.096-80 92.92-80 40.821 0 75.862 33.196 92.922 80zm.019-256H99.078C91.988 108.548 88 86.748 88 64h208c0 22.805-3.987 44.587-11.059 64z"}}]})(e)}function vc(e){return ot({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 J5(e){return ot({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M480 416v16c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v208c0 44.112 35.888 80 80 80h336zm96-80V80c0-26.51-21.49-48-48-48H144c-26.51 0-48 21.49-48 48v256c0 26.51 21.49 48 48 48h384c26.51 0 48-21.49 48-48zM256 128c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-96 144l55.515-55.515c4.686-4.686 12.284-4.686 16.971 0L272 256l135.515-135.515c4.686-4.686 12.284-4.686 16.971 0L512 208v112H160v-48z"}}]})(e)}function M$(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"}}]})(e)}function D$(e){return ot({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 u1(e){return ot({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 T$(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"}}]})(e)}function A$(e){return ot({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 N$(e){return ot({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 $$(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"}}]})(e)}function e_(e){return ot({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 t_(e){return ot({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 jh(e){return ot({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 z$(e){return ot({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 L$(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504.971 359.029c9.373 9.373 9.373 24.569 0 33.941l-80 79.984c-15.01 15.01-40.971 4.49-40.971-16.971V416h-58.785a12.004 12.004 0 0 1-8.773-3.812l-70.556-75.596 53.333-57.143L352 336h32v-39.981c0-21.438 25.943-31.998 40.971-16.971l80 79.981zM12 176h84l52.781 56.551 53.333-57.143-70.556-75.596A11.999 11.999 0 0 0 122.785 96H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12zm372 0v39.984c0 21.46 25.961 31.98 40.971 16.971l80-79.984c9.373-9.373 9.373-24.569 0-33.941l-80-79.981C409.943 24.021 384 34.582 384 56.019V96h-58.785a12.004 12.004 0 0 0-8.773 3.812L96 336H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h110.785c3.326 0 6.503-1.381 8.773-3.812L352 176h32z"}}]})(e)}function F$(e){return ot({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 Ph(e){return ot({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 L2(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"}}]})(e)}function B$(e){return ot({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 H$(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 160H32c-17.673 0-32-14.327-32-32V64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z"}}]})(e)}function V$(e){return ot({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 Zf(e){return ot({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 d1(e){return ot({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 W$(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"}}]})(e)}function U$(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z"}}]})(e)}function mo(e){return ot({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 f1(e){return ot({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 Hu(e){return ot({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 p1(e){return ot({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)}var h1=Mu({displayName:"ExternalLinkIcon",path:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[a.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),a.jsx("path",{d:"M15 3h6v6"}),a.jsx("path",{d:"M10 14L21 3"})]})}),m1=Mu({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),G$=Mu({displayName:"CloseIcon",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"}),q$=Mu({displayName:"DeleteIcon",path:a.jsx("g",{fill:"currentColor",children:a.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"})})}),K$=Mu({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});/*!
|
||
* OverlayScrollbars
|
||
* Version: 2.2.0
|
||
*
|
||
* Copyright (c) Rene Haas | KingSora.
|
||
* https://github.com/KingSora
|
||
*
|
||
* Released under the MIT license.
|
||
*/function bn(e,t){if(Eh(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&bn(Object.keys(e),n=>t(e[n],n,e));return e}function Kr(e,t){const n=ci(t);if(Is(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?V2(e,s,t):t.reduce((i,u)=>(i[u]=V2(e,s,u),i),o)}return o}e&&bn(Ro(t),o=>uz(e,o,t[o]))}const ps=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,i;const u=(m,h)=>{const v=s,b=m,w=h||(r?!r(v,b):v!==b);return(w||o)&&(s=b,i=v),[s,w,i]};return[t?m=>u(t(s,i),m):u,m=>[s,!!m,i]]},Vu=()=>typeof window<"u",n_=Vu()&&Node.ELEMENT_NODE,{toString:Y$,hasOwnProperty:jg}=Object.prototype,Ea=e=>e===void 0,Ih=e=>e===null,Q$=e=>Ea(e)||Ih(e)?`${e}`:Y$.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),ri=e=>typeof e=="number",ci=e=>typeof e=="string",g1=e=>typeof e=="boolean",Ps=e=>typeof e=="function",Is=e=>Array.isArray(e),yu=e=>typeof e=="object"&&!Is(e)&&!Ih(e),Eh=e=>{const t=!!e&&e.length,n=ri(t)&&t>-1&&t%1==0;return Is(e)||!Ps(e)&&n?t>0&&yu(e)?t-1 in e:!0:!1},M0=e=>{if(!e||!yu(e)||Q$(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=jg.call(e,n),i=o&&jg.call(o,"isPrototypeOf");if(r&&!s&&!i)return!1;for(t in e);return Ea(t)||jg.call(e,t)},Jf=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===n_:!1},Oh=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===n_:!1},v1=(e,t,n)=>e.indexOf(t,n),On=(e,t,n)=>(!n&&!ci(t)&&Eh(t)?Array.prototype.push.apply(e,t):e.push(t),e),Wi=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{On(n,r)}):bn(e,r=>{On(n,r)}),n)},y1=e=>!!e&&e.length===0,Js=(e,t,n)=>{bn(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},Rh=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ro=e=>e?Object.keys(e):[],or=(e,t,n,r,o,s,i)=>{const u=[t,n,r,o,s,i];return(typeof e!="object"||Ih(e))&&!Ps(e)&&(e={}),bn(u,d=>{bn(Ro(d),p=>{const m=d[p];if(e===m)return!0;const h=Is(m);if(m&&(M0(m)||h)){const v=e[p];let b=v;h&&!Is(v)?b=[]:!h&&!M0(v)&&(b={}),e[p]=or(b,m)}else e[p]=m})}),e},b1=e=>{for(const t in e)return!1;return!0},r_=(e,t,n,r)=>{if(Ea(r))return n?n[e]:t;n&&(ci(r)||ri(r))&&(n[e]=r)},Gr=(e,t,n)=>{if(Ea(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},uo=(e,t)=>{e&&e.removeAttribute(t)},Ti=(e,t,n,r)=>{if(n){const o=Gr(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const i=Wi(s).join(" ").trim();Gr(e,t,i)}},X$=(e,t,n)=>{const r=Gr(e,t)||"";return new Set(r.split(" ")).has(n)},ys=(e,t)=>r_("scrollLeft",0,e,t),fa=(e,t)=>r_("scrollTop",0,e,t),D0=Vu()&&Element.prototype,o_=(e,t)=>{const n=[],r=t?Oh(t)?t:null:document;return r?On(n,r.querySelectorAll(e)):n},Z$=(e,t)=>{const n=t?Oh(t)?t:null:document;return n?n.querySelector(e):null},ep=(e,t)=>Oh(e)?(D0.matches||D0.msMatchesSelector).call(e,t):!1,x1=e=>e?Wi(e.childNodes):[],Ca=e=>e?e.parentElement:null,Ol=(e,t)=>{if(Oh(e)){const n=D0.closest;if(n)return n.call(e,t);do{if(ep(e,t))return e;e=Ca(e)}while(e)}return null},J$=(e,t,n)=>{const r=e&&Ol(e,t),o=e&&Z$(n,r),s=Ol(o,t)===r;return r&&o?r===e||o===e||s&&Ol(Ol(e,n),t)!==r:!1},S1=(e,t,n)=>{if(n&&e){let r=t,o;Eh(n)?(o=document.createDocumentFragment(),bn(n,s=>{s===r&&(r=s.previousSibling),o.appendChild(s)})):o=n,t&&(r?r!==t&&(r=r.nextSibling):r=e.firstChild),e.insertBefore(o,r||null)}},Ko=(e,t)=>{S1(e,null,t)},ez=(e,t)=>{S1(Ca(e),e,t)},F2=(e,t)=>{S1(Ca(e),e&&e.nextSibling,t)},Ks=e=>{if(Eh(e))bn(Wi(e),t=>Ks(t));else if(e){const t=Ca(e);t&&t.removeChild(e)}},Ai=e=>{const t=document.createElement("div");return e&&Gr(t,"class",e),t},s_=e=>{const t=Ai();return t.innerHTML=e.trim(),bn(x1(t),n=>Ks(n))},T0=e=>e.charAt(0).toUpperCase()+e.slice(1),tz=()=>Ai().style,nz=["-webkit-","-moz-","-o-","-ms-"],rz=["WebKit","Moz","O","MS","webkit","moz","o","ms"],Pg={},Ig={},oz=e=>{let t=Ig[e];if(Rh(Ig,e))return t;const n=T0(e),r=tz();return bn(nz,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,T0(s)+n].find(u=>r[u]!==void 0))}),Ig[e]=t||""},Wu=e=>{if(Vu()){let t=Pg[e]||window[e];return Rh(Pg,e)||(bn(rz,n=>(t=t||window[n+T0(e)],!t)),Pg[e]=t),t}},sz=Wu("MutationObserver"),B2=Wu("IntersectionObserver"),Rl=Wu("ResizeObserver"),a_=Wu("cancelAnimationFrame"),i_=Wu("requestAnimationFrame"),tp=Vu()&&window.setTimeout,A0=Vu()&&window.clearTimeout,az=/[^\x20\t\r\n\f]+/g,l_=(e,t,n)=>{const r=e&&e.classList;let o,s=0,i=!1;if(r&&t&&ci(t)){const u=t.match(az)||[];for(i=u.length>0;o=u[s++];)i=!!n(r,o)&&i}return i},w1=(e,t)=>{l_(e,t,(n,r)=>n.remove(r))},pa=(e,t)=>(l_(e,t,(n,r)=>n.add(r)),w1.bind(0,e,t)),Mh=(e,t,n,r)=>{if(e&&t){let o=!0;return bn(n,s=>{const i=r?r(e[s]):e[s],u=r?r(t[s]):t[s];i!==u&&(o=!1)}),o}return!1},c_=(e,t)=>Mh(e,t,["w","h"]),u_=(e,t)=>Mh(e,t,["x","y"]),iz=(e,t)=>Mh(e,t,["t","r","b","l"]),H2=(e,t,n)=>Mh(e,t,["width","height"],n&&(r=>Math.round(r))),qo=()=>{},Il=e=>{let t;const n=e?tp:i_,r=e?A0:a_;return[o=>{r(t),t=n(o,Ps(e)?e():e)},()=>r(t)]},C1=(e,t)=>{let n,r,o,s=qo;const{v:i,g:u,p:d}=t||{},p=function(w){s(),A0(n),n=r=void 0,s=qo,e.apply(this,w)},m=b=>d&&r?d(r,b):b,h=()=>{s!==qo&&p(m(o)||o)},v=function(){const w=Wi(arguments),S=Ps(i)?i():i;if(ri(S)&&S>=0){const _=Ps(u)?u():u,k=ri(_)&&_>=0,P=S>0?tp:i_,E=S>0?A0:a_,R=m(w)||w,O=p.bind(0,R);s();const D=P(O,S);s=()=>E(D),k&&!n&&(n=tp(h,_)),r=o=R}else p(w)};return v.m=h,v},lz={opacity:1,zindex:1},Ud=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},cz=(e,t)=>!lz[e.toLowerCase()]&&ri(t)?`${t}px`:t,V2=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],uz=(e,t,n)=>{try{const{style:r}=e;Ea(r[t])?r.setProperty(t,n):r[t]=cz(t,n)}catch{}},bu=e=>Kr(e,"direction")==="rtl",W2=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,i=`${r}right${o}`,u=`${r}bottom${o}`,d=`${r}left${o}`,p=Kr(e,[s,i,u,d]);return{t:Ud(p[s],!0),r:Ud(p[i],!0),b:Ud(p[u],!0),l:Ud(p[d],!0)}},{round:U2}=Math,_1={w:0,h:0},Ui=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:_1,jf=e=>e?{w:e.clientWidth,h:e.clientHeight}:_1,np=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:_1,rp=e=>{const t=parseFloat(Kr(e,"height"))||0,n=parseFloat(Kr(e,"width"))||0;return{w:n-U2(n),h:t-U2(t)}},Qa=e=>e.getBoundingClientRect();let Gd;const dz=()=>{if(Ea(Gd)){Gd=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){Gd=!0}}))}catch{}}return Gd},d_=e=>e.split(" "),fz=(e,t,n,r)=>{bn(d_(t),o=>{e.removeEventListener(o,n,r)})},Rr=(e,t,n,r)=>{var o;const s=dz(),i=(o=s&&r&&r.S)!=null?o:s,u=r&&r.$||!1,d=r&&r.C||!1,p=[],m=s?{passive:i,capture:u}:u;return bn(d_(t),h=>{const v=d?b=>{e.removeEventListener(h,v,u),n&&n(b)}:n;On(p,fz.bind(null,e,h,v,u)),e.addEventListener(h,v,m)}),Js.bind(0,p)},f_=e=>e.stopPropagation(),p_=e=>e.preventDefault(),pz={x:0,y:0},Eg=e=>{const t=e?Qa(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:pz},G2=(e,t)=>{bn(Is(t)?t:[t],e)},k1=e=>{const t=new Map,n=(s,i)=>{if(s){const u=t.get(s);G2(d=>{u&&u[d?"delete":"clear"](d)},i)}else t.forEach(u=>{u.clear()}),t.clear()},r=(s,i)=>{if(ci(s)){const p=t.get(s)||new Set;return t.set(s,p),G2(m=>{Ps(m)&&p.add(m)},i),n.bind(0,s,i)}g1(i)&&i&&n();const u=Ro(s),d=[];return bn(u,p=>{const m=s[p];m&&On(d,r(p,m))}),Js.bind(0,d)},o=(s,i)=>{const u=t.get(s);bn(Wi(u),d=>{i&&!y1(i)?d.apply(0,i):d()})};return r(e||{}),[r,n,o]},q2=e=>JSON.stringify(e,(t,n)=>{if(Ps(n))throw new Error;return n}),hz={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:[0,33],attributes:null,ignoreMutation:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},h_=(e,t)=>{const n={},r=Ro(t).concat(Ro(e));return bn(r,o=>{const s=e[o],i=t[o];if(yu(s)&&yu(i))or(n[o]={},h_(s,i)),b1(n[o])&&delete n[o];else if(Rh(t,o)&&i!==s){let u=!0;if(Is(s)||Is(i))try{q2(s)===q2(i)&&(u=!1)}catch{}u&&(n[o]=i)}}),n},m_="os-environment",g_=`${m_}-flexbox-glue`,mz=`${g_}-max`,v_="os-scrollbar-hidden",Og="data-overlayscrollbars-initialize",hs="data-overlayscrollbars",y_=`${hs}-overflow-x`,b_=`${hs}-overflow-y`,Bl="overflowVisible",gz="scrollbarHidden",K2="scrollbarPressed",op="updating",Ga="data-overlayscrollbars-viewport",Rg="arrange",x_="scrollbarHidden",Hl=Bl,N0="data-overlayscrollbars-padding",vz=Hl,Y2="data-overlayscrollbars-content",j1="os-size-observer",yz=`${j1}-appear`,bz=`${j1}-listener`,xz="os-trinsic-observer",Sz="os-no-css-vars",wz="os-theme-none",bo="os-scrollbar",Cz=`${bo}-rtl`,_z=`${bo}-horizontal`,kz=`${bo}-vertical`,S_=`${bo}-track`,P1=`${bo}-handle`,jz=`${bo}-visible`,Pz=`${bo}-cornerless`,Q2=`${bo}-transitionless`,X2=`${bo}-interaction`,Z2=`${bo}-unusable`,J2=`${bo}-auto-hidden`,eS=`${bo}-wheel`,Iz=`${S_}-interactive`,Ez=`${P1}-interactive`,w_={},Gi=()=>w_,Oz=e=>{const t=[];return bn(Is(e)?e:[e],n=>{const r=Ro(n);bn(r,o=>{On(t,w_[o]=n[o])})}),t},Rz="__osOptionsValidationPlugin",Mz="__osSizeObserverPlugin",I1="__osScrollbarsHidingPlugin",Dz="__osClickScrollPlugin";let Mg;const tS=(e,t,n,r)=>{Ko(e,t);const o=jf(t),s=Ui(t),i=rp(n);return r&&Ks(t),{x:s.h-o.h+i.h,y:s.w-o.w+i.w}},Tz=e=>{let t=!1;const n=pa(e,v_);try{t=Kr(e,oz("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},Az=(e,t)=>{const n="hidden";Kr(e,{overflowX:n,overflowY:n,direction:"rtl"}),ys(e,0);const r=Eg(e),o=Eg(t);ys(e,-999);const s=Eg(t);return{i:r.x===o.x,n:o.x!==s.x}},Nz=(e,t)=>{const n=pa(e,g_),r=Qa(e),o=Qa(t),s=H2(o,r,!0),i=pa(e,mz),u=Qa(e),d=Qa(t),p=H2(d,u,!0);return n(),i(),s&&p},$z=()=>{const{body:e}=document,n=s_(`<div class="${m_}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=k1(),[i,u]=ps({o:tS(e,n,r),u:u_},tS.bind(0,e,n,r,!0)),[d]=u(),p=Tz(n),m={x:d.x===0,y:d.y===0},h={elements:{host:null,padding:!p,viewport:k=>p&&k===k.ownerDocument.body&&k,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},v=or({},hz),b=or.bind(0,{},v),w=or.bind(0,{},h),S={k:d,A:m,I:p,L:Kr(n,"zIndex")==="-1",B:Az(n,r),V:Nz(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:w,q:k=>or(h,k)&&w(),F:b,G:k=>or(v,k)&&b(),X:or({},h),U:or({},v)},C=window.addEventListener,_=C1(k=>s(k?"z":"r"),{v:33,g:99});if(uo(n,"style"),Ks(n),C("resize",_.bind(0,!1)),!p&&(!m.x||!m.y)){let k;C("resize",()=>{const P=Gi()[I1];k=k||P&&P.R(),k&&k(S,i,_.bind(0,!0))})}return S},xo=()=>(Mg||(Mg=$z()),Mg),E1=(e,t)=>Ps(t)?t.apply(0,e):t,zz=(e,t,n,r)=>{const o=Ea(r)?n:r;return E1(e,o)||t.apply(0,e)},C_=(e,t,n,r)=>{const o=Ea(r)?n:r,s=E1(e,o);return!!s&&(Jf(s)?s:t.apply(0,e))},Lz=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:i}=xo(),{nativeScrollbarsOverlaid:u,body:d}=t,p=r??u,m=Ea(o)?d:o,h=(s.x||s.y)&&p,v=e&&(Ih(m)?!i:m);return!!h||!!v},O1=new WeakMap,Fz=(e,t)=>{O1.set(e,t)},Bz=e=>{O1.delete(e)},__=e=>O1.get(e),nS=(e,t)=>e?t.split(".").reduce((n,r)=>n&&Rh(n,r)?n[r]:void 0,e):void 0,$0=(e,t,n)=>r=>[nS(e,r),n||nS(t,r)!==void 0],k_=e=>{let t=e;return[()=>t,n=>{t=or({},t,n)}]},qd="tabindex",Kd=Ai.bind(0,""),Dg=e=>{Ko(Ca(e),x1(e)),Ks(e)},Hz=e=>{const t=xo(),{N:n,I:r}=t,o=Gi()[I1],s=o&&o.T,{elements:i}=n(),{host:u,padding:d,viewport:p,content:m}=i,h=Jf(e),v=h?{}:e,{elements:b}=v,{host:w,padding:S,viewport:C,content:_}=b||{},k=h?e:v.target,P=ep(k,"textarea"),E=k.ownerDocument,I=E.documentElement,R=k===E.body,O=E.defaultView,D=zz.bind(0,[k]),T=C_.bind(0,[k]),$=E1.bind(0,[k]),B=D.bind(0,Kd,p),ee=T.bind(0,Kd,m),F=B(C),N=F===k,H=N&&R,K=!N&&ee(_),A=!N&&Jf(F)&&F===K,U=A&&!!$(m),V=U?B():F,W=U?K:ee(),be=H?I:A?V:F,ce=P?D(Kd,u,w):k,se=H?be:ce,X=A?W:K,ie=E.activeElement,de=!N&&O.top===O&&ie===k,xe={W:k,Z:se,J:be,K:!N&&T(Kd,d,S),tt:X,nt:!N&&!r&&s&&s(t),ot:H?I:be,st:H?E:be,et:O,ct:E,rt:P,it:R,lt:h,ut:N,dt:A,ft:(Y,Ce)=>X$(be,N?hs:Ga,N?Ce:Y),_t:(Y,Ce,te)=>Ti(be,N?hs:Ga,N?Ce:Y,te)},oe=Ro(xe).reduce((Y,Ce)=>{const te=xe[Ce];return On(Y,te&&!Ca(te)?te:!1)},[]),ve=Y=>Y?v1(oe,Y)>-1:null,{W:he,Z:je,K:Ne,J:ge,tt:Oe,nt:at}=xe,Fe=[()=>{uo(je,hs),uo(je,Og),uo(he,Og),R&&(uo(I,hs),uo(I,Og))}],qe=P&&ve(je);let Pt=P?he:x1([Oe,ge,Ne,je,he].find(Y=>ve(Y)===!1));const St=H?he:Oe||ge;return[xe,()=>{Gr(je,hs,N?"viewport":"host"),Gr(Ne,N0,""),Gr(Oe,Y2,""),N||Gr(ge,Ga,"");const Y=R&&!N?pa(Ca(k),v_):qo;if(qe&&(F2(he,je),On(Fe,()=>{F2(je,he),Ks(je)})),Ko(St,Pt),Ko(je,Ne),Ko(Ne||je,!N&&ge),Ko(ge,Oe),On(Fe,()=>{Y(),uo(Ne,N0),uo(Oe,Y2),uo(ge,y_),uo(ge,b_),uo(ge,Ga),ve(Oe)&&Dg(Oe),ve(ge)&&Dg(ge),ve(Ne)&&Dg(Ne)}),r&&!N&&(Ti(ge,Ga,x_,!0),On(Fe,uo.bind(0,ge,Ga))),at&&(ez(ge,at),On(Fe,Ks.bind(0,at))),de){const Ce=Gr(ge,qd);Gr(ge,qd,"-1"),ge.focus();const te=()=>Ce?Gr(ge,qd,Ce):uo(ge,qd),fe=Rr(E,"pointerdown keydown",()=>{te(),fe()});On(Fe,[te,fe])}else ie&&ie.focus&&ie.focus();Pt=0},Js.bind(0,Fe)]},Vz=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=xo(),{ht:i}=r(),{vt:u}=o,d=(n||!s)&&u;return d&&Kr(n,{height:i?"":"100%"}),{gt:d,wt:d}}},Wz=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,ut:u}=e,[d,p]=ps({u:iz,o:W2()},W2.bind(0,o,"padding",""));return(m,h,v)=>{let[b,w]=p(v);const{I:S,V:C}=xo(),{bt:_}=n(),{gt:k,wt:P,yt:E}=m,[I,R]=h("paddingAbsolute");(k||w||!C&&P)&&([b,w]=d(v));const D=!u&&(R||E||w);if(D){const T=!I||!s&&!S,$=b.r+b.l,B=b.t+b.b,ee={marginRight:T&&!_?-$:0,marginBottom:T?-B:0,marginLeft:T&&_?-$:0,top:T?-b.t:0,right:T?_?-b.r:"auto":0,left:T?_?"auto":-b.l:0,width:T?`calc(100% + ${$}px)`:""},F={paddingTop:T?b.t:0,paddingRight:T?b.r:0,paddingBottom:T?b.b:0,paddingLeft:T?b.l:0};Kr(s||i,ee),Kr(i,F),r({K:b,St:!T,P:s?F:or({},ee,F)})}return{xt:D}}},{max:z0}=Math,qa=z0.bind(0,0),j_="visible",rS="hidden",Uz=42,Yd={u:c_,o:{w:0,h:0}},Gz={u:u_,o:{x:rS,y:rS}},qz=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:qa(e.w-t.w),h:qa(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},Qd=e=>e.indexOf(j_)===0,Kz=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,nt:u,ut:d,_t:p,it:m,et:h}=e,{k:v,V:b,I:w,A:S}=xo(),C=Gi()[I1],_=!d&&!w&&(S.x||S.y),k=m&&d,[P,E]=ps(Yd,rp.bind(0,i)),[I,R]=ps(Yd,np.bind(0,i)),[O,D]=ps(Yd),[T,$]=ps(Yd),[B]=ps(Gz),ee=(U,V)=>{if(Kr(i,{height:""}),V){const{St:W,K:re}=n(),{$t:be,D:ce}=U,se=rp(o),X=jf(o),ie=Kr(i,"boxSizing")==="content-box",de=W||ie?re.b+re.t:0,xe=!(S.x&&ie);Kr(i,{height:X.h+se.h+(be.x&&xe?ce.x:0)-de})}},F=(U,V)=>{const W=!w&&!U?Uz:0,re=(ve,he,je)=>{const Ne=Kr(i,ve),Oe=(V?V[ve]:Ne)==="scroll";return[Ne,Oe,Oe&&!w?he?W:je:0,he&&!!W]},[be,ce,se,X]=re("overflowX",S.x,v.x),[ie,de,xe,oe]=re("overflowY",S.y,v.y);return{Ct:{x:be,y:ie},$t:{x:ce,y:de},D:{x:se,y:xe},M:{x:X,y:oe}}},N=(U,V,W,re)=>{const be=(de,xe)=>{const oe=Qd(de),ve=xe&&oe&&de.replace(`${j_}-`,"")||"";return[xe&&!oe?de:"",Qd(ve)?"hidden":ve]},[ce,se]=be(W.x,V.x),[X,ie]=be(W.y,V.y);return re.overflowX=se&&X?se:ce,re.overflowY=ie&&ce?ie:X,F(U,re)},H=(U,V,W,re)=>{const{D:be,M:ce}=U,{x:se,y:X}=ce,{x:ie,y:de}=be,{P:xe}=n(),oe=V?"marginLeft":"marginRight",ve=V?"paddingLeft":"paddingRight",he=xe[oe],je=xe.marginBottom,Ne=xe[ve],ge=xe.paddingBottom;re.width=`calc(100% + ${de+-1*he}px)`,re[oe]=-de+he,re.marginBottom=-ie+je,W&&(re[ve]=Ne+(X?de:0),re.paddingBottom=ge+(se?ie:0))},[K,A]=C?C.H(_,b,i,u,n,F,H):[()=>_,()=>[qo]];return(U,V,W)=>{const{gt:re,Ot:be,wt:ce,xt:se,vt:X,yt:ie}=U,{ht:de,bt:xe}=n(),[oe,ve]=V("showNativeOverlaidScrollbars"),[he,je]=V("overflow"),Ne=oe&&S.x&&S.y,ge=!d&&!b&&(re||ce||be||ve||X),Oe=Qd(he.x),at=Qd(he.y),Fe=Oe||at;let qe=E(W),Pt=R(W),St=D(W),zn=$(W),Y;if(ve&&w&&p(x_,gz,!Ne),ge&&(Y=F(Ne),ee(Y,de)),re||se||ce||ie||ve){Fe&&p(Hl,Bl,!1);const[Re,Je]=A(Ne,xe,Y),[it,dt]=qe=P(W),[$t,hr]=Pt=I(W),un=jf(i);let xn=$t,xr=un;Re(),(hr||dt||ve)&&Je&&!Ne&&K(Je,$t,it,xe)&&(xr=jf(i),xn=np(i));const kn={w:qa(z0($t.w,xn.w)+it.w),h:qa(z0($t.h,xn.h)+it.h)},In={w:qa((k?h.innerWidth:xr.w+qa(un.w-$t.w))+it.w),h:qa((k?h.innerHeight+it.h:xr.h+qa(un.h-$t.h))+it.h)};zn=T(In),St=O(qz(kn,In),W)}const[Ce,te]=zn,[fe,Te]=St,[Ke,bt]=Pt,[Xt,ln]=qe,_n={x:fe.w>0,y:fe.h>0},pr=Oe&&at&&(_n.x||_n.y)||Oe&&_n.x&&!_n.y||at&&_n.y&&!_n.x;if(se||ie||ln||bt||te||Te||je||ve||ge){const Re={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},Je=N(Ne,_n,he,Re),it=K(Je,Ke,Xt,xe);d||H(Je,xe,it,Re),ge&&ee(Je,de),d?(Gr(o,y_,Re.overflowX),Gr(o,b_,Re.overflowY)):Kr(i,Re)}Ti(o,hs,Bl,pr),Ti(s,N0,vz,pr),d||Ti(i,Ga,Hl,Fe);const[cn,Un]=B(F(Ne).Ct);return r({Ct:cn,zt:{x:Ce.w,y:Ce.h},Tt:{x:fe.w,y:fe.h},Et:_n}),{It:Un,At:te,Lt:Te}}},oS=(e,t,n)=>{const r={},o=t||{},s=Ro(e).concat(Ro(o));return bn(s,i=>{const u=e[i],d=o[i];r[i]=!!(n||u||d)}),r},Yz=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:i,A:u,V:d}=xo(),p=!i&&(u.x||u.y),m=[Vz(e,t),Wz(e,t),Kz(e,t)];return(h,v,b)=>{const w=oS(or({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},v),{},b),S=p||!d,C=S&&ys(r),_=S&&fa(r);o("",op,!0);let k=w;return bn(m,P=>{k=oS(k,P(k,h,!!b)||{},b)}),ys(r,C),fa(r,_),o("",op),s||(ys(n,0),fa(n,0)),k}},Qz=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},i=u=>{if(n){const d=n.reduce((p,m)=>{if(m){const[h,v]=m,b=v&&h&&(u?u(h):o_(h,e));b&&b.length&&v&&ci(v)&&On(p,[b,v.trim()],!0)}return p},[]);bn(d,p=>bn(p[0],m=>{const h=p[1],v=r.get(m)||[];if(e.contains(m)){const w=Rr(m,h,S=>{o?(w(),r.delete(m)):t(S)});r.set(m,On(v,w))}else Js(v),r.delete(m)}))}};return n&&(r=new WeakMap,i()),[s,i]},sS=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:i,Dt:u,Mt:d,Rt:p,kt:m}=r||{},h=C1(()=>{o&&n(!0)},{v:33,g:99}),[v,b]=Qz(e,h,u),w=s||[],S=i||[],C=w.concat(S),_=(P,E)=>{const I=p||qo,R=m||qo,O=new Set,D=new Set;let T=!1,$=!1;if(bn(P,B=>{const{attributeName:ee,target:F,type:N,oldValue:H,addedNodes:K,removedNodes:A}=B,U=N==="attributes",V=N==="childList",W=e===F,re=U&&ci(ee)?Gr(F,ee):0,be=re!==0&&H!==re,ce=v1(S,ee)>-1&&be;if(t&&(V||!W)){const se=!U,X=U&&be,ie=X&&d&&ep(F,d),xe=(ie?!I(F,ee,H,re):se||X)&&!R(B,!!ie,e,r);bn(K,oe=>O.add(oe)),bn(A,oe=>O.add(oe)),$=$||xe}!t&&W&&be&&!I(F,ee,H,re)&&(D.add(ee),T=T||ce)}),O.size>0&&b(B=>Wi(O).reduce((ee,F)=>(On(ee,o_(B,F)),ep(F,B)?On(ee,F):ee),[])),t)return!E&&$&&n(!1),[!1];if(D.size>0||T){const B=[Wi(D),T];return!E&&n.apply(0,B),B}},k=new sz(P=>_(P));return k.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:C,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(v(),k.disconnect(),o=!1)},()=>{if(o){h.m();const P=k.takeRecords();return!y1(P)&&_(P,!0)}}]},Xd=3333333,Zd=e=>e&&(e.height||e.width),P_=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Gi()[Mz],{B:i}=xo(),d=s_(`<div class="${j1}"><div class="${bz}"></div></div>`)[0],p=d.firstChild,m=bu.bind(0,e),[h]=ps({o:void 0,_:!0,u:(S,C)=>!(!S||!Zd(S)&&Zd(C))}),v=S=>{const C=Is(S)&&S.length>0&&yu(S[0]),_=!C&&g1(S[0]);let k=!1,P=!1,E=!0;if(C){const[I,,R]=h(S.pop().contentRect),O=Zd(I),D=Zd(R);k=!R||!O,P=!D&&O,E=!k}else _?[,E]=S:P=S===!0;if(r&&E){const I=_?S[0]:bu(d);ys(d,I?i.n?-Xd:i.i?0:Xd:Xd),fa(d,Xd)}k||t({gt:!_,Yt:_?S:void 0,Vt:!!P})},b=[];let w=o?v:!1;return[()=>{Js(b),Ks(d)},()=>{if(Rl){const S=new Rl(v);S.observe(p),On(b,()=>{S.disconnect()})}else if(s){const[S,C]=s.O(p,v,o);w=S,On(b,C)}if(r){const[S]=ps({o:void 0},m);On(b,Rr(d,"scroll",C=>{const _=S(),[k,P,E]=_;P&&(w1(p,"ltr rtl"),k?pa(p,"rtl"):pa(p,"ltr"),v([!!k,P,E])),f_(C)}))}w&&(pa(d,yz),On(b,Rr(d,"animationstart",w,{C:!!Rl}))),(Rl||s)&&Ko(e,d)}]},Xz=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,Zz=(e,t)=>{let n;const r=Ai(xz),o=[],[s]=ps({o:!1}),i=(d,p)=>{if(d){const m=s(Xz(d)),[,h]=m;if(h)return!p&&t(m),[m]}},u=(d,p)=>{if(d&&d.length>0)return i(d.pop(),p)};return[()=>{Js(o),Ks(r)},()=>{if(B2)n=new B2(d=>u(d),{root:e}),n.observe(r),On(o,()=>{n.disconnect()});else{const d=()=>{const h=Ui(r);i(h)},[p,m]=P_(r,d);On(o,p),m(),d()}Ko(e,r)},()=>{if(n)return u(n.takeRecords(),!0)}]},aS=`[${hs}]`,Jz=`[${Ga}]`,Tg=["tabindex"],iS=["wrap","cols","rows"],Ag=["id","class","style","open"],eL=(e,t,n)=>{let r,o,s;const{Z:i,J:u,tt:d,rt:p,ut:m,ft:h,_t:v}=e,{V:b}=xo(),[w]=ps({u:c_,o:{w:0,h:0}},()=>{const N=h(Hl,Bl),H=h(Rg,""),K=H&&ys(u),A=H&&fa(u);v(Hl,Bl),v(Rg,""),v("",op,!0);const U=np(d),V=np(u),W=rp(u);return v(Hl,Bl,N),v(Rg,"",H),v("",op),ys(u,K),fa(u,A),{w:V.w+U.w+W.w,h:V.h+U.h+W.h}}),S=p?iS:Ag.concat(iS),C=C1(n,{v:()=>r,g:()=>o,p(N,H){const[K]=N,[A]=H;return[Ro(K).concat(Ro(A)).reduce((U,V)=>(U[V]=K[V]||A[V],U),{})]}}),_=N=>{bn(N||Tg,H=>{if(v1(Tg,H)>-1){const K=Gr(i,H);ci(K)?Gr(u,H,K):uo(u,H)}})},k=(N,H)=>{const[K,A]=N,U={vt:A};return t({ht:K}),!H&&n(U),U},P=({gt:N,Yt:H,Vt:K})=>{const A=!N||K?n:C;let U=!1;if(H){const[V,W]=H;U=W,t({bt:V})}A({gt:N,yt:U})},E=(N,H)=>{const[,K]=w(),A={wt:K};return K&&!H&&(N?n:C)(A),A},I=(N,H,K)=>{const A={Ot:H};return H?!K&&C(A):m||_(N),A},[R,O,D]=d||!b?Zz(i,k):[qo,qo,qo],[T,$]=m?[qo,qo]:P_(i,P,{Vt:!0,Bt:!0}),[B,ee]=sS(i,!1,I,{Pt:Ag,Ht:Ag.concat(Tg)}),F=m&&Rl&&new Rl(P.bind(0,{gt:!0}));return F&&F.observe(i),_(),[()=>{R(),T(),s&&s[0](),F&&F.disconnect(),B()},()=>{$(),O()},()=>{const N={},H=ee(),K=D(),A=s&&s[1]();return H&&or(N,I.apply(0,On(H,!0))),K&&or(N,k.apply(0,On(K,!0))),A&&or(N,E.apply(0,On(A,!0))),N},N=>{const[H]=N("update.ignoreMutation"),[K,A]=N("update.attributes"),[U,V]=N("update.elementEvents"),[W,re]=N("update.debounce"),be=V||A,ce=se=>Ps(H)&&H(se);if(be&&(s&&(s[1](),s[0]()),s=sS(d||u,!0,E,{Ht:S.concat(K||[]),Dt:U,Mt:aS,kt:(se,X)=>{const{target:ie,attributeName:de}=se;return(!X&&de&&!m?J$(ie,aS,Jz):!1)||!!Ol(ie,`.${bo}`)||!!ce(se)}})),re)if(C.m(),Is(W)){const se=W[0],X=W[1];r=ri(se)&&se,o=ri(X)&&X}else ri(W)?(r=W,o=!1):(r=!1,o=!1)}]},lS={x:0,y:0},tL=e=>({K:{t:0,r:0,b:0,l:0},St:!1,P:{marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},zt:lS,Tt:lS,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:bu(e.Z)}),nL=(e,t)=>{const n=$0(t,{}),[r,o,s]=k1(),[i,u,d]=Hz(e),p=k_(tL(i)),[m,h]=p,v=Yz(i,p),b=(P,E,I)=>{const O=Ro(P).some(D=>P[D])||!b1(E)||I;return O&&s("u",[P,E,I]),O},[w,S,C,_]=eL(i,h,P=>b(v(n,P),{},!1)),k=m.bind(0);return k.jt=P=>r("u",P),k.Nt=()=>{const{W:P,J:E}=i,I=ys(P),R=fa(P);S(),u(),ys(E,I),fa(E,R)},k.qt=i,[(P,E)=>{const I=$0(t,P,E);return _(I),b(v(I,C(),E),P,!!E)},k,()=>{o(),w(),d()}]},{round:cS}=Math,rL=e=>{const{width:t,height:n}=Qa(e),{w:r,h:o}=Ui(e);return{x:cS(t)/r||1,y:cS(n)/o||1}},oL=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:i}=e,{pointers:u}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(u||[]).includes(i)},sL=(e,t)=>Rr(e,"mousedown",Rr.bind(0,t,"click",f_,{C:!0,$:!0}),{$:!0}),uS="pointerup pointerleave pointercancel lostpointercapture",aL=(e,t,n,r,o,s,i)=>{const{B:u}=xo(),{Ft:d,Gt:p,Xt:m}=r,h=`scroll${i?"Left":"Top"}`,v=`client${i?"X":"Y"}`,b=i?"width":"height",w=i?"left":"top",S=i?"w":"h",C=i?"x":"y",_=(k,P)=>E=>{const{Tt:I}=s(),R=Ui(p)[S]-Ui(d)[S],D=P*E/R*I[C],$=bu(m)&&i?u.n||u.i?1:-1:1;o[h]=k+D*$};return Rr(p,"pointerdown",k=>{const P=Ol(k.target,`.${P1}`)===d,E=P?d:p;if(Ti(t,hs,K2,!0),oL(k,e,P)){const I=!P&&k.shiftKey,R=()=>Qa(d),O=()=>Qa(p),D=(V,W)=>(V||R())[w]-(W||O())[w],T=_(o[h]||0,1/rL(o)[C]),$=k[v],B=R(),ee=O(),F=B[b],N=D(B,ee)+F/2,H=$-ee[w],K=P?0:H-N,A=V=>{Js(U),E.releasePointerCapture(V.pointerId)},U=[Ti.bind(0,t,hs,K2),Rr(n,uS,A),Rr(n,"selectstart",V=>p_(V),{S:!1}),Rr(p,uS,A),Rr(p,"pointermove",V=>{const W=V[v]-$;(P||I)&&T(K+W)})];if(I)T(K);else if(!P){const V=Gi()[Dz];V&&On(U,V.O(T,D,K,F,H))}E.setPointerCapture(k.pointerId)}})},iL=(e,t)=>(n,r,o,s,i,u)=>{const{Xt:d}=n,[p,m]=Il(333),h=!!i.scrollBy;let v=!0;return Js.bind(0,[Rr(d,"pointerenter",()=>{r(X2,!0)}),Rr(d,"pointerleave pointercancel",()=>{r(X2)}),Rr(d,"wheel",b=>{const{deltaX:w,deltaY:S,deltaMode:C}=b;h&&v&&C===0&&Ca(d)===s&&i.scrollBy({left:w,top:S,behavior:"smooth"}),v=!1,r(eS,!0),p(()=>{v=!0,r(eS)}),p_(b)},{S:!1,$:!0}),sL(d,o),aL(e,s,o,n,i,t,u),m])},{min:L0,max:dS,abs:lL,round:cL}=Math,I_=(e,t,n,r)=>{if(r){const u=n?"x":"y",{Tt:d,zt:p}=r,m=p[u],h=d[u];return dS(0,L0(1,m/(m+h)))}const o=n?"w":"h",s=Ui(e)[o],i=Ui(t)[o];return dS(0,L0(1,s/i))},uL=(e,t,n,r,o,s)=>{const{B:i}=xo(),u=s?"x":"y",d=s?"Left":"Top",{Tt:p}=r,m=cL(p[u]),h=lL(n[`scroll${d}`]),v=s&&o,b=i.i?h:m-h,S=L0(1,(v?b:h)/m),C=I_(e,t,s);return 1/C*(1-C)*S},dL=(e,t,n)=>{const{N:r,L:o}=xo(),{scrollbars:s}=r(),{slot:i}=s,{ct:u,W:d,Z:p,J:m,lt:h,ot:v,it:b,ut:w}=t,{scrollbars:S}=h?{}:e,{slot:C}=S||{},_=C_([d,p,m],()=>w&&b?d:p,i,C),k=(K,A,U)=>{const V=U?pa:w1;bn(K,W=>{V(W.Xt,A)})},P=(K,A)=>{bn(K,U=>{const[V,W]=A(U);Kr(V,W)})},E=(K,A,U)=>{P(K,V=>{const{Ft:W,Gt:re}=V;return[W,{[U?"width":"height"]:`${(100*I_(W,re,U,A)).toFixed(3)}%`}]})},I=(K,A,U)=>{const V=U?"X":"Y";P(K,W=>{const{Ft:re,Gt:be,Xt:ce}=W,se=uL(re,be,v,A,bu(ce),U);return[re,{transform:se===se?`translate${V}(${(100*se).toFixed(3)}%)`:""}]})},R=[],O=[],D=[],T=(K,A,U)=>{const V=g1(U),W=V?U:!0,re=V?!U:!0;W&&k(O,K,A),re&&k(D,K,A)},$=K=>{E(O,K,!0),E(D,K)},B=K=>{I(O,K,!0),I(D,K)},ee=K=>{const A=K?_z:kz,U=K?O:D,V=y1(U)?Q2:"",W=Ai(`${bo} ${A} ${V}`),re=Ai(S_),be=Ai(P1),ce={Xt:W,Gt:re,Ft:be};return o||pa(W,Sz),Ko(W,re),Ko(re,be),On(U,ce),On(R,[Ks.bind(0,W),n(ce,T,u,p,v,K)]),ce},F=ee.bind(0,!0),N=ee.bind(0,!1),H=()=>{Ko(_,O[0].Xt),Ko(_,D[0].Xt),tp(()=>{T(Q2)},300)};return F(),N(),[{Ut:$,Wt:B,Zt:T,Jt:{Kt:O,Qt:F,tn:P.bind(0,O)},nn:{Kt:D,Qt:N,tn:P.bind(0,D)}},H,Js.bind(0,R)]},fL=(e,t,n,r)=>{let o,s,i,u,d,p=0;const m=k_({}),[h]=m,[v,b]=Il(),[w,S]=Il(),[C,_]=Il(100),[k,P]=Il(100),[E,I]=Il(()=>p),[R,O,D]=dL(e,n.qt,iL(t,n)),{Z:T,J:$,ot:B,st:ee,ut:F,it:N}=n.qt,{Jt:H,nn:K,Zt:A,Ut:U,Wt:V}=R,{tn:W}=H,{tn:re}=K,be=de=>{const{Xt:xe}=de,oe=F&&!N&&Ca(xe)===$&&xe;return[oe,{transform:oe?`translate(${ys(B)}px, ${fa(B)}px)`:""}]},ce=(de,xe)=>{if(I(),de)A(J2);else{const oe=()=>A(J2,!0);p>0&&!xe?E(oe):oe()}},se=()=>{u=s,u&&ce(!0)},X=[_,I,P,S,b,D,Rr(T,"pointerover",se,{C:!0}),Rr(T,"pointerenter",se),Rr(T,"pointerleave",()=>{u=!1,s&&ce(!1)}),Rr(T,"pointermove",()=>{o&&v(()=>{_(),ce(!0),k(()=>{o&&ce(!1)})})}),Rr(ee,"scroll",de=>{w(()=>{V(n()),i&&ce(!0),C(()=>{i&&!u&&ce(!1)})}),r(de),F&&W(be),F&&re(be)})],ie=h.bind(0);return ie.qt=R,ie.Nt=O,[(de,xe,oe)=>{const{At:ve,Lt:he,It:je,yt:Ne}=oe,{A:ge}=xo(),Oe=$0(t,de,xe),at=n(),{Tt:Fe,Ct:qe,bt:Pt}=at,[St,zn]=Oe("showNativeOverlaidScrollbars"),[Y,Ce]=Oe("scrollbars.theme"),[te,fe]=Oe("scrollbars.visibility"),[Te,Ke]=Oe("scrollbars.autoHide"),[bt]=Oe("scrollbars.autoHideDelay"),[Xt,ln]=Oe("scrollbars.dragScroll"),[_n,pr]=Oe("scrollbars.clickScroll"),cn=ve||he||Ne,Un=je||fe,Re=St&&ge.x&&ge.y,Je=(it,dt)=>{const $t=te==="visible"||te==="auto"&&it==="scroll";return A(jz,$t,dt),$t};if(p=bt,zn&&A(wz,Re),Ce&&(A(d),A(Y,!0),d=Y),Ke&&(o=Te==="move",s=Te==="leave",i=Te!=="never",ce(!i,!0)),ln&&A(Ez,Xt),pr&&A(Iz,_n),Un){const it=Je(qe.x,!0),dt=Je(qe.y,!1);A(Pz,!(it&&dt))}cn&&(U(at),V(at),A(Z2,!Fe.x,!0),A(Z2,!Fe.y,!1),A(Cz,Pt&&!N))},ie,Js.bind(0,X)]},E_=(e,t,n)=>{Ps(e)&&e(t||void 0,n||void 0)},Xa=(e,t,n)=>{const{F:r,N:o,Y:s,j:i}=xo(),u=Gi(),d=Jf(e),p=d?e:e.target,m=__(p);if(t&&!m){let h=!1;const v=F=>{const N=Gi()[Rz],H=N&&N.O;return H?H(F,!0):F},b=or({},r(),v(t)),[w,S,C]=k1(n),[_,k,P]=nL(e,b),[E,I,R]=fL(e,b,k,F=>C("scroll",[ee,F])),O=(F,N)=>_(F,!!N),D=O.bind(0,{},!0),T=s(D),$=i(D),B=F=>{Bz(p),T(),$(),R(),P(),h=!0,C("destroyed",[ee,!!F]),S()},ee={options(F,N){if(F){const H=N?r():{},K=h_(b,or(H,v(F)));b1(K)||(or(b,K),O(K))}return or({},b)},on:w,off:(F,N)=>{F&&N&&S(F,N)},state(){const{zt:F,Tt:N,Ct:H,Et:K,K:A,St:U,bt:V}=k();return or({},{overflowEdge:F,overflowAmount:N,overflowStyle:H,hasOverflow:K,padding:A,paddingAbsolute:U,directionRTL:V,destroyed:h})},elements(){const{W:F,Z:N,K:H,J:K,tt:A,ot:U,st:V}=k.qt,{Jt:W,nn:re}=I.qt,be=se=>{const{Ft:X,Gt:ie,Xt:de}=se;return{scrollbar:de,track:ie,handle:X}},ce=se=>{const{Kt:X,Qt:ie}=se,de=be(X[0]);return or({},de,{clone:()=>{const xe=be(ie());return E({},!0,{}),xe}})};return or({},{target:F,host:N,padding:H||K,viewport:K,content:A||K,scrollOffsetElement:U,scrollEventElement:V,scrollbarHorizontal:ce(W),scrollbarVertical:ce(re)})},update:F=>O({},F),destroy:B.bind(0)};return k.jt((F,N,H)=>{E(N,H,F)}),Fz(p,ee),bn(Ro(u),F=>E_(u[F],0,ee)),Lz(k.qt.it,o().cancel,!d&&e.cancel)?(B(!0),ee):(k.Nt(),I.Nt(),C("initialized",[ee]),k.jt((F,N,H)=>{const{gt:K,yt:A,vt:U,At:V,Lt:W,It:re,wt:be,Ot:ce}=F;C("updated",[ee,{updateHints:{sizeChanged:K,directionChanged:A,heightIntrinsicChanged:U,overflowEdgeChanged:V,overflowAmountChanged:W,overflowStyleChanged:re,contentMutation:be,hostMutation:ce},changedOptions:N,force:H}])}),ee.update(!0),ee)}return m};Xa.plugin=e=>{bn(Oz(e),t=>E_(t,Xa))};Xa.valid=e=>{const t=e&&e.elements,n=Ps(t)&&t();return M0(n)&&!!__(n.target)};Xa.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:i,U:u,N:d,q:p,F:m,G:h}=xo();return or({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:i,staticDefaultOptions:u,getDefaultInitialization:d,setDefaultInitialization:p,getDefaultOptions:m,setDefaultOptions:h})};const pL=()=>{if(typeof window>"u"){const p=()=>{};return[p,p]}let e,t;const n=window,r=typeof n.requestIdleCallback=="function",o=n.requestAnimationFrame,s=n.cancelAnimationFrame,i=r?n.requestIdleCallback:o,u=r?n.cancelIdleCallback:s,d=()=>{u(e),s(t)};return[(p,m)=>{d(),e=i(r?()=>{d(),t=o(p)}:p,typeof m=="object"?m:{timeout:2233})},d]},R1=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=f.useMemo(pL,[]),i=f.useRef(null),u=f.useRef(r),d=f.useRef(t),p=f.useRef(n);return f.useEffect(()=>{u.current=r},[r]),f.useEffect(()=>{const{current:m}=i;d.current=t,Xa.valid(m)&&m.options(t||{},!0)},[t]),f.useEffect(()=>{const{current:m}=i;p.current=n,Xa.valid(m)&&m.on(n||{},!0)},[n]),f.useEffect(()=>()=>{var m;s(),(m=i.current)==null||m.destroy()},[]),f.useMemo(()=>[m=>{const h=i.current;if(Xa.valid(h))return;const v=u.current,b=d.current||{},w=p.current||{},S=()=>i.current=Xa(m,b,w);v?o(S,v):S()},()=>i.current],[])},hL=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:i,...u}=e,d=n,p=f.useRef(null),m=f.useRef(null),[h,v]=R1({options:r,events:o,defer:s});return f.useEffect(()=>{const{current:b}=p,{current:w}=m;return b&&w&&h({target:b,elements:{viewport:w,content:w}}),()=>{var S;return(S=v())==null?void 0:S.destroy()}},[h,n]),f.useImperativeHandle(t,()=>({osInstance:v,getElement:()=>p.current}),[]),z.createElement(d,{"data-overlayscrollbars-initialize":"",ref:p,...u},z.createElement("div",{ref:m},i))},O_=f.forwardRef(hL),mL=rt((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...i}={},isChecked:u,...d}=e;return a.jsx(fr,{label:r,placement:o,hasArrow:s,...i,children:a.jsx(Rf,{ref:t,colorScheme:u?"accent":"base",...d,children:n})})}),Ut=f.memo(mL),gL="My Board",vL=()=>{const[e,{isLoading:t}]=n8(),n=f.useCallback(()=>{e(gL)},[e]);return a.jsx(Ut,{isLoading:t,"aria-label":"Add Board",onClick:n,size:"sm",sx:{px:4},children:"Add Board"})},yL=e=>{const{isOver:t,label:n="Drop"}=e,r=f.useRef(ei()),{colorMode:o}=Qr();return a.jsx(vo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsxs(G,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[a.jsx(G,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:Pe("base.700","base.900")(o),opacity:.7,borderRadius:"base",alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(G,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:1,borderWidth:3,borderColor:t?Pe("base.50","base.200")(o):Pe("base.100","base.500")(o),borderRadius:"base",borderStyle:"dashed",transitionProperty:"common",transitionDuration:"0.1s",alignItems:"center",justifyContent:"center"},children:a.jsx(tt,{sx:{fontSize:"2xl",fontWeight:600,transform:t?"scale(1.02)":"scale(1)",color:t?Pe("base.50","base.50")(o):Pe("base.100","base.200")(o),transitionProperty:"common",transitionDuration:"0.1s"},children:n})})]})},r.current)},sp=f.memo(yL),bL=e=>{const{dropLabel:t,data:n,disabled:r}=e,o=f.useRef(ei()),{isOver:s,setNodeRef:i,active:u}=wv({id:o.current,disabled:r,data:n});return a.jsx(Be,{ref:i,position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",pointerEvents:"none",children:a.jsx(Os,{children:Mf(n,u)&&a.jsx(sp,{isOver:s,label:t})})})},M1=f.memo(bL),Zi=e=>{const{icon:t=vc,boxSize:n=16}=e;return a.jsxs(G,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",flexDir:"column",gap:2,userSelect:"none",color:"base.700",_dark:{color:"base.500"},...e.sx},children:[a.jsx(oo,{as:t,boxSize:n,opacity:.7}),e.label&&a.jsx(tt,{textAlign:"center",children:e.label})]})},R_=e=>{const{droppableData:t,onClick:n,isSelected:r,icon:o,label:s,badgeCount:i}=e;return a.jsxs(G,{sx:{flexDir:"column",justifyContent:"space-between",alignItems:"center",cursor:"pointer",w:"full",h:"full",borderRadius:"base"},children:[a.jsxs(G,{onClick:n,sx:{position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",w:"full",aspectRatio:"1/1",overflow:"hidden",shadow:r?"selected.light":void 0,_dark:{shadow:r?"selected.dark":void 0},flexShrink:0},children:[a.jsx(Zi,{boxSize:8,icon:o,sx:{border:"2px solid var(--invokeai-colors-base-200)",_dark:{border:"2px solid var(--invokeai-colors-base-800)"}}}),a.jsx(G,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:i!==void 0&&a.jsx(Hi,{variant:"solid",children:i})}),a.jsx(M1,{data:t})]}),a.jsx(G,{sx:{h:"full",alignItems:"center",fontWeight:r?600:void 0,fontSize:"xs",color:r?"base.900":"base.700",_dark:{color:r?"base.50":"base.200"}},children:s})]})},xL=({isSelected:e})=>{const t=H4(),n=()=>{t(Cv("all"))},r={id:"all-images-board",actionType:"MOVE_BOARD",context:{boardId:null}};return a.jsx(R_,{droppableData:r,onClick:n,isSelected:e,icon:J5,label:"All Images"})},SL=we(Tt,e=>({count:e.gallery.batchImageNames.length})),wL=({isSelected:e})=>{const t=H4(),{count:n}=L(SL),r=f.useCallback(()=>{t(Cv("batch"))},[t]),o={id:"batch-board",actionType:"ADD_TO_BATCH"};return a.jsx(R_,{droppableData:o,onClick:r,isSelected:e,icon:u1,label:"Batch",badgeCount:n})};var au=globalThis&&globalThis.__assign||function(){return au=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},au.apply(this,arguments)};function M_(e){var t,n=f.useState(!1),r=n[0],o=n[1],s=f.useState(!1),i=s[0],u=s[1],d=f.useState(!1),p=d[0],m=d[1],h=f.useState([0,0]),v=h[0],b=h[1],w=f.useRef(null);f.useEffect(function(){if(r)setTimeout(function(){u(!0),setTimeout(function(){m(!0)})});else{m(!1);var C=setTimeout(function(){u(r)},1e3);return function(){return clearTimeout(C)}}},[r]),Y9("contextmenu",function(C){var _;!((_=w.current)===null||_===void 0)&&_.contains(C.target)||C.target===w.current?(C.preventDefault(),o(!0),b([C.pageX,C.pageY])):o(!1)});var S=f.useCallback(function(){var C,_;(_=(C=e.menuProps)===null||C===void 0?void 0:C.onClose)===null||_===void 0||_.call(C),o(!1)},[(t=e.menuProps)===null||t===void 0?void 0:t.onClose,o]);return f.createElement(f.Fragment,null,e.children(w),i&&f.createElement(Ef,au({},e.portalProps),f.createElement(ph,au({isOpen:p,gutter:0},e.menuProps,{onClose:S}),f.createElement(hh,au({"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:v[0],top:v[1],cursor:"default"}},e.menuButtonProps)),e.renderMenu())))}var D_={exports:{}},T_={};const jo=_v(r8),Fc=_v(o8),CL=_v(s8);(function(e){var t,n,r=gl&&gl.__generator||function(q,Z){var ue,ye,Se,Ye,ht={label:0,sent:function(){if(1&Se[0])throw Se[1];return Se[1]},trys:[],ops:[]};return Ye={next:zt(0),throw:zt(1),return:zt(2)},typeof Symbol=="function"&&(Ye[Symbol.iterator]=function(){return this}),Ye;function zt(lt){return function(He){return function(Ge){if(ue)throw new TypeError("Generator is already executing.");for(;ht;)try{if(ue=1,ye&&(Se=2&Ge[0]?ye.return:Ge[0]?ye.throw||((Se=ye.return)&&Se.call(ye),0):ye.next)&&!(Se=Se.call(ye,Ge[1])).done)return Se;switch(ye=0,Se&&(Ge=[2&Ge[0],Se.value]),Ge[0]){case 0:case 1:Se=Ge;break;case 4:return ht.label++,{value:Ge[1],done:!1};case 5:ht.label++,ye=Ge[1],Ge=[0];continue;case 7:Ge=ht.ops.pop(),ht.trys.pop();continue;default:if(!((Se=(Se=ht.trys).length>0&&Se[Se.length-1])||Ge[0]!==6&&Ge[0]!==2)){ht=0;continue}if(Ge[0]===3&&(!Se||Ge[1]>Se[0]&&Ge[1]<Se[3])){ht.label=Ge[1];break}if(Ge[0]===6&&ht.label<Se[1]){ht.label=Se[1],Se=Ge;break}if(Se&&ht.label<Se[2]){ht.label=Se[2],ht.ops.push(Ge);break}Se[2]&&ht.ops.pop(),ht.trys.pop();continue}Ge=Z.call(q,ht)}catch(_e){Ge=[6,_e],ye=0}finally{ue=Se=0}if(5&Ge[0])throw Ge[1];return{value:Ge[0]?Ge[1]:void 0,done:!0}}([lt,He])}}},o=gl&&gl.__spreadArray||function(q,Z){for(var ue=0,ye=Z.length,Se=q.length;ue<ye;ue++,Se++)q[Se]=Z[ue];return q},s=Object.create,i=Object.defineProperty,u=Object.defineProperties,d=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,v=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,S=function(q,Z,ue){return Z in q?i(q,Z,{enumerable:!0,configurable:!0,writable:!0,value:ue}):q[Z]=ue},C=function(q,Z){for(var ue in Z||(Z={}))b.call(Z,ue)&&S(q,ue,Z[ue]);if(h)for(var ye=0,Se=h(Z);ye<Se.length;ye++)w.call(Z,ue=Se[ye])&&S(q,ue,Z[ue]);return q},_=function(q,Z){return u(q,p(Z))},k=function(q){return i(q,"__esModule",{value:!0})},P=function(q,Z){var ue={};for(var ye in q)b.call(q,ye)&&Z.indexOf(ye)<0&&(ue[ye]=q[ye]);if(q!=null&&h)for(var Se=0,Ye=h(q);Se<Ye.length;Se++)Z.indexOf(ye=Ye[Se])<0&&w.call(q,ye)&&(ue[ye]=q[ye]);return ue},E=function(q){return function(Z,ue,ye){if(ue&&typeof ue=="object"||typeof ue=="function")for(var Se=function(zt){b.call(Z,zt)||zt==="default"||i(Z,zt,{get:function(){return ue[zt]},enumerable:!(ye=d(ue,zt))||ye.enumerable})},Ye=0,ht=m(ue);Ye<ht.length;Ye++)Se(ht[Ye]);return Z}(k(i(q!=null?s(v(q)):{},"default",q&&q.__esModule&&"default"in q?{get:function(){return q.default},enumerable:!0}:{value:q,enumerable:!0})),q)},I=function(q,Z,ue){return new Promise(function(ye,Se){var Ye=function(lt){try{zt(ue.next(lt))}catch(He){Se(He)}},ht=function(lt){try{zt(ue.throw(lt))}catch(He){Se(He)}},zt=function(lt){return lt.done?ye(lt.value):Promise.resolve(lt.value).then(Ye,ht)};zt((ue=ue.apply(q,Z)).next())})};k(e),function(q,Z){for(var ue in Z)i(q,ue,{get:Z[ue],enumerable:!0})}(e,{QueryStatus:function(){return t},buildCreateApi:function(){return it},copyWithStructuralSharing:function(){return D},coreModule:function(){return Ma},createApi:function(){return as},defaultSerializeQueryArgs:function(){return Un},fakeBaseQuery:function(){return dt},fetchBaseQuery:function(){return N},retry:function(){return U},setupListeners:function(){return X},skipSelector:function(){return bt},skipToken:function(){return Ke}}),(n=t||(t={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var R=function(q){return[].concat.apply([],q)},O=E(jo).isPlainObject;function D(q,Z){if(q===Z||!(O(q)&&O(Z)||Array.isArray(q)&&Array.isArray(Z)))return Z;for(var ue=Object.keys(Z),ye=Object.keys(q),Se=ue.length===ye.length,Ye=Array.isArray(Z)?[]:{},ht=0,zt=ue;ht<zt.length;ht++){var lt=zt[ht];Ye[lt]=D(q[lt],Z[lt]),Se&&(Se=q[lt]===Ye[lt])}return Se?q:Ye}var T=E(jo),$=function(){for(var q=[],Z=0;Z<arguments.length;Z++)q[Z]=arguments[Z];return fetch.apply(void 0,q)},B=function(q){return q.status>=200&&q.status<=299},ee=function(q){return/ion\/(vnd\.api\+)?json/.test(q.get("content-type")||"")};function F(q){if(!(0,T.isPlainObject)(q))return q;for(var Z=C({},q),ue=0,ye=Object.entries(Z);ue<ye.length;ue++){var Se=ye[ue];Se[1]===void 0&&delete Z[Se[0]]}return Z}function N(q){var Z=this;q===void 0&&(q={});var ue=q.baseUrl,ye=q.prepareHeaders,Se=ye===void 0?function(Bt){return Bt}:ye,Ye=q.fetchFn,ht=Ye===void 0?$:Ye,zt=q.paramsSerializer,lt=q.isJsonContentType,He=lt===void 0?ee:lt,Ge=q.jsonContentType,_e=Ge===void 0?"application/json":Ge,Ve=q.jsonReplacer,wt=q.timeout,_t=q.responseHandler,Rt=q.validateStatus,Ft=P(q,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&ht===$&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(Bt,Ie){return I(Z,null,function(){var mt,Mt,Dt,Lt,fn,Wt,Zt,Cn,jr,Gn,Ct,Sn,jn,qn,ir,Rn,Mn,nn,gn,wn,pn,hn,We,kt,vt,et,gt,At,ft,Xe,Ee,ke,Me,$e,Qe,It;return r(this,function(jt){switch(jt.label){case 0:return mt=Ie.signal,Mt=Ie.getState,Dt=Ie.extra,Lt=Ie.endpoint,fn=Ie.forced,Wt=Ie.type,jr=(Cn=typeof Bt=="string"?{url:Bt}:Bt).url,Ct=(Gn=Cn.headers)===void 0?new Headers(Ft.headers):Gn,jn=(Sn=Cn.params)===void 0?void 0:Sn,ir=(qn=Cn.responseHandler)===void 0?_t??"json":qn,Mn=(Rn=Cn.validateStatus)===void 0?Rt??B:Rn,gn=(nn=Cn.timeout)===void 0?wt:nn,wn=P(Cn,["url","headers","params","responseHandler","validateStatus","timeout"]),pn=C(_(C({},Ft),{signal:mt}),wn),Ct=new Headers(F(Ct)),hn=pn,[4,Se(Ct,{getState:Mt,extra:Dt,endpoint:Lt,forced:fn,type:Wt})];case 1:hn.headers=jt.sent()||Ct,We=function(ze){return typeof ze=="object"&&((0,T.isPlainObject)(ze)||Array.isArray(ze)||typeof ze.toJSON=="function")},!pn.headers.has("content-type")&&We(pn.body)&&pn.headers.set("content-type",_e),We(pn.body)&&He(pn.headers)&&(pn.body=JSON.stringify(pn.body,Ve)),jn&&(kt=~jr.indexOf("?")?"&":"?",vt=zt?zt(jn):new URLSearchParams(F(jn)),jr+=kt+vt),jr=function(ze,qt){if(!ze)return qt;if(!qt)return ze;if(function(on){return new RegExp("(^|:)//").test(on)}(qt))return qt;var mn=ze.endsWith("/")||!qt.startsWith("?")?"/":"";return ze=function(on){return on.replace(/\/$/,"")}(ze),""+ze+mn+function(on){return on.replace(/^\//,"")}(qt)}(ue,jr),et=new Request(jr,pn),gt=et.clone(),Zt={request:gt},ft=!1,Xe=gn&&setTimeout(function(){ft=!0,Ie.abort()},gn),jt.label=2;case 2:return jt.trys.push([2,4,5,6]),[4,ht(et)];case 3:return At=jt.sent(),[3,6];case 4:return Ee=jt.sent(),[2,{error:{status:ft?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ee)},meta:Zt}];case 5:return Xe&&clearTimeout(Xe),[7];case 6:ke=At.clone(),Zt.response=ke,$e="",jt.label=7;case 7:return jt.trys.push([7,9,,10]),[4,Promise.all([Gt(At,ir).then(function(ze){return Me=ze},function(ze){return Qe=ze}),ke.text().then(function(ze){return $e=ze},function(){})])];case 8:if(jt.sent(),Qe)throw Qe;return[3,10];case 9:return It=jt.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:At.status,data:$e,error:String(It)},meta:Zt}];case 10:return[2,Mn(At,Me)?{data:Me,meta:Zt}:{error:{status:At.status,data:Me},meta:Zt}]}})})};function Gt(Bt,Ie){return I(this,null,function(){var mt;return r(this,function(Mt){switch(Mt.label){case 0:return typeof Ie=="function"?[2,Ie(Bt)]:(Ie==="content-type"&&(Ie=He(Bt.headers)?"json":"text"),Ie!=="json"?[3,2]:[4,Bt.text()]);case 1:return[2,(mt=Mt.sent()).length?JSON.parse(mt):null];case 2:return[2,Bt.text()]}})})}}var H=function(q,Z){Z===void 0&&(Z=void 0),this.value=q,this.meta=Z};function K(q,Z){return q===void 0&&(q=0),Z===void 0&&(Z=5),I(this,null,function(){var ue,ye;return r(this,function(Se){switch(Se.label){case 0:return ue=Math.min(q,Z),ye=~~((Math.random()+.4)*(300<<ue)),[4,new Promise(function(Ye){return setTimeout(function(ht){return Ye(ht)},ye)})];case 1:return Se.sent(),[2]}})})}var A={},U=Object.assign(function(q,Z){return function(ue,ye,Se){return I(void 0,null,function(){var Ye,ht,zt,lt,He,Ge,_e;return r(this,function(Ve){switch(Ve.label){case 0:Ye=[5,(Z||A).maxRetries,(Se||A).maxRetries].filter(function(wt){return wt!==void 0}),ht=Ye.slice(-1)[0],zt=function(wt,_t,Rt){return Rt.attempt<=ht},lt=C(C({maxRetries:ht,backoff:K,retryCondition:zt},Z),Se),He=0,Ve.label=1;case 1:Ve.label=2;case 2:return Ve.trys.push([2,4,,6]),[4,q(ue,ye,Se)];case 3:if((Ge=Ve.sent()).error)throw new H(Ge);return[2,Ge];case 4:if(_e=Ve.sent(),He++,_e.throwImmediately){if(_e instanceof H)return[2,_e.value];throw _e}return _e instanceof H&&!lt.retryCondition(_e.value.error,ue,{attempt:He,baseQueryApi:ye,extraOptions:Se})?[2,_e.value]:[4,lt.backoff(He,lt.maxRetries)];case 5:return Ve.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(q){throw Object.assign(new H({error:q}),{throwImmediately:!0})}}),V=E(jo),W=(0,V.createAction)("__rtkq/focused"),re=(0,V.createAction)("__rtkq/unfocused"),be=(0,V.createAction)("__rtkq/online"),ce=(0,V.createAction)("__rtkq/offline"),se=!1;function X(q,Z){return Z?Z(q,{onFocus:W,onFocusLost:re,onOffline:ce,onOnline:be}):(ue=function(){return q(W())},ye=function(){return q(be())},Se=function(){return q(ce())},Ye=function(){window.document.visibilityState==="visible"?ue():q(re())},se||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",Ye,!1),window.addEventListener("focus",ue,!1),window.addEventListener("online",ye,!1),window.addEventListener("offline",Se,!1),se=!0),function(){window.removeEventListener("focus",ue),window.removeEventListener("visibilitychange",Ye),window.removeEventListener("online",ye),window.removeEventListener("offline",Se),se=!1});var ue,ye,Se,Ye}var ie,de,xe=E(jo);function oe(q){return q.type===ie.query}function ve(q,Z,ue,ye,Se,Ye){return typeof q=="function"?q(Z,ue,ye,Se).map(he).map(Ye):Array.isArray(q)?q.map(he).map(Ye):[]}function he(q){return typeof q=="string"?{type:q}:q}(de=ie||(ie={})).query="query",de.mutation="mutation";var je=E(jo);function Ne(q){return q!=null}var ge=Symbol("forceQueryFn"),Oe=function(q){return typeof q[ge]=="function"},at=E(jo),Fe=E(Fc),qe=E(jo);function Pt(q){return q}function St(q,Z,ue,ye){return ve(ue[q.meta.arg.endpointName][Z],(0,at.isFulfilled)(q)?q.payload:void 0,(0,at.isRejectedWithValue)(q)?q.payload:void 0,q.meta.arg.originalArgs,"baseQueryMeta"in q.meta?q.meta.baseQueryMeta:void 0,ye)}var zn=E(Fc),Y=E(Fc);function Ce(q,Z,ue){var ye=q[Z];ye&&ue(ye)}function te(q){var Z;return(Z="arg"in q?q.arg.fixedCacheKey:q.fixedCacheKey)!=null?Z:q.requestId}function fe(q,Z,ue){var ye=q[te(Z)];ye&&ue(ye)}var Te={},Ke=Symbol.for("RTKQ/skipToken"),bt=Ke,Xt={status:t.uninitialized},ln=(0,xe.createNextState)(Xt,function(){}),_n=(0,xe.createNextState)(Xt,function(){}),pr=E(jo),cn=WeakMap?new WeakMap:void 0,Un=function(q){var Z=q.endpointName,ue=q.queryArgs,ye="",Se=cn==null?void 0:cn.get(ue);if(typeof Se=="string")ye=Se;else{var Ye=JSON.stringify(ue,function(ht,zt){return(0,pr.isPlainObject)(zt)?Object.keys(zt).sort().reduce(function(lt,He){return lt[He]=zt[He],lt},{}):zt});(0,pr.isPlainObject)(ue)&&(cn==null||cn.set(ue,Ye)),ye=Ye}return Z+"("+ye+")"},Re=E(jo),Je=E(CL);function it(){for(var q=[],Z=0;Z<arguments.length;Z++)q[Z]=arguments[Z];return function(ue){var ye=(0,Je.defaultMemoize)(function(lt){var He,Ge;return(Ge=ue.extractRehydrationInfo)==null?void 0:Ge.call(ue,lt,{reducerPath:(He=ue.reducerPath)!=null?He:"api"})}),Se=_(C({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},ue),{extractRehydrationInfo:ye,serializeQueryArgs:function(lt){var He=Un;if("serializeQueryArgs"in lt.endpointDefinition){var Ge=lt.endpointDefinition.serializeQueryArgs;He=function(_e){var Ve=Ge(_e);return typeof Ve=="string"?Ve:Un(_(C({},_e),{queryArgs:Ve}))}}else ue.serializeQueryArgs&&(He=ue.serializeQueryArgs);return He(lt)},tagTypes:o([],ue.tagTypes||[])}),Ye={endpointDefinitions:{},batch:function(lt){lt()},apiUid:(0,Re.nanoid)(),extractRehydrationInfo:ye,hasRehydrationInfo:(0,Je.defaultMemoize)(function(lt){return ye(lt)!=null})},ht={injectEndpoints:function(lt){for(var He=lt.endpoints({query:function(Gt){return _(C({},Gt),{type:ie.query})},mutation:function(Gt){return _(C({},Gt),{type:ie.mutation})}}),Ge=0,_e=Object.entries(He);Ge<_e.length;Ge++){var Ve=_e[Ge],wt=Ve[0],_t=Ve[1];if(lt.overrideExisting||!(wt in Ye.endpointDefinitions)){Ye.endpointDefinitions[wt]=_t;for(var Rt=0,Ft=zt;Rt<Ft.length;Rt++)Ft[Rt].injectEndpoint(wt,_t)}}return ht},enhanceEndpoints:function(lt){var He=lt.addTagTypes,Ge=lt.endpoints;if(He)for(var _e=0,Ve=He;_e<Ve.length;_e++){var wt=Ve[_e];Se.tagTypes.includes(wt)||Se.tagTypes.push(wt)}if(Ge)for(var _t=0,Rt=Object.entries(Ge);_t<Rt.length;_t++){var Ft=Rt[_t],Gt=Ft[0],Bt=Ft[1];typeof Bt=="function"?Bt(Ye.endpointDefinitions[Gt]):Object.assign(Ye.endpointDefinitions[Gt]||{},Bt)}return ht}},zt=q.map(function(lt){return lt.init(ht,Se,Ye)});return ht.injectEndpoints({endpoints:ue.endpoints})}}function dt(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var $t,hr=E(jo),un=function(q){var Z=q.reducerPath,ue=q.api,ye=q.context,Se=q.internalState,Ye=ue.internalActions,ht=Ye.removeQueryResult,zt=Ye.unsubscribeQueryResult;function lt(_e){var Ve=Se.currentSubscriptions[_e];return!!Ve&&!function(wt){for(var _t in wt)return!1;return!0}(Ve)}var He={};function Ge(_e,Ve,wt,_t){var Rt,Ft=ye.endpointDefinitions[Ve],Gt=(Rt=Ft==null?void 0:Ft.keepUnusedDataFor)!=null?Rt:_t.keepUnusedDataFor;if(Gt!==1/0){var Bt=Math.max(0,Math.min(Gt,2147482647e-3));if(!lt(_e)){var Ie=He[_e];Ie&&clearTimeout(Ie),He[_e]=setTimeout(function(){lt(_e)||wt.dispatch(ht({queryCacheKey:_e})),delete He[_e]},1e3*Bt)}}}return function(_e,Ve,wt){var _t;if(zt.match(_e)){var Rt=Ve.getState()[Z];Ge(fn=_e.payload.queryCacheKey,(_t=Rt.queries[fn])==null?void 0:_t.endpointName,Ve,Rt.config)}if(ue.util.resetApiState.match(_e))for(var Ft=0,Gt=Object.entries(He);Ft<Gt.length;Ft++){var Bt=Gt[Ft],Ie=Bt[0],mt=Bt[1];mt&&clearTimeout(mt),delete He[Ie]}if(ye.hasRehydrationInfo(_e)){Rt=Ve.getState()[Z];for(var Mt=ye.extractRehydrationInfo(_e).queries,Dt=0,Lt=Object.entries(Mt);Dt<Lt.length;Dt++){var fn,Wt=Lt[Dt],Zt=Wt[1];Ge(fn=Wt[0],Zt==null?void 0:Zt.endpointName,Ve,Rt.config)}}}},xn=E(jo),xr=function(q){var Z=q.reducerPath,ue=q.context,ye=q.context.endpointDefinitions,Se=q.mutationThunk,Ye=q.api,ht=q.assertTagType,zt=q.refetchQuery,lt=Ye.internalActions.removeQueryResult,He=(0,xn.isAnyOf)((0,xn.isFulfilled)(Se),(0,xn.isRejectedWithValue)(Se));function Ge(_e,Ve){var wt=Ve.getState(),_t=wt[Z],Rt=Ye.util.selectInvalidatedBy(wt,_e);ue.batch(function(){for(var Ft,Gt=0,Bt=Array.from(Rt.values());Gt<Bt.length;Gt++){var Ie=Bt[Gt].queryCacheKey,mt=_t.queries[Ie],Mt=(Ft=_t.subscriptions[Ie])!=null?Ft:{};mt&&(Object.keys(Mt).length===0?Ve.dispatch(lt({queryCacheKey:Ie})):mt.status!==t.uninitialized&&Ve.dispatch(zt(mt,Ie)))}})}return function(_e,Ve){He(_e)&&Ge(St(_e,"invalidatesTags",ye,ht),Ve),Ye.util.invalidateTags.match(_e)&&Ge(ve(_e.payload,void 0,void 0,void 0,void 0,ht),Ve)}},kn=function(q){var Z=q.reducerPath,ue=q.queryThunk,ye=q.api,Se=q.refetchQuery,Ye=q.internalState,ht={};function zt(_e,Ve){var wt=_e.queryCacheKey,_t=Ve.getState()[Z].queries[wt];if(_t&&_t.status!==t.uninitialized){var Rt=Ge(Ye.currentSubscriptions[wt]);if(Number.isFinite(Rt)){var Ft=ht[wt];Ft!=null&&Ft.timeout&&(clearTimeout(Ft.timeout),Ft.timeout=void 0);var Gt=Date.now()+Rt,Bt=ht[wt]={nextPollTimestamp:Gt,pollingInterval:Rt,timeout:setTimeout(function(){Bt.timeout=void 0,Ve.dispatch(Se(_t,wt))},Rt)}}}}function lt(_e,Ve){var wt=_e.queryCacheKey,_t=Ve.getState()[Z].queries[wt];if(_t&&_t.status!==t.uninitialized){var Rt=Ge(Ye.currentSubscriptions[wt]);if(Number.isFinite(Rt)){var Ft=ht[wt],Gt=Date.now()+Rt;(!Ft||Gt<Ft.nextPollTimestamp)&&zt({queryCacheKey:wt},Ve)}else He(wt)}}function He(_e){var Ve=ht[_e];Ve!=null&&Ve.timeout&&clearTimeout(Ve.timeout),delete ht[_e]}function Ge(_e){_e===void 0&&(_e={});var Ve=Number.POSITIVE_INFINITY;for(var wt in _e)_e[wt].pollingInterval&&(Ve=Math.min(_e[wt].pollingInterval,Ve));return Ve}return function(_e,Ve){(ye.internalActions.updateSubscriptionOptions.match(_e)||ye.internalActions.unsubscribeQueryResult.match(_e))&<(_e.payload,Ve),(ue.pending.match(_e)||ue.rejected.match(_e)&&_e.meta.condition)&<(_e.meta.arg,Ve),(ue.fulfilled.match(_e)||ue.rejected.match(_e)&&!_e.meta.condition)&&zt(_e.meta.arg,Ve),ye.util.resetApiState.match(_e)&&function(){for(var wt=0,_t=Object.keys(ht);wt<_t.length;wt++)He(_t[wt])}()}},In=E(jo),os=new Error("Promise never resolved before cacheEntryRemoved."),dn=function(q){var Z=q.api,ue=q.reducerPath,ye=q.context,Se=q.queryThunk,Ye=q.mutationThunk,ht=(0,In.isAsyncThunkAction)(Se),zt=(0,In.isAsyncThunkAction)(Ye),lt=(0,In.isFulfilled)(Se,Ye),He={};function Ge(_e,Ve,wt,_t,Rt){var Ft=ye.endpointDefinitions[_e],Gt=Ft==null?void 0:Ft.onCacheEntryAdded;if(Gt){var Bt={},Ie=new Promise(function(Wt){Bt.cacheEntryRemoved=Wt}),mt=Promise.race([new Promise(function(Wt){Bt.valueResolved=Wt}),Ie.then(function(){throw os})]);mt.catch(function(){}),He[wt]=Bt;var Mt=Z.endpoints[_e].select(Ft.type===ie.query?Ve:wt),Dt=_t.dispatch(function(Wt,Zt,Cn){return Cn}),Lt=_(C({},_t),{getCacheEntry:function(){return Mt(_t.getState())},requestId:Rt,extra:Dt,updateCachedData:Ft.type===ie.query?function(Wt){return _t.dispatch(Z.util.updateQueryData(_e,Ve,Wt))}:void 0,cacheDataLoaded:mt,cacheEntryRemoved:Ie}),fn=Gt(Ve,Lt);Promise.resolve(fn).catch(function(Wt){if(Wt!==os)throw Wt})}}return function(_e,Ve,wt){var _t=function(Mt){return ht(Mt)?Mt.meta.arg.queryCacheKey:zt(Mt)?Mt.meta.requestId:Z.internalActions.removeQueryResult.match(Mt)?Mt.payload.queryCacheKey:Z.internalActions.removeMutationResult.match(Mt)?te(Mt.payload):""}(_e);if(Se.pending.match(_e)){var Rt=wt[ue].queries[_t],Ft=Ve.getState()[ue].queries[_t];!Rt&&Ft&&Ge(_e.meta.arg.endpointName,_e.meta.arg.originalArgs,_t,Ve,_e.meta.requestId)}else if(Ye.pending.match(_e))(Ft=Ve.getState()[ue].mutations[_t])&&Ge(_e.meta.arg.endpointName,_e.meta.arg.originalArgs,_t,Ve,_e.meta.requestId);else if(lt(_e))(mt=He[_t])!=null&&mt.valueResolved&&(mt.valueResolved({data:_e.payload,meta:_e.meta.baseQueryMeta}),delete mt.valueResolved);else if(Z.internalActions.removeQueryResult.match(_e)||Z.internalActions.removeMutationResult.match(_e))(mt=He[_t])&&(delete He[_t],mt.cacheEntryRemoved());else if(Z.util.resetApiState.match(_e))for(var Gt=0,Bt=Object.entries(He);Gt<Bt.length;Gt++){var Ie=Bt[Gt],mt=Ie[1];delete He[Ie[0]],mt.cacheEntryRemoved()}}},Mo=E(jo),Do=function(q){var Z=q.api,ue=q.context,ye=q.queryThunk,Se=q.mutationThunk,Ye=(0,Mo.isPending)(ye,Se),ht=(0,Mo.isRejected)(ye,Se),zt=(0,Mo.isFulfilled)(ye,Se),lt={};return function(He,Ge){var _e,Ve,wt;if(Ye(He)){var _t=He.meta,Rt=_t.requestId,Ft=_t.arg,Gt=Ft.endpointName,Bt=Ft.originalArgs,Ie=ue.endpointDefinitions[Gt],mt=Ie==null?void 0:Ie.onQueryStarted;if(mt){var Mt={},Dt=new Promise(function(Gn,Ct){Mt.resolve=Gn,Mt.reject=Ct});Dt.catch(function(){}),lt[Rt]=Mt;var Lt=Z.endpoints[Gt].select(Ie.type===ie.query?Bt:Rt),fn=Ge.dispatch(function(Gn,Ct,Sn){return Sn}),Wt=_(C({},Ge),{getCacheEntry:function(){return Lt(Ge.getState())},requestId:Rt,extra:fn,updateCachedData:Ie.type===ie.query?function(Gn){return Ge.dispatch(Z.util.updateQueryData(Gt,Bt,Gn))}:void 0,queryFulfilled:Dt});mt(Bt,Wt)}}else if(zt(He)){var Zt=He.meta,Cn=Zt.baseQueryMeta;(_e=lt[Rt=Zt.requestId])==null||_e.resolve({data:He.payload,meta:Cn}),delete lt[Rt]}else if(ht(He)){var jr=He.meta;Cn=jr.baseQueryMeta,(wt=lt[Rt=jr.requestId])==null||wt.reject({error:(Ve=He.payload)!=null?Ve:He.error,isUnhandledError:!jr.rejectedWithValue,meta:Cn}),delete lt[Rt]}}},Nn=function(q){var Z=q.api,ue=q.context.apiUid;return function(ye,Se){Z.util.resetApiState.match(ye)&&Se.dispatch(Z.internalActions.middlewareRegistered(ue))}},ss=E(Fc),Ra=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof gl<"u"?gl:globalThis):function(q){return($t||($t=Promise.resolve())).then(q).catch(function(Z){return setTimeout(function(){throw Z},0)})};function kr(q){for(var Z=[],ue=1;ue<arguments.length;ue++)Z[ue-1]=arguments[ue];Object.assign.apply(Object,o([q],Z))}var To=E(Fc),ta=Symbol(),Ma=function(){return{name:ta,init:function(q,Z,ue){var ye=Z.baseQuery,Se=Z.reducerPath,Ye=Z.serializeQueryArgs,ht=Z.keepUnusedDataFor,zt=Z.refetchOnMountOrArgChange,lt=Z.refetchOnFocus,He=Z.refetchOnReconnect;(0,To.enablePatches)();var Ge=function(Ct){return Ct};Object.assign(q,{reducerPath:Se,endpoints:{},internalActions:{onOnline:be,onOffline:ce,onFocus:W,onFocusLost:re},util:{}});var _e=function(Ct){var Sn=this,jn=Ct.reducerPath,qn=Ct.baseQuery,ir=Ct.context.endpointDefinitions,Rn=Ct.serializeQueryArgs,Mn=Ct.api,nn=function(We,kt){return I(Sn,[We,kt],function(vt,et){var gt,At,ft,Xe,Ee,ke,Me,$e,Qe,It,jt,ze,qt,mn=et.signal,on=et.abort,lr=et.rejectWithValue,Ln=et.fulfillWithValue,an=et.dispatch,$n=et.getState,Jr=et.extra;return r(this,function(rn){switch(rn.label){case 0:gt=ir[vt.endpointName],rn.label=1;case 1:return rn.trys.push([1,8,,13]),At=Pt,ft=void 0,Xe={signal:mn,abort:on,dispatch:an,getState:$n,extra:Jr,endpoint:vt.endpointName,type:vt.type,forced:vt.type==="query"?gn(vt,$n()):void 0},(Ee=vt.type==="query"?vt[ge]:void 0)?(ft=Ee(),[3,6]):[3,2];case 2:return gt.query?[4,qn(gt.query(vt.originalArgs),Xe,gt.extraOptions)]:[3,4];case 3:return ft=rn.sent(),gt.transformResponse&&(At=gt.transformResponse),[3,6];case 4:return[4,gt.queryFn(vt.originalArgs,Xe,gt.extraOptions,function(Dn){return qn(Dn,Xe,gt.extraOptions)})];case 5:ft=rn.sent(),rn.label=6;case 6:if(ft.error)throw new H(ft.error,ft.meta);return ke=Ln,[4,At(ft.data,ft.meta,vt.originalArgs)];case 7:return[2,ke.apply(void 0,[rn.sent(),(ze={fulfilledTimeStamp:Date.now(),baseQueryMeta:ft.meta},ze[qe.SHOULD_AUTOBATCH]=!0,ze)])];case 8:if(Me=rn.sent(),!(($e=Me)instanceof H))return[3,12];Qe=Pt,gt.query&>.transformErrorResponse&&(Qe=gt.transformErrorResponse),rn.label=9;case 9:return rn.trys.push([9,11,,12]),It=lr,[4,Qe($e.value,$e.meta,vt.originalArgs)];case 10:return[2,It.apply(void 0,[rn.sent(),(qt={baseQueryMeta:$e.meta},qt[qe.SHOULD_AUTOBATCH]=!0,qt)])];case 11:return jt=rn.sent(),$e=jt,[3,12];case 12:throw console.error($e),$e;case 13:return[2]}})})};function gn(We,kt){var vt,et,gt,At,ft=(et=(vt=kt[jn])==null?void 0:vt.queries)==null?void 0:et[We.queryCacheKey],Xe=(gt=kt[jn])==null?void 0:gt.config.refetchOnMountOrArgChange,Ee=ft==null?void 0:ft.fulfilledTimeStamp,ke=(At=We.forceRefetch)!=null?At:We.subscribe&&Xe;return!!ke&&(ke===!0||(Number(new Date)-Number(Ee))/1e3>=ke)}var wn=(0,qe.createAsyncThunk)(jn+"/executeQuery",nn,{getPendingMeta:function(){var We;return(We={startedTimeStamp:Date.now()})[qe.SHOULD_AUTOBATCH]=!0,We},condition:function(We,kt){var vt,et,gt,At=(0,kt.getState)(),ft=(et=(vt=At[jn])==null?void 0:vt.queries)==null?void 0:et[We.queryCacheKey],Xe=ft==null?void 0:ft.fulfilledTimeStamp,Ee=We.originalArgs,ke=ft==null?void 0:ft.originalArgs,Me=ir[We.endpointName];return!(!Oe(We)&&((ft==null?void 0:ft.status)==="pending"||!gn(We,At)&&(!oe(Me)||!((gt=Me==null?void 0:Me.forceRefetch)!=null&>.call(Me,{currentArg:Ee,previousArg:ke,endpointState:ft,state:At})))&&Xe))},dispatchConditionRejection:!0}),pn=(0,qe.createAsyncThunk)(jn+"/executeMutation",nn,{getPendingMeta:function(){var We;return(We={startedTimeStamp:Date.now()})[qe.SHOULD_AUTOBATCH]=!0,We}});function hn(We){return function(kt){var vt,et;return((et=(vt=kt==null?void 0:kt.meta)==null?void 0:vt.arg)==null?void 0:et.endpointName)===We}}return{queryThunk:wn,mutationThunk:pn,prefetch:function(We,kt,vt){return function(et,gt){var At=function(Me){return"force"in Me}(vt)&&vt.force,ft=function(Me){return"ifOlderThan"in Me}(vt)&&vt.ifOlderThan,Xe=function(Me){return Me===void 0&&(Me=!0),Mn.endpoints[We].initiate(kt,{forceRefetch:Me})},Ee=Mn.endpoints[We].select(kt)(gt());if(At)et(Xe());else if(ft){var ke=Ee==null?void 0:Ee.fulfilledTimeStamp;if(!ke)return void et(Xe());(Number(new Date)-Number(new Date(ke)))/1e3>=ft&&et(Xe())}else et(Xe(!1))}},updateQueryData:function(We,kt,vt){return function(et,gt){var At,ft,Xe=Mn.endpoints[We].select(kt)(gt()),Ee={patches:[],inversePatches:[],undo:function(){return et(Mn.util.patchQueryData(We,kt,Ee.inversePatches))}};if(Xe.status===t.uninitialized)return Ee;if("data"in Xe)if((0,Fe.isDraftable)(Xe.data)){var ke=(0,Fe.produceWithPatches)(Xe.data,vt),Me=ke[2];(At=Ee.patches).push.apply(At,ke[1]),(ft=Ee.inversePatches).push.apply(ft,Me)}else{var $e=vt(Xe.data);Ee.patches.push({op:"replace",path:[],value:$e}),Ee.inversePatches.push({op:"replace",path:[],value:Xe.data})}return et(Mn.util.patchQueryData(We,kt,Ee.patches)),Ee}},upsertQueryData:function(We,kt,vt){return function(et){var gt;return et(Mn.endpoints[We].initiate(kt,((gt={subscribe:!1,forceRefetch:!0})[ge]=function(){return{data:vt}},gt)))}},patchQueryData:function(We,kt,vt){return function(et){et(Mn.internalActions.queryResultPatched({queryCacheKey:Rn({queryArgs:kt,endpointDefinition:ir[We],endpointName:We}),patches:vt}))}},buildMatchThunkActions:function(We,kt){return{matchPending:(0,at.isAllOf)((0,at.isPending)(We),hn(kt)),matchFulfilled:(0,at.isAllOf)((0,at.isFulfilled)(We),hn(kt)),matchRejected:(0,at.isAllOf)((0,at.isRejected)(We),hn(kt))}}}}({baseQuery:ye,reducerPath:Se,context:ue,api:q,serializeQueryArgs:Ye}),Ve=_e.queryThunk,wt=_e.mutationThunk,_t=_e.patchQueryData,Rt=_e.updateQueryData,Ft=_e.upsertQueryData,Gt=_e.prefetch,Bt=_e.buildMatchThunkActions,Ie=function(Ct){var Sn=Ct.reducerPath,jn=Ct.queryThunk,qn=Ct.mutationThunk,ir=Ct.context,Rn=ir.endpointDefinitions,Mn=ir.apiUid,nn=ir.extractRehydrationInfo,gn=ir.hasRehydrationInfo,wn=Ct.assertTagType,pn=Ct.config,hn=(0,je.createAction)(Sn+"/resetApiState"),We=(0,je.createSlice)({name:Sn+"/queries",initialState:Te,reducers:{removeQueryResult:{reducer:function(Xe,Ee){delete Xe[Ee.payload.queryCacheKey]},prepare:(0,je.prepareAutoBatched)()},queryResultPatched:function(Xe,Ee){var ke=Ee.payload,Me=ke.patches;Ce(Xe,ke.queryCacheKey,function($e){$e.data=(0,Y.applyPatches)($e.data,Me.concat())})}},extraReducers:function(Xe){Xe.addCase(jn.pending,function(Ee,ke){var Me,$e=ke.meta,Qe=ke.meta.arg,It=Oe(Qe);(Qe.subscribe||It)&&(Ee[Me=Qe.queryCacheKey]!=null||(Ee[Me]={status:t.uninitialized,endpointName:Qe.endpointName})),Ce(Ee,Qe.queryCacheKey,function(jt){jt.status=t.pending,jt.requestId=It&&jt.requestId?jt.requestId:$e.requestId,Qe.originalArgs!==void 0&&(jt.originalArgs=Qe.originalArgs),jt.startedTimeStamp=$e.startedTimeStamp})}).addCase(jn.fulfilled,function(Ee,ke){var Me=ke.meta,$e=ke.payload;Ce(Ee,Me.arg.queryCacheKey,function(Qe){var It;if(Qe.requestId===Me.requestId||Oe(Me.arg)){var jt=Rn[Me.arg.endpointName].merge;if(Qe.status=t.fulfilled,jt)if(Qe.data!==void 0){var ze=Me.fulfilledTimeStamp,qt=Me.arg,mn=Me.baseQueryMeta,on=Me.requestId,lr=(0,je.createNextState)(Qe.data,function(Ln){return jt(Ln,$e,{arg:qt.originalArgs,baseQueryMeta:mn,fulfilledTimeStamp:ze,requestId:on})});Qe.data=lr}else Qe.data=$e;else Qe.data=(It=Rn[Me.arg.endpointName].structuralSharing)==null||It?D((0,zn.isDraft)(Qe.data)?(0,Y.original)(Qe.data):Qe.data,$e):$e;delete Qe.error,Qe.fulfilledTimeStamp=Me.fulfilledTimeStamp}})}).addCase(jn.rejected,function(Ee,ke){var Me=ke.meta,$e=Me.condition,Qe=Me.requestId,It=ke.error,jt=ke.payload;Ce(Ee,Me.arg.queryCacheKey,function(ze){if(!$e){if(ze.requestId!==Qe)return;ze.status=t.rejected,ze.error=jt??It}})}).addMatcher(gn,function(Ee,ke){for(var Me=nn(ke).queries,$e=0,Qe=Object.entries(Me);$e<Qe.length;$e++){var It=Qe[$e],jt=It[1];(jt==null?void 0:jt.status)!==t.fulfilled&&(jt==null?void 0:jt.status)!==t.rejected||(Ee[It[0]]=jt)}})}}),kt=(0,je.createSlice)({name:Sn+"/mutations",initialState:Te,reducers:{removeMutationResult:{reducer:function(Xe,Ee){var ke=te(Ee.payload);ke in Xe&&delete Xe[ke]},prepare:(0,je.prepareAutoBatched)()}},extraReducers:function(Xe){Xe.addCase(qn.pending,function(Ee,ke){var Me=ke.meta,$e=Me.requestId,Qe=Me.arg,It=Me.startedTimeStamp;Qe.track&&(Ee[te(ke.meta)]={requestId:$e,status:t.pending,endpointName:Qe.endpointName,startedTimeStamp:It})}).addCase(qn.fulfilled,function(Ee,ke){var Me=ke.payload,$e=ke.meta;$e.arg.track&&fe(Ee,$e,function(Qe){Qe.requestId===$e.requestId&&(Qe.status=t.fulfilled,Qe.data=Me,Qe.fulfilledTimeStamp=$e.fulfilledTimeStamp)})}).addCase(qn.rejected,function(Ee,ke){var Me=ke.payload,$e=ke.error,Qe=ke.meta;Qe.arg.track&&fe(Ee,Qe,function(It){It.requestId===Qe.requestId&&(It.status=t.rejected,It.error=Me??$e)})}).addMatcher(gn,function(Ee,ke){for(var Me=nn(ke).mutations,$e=0,Qe=Object.entries(Me);$e<Qe.length;$e++){var It=Qe[$e],jt=It[0],ze=It[1];(ze==null?void 0:ze.status)!==t.fulfilled&&(ze==null?void 0:ze.status)!==t.rejected||jt===(ze==null?void 0:ze.requestId)||(Ee[jt]=ze)}})}}),vt=(0,je.createSlice)({name:Sn+"/invalidation",initialState:Te,reducers:{},extraReducers:function(Xe){Xe.addCase(We.actions.removeQueryResult,function(Ee,ke){for(var Me=ke.payload.queryCacheKey,$e=0,Qe=Object.values(Ee);$e<Qe.length;$e++)for(var It=0,jt=Object.values(Qe[$e]);It<jt.length;It++){var ze=jt[It],qt=ze.indexOf(Me);qt!==-1&&ze.splice(qt,1)}}).addMatcher(gn,function(Ee,ke){for(var Me,$e,Qe,It,jt=nn(ke).provided,ze=0,qt=Object.entries(jt);ze<qt.length;ze++)for(var mn=qt[ze],on=mn[0],lr=0,Ln=Object.entries(mn[1]);lr<Ln.length;lr++)for(var an=Ln[lr],$n=an[0],Jr=an[1],rn=(It=($e=(Me=Ee[on])!=null?Me:Ee[on]={})[Qe=$n||"__internal_without_id"])!=null?It:$e[Qe]=[],Dn=0,Nr=Jr;Dn<Nr.length;Dn++){var Pr=Nr[Dn];rn.includes(Pr)||rn.push(Pr)}}).addMatcher((0,je.isAnyOf)((0,je.isFulfilled)(jn),(0,je.isRejectedWithValue)(jn)),function(Ee,ke){for(var Me,$e,Qe,It,jt=St(ke,"providesTags",Rn,wn),ze=ke.meta.arg.queryCacheKey,qt=0,mn=Object.values(Ee);qt<mn.length;qt++)for(var on=0,lr=Object.values(mn[qt]);on<lr.length;on++){var Ln=lr[on],an=Ln.indexOf(ze);an!==-1&&Ln.splice(an,1)}for(var $n=0,Jr=jt;$n<Jr.length;$n++){var rn=Jr[$n],Dn=rn.type,Nr=rn.id,Pr=(It=($e=(Me=Ee[Dn])!=null?Me:Ee[Dn]={})[Qe=Nr||"__internal_without_id"])!=null?It:$e[Qe]=[];Pr.includes(ze)||Pr.push(ze)}})}}),et=(0,je.createSlice)({name:Sn+"/subscriptions",initialState:Te,reducers:{updateSubscriptionOptions:function(Xe,Ee){},unsubscribeQueryResult:function(Xe,Ee){},internal_probeSubscription:function(Xe,Ee){}}}),gt=(0,je.createSlice)({name:Sn+"/internalSubscriptions",initialState:Te,reducers:{subscriptionsUpdated:{reducer:function(Xe,Ee){return(0,Y.applyPatches)(Xe,Ee.payload)},prepare:(0,je.prepareAutoBatched)()}}}),At=(0,je.createSlice)({name:Sn+"/config",initialState:C({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},pn),reducers:{middlewareRegistered:function(Xe,Ee){Xe.middlewareRegistered=Xe.middlewareRegistered!=="conflict"&&Mn===Ee.payload||"conflict"}},extraReducers:function(Xe){Xe.addCase(be,function(Ee){Ee.online=!0}).addCase(ce,function(Ee){Ee.online=!1}).addCase(W,function(Ee){Ee.focused=!0}).addCase(re,function(Ee){Ee.focused=!1}).addMatcher(gn,function(Ee){return C({},Ee)})}}),ft=(0,je.combineReducers)({queries:We.reducer,mutations:kt.reducer,provided:vt.reducer,subscriptions:gt.reducer,config:At.reducer});return{reducer:function(Xe,Ee){return ft(hn.match(Ee)?void 0:Xe,Ee)},actions:_(C(C(C(C(C({},At.actions),We.actions),et.actions),gt.actions),kt.actions),{unsubscribeMutationResult:kt.actions.removeMutationResult,resetApiState:hn})}}({context:ue,queryThunk:Ve,mutationThunk:wt,reducerPath:Se,assertTagType:Ge,config:{refetchOnFocus:lt,refetchOnReconnect:He,refetchOnMountOrArgChange:zt,keepUnusedDataFor:ht,reducerPath:Se}}),mt=Ie.reducer,Mt=Ie.actions;kr(q.util,{patchQueryData:_t,updateQueryData:Rt,upsertQueryData:Ft,prefetch:Gt,resetApiState:Mt.resetApiState}),kr(q.internalActions,Mt);var Dt=function(Ct){var Sn=Ct.reducerPath,jn=Ct.queryThunk,qn=Ct.api,ir=Ct.context,Rn=ir.apiUid,Mn={invalidateTags:(0,hr.createAction)(Sn+"/invalidateTags")},nn=[Nn,un,xr,kn,dn,Do];return{middleware:function(wn){var pn=!1,hn=_(C({},Ct),{internalState:{currentSubscriptions:{}},refetchQuery:gn}),We=nn.map(function(et){return et(hn)}),kt=function(et){var gt=et.api,At=et.queryThunk,ft=et.internalState,Xe=gt.reducerPath+"/subscriptions",Ee=null,ke=!1,Me=gt.internalActions,$e=Me.updateSubscriptionOptions,Qe=Me.unsubscribeQueryResult;return function(It,jt){var ze,qt;if(Ee||(Ee=JSON.parse(JSON.stringify(ft.currentSubscriptions))),gt.util.resetApiState.match(It))return Ee=ft.currentSubscriptions={},[!0,!1];if(gt.internalActions.internal_probeSubscription.match(It)){var mn=It.payload;return[!1,!!((ze=ft.currentSubscriptions[mn.queryCacheKey])!=null&&ze[mn.requestId])]}var on=function(an,$n){var Jr,rn,Dn,Nr,Pr,Da,Ku,wo,na;if($e.match($n)){var Ds=$n.payload,ra=Ds.queryCacheKey,eo=Ds.requestId;return(Jr=an==null?void 0:an[ra])!=null&&Jr[eo]&&(an[ra][eo]=Ds.options),!0}if(Qe.match($n)){var to=$n.payload;return eo=to.requestId,an[ra=to.queryCacheKey]&&delete an[ra][eo],!0}if(gt.internalActions.removeQueryResult.match($n))return delete an[$n.payload.queryCacheKey],!0;if(At.pending.match($n)){var no=$n.meta;if(eo=no.requestId,(Br=no.arg).subscribe)return(Ao=(Dn=an[rn=Br.queryCacheKey])!=null?Dn:an[rn]={})[eo]=(Pr=(Nr=Br.subscriptionOptions)!=null?Nr:Ao[eo])!=null?Pr:{},!0}if(At.rejected.match($n)){var Ao,Co=$n.meta,Br=Co.arg;if(eo=Co.requestId,Co.condition&&Br.subscribe)return(Ao=(Ku=an[Da=Br.queryCacheKey])!=null?Ku:an[Da]={})[eo]=(na=(wo=Br.subscriptionOptions)!=null?wo:Ao[eo])!=null?na:{},!0}return!1}(ft.currentSubscriptions,It);if(on){ke||(Ra(function(){var an=JSON.parse(JSON.stringify(ft.currentSubscriptions)),$n=(0,ss.produceWithPatches)(Ee,function(){return an});jt.next(gt.internalActions.subscriptionsUpdated($n[1])),Ee=an,ke=!1}),ke=!0);var lr=!!((qt=It.type)!=null&&qt.startsWith(Xe)),Ln=At.rejected.match(It)&&It.meta.condition&&!!It.meta.arg.subscribe;return[!lr&&!Ln,!1]}return[!0,!1]}}(hn),vt=function(et){var gt=et.reducerPath,At=et.context,ft=et.refetchQuery,Xe=et.internalState,Ee=et.api.internalActions.removeQueryResult;function ke(Me,$e){var Qe=Me.getState()[gt],It=Qe.queries,jt=Xe.currentSubscriptions;At.batch(function(){for(var ze=0,qt=Object.keys(jt);ze<qt.length;ze++){var mn=qt[ze],on=It[mn],lr=jt[mn];lr&&on&&(Object.values(lr).some(function(Ln){return Ln[$e]===!0})||Object.values(lr).every(function(Ln){return Ln[$e]===void 0})&&Qe.config[$e])&&(Object.keys(lr).length===0?Me.dispatch(Ee({queryCacheKey:mn})):on.status!==t.uninitialized&&Me.dispatch(ft(on,mn)))}})}return function(Me,$e){W.match(Me)&&ke($e,"refetchOnFocus"),be.match(Me)&&ke($e,"refetchOnReconnect")}}(hn);return function(et){return function(gt){pn||(pn=!0,wn.dispatch(qn.internalActions.middlewareRegistered(Rn)));var At,ft=_(C({},wn),{next:et}),Xe=wn.getState(),Ee=kt(gt,ft,Xe),ke=Ee[1];if(At=Ee[0]?et(gt):ke,wn.getState()[Sn]&&(vt(gt,ft,Xe),function(Qe){return!!Qe&&typeof Qe.type=="string"&&Qe.type.startsWith(Sn+"/")}(gt)||ir.hasRehydrationInfo(gt)))for(var Me=0,$e=We;Me<$e.length;Me++)(0,$e[Me])(gt,ft,Xe);return At}}},actions:Mn};function gn(wn,pn,hn){return hn===void 0&&(hn={}),jn(C({type:"query",endpointName:wn.endpointName,originalArgs:wn.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:pn},hn))}}({reducerPath:Se,context:ue,queryThunk:Ve,mutationThunk:wt,api:q,assertTagType:Ge}),Lt=Dt.middleware;kr(q.util,Dt.actions),kr(q,{reducer:mt,middleware:Lt});var fn=function(Ct){var Sn=Ct.serializeQueryArgs,jn=Ct.reducerPath,qn=function(nn){return ln},ir=function(nn){return _n};return{buildQuerySelector:function(nn,gn){return function(wn){var pn=Sn({queryArgs:wn,endpointDefinition:gn,endpointName:nn});return(0,xe.createSelector)(wn===Ke?qn:function(hn){var We,kt,vt;return(vt=(kt=(We=Mn(hn))==null?void 0:We.queries)==null?void 0:kt[pn])!=null?vt:ln},Rn)}},buildMutationSelector:function(){return function(nn){var gn,wn;return wn=typeof nn=="object"?(gn=te(nn))!=null?gn:Ke:nn,(0,xe.createSelector)(wn===Ke?ir:function(pn){var hn,We,kt;return(kt=(We=(hn=Mn(pn))==null?void 0:hn.mutations)==null?void 0:We[wn])!=null?kt:_n},Rn)}},selectInvalidatedBy:function(nn,gn){for(var wn,pn=nn[jn],hn=new Set,We=0,kt=gn.map(he);We<kt.length;We++){var vt=kt[We],et=pn.provided[vt.type];if(et)for(var gt=0,At=(wn=vt.id!==void 0?et[vt.id]:R(Object.values(et)))!=null?wn:[];gt<At.length;gt++)hn.add(At[gt])}return R(Array.from(hn.values()).map(function(ft){var Xe=pn.queries[ft];return Xe?[{queryCacheKey:ft,endpointName:Xe.endpointName,originalArgs:Xe.originalArgs}]:[]}))}};function Rn(nn){return C(C({},nn),{status:gn=nn.status,isUninitialized:gn===t.uninitialized,isLoading:gn===t.pending,isSuccess:gn===t.fulfilled,isError:gn===t.rejected});var gn}function Mn(nn){return nn[jn]}}({serializeQueryArgs:Ye,reducerPath:Se}),Wt=fn.buildQuerySelector,Zt=fn.buildMutationSelector;kr(q.util,{selectInvalidatedBy:fn.selectInvalidatedBy});var Cn=function(Ct){var Sn=Ct.serializeQueryArgs,jn=Ct.queryThunk,qn=Ct.mutationThunk,ir=Ct.api,Rn=Ct.context,Mn=new Map,nn=new Map,gn=ir.internalActions,wn=gn.unsubscribeQueryResult,pn=gn.removeMutationResult,hn=gn.updateSubscriptionOptions;return{buildInitiateQuery:function(We,kt){var vt=function(et,gt){var At=gt===void 0?{}:gt,ft=At.subscribe,Xe=ft===void 0||ft,Ee=At.forceRefetch,ke=At.subscriptionOptions,Me=At[ge];return function($e,Qe){var It,jt,ze=Sn({queryArgs:et,endpointDefinition:kt,endpointName:We}),qt=jn(((It={type:"query",subscribe:Xe,forceRefetch:Ee,subscriptionOptions:ke,endpointName:We,originalArgs:et,queryCacheKey:ze})[ge]=Me,It)),mn=ir.endpoints[We].select(et),on=$e(qt),lr=mn(Qe()),Ln=on.requestId,an=on.abort,$n=lr.requestId!==Ln,Jr=(jt=Mn.get($e))==null?void 0:jt[ze],rn=function(){return mn(Qe())},Dn=Object.assign(Me?on.then(rn):$n&&!Jr?Promise.resolve(lr):Promise.all([Jr,on]).then(rn),{arg:et,requestId:Ln,subscriptionOptions:ke,queryCacheKey:ze,abort:an,unwrap:function(){return I(this,null,function(){var Pr;return r(this,function(Da){switch(Da.label){case 0:return[4,Dn];case 1:if((Pr=Da.sent()).isError)throw Pr.error;return[2,Pr.data]}})})},refetch:function(){return $e(vt(et,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){Xe&&$e(wn({queryCacheKey:ze,requestId:Ln}))},updateSubscriptionOptions:function(Pr){Dn.subscriptionOptions=Pr,$e(hn({endpointName:We,requestId:Ln,queryCacheKey:ze,options:Pr}))}});if(!Jr&&!$n&&!Me){var Nr=Mn.get($e)||{};Nr[ze]=Dn,Mn.set($e,Nr),Dn.then(function(){delete Nr[ze],Object.keys(Nr).length||Mn.delete($e)})}return Dn}};return vt},buildInitiateMutation:function(We){return function(kt,vt){var et=vt===void 0?{}:vt,gt=et.track,At=gt===void 0||gt,ft=et.fixedCacheKey;return function(Xe,Ee){var ke=qn({type:"mutation",endpointName:We,originalArgs:kt,track:At,fixedCacheKey:ft}),Me=Xe(ke),$e=Me.requestId,Qe=Me.abort,It=Me.unwrap,jt=Me.unwrap().then(function(on){return{data:on}}).catch(function(on){return{error:on}}),ze=function(){Xe(pn({requestId:$e,fixedCacheKey:ft}))},qt=Object.assign(jt,{arg:Me.arg,requestId:$e,abort:Qe,unwrap:It,unsubscribe:ze,reset:ze}),mn=nn.get(Xe)||{};return nn.set(Xe,mn),mn[$e]=qt,qt.then(function(){delete mn[$e],Object.keys(mn).length||nn.delete(Xe)}),ft&&(mn[ft]=qt,qt.then(function(){mn[ft]===qt&&(delete mn[ft],Object.keys(mn).length||nn.delete(Xe))})),qt}}},getRunningQueryThunk:function(We,kt){return function(vt){var et,gt=Sn({queryArgs:kt,endpointDefinition:Rn.endpointDefinitions[We],endpointName:We});return(et=Mn.get(vt))==null?void 0:et[gt]}},getRunningMutationThunk:function(We,kt){return function(vt){var et;return(et=nn.get(vt))==null?void 0:et[kt]}},getRunningQueriesThunk:function(){return function(We){return Object.values(Mn.get(We)||{}).filter(Ne)}},getRunningMutationsThunk:function(){return function(We){return Object.values(nn.get(We)||{}).filter(Ne)}},getRunningOperationPromises:function(){var We=function(kt){return Array.from(kt.values()).flatMap(function(vt){return vt?Object.values(vt):[]})};return o(o([],We(Mn)),We(nn)).filter(Ne)},removalWarning:function(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
|
||
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
|
||
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}}({queryThunk:Ve,mutationThunk:wt,api:q,serializeQueryArgs:Ye,context:ue}),jr=Cn.buildInitiateQuery,Gn=Cn.buildInitiateMutation;return kr(q.util,{getRunningOperationPromises:Cn.getRunningOperationPromises,getRunningOperationPromise:Cn.removalWarning,getRunningMutationThunk:Cn.getRunningMutationThunk,getRunningMutationsThunk:Cn.getRunningMutationsThunk,getRunningQueryThunk:Cn.getRunningQueryThunk,getRunningQueriesThunk:Cn.getRunningQueriesThunk}),{name:ta,injectEndpoint:function(Ct,Sn){var jn,qn=q;(jn=qn.endpoints)[Ct]!=null||(jn[Ct]={}),oe(Sn)?kr(qn.endpoints[Ct],{name:Ct,select:Wt(Ct,Sn),initiate:jr(Ct,Sn)},Bt(Ve,Ct)):Sn.type===ie.mutation&&kr(qn.endpoints[Ct],{name:Ct,select:Zt(),initiate:Gn(Ct)},Bt(wt,Ct))}}}}},as=it(Ma())})(T_);D_.exports=T_;var Yo=D_.exports;const A_=f.memo(({board:e,isSelected:t})=>{const n=ne(),{currentData:r}=Cs(e.cover_image_name??Yo.skipToken),{colorMode:o}=Qr(),{board_name:s,board_id:i}=e,{onClickDeleteBoardImages:u}=f.useContext(V4),d=f.useCallback(()=>{n(Cv(i))},[i,n]),[p,{isLoading:m}]=a8(),[h,{isLoading:v}]=i8(),b=k=>{p({board_id:i,changes:{board_name:k}})},w=f.useCallback(()=>{h(i)},[i,h]),S=f.useCallback(()=>{},[]),C=f.useCallback(()=>{u(e)},[e,u]),_=f.useMemo(()=>({id:i,actionType:"MOVE_BOARD",context:{boardId:i}}),[i]);return a.jsx(Be,{sx:{touchAction:"none",height:"full"},children:a.jsx(M_,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>a.jsxs($u,{sx:{visibility:"visible !important"},children:[e.image_count>0&&a.jsxs(a.Fragment,{children:[a.jsx(Lr,{isDisabled:!e.image_count,icon:a.jsx(J5,{}),onClickCapture:S,children:"Add Board to Batch"}),a.jsx(Lr,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(mo,{}),onClickCapture:C,children:"Delete Board and Images"})]}),a.jsx(Lr,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(mo,{}),onClickCapture:w,children:"Delete Board"})]}),children:k=>a.jsxs(G,{userSelect:"none",ref:k,sx:{flexDir:"column",justifyContent:"space-between",alignItems:"center",cursor:"pointer",w:"full",h:"full"},children:[a.jsxs(G,{onClick:d,sx:{position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",w:"full",aspectRatio:"1/1",overflow:"hidden",shadow:t?"selected.light":void 0,_dark:{shadow:t?"selected.dark":void 0},flexShrink:0},children:[e.cover_image_name&&(r==null?void 0:r.image_url)&&a.jsx(Eu,{src:r==null?void 0:r.image_url,draggable:!1}),!(e.cover_image_name&&(r!=null&&r.image_url))&&a.jsx(Zi,{boxSize:8,icon:su,sx:{border:"2px solid var(--invokeai-colors-base-200)",_dark:{border:"2px solid var(--invokeai-colors-base-800)"}}}),a.jsx(G,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(Hi,{variant:"solid",children:e.image_count})}),a.jsx(M1,{data:_})]}),a.jsx(G,{sx:{width:"full",height:"full",justifyContent:"center",alignItems:"center"},children:a.jsxs(o6,{defaultValue:s,submitOnBlur:!1,onSubmit:P=>{b(P)},children:[a.jsx(t6,{sx:{color:t?Pe("base.900","base.50")(o):Pe("base.700","base.200")(o),fontWeight:t?600:void 0,fontSize:"xs",textAlign:"center",p:0},noOfLines:1}),a.jsx(e6,{sx:{color:Pe("base.900","base.50")(o),fontSize:"xs",borderColor:Pe("base.500","base.500")(o),p:0,outline:0}})]})})]},i)})})});A_.displayName="HoverableBoard";const sr=e=>{const t=L(i=>i.config.disabledTabs),n=L(i=>i.config.disabledFeatures),r=L(i=>i.config.disabledSDFeatures),o=f.useMemo(()=>n.includes(e)||r.includes(e)||t.includes(e),[n,r,t,e]),s=f.useMemo(()=>!(n.includes(e)||r.includes(e)||t.includes(e)),[n,r,t,e]);return{isFeatureDisabled:o,isFeatureEnabled:s}},_L=we([Tt],({boards:e,gallery:t})=>{const{searchText:n}=e,{selectedBoardId:r}=t;return{selectedBoardId:r,searchText:n}},ut),kL=e=>{const{isOpen:t}=e,n=ne(),{selectedBoardId:r,searchText:o}=L(_L),{data:s}=kv(),i=sr("batches").isFeatureEnabled,u=o?s==null?void 0:s.filter(v=>v.board_name.toLowerCase().includes(o.toLowerCase())):s,[d,p]=f.useState(!1),m=v=>{p(v.length>0),n(ix(v))},h=()=>{p(!1),n(ix(""))};return a.jsx(ch,{in:t,animateOpacity:!0,children:a.jsxs(G,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[a.jsxs(G,{sx:{gap:2,alignItems:"center"},children:[a.jsxs(V6,{children:[a.jsx(Tu,{placeholder:"Search Boards...",value:o,onChange:v=>{m(v.target.value)}}),o&&o.length&&a.jsx(Kv,{children:a.jsx(ti,{onClick:h,size:"xs",variant:"ghost","aria-label":"Clear Search",icon:a.jsx(G$,{boxSize:3})})})]}),a.jsx(vL,{})]}),a.jsx(O_,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsxs(Bi,{className:"list-container",sx:{gridTemplateRows:"6.5rem 6.5rem",gridAutoFlow:"column dense",gridAutoColumns:"5rem"},children:[!d&&a.jsxs(a.Fragment,{children:[a.jsx(wf,{sx:{p:1.5},children:a.jsx(xL,{isSelected:r==="all"})}),i&&a.jsx(wf,{sx:{p:1.5},children:a.jsx(wL,{isSelected:r==="batch"})})]}),u&&u.map(v=>a.jsx(wf,{sx:{p:1.5},children:a.jsx(A_,{board:v,isSelected:r===v.board_id})},v.board_id))]})})]})})},jL=f.memo(kL),Dh=0,Ji=1,yc=2,N_=4;function PL(e,t){return n=>e(t(n))}function IL(e,t){return t(e)}function $_(e,t){return n=>e(t,n)}function fS(e,t){return()=>e(t)}function D1(e,t){return t(e),e}function el(...e){return e}function EL(e){e()}function pS(e){return()=>e}function OL(...e){return()=>{e.map(EL)}}function RL(e){return e!==void 0}function Th(){}function Qo(e,t){return e(Ji,t)}function Ci(e,t){e(Dh,t)}function T1(e){e(yc)}function Ah(e){return e(N_)}function Hn(e,t){return Qo(e,$_(t,Dh))}function Or(){const e=[];return(t,n)=>{switch(t){case yc:e.splice(0,e.length);return;case Ji:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case Dh:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function Kt(e){let t=e;const n=Or();return(r,o)=>{switch(r){case Ji:o(t);break;case Dh:t=o;break;case N_:return t}return n(r,o)}}function ML(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case Ji:return s?n===s?void 0:(r(),n=s,t=Qo(e,s),t):(r(),Th);case yc:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function iu(e){return D1(Or(),t=>Hn(e,t))}function Vl(e,t){return D1(Kt(t),n=>Hn(e,n))}function DL(...e){return t=>e.reduceRight(IL,t)}function en(e,...t){const n=DL(...t);return(r,o)=>{switch(r){case Ji:return Qo(e,n(o));case yc:T1(e);return}}}function z_(e,t){return e===t}function ho(e=z_){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Uo(e){return t=>n=>{e(n)&&t(n)}}function Qn(e){return t=>PL(t,e)}function _i(e){return t=>()=>t(e)}function Jd(e,t){return n=>r=>n(t=e(t,r))}function hS(e){return t=>n=>{e>0?e--:t(n)}}function ef(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function mS(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Za(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const u=Math.pow(2,i);Qo(s,d=>{const p=n;n=n|u,t[i]=d,p!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const u=()=>s([i].concat(t));n===o?u():r=u}}function gS(...e){return function(t,n){switch(t){case Ji:return OL(...e.map(r=>Qo(r,n)));case yc:return;default:throw new Error(`unrecognized action ${t}`)}}}function Xn(e,t=z_){return en(e,ho(t))}function qi(...e){const t=Or(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const u=Math.pow(2,i);Qo(s,d=>{n[i]=d,r=r|u,r===o&&Ci(t,n)})}),function(s,i){switch(s){case Ji:return r===o&&i(n),Qo(t,i);case yc:return T1(t);default:throw new Error(`unrecognized action ${s}`)}}}function ea(e,t=[],{singleton:n}={singleton:!0}){return{id:TL(),constructor:e,dependencies:t,singleton:n}}const TL=()=>Symbol();function AL(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const u=o(s.map(d=>n(d)));return i&&t.set(r,u),u};return n(e)}function NL(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)r.hasOwnProperty(i)||(n[i]=t[i]);return n}const tf=typeof document<"u"?z.useLayoutEffect:z.useEffect;function $L(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),u=z.createContext({});function d(S,C){S.propsReady&&Ci(S.propsReady,!1);for(const _ of r){const k=S[t.required[_]];Ci(k,C[_])}for(const _ of o)if(_ in C){const k=S[t.optional[_]];Ci(k,C[_])}S.propsReady&&Ci(S.propsReady,!0)}function p(S){return s.reduce((C,_)=>(C[_]=k=>{const P=S[t.methods[_]];Ci(P,k)},C),{})}function m(S){return i.reduce((C,_)=>(C[_]=ML(S[t.events[_]]),C),{})}return{Component:z.forwardRef((S,C)=>{const{children:_,...k}=S,[P]=z.useState(()=>D1(AL(e),I=>d(I,k))),[E]=z.useState(fS(m,P));return tf(()=>{for(const I of i)I in k&&Qo(E[I],k[I]);return()=>{Object.values(E).map(T1)}},[k,E,P]),tf(()=>{d(P,k)}),z.useImperativeHandle(C,pS(p(P))),z.createElement(u.Provider,{value:P},n?z.createElement(n,NL([...r,...o,...i],k),_):_)}),usePublisher:S=>z.useCallback($_(Ci,z.useContext(u)[S]),[S]),useEmitterValue:S=>{const _=z.useContext(u)[S],[k,P]=z.useState(fS(Ah,_));return tf(()=>Qo(_,E=>{E!==k&&P(pS(E))}),[_,k]),k},useEmitter:(S,C)=>{const k=z.useContext(u)[S];tf(()=>Qo(k,C),[C,k])}}}const zL=typeof document<"u"?z.useLayoutEffect:z.useEffect,LL=zL;var A1=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(A1||{});const FL={[0]:"debug",[1]:"log",[2]:"warn",[3]:"error"},BL=()=>typeof globalThis>"u"?window:globalThis,L_=ea(()=>{const e=Kt(3);return{log:Kt((n,r,o=1)=>{var s;const i=(s=BL().VIRTUOSO_LOG_LEVEL)!=null?s:Ah(e);o>=i&&console[FL[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function F_(e,t=!0){const n=z.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=z.useMemo(()=>new ResizeObserver(s=>{const i=s[0].target;i.offsetParent!==null&&e(i)}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function Nh(e,t=!0){return F_(e,t).callbackRef}function ap(e,t){return Math.round(e.getBoundingClientRect()[t])}function B_(e,t){return Math.abs(e-t)<1.01}function H_(e,t,n,r=Th,o){const s=z.useRef(null),i=z.useRef(null),u=z.useRef(null),d=z.useCallback(h=>{const v=h.target,b=v===window||v===document,w=b?window.pageYOffset||document.documentElement.scrollTop:v.scrollTop,S=b?document.documentElement.scrollHeight:v.scrollHeight,C=b?window.innerHeight:v.offsetHeight,_=()=>{e({scrollTop:Math.max(w,0),scrollHeight:S,viewportHeight:C})};h.suppressFlushSync?_():l8.flushSync(_),i.current!==null&&(w===i.current||w<=0||w===S-C)&&(i.current=null,t(!0),u.current&&(clearTimeout(u.current),u.current=null))},[e,t]);z.useEffect(()=>{const h=o||s.current;return r(o||s.current),d({target:h,suppressFlushSync:!0}),h.addEventListener("scroll",d,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",d)}},[s,d,n,r,o]);function p(h){const v=s.current;if(!v||"offsetHeight"in v&&v.offsetHeight===0)return;const b=h.behavior==="smooth";let w,S,C;v===window?(S=Math.max(ap(document.documentElement,"height"),document.documentElement.scrollHeight),w=window.innerHeight,C=document.documentElement.scrollTop):(S=v.scrollHeight,w=ap(v,"height"),C=v.scrollTop);const _=S-w;if(h.top=Math.ceil(Math.max(Math.min(_,h.top),0)),B_(w,S)||h.top===C){e({scrollTop:C,scrollHeight:S,viewportHeight:w}),b&&t(!0);return}b?(i.current=h.top,u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,i.current=null,t(!0)},1e3)):i.current=null,v.scrollTo(h)}function m(h){s.current.scrollBy(h)}return{scrollerRef:s,scrollByCallback:m,scrollToCallback:p}}const $h=ea(()=>{const e=Or(),t=Or(),n=Kt(0),r=Or(),o=Kt(0),s=Or(),i=Or(),u=Kt(0),d=Kt(0),p=Kt(0),m=Kt(0),h=Or(),v=Or(),b=Kt(!1);return Hn(en(e,Qn(({scrollTop:w})=>w)),t),Hn(en(e,Qn(({scrollHeight:w})=>w)),i),Hn(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:u,fixedHeaderHeight:d,fixedFooterHeight:p,footerHeight:m,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:h,scrollBy:v,statefulScrollTop:o,deviation:n,scrollingInProgress:b}},[],{singleton:!0}),HL=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function VL(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!HL)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const ip="up",lu="down",WL="none",UL={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},GL=0,V_=ea(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=Kt(!1),u=Kt(!0),d=Or(),p=Or(),m=Kt(4),h=Kt(GL),v=Vl(en(gS(en(Xn(t),hS(1),_i(!0)),en(Xn(t),hS(1),_i(!1),mS(100))),ho()),!1),b=Vl(en(gS(en(s,_i(!0)),en(s,_i(!1),mS(200))),ho()),!1);Hn(en(qi(Xn(t),Xn(h)),Qn(([k,P])=>k<=P),ho()),u),Hn(en(u,ef(50)),p);const w=iu(en(qi(e,Xn(n),Xn(r),Xn(o),Xn(m)),Jd((k,[{scrollTop:P,scrollHeight:E},I,R,O,D])=>{const T=P+I-E>-D,$={viewportHeight:I,scrollTop:P,scrollHeight:E};if(T){let ee,F;return P>k.state.scrollTop?(ee="SCROLLED_DOWN",F=k.state.scrollTop-P):(ee="SIZE_DECREASED",F=k.state.scrollTop-P||k.scrollTopDelta),{atBottom:!0,state:$,atBottomBecause:ee,scrollTopDelta:F}}let B;return $.scrollHeight>k.state.scrollHeight?B="SIZE_INCREASED":I<k.state.viewportHeight?B="VIEWPORT_HEIGHT_DECREASING":P<k.state.scrollTop?B="SCROLLING_UPWARDS":B="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:B,state:$}},UL),ho((k,P)=>k&&k.atBottom===P.atBottom))),S=Vl(en(e,Jd((k,{scrollTop:P,scrollHeight:E,viewportHeight:I})=>{if(B_(k.scrollHeight,E))return{scrollTop:P,scrollHeight:E,jump:0,changed:!1};{const R=E-(P+I)<1;return k.scrollTop!==P&&R?{scrollHeight:E,scrollTop:P,jump:k.scrollTop-P,changed:!0}:{scrollHeight:E,scrollTop:P,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Uo(k=>k.changed),Qn(k=>k.jump)),0);Hn(en(w,Qn(k=>k.atBottom)),i),Hn(en(i,ef(50)),d);const C=Kt(lu);Hn(en(e,Qn(({scrollTop:k})=>k),ho(),Jd((k,P)=>Ah(b)?{direction:k.direction,prevScrollTop:P}:{direction:P<k.prevScrollTop?ip:lu,prevScrollTop:P},{direction:lu,prevScrollTop:0}),Qn(k=>k.direction)),C),Hn(en(e,ef(50),_i(WL)),C);const _=Kt(0);return Hn(en(v,Uo(k=>!k),_i(0)),_),Hn(en(t,ef(100),Za(v),Uo(([k,P])=>!!P),Jd(([k,P],[E])=>[P,E],[0,0]),Qn(([k,P])=>P-k)),_),{isScrolling:v,isAtTop:u,isAtBottom:i,atBottomState:w,atTopStateChange:p,atBottomStateChange:d,scrollDirection:C,atBottomThreshold:m,atTopThreshold:h,scrollVelocity:_,lastJumpDueToItemResize:S}},el($h)),qL=ea(([{log:e}])=>{const t=Kt(!1),n=iu(en(t,Uo(r=>r),ho()));return Qo(t,r=>{r&&Ah(e)("props updated",{},A1.DEBUG)}),{propsReady:t,didMount:n}},el(L_),{singleton:!0});function F0(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function KL(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const lp="top",cp="bottom",vS="none";function yS(e,t,n){return typeof e=="number"?n===ip&&t===lp||n===lu&&t===cp?e:0:n===ip?t===lp?e.main:e.reverse:t===cp?e.main:e.reverse}function bS(e,t){return typeof e=="number"?e:e[t]||0}const YL=ea(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=Or(),i=Kt(0),u=Kt(0),d=Kt(0),p=Vl(en(qi(Xn(e),Xn(t),Xn(r),Xn(s,F0),Xn(d),Xn(i),Xn(o),Xn(n),Xn(u)),Qn(([m,h,v,[b,w],S,C,_,k,P])=>{const E=m-k,I=C+_,R=Math.max(v-E,0);let O=vS;const D=bS(P,lp),T=bS(P,cp);return b-=k,b+=v+_,w+=v+_,w-=k,b>m+I-D&&(O=ip),w<m-R+h+T&&(O=lu),O!==vS?[Math.max(E-v-yS(S,lp,O)-D,0),E-R-_+h+yS(S,cp,O)+T]:null}),Uo(m=>m!=null),ho(F0)),[0,0]);return{listBoundary:s,overscan:d,topListHeight:i,increaseViewportBy:u,visibleRange:p}},el($h),{singleton:!0}),QL=ea(([{scrollVelocity:e}])=>{const t=Kt(!1),n=Or(),r=Kt(!1);return Hn(en(e,Za(r,t,n),Uo(([o,s])=>!!s),Qn(([o,s,i,u])=>{const{exit:d,enter:p}=s;if(i){if(d(o,u))return!1}else if(p(o,u))return!0;return i}),ho()),t),Qo(en(qi(t,e,n),Za(r)),([[o,s,i],u])=>o&&u&&u.change&&u.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},el(V_),{singleton:!0});function XL(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const ZL=ea(([{scrollTo:e,scrollContainerState:t}])=>{const n=Or(),r=Or(),o=Or(),s=Kt(!1),i=Kt(void 0);return Hn(en(qi(n,r),Qn(([{viewportHeight:u,scrollTop:d,scrollHeight:p},{offsetTop:m}])=>({scrollTop:Math.max(0,d-m),scrollHeight:p,viewportHeight:u}))),t),Hn(en(e,Za(r),Qn(([u,{offsetTop:d}])=>({...u,top:u.top+d}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},el($h)),Ng="-webkit-sticky",xS="sticky",W_=XL(()=>{if(typeof document>"u")return xS;const e=document.createElement("div");return e.style.position=Ng,e.style.position===Ng?Ng:xS});function JL(e,t){const n=z.useRef(null),r=z.useCallback(u=>{if(u===null||!u.offsetParent)return;const d=u.getBoundingClientRect(),p=d.width;let m,h;if(t){const v=t.getBoundingClientRect(),b=d.top-v.top;m=v.height-Math.max(0,b),h=b+t.scrollTop}else m=window.innerHeight-Math.max(0,d.top),h=d.top+window.pageYOffset;n.current={offsetTop:h,visibleHeight:m,visibleWidth:p},e(n.current)},[e,t]),{callbackRef:o,ref:s}=F_(r),i=z.useCallback(()=>{r(s.current)},[r,s]);return z.useEffect(()=>{if(t){t.addEventListener("scroll",i);const u=new ResizeObserver(i);return u.observe(t),()=>{t.removeEventListener("scroll",i),u.unobserve(t)}}else return window.addEventListener("scroll",i),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[i,t]),o}z.createContext(void 0);const U_=z.createContext(void 0);function eF(e){return e}W_();const tF={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},G_={width:"100%",height:"100%",position:"absolute",top:0};W_();function Ni(e,t){if(typeof e!="string")return{context:t}}function nF({usePublisher:e,useEmitter:t,useEmitterValue:n}){return z.memo(function({style:s,children:i,...u}){const d=e("scrollContainerState"),p=n("ScrollerComponent"),m=e("smoothScrollTargetReached"),h=n("scrollerRef"),v=n("context"),{scrollerRef:b,scrollByCallback:w,scrollToCallback:S}=H_(d,m,p,h);return t("scrollTo",S),t("scrollBy",w),z.createElement(p,{ref:b,style:{...tF,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...u,...Ni(p,v)},i)})}function rF({usePublisher:e,useEmitter:t,useEmitterValue:n}){return z.memo(function({style:s,children:i,...u}){const d=e("windowScrollContainerState"),p=n("ScrollerComponent"),m=e("smoothScrollTargetReached"),h=n("totalListHeight"),v=n("deviation"),b=n("customScrollParent"),w=n("context"),{scrollerRef:S,scrollByCallback:C,scrollToCallback:_}=H_(d,m,p,Th,b);return LL(()=>(S.current=b||window,()=>{S.current=null}),[S,b]),t("windowScrollTo",_),t("scrollBy",C),z.createElement(p,{style:{position:"relative",...s,...h!==0?{height:h+v}:{}},"data-virtuoso-scroller":!0,...u,...Ni(p,w)},i)})}const SS={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},oF={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:wS,ceil:CS,floor:up,min:$g,max:cu}=Math;function sF(e){return{...oF,items:e}}function zg(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>({index:o+e,data:n==null?void 0:n[o+e]}))}function aF(e,t){return e&&e.column===t.column&&e.row===t.row}function _S(e,t){return e&&e.width===t.width&&e.height===t.height}const iF=ea(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:u,scrollContainerState:d,footerHeight:p,headerHeight:m},h,v,{propsReady:b,didMount:w},{windowViewportRect:S,windowScrollTo:C,useWindowScroll:_,customScrollParent:k,windowScrollContainerState:P},E])=>{const I=Kt(0),R=Kt(0),O=Kt(SS),D=Kt({height:0,width:0}),T=Kt({height:0,width:0}),$=Or(),B=Or(),ee=Kt(0),F=Kt(void 0),N=Kt({row:0,column:0});Hn(en(w,Za(R,F),Uo(([W,re])=>W&&re!==0),Qn(([,W,re])=>({items:zg(0,W-1,re),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}))),O),Hn(en(qi(Xn(I),t,Xn(N,aF),Xn(T,_S),Xn(D,_S),F),Qn(([W,[re,be],ce,se,X,ie])=>{const{row:de,column:xe}=ce,{height:oe,width:ve}=se,{width:he}=X;if(W===0||he===0)return SS;if(ve===0)return sF(zg(0,0,ie));const je=q_(he,ve,xe);let Ne=je*up((re+de)/(oe+de)),ge=je*CS((be+de)/(oe+de))-1;ge=$g(W-1,cu(ge,je-1)),Ne=$g(ge,cu(0,Ne));const Oe=zg(Ne,ge,ie),{top:at,bottom:Fe}=kS(X,ce,se,Oe),qe=CS(W/je),St=qe*oe+(qe-1)*de-Fe;return{items:Oe,offsetTop:at,offsetBottom:St,top:at,bottom:Fe,itemHeight:oe,itemWidth:ve}})),O),Hn(en(F,Uo(RL),Qn(W=>W.length)),I),Hn(en(D,Qn(({height:W})=>W)),o),Hn(en(qi(D,T,O,N),Qn(([W,re,{items:be},ce])=>{const{top:se,bottom:X}=kS(W,ce,re,be);return[se,X]}),ho(F0)),n);const H=Kt(!1);Hn(en(r,Za(H),Qn(([W,re])=>re||W!==0)),H);const K=iu(en(Xn(O),Uo(({items:W})=>W.length>0),Za(I,H),Uo(([{items:W},re,be])=>be&&W[W.length-1].index===re-1),Qn(([,W])=>W-1),ho())),A=iu(en(Xn(O),Uo(({items:W})=>W.length>0&&W[0].index===0),_i(0),ho())),U=iu(en(Xn(O),Uo(({items:W})=>W.length>0),Qn(({items:W})=>({startIndex:W[0].index,endIndex:W[W.length-1].index})),ho(KL)));Hn(U,v.scrollSeekRangeChanged),Hn(en($,Za(D,T,I,N),Qn(([W,re,be,ce,se])=>{const X=VL(W),{align:ie,behavior:de,offset:xe}=X;let oe=X.index;oe==="LAST"&&(oe=ce-1),oe=cu(0,oe,$g(ce-1,oe));let ve=B0(re,se,be,oe);return ie==="end"?ve=wS(ve-re.height+be.height):ie==="center"&&(ve=wS(ve-re.height/2+be.height/2)),xe&&(ve+=xe),{top:ve,behavior:de}})),i);const V=Vl(en(O,Qn(W=>W.offsetBottom+W.bottom)),0);return Hn(en(S,Qn(W=>({width:W.visibleWidth,height:W.visibleHeight}))),D),{data:F,totalCount:I,viewportDimensions:D,itemDimensions:T,scrollTop:r,scrollHeight:B,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:$,smoothScrollTargetReached:u,windowViewportRect:S,windowScrollTo:C,useWindowScroll:_,customScrollParent:k,windowScrollContainerState:P,deviation:ee,scrollContainerState:d,footerHeight:p,headerHeight:m,initialItemCount:R,gap:N,...v,gridState:O,totalListHeight:V,...h,startReached:A,endReached:K,rangeChanged:U,propsReady:b,...E}},el(YL,$h,V_,QL,qL,ZL,L_));function kS(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=B0(e,t,n,r[0].index),i=B0(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function B0(e,t,n,r){const o=q_(e.width,n.width,t.column),s=up(r/o),i=s*n.height+cu(0,s-1)*t.row;return i>0?i+t.row:i}function q_(e,t,n){return cu(1,up((e+n)/(up(t)+n)))}const lF=ea(()=>{const e=Kt(p=>`Item ${p}`),t=Kt({}),n=Kt(null),r=Kt("virtuoso-grid-item"),o=Kt("virtuoso-grid-list"),s=Kt(eF),i=Kt("div"),u=Kt(Th),d=(p,m=null)=>Vl(en(t,Qn(h=>h[p]),ho()),m);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:u,FooterComponent:d("Footer"),HeaderComponent:d("Header"),ListComponent:d("List","div"),ItemComponent:d("Item","div"),ScrollerComponent:d("Scroller","div"),ScrollSeekPlaceholder:d("ScrollSeekPlaceholder","div")}}),cF=ea(([e,t])=>({...e,...t}),el(iF,lF)),uF=z.memo(function(){const t=ur("gridState"),n=ur("listClassName"),r=ur("itemClassName"),o=ur("itemContent"),s=ur("computeItemKey"),i=ur("isSeeking"),u=bs("scrollHeight"),d=ur("ItemComponent"),p=ur("ListComponent"),m=ur("ScrollSeekPlaceholder"),h=ur("context"),v=bs("itemDimensions"),b=bs("gap"),w=ur("log"),S=Nh(C=>{const _=C.parentElement.parentElement.scrollHeight;u(_);const k=C.firstChild;k&&v(k.getBoundingClientRect()),b({row:jS("row-gap",getComputedStyle(C).rowGap,w),column:jS("column-gap",getComputedStyle(C).columnGap,w)})});return z.createElement(p,{ref:S,className:n,...Ni(p,h),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(C=>{const _=s(C.index,C.data,h);return i?z.createElement(m,{key:_,...Ni(m,h),index:C.index,height:t.itemHeight,width:t.itemWidth}):z.createElement(d,{...Ni(d,h),className:r,"data-index":C.index,key:_},o(C.index,C.data,h))}))}),dF=z.memo(function(){const t=ur("HeaderComponent"),n=bs("headerHeight"),r=ur("headerFooterTag"),o=Nh(i=>n(ap(i,"height"))),s=ur("context");return t?z.createElement(r,{ref:o},z.createElement(t,Ni(t,s))):null}),fF=z.memo(function(){const t=ur("FooterComponent"),n=bs("footerHeight"),r=ur("headerFooterTag"),o=Nh(i=>n(ap(i,"height"))),s=ur("context");return t?z.createElement(r,{ref:o},z.createElement(t,Ni(t,s))):null}),pF=({children:e})=>{const t=z.useContext(U_),n=bs("itemDimensions"),r=bs("viewportDimensions"),o=Nh(s=>{r(s.getBoundingClientRect())});return z.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),z.createElement("div",{style:G_,ref:o},e)},hF=({children:e})=>{const t=z.useContext(U_),n=bs("windowViewportRect"),r=bs("itemDimensions"),o=ur("customScrollParent"),s=JL(n,o);return z.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),z.createElement("div",{ref:s,style:G_},e)},mF=z.memo(function({...t}){const n=ur("useWindowScroll"),r=ur("customScrollParent"),o=r||n?yF:vF,s=r||n?hF:pF;return z.createElement(o,{...t},z.createElement(s,null,z.createElement(dF,null),z.createElement(uF,null),z.createElement(fF,null)))}),{Component:gF,usePublisher:bs,useEmitterValue:ur,useEmitter:K_}=$L(cF,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange"}},mF),vF=nF({usePublisher:bs,useEmitterValue:ur,useEmitter:K_}),yF=rF({usePublisher:bs,useEmitterValue:ur,useEmitter:K_});function jS(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,A1.WARN),t==="normal"?0:parseInt(t??"0",10)}const Y_=gF,bF=({image:e})=>{const t=f.useMemo(()=>{var n,r;if(c8((n=e.metadata)==null?void 0:n.model))return(r=e.metadata)==null?void 0:r.model},[e.metadata]);return a.jsxs(G,{sx:{pointerEvents:"none",flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,p:2,alignItems:"flex-start",gap:2},children:[a.jsxs(Hi,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]}),t&&a.jsx(Hi,{variant:"solid",colorScheme:"base",children:t})]})},Q_=({postUploadAction:e,isDisabled:t})=>{const n=ne(),r=f.useCallback(u=>{const d=u[0];d&&n(F4({file:d,image_category:"user",is_intermediate:!1,postUploadAction:e}))},[n,e]),{getRootProps:o,getInputProps:s,open:i}=i1({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:r,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:o,getUploadInputProps:s,openUploader:i}},xF=e=>{const{data:t,disabled:n,onClick:r}=e,o=f.useRef(ei()),{attributes:s,listeners:i,setNodeRef:u}=u8({id:o.current,disabled:n,data:t});return a.jsx(Be,{onClick:r,ref:u,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,...s,...i})},SF=f.memo(xF),wF=e=>{const{imageDTO:t,onClickReset:n,onError:r,onClick:o,withResetIcon:s=!1,withMetadataOverlay:i=!1,isDropDisabled:u=!1,isDragDisabled:d=!1,isUploadDisabled:p=!1,minSize:m=24,postUploadAction:h,imageSx:v,fitContainer:b=!1,droppableData:w,draggableData:S,dropLabel:C,isSelected:_=!1,thumbnail:k=!1,resetTooltip:P="Reset",resetIcon:E=a.jsx(f1,{}),noContentFallback:I=a.jsx(Zi,{icon:vc})}=e,{colorMode:R}=Qr(),{getUploadButtonProps:O,getUploadInputProps:D}=Q_({postUploadAction:h,isDisabled:p}),T=xf("drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-600))","drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-800))"),$=p?{}:{cursor:"pointer",bg:Pe("base.200","base.800")(R),_hover:{bg:Pe("base.300","base.650")(R),color:Pe("base.500","base.300")(R)}};return a.jsxs(G,{sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative",minW:m||void 0,minH:m||void 0,userSelect:"none",cursor:d||!t?"default":"pointer"},children:[t&&a.jsxs(G,{sx:{w:"full",h:"full",position:b?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[a.jsx(Eu,{src:k?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallbackSrc:t.thumbnail_url,width:t.width,height:t.height,onError:r,draggable:!1,sx:{objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",shadow:_?"selected.light":void 0,_dark:{shadow:_?"selected.dark":void 0},...v}}),i&&a.jsx(bF,{image:t})]}),!t&&!p&&a.jsx(a.Fragment,{children:a.jsxs(G,{sx:{minH:m,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:Pe("base.500","base.500")(R),...$},...O(),children:[a.jsx("input",{...D()}),a.jsx(oo,{as:Hu,sx:{boxSize:16}})]})}),!t&&p&&I,!u&&a.jsx(M1,{data:w,disabled:u,dropLabel:C}),t&&!d&&a.jsx(SF,{data:S,disabled:d||!t,onClick:o}),n&&s&&t&&a.jsx(Ae,{onClick:n,"aria-label":P,tooltip:P,icon:E,size:"sm",variant:"link",sx:{position:"absolute",top:1,insetInlineEnd:1,p:0,minW:0,svg:{transitionProperty:"common",transitionDuration:"normal",fill:"base.100",_hover:{fill:"base.50"},filter:T}}})]})},si=f.memo(wF),CF=()=>a.jsx(Be,{sx:{position:"relative",height:"full",width:"full","::before":{content:"''",display:"block",pt:"100%"}},children:a.jsx(G,{sx:{position:"absolute",top:0,insetInlineStart:0,height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",bg:"base.100",color:"base.500",_dark:{color:"base.700",bg:"base.850"}},children:a.jsx(oo,{as:C$,boxSize:16,opacity:.7})})}),_F=()=>a.jsx(y5,{sx:{position:"relative",height:"full",width:"full","::before":{content:"''",display:"block",pt:"100%"}},children:a.jsx(Be,{sx:{position:"absolute",top:0,insetInlineStart:0,height:"full",width:"full"}})}),kF=()=>{const e=f.useCallback(()=>{},[]),t=f.useCallback(()=>{},[]),n=f.useCallback(()=>{},[]);return a.jsxs(a.Fragment,{children:[a.jsx(Lr,{icon:a.jsx(su,{}),onClickCapture:e,children:"Move Selection to Board"}),a.jsx(Lr,{icon:a.jsx(I$,{}),onClickCapture:n,children:"Add Selection to Batch"}),a.jsx(Lr,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(mo,{}),onClickCapture:t,children:"Delete Selection"})]})},N1=()=>{const e=ne(),t=Iu(),{t:n}=pe(),r=f.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),o=f.useCallback(()=>{t({title:n("toast.parameterNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),s=f.useCallback(()=>{t({title:n("toast.parametersSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),i=f.useCallback(()=>{t({title:n("toast.parametersNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),u=f.useCallback((I,R)=>{if(Rd(I)||Md(R)){Rd(I)&&e(nu(I)),Md(R)&&e(ru(R)),r();return}o()},[e,r,o]),d=f.useCallback(I=>{if(!Rd(I)){o();return}e(nu(I)),r()},[e,r,o]),p=f.useCallback(I=>{if(!Md(I)){o();return}e(ru(I)),r()},[e,r,o]),m=f.useCallback(I=>{if(!lx(I)){o();return}e(Df(I)),r()},[e,r,o]),h=f.useCallback(I=>{if(!cx(I)){o();return}e(Tf(I)),r()},[e,r,o]),v=f.useCallback(I=>{if(!ux(I)){o();return}e(a0(I)),r()},[e,r,o]),b=f.useCallback(I=>{if(!dx(I)){o();return}e(i0(I)),r()},[e,r,o]),w=f.useCallback(I=>{if(!fx(I)){o();return}e(Af(I)),r()},[e,r,o]),S=f.useCallback(I=>{if(!px(I)){o();return}e(Gl(I)),r()},[e,r,o]),C=f.useCallback(I=>{if(!hx(I)){o();return}e(ql(I)),r()},[e,r,o]),_=f.useCallback(I=>{if(!mx(I)){o();return}e(Nf(I)),r()},[e,r,o]),k=f.useCallback(async I=>{if(!d8(I)){o();return}e($f(I.image_name)),r()},[e,r,o]),P=f.useCallback(I=>{e($f(I))},[e]),E=f.useCallback(I=>{if(!I){i();return}const{cfg_scale:R,height:O,model:D,positive_prompt:T,negative_prompt:$,scheduler:B,seed:ee,steps:F,width:N,strength:H}=I;cx(R)&&e(Tf(R)),ux(D)&&e(a0(D)),Rd(T)&&e(nu(T)),Md($)&&e(ru($)),dx(B)&&e(i0(B)),lx(ee)&&e(Df(ee)),fx(F)&&e(Af(F)),px(N)&&e(Gl(N)),hx(O)&&e(ql(O)),mx(H)&&e(Nf(H)),s()},[i,s,e]);return{recallBothPrompts:u,recallPositivePrompt:d,recallNegativePrompt:p,recallSeed:m,recallInitialImage:k,recallCfgScale:h,recallModel:v,recallScheduler:b,recallSteps:w,recallWidth:S,recallHeight:C,recallStrength:_,recallAllParameters:E,sendToImageToImage:P}};function Pf(e){return ot({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)}function jF(e){return ot({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.33 433.6l-90-218a22 22 0 00-40.67 0l-90 218a22 22 0 1040.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 00458 464a22 22 0 0020.32-30.4zM334.83 362L368 281.65 401.17 362zm-66.99-19.08a22 22 0 00-4.89-30.7c-.2-.15-15-11.13-36.49-34.73 39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 000-44H214V70a22 22 0 00-44 0v20H54a22 22 0 000 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 00-40.58 17c.58 1.38 14.55 34.23 52.86 83.93.92 1.19 1.83 2.35 2.74 3.51-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1021.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59 22.52 24.08 38 35.44 38.93 36.1a22 22 0 0030.75-4.9z"}}]})(e)}const PF=e=>{const{imageDTO:t}=e,n=f.useMemo(()=>we([Tt],({gallery:$})=>({isInBatch:$.batchImageNames.includes(t.image_name)}),ut),[t.image_name]),{isInBatch:r}=L(n),o=ne(),{t:s}=pe(),i=Iu(),u=sr("unifiedCanvas").isFeatureEnabled,d=sr("batches").isFeatureEnabled,{onClickAddToBoard:p}=f.useContext(W4),{currentData:m}=jv(t.image_name),h=m==null?void 0:m.metadata,v=f.useCallback(()=>{t&&o(Pv(t))},[o,t]),{recallBothPrompts:b,recallSeed:w,recallAllParameters:S}=N1(),[C]=f8(),_=f.useCallback(()=>{b(h==null?void 0:h.positive_prompt,h==null?void 0:h.negative_prompt)},[h==null?void 0:h.negative_prompt,h==null?void 0:h.positive_prompt,b]),k=f.useCallback(()=>{w(h==null?void 0:h.seed)},[h==null?void 0:h.seed,w]),P=f.useCallback(()=>{o(U4()),o($f(t))},[o,t]),E=f.useCallback(()=>{o(G4()),o(q4(t)),o(sh()),o(Ii("unifiedCanvas")),i({title:s("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},[o,t,s,i]),I=f.useCallback(()=>{console.log(h),S(h)},[h,S]),R=f.useCallback(()=>{p(t)},[t,p]),O=f.useCallback(()=>{t.board_id&&C({board_id:t.board_id,image_name:t.image_name})},[t.board_id,t.image_name,C]),D=f.useCallback(()=>{window.open(t.image_url,"_blank")},[t.image_url]),T=f.useCallback(()=>{o(p8([t.image_name]))},[o,t.image_name]);return a.jsxs(a.Fragment,{children:[a.jsx(Lr,{icon:a.jsx(h1,{}),onClickCapture:D,children:s("common.openInNewTab")}),a.jsx(Lr,{icon:a.jsx(Pf,{}),onClickCapture:_,isDisabled:(h==null?void 0:h.positive_prompt)===void 0&&(h==null?void 0:h.negative_prompt)===void 0,children:s("parameters.usePrompt")}),a.jsx(Lr,{icon:a.jsx(Pf,{}),onClickCapture:k,isDisabled:(h==null?void 0:h.seed)===void 0,children:s("parameters.useSeed")}),a.jsx(Lr,{icon:a.jsx(Pf,{}),onClickCapture:I,isDisabled:!h,children:s("parameters.useAll")}),a.jsx(Lr,{icon:a.jsx(Zf,{}),onClickCapture:P,id:"send-to-img2img",children:s("parameters.sendToImg2Img")}),u&&a.jsx(Lr,{icon:a.jsx(Zf,{}),onClickCapture:E,id:"send-to-canvas",children:s("parameters.sendToUnifiedCanvas")}),d&&a.jsx(Lr,{icon:a.jsx(su,{}),isDisabled:r,onClickCapture:T,children:"Add to Batch"}),a.jsx(Lr,{icon:a.jsx(su,{}),onClickCapture:R,children:t.board_id?"Change Board":"Add to Board"}),t.board_id&&a.jsx(Lr,{icon:a.jsx(su,{}),onClickCapture:O,children:"Remove from Board"}),a.jsx(Lr,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(mo,{}),onClickCapture:v,children:s("gallery.deleteImage")})]})},IF=f.memo(PF),EF=({imageDTO:e,children:t})=>{const n=f.useMemo(()=>we([Tt],({gallery:o})=>({selectionCount:o.selection.length}),ut),[]),{selectionCount:r}=L(n);return a.jsx(M_,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>a.jsx($u,{sx:{visibility:"visible !important"},children:r===1?a.jsx(IF,{imageDTO:e}):a.jsx(kF,{})}),children:t})},X_=f.memo(EF),OF=e=>we([Tt],t=>({selectionCount:t.gallery.selection.length,selection:t.gallery.selection,isSelected:t.gallery.selection.includes(e)}),ut),RF=e=>{const t=ne(),{imageName:n}=e,{currentData:r,isLoading:o,isError:s,isSuccess:i}=Cs(n),u=f.useMemo(()=>OF(n),[n]),{isSelected:d,selectionCount:p,selection:m}=L(u),h=f.useCallback(()=>{t(h8([n]))},[t,n]),v=f.useCallback(w=>{w.shiftKey?t(m8(n)):w.ctrlKey||w.metaKey?t(g8(n)):t(zf(n))},[t,n]),b=f.useMemo(()=>{if(p>1)return{id:"batch",payloadType:"IMAGE_NAMES",payload:{image_names:m}};if(r)return{id:"batch",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r,m,p]);return o?a.jsx(_F,{}):s||!r?a.jsx(CF,{}):a.jsx(Be,{sx:{w:"full",h:"full",touchAction:"none"},children:a.jsx(X_,{imageDTO:r,children:w=>a.jsx(Be,{position:"relative",userSelect:"none",ref:w,sx:{display:"flex",justifyContent:"center",alignItems:"center",aspectRatio:"1/1"},children:a.jsx(si,{onClick:v,imageDTO:r,draggableData:b,isSelected:d,minSize:0,onClickReset:h,isDropDisabled:!0,imageSx:{w:"full",h:"full"},isUploadDisabled:!0,resetTooltip:"Remove from batch",withResetIcon:!0,thumbnail:!0})},n)})})},MF=f.memo(RF),Z_=rt((e,t)=>a.jsx(Be,{className:"item-container",ref:t,p:1.5,children:e.children})),J_=rt((e,t)=>{const n=L(r=>r.gallery.galleryImageMinimumWidth);return a.jsx(Bi,{...e,className:"list-container",ref:t,sx:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr));`},children:e.children})}),DF=we([Tt],e=>({imageNames:e.gallery.batchImageNames}),ut),TF=()=>{const{t:e}=pe(),t=f.useRef(null),[n,r]=f.useState(null),[o,s]=R1({defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"leave",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}}),{imageNames:i}=L(DF);return f.useEffect(()=>{const{current:u}=t;return n&&u&&o({target:u,elements:{viewport:n}}),()=>{var d;return(d=s())==null?void 0:d.destroy()}},[n,o,s]),i.length?a.jsx(Be,{ref:t,"data-overlayscrollbars":"",h:"100%",children:a.jsx(Y_,{style:{height:"100%"},data:i,components:{Item:Z_,List:J_},scrollerRef:r,itemContent:(u,d)=>a.jsx(MF,{imageName:d},d)})}):a.jsx(Zi,{label:e("gallery.noImagesInGallery"),icon:vc})},AF=f.memo(TF),NF=e=>we([Tt],({gallery:t})=>({isSelected:t.selection.includes(e),selectionCount:t.selection.length,selection:t.selection}),ut),$F=e=>{const t=ne(),{imageName:n}=e,{currentData:r}=Cs(n),o=f.useMemo(()=>NF(n),[n]),{isSelected:s,selectionCount:i,selection:u}=L(o),d=f.useCallback(h=>{t(zf(n))},[t,n]),p=f.useCallback(h=>{h.stopPropagation(),r&&t(Pv(r))},[t,r]),m=f.useMemo(()=>{if(i>1)return{id:"gallery-image",payloadType:"IMAGE_NAMES",payload:{image_names:u}};if(r)return{id:"gallery-image",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r,u,i]);return r?a.jsx(Be,{sx:{w:"full",h:"full",touchAction:"none"},children:a.jsx(X_,{imageDTO:r,children:h=>a.jsx(Be,{position:"relative",userSelect:"none",ref:h,sx:{display:"flex",justifyContent:"center",alignItems:"center",aspectRatio:"1/1"},children:a.jsx(si,{onClick:d,imageDTO:r,draggableData:m,isSelected:s,minSize:0,onClickReset:p,imageSx:{w:"full",h:"full"},isDropDisabled:!0,isUploadDisabled:!0,thumbnail:!0})},n)})}):a.jsx(fc,{})},zF=f.memo($F),LF=we([Tt,K4],(e,t)=>{const{galleryImageMinimumWidth:n,selectedBoardId:r,galleryView:o,total:s,isLoading:i}=e.gallery;return{imageNames:t.map(u=>u.image_name),total:s,selectedBoardId:r,galleryView:o,galleryImageMinimumWidth:n,isLoading:i}},ut),FF=()=>{const{t:e}=pe(),t=f.useRef(null),n=f.useRef(null),[r,o]=f.useState(null),[s,i]=R1({defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"leave",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}});f.useState(!1);const u=ne(),{galleryImageMinimumWidth:d,imageNames:p,total:m,selectedBoardId:h,galleryView:v,isLoading:b}=L(LF),{data:w,isLoading:S}=v8({board_id:h},{skip:h==="all"}),C=f.useMemo(()=>{if(h==="all")return p;{const E=v==="images"?gx:vx;return((w==null?void 0:w.items)||[]).filter(R=>E.includes(R.image_category)).map(R=>R.image_name)}},[h,v,w,p]),_=f.useMemo(()=>h==="all"?m>p.length:!1,[h,p.length,m]),k=f.useMemo(()=>h==="all"?b:S,[h,b,S]),P=f.useCallback(()=>{u(Y4({categories:v==="images"?gx:vx,is_intermediate:!1,offset:C.length,limit:y8}))},[u,C.length,v]);if(f.useEffect(()=>{const{current:E}=t;return r&&E&&s({target:E,elements:{viewport:r}}),()=>{var I;return(I=i())==null?void 0:I.destroy()}},[r,s,i]),f.useMemo(()=>{if(_)return P},[_,P]),!k&&C.length===0)return a.jsx(Be,{ref:n,sx:{w:"full",h:"full"},children:a.jsx(Zi,{label:e("gallery.noImagesInGallery"),icon:vc})});if(console.log({selectedBoardId:h}),status!=="rejected")return a.jsxs(a.Fragment,{children:[a.jsx(Be,{ref:t,"data-overlayscrollbars":"",h:"100%",children:a.jsx(Y_,{style:{height:"100%"},data:C,components:{Item:Z_,List:J_},scrollerRef:o,itemContent:(E,I)=>a.jsx(zF,{imageName:I},I)})}),a.jsx(Ut,{onClick:P,isDisabled:!_,isLoading:status==="pending",loadingText:"Loading",flexShrink:0,children:e(_?"gallery.loadMore":"gallery.allImagesLoaded")})]})},BF=f.memo(FF),HF=we([Tt],e=>{const{selectedBoardId:t,galleryImageMinimumWidth:n,galleryView:r,shouldAutoSwitch:o}=e.gallery,{shouldPinGallery:s}=e.ui;return{selectedBoardId:t,shouldPinGallery:s,galleryImageMinimumWidth:n,shouldAutoSwitch:o,galleryView:r}},ut),VF=()=>{const e=ne(),{t}=pe(),n=f.useRef(null),r=f.useRef(null),{colorMode:o}=Qr(),{selectedBoardId:s,shouldPinGallery:i,galleryImageMinimumWidth:u,shouldAutoSwitch:d,galleryView:p}=L(HF),{selectedBoard:m}=kv(void 0,{selectFromResult:({data:k})=>({selectedBoard:k==null?void 0:k.find(P=>P.board_id===s)})}),h=f.useMemo(()=>s==="batch"?"Batch":m?m.board_name:"All Images",[m,s]),{isOpen:v,onToggle:b}=va(),w=k=>{e(Lf(k))},S=()=>{e(Q4()),e(js())},C=f.useCallback(()=>{e(yx("images"))},[e]),_=f.useCallback(()=>{e(yx("assets"))},[e]);return a.jsxs(_r,{sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base"},children:[a.jsxs(Be,{sx:{w:"full"},children:[a.jsxs(G,{ref:n,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[a.jsxs(dr,{isAttached:!0,children:[a.jsx(Ae,{tooltip:t("gallery.images"),"aria-label":t("gallery.images"),onClick:C,isChecked:p==="images",size:"sm",icon:a.jsx(vc,{})}),a.jsx(Ae,{tooltip:t("gallery.assets"),"aria-label":t("gallery.assets"),onClick:_,isChecked:p==="assets",size:"sm",icon:a.jsx(H$,{})})]}),a.jsxs(G,{as:Rf,onClick:b,size:"sm",variant:"ghost",sx:{w:"full",justifyContent:"center",alignItems:"center",px:2,_hover:{bg:Pe("base.100","base.800")(o)}},children:[a.jsx(tt,{noOfLines:1,sx:{w:"full",color:Pe("base.800","base.200")(o),fontWeight:600},children:h}),a.jsx(m1,{sx:{transform:v?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(da,{triggerComponent:a.jsx(Ae,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:a.jsx(p1,{})}),children:a.jsxs(G,{direction:"column",gap:2,children:[a.jsx(yt,{value:u,onChange:w,min:32,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:()=>e(Lf(64))}),a.jsx(En,{label:t("gallery.autoSwitchNewImages"),isChecked:d,onChange:k=>e(b8(k.target.checked))})]})}),a.jsx(Ae,{size:"sm","aria-label":t("gallery.pinGallery"),tooltip:`${t("gallery.pinGallery")} (Shift+G)`,onClick:S,icon:i?a.jsx(G5,{}):a.jsx(q5,{})})]}),a.jsx(Be,{children:a.jsx(jL,{isOpen:v})})]}),a.jsx(G,{ref:r,direction:"column",gap:2,h:"full",w:"full",children:s==="batch"?a.jsx(AF,{}):a.jsx(BF,{})})]})},ek=f.memo(VF),WF=we([yr,Xr,x8,er],(e,t,n,r)=>{const{shouldPinGallery:o,shouldShowGallery:s}=t,{galleryImageMinimumWidth:i}=n;return{activeTabName:e,isStaging:r,shouldPinGallery:o,shouldShowGallery:s,galleryImageMinimumWidth:i,isResizable:e!=="unifiedCanvas"}},{memoizeOptions:{resultEqualityCheck:Yt}}),UF=()=>{const e=ne(),{shouldPinGallery:t,shouldShowGallery:n,galleryImageMinimumWidth:r}=L(WF),o=()=>{e(l0(!1)),t&&e(js())};Ze("esc",()=>{e(l0(!1))},{enabled:()=>!t,preventDefault:!0},[t]);const s=32;return Ze("shift+up",()=>{if(r<256){const i=qs(r+s,32,256);e(Lf(i))}},[r]),Ze("shift+down",()=>{if(r>32){const i=qs(r-s,32,256);e(Lf(i))}},[r]),t?null:a.jsx(U5,{direction:"right",isResizable:!0,isOpen:n,onClose:o,minWidth:337,children:a.jsx(ek,{})})},GF=f.memo(UF),qF=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:i,...u}=e;return a.jsx(fr,{label:i,hasArrow:!0,placement:"top",isDisabled:!i,children:a.jsxs(Vn,{isDisabled:n,width:r,display:"flex",alignItems:"center",...o,children:[t&&a.jsx(Zn,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx,pe:4},...s,children:t}),a.jsx(s1,{...u})]})})},Pn=f.memo(qF),KF=e=>{const{imageUsage:t}=e;return!t||!X4(t)?null:a.jsxs(a.Fragment,{children:[a.jsx(tt,{children:"This image is currently in use in the following features:"}),a.jsxs(fh,{sx:{paddingInlineStart:6},children:[t.isInitialImage&&a.jsx(Oo,{children:"Image to Image"}),t.isCanvasImage&&a.jsx(Oo,{children:"Unified Canvas"}),t.isControlNetImage&&a.jsx(Oo,{children:"ControlNet"}),t.isNodesImage&&a.jsx(Oo,{children:"Node Editor"})]}),a.jsx(tt,{children:"If you delete this image, those features will immediately be reset."})]})},YF=f.memo(KF),QF=we([Tt,S8],({system:e,config:t,imageDeletion:n},r)=>{const{shouldConfirmOnDelete:o}=e,{canRestoreDeletedImagesFromBin:s}=t,{imageToDelete:i,isModalOpen:u}=n;return{shouldConfirmOnDelete:o,canRestoreDeletedImagesFromBin:s,imageToDelete:i,imageUsage:r,isModalOpen:u}},ut),XF=()=>{const e=ne(),{t}=pe(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imageToDelete:o,imageUsage:s,isModalOpen:i}=L(QF),u=f.useCallback(h=>e(Z4(!h.target.checked)),[e]),d=f.useCallback(()=>{e(bx()),e(w8(!1))},[e]),p=f.useCallback(()=>{!o||!s||(e(bx()),e(C8({imageDTO:o,imageUsage:s})))},[e,o,s]),m=f.useRef(null);return a.jsx(zu,{isOpen:i,onClose:d,leastDestructiveRef:m,isCentered:!0,children:a.jsx(Sa,{children:a.jsxs(Lu,{children:[a.jsx(xa,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),a.jsx(wa,{children:a.jsxs(G,{direction:"column",gap:3,children:[a.jsx(YF,{imageUsage:s}),a.jsx(Ia,{}),a.jsx(tt,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),a.jsx(tt,{children:t("common.areYouSure")}),a.jsx(Pn,{label:t("common.dontAskMeAgain"),isChecked:!n,onChange:u})]})}),a.jsxs(ba,{children:[a.jsx(Ut,{ref:m,onClick:d,children:"Cancel"}),a.jsx(Ut,{colorScheme:"error",onClick:p,ml:3,children:"Delete"})]})]})})})},ZF=f.memo(XF);function PS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function IS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var JF=function(e,t){return typeof t=="boolean"?t:!e},eB=function(e){return f.useReducer(JF,e)};const tB=eB;var nB=function(e,t){t===void 0&&(t=!0);var n=f.useState(!1),r=n[0],o=n[1];return f.useEffect(function(){var s=function(){return o(!0)},i=function(){return o(!1)};t&&e&&e.current&&(PS(e.current,"mouseover",s),PS(e.current,"mouseout",i));var u=e.current;return function(){t&&u&&(IS(u,"mouseover",s),IS(u,"mouseout",i))}},[t,e]),r};const tk=nB,rB=we(yo,e=>{const{isConnected:t,isProcessing:n,statusTranslationKey:r,currentIteration:o,totalIterations:s,currentStatusHasSteps:i}=e;return{isConnected:t,isProcessing:n,currentIteration:o,totalIterations:s,statusTranslationKey:r,currentStatusHasSteps:i}},ut),ES={ok:"green.400",working:"yellow.400",error:"red.400"},OS={ok:"green.600",working:"yellow.500",error:"red.500"},oB=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,statusTranslationKey:o}=L(rB),{t:s}=pe(),i=f.useRef(null),u=f.useMemo(()=>t?"working":e?"ok":"error",[t,e]),d=f.useMemo(()=>{if(n&&r)return` (${n}/${r})`},[n,r]),p=tk(i);return a.jsxs(G,{ref:i,h:"full",px:2,alignItems:"center",gap:5,children:[a.jsx(Os,{children:p&&a.jsx(vo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsxs(tt,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:OS[u],_dark:{color:ES[u]}},children:[s(o),d]})},"statusText")}),a.jsx(oo,{as:x$,sx:{boxSize:"0.5rem",color:OS[u],_dark:{color:ES[u]}}})]})};function sB(e){return ot({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 aB(e){return ot({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 iB(e){return ot({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M17 16l-4-4V8.82C14.16 8.4 15 7.3 15 6c0-1.66-1.34-3-3-3S9 4.34 9 6c0 1.3.84 2.4 2 2.82V12l-4 4H3v5h5v-3.05l4-4.2 4 4.2V21h5v-5h-4z"}}]})(e)}function lB(e){return ot({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"}}]})(e)}function cB(e){return ot({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 uB(e){return ot({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 nk(e){return ot({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"}}]})(e)}const dB=()=>{const{colorMode:e,toggleColorMode:t}=Qr(),{t:n}=pe();return a.jsx(Ae,{"aria-label":n(e==="dark"?"common.lightMode":"common.darkMode"),tooltip:n(e==="dark"?"common.lightMode":"common.darkMode"),size:"sm",icon:e==="dark"?a.jsx(W$,{fontSize:19}):a.jsx($$,{fontSize:18}),onClick:t,variant:"link"})};function fB(e){const{title:t,hotkey:n,description:r}=e;return a.jsxs(Bi,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs(Bi,{children:[a.jsx(tt,{fontWeight:600,children:t}),r&&a.jsx(tt,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),a.jsx(Be,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function pB({children:e}){const{isOpen:t,onOpen:n,onClose:r}=va(),{t:o}=pe(),s=[{title:o("hotkeys.invoke.title"),desc:o("hotkeys.invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys.cancel.title"),desc:o("hotkeys.cancel.desc"),hotkey:"Shift+X"},{title:o("hotkeys.focusPrompt.title"),desc:o("hotkeys.focusPrompt.desc"),hotkey:"Alt+A"},{title:o("hotkeys.toggleOptions.title"),desc:o("hotkeys.toggleOptions.desc"),hotkey:"O"},{title:o("hotkeys.pinOptions.title"),desc:o("hotkeys.pinOptions.desc"),hotkey:"Shift+O"},{title:o("hotkeys.toggleViewer.title"),desc:o("hotkeys.toggleViewer.desc"),hotkey:"Z"},{title:o("hotkeys.toggleGallery.title"),desc:o("hotkeys.toggleGallery.desc"),hotkey:"G"},{title:o("hotkeys.maximizeWorkSpace.title"),desc:o("hotkeys.maximizeWorkSpace.desc"),hotkey:"F"},{title:o("hotkeys.changeTabs.title"),desc:o("hotkeys.changeTabs.desc"),hotkey:"1-5"},{title:o("hotkeys.consoleToggle.title"),desc:o("hotkeys.consoleToggle.desc"),hotkey:"`"}],i=[{title:o("hotkeys.setPrompt.title"),desc:o("hotkeys.setPrompt.desc"),hotkey:"P"},{title:o("hotkeys.setSeed.title"),desc:o("hotkeys.setSeed.desc"),hotkey:"S"},{title:o("hotkeys.setParameters.title"),desc:o("hotkeys.setParameters.desc"),hotkey:"A"},{title:o("hotkeys.restoreFaces.title"),desc:o("hotkeys.restoreFaces.desc"),hotkey:"Shift+R"},{title:o("hotkeys.upscale.title"),desc:o("hotkeys.upscale.desc"),hotkey:"Shift+U"},{title:o("hotkeys.showInfo.title"),desc:o("hotkeys.showInfo.desc"),hotkey:"I"},{title:o("hotkeys.sendToImageToImage.title"),desc:o("hotkeys.sendToImageToImage.desc"),hotkey:"Shift+I"},{title:o("hotkeys.deleteImage.title"),desc:o("hotkeys.deleteImage.desc"),hotkey:"Del"},{title:o("hotkeys.closePanels.title"),desc:o("hotkeys.closePanels.desc"),hotkey:"Esc"}],u=[{title:o("hotkeys.previousImage.title"),desc:o("hotkeys.previousImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextImage.title"),desc:o("hotkeys.nextImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.toggleGalleryPin.title"),desc:o("hotkeys.toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:o("hotkeys.increaseGalleryThumbSize.title"),desc:o("hotkeys.increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:o("hotkeys.decreaseGalleryThumbSize.title"),desc:o("hotkeys.decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],d=[{title:o("hotkeys.selectBrush.title"),desc:o("hotkeys.selectBrush.desc"),hotkey:"B"},{title:o("hotkeys.selectEraser.title"),desc:o("hotkeys.selectEraser.desc"),hotkey:"E"},{title:o("hotkeys.decreaseBrushSize.title"),desc:o("hotkeys.decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys.increaseBrushSize.title"),desc:o("hotkeys.increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys.decreaseBrushOpacity.title"),desc:o("hotkeys.decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys.increaseBrushOpacity.title"),desc:o("hotkeys.increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys.moveTool.title"),desc:o("hotkeys.moveTool.desc"),hotkey:"V"},{title:o("hotkeys.fillBoundingBox.title"),desc:o("hotkeys.fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys.eraseBoundingBox.title"),desc:o("hotkeys.eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys.colorPicker.title"),desc:o("hotkeys.colorPicker.desc"),hotkey:"C"},{title:o("hotkeys.toggleSnap.title"),desc:o("hotkeys.toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys.quickToggleMove.title"),desc:o("hotkeys.quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys.toggleLayer.title"),desc:o("hotkeys.toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys.clearMask.title"),desc:o("hotkeys.clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys.hideMask.title"),desc:o("hotkeys.hideMask.desc"),hotkey:"H"},{title:o("hotkeys.showHideBoundingBox.title"),desc:o("hotkeys.showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys.mergeVisible.title"),desc:o("hotkeys.mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys.saveToGallery.title"),desc:o("hotkeys.saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys.copyToClipboard.title"),desc:o("hotkeys.copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys.downloadImage.title"),desc:o("hotkeys.downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys.undoStroke.title"),desc:o("hotkeys.undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys.redoStroke.title"),desc:o("hotkeys.redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys.resetView.title"),desc:o("hotkeys.resetView.desc"),hotkey:"R"},{title:o("hotkeys.previousStagingImage.title"),desc:o("hotkeys.previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextStagingImage.title"),desc:o("hotkeys.nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.acceptStagingImage.title"),desc:o("hotkeys.acceptStagingImage.desc"),hotkey:"Enter"}],p=m=>a.jsx(G,{flexDir:"column",gap:4,children:m.map((h,v)=>a.jsxs(G,{flexDir:"column",px:2,gap:4,children:[a.jsx(fB,{title:h.title,description:h.desc,hotkey:h.hotkey}),v<m.length-1&&a.jsx(Ia,{})]},v))});return a.jsxs(a.Fragment,{children:[f.cloneElement(e,{onClick:n}),a.jsxs(mu,{isOpen:t,onClose:r,children:[a.jsx(Sa,{}),a.jsxs(gu,{children:[a.jsx(xa,{children:o("hotkeys.keyboardShortcuts")}),a.jsx(Jv,{}),a.jsx(wa,{children:a.jsx(G3,{allowMultiple:!0,children:a.jsxs(G,{flexDir:"column",gap:2,children:[a.jsxs(Qc,{children:[a.jsx(Kc,{children:a.jsxs(G,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.appHotkeys")}),a.jsx(Yc,{})]})}),a.jsx(Xc,{children:p(s)})]}),a.jsxs(Qc,{children:[a.jsx(Kc,{children:a.jsxs(G,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.generalHotkeys")}),a.jsx(Yc,{})]})}),a.jsx(Xc,{children:p(i)})]}),a.jsxs(Qc,{children:[a.jsx(Kc,{children:a.jsxs(G,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),a.jsx(Yc,{})]})}),a.jsx(Xc,{children:p(u)})]}),a.jsxs(Qc,{children:[a.jsx(Kc,{children:a.jsxs(G,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),a.jsx(Yc,{})]})}),a.jsx(Xc,{children:p(d)})]})]})})}),a.jsx(ba,{})]})]})]})}const rk=()=>{const{data:e}=_8(),t=f.useRef(null),n=tk(t);return a.jsxs(G,{alignItems:"center",gap:3,ps:1,ref:t,children:[a.jsx(Eu,{src:k8,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),a.jsxs(G,{sx:{gap:3,alignItems:"center"},children:[a.jsxs(tt,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",a.jsx("strong",{children:"ai"})]}),a.jsx(Os,{children:n&&e&&a.jsx(vo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(tt,{sx:{fontWeight:600,marginTop:1,color:"base.300",fontSize:14},variant:"subtext",children:e.version})},"statusText")})]})]})},hB={ar:wr.t("common.langArabic",{lng:"ar"}),nl:wr.t("common.langDutch",{lng:"nl"}),en:wr.t("common.langEnglish",{lng:"en"}),fr:wr.t("common.langFrench",{lng:"fr"}),de:wr.t("common.langGerman",{lng:"de"}),he:wr.t("common.langHebrew",{lng:"he"}),it:wr.t("common.langItalian",{lng:"it"}),ja:wr.t("common.langJapanese",{lng:"ja"}),ko:wr.t("common.langKorean",{lng:"ko"}),pl:wr.t("common.langPolish",{lng:"pl"}),pt_BR:wr.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:wr.t("common.langPortuguese",{lng:"pt"}),ru:wr.t("common.langRussian",{lng:"ru"}),zh_CN:wr.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:wr.t("common.langSpanish",{lng:"es"}),uk:wr.t("common.langUkranian",{lng:"ua"})};function mB(){const{t:e}=pe(),t=ne(),n=L(J4);return a.jsxs(ph,{closeOnSelect:!1,children:[a.jsx(fr,{label:e("common.languagePickerLabel"),hasArrow:!0,children:a.jsx(hh,{as:ti,icon:a.jsx(jF,{}),variant:"link","aria-label":e("common.languagePickerLabel"),fontSize:22,minWidth:8})}),a.jsx($u,{children:a.jsx(Zv,{value:n,children:Xs(hB,(r,o)=>a.jsx(hu,{value:o,onClick:()=>t(j8(o)),children:r},o))})})]})}function gB(e){const t=f.createContext(null);return[({children:o,value:s})=>z.createElement(t.Provider,{value:s},o),()=>{const o=f.useContext(t);if(o===null)throw new Error(e);return o}]}function ok(e){return Array.isArray(e)?e:[e]}const vB=()=>{};function yB(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||vB:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function sk({data:e}){const t=[],n=[],r=e.reduce((o,s,i)=>(s.group?o[s.group]?o[s.group].push(i):o[s.group]=[i]:n.push(i),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(s=>e[s]))}),t.push(...n.map(o=>e[o])),t}function ak(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==z.Fragment:!1}function ik(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ik(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function lk(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=ik(t))&&(r&&(r+=" "),r+=n);return r}const bB={app:100,modal:200,popover:300,overlay:400,max:9999};function $1(e){return bB[e]}function xB(e,t){const n=f.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,o)=>r===t[o]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const SB=P8({key:"mantine",prepend:!0});function wB(){return F3()||SB}var CB=Object.defineProperty,RS=Object.getOwnPropertySymbols,_B=Object.prototype.hasOwnProperty,kB=Object.prototype.propertyIsEnumerable,MS=(e,t,n)=>t in e?CB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jB=(e,t)=>{for(var n in t||(t={}))_B.call(t,n)&&MS(e,n,t[n]);if(RS)for(var n of RS(t))kB.call(t,n)&&MS(e,n,t[n]);return e};const Lg="ref";function PB(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(Lg in n))return{args:e,ref:t};t=n[Lg];const r=jB({},n);return delete r[Lg],{args:[r],ref:t}}const{cssFactory:IB}=(()=>{function e(n,r,o){const s=[],i=O8(n,s,o);return s.length<2?o:i+r(s)}function t(n){const{cache:r}=n,o=(...i)=>{const{ref:u,args:d}=PB(i),p=I8(d,r.registered);return E8(r,p,!1),`${r.key}-${p.name}${u===void 0?"":` ${u}`}`};return{css:o,cx:(...i)=>e(r.registered,o,lk(i))}}return{cssFactory:t}})();function ck(){const e=wB();return xB(()=>IB({cache:e}),[e])}function EB({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const i=n.reduce((u,d)=>(Object.keys(d.classNames).forEach(p=>{typeof u[p]!="string"?u[p]=`${d.classNames[p]}`:u[p]=`${u[p]} ${d.classNames[p]}`}),u),{});return Object.keys(t).reduce((u,d)=>(u[d]=e(t[d],i[d],r!=null&&r[d],Array.isArray(o)?o.filter(Boolean).map(p=>`${(s==null?void 0:s.key)||"mantine"}-${p}-${d}`).join(" "):o?`${(s==null?void 0:s.key)||"mantine"}-${o}-${d}`:null),u),{})}var OB=Object.defineProperty,DS=Object.getOwnPropertySymbols,RB=Object.prototype.hasOwnProperty,MB=Object.prototype.propertyIsEnumerable,TS=(e,t,n)=>t in e?OB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fg=(e,t)=>{for(var n in t||(t={}))RB.call(t,n)&&TS(e,n,t[n]);if(DS)for(var n of DS(t))MB.call(t,n)&&TS(e,n,t[n]);return e};function H0(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=Fg(Fg({},e[n]),t[n]):e[n]=Fg({},t[n])}),e}function AS(e,t,n,r){const o=s=>typeof s=="function"?s(t,n||{},r):s||{};return Array.isArray(e)?e.map(s=>o(s.styles)).reduce((s,i)=>H0(s,i),{}):o(e)}function DB({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,i)=>(i.variants&&r in i.variants&&H0(s,i.variants[r](t,n,{variant:r,size:o})),i.sizes&&o in i.sizes&&H0(s,i.sizes[o](t,n,{variant:r,size:o})),s),{})}function Zr(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=Pa(),i=sR(o==null?void 0:o.name),u=F3(),d={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:p,cx:m}=ck(),h=t(s,r,d),v=AS(o==null?void 0:o.styles,s,r,d),b=AS(i,s,r,d),w=DB({ctx:i,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),S=Object.fromEntries(Object.keys(h).map(C=>{const _=m({[p(h[C])]:!(o!=null&&o.unstyled)},p(w[C]),p(b[C]),p(v[C]));return[C,_]}));return{classes:EB({cx:m,classes:S,context:i,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:u}),cx:m,theme:s}}return n}function NS(e){return`___ref-${e||""}`}var TB=Object.defineProperty,AB=Object.defineProperties,NB=Object.getOwnPropertyDescriptors,$S=Object.getOwnPropertySymbols,$B=Object.prototype.hasOwnProperty,zB=Object.prototype.propertyIsEnumerable,zS=(e,t,n)=>t in e?TB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bc=(e,t)=>{for(var n in t||(t={}))$B.call(t,n)&&zS(e,n,t[n]);if($S)for(var n of $S(t))zB.call(t,n)&&zS(e,n,t[n]);return e},Hc=(e,t)=>AB(e,NB(t));const Vc={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${Le(10)})`},transitionProperty:"transform, opacity"},nf={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(-${Le(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${Le(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Le(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Le(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:Hc(Bc({},Vc),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Hc(Bc({},Vc),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Hc(Bc({},Vc),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Hc(Bc({},Vc),{common:{transformOrigin:"top left"}}),"pop-top-right":Hc(Bc({},Vc),{common:{transformOrigin:"top right"}})},LS=["mousedown","touchstart"];function LB(e,t,n){const r=f.useRef();return f.useEffect(()=>{const o=s=>{const{target:i}=s??{};if(Array.isArray(n)){const u=(i==null?void 0:i.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(i)&&i.tagName!=="HTML";n.every(p=>!!p&&!s.composedPath().includes(p))&&!u&&e()}else r.current&&!r.current.contains(i)&&e()};return(t||LS).forEach(s=>document.addEventListener(s,o)),()=>{(t||LS).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function FB(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function BB(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function HB(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=f.useState(n?t:BB(e,t)),s=f.useRef();return f.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),FB(s.current,i=>o(i.matches))},[e]),r}const uk=typeof document<"u"?f.useLayoutEffect:f.useEffect;function xs(e,t){const n=f.useRef(!1);f.useEffect(()=>()=>{n.current=!1},[]),f.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function VB({opened:e,shouldReturnFocus:t=!0}){const n=f.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return xs(()=>{let o=-1;const s=i=>{i.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const WB=/input|select|textarea|button|object/,dk="a, input, select, textarea, button, object, [tabindex]";function UB(e){return e.style.display==="none"}function GB(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(UB(n))return!1;n=n.parentNode}return!0}function fk(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function V0(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(fk(e));return(WB.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&GB(e)}function pk(e){const t=fk(e);return(Number.isNaN(t)||t>=0)&&V0(e)}function qB(e){return Array.from(e.querySelectorAll(dk)).filter(pk)}function KB(e,t){const n=qB(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();if(!(r===o.activeElement||e===o.activeElement))return;t.preventDefault();const i=n[t.shiftKey?n.length-1:0];i&&i.focus()}function z1(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function YB(e,t="body > :not(script)"){const n=z1(),r=Array.from(document.querySelectorAll(t)).map(o=>{var s;if((s=o==null?void 0:o.shadowRoot)!=null&&s.contains(e)||o.contains(e))return;const i=o.getAttribute("aria-hidden"),u=o.getAttribute("data-hidden"),d=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!u&&!d&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:u||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function QB(e=!0){const t=f.useRef(),n=f.useRef(null),r=s=>{let i=s.querySelector("[data-autofocus]");if(!i){const u=Array.from(s.querySelectorAll(dk));i=u.find(pk)||u.find(V0)||null,!i&&V0(s)&&(i=s)}i&&i.focus({preventScroll:!0})},o=f.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=YB(s),t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)}},[e]);return f.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=i=>{i.key==="Tab"&&t.current&&KB(t.current,i)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const XB=z["useId".toString()]||(()=>{});function ZB(){const e=XB();return e?`mantine-${e.replace(/:/g,"")}`:""}function L1(e){const t=ZB(),[n,r]=f.useState(t);return uk(()=>{r(z1())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function FS(e,t,n){f.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function hk(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function JB(...e){return t=>{e.forEach(n=>hk(n,t))}}function Uu(...e){return f.useCallback(JB(...e),e)}function xu({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=f.useState(t!==void 0?t:n),i=u=>{s(u),r==null||r(u)};return e!==void 0?[e,r,!0]:[o,i,!1]}function mk(e,t){return HB("(prefers-reduced-motion: reduce)",e,t)}const eH=e=>e<.5?2*e*e:-1+(4-2*e)*e,tH=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const i=!!n,d=(n||document.body).getBoundingClientRect(),p=t.getBoundingClientRect(),m=h=>p[h]-d[h];if(e==="y"){const h=m("top");if(h===0)return 0;if(r==="start"){const b=h-o;return b<=p.height*(s?0:1)||!s?b:0}const v=i?d.height:window.innerHeight;if(r==="end"){const b=h+o-v+p.height;return b>=-p.height*(s?0:1)||!s?b:0}return r==="center"?h-v/2+p.height/2:0}if(e==="x"){const h=m("left");if(h===0)return 0;if(r==="start"){const b=h-o;return b<=p.width||!s?b:0}const v=i?d.width:window.innerWidth;if(r==="end"){const b=h+o-v+p.width;return b>=-p.width||!s?b:0}return r==="center"?h-v/2+p.width/2:0}return 0},nH=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const n=e==="y"?"scrollTop":"scrollLeft";if(t)return t[n];const{body:r,documentElement:o}=document;return r[n]+o[n]},rH=({axis:e,parent:t,distance:n})=>{if(!t&&typeof document>"u")return;const r=e==="y"?"scrollTop":"scrollLeft";if(t)t[r]=n;else{const{body:o,documentElement:s}=document;o[r]=n,s[r]=n}};function gk({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=eH,offset:o=0,cancelable:s=!0,isList:i=!1}={}){const u=f.useRef(0),d=f.useRef(0),p=f.useRef(!1),m=f.useRef(null),h=f.useRef(null),v=mk(),b=()=>{u.current&&cancelAnimationFrame(u.current)},w=f.useCallback(({alignment:C="start"}={})=>{var _;p.current=!1,u.current&&b();const k=(_=nH({parent:m.current,axis:t}))!=null?_:0,P=tH({parent:m.current,target:h.current,axis:t,alignment:C,offset:o,isList:i})-(m.current?0:k);function E(){d.current===0&&(d.current=performance.now());const R=performance.now()-d.current,O=v||e===0?1:R/e,D=k+P*r(O);rH({parent:m.current,axis:t,distance:D}),!p.current&&O<1?u.current=requestAnimationFrame(E):(typeof n=="function"&&n(),d.current=0,u.current=0,b())}E()},[t,e,r,i,o,n,v]),S=()=>{s&&(p.current=!0)};return FS("wheel",S,{passive:!0}),FS("touchmove",S,{passive:!0}),f.useEffect(()=>b,[]),{scrollableRef:m,targetRef:h,scrollIntoView:w,cancel:b}}var BS=Object.getOwnPropertySymbols,oH=Object.prototype.hasOwnProperty,sH=Object.prototype.propertyIsEnumerable,aH=(e,t)=>{var n={};for(var r in e)oH.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&BS)for(var r of BS(e))t.indexOf(r)<0&&sH.call(e,r)&&(n[r]=e[r]);return n};function zh(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:i,ml:u,mr:d,p,px:m,py:h,pt:v,pb:b,pl:w,pr:S,bg:C,c:_,opacity:k,ff:P,fz:E,fw:I,lts:R,ta:O,lh:D,fs:T,tt:$,td:B,w:ee,miw:F,maw:N,h:H,mih:K,mah:A,bgsz:U,bgp:V,bgr:W,bga:re,pos:be,top:ce,left:se,bottom:X,right:ie,inset:de,display:xe}=t,oe=aH(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:aR({m:n,mx:r,my:o,mt:s,mb:i,ml:u,mr:d,p,px:m,py:h,pt:v,pb:b,pl:w,pr:S,bg:C,c:_,opacity:k,ff:P,fz:E,fw:I,lts:R,ta:O,lh:D,fs:T,tt:$,td:B,w:ee,miw:F,maw:N,h:H,mih:K,mah:A,bgsz:U,bgp:V,bgr:W,bga:re,pos:be,top:ce,left:se,bottom:X,right:ie,inset:de,display:xe}),rest:oe}}function iH(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>Kx(Nt({size:r,sizes:t.breakpoints}))-Kx(Nt({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function lH({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return iH(e,t).reduce((i,u)=>{if(u==="base"&&e.base!==void 0){const p=n(e.base,t);return Array.isArray(r)?(r.forEach(m=>{i[m]=p}),i):(i[r]=p,i)}const d=n(e[u],t);return Array.isArray(r)?(i[t.fn.largerThan(u)]={},r.forEach(p=>{i[t.fn.largerThan(u)][p]=d}),i):(i[t.fn.largerThan(u)]={[r]:d},i)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,i)=>(s[i]=o,s),{}):{[r]:o}}function cH(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function uH(e){return Le(e)}function dH(e){return e}function fH(e,t){return Nt({size:e,sizes:t.fontSizes})}const pH=["-xs","-sm","-md","-lg","-xl"];function hH(e,t){return pH.includes(e)?`calc(${Nt({size:e.replace("-",""),sizes:t.spacing})} * -1)`:Nt({size:e,sizes:t.spacing})}const mH={identity:dH,color:cH,size:uH,fontSize:fH,spacing:hH},gH={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"}};var vH=Object.defineProperty,HS=Object.getOwnPropertySymbols,yH=Object.prototype.hasOwnProperty,bH=Object.prototype.propertyIsEnumerable,VS=(e,t,n)=>t in e?vH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WS=(e,t)=>{for(var n in t||(t={}))yH.call(t,n)&&VS(e,n,t[n]);if(HS)for(var n of HS(t))bH.call(t,n)&&VS(e,n,t[n]);return e};function US(e,t,n=gH){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(lH({value:e[s],getValue:mH[n[s].type],property:n[s].property,theme:t})),o),[]).reduce((o,s)=>(Object.keys(s).forEach(i=>{typeof s[i]=="object"&&s[i]!==null&&i in o?o[i]=WS(WS({},o[i]),s[i]):o[i]=s[i]}),o),{})}function GS(e,t){return typeof e=="function"?e(t):e}function xH(e,t,n){const r=Pa(),{css:o,cx:s}=ck();return Array.isArray(e)?s(n,o(US(t,r)),e.map(i=>o(GS(i,r)))):s(n,o(GS(e,r)),o(US(t,r)))}var SH=Object.defineProperty,dp=Object.getOwnPropertySymbols,vk=Object.prototype.hasOwnProperty,yk=Object.prototype.propertyIsEnumerable,qS=(e,t,n)=>t in e?SH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wH=(e,t)=>{for(var n in t||(t={}))vk.call(t,n)&&qS(e,n,t[n]);if(dp)for(var n of dp(t))yk.call(t,n)&&qS(e,n,t[n]);return e},CH=(e,t)=>{var n={};for(var r in e)vk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dp)for(var r of dp(e))t.indexOf(r)<0&&yk.call(e,r)&&(n[r]=e[r]);return n};const bk=f.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:i}=n,u=CH(n,["className","component","style","sx"]);const{systemStyles:d,rest:p}=zh(u),m=o||"div";return z.createElement(m,wH({ref:t,className:xH(i,d,r),style:s},p))});bk.displayName="@mantine/core/Box";const go=bk;var _H=Object.defineProperty,kH=Object.defineProperties,jH=Object.getOwnPropertyDescriptors,KS=Object.getOwnPropertySymbols,PH=Object.prototype.hasOwnProperty,IH=Object.prototype.propertyIsEnumerable,YS=(e,t,n)=>t in e?_H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QS=(e,t)=>{for(var n in t||(t={}))PH.call(t,n)&&YS(e,n,t[n]);if(KS)for(var n of KS(t))IH.call(t,n)&&YS(e,n,t[n]);return e},EH=(e,t)=>kH(e,jH(t)),OH=Zr(e=>({root:EH(QS(QS({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const RH=OH;var MH=Object.defineProperty,fp=Object.getOwnPropertySymbols,xk=Object.prototype.hasOwnProperty,Sk=Object.prototype.propertyIsEnumerable,XS=(e,t,n)=>t in e?MH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DH=(e,t)=>{for(var n in t||(t={}))xk.call(t,n)&&XS(e,n,t[n]);if(fp)for(var n of fp(t))Sk.call(t,n)&&XS(e,n,t[n]);return e},TH=(e,t)=>{var n={};for(var r in e)xk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fp)for(var r of fp(e))t.indexOf(r)<0&&Sk.call(e,r)&&(n[r]=e[r]);return n};const wk=f.forwardRef((e,t)=>{const n=br("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:i}=n,u=TH(n,["className","component","unstyled","variant"]),{classes:d,cx:p}=RH(null,{name:"UnstyledButton",unstyled:s,variant:i});return z.createElement(go,DH({component:o,ref:t,className:p(d.root,r),type:o==="button"?"button":void 0},u))});wk.displayName="@mantine/core/UnstyledButton";const AH=wk;var NH=Object.defineProperty,$H=Object.defineProperties,zH=Object.getOwnPropertyDescriptors,ZS=Object.getOwnPropertySymbols,LH=Object.prototype.hasOwnProperty,FH=Object.prototype.propertyIsEnumerable,JS=(e,t,n)=>t in e?NH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W0=(e,t)=>{for(var n in t||(t={}))LH.call(t,n)&&JS(e,n,t[n]);if(ZS)for(var n of ZS(t))FH.call(t,n)&&JS(e,n,t[n]);return e},ew=(e,t)=>$H(e,zH(t));const BH=["subtle","filled","outline","light","default","transparent","gradient"],rf={xs:Le(18),sm:Le(22),md:Le(28),lg:Le(34),xl:Le(44)};function HH({variant:e,theme:t,color:n,gradient:r}){const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:BH.includes(e)?W0({border:`${Le(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var VH=Zr((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:ew(W0({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:Nt({size:s,sizes:rf}),minHeight:Nt({size:s,sizes:rf}),width:Nt({size:s,sizes:rf}),minWidth:Nt({size:s,sizes:rf})},HH({variant:o,theme:e,color:n,gradient:r})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":ew(W0({content:'""'},e.fn.cover(Le(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}})}));const WH=VH;var UH=Object.defineProperty,pp=Object.getOwnPropertySymbols,Ck=Object.prototype.hasOwnProperty,_k=Object.prototype.propertyIsEnumerable,tw=(e,t,n)=>t in e?UH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GH=(e,t)=>{for(var n in t||(t={}))Ck.call(t,n)&&tw(e,n,t[n]);if(pp)for(var n of pp(t))_k.call(t,n)&&tw(e,n,t[n]);return e},qH=(e,t)=>{var n={};for(var r in e)Ck.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pp)for(var r of pp(e))t.indexOf(r)<0&&_k.call(e,r)&&(n[r]=e[r]);return n};function KH(e){var t=e,{size:n,color:r}=t,o=qH(t,["size","color"]);return z.createElement("svg",GH({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,width:n},o),z.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},z.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),z.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),z.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},z.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),z.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),z.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},z.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),z.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),z.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},z.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),z.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),z.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},z.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),z.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var YH=Object.defineProperty,hp=Object.getOwnPropertySymbols,kk=Object.prototype.hasOwnProperty,jk=Object.prototype.propertyIsEnumerable,nw=(e,t,n)=>t in e?YH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QH=(e,t)=>{for(var n in t||(t={}))kk.call(t,n)&&nw(e,n,t[n]);if(hp)for(var n of hp(t))jk.call(t,n)&&nw(e,n,t[n]);return e},XH=(e,t)=>{var n={};for(var r in e)kk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hp)for(var r of hp(e))t.indexOf(r)<0&&jk.call(e,r)&&(n[r]=e[r]);return n};function ZH(e){var t=e,{size:n,color:r}=t,o=XH(t,["size","color"]);return z.createElement("svg",QH({width:n,height:n,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r},o),z.createElement("g",{fill:"none",fillRule:"evenodd"},z.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},z.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),z.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},z.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var JH=Object.defineProperty,mp=Object.getOwnPropertySymbols,Pk=Object.prototype.hasOwnProperty,Ik=Object.prototype.propertyIsEnumerable,rw=(e,t,n)=>t in e?JH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eV=(e,t)=>{for(var n in t||(t={}))Pk.call(t,n)&&rw(e,n,t[n]);if(mp)for(var n of mp(t))Ik.call(t,n)&&rw(e,n,t[n]);return e},tV=(e,t)=>{var n={};for(var r in e)Pk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mp)for(var r of mp(e))t.indexOf(r)<0&&Ik.call(e,r)&&(n[r]=e[r]);return n};function nV(e){var t=e,{size:n,color:r}=t,o=tV(t,["size","color"]);return z.createElement("svg",eV({width:n,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r},o),z.createElement("circle",{cx:"15",cy:"15",r:"15"},z.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),z.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),z.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},z.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),z.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),z.createElement("circle",{cx:"105",cy:"15",r:"15"},z.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),z.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var rV=Object.defineProperty,gp=Object.getOwnPropertySymbols,Ek=Object.prototype.hasOwnProperty,Ok=Object.prototype.propertyIsEnumerable,ow=(e,t,n)=>t in e?rV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oV=(e,t)=>{for(var n in t||(t={}))Ek.call(t,n)&&ow(e,n,t[n]);if(gp)for(var n of gp(t))Ok.call(t,n)&&ow(e,n,t[n]);return e},sV=(e,t)=>{var n={};for(var r in e)Ek.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gp)for(var r of gp(e))t.indexOf(r)<0&&Ok.call(e,r)&&(n[r]=e[r]);return n};const Bg={bars:KH,oval:ZH,dots:nV},aV={xs:Le(18),sm:Le(22),md:Le(36),lg:Le(44),xl:Le(58)},iV={size:"md"};function Rk(e){const t=br("Loader",iV,e),{size:n,color:r,variant:o}=t,s=sV(t,["size","color","variant"]),i=Pa(),u=o in Bg?o:i.loader;return z.createElement(go,oV({role:"presentation",component:Bg[u]||Bg.bars,size:Nt({size:n,sizes:aV}),color:i.fn.variant({variant:"filled",primaryFallback:!1,color:r||i.primaryColor}).background},s))}Rk.displayName="@mantine/core/Loader";var lV=Object.defineProperty,vp=Object.getOwnPropertySymbols,Mk=Object.prototype.hasOwnProperty,Dk=Object.prototype.propertyIsEnumerable,sw=(e,t,n)=>t in e?lV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aw=(e,t)=>{for(var n in t||(t={}))Mk.call(t,n)&&sw(e,n,t[n]);if(vp)for(var n of vp(t))Dk.call(t,n)&&sw(e,n,t[n]);return e},cV=(e,t)=>{var n={};for(var r in e)Mk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vp)for(var r of vp(e))t.indexOf(r)<0&&Dk.call(e,r)&&(n[r]=e[r]);return n};const uV={color:"gray",size:"md",variant:"subtle"},Tk=f.forwardRef((e,t)=>{const n=br("ActionIcon",uV,e),{className:r,color:o,children:s,radius:i,size:u,variant:d,gradient:p,disabled:m,loaderProps:h,loading:v,unstyled:b,__staticSelector:w}=n,S=cV(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:C,cx:_,theme:k}=WH({radius:i,color:o,gradient:p},{name:["ActionIcon",w],unstyled:b,size:u,variant:d}),P=z.createElement(Rk,aw({color:k.fn.variant({color:o,variant:d}).color,size:"100%","data-action-icon-loader":!0},h));return z.createElement(AH,aw({className:_(C.root,r),ref:t,disabled:m,"data-disabled":m||void 0,"data-loading":v||void 0,unstyled:b},S),v?P:s)});Tk.displayName="@mantine/core/ActionIcon";const dV=Tk;var fV=Object.defineProperty,pV=Object.defineProperties,hV=Object.getOwnPropertyDescriptors,yp=Object.getOwnPropertySymbols,Ak=Object.prototype.hasOwnProperty,Nk=Object.prototype.propertyIsEnumerable,iw=(e,t,n)=>t in e?fV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mV=(e,t)=>{for(var n in t||(t={}))Ak.call(t,n)&&iw(e,n,t[n]);if(yp)for(var n of yp(t))Nk.call(t,n)&&iw(e,n,t[n]);return e},gV=(e,t)=>pV(e,hV(t)),vV=(e,t)=>{var n={};for(var r in e)Ak.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yp)for(var r of yp(e))t.indexOf(r)<0&&Nk.call(e,r)&&(n[r]=e[r]);return n};function $k(e){const t=br("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,i=vV(t,["children","target","className","innerRef"]),u=Pa(),[d,p]=f.useState(!1),m=f.useRef();return uk(()=>(p(!0),m.current=r?typeof r=="string"?document.querySelector(r):r:document.createElement("div"),r||document.body.appendChild(m.current),()=>{!r&&document.body.removeChild(m.current)}),[r]),d?dc.createPortal(z.createElement("div",gV(mV({className:o,dir:u.dir},i),{ref:s}),n),m.current):null}$k.displayName="@mantine/core/Portal";var yV=Object.defineProperty,bp=Object.getOwnPropertySymbols,zk=Object.prototype.hasOwnProperty,Lk=Object.prototype.propertyIsEnumerable,lw=(e,t,n)=>t in e?yV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bV=(e,t)=>{for(var n in t||(t={}))zk.call(t,n)&&lw(e,n,t[n]);if(bp)for(var n of bp(t))Lk.call(t,n)&&lw(e,n,t[n]);return e},xV=(e,t)=>{var n={};for(var r in e)zk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bp)for(var r of bp(e))t.indexOf(r)<0&&Lk.call(e,r)&&(n[r]=e[r]);return n};function Fk(e){var t=e,{withinPortal:n=!0,children:r}=t,o=xV(t,["withinPortal","children"]);return n?z.createElement($k,bV({},o),r):z.createElement(z.Fragment,null,r)}Fk.displayName="@mantine/core/OptionalPortal";var SV=Object.defineProperty,cw=Object.getOwnPropertySymbols,wV=Object.prototype.hasOwnProperty,CV=Object.prototype.propertyIsEnumerable,uw=(e,t,n)=>t in e?SV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_V=(e,t)=>{for(var n in t||(t={}))wV.call(t,n)&&uw(e,n,t[n]);if(cw)for(var n of cw(t))CV.call(t,n)&&uw(e,n,t[n]);return e};function Bk(e){return z.createElement("svg",_V({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),z.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}Bk.displayName="@mantine/core/CloseIcon";var kV=Object.defineProperty,xp=Object.getOwnPropertySymbols,Hk=Object.prototype.hasOwnProperty,Vk=Object.prototype.propertyIsEnumerable,dw=(e,t,n)=>t in e?kV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jV=(e,t)=>{for(var n in t||(t={}))Hk.call(t,n)&&dw(e,n,t[n]);if(xp)for(var n of xp(t))Vk.call(t,n)&&dw(e,n,t[n]);return e},PV=(e,t)=>{var n={};for(var r in e)Hk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xp)for(var r of xp(e))t.indexOf(r)<0&&Vk.call(e,r)&&(n[r]=e[r]);return n};const IV={xs:Le(12),sm:Le(16),md:Le(20),lg:Le(28),xl:Le(34)},EV={size:"sm"},Wk=f.forwardRef((e,t)=>{const n=br("CloseButton",EV,e),{iconSize:r,size:o,children:s}=n,i=PV(n,["iconSize","size","children"]),u=Le(r||IV[o]);return z.createElement(dV,jV({ref:t,__staticSelector:"CloseButton",size:o},i),s||z.createElement(Bk,{width:u,height:u}))});Wk.displayName="@mantine/core/CloseButton";const Uk=Wk;var OV=Object.defineProperty,RV=Object.defineProperties,MV=Object.getOwnPropertyDescriptors,fw=Object.getOwnPropertySymbols,DV=Object.prototype.hasOwnProperty,TV=Object.prototype.propertyIsEnumerable,pw=(e,t,n)=>t in e?OV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,of=(e,t)=>{for(var n in t||(t={}))DV.call(t,n)&&pw(e,n,t[n]);if(fw)for(var n of fw(t))TV.call(t,n)&&pw(e,n,t[n]);return e},AV=(e,t)=>RV(e,MV(t));function NV({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function $V({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function zV(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function LV({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var FV=Zr((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:i,gradient:u,weight:d,transform:p,align:m,strikethrough:h,italic:v},{size:b})=>{const w=e.fn.variant({variant:"gradient",gradient:u});return{root:AV(of(of(of(of({},e.fn.fontStyles()),e.fn.focusStyles()),zV(n)),LV({theme:e,truncate:r})),{color:$V({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||b===void 0?"inherit":Nt({size:b,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:NV({underline:i,strikethrough:h}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":d,textTransform:p,textAlign:m,fontStyle:v?"italic":void 0}),gradient:{backgroundImage:w.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const BV=FV;var HV=Object.defineProperty,Sp=Object.getOwnPropertySymbols,Gk=Object.prototype.hasOwnProperty,qk=Object.prototype.propertyIsEnumerable,hw=(e,t,n)=>t in e?HV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VV=(e,t)=>{for(var n in t||(t={}))Gk.call(t,n)&&hw(e,n,t[n]);if(Sp)for(var n of Sp(t))qk.call(t,n)&&hw(e,n,t[n]);return e},WV=(e,t)=>{var n={};for(var r in e)Gk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sp)for(var r of Sp(e))t.indexOf(r)<0&&qk.call(e,r)&&(n[r]=e[r]);return n};const UV={variant:"text"},Kk=f.forwardRef((e,t)=>{const n=br("Text",UV,e),{className:r,size:o,weight:s,transform:i,color:u,align:d,variant:p,lineClamp:m,truncate:h,gradient:v,inline:b,inherit:w,underline:S,strikethrough:C,italic:_,classNames:k,styles:P,unstyled:E,span:I,__staticSelector:R}=n,O=WV(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:D,cx:T}=BV({color:u,lineClamp:m,truncate:h,inline:b,inherit:w,underline:S,strikethrough:C,italic:_,weight:s,transform:i,align:d,gradient:v},{unstyled:E,name:R||"Text",variant:p,size:o});return z.createElement(go,VV({ref:t,className:T(D.root,{[D.gradient]:p==="gradient"},r),component:I?"span":"div"},O))});Kk.displayName="@mantine/core/Text";const Yl=Kk,sf={xs:Le(1),sm:Le(2),md:Le(3),lg:Le(4),xl:Le(5)};function af(e,t){const n=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?n:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var GV=Zr((e,{color:t},{size:n,variant:r})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:Le(1),borderTop:`${Nt({size:n,sizes:sf})} ${r} ${af(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${Nt({size:n,sizes:sf})} ${r} ${af(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:Le(Nt({size:n,sizes:sf})),borderTopColor:af(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:Le(Nt({size:n,sizes:sf})),borderLeftColor:af(e,t),borderLeftStyle:r}}));const qV=GV;var KV=Object.defineProperty,YV=Object.defineProperties,QV=Object.getOwnPropertyDescriptors,wp=Object.getOwnPropertySymbols,Yk=Object.prototype.hasOwnProperty,Qk=Object.prototype.propertyIsEnumerable,mw=(e,t,n)=>t in e?KV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gw=(e,t)=>{for(var n in t||(t={}))Yk.call(t,n)&&mw(e,n,t[n]);if(wp)for(var n of wp(t))Qk.call(t,n)&&mw(e,n,t[n]);return e},XV=(e,t)=>YV(e,QV(t)),ZV=(e,t)=>{var n={};for(var r in e)Yk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wp)for(var r of wp(e))t.indexOf(r)<0&&Qk.call(e,r)&&(n[r]=e[r]);return n};const JV={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},U0=f.forwardRef((e,t)=>{const n=br("Divider",JV,e),{className:r,color:o,orientation:s,size:i,label:u,labelPosition:d,labelProps:p,variant:m,styles:h,classNames:v,unstyled:b}=n,w=ZV(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:S,cx:C}=qV({color:o},{classNames:v,styles:h,unstyled:b,name:"Divider",variant:m,size:i}),_=s==="vertical",k=s==="horizontal",P=!!u&&k,E=!(p!=null&&p.color);return z.createElement(go,gw({ref:t,className:C(S.root,{[S.vertical]:_,[S.horizontal]:k,[S.withLabel]:P},r),role:"separator"},w),P&&z.createElement(Yl,XV(gw({},p),{size:(p==null?void 0:p.size)||"xs",mt:Le(2),className:C(S.label,S[d],{[S.labelDefaultStyles]:E})}),u))});U0.displayName="@mantine/core/Divider";var eW=Object.defineProperty,tW=Object.defineProperties,nW=Object.getOwnPropertyDescriptors,vw=Object.getOwnPropertySymbols,rW=Object.prototype.hasOwnProperty,oW=Object.prototype.propertyIsEnumerable,yw=(e,t,n)=>t in e?eW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bw=(e,t)=>{for(var n in t||(t={}))rW.call(t,n)&&yw(e,n,t[n]);if(vw)for(var n of vw(t))oW.call(t,n)&&yw(e,n,t[n]);return e},sW=(e,t)=>tW(e,nW(t)),aW=Zr((e,t,{size:n})=>({item:sW(bw({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${Nt({size:n,sizes:e.spacing})} / 1.5) ${Nt({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:Nt({size:n,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":bw({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${Nt({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${Nt({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${Nt({size:n,sizes:e.spacing})} / 1.5) ${Nt({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const iW=aW;var lW=Object.defineProperty,xw=Object.getOwnPropertySymbols,cW=Object.prototype.hasOwnProperty,uW=Object.prototype.propertyIsEnumerable,Sw=(e,t,n)=>t in e?lW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dW=(e,t)=>{for(var n in t||(t={}))cW.call(t,n)&&Sw(e,n,t[n]);if(xw)for(var n of xw(t))uW.call(t,n)&&Sw(e,n,t[n]);return e};function F1({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:i,onItemHover:u,onItemSelect:d,itemsRefs:p,itemComponent:m,size:h,nothingFound:v,creatable:b,createLabel:w,unstyled:S,variant:C}){const{classes:_}=iW(null,{classNames:n,styles:r,unstyled:S,name:i,variant:C,size:h}),k=[],P=[];let E=null;const I=(O,D)=>{const T=typeof o=="function"?o(O.value):!1;return z.createElement(m,dW({key:O.value,className:_.item,"data-disabled":O.disabled||void 0,"data-hovered":!O.disabled&&t===D||void 0,"data-selected":!O.disabled&&T||void 0,selected:T,onMouseEnter:()=>u(D),id:`${s}-${D}`,role:"option",tabIndex:-1,"aria-selected":t===D,ref:$=>{p&&p.current&&(p.current[O.value]=$)},onMouseDown:O.disabled?null:$=>{$.preventDefault(),d(O)},disabled:O.disabled,variant:C},O))};let R=null;if(e.forEach((O,D)=>{O.creatable?E=D:O.group?(R!==O.group&&(R=O.group,P.push(z.createElement("div",{className:_.separator,key:`__mantine-divider-${D}`},z.createElement(U0,{classNames:{label:_.separatorLabel},label:O.group})))),P.push(I(O,D))):k.push(I(O,D))}),b){const O=e[E];k.push(z.createElement("div",{key:z1(),className:_.item,"data-hovered":t===E||void 0,onMouseEnter:()=>u(E),onMouseDown:D=>{D.preventDefault(),d(O)},tabIndex:-1,ref:D=>{p&&p.current&&(p.current[O.value]=D)}},w))}return P.length>0&&k.length>0&&k.unshift(z.createElement("div",{className:_.separator,key:"empty-group-separator"},z.createElement(U0,null))),P.length>0||k.length>0?z.createElement(z.Fragment,null,P,k):z.createElement(Yl,{size:h,unstyled:S,className:_.nothingFound},v)}F1.displayName="@mantine/core/SelectItems";var fW=Object.defineProperty,Cp=Object.getOwnPropertySymbols,Xk=Object.prototype.hasOwnProperty,Zk=Object.prototype.propertyIsEnumerable,ww=(e,t,n)=>t in e?fW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pW=(e,t)=>{for(var n in t||(t={}))Xk.call(t,n)&&ww(e,n,t[n]);if(Cp)for(var n of Cp(t))Zk.call(t,n)&&ww(e,n,t[n]);return e},hW=(e,t)=>{var n={};for(var r in e)Xk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cp)for(var r of Cp(e))t.indexOf(r)<0&&Zk.call(e,r)&&(n[r]=e[r]);return n};const B1=f.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=hW(n,["label","value"]);return z.createElement("div",pW({ref:t},s),r||o)});B1.displayName="@mantine/core/DefaultItem";function mW(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Jk(...e){return t=>e.forEach(n=>mW(n,t))}function tl(...e){return f.useCallback(Jk(...e),e)}const ej=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.Children.toArray(n),s=o.find(vW);if(s){const i=s.props.children,u=o.map(d=>d===s?f.Children.count(i)>1?f.Children.only(null):f.isValidElement(i)?i.props.children:null:d);return f.createElement(G0,Jn({},r,{ref:t}),f.isValidElement(i)?f.cloneElement(i,void 0,u):null)}return f.createElement(G0,Jn({},r,{ref:t}),n)});ej.displayName="Slot";const G0=f.forwardRef((e,t)=>{const{children:n,...r}=e;return f.isValidElement(n)?f.cloneElement(n,{...yW(r,n.props),ref:Jk(t,n.ref)}):f.Children.count(n)>1?f.Children.only(null):null});G0.displayName="SlotClone";const gW=({children:e})=>f.createElement(f.Fragment,null,e);function vW(e){return f.isValidElement(e)&&e.type===gW}function yW(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...u)=>{s(...u),o(...u)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}const bW=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Gu=bW.reduce((e,t)=>{const n=f.forwardRef((r,o)=>{const{asChild:s,...i}=r,u=s?ej:t;return f.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),f.createElement(u,Jn({},i,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),q0=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function xW(e,t){return f.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const qu=e=>{const{present:t,children:n}=e,r=SW(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=tl(r.ref,o.ref);return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};qu.displayName="Presence";function SW(e){const[t,n]=f.useState(),r=f.useRef({}),o=f.useRef(e),s=f.useRef("none"),i=e?"mounted":"unmounted",[u,d]=xW(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const p=lf(r.current);s.current=u==="mounted"?p:"none"},[u]),q0(()=>{const p=r.current,m=o.current;if(m!==e){const v=s.current,b=lf(p);e?d("MOUNT"):b==="none"||(p==null?void 0:p.display)==="none"?d("UNMOUNT"):d(m&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),q0(()=>{if(t){const p=h=>{const b=lf(r.current).includes(h.animationName);h.target===t&&b&&dc.flushSync(()=>d("ANIMATION_END"))},m=h=>{h.target===t&&(s.current=lf(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:f.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function lf(e){return(e==null?void 0:e.animationName)||"none"}function wW(e,t=[]){let n=[];function r(s,i){const u=f.createContext(i),d=n.length;n=[...n,i];function p(h){const{scope:v,children:b,...w}=h,S=(v==null?void 0:v[e][d])||u,C=f.useMemo(()=>w,Object.values(w));return f.createElement(S.Provider,{value:C},b)}function m(h,v){const b=(v==null?void 0:v[e][d])||u,w=f.useContext(b);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${s}\``)}return p.displayName=s+"Provider",[p,m]}const o=()=>{const s=n.map(i=>f.createContext(i));return function(u){const d=(u==null?void 0:u[e])||s;return f.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return o.scopeName=e,[r,CW(o,...t)]}function CW(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((u,{useScope:d,scopeName:p})=>{const h=d(s)[`__scope${p}`];return{...u,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Pi(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const _W=f.createContext(void 0);function kW(e){const t=f.useContext(_W);return e||t||"ltr"}function jW(e,[t,n]){return Math.min(n,Math.max(t,e))}function $i(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function PW(e,t){return f.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const tj="ScrollArea",[nj,Lse]=wW(tj),[IW,rs]=nj(tj),EW=f.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[u,d]=f.useState(null),[p,m]=f.useState(null),[h,v]=f.useState(null),[b,w]=f.useState(null),[S,C]=f.useState(null),[_,k]=f.useState(0),[P,E]=f.useState(0),[I,R]=f.useState(!1),[O,D]=f.useState(!1),T=tl(t,B=>d(B)),$=kW(o);return f.createElement(IW,{scope:n,type:r,dir:$,scrollHideDelay:s,scrollArea:u,viewport:p,onViewportChange:m,content:h,onContentChange:v,scrollbarX:b,onScrollbarXChange:w,scrollbarXEnabled:I,onScrollbarXEnabledChange:R,scrollbarY:S,onScrollbarYChange:C,scrollbarYEnabled:O,onScrollbarYEnabledChange:D,onCornerWidthChange:k,onCornerHeightChange:E},f.createElement(Gu.div,Jn({dir:$},i,{ref:T,style:{position:"relative",["--radix-scroll-area-corner-width"]:_+"px",["--radix-scroll-area-corner-height"]:P+"px",...e.style}})))}),OW="ScrollAreaViewport",RW=f.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=rs(OW,n),i=f.useRef(null),u=tl(t,i,s.onViewportChange);return f.createElement(f.Fragment,null,f.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),f.createElement(Gu.div,Jn({"data-radix-scroll-area-viewport":""},o,{ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),f.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Oa="ScrollAreaScrollbar",MW=f.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=rs(Oa,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,u=e.orientation==="horizontal";return f.useEffect(()=>(u?s(!0):i(!0),()=>{u?s(!1):i(!1)}),[u,s,i]),o.type==="hover"?f.createElement(DW,Jn({},r,{ref:t,forceMount:n})):o.type==="scroll"?f.createElement(TW,Jn({},r,{ref:t,forceMount:n})):o.type==="auto"?f.createElement(rj,Jn({},r,{ref:t,forceMount:n})):o.type==="always"?f.createElement(H1,Jn({},r,{ref:t})):null}),DW=f.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=rs(Oa,e.__scopeScrollArea),[s,i]=f.useState(!1);return f.useEffect(()=>{const u=o.scrollArea;let d=0;if(u){const p=()=>{window.clearTimeout(d),i(!0)},m=()=>{d=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return u.addEventListener("pointerenter",p),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",p),u.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),f.createElement(qu,{present:n||s},f.createElement(rj,Jn({"data-state":s?"visible":"hidden"},r,{ref:t})))}),TW=f.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=rs(Oa,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Fh(()=>d("SCROLL_END"),100),[u,d]=PW("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return f.useEffect(()=>{if(u==="idle"){const p=window.setTimeout(()=>d("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[u,o.scrollHideDelay,d]),f.useEffect(()=>{const p=o.viewport,m=s?"scrollLeft":"scrollTop";if(p){let h=p[m];const v=()=>{const b=p[m];h!==b&&(d("SCROLL"),i()),h=b};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[o.viewport,s,d,i]),f.createElement(qu,{present:n||u!=="hidden"},f.createElement(H1,Jn({"data-state":u==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:$i(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:$i(e.onPointerLeave,()=>d("POINTER_LEAVE"))})))}),rj=f.forwardRef((e,t)=>{const n=rs(Oa,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=f.useState(!1),u=e.orientation==="horizontal",d=Fh(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;i(u?p:m)}},10);return Ql(n.viewport,d),Ql(n.content,d),f.createElement(qu,{present:r||s},f.createElement(H1,Jn({"data-state":s?"visible":"hidden"},o,{ref:t})))}),H1=f.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=rs(Oa,e.__scopeScrollArea),s=f.useRef(null),i=f.useRef(0),[u,d]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=ij(u.viewport,u.content),m={...r,sizes:u,onSizesChange:d,hasThumb:p>0&&p<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:v=>i.current=v};function h(v,b){return HW(v,i.current,u,b)}return n==="horizontal"?f.createElement(AW,Jn({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollLeft,b=Cw(v,u,o.dir);s.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollLeft=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollLeft=h(v,o.dir))}})):n==="vertical"?f.createElement(NW,Jn({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollTop,b=Cw(v,u);s.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollTop=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollTop=h(v))}})):null}),AW=f.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=rs(Oa,e.__scopeScrollArea),[i,u]=f.useState(),d=f.useRef(null),p=tl(t,d,s.onScrollbarXChange);return f.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),f.createElement(sj,Jn({"data-orientation":"horizontal"},o,{ref:p,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,["--radix-scroll-area-thumb-width"]:Lh(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,h)=>{if(s.viewport){const v=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(v),cj(v,h)&&m.preventDefault()}},onResize:()=>{d.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:_p(i.paddingLeft),paddingEnd:_p(i.paddingRight)}})}}))}),NW=f.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=rs(Oa,e.__scopeScrollArea),[i,u]=f.useState(),d=f.useRef(null),p=tl(t,d,s.onScrollbarYChange);return f.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),f.createElement(sj,Jn({"data-orientation":"vertical"},o,{ref:p,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)",["--radix-scroll-area-thumb-height"]:Lh(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,h)=>{if(s.viewport){const v=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(v),cj(v,h)&&m.preventDefault()}},onResize:()=>{d.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:_p(i.paddingTop),paddingEnd:_p(i.paddingBottom)}})}}))}),[$W,oj]=nj(Oa),sj=f.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:p,onWheelScroll:m,onResize:h,...v}=e,b=rs(Oa,n),[w,S]=f.useState(null),C=tl(t,T=>S(T)),_=f.useRef(null),k=f.useRef(""),P=b.viewport,E=r.content-r.viewport,I=Pi(m),R=Pi(d),O=Fh(h,10);function D(T){if(_.current){const $=T.clientX-_.current.left,B=T.clientY-_.current.top;p({x:$,y:B})}}return f.useEffect(()=>{const T=$=>{const B=$.target;(w==null?void 0:w.contains(B))&&I($,E)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[P,w,E,I]),f.useEffect(R,[r,R]),Ql(w,O),Ql(b.content,O),f.createElement($W,{scope:n,scrollbar:w,hasThumb:o,onThumbChange:Pi(s),onThumbPointerUp:Pi(i),onThumbPositionChange:R,onThumbPointerDown:Pi(u)},f.createElement(Gu.div,Jn({},v,{ref:C,style:{position:"absolute",...v.style},onPointerDown:$i(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),_.current=w.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",D(T))}),onPointerMove:$i(e.onPointerMove,D),onPointerUp:$i(e.onPointerUp,T=>{const $=T.target;$.hasPointerCapture(T.pointerId)&&$.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=k.current,_.current=null})})))}),K0="ScrollAreaThumb",zW=f.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=oj(K0,e.__scopeScrollArea);return f.createElement(qu,{present:n||o.hasThumb},f.createElement(LW,Jn({ref:t},r)))}),LW=f.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=rs(K0,n),i=oj(K0,n),{onThumbPositionChange:u}=i,d=tl(t,h=>i.onThumbChange(h)),p=f.useRef(),m=Fh(()=>{p.current&&(p.current(),p.current=void 0)},100);return f.useEffect(()=>{const h=s.viewport;if(h){const v=()=>{if(m(),!p.current){const b=VW(h,u);p.current=b,u()}};return u(),h.addEventListener("scroll",v),()=>h.removeEventListener("scroll",v)}},[s.viewport,m,u]),f.createElement(Gu.div,Jn({"data-state":i.hasThumb?"visible":"hidden"},o,{ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:$i(e.onPointerDownCapture,h=>{const b=h.target.getBoundingClientRect(),w=h.clientX-b.left,S=h.clientY-b.top;i.onThumbPointerDown({x:w,y:S})}),onPointerUp:$i(e.onPointerUp,i.onThumbPointerUp)}))}),aj="ScrollAreaCorner",FW=f.forwardRef((e,t)=>{const n=rs(aj,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?f.createElement(BW,Jn({},e,{ref:t})):null}),BW=f.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=rs(aj,n),[s,i]=f.useState(0),[u,d]=f.useState(0),p=!!(s&&u);return Ql(o.scrollbarX,()=>{var m;const h=((m=o.scrollbarX)===null||m===void 0?void 0:m.offsetHeight)||0;o.onCornerHeightChange(h),d(h)}),Ql(o.scrollbarY,()=>{var m;const h=((m=o.scrollbarY)===null||m===void 0?void 0:m.offsetWidth)||0;o.onCornerWidthChange(h),i(h)}),p?f.createElement(Gu.div,Jn({},r,{ref:t,style:{width:s,height:u,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function _p(e){return e?parseInt(e,10):0}function ij(e,t){const n=e/t;return isNaN(n)?0:n}function Lh(e){const t=ij(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function HW(e,t,n,r="ltr"){const o=Lh(n),s=o/2,i=t||s,u=o-i,d=n.scrollbar.paddingStart+i,p=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,h=r==="ltr"?[0,m]:[m*-1,0];return lj([d,p],h)(e)}function Cw(e,t,n="ltr"){const r=Lh(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,u=s-r,d=n==="ltr"?[0,i]:[i*-1,0],p=jW(e,d);return lj([0,i],[0,u])(p)}function lj(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function cj(e,t){return e>0&&e<t}const VW=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,u=n.top!==s.top;(i||u)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Fh(e,t){const n=Pi(e),r=f.useRef(0);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),f.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ql(e,t){const n=Pi(t);q0(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const WW=EW,UW=RW,_w=MW,kw=zW,GW=FW;var qW=Zr((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?Le(t):void 0,paddingBottom:n?Le(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${Le(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${NS("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:Le(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:Le(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:NS("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:Le(t),position:"relative",transition:"background-color 150ms ease",display:o?"none":void 0,overflow:"hidden","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:Le(44),minHeight:Le(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:r?1:0,display:o?"none":void 0}}));const KW=qW;var YW=Object.defineProperty,QW=Object.defineProperties,XW=Object.getOwnPropertyDescriptors,kp=Object.getOwnPropertySymbols,uj=Object.prototype.hasOwnProperty,dj=Object.prototype.propertyIsEnumerable,jw=(e,t,n)=>t in e?YW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Y0=(e,t)=>{for(var n in t||(t={}))uj.call(t,n)&&jw(e,n,t[n]);if(kp)for(var n of kp(t))dj.call(t,n)&&jw(e,n,t[n]);return e},fj=(e,t)=>QW(e,XW(t)),pj=(e,t)=>{var n={};for(var r in e)uj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kp)for(var r of kp(e))t.indexOf(r)<0&&dj.call(e,r)&&(n[r]=e[r]);return n};const hj={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},Bh=f.forwardRef((e,t)=>{const n=br("ScrollArea",hj,e),{children:r,className:o,classNames:s,styles:i,scrollbarSize:u,scrollHideDelay:d,type:p,dir:m,offsetScrollbars:h,viewportRef:v,onScrollPositionChange:b,unstyled:w,variant:S,viewportProps:C}=n,_=pj(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[k,P]=f.useState(!1),E=Pa(),{classes:I,cx:R}=KW({scrollbarSize:u,offsetScrollbars:h,scrollbarHovered:k,hidden:p==="never"},{name:"ScrollArea",classNames:s,styles:i,unstyled:w,variant:S});return z.createElement(WW,{type:p==="never"?"always":p,scrollHideDelay:d,dir:m||E.dir,ref:t,asChild:!0},z.createElement(go,Y0({className:R(I.root,o)},_),z.createElement(UW,fj(Y0({},C),{className:I.viewport,ref:v,onScroll:typeof b=="function"?({currentTarget:O})=>b({x:O.scrollLeft,y:O.scrollTop}):void 0}),r),z.createElement(_w,{orientation:"horizontal",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1)},z.createElement(kw,{className:I.thumb})),z.createElement(_w,{orientation:"vertical",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1)},z.createElement(kw,{className:I.thumb})),z.createElement(GW,{className:I.corner})))}),mj=f.forwardRef((e,t)=>{const n=br("ScrollAreaAutosize",hj,e),{children:r,classNames:o,styles:s,scrollbarSize:i,scrollHideDelay:u,type:d,dir:p,offsetScrollbars:m,viewportRef:h,onScrollPositionChange:v,unstyled:b,sx:w,variant:S,viewportProps:C}=n,_=pj(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return z.createElement(go,fj(Y0({},_),{ref:t,sx:[{display:"flex"},...ok(w)]}),z.createElement(go,{sx:{display:"flex",flexDirection:"column",flex:1}},z.createElement(Bh,{classNames:o,styles:s,scrollHideDelay:u,scrollbarSize:i,type:d,dir:p,offsetScrollbars:m,viewportRef:h,onScrollPositionChange:v,unstyled:b,variant:S,viewportProps:C},r)))});mj.displayName="@mantine/core/ScrollAreaAutosize";Bh.displayName="@mantine/core/ScrollArea";Bh.Autosize=mj;const ZW=Bh;var JW=Object.defineProperty,eU=Object.defineProperties,tU=Object.getOwnPropertyDescriptors,jp=Object.getOwnPropertySymbols,gj=Object.prototype.hasOwnProperty,vj=Object.prototype.propertyIsEnumerable,Pw=(e,t,n)=>t in e?JW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Iw=(e,t)=>{for(var n in t||(t={}))gj.call(t,n)&&Pw(e,n,t[n]);if(jp)for(var n of jp(t))vj.call(t,n)&&Pw(e,n,t[n]);return e},nU=(e,t)=>eU(e,tU(t)),rU=(e,t)=>{var n={};for(var r in e)gj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jp)for(var r of jp(e))t.indexOf(r)<0&&vj.call(e,r)&&(n[r]=e[r]);return n};const Hh=f.forwardRef((e,t)=>{var n=e,{style:r}=n,o=rU(n,["style"]);return z.createElement(ZW,nU(Iw({},o),{style:Iw({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});Hh.displayName="@mantine/core/SelectScrollArea";var oU=Zr(()=>({dropdown:{},itemsWrapper:{padding:Le(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const sU=oU;function bc(e){return e.split("-")[1]}function V1(e){return e==="y"?"height":"width"}function Ss(e){return e.split("-")[0]}function ui(e){return["top","bottom"].includes(Ss(e))?"x":"y"}function Ew(e,t,n){let{reference:r,floating:o}=e;const s=r.x+r.width/2-o.width/2,i=r.y+r.height/2-o.height/2,u=ui(t),d=V1(u),p=r[d]/2-o[d]/2,m=u==="x";let h;switch(Ss(t)){case"top":h={x:s,y:r.y-o.height};break;case"bottom":h={x:s,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:i};break;case"left":h={x:r.x-o.width,y:i};break;default:h={x:r.x,y:r.y}}switch(bc(t)){case"start":h[u]-=p*(n&&m?-1:1);break;case"end":h[u]+=p*(n&&m?-1:1)}return h}const aU=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,u=s.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(t));let p=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:h}=Ew(p,r,d),v=r,b={},w=0;for(let S=0;S<u.length;S++){const{name:C,fn:_}=u[S],{x:k,y:P,data:E,reset:I}=await _({x:m,y:h,initialPlacement:r,placement:v,strategy:o,middlewareData:b,rects:p,platform:i,elements:{reference:e,floating:t}});m=k??m,h=P??h,b={...b,[C]:{...b[C],...E}},I&&w<=50&&(w++,typeof I=="object"&&(I.placement&&(v=I.placement),I.rects&&(p=I.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:m,y:h}=Ew(p,v,d)),S=-1)}return{x:m,y:h,placement:v,strategy:o,middlewareData:b}};function _a(e,t){return typeof e=="function"?e(t):e}function W1(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function Xl(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function U1(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:u,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:v=!1,padding:b=0}=_a(t,e),w=W1(b),S=u[v?h==="floating"?"reference":"floating":h],C=Xl(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(S)))==null||n?S:S.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:p,rootBoundary:m,strategy:d})),_=h==="floating"?{...i.floating,x:r,y:o}:i.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),P=await(s.isElement==null?void 0:s.isElement(k))&&await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1},E=Xl(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:k,strategy:d}):_);return{top:(C.top-E.top+w.top)/P.y,bottom:(E.bottom-C.bottom+w.bottom)/P.y,left:(C.left-E.left+w.left)/P.x,right:(E.right-C.right+w.right)/P.x}}const ai=Math.min,Hs=Math.max;function Q0(e,t,n){return Hs(e,ai(t,n))}const Ow=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:u}=t,{element:d,padding:p=0}=_a(e,t)||{};if(d==null)return{};const m=W1(p),h={x:n,y:r},v=ui(o),b=V1(v),w=await i.getDimensions(d),S=v==="y",C=S?"top":"left",_=S?"bottom":"right",k=S?"clientHeight":"clientWidth",P=s.reference[b]+s.reference[v]-h[v]-s.floating[b],E=h[v]-s.reference[v],I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let R=I?I[k]:0;R&&await(i.isElement==null?void 0:i.isElement(I))||(R=u.floating[k]||s.floating[b]);const O=P/2-E/2,D=R/2-w[b]/2-1,T=ai(m[C],D),$=ai(m[_],D),B=T,ee=R-w[b]-$,F=R/2-w[b]/2+O,N=Q0(B,F,ee),H=bc(o)!=null&&F!=N&&s.reference[b]/2-(F<B?T:$)-w[b]/2<0?F<B?B-F:ee-F:0;return{[v]:h[v]-H,data:{[v]:N,centerOffset:F-N+H}}}}),iU=["top","right","bottom","left"];iU.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const lU={left:"right",right:"left",bottom:"top",top:"bottom"};function Pp(e){return e.replace(/left|right|bottom|top/g,t=>lU[t])}function cU(e,t,n){n===void 0&&(n=!1);const r=bc(e),o=ui(e),s=V1(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Pp(i)),{main:i,cross:Pp(i)}}const uU={start:"end",end:"start"};function Hg(e){return e.replace(/start|end/g,t=>uU[t])}const dU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:s,initialPlacement:i,platform:u,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...S}=_a(e,t),C=Ss(r),_=Ss(i)===i,k=await(u.isRTL==null?void 0:u.isRTL(d.floating)),P=h||(_||!w?[Pp(i)]:function(B){const ee=Pp(B);return[Hg(B),ee,Hg(ee)]}(i));h||b==="none"||P.push(...function(B,ee,F,N){const H=bc(B);let K=function(A,U,V){const W=["left","right"],re=["right","left"],be=["top","bottom"],ce=["bottom","top"];switch(A){case"top":case"bottom":return V?U?re:W:U?W:re;case"left":case"right":return U?be:ce;default:return[]}}(Ss(B),F==="start",N);return H&&(K=K.map(A=>A+"-"+H),ee&&(K=K.concat(K.map(Hg)))),K}(i,w,b,k));const E=[i,...P],I=await U1(t,S),R=[];let O=((n=o.flip)==null?void 0:n.overflows)||[];if(p&&R.push(I[C]),m){const{main:B,cross:ee}=cU(r,s,k);R.push(I[B],I[ee])}if(O=[...O,{placement:r,overflows:R}],!R.every(B=>B<=0)){var D,T;const B=(((D=o.flip)==null?void 0:D.index)||0)+1,ee=E[B];if(ee)return{data:{index:B,overflows:O},reset:{placement:ee}};let F=(T=O.filter(N=>N.overflows[0]<=0).sort((N,H)=>N.overflows[1]-H.overflows[1])[0])==null?void 0:T.placement;if(!F)switch(v){case"bestFit":{var $;const N=($=O.map(H=>[H.placement,H.overflows.filter(K=>K>0).reduce((K,A)=>K+A,0)]).sort((H,K)=>H[1]-K[1])[0])==null?void 0:$[0];N&&(F=N);break}case"initialPlacement":F=i}if(r!==F)return{reset:{placement:F}}}return{}}}};function Rw(e){const t=ai(...e.map(r=>r.left)),n=ai(...e.map(r=>r.top));return{x:t,y:n,width:Hs(...e.map(r=>r.right))-t,height:Hs(...e.map(r=>r.bottom))-n}}const fU=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:i}=t,{padding:u=2,x:d,y:p}=_a(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),h=function(S){const C=S.slice().sort((P,E)=>P.y-E.y),_=[];let k=null;for(let P=0;P<C.length;P++){const E=C[P];!k||E.y-k.y>k.height/2?_.push([E]):_[_.length-1].push(E),k=E}return _.map(P=>Xl(Rw(P)))}(m),v=Xl(Rw(m)),b=W1(u),w=await s.getElementRects({reference:{getBoundingClientRect:function(){if(h.length===2&&h[0].left>h[1].right&&d!=null&&p!=null)return h.find(S=>d>S.left-b.left&&d<S.right+b.right&&p>S.top-b.top&&p<S.bottom+b.bottom)||v;if(h.length>=2){if(ui(n)==="x"){const I=h[0],R=h[h.length-1],O=Ss(n)==="top",D=I.top,T=R.bottom,$=O?I.left:R.left,B=O?I.right:R.right;return{top:D,bottom:T,left:$,right:B,width:B-$,height:T-D,x:$,y:D}}const S=Ss(n)==="left",C=Hs(...h.map(I=>I.right)),_=ai(...h.map(I=>I.left)),k=h.filter(I=>S?I.left===_:I.right===C),P=k[0].top,E=k[k.length-1].bottom;return{top:P,bottom:E,left:_,right:C,width:C-_,height:E-P,x:_,y:P}}return v}},floating:r.floating,strategy:i});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},pU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(s,i){const{placement:u,platform:d,elements:p}=s,m=await(d.isRTL==null?void 0:d.isRTL(p.floating)),h=Ss(u),v=bc(u),b=ui(u)==="x",w=["left","top"].includes(h)?-1:1,S=m&&b?-1:1,C=_a(i,s);let{mainAxis:_,crossAxis:k,alignmentAxis:P}=typeof C=="number"?{mainAxis:C,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...C};return v&&typeof P=="number"&&(k=v==="end"?-1*P:P),b?{x:k*S,y:_*w}:{x:_*w,y:k*S}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function yj(e){return e==="x"?"y":"x"}const hU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:u={fn:C=>{let{x:_,y:k}=C;return{x:_,y:k}}},...d}=_a(e,t),p={x:n,y:r},m=await U1(t,d),h=ui(Ss(o)),v=yj(h);let b=p[h],w=p[v];if(s){const C=h==="y"?"bottom":"right";b=Q0(b+m[h==="y"?"top":"left"],b,b-m[C])}if(i){const C=v==="y"?"bottom":"right";w=Q0(w+m[v==="y"?"top":"left"],w,w-m[C])}const S=u.fn({...t,[h]:b,[v]:w});return{...S,data:{x:S.x-n,y:S.y-r}}}}},mU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:u=0,mainAxis:d=!0,crossAxis:p=!0}=_a(e,t),m={x:n,y:r},h=ui(o),v=yj(h);let b=m[h],w=m[v];const S=_a(u,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const P=h==="y"?"height":"width",E=s.reference[h]-s.floating[P]+C.mainAxis,I=s.reference[h]+s.reference[P]-C.mainAxis;b<E?b=E:b>I&&(b=I)}if(p){var _,k;const P=h==="y"?"width":"height",E=["top","left"].includes(Ss(o)),I=s.reference[v]-s.floating[P]+(E&&((_=i.offset)==null?void 0:_[v])||0)+(E?0:C.crossAxis),R=s.reference[v]+s.reference[P]+(E?0:((k=i.offset)==null?void 0:k[v])||0)-(E?C.crossAxis:0);w<I?w=I:w>R&&(w=R)}return{[h]:b,[v]:w}}}},gU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...u}=_a(e,t),d=await U1(t,u),p=Ss(n),m=bc(n),h=ui(n)==="x",{width:v,height:b}=r.floating;let w,S;p==="top"||p==="bottom"?(w=p,S=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(S=p,w=m==="end"?"top":"bottom");const C=b-d[w],_=v-d[S],k=!t.middlewareData.shift;let P=C,E=_;if(h){const R=v-d.left-d.right;E=m||k?ai(_,R):R}else{const R=b-d.top-d.bottom;P=m||k?ai(C,R):R}if(k&&!m){const R=Hs(d.left,0),O=Hs(d.right,0),D=Hs(d.top,0),T=Hs(d.bottom,0);h?E=v-2*(R!==0||O!==0?R+O:Hs(d.left,d.right)):P=b-2*(D!==0||T!==0?D+T:Hs(d.top,d.bottom))}await i({...t,availableWidth:E,availableHeight:P});const I=await o.getDimensions(s.floating);return v!==I.width||b!==I.height?{reset:{rects:!0}}:{}}}};function Xo(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ws(e){return Xo(e).getComputedStyle(e)}function bj(e){return e instanceof Xo(e).Node}function ii(e){return bj(e)?(e.nodeName||"").toLowerCase():"#document"}function Es(e){return e instanceof Xo(e).HTMLElement}function ha(e){return e instanceof Xo(e).Element}function Mw(e){return typeof ShadowRoot<"u"&&(e instanceof Xo(e).ShadowRoot||e instanceof ShadowRoot)}function Su(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ws(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function vU(e){return["table","td","th"].includes(ii(e))}function X0(e){const t=G1(),n=ws(e);return n.transform!=="none"||n.perspective!=="none"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function G1(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Vh(e){return["html","body","#document"].includes(ii(e))}const Z0=Math.min,Wl=Math.max,Ip=Math.round,cf=Math.floor,Ki=e=>({x:e,y:e});function xj(e){const t=ws(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Es(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,u=Ip(n)!==s||Ip(r)!==i;return u&&(n=s,r=i),{width:n,height:r,$:u}}function q1(e){return ha(e)?e:e.contextElement}function Ul(e){const t=q1(e);if(!Es(t))return Ki(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=xj(t);let i=(s?Ip(n.width):n.width)/r,u=(s?Ip(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),u&&Number.isFinite(u)||(u=1),{x:i,y:u}}const Dw=Ki(0);function Sj(e,t,n){var r,o;if(t===void 0&&(t=!0),!G1())return Dw;const s=e?Xo(e):window;return!n||t&&n!==s?Dw:{x:((r=s.visualViewport)==null?void 0:r.offsetLeft)||0,y:((o=s.visualViewport)==null?void 0:o.offsetTop)||0}}function Yi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=q1(e);let i=Ki(1);t&&(r?ha(r)&&(i=Ul(r)):i=Ul(e));const u=Sj(s,n,r);let d=(o.left+u.x)/i.x,p=(o.top+u.y)/i.y,m=o.width/i.x,h=o.height/i.y;if(s){const v=Xo(s),b=r&&ha(r)?Xo(r):r;let w=v.frameElement;for(;w&&r&&b!==v;){const S=Ul(w),C=w.getBoundingClientRect(),_=getComputedStyle(w),k=C.left+(w.clientLeft+parseFloat(_.paddingLeft))*S.x,P=C.top+(w.clientTop+parseFloat(_.paddingTop))*S.y;d*=S.x,p*=S.y,m*=S.x,h*=S.y,d+=k,p+=P,w=Xo(w).frameElement}}return Xl({width:m,height:h,x:d,y:p})}function ma(e){return((bj(e)?e.ownerDocument:e.document)||window.document).documentElement}function Wh(e){return ha(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function wj(e){return Yi(ma(e)).left+Wh(e).scrollLeft}function Zl(e){if(ii(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Mw(e)&&e.host||ma(e);return Mw(t)?t.host:t}function Cj(e){const t=Zl(e);return Vh(t)?e.ownerDocument?e.ownerDocument.body:e.body:Es(t)&&Su(t)?t:Cj(t)}function Ep(e,t){var n;t===void 0&&(t=[]);const r=Cj(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Xo(r);return o?t.concat(s,s.visualViewport||[],Su(r)?r:[]):t.concat(r,Ep(r))}function Tw(e,t,n){let r;if(t==="viewport")r=function(o,s){const i=Xo(o),u=ma(o),d=i.visualViewport;let p=u.clientWidth,m=u.clientHeight,h=0,v=0;if(d){p=d.width,m=d.height;const b=G1();(!b||b&&s==="fixed")&&(h=d.offsetLeft,v=d.offsetTop)}return{width:p,height:m,x:h,y:v}}(e,n);else if(t==="document")r=function(o){const s=ma(o),i=Wh(o),u=o.ownerDocument.body,d=Wl(s.scrollWidth,s.clientWidth,u.scrollWidth,u.clientWidth),p=Wl(s.scrollHeight,s.clientHeight,u.scrollHeight,u.clientHeight);let m=-i.scrollLeft+wj(o);const h=-i.scrollTop;return ws(u).direction==="rtl"&&(m+=Wl(s.clientWidth,u.clientWidth)-d),{width:d,height:p,x:m,y:h}}(ma(e));else if(ha(t))r=function(o,s){const i=Yi(o,!0,s==="fixed"),u=i.top+o.clientTop,d=i.left+o.clientLeft,p=Es(o)?Ul(o):Ki(1);return{width:o.clientWidth*p.x,height:o.clientHeight*p.y,x:d*p.x,y:u*p.y}}(t,n);else{const o=Sj(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Xl(r)}function _j(e,t){const n=Zl(e);return!(n===t||!ha(n)||Vh(n))&&(ws(n).position==="fixed"||_j(n,t))}function Aw(e,t){return Es(e)&&ws(e).position!=="fixed"?t?t(e):e.offsetParent:null}function Nw(e,t){const n=Xo(e);if(!Es(e))return n;let r=Aw(e,t);for(;r&&vU(r)&&ws(r).position==="static";)r=Aw(r,t);return r&&(ii(r)==="html"||ii(r)==="body"&&ws(r).position==="static"&&!X0(r))?n:r||function(o){let s=Zl(o);for(;Es(s)&&!Vh(s);){if(X0(s))return s;s=Zl(s)}return null}(e)||n}function yU(e,t,n){const r=Es(t),o=ma(t),s=n==="fixed",i=Yi(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const d=Ki(0);if(r||!r&&!s)if((ii(t)!=="body"||Su(o))&&(u=Wh(t)),Es(t)){const p=Yi(t,!0,s,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}else o&&(d.x=wj(o));return{x:i.left+u.scrollLeft-d.x,y:i.top+u.scrollTop-d.y,width:i.width,height:i.height}}const bU={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=n==="clippingAncestors"?function(p,m){const h=m.get(p);if(h)return h;let v=Ep(p).filter(C=>ha(C)&&ii(C)!=="body"),b=null;const w=ws(p).position==="fixed";let S=w?Zl(p):p;for(;ha(S)&&!Vh(S);){const C=ws(S),_=X0(S);_||C.position!=="fixed"||(b=null),(w?!_&&!b:!_&&C.position==="static"&&b&&["absolute","fixed"].includes(b.position)||Su(S)&&!_&&_j(p,S))?v=v.filter(k=>k!==S):b=C,S=Zl(S)}return m.set(p,v),v}(t,this._c):[].concat(n),i=[...s,r],u=i[0],d=i.reduce((p,m)=>{const h=Tw(t,m,o);return p.top=Wl(h.top,p.top),p.right=Z0(h.right,p.right),p.bottom=Z0(h.bottom,p.bottom),p.left=Wl(h.left,p.left),p},Tw(t,u,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Es(n),s=ma(n);if(n===s)return t;let i={scrollLeft:0,scrollTop:0},u=Ki(1);const d=Ki(0);if((o||!o&&r!=="fixed")&&((ii(n)!=="body"||Su(s))&&(i=Wh(n)),Es(n))){const p=Yi(n);u=Ul(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-i.scrollLeft*u.x+d.x,y:t.y*u.y-i.scrollTop*u.y+d.y}},isElement:ha,getDimensions:function(e){return xj(e)},getOffsetParent:Nw,getDocumentElement:ma,getScale:Ul,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Nw,s=this.getDimensions;return{reference:yU(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ws(e).direction==="rtl"};function xU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=!0,layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,p=q1(e),m=o||s?[...p?Ep(p):[],...Ep(t)]:[];m.forEach(S=>{o&&S.addEventListener("scroll",n,{passive:!0}),s&&S.addEventListener("resize",n)});const h=p&&u?function(S,C){let _,k=null;const P=ma(S);function E(){clearTimeout(_),k&&k.disconnect(),k=null}return function I(R,O){R===void 0&&(R=!1),O===void 0&&(O=1),E();const{left:D,top:T,width:$,height:B}=S.getBoundingClientRect();if(R||C(),!$||!B)return;const ee=cf(T),F=cf(P.clientWidth-(D+$)),N=cf(P.clientHeight-(T+B)),H=cf(D);let K=!0;k=new IntersectionObserver(A=>{const U=A[0].intersectionRatio;if(U!==O){if(!K)return I();U?I(!1,U):_=setTimeout(()=>{I(!1,1e-7)},100)}K=!1},{rootMargin:-ee+"px "+-F+"px "+-N+"px "+-H+"px",threshold:Wl(0,Z0(1,O))||1}),k.observe(S)}(!0),E}(p,n):null;let v,b=null;i&&(b=new ResizeObserver(n),p&&!d&&b.observe(p),b.observe(t));let w=d?Yi(e):null;return d&&function S(){const C=Yi(e);!w||C.x===w.x&&C.y===w.y&&C.width===w.width&&C.height===w.height||n(),w=C,v=requestAnimationFrame(S)}(),n(),()=>{m.forEach(S=>{o&&S.removeEventListener("scroll",n),s&&S.removeEventListener("resize",n)}),h&&h(),b&&b.disconnect(),b=null,d&&cancelAnimationFrame(v)}}const SU=(e,t,n)=>{const r=new Map,o={platform:bU,...n},s={...o.platform,_c:r};return aU(e,t,{...o,platform:s})},wU=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?Ow({element:t.current,padding:n}).fn(o):{}:t?Ow({element:t,padding:n}).fn(o):{}}}};var If=typeof document<"u"?f.useLayoutEffect:f.useEffect;function Op(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,o;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(!Op(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Op(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function $w(e){const t=f.useRef(e);return If(()=>{t.current=e}),t}function CU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:i}=e,[u,d]=f.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);Op(p,r)||m(r);const h=f.useRef(null),v=f.useRef(null),b=f.useRef(u),w=$w(s),S=$w(o),[C,_]=f.useState(null),[k,P]=f.useState(null),E=f.useCallback($=>{h.current!==$&&(h.current=$,_($))},[]),I=f.useCallback($=>{v.current!==$&&(v.current=$,P($))},[]),R=f.useCallback(()=>{if(!h.current||!v.current)return;const $={placement:t,strategy:n,middleware:p};S.current&&($.platform=S.current),SU(h.current,v.current,$).then(B=>{const ee={...B,isPositioned:!0};O.current&&!Op(b.current,ee)&&(b.current=ee,dc.flushSync(()=>{d(ee)}))})},[p,t,n,S]);If(()=>{i===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,d($=>({...$,isPositioned:!1})))},[i]);const O=f.useRef(!1);If(()=>(O.current=!0,()=>{O.current=!1}),[]),If(()=>{if(C&&k){if(w.current)return w.current(C,k,R);R()}},[C,k,R,w]);const D=f.useMemo(()=>({reference:h,floating:v,setReference:E,setFloating:I}),[E,I]),T=f.useMemo(()=>({reference:C,floating:k}),[C,k]);return f.useMemo(()=>({...u,update:R,refs:D,elements:T,reference:E,floating:I}),[u,R,D,T,E,I])}var _U=typeof document<"u"?f.useLayoutEffect:f.useEffect;function kU(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const jU=f.createContext(null),PU=()=>f.useContext(jU);function IU(e){return(e==null?void 0:e.ownerDocument)||document}function EU(e){return IU(e).defaultView||window}function uf(e){return e?e instanceof EU(e).Element:!1}const OU=Iv["useInsertionEffect".toString()],RU=OU||(e=>e());function MU(e){const t=f.useRef(()=>{});return RU(()=>{t.current=e}),f.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function DU(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=CU(e),s=PU(),i=f.useRef(null),u=f.useRef({}),d=f.useState(()=>kU())[0],[p,m]=f.useState(null),h=f.useCallback(_=>{const k=uf(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;o.refs.setReference(k)},[o.refs]),v=f.useCallback(_=>{(uf(_)||_===null)&&(i.current=_,m(_)),(uf(o.refs.reference.current)||o.refs.reference.current===null||_!==null&&!uf(_))&&o.refs.setReference(_)},[o.refs]),b=f.useMemo(()=>({...o.refs,setReference:v,setPositionReference:h,domReference:i}),[o.refs,v,h]),w=f.useMemo(()=>({...o.elements,domReference:p}),[o.elements,p]),S=MU(n),C=f.useMemo(()=>({...o,refs:b,elements:w,dataRef:u,nodeId:r,events:d,open:t,onOpenChange:S}),[o,r,d,t,S,b,w]);return _U(()=>{const _=s==null?void 0:s.nodesRef.current.find(k=>k.id===r);_&&(_.context=C)}),f.useMemo(()=>({...o,context:C,refs:b,reference:v,positionReference:h}),[o,b,C,v,h])}function TU({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=f.useState(0);f.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return xU(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),xs(()=>{t.update()},r),xs(()=>{s(i=>i+1)},[e])}function AU(e){const t=[pU(e.offset)];return e.middlewares.shift&&t.push(hU({limiter:mU()})),e.middlewares.flip&&t.push(dU()),e.middlewares.inline&&t.push(fU()),t.push(wU({element:e.arrowRef,padding:e.arrowOffset})),t}function NU(e){const[t,n]=xu({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var i;(i=e.onClose)==null||i.call(e),n(!1)},o=()=>{var i,u;t?((i=e.onClose)==null||i.call(e),n(!1)):((u=e.onOpen)==null||u.call(e),n(!0))},s=DU({placement:e.position,middleware:[...AU(e),...e.width==="target"?[gU({apply({rects:i}){var u,d;Object.assign((d=(u=s.refs.floating.current)==null?void 0:u.style)!=null?d:{},{width:`${i.reference.width}px`})}})]:[]]});return TU({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),xs(()=>{var i;(i=e.onPositionChange)==null||i.call(e,s.placement)},[s.placement]),xs(()=>{var i,u;e.opened?(u=e.onOpen)==null||u.call(e):(i=e.onClose)==null||i.call(e)},[e.opened]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const kj={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[$U,jj]=gB(kj.context);var zU=Object.defineProperty,LU=Object.defineProperties,FU=Object.getOwnPropertyDescriptors,Rp=Object.getOwnPropertySymbols,Pj=Object.prototype.hasOwnProperty,Ij=Object.prototype.propertyIsEnumerable,zw=(e,t,n)=>t in e?zU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,df=(e,t)=>{for(var n in t||(t={}))Pj.call(t,n)&&zw(e,n,t[n]);if(Rp)for(var n of Rp(t))Ij.call(t,n)&&zw(e,n,t[n]);return e},BU=(e,t)=>LU(e,FU(t)),HU=(e,t)=>{var n={};for(var r in e)Pj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rp)for(var r of Rp(e))t.indexOf(r)<0&&Ij.call(e,r)&&(n[r]=e[r]);return n};const VU={refProp:"ref",popupType:"dialog"},Ej=f.forwardRef((e,t)=>{const n=br("PopoverTarget",VU,e),{children:r,refProp:o,popupType:s}=n,i=HU(n,["children","refProp","popupType"]);if(!ak(r))throw new Error(kj.children);const u=i,d=jj(),p=Uu(d.reference,r.ref,t),m=d.withRoles?{"aria-haspopup":s,"aria-expanded":d.opened,"aria-controls":d.getDropdownId(),id:d.getTargetId()}:{};return f.cloneElement(r,df(BU(df(df(df({},u),m),d.targetProps),{className:lk(d.targetProps.className,u.className,r.props.className),[o]:p}),d.controlled?null:{onClick:d.onToggle}))});Ej.displayName="@mantine/core/PopoverTarget";var WU=Zr((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${Le(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm} ${e.spacing.md}`,boxShadow:e.shadows[n]||n||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`${Le(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const UU=WU;var GU=Object.defineProperty,Lw=Object.getOwnPropertySymbols,qU=Object.prototype.hasOwnProperty,KU=Object.prototype.propertyIsEnumerable,Fw=(e,t,n)=>t in e?GU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_l=(e,t)=>{for(var n in t||(t={}))qU.call(t,n)&&Fw(e,n,t[n]);if(Lw)for(var n of Lw(t))KU.call(t,n)&&Fw(e,n,t[n]);return e};const Bw={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function YU({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in nf?_l(_l(_l({transitionProperty:nf[e].transitionProperty},o),nf[e].common),nf[e][Bw[t]]):null:_l(_l(_l({transitionProperty:e.transitionProperty},o),e.common),e[Bw[t]])}function QU({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:i,onExited:u}){const d=Pa(),p=mk(),m=d.respectReducedMotion?p:!1,[h,v]=f.useState(m?0:e),[b,w]=f.useState(r?"entered":"exited"),S=f.useRef(-1),C=_=>{const k=_?o:s,P=_?i:u;w(_?"pre-entering":"pre-exiting"),window.clearTimeout(S.current);const E=m?0:_?e:t;if(v(E),E===0)typeof k=="function"&&k(),typeof P=="function"&&P(),w(_?"entered":"exited");else{const I=window.setTimeout(()=>{typeof k=="function"&&k(),w(_?"entering":"exiting")},10);S.current=window.setTimeout(()=>{window.clearTimeout(I),typeof P=="function"&&P(),w(_?"entered":"exited")},E)}};return xs(()=>{C(r)},[r]),f.useEffect(()=>()=>window.clearTimeout(S.current),[]),{transitionDuration:h,transitionStatus:b,transitionTimingFunction:n||d.transitionTimingFunction}}function Oj({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:i,onExit:u,onEntered:d,onEnter:p,onExited:m}){const{transitionDuration:h,transitionStatus:v,transitionTimingFunction:b}=QU({mounted:o,exitDuration:r,duration:n,timingFunction:i,onExit:u,onEntered:d,onEnter:p,onExited:m});return h===0?o?z.createElement(z.Fragment,null,s({})):e?s({display:"none"}):null:v==="exited"?e?s({display:"none"}):null:z.createElement(z.Fragment,null,s(YU({transition:t,duration:h,state:v,timingFunction:b})))}Oj.displayName="@mantine/core/Transition";function Rj({children:e,active:t=!0,refProp:n="ref"}){const r=QB(t),o=Uu(r,e==null?void 0:e.ref);return ak(e)?f.cloneElement(e,{[n]:o}):e}Rj.displayName="@mantine/core/FocusTrap";var XU=Object.defineProperty,ZU=Object.defineProperties,JU=Object.getOwnPropertyDescriptors,Hw=Object.getOwnPropertySymbols,eG=Object.prototype.hasOwnProperty,tG=Object.prototype.propertyIsEnumerable,Vw=(e,t,n)=>t in e?XU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ha=(e,t)=>{for(var n in t||(t={}))eG.call(t,n)&&Vw(e,n,t[n]);if(Hw)for(var n of Hw(t))tG.call(t,n)&&Vw(e,n,t[n]);return e},ff=(e,t)=>ZU(e,JU(t));function Ww(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function Uw(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const nG={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function rG({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:i,dir:u}){const[d,p="center"]=e.split("-"),m={width:Le(t),height:Le(t),transform:"rotate(45deg)",position:"absolute",[nG[d]]:Le(r)},h=Le(-t/2);return d==="left"?ff(Ha(Ha({},m),Ww(p,i,n,o)),{right:h,borderLeftColor:"transparent",borderBottomColor:"transparent"}):d==="right"?ff(Ha(Ha({},m),Ww(p,i,n,o)),{left:h,borderRightColor:"transparent",borderTopColor:"transparent"}):d==="top"?ff(Ha(Ha({},m),Uw(p,s,n,o,u)),{bottom:h,borderTopColor:"transparent",borderLeftColor:"transparent"}):d==="bottom"?ff(Ha(Ha({},m),Uw(p,s,n,o,u)),{top:h,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var oG=Object.defineProperty,sG=Object.defineProperties,aG=Object.getOwnPropertyDescriptors,Mp=Object.getOwnPropertySymbols,Mj=Object.prototype.hasOwnProperty,Dj=Object.prototype.propertyIsEnumerable,Gw=(e,t,n)=>t in e?oG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iG=(e,t)=>{for(var n in t||(t={}))Mj.call(t,n)&&Gw(e,n,t[n]);if(Mp)for(var n of Mp(t))Dj.call(t,n)&&Gw(e,n,t[n]);return e},lG=(e,t)=>sG(e,aG(t)),cG=(e,t)=>{var n={};for(var r in e)Mj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mp)for(var r of Mp(e))t.indexOf(r)<0&&Dj.call(e,r)&&(n[r]=e[r]);return n};const Tj=f.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:u,visible:d,arrowX:p,arrowY:m}=n,h=cG(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const v=Pa();return d?z.createElement("div",lG(iG({},h),{ref:t,style:rG({position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:u,dir:v.dir,arrowX:p,arrowY:m})})):null});Tj.displayName="@mantine/core/FloatingArrow";var uG=Object.defineProperty,dG=Object.defineProperties,fG=Object.getOwnPropertyDescriptors,Dp=Object.getOwnPropertySymbols,Aj=Object.prototype.hasOwnProperty,Nj=Object.prototype.propertyIsEnumerable,qw=(e,t,n)=>t in e?uG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kl=(e,t)=>{for(var n in t||(t={}))Aj.call(t,n)&&qw(e,n,t[n]);if(Dp)for(var n of Dp(t))Nj.call(t,n)&&qw(e,n,t[n]);return e},pf=(e,t)=>dG(e,fG(t)),pG=(e,t)=>{var n={};for(var r in e)Aj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dp)for(var r of Dp(e))t.indexOf(r)<0&&Nj.call(e,r)&&(n[r]=e[r]);return n};const hG={};function $j(e){var t;const n=br("PopoverDropdown",hG,e),{style:r,className:o,children:s,onKeyDownCapture:i}=n,u=pG(n,["style","className","children","onKeyDownCapture"]),d=jj(),{classes:p,cx:m}=UU({radius:d.radius,shadow:d.shadow},{name:d.__staticSelector,classNames:d.classNames,styles:d.styles,unstyled:d.unstyled,variant:d.variant}),h=VB({opened:d.opened,shouldReturnFocus:d.returnFocus}),v=d.withRoles?{"aria-labelledby":d.getTargetId(),id:d.getDropdownId(),role:"dialog"}:{};return d.disabled?null:z.createElement(Fk,pf(kl({},d.portalProps),{withinPortal:d.withinPortal}),z.createElement(Oj,pf(kl({mounted:d.opened},d.transitionProps),{transition:d.transitionProps.transition||"fade",duration:(t=d.transitionProps.duration)!=null?t:150,keepMounted:d.keepMounted,exitDuration:typeof d.transitionProps.exitDuration=="number"?d.transitionProps.exitDuration:d.transitionProps.duration}),b=>{var w,S;return z.createElement(Rj,{active:d.trapFocus},z.createElement(go,kl(pf(kl({},v),{tabIndex:-1,ref:d.floating,style:pf(kl(kl({},r),b),{zIndex:d.zIndex,top:(w=d.y)!=null?w:0,left:(S=d.x)!=null?S:0,width:d.width==="target"?void 0:Le(d.width)}),className:m(p.dropdown,o),onKeyDownCapture:yB(d.onClose,{active:d.closeOnEscape,onTrigger:h,onKeyDown:i}),"data-position":d.placement}),u),s,z.createElement(Tj,{ref:d.arrowRef,arrowX:d.arrowX,arrowY:d.arrowY,visible:d.withArrow,position:d.placement,arrowSize:d.arrowSize,arrowRadius:d.arrowRadius,arrowOffset:d.arrowOffset,arrowPosition:d.arrowPosition,className:p.arrow})))}))}$j.displayName="@mantine/core/PopoverDropdown";function mG(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}var Kw=Object.getOwnPropertySymbols,gG=Object.prototype.hasOwnProperty,vG=Object.prototype.propertyIsEnumerable,yG=(e,t)=>{var n={};for(var r in e)gG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Kw)for(var r of Kw(e))t.indexOf(r)<0&&vG.call(e,r)&&(n[r]=e[r]);return n};const bG={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:$1("popover"),__staticSelector:"Popover",width:"max-content"};function xc(e){var t,n,r,o,s,i;const u=f.useRef(null),d=br("Popover",bG,e),{children:p,position:m,offset:h,onPositionChange:v,positionDependencies:b,opened:w,transitionProps:S,width:C,middlewares:_,withArrow:k,arrowSize:P,arrowOffset:E,arrowRadius:I,arrowPosition:R,unstyled:O,classNames:D,styles:T,closeOnClickOutside:$,withinPortal:B,portalProps:ee,closeOnEscape:F,clickOutsideEvents:N,trapFocus:H,onClose:K,onOpen:A,onChange:U,zIndex:V,radius:W,shadow:re,id:be,defaultOpened:ce,__staticSelector:se,withRoles:X,disabled:ie,returnFocus:de,variant:xe,keepMounted:oe}=d,ve=yG(d,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[he,je]=f.useState(null),[Ne,ge]=f.useState(null),Oe=L1(be),at=Pa(),Fe=NU({middlewares:_,width:C,position:mG(at.dir,m),offset:typeof h=="number"?h+(k?P/2:0):h,arrowRef:u,arrowOffset:E,onPositionChange:v,positionDependencies:b,opened:w,defaultOpened:ce,onChange:U,onOpen:A,onClose:K});LB(()=>Fe.opened&&$&&Fe.onClose(),N,[he,Ne]);const qe=f.useCallback(St=>{je(St),Fe.floating.reference(St)},[Fe.floating.reference]),Pt=f.useCallback(St=>{ge(St),Fe.floating.floating(St)},[Fe.floating.floating]);return z.createElement($U,{value:{returnFocus:de,disabled:ie,controlled:Fe.controlled,reference:qe,floating:Pt,x:Fe.floating.x,y:Fe.floating.y,arrowX:(r=(n=(t=Fe.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(i=(s=(o=Fe.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:i.y,opened:Fe.opened,arrowRef:u,transitionProps:S,width:C,withArrow:k,arrowSize:P,arrowOffset:E,arrowRadius:I,arrowPosition:R,placement:Fe.floating.placement,trapFocus:H,withinPortal:B,portalProps:ee,zIndex:V,radius:W,shadow:re,closeOnEscape:F,onClose:Fe.onClose,onToggle:Fe.onToggle,getTargetId:()=>`${Oe}-target`,getDropdownId:()=>`${Oe}-dropdown`,withRoles:X,targetProps:ve,__staticSelector:se,classNames:D,styles:T,unstyled:O,variant:xe,keepMounted:oe}},p)}xc.Target=Ej;xc.Dropdown=$j;xc.displayName="@mantine/core/Popover";var xG=Object.defineProperty,Tp=Object.getOwnPropertySymbols,zj=Object.prototype.hasOwnProperty,Lj=Object.prototype.propertyIsEnumerable,Yw=(e,t,n)=>t in e?xG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,SG=(e,t)=>{for(var n in t||(t={}))zj.call(t,n)&&Yw(e,n,t[n]);if(Tp)for(var n of Tp(t))Lj.call(t,n)&&Yw(e,n,t[n]);return e},wG=(e,t)=>{var n={};for(var r in e)zj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tp)for(var r of Tp(e))t.indexOf(r)<0&&Lj.call(e,r)&&(n[r]=e[r]);return n};function CG(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:i,innerRef:u,__staticSelector:d,styles:p,classNames:m,unstyled:h}=t,v=wG(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:b}=sU(null,{name:d,styles:p,classNames:m,unstyled:h});return z.createElement(xc.Dropdown,SG({p:0,onMouseDown:w=>w.preventDefault()},v),z.createElement("div",{style:{maxHeight:Le(o),display:"flex"}},z.createElement(go,{component:r||"div",id:`${i}-items`,"aria-labelledby":`${i}-label`,role:"listbox",onMouseDown:w=>w.preventDefault(),style:{flex:1,overflowY:r!==Hh?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:u},z.createElement("div",{className:b.itemsWrapper,style:{flexDirection:s}},n))))}function oi({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:s,__staticSelector:i,onDirectionChange:u,switchDirectionOnFlip:d,zIndex:p,dropdownPosition:m,positionDependencies:h=[],classNames:v,styles:b,unstyled:w,readOnly:S,variant:C}){return z.createElement(xc,{unstyled:w,classNames:v,styles:b,width:"target",withRoles:!1,opened:e,middlewares:{flip:m==="flip",shift:!1},position:m==="flip"?"bottom":m,positionDependencies:h,zIndex:p,__staticSelector:i,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:S,onPositionChange:_=>d&&(u==null?void 0:u(_==="top"?"column-reverse":"column")),variant:C},s)}oi.Target=xc.Target;oi.Dropdown=CG;var _G=Object.defineProperty,kG=Object.defineProperties,jG=Object.getOwnPropertyDescriptors,Ap=Object.getOwnPropertySymbols,Fj=Object.prototype.hasOwnProperty,Bj=Object.prototype.propertyIsEnumerable,Qw=(e,t,n)=>t in e?_G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hf=(e,t)=>{for(var n in t||(t={}))Fj.call(t,n)&&Qw(e,n,t[n]);if(Ap)for(var n of Ap(t))Bj.call(t,n)&&Qw(e,n,t[n]);return e},PG=(e,t)=>kG(e,jG(t)),IG=(e,t)=>{var n={};for(var r in e)Fj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ap)for(var r of Ap(e))t.indexOf(r)<0&&Bj.call(e,r)&&(n[r]=e[r]);return n};function Hj(e,t,n){const r=br(e,t,n),{label:o,description:s,error:i,required:u,classNames:d,styles:p,className:m,unstyled:h,__staticSelector:v,sx:b,errorProps:w,labelProps:S,descriptionProps:C,wrapperProps:_,id:k,size:P,style:E,inputContainer:I,inputWrapperOrder:R,withAsterisk:O,variant:D}=r,T=IG(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),$=L1(k),{systemStyles:B,rest:ee}=zh(T),F=hf({label:o,description:s,error:i,required:u,classNames:d,className:m,__staticSelector:v,sx:b,errorProps:w,labelProps:S,descriptionProps:C,unstyled:h,styles:p,id:$,size:P,style:E,inputContainer:I,inputWrapperOrder:R,withAsterisk:O,variant:D},_);return PG(hf({},ee),{classNames:d,styles:p,unstyled:h,wrapperProps:hf(hf({},F),B),inputProps:{required:u,classNames:d,styles:p,unstyled:h,id:$,size:P,__staticSelector:v,error:i,variant:D}})}var EG=Zr((e,t,{size:n})=>({label:{display:"inline-block",fontSize:Nt({size:n,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const OG=EG;var RG=Object.defineProperty,Np=Object.getOwnPropertySymbols,Vj=Object.prototype.hasOwnProperty,Wj=Object.prototype.propertyIsEnumerable,Xw=(e,t,n)=>t in e?RG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MG=(e,t)=>{for(var n in t||(t={}))Vj.call(t,n)&&Xw(e,n,t[n]);if(Np)for(var n of Np(t))Wj.call(t,n)&&Xw(e,n,t[n]);return e},DG=(e,t)=>{var n={};for(var r in e)Vj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Np)for(var r of Np(e))t.indexOf(r)<0&&Wj.call(e,r)&&(n[r]=e[r]);return n};const TG={labelElement:"label",size:"sm"},K1=f.forwardRef((e,t)=>{const n=br("InputLabel",TG,e),{labelElement:r,children:o,required:s,size:i,classNames:u,styles:d,unstyled:p,className:m,htmlFor:h,__staticSelector:v,variant:b,onMouseDown:w}=n,S=DG(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:C,cx:_}=OG(null,{name:["InputWrapper",v],classNames:u,styles:d,unstyled:p,variant:b,size:i});return z.createElement(go,MG({component:r,ref:t,className:_(C.label,m),htmlFor:r==="label"?h:void 0,onMouseDown:k=>{w==null||w(k),!k.defaultPrevented&&k.detail>1&&k.preventDefault()}},S),o,s&&z.createElement("span",{className:C.required,"aria-hidden":!0}," *"))});K1.displayName="@mantine/core/InputLabel";var AG=Zr((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${Nt({size:n,sizes:e.fontSizes})} - ${Le(2)})`,lineHeight:1.2,display:"block"}}));const NG=AG;var $G=Object.defineProperty,$p=Object.getOwnPropertySymbols,Uj=Object.prototype.hasOwnProperty,Gj=Object.prototype.propertyIsEnumerable,Zw=(e,t,n)=>t in e?$G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zG=(e,t)=>{for(var n in t||(t={}))Uj.call(t,n)&&Zw(e,n,t[n]);if($p)for(var n of $p(t))Gj.call(t,n)&&Zw(e,n,t[n]);return e},LG=(e,t)=>{var n={};for(var r in e)Uj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$p)for(var r of $p(e))t.indexOf(r)<0&&Gj.call(e,r)&&(n[r]=e[r]);return n};const FG={size:"sm"},Y1=f.forwardRef((e,t)=>{const n=br("InputError",FG,e),{children:r,className:o,classNames:s,styles:i,unstyled:u,size:d,__staticSelector:p,variant:m}=n,h=LG(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:b}=NG(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:u,variant:m,size:d});return z.createElement(Yl,zG({className:b(v.error,o),ref:t},h),r)});Y1.displayName="@mantine/core/InputError";var BG=Zr((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${Nt({size:n,sizes:e.fontSizes})} - ${Le(2)})`,lineHeight:1.2,display:"block"}}));const HG=BG;var VG=Object.defineProperty,zp=Object.getOwnPropertySymbols,qj=Object.prototype.hasOwnProperty,Kj=Object.prototype.propertyIsEnumerable,Jw=(e,t,n)=>t in e?VG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WG=(e,t)=>{for(var n in t||(t={}))qj.call(t,n)&&Jw(e,n,t[n]);if(zp)for(var n of zp(t))Kj.call(t,n)&&Jw(e,n,t[n]);return e},UG=(e,t)=>{var n={};for(var r in e)qj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zp)for(var r of zp(e))t.indexOf(r)<0&&Kj.call(e,r)&&(n[r]=e[r]);return n};const GG={size:"sm"},Q1=f.forwardRef((e,t)=>{const n=br("InputDescription",GG,e),{children:r,className:o,classNames:s,styles:i,unstyled:u,size:d,__staticSelector:p,variant:m}=n,h=UG(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:b}=HG(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:u,variant:m,size:d});return z.createElement(Yl,WG({color:"dimmed",className:b(v.description,o),ref:t,unstyled:u},h),r)});Q1.displayName="@mantine/core/InputDescription";const Yj=f.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),qG=Yj.Provider,KG=()=>f.useContext(Yj);function YG(e,{hasDescription:t,hasError:n}){const r=e.findIndex(d=>d==="input"),o=e[r-1],s=e[r+1];return{offsetBottom:t&&s==="description"||n&&s==="error",offsetTop:t&&o==="description"||n&&o==="error"}}var QG=Object.defineProperty,XG=Object.defineProperties,ZG=Object.getOwnPropertyDescriptors,eC=Object.getOwnPropertySymbols,JG=Object.prototype.hasOwnProperty,eq=Object.prototype.propertyIsEnumerable,tC=(e,t,n)=>t in e?QG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tq=(e,t)=>{for(var n in t||(t={}))JG.call(t,n)&&tC(e,n,t[n]);if(eC)for(var n of eC(t))eq.call(t,n)&&tC(e,n,t[n]);return e},nq=(e,t)=>XG(e,ZG(t)),rq=Zr(e=>({root:nq(tq({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const oq=rq;var sq=Object.defineProperty,aq=Object.defineProperties,iq=Object.getOwnPropertyDescriptors,Lp=Object.getOwnPropertySymbols,Qj=Object.prototype.hasOwnProperty,Xj=Object.prototype.propertyIsEnumerable,nC=(e,t,n)=>t in e?sq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Va=(e,t)=>{for(var n in t||(t={}))Qj.call(t,n)&&nC(e,n,t[n]);if(Lp)for(var n of Lp(t))Xj.call(t,n)&&nC(e,n,t[n]);return e},rC=(e,t)=>aq(e,iq(t)),lq=(e,t)=>{var n={};for(var r in e)Qj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lp)for(var r of Lp(e))t.indexOf(r)<0&&Xj.call(e,r)&&(n[r]=e[r]);return n};const cq={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},Zj=f.forwardRef((e,t)=>{const n=br("InputWrapper",cq,e),{className:r,label:o,children:s,required:i,id:u,error:d,description:p,labelElement:m,labelProps:h,descriptionProps:v,errorProps:b,classNames:w,styles:S,size:C,inputContainer:_,__staticSelector:k,unstyled:P,inputWrapperOrder:E,withAsterisk:I,variant:R}=n,O=lq(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:D,cx:T}=oq(null,{classNames:w,styles:S,name:["InputWrapper",k],unstyled:P,variant:R,size:C}),$={classNames:w,styles:S,unstyled:P,size:C,variant:R,__staticSelector:k},B=typeof I=="boolean"?I:i,ee=u?`${u}-error`:b==null?void 0:b.id,F=u?`${u}-description`:v==null?void 0:v.id,H=`${!!d&&typeof d!="boolean"?ee:""} ${p?F:""}`,K=H.trim().length>0?H.trim():void 0,A=o&&z.createElement(K1,Va(Va({key:"label",labelElement:m,id:u?`${u}-label`:void 0,htmlFor:u,required:B},$),h),o),U=p&&z.createElement(Q1,rC(Va(Va({key:"description"},v),$),{size:(v==null?void 0:v.size)||$.size,id:(v==null?void 0:v.id)||F}),p),V=z.createElement(f.Fragment,{key:"input"},_(s)),W=typeof d!="boolean"&&d&&z.createElement(Y1,rC(Va(Va({},b),$),{size:(b==null?void 0:b.size)||$.size,key:"error",id:(b==null?void 0:b.id)||ee}),d),re=E.map(be=>{switch(be){case"label":return A;case"input":return V;case"description":return U;case"error":return W;default:return null}});return z.createElement(qG,{value:Va({describedBy:K},YG(E,{hasDescription:!!U,hasError:!!W}))},z.createElement(go,Va({className:T(D.root,r),ref:t},O),re))});Zj.displayName="@mantine/core/InputWrapper";var uq=Object.defineProperty,Fp=Object.getOwnPropertySymbols,Jj=Object.prototype.hasOwnProperty,eP=Object.prototype.propertyIsEnumerable,oC=(e,t,n)=>t in e?uq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dq=(e,t)=>{for(var n in t||(t={}))Jj.call(t,n)&&oC(e,n,t[n]);if(Fp)for(var n of Fp(t))eP.call(t,n)&&oC(e,n,t[n]);return e},fq=(e,t)=>{var n={};for(var r in e)Jj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fp)for(var r of Fp(e))t.indexOf(r)<0&&eP.call(e,r)&&(n[r]=e[r]);return n};const pq={},tP=f.forwardRef((e,t)=>{const n=br("InputPlaceholder",pq,e),{sx:r}=n,o=fq(n,["sx"]);return z.createElement(go,dq({component:"span",sx:[s=>s.fn.placeholderStyles(),...ok(r)],ref:t},o))});tP.displayName="@mantine/core/InputPlaceholder";var hq=Object.defineProperty,mq=Object.defineProperties,gq=Object.getOwnPropertyDescriptors,sC=Object.getOwnPropertySymbols,vq=Object.prototype.hasOwnProperty,yq=Object.prototype.propertyIsEnumerable,aC=(e,t,n)=>t in e?hq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mf=(e,t)=>{for(var n in t||(t={}))vq.call(t,n)&&aC(e,n,t[n]);if(sC)for(var n of sC(t))yq.call(t,n)&&aC(e,n,t[n]);return e},Vg=(e,t)=>mq(e,gq(t));const Vo={xs:Le(30),sm:Le(36),md:Le(42),lg:Le(50),xl:Le(60)},bq=["default","filled","unstyled"];function xq({theme:e,variant:t}){return bq.includes(t)?t==="default"?{border:`${Le(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:`${Le(1)} solid transparent`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:Le(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var Sq=Zr((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:i,offsetBottom:u,offsetTop:d,pointer:p},{variant:m,size:h})=>{const v=e.fn.variant({variant:"filled",color:"red"}).background,b=m==="default"||m==="filled"?{minHeight:Nt({size:h,sizes:Vo}),paddingLeft:`calc(${Nt({size:h,sizes:Vo})} / 3)`,paddingRight:s?o||Nt({size:h,sizes:Vo}):`calc(${Nt({size:h,sizes:Vo})} / 3)`,borderRadius:e.fn.radius(n)}:m==="unstyled"&&s?{paddingRight:o||Nt({size:h,sizes:Vo})}:null;return{wrapper:{position:"relative",marginTop:d?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:u?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:Vg(mf(mf(Vg(mf({},e.fn.fontStyles()),{height:t?m==="unstyled"?void 0:"auto":Nt({size:h,sizes:Vo}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${Nt({size:h,sizes:Vo})} - ${Le(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:Nt({size:h,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:p?"pointer":void 0}),xq({theme:e,variant:m})),b),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:v,borderColor:v,"&::placeholder":{opacity:1,color:v}},"&[data-with-icon]":{paddingLeft:typeof i=="number"?Le(i):Nt({size:h,sizes:Vo})},"&::placeholder":Vg(mf({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:i?Le(i):Nt({size:h,sizes:Vo}),color:r?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||Nt({size:h,sizes:Vo})}}});const wq=Sq;var Cq=Object.defineProperty,_q=Object.defineProperties,kq=Object.getOwnPropertyDescriptors,Bp=Object.getOwnPropertySymbols,nP=Object.prototype.hasOwnProperty,rP=Object.prototype.propertyIsEnumerable,iC=(e,t,n)=>t in e?Cq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gf=(e,t)=>{for(var n in t||(t={}))nP.call(t,n)&&iC(e,n,t[n]);if(Bp)for(var n of Bp(t))rP.call(t,n)&&iC(e,n,t[n]);return e},lC=(e,t)=>_q(e,kq(t)),jq=(e,t)=>{var n={};for(var r in e)nP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Bp)for(var r of Bp(e))t.indexOf(r)<0&&rP.call(e,r)&&(n[r]=e[r]);return n};const Pq={size:"sm",variant:"default"},nl=f.forwardRef((e,t)=>{const n=br("Input",Pq,e),{className:r,error:o,required:s,disabled:i,variant:u,icon:d,style:p,rightSectionWidth:m,iconWidth:h,rightSection:v,rightSectionProps:b,radius:w,size:S,wrapperProps:C,classNames:_,styles:k,__staticSelector:P,multiline:E,sx:I,unstyled:R,pointer:O}=n,D=jq(n,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:T,offsetTop:$,describedBy:B}=KG(),{classes:ee,cx:F}=wq({radius:w,multiline:E,invalid:!!o,rightSectionWidth:m?Le(m):void 0,iconWidth:h,withRightSection:!!v,offsetBottom:T,offsetTop:$,pointer:O},{classNames:_,styles:k,name:["Input",P],unstyled:R,variant:u,size:S}),{systemStyles:N,rest:H}=zh(D);return z.createElement(go,gf(gf({className:F(ee.wrapper,r),sx:I,style:p},N),C),d&&z.createElement("div",{className:ee.icon},d),z.createElement(go,lC(gf({component:"input"},H),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":B,disabled:i,"data-disabled":i||void 0,"data-with-icon":!!d||void 0,"data-invalid":!!o||void 0,className:ee.input})),v&&z.createElement("div",lC(gf({},b),{className:ee.rightSection}),v))});nl.displayName="@mantine/core/Input";nl.Wrapper=Zj;nl.Label=K1;nl.Description=Q1;nl.Error=Y1;nl.Placeholder=tP;const Jl=nl;var Iq=Object.defineProperty,Hp=Object.getOwnPropertySymbols,oP=Object.prototype.hasOwnProperty,sP=Object.prototype.propertyIsEnumerable,cC=(e,t,n)=>t in e?Iq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uC=(e,t)=>{for(var n in t||(t={}))oP.call(t,n)&&cC(e,n,t[n]);if(Hp)for(var n of Hp(t))sP.call(t,n)&&cC(e,n,t[n]);return e},Eq=(e,t)=>{var n={};for(var r in e)oP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hp)for(var r of Hp(e))t.indexOf(r)<0&&sP.call(e,r)&&(n[r]=e[r]);return n};const Oq={multiple:!1},aP=f.forwardRef((e,t)=>{const n=br("FileButton",Oq,e),{onChange:r,children:o,multiple:s,accept:i,name:u,form:d,resetRef:p,disabled:m,capture:h,inputProps:v}=n,b=Eq(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),w=f.useRef(),S=()=>{!m&&w.current.click()},C=k=>{r(s?Array.from(k.currentTarget.files):k.currentTarget.files[0]||null)};return hk(p,()=>{w.current.value=""}),z.createElement(z.Fragment,null,o(uC({onClick:S},b)),z.createElement("input",uC({style:{display:"none"},type:"file",accept:i,multiple:s,onChange:C,ref:Uu(t,w),name:u,form:d,capture:h},v)))});aP.displayName="@mantine/core/FileButton";const iP={xs:Le(16),sm:Le(22),md:Le(26),lg:Le(30),xl:Le(36)},Rq={xs:Le(10),sm:Le(12),md:Le(14),lg:Le(16),xl:Le(18)};var Mq=Zr((e,{disabled:t,radius:n,readOnly:r},{size:o,variant:s})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:s==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:Nt({size:o,sizes:iP}),paddingLeft:`calc(${Nt({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?Nt({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:Nt({size:o,sizes:Rq}),borderRadius:Nt({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${Le(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${Nt({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const Dq=Mq;var Tq=Object.defineProperty,Vp=Object.getOwnPropertySymbols,lP=Object.prototype.hasOwnProperty,cP=Object.prototype.propertyIsEnumerable,dC=(e,t,n)=>t in e?Tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Aq=(e,t)=>{for(var n in t||(t={}))lP.call(t,n)&&dC(e,n,t[n]);if(Vp)for(var n of Vp(t))cP.call(t,n)&&dC(e,n,t[n]);return e},Nq=(e,t)=>{var n={};for(var r in e)lP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vp)for(var r of Vp(e))t.indexOf(r)<0&&cP.call(e,r)&&(n[r]=e[r]);return n};const $q={xs:16,sm:22,md:24,lg:26,xl:30};function uP(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:i,disabled:u,readOnly:d,size:p,radius:m="sm",variant:h,unstyled:v}=t,b=Nq(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:w,cx:S}=Dq({disabled:u,readOnly:d,radius:m},{name:"MultiSelect",classNames:r,styles:o,unstyled:v,size:p,variant:h});return z.createElement("div",Aq({className:S(w.defaultValue,s)},b),z.createElement("span",{className:w.defaultValueLabel},n),!u&&!d&&z.createElement(Uk,{"aria-hidden":!0,onMouseDown:i,size:$q[p],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:w.defaultValueRemove,tabIndex:-1,unstyled:v}))}uP.displayName="@mantine/core/MultiSelect/DefaultValue";function zq({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,disableSelectedItemFiltering:i}){if(!t&&s.length===0)return e;if(!t){const d=[];for(let p=0;p<e.length;p+=1)(i||!s.some(m=>m===e[p].value&&!e[p].disabled))&&d.push(e[p]);return d}const u=[];for(let d=0;d<e.length&&(o(r,!i&&s.some(p=>p===e[d].value&&!e[d].disabled),e[d])&&u.push(e[d]),!(u.length>=n));d+=1);return u}var Lq=Object.defineProperty,Wp=Object.getOwnPropertySymbols,dP=Object.prototype.hasOwnProperty,fP=Object.prototype.propertyIsEnumerable,fC=(e,t,n)=>t in e?Lq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pC=(e,t)=>{for(var n in t||(t={}))dP.call(t,n)&&fC(e,n,t[n]);if(Wp)for(var n of Wp(t))fP.call(t,n)&&fC(e,n,t[n]);return e},Fq=(e,t)=>{var n={};for(var r in e)dP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wp)for(var r of Wp(e))t.indexOf(r)<0&&fP.call(e,r)&&(n[r]=e[r]);return n};const Bq={xs:Le(14),sm:Le(18),md:Le(20),lg:Le(24),xl:Le(28)};function Hq(e){var t=e,{size:n,error:r,style:o}=t,s=Fq(t,["size","error","style"]);const i=Pa(),u=Nt({size:n,sizes:Bq});return z.createElement("svg",pC({width:u,height:u,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:pC({color:r?i.colors.red[6]:i.colors.gray[6]},o),"data-chevron":!0},s),z.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var Vq=Object.defineProperty,Wq=Object.defineProperties,Uq=Object.getOwnPropertyDescriptors,hC=Object.getOwnPropertySymbols,Gq=Object.prototype.hasOwnProperty,qq=Object.prototype.propertyIsEnumerable,mC=(e,t,n)=>t in e?Vq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kq=(e,t)=>{for(var n in t||(t={}))Gq.call(t,n)&&mC(e,n,t[n]);if(hC)for(var n of hC(t))qq.call(t,n)&&mC(e,n,t[n]);return e},Yq=(e,t)=>Wq(e,Uq(t));function pP({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?z.createElement(Uk,Yq(Kq({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):z.createElement(Hq,{error:o,size:r})}pP.displayName="@mantine/core/SelectRightSection";var Qq=Object.defineProperty,Xq=Object.defineProperties,Zq=Object.getOwnPropertyDescriptors,Up=Object.getOwnPropertySymbols,hP=Object.prototype.hasOwnProperty,mP=Object.prototype.propertyIsEnumerable,gC=(e,t,n)=>t in e?Qq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wg=(e,t)=>{for(var n in t||(t={}))hP.call(t,n)&&gC(e,n,t[n]);if(Up)for(var n of Up(t))mP.call(t,n)&&gC(e,n,t[n]);return e},vC=(e,t)=>Xq(e,Zq(t)),Jq=(e,t)=>{var n={};for(var r in e)hP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Up)for(var r of Up(e))t.indexOf(r)<0&&mP.call(e,r)&&(n[r]=e[r]);return n};function gP(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,i=Jq(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const u=typeof n=="function"?n(s):n;return{rightSection:!i.readOnly&&!(i.disabled&&i.shouldClear)&&z.createElement(pP,Wg({},i)),styles:vC(Wg({},u),{rightSection:vC(Wg({},u==null?void 0:u.rightSection),{pointerEvents:i.shouldClear?void 0:"none"})})}}var eK=Object.defineProperty,tK=Object.defineProperties,nK=Object.getOwnPropertyDescriptors,yC=Object.getOwnPropertySymbols,rK=Object.prototype.hasOwnProperty,oK=Object.prototype.propertyIsEnumerable,bC=(e,t,n)=>t in e?eK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sK=(e,t)=>{for(var n in t||(t={}))rK.call(t,n)&&bC(e,n,t[n]);if(yC)for(var n of yC(t))oK.call(t,n)&&bC(e,n,t[n]);return e},aK=(e,t)=>tK(e,nK(t)),iK=Zr((e,{invalid:t},{size:n})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${Nt({size:n,sizes:Vo})} - ${Le(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:Nt({size:n,sizes:Vo})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${Le(2)}) calc(${e.spacing.xs} / 2)`},searchInput:aK(sK({},e.fn.fontStyles()),{flex:1,minWidth:Le(60),backgroundColor:"transparent",border:0,outline:0,fontSize:Nt({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:Nt({size:n,sizes:iP}),"&::placeholder":{opacity:1,color:t?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}}));const lK=iK;var cK=Object.defineProperty,uK=Object.defineProperties,dK=Object.getOwnPropertyDescriptors,Gp=Object.getOwnPropertySymbols,vP=Object.prototype.hasOwnProperty,yP=Object.prototype.propertyIsEnumerable,xC=(e,t,n)=>t in e?cK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jl=(e,t)=>{for(var n in t||(t={}))vP.call(t,n)&&xC(e,n,t[n]);if(Gp)for(var n of Gp(t))yP.call(t,n)&&xC(e,n,t[n]);return e},SC=(e,t)=>uK(e,dK(t)),fK=(e,t)=>{var n={};for(var r in e)vP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gp)for(var r of Gp(e))t.indexOf(r)<0&&yP.call(e,r)&&(n[r]=e[r]);return n};function pK(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function hK(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function wC(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const n=t.map(r=>typeof r=="object"?r.value:r);return e.filter(r=>n.includes(r))}const mK={size:"sm",valueComponent:uP,itemComponent:B1,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:pK,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:hK,switchDirectionOnFlip:!1,zIndex:$1("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},bP=f.forwardRef((e,t)=>{const n=br("MultiSelect",mK,e),{className:r,style:o,required:s,label:i,description:u,size:d,error:p,classNames:m,styles:h,wrapperProps:v,value:b,defaultValue:w,data:S,onChange:C,valueComponent:_,itemComponent:k,id:P,transitionProps:E,maxDropdownHeight:I,shadow:R,nothingFound:O,onFocus:D,onBlur:T,searchable:$,placeholder:B,filter:ee,limit:F,clearSearchOnChange:N,clearable:H,clearSearchOnBlur:K,variant:A,onSearchChange:U,searchValue:V,disabled:W,initiallyOpened:re,radius:be,icon:ce,rightSection:se,rightSectionWidth:X,creatable:ie,getCreateLabel:de,shouldCreate:xe,onCreate:oe,sx:ve,dropdownComponent:he,onDropdownClose:je,onDropdownOpen:Ne,maxSelectedValues:ge,withinPortal:Oe,switchDirectionOnFlip:at,zIndex:Fe,selectOnBlur:qe,name:Pt,dropdownPosition:St,errorProps:zn,labelProps:Y,descriptionProps:Ce,form:te,positionDependencies:fe,onKeyDown:Te,unstyled:Ke,inputContainer:bt,inputWrapperOrder:Xt,readOnly:ln,withAsterisk:_n,clearButtonProps:pr,hoverOnSearchChange:cn,disableSelectedItemFiltering:Un}=n,Re=fK(n,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:Je,cx:it,theme:dt}=lK({invalid:!!p},{name:"MultiSelect",classNames:m,styles:h,unstyled:Ke,size:d,variant:A}),{systemStyles:$t,rest:hr}=zh(Re),un=f.useRef(),xn=f.useRef({}),xr=L1(P),[kn,In]=f.useState(re),[os,dn]=f.useState(-1),[Mo,Do]=f.useState("column"),[Nn,ss]=xu({value:V,defaultValue:"",finalValue:void 0,onChange:U}),[Ra,kr]=f.useState(!1),{scrollIntoView:To,targetRef:ta,scrollableRef:Ma}=gk({duration:0,offset:5,cancelable:!1,isList:!0}),as=ie&&typeof de=="function";let q=null;const Z=S.map(Ie=>typeof Ie=="string"?{label:Ie,value:Ie}:Ie),ue=sk({data:Z}),[ye,Se]=xu({value:wC(b,S),defaultValue:wC(w,S),finalValue:[],onChange:C}),Ye=f.useRef(!!ge&&ge<ye.length),ht=Ie=>{if(!ln){const mt=ye.filter(Mt=>Mt!==Ie);Se(mt),ge&&mt.length<ge&&(Ye.current=!1)}},zt=Ie=>{ss(Ie.currentTarget.value),!W&&!Ye.current&&$&&In(!0)},lt=Ie=>{typeof D=="function"&&D(Ie),!W&&!Ye.current&&$&&In(!0)},He=zq({data:ue,searchable:$,searchValue:Nn,limit:F,filter:ee,value:ye,disableSelectedItemFiltering:Un});as&&xe(Nn,ue)&&(q=de(Nn),He.push({label:Nn,value:Nn,creatable:!0}));const Ge=Math.min(os,He.length-1),_e=(Ie,mt,Mt)=>{let Dt=Ie;for(;Mt(Dt);)if(Dt=mt(Dt),!He[Dt].disabled)return Dt;return Ie};xs(()=>{dn(cn&&Nn?0:-1)},[Nn,cn]),xs(()=>{!W&&ye.length>S.length&&In(!1),ge&&ye.length<ge&&(Ye.current=!1),ge&&ye.length>=ge&&(Ye.current=!0,In(!1))},[ye]);const Ve=Ie=>{if(!ln)if(N&&ss(""),ye.includes(Ie.value))ht(Ie.value);else{if(Ie.creatable&&typeof oe=="function"){const mt=oe(Ie.value);typeof mt<"u"&&mt!==null&&Se(typeof mt=="string"?[...ye,mt]:[...ye,mt.value])}else Se([...ye,Ie.value]);ye.length===ge-1&&(Ye.current=!0,In(!1)),He.length===1&&In(!1)}},wt=Ie=>{typeof T=="function"&&T(Ie),qe&&He[Ge]&&kn&&Ve(He[Ge]),K&&ss(""),In(!1)},_t=Ie=>{if(Ra||(Te==null||Te(Ie),ln)||Ie.key!=="Backspace"&&ge&&Ye.current)return;const mt=Mo==="column",Mt=()=>{dn(Lt=>{var fn;const Wt=_e(Lt,Zt=>Zt+1,Zt=>Zt<He.length-1);return kn&&(ta.current=xn.current[(fn=He[Wt])==null?void 0:fn.value],To({alignment:mt?"end":"start"})),Wt})},Dt=()=>{dn(Lt=>{var fn;const Wt=_e(Lt,Zt=>Zt-1,Zt=>Zt>0);return kn&&(ta.current=xn.current[(fn=He[Wt])==null?void 0:fn.value],To({alignment:mt?"start":"end"})),Wt})};switch(Ie.key){case"ArrowUp":{Ie.preventDefault(),In(!0),mt?Dt():Mt();break}case"ArrowDown":{Ie.preventDefault(),In(!0),mt?Mt():Dt();break}case"Enter":{Ie.preventDefault(),He[Ge]&&kn?Ve(He[Ge]):In(!0);break}case" ":{$||(Ie.preventDefault(),He[Ge]&&kn?Ve(He[Ge]):In(!0));break}case"Backspace":{ye.length>0&&Nn.length===0&&(Se(ye.slice(0,-1)),In(!0),ge&&(Ye.current=!1));break}case"Home":{if(!$){Ie.preventDefault(),kn||In(!0);const Lt=He.findIndex(fn=>!fn.disabled);dn(Lt),To({alignment:mt?"end":"start"})}break}case"End":{if(!$){Ie.preventDefault(),kn||In(!0);const Lt=He.map(fn=>!!fn.disabled).lastIndexOf(!1);dn(Lt),To({alignment:mt?"end":"start"})}break}case"Escape":In(!1)}},Rt=ye.map(Ie=>{let mt=ue.find(Mt=>Mt.value===Ie&&!Mt.disabled);return!mt&&as&&(mt={value:Ie,label:Ie}),mt}).filter(Ie=>!!Ie).map((Ie,mt)=>z.createElement(_,SC(jl({},Ie),{variant:A,disabled:W,className:Je.value,readOnly:ln,onRemove:Mt=>{Mt.preventDefault(),Mt.stopPropagation(),ht(Ie.value)},key:Ie.value,size:d,styles:h,classNames:m,radius:be,index:mt}))),Ft=Ie=>ye.includes(Ie),Gt=()=>{var Ie;ss(""),Se([]),(Ie=un.current)==null||Ie.focus(),ge&&(Ye.current=!1)},Bt=!ln&&(He.length>0?kn:kn&&!!O);return xs(()=>{const Ie=Bt?Ne:je;typeof Ie=="function"&&Ie()},[Bt]),z.createElement(Jl.Wrapper,jl(jl({required:s,id:xr,label:i,error:p,description:u,size:d,className:r,style:o,classNames:m,styles:h,__staticSelector:"MultiSelect",sx:ve,errorProps:zn,descriptionProps:Ce,labelProps:Y,inputContainer:bt,inputWrapperOrder:Xt,unstyled:Ke,withAsterisk:_n,variant:A},$t),v),z.createElement(oi,{opened:Bt,transitionProps:E,shadow:"sm",withinPortal:Oe,__staticSelector:"MultiSelect",onDirectionChange:Do,switchDirectionOnFlip:at,zIndex:Fe,dropdownPosition:St,positionDependencies:[...fe,Nn],classNames:m,styles:h,unstyled:Ke,variant:A},z.createElement(oi.Target,null,z.createElement("div",{className:Je.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":kn&&Bt?`${xr}-items`:null,"aria-controls":xr,"aria-expanded":kn,onMouseLeave:()=>dn(-1),tabIndex:-1},z.createElement("input",{type:"hidden",name:Pt,value:ye.join(","),form:te,disabled:W}),z.createElement(Jl,jl({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:d,variant:A,disabled:W,error:p,required:s,radius:be,icon:ce,unstyled:Ke,onMouseDown:Ie=>{var mt;Ie.preventDefault(),!W&&!Ye.current&&In(!kn),(mt=un.current)==null||mt.focus()},classNames:SC(jl({},m),{input:it({[Je.input]:!$},m==null?void 0:m.input)})},gP({theme:dt,rightSection:se,rightSectionWidth:X,styles:h,size:d,shouldClear:H&&ye.length>0,onClear:Gt,error:p,disabled:W,clearButtonProps:pr,readOnly:ln})),z.createElement("div",{className:Je.values,"data-clearable":H||void 0},Rt,z.createElement("input",jl({ref:Uu(t,un),type:"search",id:xr,className:it(Je.searchInput,{[Je.searchInputPointer]:!$,[Je.searchInputInputHidden]:!kn&&ye.length>0||!$&&ye.length>0,[Je.searchInputEmpty]:ye.length===0}),onKeyDown:_t,value:Nn,onChange:zt,onFocus:lt,onBlur:wt,readOnly:!$||Ye.current||ln,placeholder:ye.length===0?B:void 0,disabled:W,"data-mantine-stop-propagation":kn,autoComplete:"off",onCompositionStart:()=>kr(!0),onCompositionEnd:()=>kr(!1)},hr)))))),z.createElement(oi.Dropdown,{component:he||Hh,maxHeight:I,direction:Mo,id:xr,innerRef:Ma,__staticSelector:"MultiSelect",classNames:m,styles:h},z.createElement(F1,{data:He,hovered:Ge,classNames:m,styles:h,uuid:xr,__staticSelector:"MultiSelect",onItemHover:dn,onItemSelect:Ve,itemsRefs:xn,itemComponent:k,size:d,nothingFound:O,isItemSelected:Ft,creatable:ie&&!!q,createLabel:q,unstyled:Ke,variant:A}))))});bP.displayName="@mantine/core/MultiSelect";var gK=Object.defineProperty,vK=Object.defineProperties,yK=Object.getOwnPropertyDescriptors,qp=Object.getOwnPropertySymbols,xP=Object.prototype.hasOwnProperty,SP=Object.prototype.propertyIsEnumerable,CC=(e,t,n)=>t in e?gK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ug=(e,t)=>{for(var n in t||(t={}))xP.call(t,n)&&CC(e,n,t[n]);if(qp)for(var n of qp(t))SP.call(t,n)&&CC(e,n,t[n]);return e},bK=(e,t)=>vK(e,yK(t)),xK=(e,t)=>{var n={};for(var r in e)xP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qp)for(var r of qp(e))t.indexOf(r)<0&&SP.call(e,r)&&(n[r]=e[r]);return n};const SK={type:"text",size:"sm",__staticSelector:"TextInput"},wP=f.forwardRef((e,t)=>{const n=Hj("TextInput",SK,e),{inputProps:r,wrapperProps:o}=n,s=xK(n,["inputProps","wrapperProps"]);return z.createElement(Jl.Wrapper,Ug({},o),z.createElement(Jl,bK(Ug(Ug({},r),s),{ref:t})))});wP.displayName="@mantine/core/TextInput";function wK({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:i}){if(!t)return e;const u=s!=null&&e.find(p=>p.value===s)||null;if(u&&!i&&(u==null?void 0:u.label)===r){if(n){if(n>=e.length)return e;const p=e.indexOf(u),m=p+n,h=m-e.length;return h>0?e.slice(p-h):e.slice(p,m)}return e}const d=[];for(let p=0;p<e.length&&(o(r,e[p])&&d.push(e[p]),!(d.length>=n));p+=1);return d}var CK=Zr(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const _K=CK;var kK=Object.defineProperty,jK=Object.defineProperties,PK=Object.getOwnPropertyDescriptors,Kp=Object.getOwnPropertySymbols,CP=Object.prototype.hasOwnProperty,_P=Object.prototype.propertyIsEnumerable,_C=(e,t,n)=>t in e?kK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wc=(e,t)=>{for(var n in t||(t={}))CP.call(t,n)&&_C(e,n,t[n]);if(Kp)for(var n of Kp(t))_P.call(t,n)&&_C(e,n,t[n]);return e},Gg=(e,t)=>jK(e,PK(t)),IK=(e,t)=>{var n={};for(var r in e)CP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Kp)for(var r of Kp(e))t.indexOf(r)<0&&_P.call(e,r)&&(n[r]=e[r]);return n};function EK(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function OK(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const RK={required:!1,size:"sm",shadow:"sm",itemComponent:B1,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:EK,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:OK,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:$1("popover"),positionDependencies:[],dropdownPosition:"flip"},X1=f.forwardRef((e,t)=>{const n=Hj("Select",RK,e),{inputProps:r,wrapperProps:o,shadow:s,data:i,value:u,defaultValue:d,onChange:p,itemComponent:m,onKeyDown:h,onBlur:v,onFocus:b,transitionProps:w,initiallyOpened:S,unstyled:C,classNames:_,styles:k,filter:P,maxDropdownHeight:E,searchable:I,clearable:R,nothingFound:O,limit:D,disabled:T,onSearchChange:$,searchValue:B,rightSection:ee,rightSectionWidth:F,creatable:N,getCreateLabel:H,shouldCreate:K,selectOnBlur:A,onCreate:U,dropdownComponent:V,onDropdownClose:W,onDropdownOpen:re,withinPortal:be,portalProps:ce,switchDirectionOnFlip:se,zIndex:X,name:ie,dropdownPosition:de,allowDeselect:xe,placeholder:oe,filterDataOnExactSearchMatch:ve,form:he,positionDependencies:je,readOnly:Ne,clearButtonProps:ge,hoverOnSearchChange:Oe}=n,at=IK(n,["inputProps","wrapperProps","shadow","data","value","defaultValue","onChange","itemComponent","onKeyDown","onBlur","onFocus","transitionProps","initiallyOpened","unstyled","classNames","styles","filter","maxDropdownHeight","searchable","clearable","nothingFound","limit","disabled","onSearchChange","searchValue","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","selectOnBlur","onCreate","dropdownComponent","onDropdownClose","onDropdownOpen","withinPortal","portalProps","switchDirectionOnFlip","zIndex","name","dropdownPosition","allowDeselect","placeholder","filterDataOnExactSearchMatch","form","positionDependencies","readOnly","clearButtonProps","hoverOnSearchChange"]),{classes:Fe,cx:qe,theme:Pt}=_K(),[St,zn]=f.useState(S),[Y,Ce]=f.useState(-1),te=f.useRef(),fe=f.useRef({}),[Te,Ke]=f.useState("column"),bt=Te==="column",{scrollIntoView:Xt,targetRef:ln,scrollableRef:_n}=gk({duration:0,offset:5,cancelable:!1,isList:!0}),pr=xe===void 0?R:xe,cn=Z=>{if(St!==Z){zn(Z);const ue=Z?re:W;typeof ue=="function"&&ue()}},Un=N&&typeof H=="function";let Re=null;const Je=i.map(Z=>typeof Z=="string"?{label:Z,value:Z}:Z),it=sk({data:Je}),[dt,$t,hr]=xu({value:u,defaultValue:d,finalValue:null,onChange:p}),un=it.find(Z=>Z.value===dt),[xn,xr]=xu({value:B,defaultValue:(un==null?void 0:un.label)||"",finalValue:void 0,onChange:$}),kn=Z=>{xr(Z),I&&typeof $=="function"&&$(Z)},In=()=>{var Z;Ne||($t(null),hr||kn(""),(Z=te.current)==null||Z.focus())};f.useEffect(()=>{const Z=it.find(ue=>ue.value===dt);Z?kn(Z.label):(!Un||!dt)&&kn("")},[dt]),f.useEffect(()=>{un&&(!I||!St)&&kn(un.label)},[un==null?void 0:un.label]);const os=Z=>{if(!Ne)if(pr&&(un==null?void 0:un.value)===Z.value)$t(null),cn(!1);else{if(Z.creatable&&typeof U=="function"){const ue=U(Z.value);typeof ue<"u"&&ue!==null&&$t(typeof ue=="string"?ue:ue.value)}else $t(Z.value);hr||kn(Z.label),Ce(-1),cn(!1),te.current.focus()}},dn=wK({data:it,searchable:I,limit:D,searchValue:xn,filter:P,filterDataOnExactSearchMatch:ve,value:dt});Un&&K(xn,dn)&&(Re=H(xn),dn.push({label:xn,value:xn,creatable:!0}));const Mo=(Z,ue,ye)=>{let Se=Z;for(;ye(Se);)if(Se=ue(Se),!dn[Se].disabled)return Se;return Z};xs(()=>{Ce(Oe&&xn?0:-1)},[xn,Oe]);const Do=dt?dn.findIndex(Z=>Z.value===dt):0,Nn=!Ne&&(dn.length>0?St:St&&!!O),ss=()=>{Ce(Z=>{var ue;const ye=Mo(Z,Se=>Se-1,Se=>Se>0);return ln.current=fe.current[(ue=dn[ye])==null?void 0:ue.value],Nn&&Xt({alignment:bt?"start":"end"}),ye})},Ra=()=>{Ce(Z=>{var ue;const ye=Mo(Z,Se=>Se+1,Se=>Se<dn.length-1);return ln.current=fe.current[(ue=dn[ye])==null?void 0:ue.value],Nn&&Xt({alignment:bt?"end":"start"}),ye})},kr=()=>window.setTimeout(()=>{var Z;ln.current=fe.current[(Z=dn[Do])==null?void 0:Z.value],Xt({alignment:bt?"end":"start"})},50);xs(()=>{Nn&&kr()},[Nn]);const To=Z=>{switch(typeof h=="function"&&h(Z),Z.key){case"ArrowUp":{Z.preventDefault(),St?bt?ss():Ra():(Ce(Do),cn(!0),kr());break}case"ArrowDown":{Z.preventDefault(),St?bt?Ra():ss():(Ce(Do),cn(!0),kr());break}case"Home":{if(!I){Z.preventDefault(),St||cn(!0);const ue=dn.findIndex(ye=>!ye.disabled);Ce(ue),Nn&&Xt({alignment:bt?"end":"start"})}break}case"End":{if(!I){Z.preventDefault(),St||cn(!0);const ue=dn.map(ye=>!!ye.disabled).lastIndexOf(!1);Ce(ue),Nn&&Xt({alignment:bt?"end":"start"})}break}case"Escape":{Z.preventDefault(),cn(!1),Ce(-1);break}case" ":{I||(Z.preventDefault(),dn[Y]&&St?os(dn[Y]):(cn(!0),Ce(Do),kr()));break}case"Enter":I||Z.preventDefault(),dn[Y]&&St&&(Z.preventDefault(),os(dn[Y]))}},ta=Z=>{typeof v=="function"&&v(Z);const ue=it.find(ye=>ye.value===dt);A&&dn[Y]&&St&&os(dn[Y]),kn((ue==null?void 0:ue.label)||""),cn(!1)},Ma=Z=>{typeof b=="function"&&b(Z),I&&cn(!0)},as=Z=>{Ne||(kn(Z.currentTarget.value),R&&Z.currentTarget.value===""&&$t(null),Ce(-1),cn(!0))},q=()=>{Ne||(cn(!St),dt&&!St&&Ce(Do))};return z.createElement(Jl.Wrapper,Gg(Wc({},o),{__staticSelector:"Select"}),z.createElement(oi,{opened:Nn,transitionProps:w,shadow:s,withinPortal:be,portalProps:ce,__staticSelector:"Select",onDirectionChange:Ke,switchDirectionOnFlip:se,zIndex:X,dropdownPosition:de,positionDependencies:[...je,xn],classNames:_,styles:k,unstyled:C,variant:r.variant},z.createElement(oi.Target,null,z.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":Nn?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":Nn,onMouseLeave:()=>Ce(-1),tabIndex:-1},z.createElement("input",{type:"hidden",name:ie,value:dt||"",form:he,disabled:T}),z.createElement(Jl,Wc(Gg(Wc(Wc({autoComplete:"off",type:"search"},r),at),{ref:Uu(t,te),onKeyDown:To,__staticSelector:"Select",value:xn,placeholder:oe,onChange:as,"aria-autocomplete":"list","aria-controls":Nn?`${r.id}-items`:null,"aria-activedescendant":Y>=0?`${r.id}-${Y}`:null,onMouseDown:q,onBlur:ta,onFocus:Ma,readOnly:!I||Ne,disabled:T,"data-mantine-stop-propagation":Nn,name:null,classNames:Gg(Wc({},_),{input:qe({[Fe.input]:!I},_==null?void 0:_.input)})}),gP({theme:Pt,rightSection:ee,rightSectionWidth:F,styles:k,size:r.size,shouldClear:R&&!!un,onClear:In,error:o.error,clearButtonProps:ge,disabled:T,readOnly:Ne}))))),z.createElement(oi.Dropdown,{component:V||Hh,maxHeight:E,direction:Te,id:r.id,innerRef:_n,__staticSelector:"Select",classNames:_,styles:k},z.createElement(F1,{data:dn,hovered:Y,classNames:_,styles:k,isItemSelected:Z=>Z===dt,uuid:r.id,__staticSelector:"Select",onItemHover:Ce,onItemSelect:os,itemsRefs:fe,itemComponent:m,size:r.size,nothingFound:O,creatable:Un&&!!Re,createLabel:Re,"aria-label":o.label,unstyled:C,variant:r.variant}))))});X1.displayName="@mantine/core/Select";const Z1=()=>{const[e,t,n,r,o,s,i,u,d,p,m,h,v,b,w,S,C,_,k,P,E,I,R,O,D,T,$,B,ee,F,N,H,K,A,U,V,W,re]=uc("colors",["base.50","base.100","base.150","base.200","base.250","base.300","base.350","base.400","base.450","base.500","base.550","base.600","base.650","base.700","base.750","base.800","base.850","base.900","base.950","accent.50","accent.100","accent.150","accent.200","accent.250","accent.300","accent.350","accent.400","accent.450","accent.500","accent.550","accent.600","accent.650","accent.700","accent.750","accent.800","accent.850","accent.900","accent.950"]);return{base50:e,base100:t,base150:n,base200:r,base250:o,base300:s,base350:i,base400:u,base450:d,base500:p,base550:m,base600:h,base650:v,base700:b,base750:w,base800:S,base850:C,base900:_,base950:k,accent50:P,accent100:E,accent150:I,accent200:R,accent250:O,accent300:D,accent350:T,accent400:$,accent450:B,accent500:ee,accent550:F,accent600:N,accent650:H,accent700:K,accent750:A,accent800:U,accent850:V,accent900:W,accent950:re}},kP=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:u,base800:d,base900:p,accent200:m,accent300:h,accent400:v,accent500:b,accent600:w}=Z1(),{colorMode:S}=Qr(),[C]=uc("shadows",["dark-lg"]);return f.useCallback(()=>({label:{color:Pe(u,r)(S)},separatorLabel:{color:Pe(s,s)(S),"::after":{borderTopColor:Pe(r,u)(S)}},input:{backgroundColor:Pe(e,p)(S),borderWidth:"2px",borderColor:Pe(n,d)(S),color:Pe(p,t)(S),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Pe(r,i)(S)},"&:focus":{borderColor:Pe(h,w)(S)},"&:is(:focus, :hover)":{borderColor:Pe(o,s)(S)},"&:focus-within":{borderColor:Pe(m,w)(S)},"&[data-disabled]":{backgroundColor:Pe(r,u)(S),color:Pe(i,o)(S),cursor:"not-allowed"}},value:{backgroundColor:Pe(t,p)(S),color:Pe(p,t)(S),button:{color:Pe(p,t)(S)},"&:hover":{backgroundColor:Pe(r,u)(S),cursor:"pointer"}},dropdown:{backgroundColor:Pe(n,d)(S),borderColor:Pe(n,d)(S),boxShadow:C},item:{backgroundColor:Pe(n,d)(S),color:Pe(d,n)(S),padding:6,"&[data-hovered]":{color:Pe(p,t)(S),backgroundColor:Pe(r,u)(S)},"&[data-active]":{backgroundColor:Pe(r,u)(S),"&:hover":{color:Pe(p,t)(S),backgroundColor:Pe(r,u)(S)}},"&[data-selected]":{backgroundColor:Pe(v,w)(S),color:Pe(e,t)(S),fontWeight:600,"&:hover":{backgroundColor:Pe(b,b)(S),color:Pe("white",e)(S)}},"&[data-disabled]":{color:Pe(s,i)(S),cursor:"not-allowed"}},rightSection:{width:32,button:{color:Pe(p,t)(S)}}}),[m,h,v,b,w,t,n,r,o,e,s,i,u,d,p,C,S])},MK=e=>{const{tooltip:t,inputRef:n,label:r,disabled:o,...s}=e,i=kP();return a.jsx(fr,{label:t,placement:"top",hasArrow:!0,children:a.jsx(X1,{label:r?a.jsx(Vn,{isDisabled:o,children:a.jsx(Zn,{children:r})}):void 0,disabled:o,ref:n,styles:i,...s})})},Ys=f.memo(MK),DK=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:u,base800:d,base900:p,accent200:m,accent300:h,accent400:v,accent500:b,accent600:w}=Z1(),{colorMode:S}=Qr(),[C]=uc("shadows",["dark-lg"]);return f.useCallback(()=>({label:{color:Pe(u,r)(S)},separatorLabel:{color:Pe(s,s)(S),"::after":{borderTopColor:Pe(r,u)(S)}},searchInput:{":placeholder":{color:Pe(r,u)(S)}},input:{backgroundColor:Pe(e,p)(S),borderWidth:"2px",borderColor:Pe(n,d)(S),color:Pe(p,t)(S),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Pe(r,i)(S)},"&:focus":{borderColor:Pe(h,w)(S)},"&:is(:focus, :hover)":{borderColor:Pe(o,s)(S)},"&:focus-within":{borderColor:Pe(m,w)(S)},"&[data-disabled]":{backgroundColor:Pe(r,u)(S),color:Pe(i,o)(S),cursor:"not-allowed"}},value:{backgroundColor:Pe(n,d)(S),color:Pe(p,t)(S),button:{color:Pe(p,t)(S)},"&:hover":{backgroundColor:Pe(r,u)(S),cursor:"pointer"}},dropdown:{backgroundColor:Pe(n,d)(S),borderColor:Pe(n,d)(S),boxShadow:C},item:{backgroundColor:Pe(n,d)(S),color:Pe(d,n)(S),padding:6,"&[data-hovered]":{color:Pe(p,t)(S),backgroundColor:Pe(r,u)(S)},"&[data-active]":{backgroundColor:Pe(r,u)(S),"&:hover":{color:Pe(p,t)(S),backgroundColor:Pe(r,u)(S)}},"&[data-selected]":{backgroundColor:Pe(v,w)(S),color:Pe(e,t)(S),fontWeight:600,"&:hover":{backgroundColor:Pe(b,b)(S),color:Pe("white",e)(S)}},"&[data-disabled]":{color:Pe(s,i)(S),cursor:"not-allowed"}},rightSection:{width:24,padding:20,button:{color:Pe(p,t)(S)}}}),[m,h,v,b,w,t,n,r,o,e,s,i,u,d,p,C,S])},TK=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,label:o,disabled:s,...i}=e,u=ne(),d=f.useCallback(h=>{h.shiftKey&&u(Zo(!0))},[u]),p=f.useCallback(h=>{h.shiftKey||u(Zo(!1))},[u]),m=DK();return a.jsx(fr,{label:n,placement:"top",hasArrow:!0,isOpen:!0,children:a.jsx(bP,{label:o?a.jsx(Vn,{isDisabled:s,children:a.jsx(Zn,{children:o})}):void 0,ref:r,disabled:s,onKeyDown:d,onKeyUp:p,searchable:t,maxDropdownHeight:300,styles:m,...i})})},AK=f.memo(TK),NK=Xs(e3,e=>({value:e,label:t3[e]})).sort((e,t)=>e.label.localeCompare(t.label));function $K(){const e=ne(),{t}=pe(),n=L(o=>o.ui.favoriteSchedulers),r=f.useCallback(o=>{e(R8(o))},[e]);return a.jsx(AK,{label:t("settings.favoriteSchedulers"),value:n,data:NK,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const zK=we([yo,Xr],(e,t)=>{const{shouldConfirmOnDelete:n,shouldDisplayGuides:r,enableImageDebugging:o,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:u}=e,{shouldUseCanvasBetaLayout:d,shouldUseSliders:p,shouldShowProgressInViewer:m,shouldShowAdvancedOptions:h}=t;return{shouldConfirmOnDelete:n,shouldDisplayGuides:r,enableImageDebugging:o,shouldUseCanvasBetaLayout:d,shouldUseSliders:p,shouldShowProgressInViewer:m,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:u,shouldShowAdvancedOptions:h}},{memoizeOptions:{resultEqualityCheck:Yt}}),LK=({children:e,config:t})=>{const n=ne(),{t:r}=pe(),o=(t==null?void 0:t.shouldShowBetaLayout)??!0,s=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,i=(t==null?void 0:t.shouldShowResetWebUiText)??!0,u=(t==null?void 0:t.shouldShowAdvancedOptionsSettings)??!0;f.useEffect(()=>{s||n(xx(!1))},[s,n]);const{isOpen:d,onOpen:p,onClose:m}=va(),{isOpen:h,onOpen:v,onClose:b}=va(),{shouldConfirmOnDelete:w,shouldDisplayGuides:S,enableImageDebugging:C,shouldUseCanvasBetaLayout:_,shouldUseSliders:k,shouldShowProgressInViewer:P,consoleLogLevel:E,shouldLogToConsole:I,shouldAntialiasProgressImage:R,shouldShowAdvancedOptions:O}=L(zK),D=f.useCallback(()=>{Object.keys(window.localStorage).forEach(B=>{(M8.includes(B)||B.startsWith(D8))&&localStorage.removeItem(B)}),m(),v()},[m,v]),T=f.useCallback(B=>{n(T8(B))},[n]),$=f.useCallback(B=>{n(xx(B.target.checked))},[n]);return a.jsxs(a.Fragment,{children:[f.cloneElement(e,{onClick:p}),a.jsxs(mu,{isOpen:d,onClose:m,size:"xl",isCentered:!0,children:[a.jsx(Sa,{}),a.jsxs(gu,{children:[a.jsx(xa,{children:r("common.settingsLabel")}),a.jsx(Jv,{}),a.jsx(wa,{children:a.jsxs(G,{sx:{gap:4,flexDirection:"column"},children:[a.jsxs(Uc,{children:[a.jsx(ca,{size:"sm",children:r("settings.general")}),a.jsx(Pn,{label:r("settings.confirmOnDelete"),isChecked:w,onChange:B=>n(Z4(B.target.checked))}),u&&a.jsx(Pn,{label:r("settings.showAdvancedOptions"),isChecked:O,onChange:B=>n(A8(B.target.checked))})]}),a.jsxs(Uc,{children:[a.jsx(ca,{size:"sm",children:r("settings.generation")}),a.jsx($K,{})]}),a.jsxs(Uc,{children:[a.jsx(ca,{size:"sm",children:r("settings.ui")}),a.jsx(Pn,{label:r("settings.displayHelpIcons"),isChecked:S,onChange:B=>n(N8(B.target.checked))}),o&&a.jsx(Pn,{label:r("settings.useCanvasBeta"),isChecked:_,onChange:B=>n($8(B.target.checked))}),a.jsx(Pn,{label:r("settings.useSlidersForAll"),isChecked:k,onChange:B=>n(z8(B.target.checked))}),a.jsx(Pn,{label:r("settings.showProgressInViewer"),isChecked:P,onChange:B=>n(n3(B.target.checked))}),a.jsx(Pn,{label:r("settings.antialiasProgressImages"),isChecked:R,onChange:B=>n(L8(B.target.checked))})]}),s&&a.jsxs(Uc,{children:[a.jsx(ca,{size:"sm",children:r("settings.developer")}),a.jsx(Pn,{label:r("settings.shouldLogToConsole"),isChecked:I,onChange:$}),a.jsx(Ys,{disabled:!I,label:r("settings.consoleLogLevel"),onChange:T,value:E,data:F8.concat()}),a.jsx(Pn,{label:r("settings.enableImageDebugging"),isChecked:C,onChange:B=>n(B8(B.target.checked))})]}),a.jsxs(Uc,{children:[a.jsx(ca,{size:"sm",children:r("settings.resetWebUI")}),a.jsx(Ut,{colorScheme:"error",onClick:D,children:r("settings.resetWebUI")}),i&&a.jsxs(a.Fragment,{children:[a.jsx(tt,{children:r("settings.resetWebUIDesc1")}),a.jsx(tt,{children:r("settings.resetWebUIDesc2")})]})]})]})}),a.jsx(ba,{children:a.jsx(Ut,{onClick:m,children:r("common.close")})})]})]}),a.jsxs(mu,{closeOnOverlayClick:!1,isOpen:h,onClose:b,isCentered:!0,children:[a.jsx(Sa,{backdropFilter:"blur(40px)"}),a.jsxs(gu,{children:[a.jsx(xa,{}),a.jsx(wa,{children:a.jsx(G,{justifyContent:"center",children:a.jsx(tt,{fontSize:"lg",children:a.jsx(tt,{children:r("settings.resetComplete")})})})}),a.jsx(ba,{})]})]})]})},Uc=e=>a.jsx(G,{layerStyle:"second",sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base"},children:e.children}),FK=()=>{const{t:e}=pe(),t=sr("localization").isFeatureEnabled,n=sr("bugLink").isFeatureEnabled,r=sr("discordLink").isFeatureEnabled,o=sr("githubLink").isFeatureEnabled;return a.jsxs(G,{sx:{gap:2,alignItems:"center"},children:[a.jsx(rk,{}),a.jsx(li,{}),a.jsx(oB,{}),a.jsx(pB,{children:a.jsx(Ae,{"aria-label":e("common.hotkeysLabel"),tooltip:e("common.hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:a.jsx(D$,{})})}),t&&a.jsx(mB,{}),n&&a.jsx(Di,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",marginBottom:"-0.25rem",children:a.jsx(Ae,{"aria-label":e("common.reportBugLabel"),tooltip:e("common.reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:a.jsx(y$,{})})}),o&&a.jsx(Di,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",marginBottom:"-0.25rem",children:a.jsx(Ae,{"aria-label":e("common.githubLabel"),tooltip:e("common.githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:a.jsx(u$,{})})}),r&&a.jsx(Di,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",marginBottom:"-0.25rem",children:a.jsx(Ae,{"aria-label":e("common.discordLabel"),tooltip:e("common.discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:a.jsx(c$,{})})}),a.jsx(dB,{}),a.jsx(LK,{children:a.jsx(Ae,{"aria-label":e("common.settingsLabel"),tooltip:e("common.settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:a.jsx(aB,{})})})]})},BK=f.memo(FK),HK=we(yo,e=>{const{isUploading:t}=e;let n="";return t&&(n="Uploading..."),{tooltip:n,shouldShow:t}}),VK=()=>{const{shouldShow:e,tooltip:t}=L(HK);return e?a.jsx(G,{sx:{alignItems:"center",justifyContent:"center",color:"base.600"},children:a.jsx(fr,{label:t,placement:"right",hasArrow:!0,children:a.jsx(fc,{})})}):null},WK=f.memo(VK),rl=e=>e.config,{createElement:ec,createContext:UK,forwardRef:jP,useCallback:Ua,useContext:PP,useEffect:ga,useImperativeHandle:IP,useLayoutEffect:GK,useMemo:qK,useRef:Go,useState:uu}=Iv,kC=Iv["useId".toString()],KK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Yp=KK?GK:()=>{},YK=typeof kC=="function"?kC:()=>null;let QK=0;function J1(e=null){const t=YK(),n=Go(e||t||null);return n.current===null&&(n.current=""+QK++),n.current}const Uh=UK(null);Uh.displayName="PanelGroupContext";function EP({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:i=null,maxSize:u=100,minSize:d=10,onCollapse:p=null,onResize:m=null,order:h=null,style:v={},tagName:b="div"}){const w=PP(Uh);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const S=J1(i),{collapsePanel:C,expandPanel:_,getPanelStyle:k,registerPanel:P,resizePanel:E,unregisterPanel:I}=w,R=Go({onCollapse:p,onResize:m});if(ga(()=>{R.current.onCollapse=p,R.current.onResize=m}),d<0||d>100)throw Error(`Panel minSize must be between 0 and 100, but was ${d}`);if(u<0||u>100)throw Error(`Panel maxSize must be between 0 and 100, but was ${u}`);if(o!==null){if(o<0||o>100)throw Error(`Panel defaultSize must be between 0 and 100, but was ${o}`);d>o&&!r&&(console.error(`Panel minSize ${d} cannot be greater than defaultSize ${o}`),o=d)}const O=k(S,o),D=Go({size:jC(O)}),T=Go({callbacksRef:R,collapsedSize:n,collapsible:r,defaultSize:o,id:S,maxSize:u,minSize:d,order:h});return Yp(()=>{D.current.size=jC(O),T.current.callbacksRef=R,T.current.collapsedSize=n,T.current.collapsible=r,T.current.defaultSize=o,T.current.id=S,T.current.maxSize=u,T.current.minSize=d,T.current.order=h}),Yp(()=>(P(S,T),()=>{I(S)}),[h,S,P,I]),IP(s,()=>({collapse:()=>C(S),expand:()=>_(S),getCollapsed(){return D.current.size===0},getSize(){return D.current.size},resize:$=>E(S,$)}),[C,_,S,E]),ec(b,{children:e,className:t,"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-id":S,"data-panel-size":parseFloat(""+O.flexGrow).toFixed(1),id:`data-panel-id-${S}`,style:{...O,...v}})}const wu=jP((e,t)=>ec(EP,{...e,forwardedRef:t}));EP.displayName="Panel";wu.displayName="forwardRef(Panel)";function jC(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const Qi=10;function Zc(e,t,n,r,o,s,i,u){const{sizes:d}=u||{},p=d||s;if(o===0)return p;const m=Wo(t),h=p.concat();let v=0;{const S=o<0?r:n,C=m.findIndex(E=>E.current.id===S),_=m[C],k=p[C],P=PC(_,Math.abs(o),k,e);if(k===P)return p;P===0&&k>0&&i.set(S,k),o=o<0?k-P:P-k}let b=o<0?n:r,w=m.findIndex(S=>S.current.id===b);for(;;){const S=m[w],C=p[w],_=Math.abs(o)-Math.abs(v),k=PC(S,0-_,C,e);if(C!==k&&(k===0&&C>0&&i.set(S.current.id,C),v+=C-k,h[w]=k,v.toPrecision(Qi).localeCompare(Math.abs(o).toPrecision(Qi),void 0,{numeric:!0})>=0))break;if(o<0){if(--w<0)break}else if(++w>=m.length)break}return v===0?p:(b=o<0?r:n,w=m.findIndex(S=>S.current.id===b),h[w]=p[w]+v,h)}function Pl(e,t,n){t.forEach((r,o)=>{const{callbacksRef:s,collapsedSize:i,collapsible:u,id:d}=e[o].current,p=n[d];if(p!==r){n[d]=r;const{onCollapse:m,onResize:h}=s.current;h&&h(r,p),u&&m&&((p==null||p===i)&&r!==i?m(!1):p!==i&&r===i&&m(!0))}})}function qg(e,t){if(t.length<2)return[null,null];const n=t.findIndex(i=>i.current.id===e);if(n<0)return[null,null];const r=n===t.length-1,o=r?t[n-1].current.id:e,s=r?e:t[n+1].current.id;return[o,s]}function OP(e,t,n){if(e.size===1)return"100";const o=Wo(e).findIndex(i=>i.current.id===t),s=n[o];return s==null?"0":s.toPrecision(Qi)}function XK(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function ey(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function Gh(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function ZK(e){return RP().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function RP(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function MP(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function ty(e,t,n){var d,p,m,h;const r=Gh(t),o=MP(e),s=r?o.indexOf(r):-1,i=((p=(d=n[s])==null?void 0:d.current)==null?void 0:p.id)??null,u=((h=(m=n[s+1])==null?void 0:m.current)==null?void 0:h.id)??null;return[i,u]}function Wo(e){return Array.from(e.values()).sort((t,n)=>{const r=t.current.order,o=n.current.order;return r==null&&o==null?0:r==null?-1:o==null?1:r-o})}function PC(e,t,n,r){var m;const o=n+t,{collapsedSize:s,collapsible:i,maxSize:u,minSize:d}=e.current;if(i){if(n>s){if(o<=d/2+s)return s}else if(!((m=r==null?void 0:r.type)==null?void 0:m.startsWith("key"))&&o<d)return s}return Math.min(u,Math.max(d,o))}function DP(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function JK({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){ga(()=>{const{direction:i,panels:u}=e.current,d=ey(t),{height:p,width:m}=d.getBoundingClientRect(),v=MP(t).map(b=>{const w=b.getAttribute("data-panel-resize-handle-id"),S=Wo(u),[C,_]=ty(t,w,S);if(C==null||_==null)return()=>{};let k=0,P=100,E=0,I=0;S.forEach(B=>{B.current.id===C?(P=B.current.maxSize,k=B.current.minSize):(E+=B.current.minSize,I+=B.current.maxSize)});const R=Math.min(P,100-E),O=Math.max(k,(S.length-1)*100-I),D=OP(u,C,o);b.setAttribute("aria-valuemax",""+Math.round(R)),b.setAttribute("aria-valuemin",""+Math.round(O)),b.setAttribute("aria-valuenow",""+Math.round(parseInt(D)));const T=B=>{if(!B.defaultPrevented)switch(B.key){case"Enter":{B.preventDefault();const ee=S.findIndex(F=>F.current.id===C);if(ee>=0){const F=S[ee],N=o[ee];if(N!=null){let H=0;N.toPrecision(Qi)<=F.current.minSize.toPrecision(Qi)?H=i==="horizontal"?m:p:H=-(i==="horizontal"?m:p);const K=Zc(B,u,C,_,H,o,s.current,null);o!==K&&r(K)}}break}}};b.addEventListener("keydown",T);const $=XK(C);return $!=null&&b.setAttribute("aria-controls",$.id),()=>{b.removeAttribute("aria-valuemax"),b.removeAttribute("aria-valuemin"),b.removeAttribute("aria-valuenow"),b.removeEventListener("keydown",T),$!=null&&b.removeAttribute("aria-controls")}});return()=>{v.forEach(b=>b())}},[e,t,n,s,r,o])}function eY({disabled:e,handleId:t,resizeHandler:n}){ga(()=>{if(e||n==null)return;const r=Gh(t);if(r==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const i=RP(),u=ZK(t);DP(u!==null);const d=s.shiftKey?u>0?u-1:i.length-1:u+1<i.length?u+1:0;i[d].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function tY(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function TP(e,t,n,r=0,o=null){const s=n==="horizontal";let i=0;if(J0(e))i=s?e.clientX:e.clientY;else if(ev(e)){const m=e.touches[0];i=s?m.screenX:m.screenY}else return 0;const u=Gh(t),d=o||u.getBoundingClientRect(),p=s?d.left:d.top;return i-p-r}function nY(e,t,n,r,o,s,i){const{dragOffset:u=0,dragHandleRect:d,sizes:p}=i||{},m=p||s;if(rY(e)){const h=o==="horizontal",b=ey(t).getBoundingClientRect(),w=h?b.width:b.height,S=e.shiftKey?10:100,C=w/S;let _=0;switch(e.key){case"ArrowDown":_=h?0:C;break;case"ArrowLeft":_=h?-C:0;break;case"ArrowRight":_=h?C:0;break;case"ArrowUp":_=h?0:-C;break;case"End":_=w;break;case"Home":_=-w;break}const[k,P]=ty(t,n,r),E=_<0?k:P,I=r.findIndex(O=>O.current.id===E),R=r[I];if(R.current.collapsible){const O=m[I];(O===0||O.toPrecision(Qi)===R.current.minSize.toPrecision(Qi))&&(_=_<0?-R.current.minSize*w:R.current.minSize*w)}return _}else return TP(e,n,o,u,d)}function rY(e){return e.type==="keydown"}function J0(e){return e.type.startsWith("mouse")}function ev(e){return e.type.startsWith("touch")}let tv=null,Oi=null;function AP(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function oY(){Oi!==null&&(document.head.removeChild(Oi),tv=null,Oi=null)}function Kg(e){if(tv===e)return;tv=e;const t=AP(e);Oi===null&&(Oi=document.createElement("style"),document.head.appendChild(Oi)),Oi.innerHTML=`*{cursor: ${t}!important;}`}function sY(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function NP(e){return e.map(t=>{const{minSize:n,order:r}=t.current;return r?`${r}:${n}`:`${n}`}).sort((t,n)=>t.localeCompare(n)).join(",")}function $P(e,t){try{const n=t.getItem(`PanelGroup:sizes:${e}`);if(n){const r=JSON.parse(n);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function aY(e,t,n){const r=$P(e,n);if(r){const o=NP(t);return r[o]??null}return null}function iY(e,t,n,r){const o=NP(t),s=$P(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(i){console.error(i)}}const Yg={};function IC(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}const Jc={getItem:e=>(IC(Jc),Jc.getItem(e)),setItem:(e,t)=>{IC(Jc),Jc.setItem(e,t)}};function zP({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:i=null,onLayout:u,storage:d=Jc,style:p={},tagName:m="div"}){const h=J1(i),[v,b]=uu(null),[w,S]=uu(new Map),C=Go(null),_=Go({onLayout:u});ga(()=>{_.current.onLayout=u});const k=Go({}),[P,E]=uu([]),I=Go(new Map),R=Go(0),O=Go({direction:r,panels:w,sizes:P});IP(s,()=>({getLayout:()=>{const{sizes:A}=O.current;return A},setLayout:A=>{const U=A.reduce((be,ce)=>be+ce,0);DP(U===100,"Panel sizes must add up to 100%");const{panels:V}=O.current,W=k.current,re=Wo(V);E(A),Pl(re,A,W)}}),[]),Yp(()=>{O.current.direction=r,O.current.panels=w,O.current.sizes=P}),JK({committedValuesRef:O,groupId:h,panels:w,setSizes:E,sizes:P,panelSizeBeforeCollapse:I}),ga(()=>{const{onLayout:A}=_.current,{panels:U,sizes:V}=O.current;if(V.length>0){A&&A(V);const W=k.current,re=Wo(U);Pl(re,V,W)}},[P]),Yp(()=>{if(O.current.sizes.length===w.size)return;let U=null;if(e){const V=Wo(w);U=aY(e,V,d)}if(U!=null)E(U);else{const V=Wo(w);let W=0,re=0,be=0;if(V.forEach(ce=>{be+=ce.current.minSize,ce.current.defaultSize===null?W++:re+=ce.current.defaultSize}),re>100)throw new Error("Default panel sizes cannot exceed 100%");if(V.length>1&&W===0&&re!==100)throw new Error("Invalid default sizes specified for panels");if(be>100)throw new Error("Minimum panel sizes cannot exceed 100%");E(V.map(ce=>ce.current.defaultSize===null?(100-re)/W:ce.current.defaultSize))}},[e,w,d]),ga(()=>{if(e){if(P.length===0||P.length!==w.size)return;const A=Wo(w);Yg[e]||(Yg[e]=sY(iY,100)),Yg[e](e,A,P,d)}},[e,w,P,d]);const D=Ua((A,U)=>{const{panels:V}=O.current;return V.size===0?{flexBasis:0,flexGrow:U??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:OP(V,A,P),flexShrink:1,overflow:"hidden",pointerEvents:o&&v!==null?"none":void 0}},[v,o,P]),T=Ua((A,U)=>{S(V=>{if(V.has(A))return V;const W=new Map(V);return W.set(A,U),W})},[]),$=Ua(A=>V=>{V.preventDefault();const{direction:W,panels:re,sizes:be}=O.current,ce=Wo(re),[se,X]=ty(h,A,ce);if(se==null||X==null)return;let ie=nY(V,h,A,ce,W,be,C.current);if(ie===0)return;const xe=ey(h).getBoundingClientRect(),oe=W==="horizontal";document.dir==="rtl"&&oe&&(ie=-ie);const ve=oe?xe.width:xe.height,he=ie/ve*100,je=Zc(V,re,se,X,he,be,I.current,C.current),Ne=!tY(be,je);if((J0(V)||ev(V))&&R.current!=he&&Kg(Ne?oe?"horizontal":"vertical":oe?ie<0?"horizontal-min":"horizontal-max":ie<0?"vertical-min":"vertical-max"),Ne){const ge=k.current;E(je),Pl(ce,je,ge)}R.current=he},[h]),B=Ua(A=>{S(U=>{if(!U.has(A))return U;const V=new Map(U);return V.delete(A),V})},[]),ee=Ua(A=>{const{panels:U,sizes:V}=O.current,W=U.get(A);if(W==null)return;const{collapsedSize:re,collapsible:be}=W.current;if(!be)return;const ce=Wo(U),se=ce.indexOf(W);if(se<0)return;const X=V[se];if(X===re)return;I.current.set(A,X);const[ie,de]=qg(A,ce);if(ie==null||de==null)return;const oe=se===ce.length-1?X:re-X,ve=Zc(null,U,ie,de,oe,V,I.current,null);if(V!==ve){const he=k.current;E(ve),Pl(ce,ve,he)}},[]),F=Ua(A=>{const{panels:U,sizes:V}=O.current,W=U.get(A);if(W==null)return;const{collapsedSize:re,minSize:be}=W.current,ce=I.current.get(A)||be;if(!ce)return;const se=Wo(U),X=se.indexOf(W);if(X<0||V[X]!==re)return;const[de,xe]=qg(A,se);if(de==null||xe==null)return;const ve=X===se.length-1?re-ce:ce,he=Zc(null,U,de,xe,ve,V,I.current,null);if(V!==he){const je=k.current;E(he),Pl(se,he,je)}},[]),N=Ua((A,U)=>{const{panels:V,sizes:W}=O.current,re=V.get(A);if(re==null)return;const{collapsedSize:be,collapsible:ce,maxSize:se,minSize:X}=re.current,ie=Wo(V),de=ie.indexOf(re);if(de<0)return;const xe=W[de];if(xe===U)return;ce&&U===be||(U=Math.min(se,Math.max(X,U)));const[oe,ve]=qg(A,ie);if(oe==null||ve==null)return;const je=de===ie.length-1?xe-U:U-xe,Ne=Zc(null,V,oe,ve,je,W,I.current,null);if(W!==Ne){const ge=k.current;E(Ne),Pl(ie,Ne,ge)}},[]),H=qK(()=>({activeHandleId:v,collapsePanel:ee,direction:r,expandPanel:F,getPanelStyle:D,groupId:h,registerPanel:T,registerResizeHandle:$,resizePanel:N,startDragging:(A,U)=>{if(b(A),J0(U)||ev(U)){const V=Gh(A);C.current={dragHandleRect:V.getBoundingClientRect(),dragOffset:TP(U,A,r),sizes:O.current.sizes}}},stopDragging:()=>{oY(),b(null),C.current=null},unregisterPanel:B}),[v,ee,r,F,D,h,T,$,N,B]),K={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return ec(Uh.Provider,{children:ec(m,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h,style:{...K,...p}}),value:H})}const ny=jP((e,t)=>ec(zP,{...e,forwardedRef:t}));zP.displayName="PanelGroup";ny.displayName="forwardRef(PanelGroup)";function nv({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:i="div"}){const u=Go(null),d=Go({onDragging:o});ga(()=>{d.current.onDragging=o});const p=PP(Uh);if(p===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:m,direction:h,groupId:v,registerResizeHandle:b,startDragging:w,stopDragging:S}=p,C=J1(r),_=m===C,[k,P]=uu(!1),[E,I]=uu(null),R=Ua(()=>{u.current.blur(),S();const{onDragging:T}=d.current;T&&T(!1)},[S]);ga(()=>{if(n)I(null);else{const D=b(C);I(()=>D)}},[n,C,b]),ga(()=>{if(n||E==null||!_)return;const D=ee=>{E(ee)},T=ee=>{E(ee)},B=u.current.ownerDocument;return B.body.addEventListener("contextmenu",R),B.body.addEventListener("mousemove",D),B.body.addEventListener("touchmove",D),B.body.addEventListener("mouseleave",T),window.addEventListener("mouseup",R),window.addEventListener("touchend",R),()=>{B.body.removeEventListener("contextmenu",R),B.body.removeEventListener("mousemove",D),B.body.removeEventListener("touchmove",D),B.body.removeEventListener("mouseleave",T),window.removeEventListener("mouseup",R),window.removeEventListener("touchend",R)}},[h,n,_,E,R]),eY({disabled:n,handleId:C,resizeHandler:E});const O={cursor:AP(h),touchAction:"none",userSelect:"none"};return ec(i,{children:e,className:t,"data-resize-handle-active":_?"pointer":k?"keyboard":void 0,"data-panel-group-direction":h,"data-panel-group-id":v,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":C,onBlur:()=>P(!1),onFocus:()=>P(!0),onMouseDown:D=>{w(C,D.nativeEvent);const{onDragging:T}=d.current;T&&T(!0)},onMouseUp:R,onTouchCancel:R,onTouchEnd:R,onTouchStart:D=>{w(C,D.nativeEvent);const{onDragging:T}=d.current;T&&T(!0)},ref:u,role:"separator",style:{...O,...s},tabIndex:0})}nv.displayName="PanelResizeHandle";const lY=(e,t,n,r="horizontal")=>{const o=f.useRef(null),[s,i]=f.useState(t),u=f.useCallback(()=>{var p,m;const d=(p=o.current)==null?void 0:p.getSize();d!==void 0&&d<s&&((m=o.current)==null||m.resize(s))},[s]);return f.useLayoutEffect(()=>{const d=document.querySelector(`[data-panel-group-id="${n}"]`),p=document.querySelectorAll("[data-panel-resize-handle-id]");if(!d)return;const m=new ResizeObserver(()=>{let h=r==="horizontal"?d.getBoundingClientRect().width:d.getBoundingClientRect().height;p.forEach(v=>{h-=r==="horizontal"?v.getBoundingClientRect().width:v.getBoundingClientRect().height}),i(e/h*100)});return m.observe(d),p.forEach(h=>{m.observe(h)}),window.addEventListener("resize",u),()=>{m.disconnect(),window.removeEventListener("resize",u)}},[n,u,s,e,r]),{ref:o,minSizePct:s}},cY=we([Tt],e=>{const{initialImage:t}=e.generation;return{initialImage:t,isResetButtonDisabled:!t}},ut),uY=()=>{const{initialImage:e}=L(cY),{currentData:t,isLoading:n,isError:r,isSuccess:o}=Cs((e==null?void 0:e.imageName)??Yo.skipToken),s=f.useMemo(()=>{if(t)return{id:"initial-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t]),i=f.useMemo(()=>({id:"initial-image",actionType:"SET_INITIAL_IMAGE"}),[]);return a.jsx(si,{imageDTO:t,droppableData:i,draggableData:s,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Initial Image",noContentFallback:a.jsx(Zi,{label:"No initial image selected"})})},dY=we([Tt],e=>{const{initialImage:t}=e.generation;return{isResetButtonDisabled:!t}},ut),fY={type:"SET_INITIAL_IMAGE"},pY=()=>{const{isResetButtonDisabled:e}=L(dY),t=ne(),{openUploader:n}=kh(),{getUploadButtonProps:r,getUploadInputProps:o}=Q_({postUploadAction:fY}),s=f.useCallback(()=>{t(H8())},[t]),i=f.useCallback(()=>{n()},[n]);return a.jsxs(G,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",p:4,gap:4},children:[a.jsxs(G,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(tt,{sx:{fontWeight:600,userSelect:"none",color:"base.700",_dark:{color:"base.200"}},children:"Initial Image"}),a.jsx(li,{}),a.jsx(Ae,{tooltip:"Upload Initial Image","aria-label":"Upload Initial Image",icon:a.jsx(Hu,{}),onClick:i,...r()}),a.jsx(Ae,{tooltip:"Reset Initial Image","aria-label":"Reset Initial Image",icon:a.jsx(f1,{}),onClick:s,isDisabled:e})]}),a.jsx(uY,{}),a.jsx("input",{...o()})]})},ry="28rem",LP=e=>{const{sx:t}=e,n=ne(),r=L(i=>i.ui.shouldPinParametersPanel),{t:o}=pe(),s=()=>{n(V8(!r)),n(js())};return a.jsx(Ae,{...e,tooltip:o("common.pinOptionsPanel"),"aria-label":o("common.pinOptionsPanel"),onClick:s,icon:r?a.jsx(G5,{}):a.jsx(q5,{}),variant:"ghost",size:"sm",sx:{color:"base.500",_hover:{color:"base.600"},_active:{color:"base.700"},_dark:{color:"base.500",_hover:{color:"base.400"},_active:{color:"base.300"}},...t}})},hY=we(Xr,e=>{const{shouldPinParametersPanel:t,shouldShowParametersPanel:n}=e;return{shouldPinParametersPanel:t,shouldShowParametersPanel:n}}),mY=e=>{const{shouldPinParametersPanel:t,shouldShowParametersPanel:n}=L(hY);return t&&n?a.jsxs(Be,{sx:{position:"relative",h:"full",w:ry,flexShrink:0},children:[a.jsx(G,{sx:{gap:2,flexDirection:"column",h:"full",w:"full",position:"absolute",overflowY:"auto"},children:e.children}),a.jsx(LP,{sx:{position:"absolute",top:0,insetInlineEnd:0}})]}):null},oy=f.memo(mY),gY=e=>{const{direction:t="horizontal",...n}=e,{colorMode:r}=Qr();return t==="horizontal"?a.jsx(nv,{children:a.jsx(G,{sx:{w:6,h:"full",justifyContent:"center",alignItems:"center"},...n,children:a.jsx(Be,{sx:{w:.5,h:"calc(100% - 4px)",bg:Pe("base.100","base.850")(r)}})})}):a.jsx(nv,{children:a.jsx(G,{sx:{w:"full",h:6,justifyContent:"center",alignItems:"center"},...n,children:a.jsx(Be,{sx:{w:"calc(100% - 4px)",h:.5,bg:Pe("base.100","base.850")(r)}})})})},FP=f.memo(gY),vY=we([Tt],({system:e})=>{const{isProcessing:t,isConnected:n}=e;return n&&!t}),yY=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=pe(),o=L(vY);return a.jsx(Ae,{onClick:t,icon:a.jsx(mo,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})},bY=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,onChange:o,label:s,disabled:i,...u}=e,d=ne(),[p,m]=f.useState(""),h=f.useCallback(S=>{S.shiftKey&&d(Zo(!0))},[d]),v=f.useCallback(S=>{S.shiftKey||d(Zo(!1))},[d]),b=f.useCallback(S=>{m(""),o&&o(S)},[o]),w=kP();return a.jsx(fr,{label:n,placement:"top",hasArrow:!0,children:a.jsx(X1,{ref:r,label:s?a.jsx(Vn,{isDisabled:i,children:a.jsx(Zn,{children:s})}):void 0,disabled:i,searchValue:p,onSearchChange:m,onChange:b,onKeyDown:h,onKeyUp:v,searchable:t,maxDropdownHeight:300,styles:w,...u})})},gr=f.memo(bY);function xY(){const e=L(o=>o.postprocessing.facetoolType),t=ne(),{t:n}=pe(),r=o=>t(U8(o));return a.jsx(gr,{label:n("parameters.type"),data:W8.concat(),value:e,onChange:r})}function SY(){const e=L(o=>o.system.isGFPGANAvailable),t=L(o=>o.postprocessing.facetoolStrength),{t:n}=pe(),r=ne();return a.jsx(yt,{isDisabled:!e,label:n("parameters.strength"),step:.05,min:0,max:1,onChange:o=>r(Sx(o)),handleReset:()=>r(Sx(.75)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}function wY(){const e=L(o=>o.system.isGFPGANAvailable),t=L(o=>o.postprocessing.codeformerFidelity),{t:n}=pe(),r=ne();return a.jsx(yt,{isDisabled:!e,label:n("parameters.codeformerFidelity"),step:.05,min:0,max:1,onChange:o=>r(wx(o)),handleReset:()=>r(wx(1)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}const CY=()=>{const e=L(t=>t.postprocessing.facetoolType);return a.jsxs(_r,{gap:2,alignItems:"stretch",children:[a.jsx(xY,{}),a.jsx(SY,{}),e==="codeformer"&&a.jsx(wY,{})]})};function _Y(){const e=L(o=>o.system.isESRGANAvailable),t=L(o=>o.postprocessing.upscalingDenoising),{t:n}=pe(),r=ne();return a.jsx(yt,{label:n("parameters.denoisingStrength"),value:t,min:0,max:1,step:.01,onChange:o=>{r(Cx(o))},handleReset:()=>r(Cx(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isDisabled:!e})}function kY(){const e=L(o=>o.system.isESRGANAvailable),t=L(o=>o.postprocessing.upscalingStrength),{t:n}=pe(),r=ne();return a.jsx(yt,{label:`${n("parameters.upscale")} ${n("parameters.strength")}`,value:t,min:0,max:1,step:.05,onChange:o=>r(_x(o)),handleReset:()=>r(_x(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isDisabled:!e})}function jY(){const e=L(s=>s.system.isESRGANAvailable),t=L(s=>s.postprocessing.upscalingLevel),{t:n}=pe(),r=ne(),o=s=>r(q8(Number(s)));return a.jsx(gr,{disabled:!e,label:n("parameters.scale"),value:String(t),onChange:o,data:G8})}const PY=()=>a.jsxs(_r,{gap:2,alignItems:"stretch",children:[a.jsx(jY,{}),a.jsx(_Y,{}),a.jsx(kY,{})]});function IY(e,t,n){var r=this,o=f.useRef(null),s=f.useRef(0),i=f.useRef(null),u=f.useRef([]),d=f.useRef(),p=f.useRef(),m=f.useRef(e),h=f.useRef(!0);f.useEffect(function(){m.current=e},[e]);var v=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var b=!!(n=n||{}).leading,w=!("trailing"in n)||!!n.trailing,S="maxWait"in n,C=S?Math.max(+n.maxWait||0,t):null;f.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var _=f.useMemo(function(){var k=function(D){var T=u.current,$=d.current;return u.current=d.current=null,s.current=D,p.current=m.current.apply($,T)},P=function(D,T){v&&cancelAnimationFrame(i.current),i.current=v?requestAnimationFrame(D):setTimeout(D,T)},E=function(D){if(!h.current)return!1;var T=D-o.current;return!o.current||T>=t||T<0||S&&D-s.current>=C},I=function(D){return i.current=null,w&&u.current?k(D):(u.current=d.current=null,p.current)},R=function D(){var T=Date.now();if(E(T))return I(T);if(h.current){var $=t-(T-o.current),B=S?Math.min($,C-(T-s.current)):$;P(D,B)}},O=function(){var D=Date.now(),T=E(D);if(u.current=[].slice.call(arguments),d.current=r,o.current=D,T){if(!i.current&&h.current)return s.current=o.current,P(R,t),b?k(o.current):p.current;if(S)return P(R,t),k(o.current)}return i.current||P(R,t),p.current};return O.cancel=function(){i.current&&(v?cancelAnimationFrame(i.current):clearTimeout(i.current)),s.current=0,u.current=o.current=d.current=i.current=null},O.isPending=function(){return!!i.current},O.flush=function(){return i.current?I(Date.now()):p.current},O},[b,S,t,C,w,v]);return _}function EY(e,t){return e===t}function EC(e){return typeof e=="function"?function(){return e}:e}function BP(e,t,n){var r,o,s=n&&n.equalityFn||EY,i=(r=f.useState(EC(e)),o=r[1],[r[0],f.useCallback(function(h){return o(EC(h))},[])]),u=i[0],d=i[1],p=IY(f.useCallback(function(h){return d(h)},[d]),t,n),m=f.useRef(e);return s(m.current,e)||(p(e),m.current=e),[u,p]}const OY=we([Tt,yr],({gallery:e,system:t,postprocessing:n,ui:r},o)=>{const{isProcessing:s,isConnected:i,isGFPGANAvailable:u,isESRGANAvailable:d,shouldConfirmOnDelete:p,progressImage:m}=t,{upscalingLevel:h,facetoolStrength:v}=n,{shouldShowImageDetails:b,shouldHidePreview:w,shouldShowProgressInViewer:S}=r,C=e.selection[e.selection.length-1];return{canDeleteImage:i&&!s,shouldConfirmOnDelete:p,isProcessing:s,isConnected:i,isGFPGANAvailable:u,isESRGANAvailable:d,upscalingLevel:h,facetoolStrength:v,shouldDisableToolbarButtons:!!m||!C,shouldShowImageDetails:b,activeTabName:o,shouldHidePreview:w,shouldShowProgressInViewer:S,lastSelectedImage:C}},{memoizeOptions:{resultEqualityCheck:Yt}}),RY=e=>{const t=ne(),{isProcessing:n,isConnected:r,isGFPGANAvailable:o,isESRGANAvailable:s,upscalingLevel:i,facetoolStrength:u,shouldDisableToolbarButtons:d,shouldShowImageDetails:p,activeTabName:m,lastSelectedImage:h,shouldShowProgressInViewer:v}=L(OY),b=sr("unifiedCanvas").isFeatureEnabled,w=sr("upscaling").isFeatureEnabled,S=sr("faceRestore").isFeatureEnabled,C=Iu(),{t:_}=pe(),{recallBothPrompts:k,recallSeed:P,recallAllParameters:E}=N1(),[I,R]=BP(h,500),{currentData:O,isFetching:D}=Cs(h??Yo.skipToken),{currentData:T}=jv(R.isPending()?Yo.skipToken:I??Yo.skipToken),$=T==null?void 0:T.metadata,B=f.useCallback(()=>{const ce=(()=>{if(O)return O.image_url.startsWith("http")?O.image_url:window.location.toString()+O.image_url})();if(!ce){C({title:_("toast.problemCopyingImageLink"),status:"error",duration:2500,isClosable:!0});return}navigator.clipboard.writeText(ce).then(()=>{C({title:_("toast.imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})},[C,_,O]),ee=f.useCallback(()=>{E($)},[$,E]);Ze("a",()=>{},[$,E]);const F=f.useCallback(()=>{P($==null?void 0:$.seed)},[$==null?void 0:$.seed,P]);Ze("s",F,[O]);const N=f.useCallback(()=>{k($==null?void 0:$.positive_prompt,$==null?void 0:$.negative_prompt)},[$==null?void 0:$.negative_prompt,$==null?void 0:$.positive_prompt,k]);Ze("p",N,[O]);const H=f.useCallback(()=>{t(U4()),t($f(O))},[t,O]);Ze("shift+i",H,[O]);const K=f.useCallback(()=>{},[]),A=f.useCallback(()=>{O&&t(Pv(O))},[t,O]);Ze("Shift+U",()=>{K()},{enabled:()=>!!(w&&s&&!d&&r&&!n&&i)},[w,O,s,d,r,n,i]);const U=f.useCallback(()=>{},[]);Ze("Shift+R",()=>{U()},{enabled:()=>!!(S&&o&&!d&&r&&!n&&u)},[S,O,o,d,r,n,u]);const V=f.useCallback(()=>t(K8(!p)),[t,p]),W=f.useCallback(()=>{O&&(t(G4()),t(q4(O)),t(js()),m!=="unifiedCanvas"&&t(Ii("unifiedCanvas")),C({title:_("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))},[O,t,m,C,_]);Ze("i",()=>{O?V():C({title:_("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[O,p,C]);const re=f.useCallback(()=>{t(n3(!v))},[t,v]);return a.jsx(a.Fragment,{children:a.jsxs(G,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},...e,children:[a.jsx(dr,{isAttached:!0,isDisabled:d,children:a.jsx(da,{triggerComponent:a.jsx(Ae,{"aria-label":`${_("parameters.sendTo")}...`,tooltip:`${_("parameters.sendTo")}...`,isDisabled:!O,icon:a.jsx(V$,{})}),children:a.jsxs(G,{sx:{flexDirection:"column",rowGap:2},children:[a.jsx(Ut,{size:"sm",onClick:H,leftIcon:a.jsx(Zf,{}),id:"send-to-img2img",children:_("parameters.sendToImg2Img")}),b&&a.jsx(Ut,{size:"sm",onClick:W,leftIcon:a.jsx(Zf,{}),id:"send-to-canvas",children:_("parameters.sendToUnifiedCanvas")}),a.jsx(Ut,{size:"sm",onClick:B,leftIcon:a.jsx(gc,{}),children:_("parameters.copyImageToLink")}),a.jsx(Di,{download:!0,href:O==null?void 0:O.image_url,target:"_blank",children:a.jsx(Ut,{leftIcon:a.jsx(c1,{}),size:"sm",w:"100%",children:_("parameters.downloadImage")})})]})})}),a.jsxs(dr,{isAttached:!0,isDisabled:d,children:[a.jsx(Ae,{icon:a.jsx(z$,{}),tooltip:`${_("parameters.usePrompt")} (P)`,"aria-label":`${_("parameters.usePrompt")} (P)`,isDisabled:!($!=null&&$.positive_prompt),onClick:N}),a.jsx(Ae,{icon:a.jsx(B$,{}),tooltip:`${_("parameters.useSeed")} (S)`,"aria-label":`${_("parameters.useSeed")} (S)`,isDisabled:!($!=null&&$.seed),onClick:F}),a.jsx(Ae,{icon:a.jsx(v$,{}),tooltip:`${_("parameters.useAll")} (A)`,"aria-label":`${_("parameters.useAll")} (A)`,isDisabled:!$,onClick:ee})]}),(w||S)&&a.jsxs(dr,{isAttached:!0,isDisabled:d,children:[S&&a.jsx(da,{triggerComponent:a.jsx(Ae,{icon:a.jsx(O$,{}),"aria-label":_("parameters.restoreFaces")}),children:a.jsxs(G,{sx:{flexDirection:"column",rowGap:4},children:[a.jsx(CY,{}),a.jsx(Ut,{isDisabled:!o||!O||!(r&&!n)||!u,onClick:U,children:_("parameters.restoreFaces")})]})}),w&&a.jsx(da,{triggerComponent:a.jsx(Ae,{icon:a.jsx(_$,{}),"aria-label":_("parameters.upscale")}),children:a.jsxs(G,{sx:{flexDirection:"column",gap:4},children:[a.jsx(PY,{}),a.jsx(Ut,{isDisabled:!s||!O||!(r&&!n)||!i,onClick:K,children:_("parameters.upscaleImage")})]})})]}),a.jsx(dr,{isAttached:!0,isDisabled:d,children:a.jsx(Ae,{icon:a.jsx(l1,{}),tooltip:`${_("parameters.info")} (I)`,"aria-label":`${_("parameters.info")} (I)`,isChecked:p,onClick:V})}),a.jsx(dr,{isAttached:!0,children:a.jsx(Ae,{"aria-label":_("settings.displayInProgress"),tooltip:_("settings.displayInProgress"),icon:a.jsx(R$,{}),isChecked:v,onClick:re})}),a.jsx(dr,{isAttached:!0,children:a.jsx(yY,{onClick:A,isDisabled:d})})]})})},MY=we([Tt,K4],(e,t)=>{const{total:n,isFetching:r}=e.gallery,o=e.gallery.selection[e.gallery.selection.length-1];if(!o||t.length===0)return{isOnFirstImage:!0,isOnLastImage:!0};const s=t.findIndex(b=>b.image_name===o),i=qs(s+1,0,t.length-1),u=qs(s-1,0,t.length-1),d=t[i].image_name,p=t[u].image_name,m=kx(e,d),h=kx(e,p),v=t.length;return{isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===v-1,areMoreImagesAvailable:n>v,isFetching:r,nextImage:m,prevImage:h,nextImageId:d,prevImageId:p}},{memoizeOptions:{resultEqualityCheck:Yt}}),HP=()=>{const e=ne(),{isOnFirstImage:t,isOnLastImage:n,nextImageId:r,prevImageId:o,areMoreImagesAvailable:s,isFetching:i}=L(MY),u=f.useCallback(()=>{o&&e(zf(o))},[e,o]),d=f.useCallback(()=>{r&&e(zf(r))},[e,r]),p=f.useCallback(()=>{e(Y4({is_intermediate:!1}))},[e]);return{handlePrevImage:u,handleNextImage:d,isOnFirstImage:t,isOnLastImage:n,nextImageId:r,prevImageId:o,areMoreImagesAvailable:s,handleLoadMoreImages:p,isFetching:i}},ds=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:i}=pe();return t?a.jsxs(G,{gap:2,children:[n&&a.jsx(fr,{label:`Recall ${e}`,children:a.jsx(ti,{"aria-label":i("accessibility.useThisParameter"),icon:a.jsx(Pf,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&a.jsx(fr,{label:`Copy ${e}`,children:a.jsx(ti,{"aria-label":`Copy ${e}`,icon:a.jsx(gc,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),a.jsxs(G,{direction:o?"column":"row",children:[a.jsxs(tt,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?a.jsxs(Di,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",a.jsx(h1,{mx:"2px"})]}):a.jsx(tt,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},DY=e=>{const{metadata:t}=e,{recallBothPrompts:n,recallPositivePrompt:r,recallNegativePrompt:o,recallSeed:s,recallInitialImage:i,recallCfgScale:u,recallModel:d,recallScheduler:p,recallSteps:m,recallWidth:h,recallHeight:v,recallStrength:b,recallAllParameters:w}=N1(),S=f.useCallback(()=>{r(t==null?void 0:t.positive_prompt)},[t==null?void 0:t.positive_prompt,r]),C=f.useCallback(()=>{o(t==null?void 0:t.negative_prompt)},[t==null?void 0:t.negative_prompt,o]),_=f.useCallback(()=>{s(t==null?void 0:t.seed)},[t==null?void 0:t.seed,s]),k=f.useCallback(()=>{d(t==null?void 0:t.model)},[t==null?void 0:t.model,d]),P=f.useCallback(()=>{h(t==null?void 0:t.width)},[t==null?void 0:t.width,h]),E=f.useCallback(()=>{v(t==null?void 0:t.height)},[t==null?void 0:t.height,v]),I=f.useCallback(()=>{p(t==null?void 0:t.scheduler)},[t==null?void 0:t.scheduler,p]),R=f.useCallback(()=>{m(t==null?void 0:t.steps)},[t==null?void 0:t.steps,m]),O=f.useCallback(()=>{u(t==null?void 0:t.cfg_scale)},[t==null?void 0:t.cfg_scale,u]),D=f.useCallback(()=>{b(t==null?void 0:t.strength)},[t==null?void 0:t.strength,b]);return!t||Object.keys(t).length===0?null:a.jsxs(a.Fragment,{children:[t.generation_mode&&a.jsx(ds,{label:"Generation Mode",value:t.generation_mode}),t.positive_prompt&&a.jsx(ds,{label:"Positive Prompt",labelPosition:"top",value:t.positive_prompt,onClick:S}),t.negative_prompt&&a.jsx(ds,{label:"Negative Prompt",labelPosition:"top",value:t.negative_prompt,onClick:C}),t.seed!==void 0&&a.jsx(ds,{label:"Seed",value:t.seed,onClick:_}),t.model!==void 0&&a.jsx(ds,{label:"Model",value:t.model.model_name,onClick:k}),t.width&&a.jsx(ds,{label:"Width",value:t.width,onClick:P}),t.height&&a.jsx(ds,{label:"Height",value:t.height,onClick:E}),t.scheduler&&a.jsx(ds,{label:"Scheduler",value:t.scheduler,onClick:I}),t.steps&&a.jsx(ds,{label:"Steps",value:t.steps,onClick:R}),t.cfg_scale!==void 0&&a.jsx(ds,{label:"CFG scale",value:t.cfg_scale,onClick:O}),t.strength&&a.jsx(ds,{label:"Image to image strength",value:t.strength,onClick:D})]})},TY=e=>{const{copyTooltip:t,jsonObject:n}=e,r=f.useMemo(()=>JSON.stringify(n,null,2),[n]);return a.jsxs(G,{sx:{borderRadius:"base",bg:"whiteAlpha.500",_dark:{bg:"blackAlpha.500"},flexGrow:1,w:"full",h:"full",position:"relative"},children:[a.jsx(Be,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"auto",p:4},children:a.jsx(O_,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsx("pre",{children:r})})}),a.jsx(G,{sx:{position:"absolute",top:0,insetInlineEnd:0,p:2},children:a.jsx(fr,{label:t,children:a.jsx(ti,{"aria-label":t,icon:a.jsx(gc,{}),variant:"ghost",onClick:()=>navigator.clipboard.writeText(r)})})})]})},AY=({image:e})=>{const[t,n]=BP(e.image_name,500),{currentData:r}=jv(n.isPending()?Yo.skipToken:t??Yo.skipToken),o=r==null?void 0:r.metadata,s=r==null?void 0:r.graph,i=f.useMemo(()=>{const u=[];return o&&u.push({label:"Core Metadata",data:o,copyTooltip:"Copy Core Metadata JSON"}),e&&u.push({label:"Image Details",data:e,copyTooltip:"Copy Image Details JSON"}),s&&u.push({label:"Graph",data:s,copyTooltip:"Copy Graph JSON"}),u},[o,s,e]);return a.jsxs(G,{sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",backdropFilter:"blur(20px)",bg:"baseAlpha.200",_dark:{bg:"blackAlpha.600"},borderRadius:"base",position:"absolute",overflow:"hidden"},children:[a.jsxs(G,{gap:2,children:[a.jsx(tt,{fontWeight:"semibold",children:"File:"}),a.jsxs(Di,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,a.jsx(h1,{mx:"2px"})]})]}),a.jsx(DY,{metadata:o}),a.jsxs(xh,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsx(Sh,{children:i.map(u=>a.jsx(_h,{sx:{borderTopRadius:"base"},children:a.jsx(tt,{sx:{color:"base.700",_dark:{color:"base.300"}},children:u.label})},u.label))}),a.jsx(Ch,{sx:{w:"full",h:"full"},children:i.map(u=>a.jsx(wh,{sx:{w:"full",h:"full",p:0,pt:4},children:a.jsx(TY,{jsonObject:u.data,copyTooltip:u.copyTooltip})},u.label))})]})]})},NY=f.memo(AY),Qg={color:"base.100",pointerEvents:"auto"},$Y=()=>{const{t:e}=pe(),{handlePrevImage:t,handleNextImage:n,isOnFirstImage:r,isOnLastImage:o,handleLoadMoreImages:s,areMoreImagesAvailable:i,isFetching:u}=HP();return a.jsxs(Be,{sx:{position:"relative",height:"100%",width:"100%"},children:[a.jsx(Be,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineStart:0},children:!r&&a.jsx(ti,{"aria-label":e("accessibility.previousImage"),icon:a.jsx(p$,{size:64}),variant:"unstyled",onClick:t,boxSize:16,sx:Qg})}),a.jsxs(Be,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineEnd:0},children:[!o&&a.jsx(ti,{"aria-label":e("accessibility.nextImage"),icon:a.jsx(h$,{size:64}),variant:"unstyled",onClick:n,boxSize:16,sx:Qg}),o&&i&&!u&&a.jsx(ti,{"aria-label":e("accessibility.loadMore"),icon:a.jsx(f$,{size:64}),variant:"unstyled",onClick:s,boxSize:16,sx:Qg}),o&&i&&u&&a.jsx(G,{sx:{w:16,h:16,alignItems:"center",justifyContent:"center"},children:a.jsx(fc,{opacity:.5,size:"xl"})})]})]})},zY=f.memo($Y),LY=we([Tt,Y8],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{progressImage:i,shouldAntialiasProgressImage:u}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n,progressImage:i,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:u}},{memoizeOptions:{resultEqualityCheck:Yt}}),FY=()=>{const{shouldShowImageDetails:e,imageName:t,progressImage:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=L(LY),{handlePrevImage:s,handleNextImage:i,prevImageId:u,nextImageId:d,isOnLastImage:p,handleLoadMoreImages:m,areMoreImagesAvailable:h,isFetching:v}=HP();Ze("left",()=>{s()},[u]),Ze("right",()=>{if(p&&h&&!v){m();return}p||i()},[d,p,h,m,v]);const{currentData:b,isLoading:w,isError:S,isSuccess:C}=Cs(t??Yo.skipToken),_=f.useMemo(()=>{if(b)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:b}}},[b]),k=f.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]),[P,E]=f.useState(!1),I=f.useRef(0),R=f.useCallback(()=>{E(!0),window.clearTimeout(I.current)},[]),O=f.useCallback(()=>{I.current=window.setTimeout(()=>{E(!1)},500)},[]);return a.jsxs(G,{onMouseOver:R,onMouseOut:O,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n&&r?a.jsx(Eu,{src:n.dataURL,width:n.width,height:n.height,draggable:!1,sx:{objectFit:"contain",maxWidth:"full",maxHeight:"full",height:"auto",position:"absolute",borderRadius:"base",imageRendering:o?"auto":"pixelated"}}):a.jsx(si,{imageDTO:b,droppableData:k,draggableData:_,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Current Image"}),e&&b&&a.jsx(Be,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base"},children:a.jsx(NY,{image:b})}),a.jsx(Os,{children:!e&&b&&P&&a.jsx(vo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},style:{position:"absolute",top:"0",width:"100%",height:"100%",pointerEvents:"none"},children:a.jsx(zY,{})},"nextPrevButtons")})]})},BY=f.memo(FY),HY=()=>a.jsxs(G,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[a.jsx(RY,{}),a.jsx(BY,{})]}),VP=()=>a.jsx(Be,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:4,borderRadius:"base"},children:a.jsx(G,{sx:{width:"100%",height:"100%"},children:a.jsx(HY,{})})}),VY=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:i}=va({defaultIsOpen:o}),{colorMode:u}=Qr();return a.jsxs(Be,{children:[a.jsxs(G,{onClick:i,sx:{alignItems:"center",p:2,px:4,gap:2,borderTopRadius:"base",borderBottomRadius:s?0:"base",bg:s?Pe("base.200","base.750")(u):Pe("base.150","base.800")(u),color:Pe("base.900","base.100")(u),_hover:{bg:s?Pe("base.250","base.700")(u):Pe("base.200","base.750")(u)},fontSize:"sm",fontWeight:600,cursor:"pointer",transitionProperty:"common",transitionDuration:"normal",userSelect:"none"},children:[t,a.jsx(Os,{children:n&&a.jsx(vo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(tt,{sx:{color:"accent.500",_dark:{color:"accent.300"}},children:n})},"statusText")}),a.jsx(li,{}),a.jsx(m1,{sx:{w:"1rem",h:"1rem",transform:s?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(ch,{in:s,animateOpacity:!0,style:{overflow:"unset"},children:a.jsx(Be,{sx:{p:4,borderBottomRadius:"base",bg:Pe("base.100","base.800")(u)},children:r})})]})},So=f.memo(VY),WY=we(Tt,e=>{const{combinatorial:t,isEnabled:n}=e.dynamicPrompts;return{combinatorial:t,isDisabled:!n}},ut),UY=()=>{const{combinatorial:e,isDisabled:t}=L(WY),n=ne(),r=f.useCallback(()=>{n(Q8())},[n]);return a.jsx(Pn,{isDisabled:t,label:"Combinatorial Generation",isChecked:e,onChange:r})},GY=we(Tt,e=>{const{isEnabled:t}=e.dynamicPrompts;return{isEnabled:t}},ut),qY=()=>{const e=ne(),{isEnabled:t}=L(GY),n=f.useCallback(()=>{e(X8())},[e]);return a.jsx(Pn,{label:"Enable Dynamic Prompts",isChecked:t,onChange:n})},KY=we(Tt,e=>{const{maxPrompts:t,combinatorial:n,isEnabled:r}=e.dynamicPrompts,{min:o,sliderMax:s,inputMax:i}=e.config.sd.dynamicPrompts.maxPrompts;return{maxPrompts:t,min:o,sliderMax:s,inputMax:i,isDisabled:!r||!n}},ut),YY=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=L(KY),s=ne(),i=f.useCallback(d=>{s(Z8(d))},[s]),u=f.useCallback(()=>{s(J8())},[s]);return a.jsx(yt,{label:"Max Prompts",isDisabled:o,min:t,max:n,value:e,onChange:i,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},QY=we(Tt,e=>{const{isEnabled:t}=e.dynamicPrompts;return{activeLabel:t?"Enabled":void 0}},ut),sy=()=>{const{activeLabel:e}=L(QY);return sr("dynamicPrompting").isFeatureEnabled?a.jsx(So,{label:"Dynamic Prompts",activeLabel:e,children:a.jsxs(G,{sx:{gap:2,flexDir:"column"},children:[a.jsx(qY,{}),a.jsx(UY,{}),a.jsx(YY,{})]})}):null},XY=e=>{const t=ne(),{lora:n}=e,r=f.useCallback(i=>{t(eO({id:n.id,weight:i}))},[t,n.id]),o=f.useCallback(()=>{t(tO(n.id))},[t,n.id]),s=f.useCallback(()=>{t(nO(n.id))},[t,n.id]);return a.jsxs(G,{sx:{gap:2.5,alignItems:"flex-end"},children:[a.jsx(yt,{label:n.model_name,value:n.weight,onChange:r,min:-1,max:2,step:.01,withInput:!0,withReset:!0,handleReset:o,withSliderMarks:!0,sliderMarks:[-1,0,1,2]}),a.jsx(Ae,{size:"sm",onClick:s,tooltip:"Remove LoRA","aria-label":"Remove LoRA",icon:a.jsx(mo,{}),colorScheme:"error"})]})},ZY=f.memo(XY),JY=we(Tt,({lora:e})=>{const{loras:t}=e;return{loras:t}},ut),eQ=()=>{const{loras:e}=L(JY);return Xs(e,t=>a.jsx(ZY,{lora:t},t.model_name))},WP=f.forwardRef(({label:e,tooltip:t,description:n,disabled:r,...o},s)=>a.jsx(fr,{label:t,placement:"top",hasArrow:!0,children:a.jsx(Be,{ref:s,...o,children:a.jsxs(Be,{children:[a.jsx(Yl,{children:e}),n&&a.jsx(Yl,{size:"xs",color:"base.600",children:n})]})})}));WP.displayName="IAIMantineSelectItemWithTooltip";const Sc=f.memo(WP),Mr={"sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x"},tQ=we(Tt,({lora:e})=>({loras:e.loras}),ut),nQ=()=>{const e=ne(),{loras:t}=L(tQ),{data:n}=r3(),r=L(i=>i.generation.model),o=f.useMemo(()=>{if(!n)return[];const i=[];return es(n.entities,(u,d)=>{if(!u||d in t)return;const p=(r==null?void 0:r.base_model)!==u.base_model;i.push({value:d,label:u.model_name,disabled:p,group:Mr[u.base_model],tooltip:p?`Incompatible base model: ${u.base_model}`:void 0})}),i.sort((u,d)=>u.disabled&&!d.disabled?1:-1)},[t,n,r==null?void 0:r.base_model]),s=f.useCallback(i=>{if(!i)return;const u=n==null?void 0:n.entities[i];u&&e(rO(u))},[e,n==null?void 0:n.entities]);return(n==null?void 0:n.ids.length)===0?a.jsx(G,{sx:{justifyContent:"center",p:2},children:a.jsx(tt,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(gr,{placeholder:o.length===0?"All LoRAs added":"Add LoRA",value:null,data:o,nothingFound:"No matching LoRAs",itemComponent:Sc,disabled:o.length===0,filter:(i,u)=>{var d;return((d=u.label)==null?void 0:d.toLowerCase().includes(i.toLowerCase().trim()))||u.value.toLowerCase().includes(i.toLowerCase().trim())},onChange:s})},rQ=we(Tt,e=>{const t=oO(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},ut),oQ=()=>{const{activeLabel:e}=L(rQ);return sr("lora").isFeatureEnabled?a.jsx(So,{label:"LoRA",activeLabel:e,children:a.jsxs(G,{sx:{flexDir:"column",gap:2},children:[a.jsx(nQ,{}),a.jsx(eQ,{})]})}):null},ay=f.memo(oQ),sQ=we(Tt,e=>({activeLabel:e.generation.clipSkip>0?"Clip Skip":void 0}),ut);function iy(){const{activeLabel:e}=L(sQ);return L(n=>n.ui.shouldShowAdvancedOptions)&&a.jsx(So,{label:"Advanced",activeLabel:e,children:a.jsx(G,{sx:{flexDir:"column",gap:2},children:a.jsx(sO,{})})})}const aQ=ah.child({module:"models"}),UP=e=>{const[t,n,r]=e.split("/"),o=aO.safeParse({base_model:t,model_name:r});if(!o.success){aQ.error({controlNetModelId:e,errors:o.error.format()},"Failed to parse ControlNet model id");return}return o.data},iQ=e=>{const{controlNetId:t}=e,n=ne(),r=L(Fr),o=f.useMemo(()=>we(Tt,({generation:v,controlNet:b})=>{var _,k;const{model:w}=v,S=(_=b.controlNets[t])==null?void 0:_.model,C=(k=b.controlNets[t])==null?void 0:k.isEnabled;return{mainModel:w,controlNetModel:S,isEnabled:C}},ut),[t]),{mainModel:s,controlNetModel:i,isEnabled:u}=L(o),{data:d}=Ev(),p=f.useMemo(()=>{if(!d)return[];const v=[];return es(d.entities,(b,w)=>{if(!b)return;const S=(b==null?void 0:b.base_model)!==(s==null?void 0:s.base_model);v.push({value:w,label:b.model_name,group:Mr[b.base_model],disabled:S,tooltip:S?`Incompatible base model: ${b.base_model}`:void 0})}),v},[d,s==null?void 0:s.base_model]),m=f.useMemo(()=>(d==null?void 0:d.entities[`${i==null?void 0:i.base_model}/controlnet/${i==null?void 0:i.model_name}`])??null,[i==null?void 0:i.base_model,i==null?void 0:i.model_name,d==null?void 0:d.entities]),h=f.useCallback(v=>{if(!v)return;const b=UP(v);b&&n(o3({controlNetId:t,model:b}))},[t,n]);return a.jsx(gr,{itemComponent:Sc,data:p,error:!m||(s==null?void 0:s.base_model)!==m.base_model,placeholder:"Select a model",value:(m==null?void 0:m.id)??null,onChange:h,disabled:r||!u,tooltip:m==null?void 0:m.description})},lQ=f.memo(iQ),cQ=e=>{const{controlNetId:t}=e,n=ne(),r=f.useMemo(()=>we(Tt,({controlNet:u})=>{const{weight:d,isEnabled:p}=u.controlNets[t];return{weight:d,isEnabled:p}},ut),[t]),{weight:o,isEnabled:s}=L(r),i=f.useCallback(u=>{n(iO({controlNetId:t,weight:u}))},[t,n]);return a.jsx(yt,{isDisabled:!s,label:"Weight",value:o,onChange:i,min:0,max:2,step:.01,withSliderMarks:!0,sliderMarks:[0,1,2]})},uQ=f.memo(cQ),dQ=e=>{const{height:t,controlNetId:n}=e,r=ne(),o=f.useMemo(()=>we(Tt,({controlNet:B})=>{const{pendingControlImages:ee}=B,{controlImage:F,processedControlImage:N,processorType:H,isEnabled:K}=B.controlNets[n];return{controlImageName:F,processedControlImageName:N,processorType:H,isEnabled:K,pendingControlImages:ee}},ut),[n]),{controlImageName:s,processedControlImageName:i,processorType:u,pendingControlImages:d,isEnabled:p}=L(o),[m,h]=f.useState(!1),{currentData:v,isLoading:b,isError:w,isSuccess:S}=Cs(s??Yo.skipToken),{currentData:C,isLoading:_,isError:k,isSuccess:P}=Cs(i??Yo.skipToken),E=f.useCallback(()=>{r(lO({controlNetId:n,controlImage:null}))},[n,r]),I=f.useCallback(()=>{h(!0)},[]),R=f.useCallback(()=>{h(!1)},[]),O=f.useMemo(()=>{if(v)return{id:n,payloadType:"IMAGE_DTO",payload:{imageDTO:v}}},[v,n]),D=f.useMemo(()=>({id:n,actionType:"SET_CONTROLNET_IMAGE",context:{controlNetId:n}}),[n]),T=f.useMemo(()=>({type:"SET_CONTROLNET_IMAGE",controlNetId:n}),[n]),$=v&&C&&!m&&!d.includes(n)&&u!=="none";return a.jsxs(G,{onMouseEnter:I,onMouseLeave:R,sx:{position:"relative",w:"full",h:t,alignItems:"center",justifyContent:"center",pointerEvents:p?"auto":"none",opacity:p?1:.5},children:[a.jsx(si,{draggableData:O,droppableData:D,imageDTO:v,isDropDisabled:$||!p,onClickReset:E,postUploadAction:T,resetTooltip:"Reset Control Image",withResetIcon:!!v}),a.jsx(Be,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:$?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:a.jsx(si,{draggableData:O,droppableData:D,imageDTO:C,isUploadDisabled:!0,isDropDisabled:!p,onClickReset:E,resetTooltip:"Reset Control Image",withResetIcon:!!v})}),d.includes(n)&&a.jsx(G,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",alignItems:"center",justifyContent:"center",opacity:.8,borderRadius:"base",bg:"base.400",_dark:{bg:"base.900"}},children:a.jsx(fc,{size:"xl",sx:{color:"base.100",_dark:{color:"base.400"}}})})]})},OC=f.memo(dQ),Rs=()=>{const e=ne();return f.useCallback((n,r)=>{e(cO({controlNetId:n,changes:r}))},[e])};function Ms(e){return a.jsx(G,{sx:{flexDirection:"column",gap:2},children:e.children})}const RC=ts.canny_image_processor.default,fQ=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{low_threshold:o,high_threshold:s}=n,i=L(Fr),u=Rs(),d=f.useCallback(v=>{u(t,{low_threshold:v})},[t,u]),p=f.useCallback(()=>{u(t,{low_threshold:RC.low_threshold})},[t,u]),m=f.useCallback(v=>{u(t,{high_threshold:v})},[t,u]),h=f.useCallback(()=>{u(t,{high_threshold:RC.high_threshold})},[t,u]);return a.jsxs(Ms,{children:[a.jsx(yt,{isDisabled:i||!r,label:"Low Threshold",value:o,onChange:d,handleReset:p,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),a.jsx(yt,{isDisabled:i||!r,label:"High Threshold",value:s,onChange:m,handleReset:h,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},pQ=f.memo(fQ),Gc=ts.content_shuffle_image_processor.default,hQ=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,w:i,h:u,f:d}=n,p=Rs(),m=L(Fr),h=f.useCallback(I=>{p(t,{detect_resolution:I})},[t,p]),v=f.useCallback(()=>{p(t,{detect_resolution:Gc.detect_resolution})},[t,p]),b=f.useCallback(I=>{p(t,{image_resolution:I})},[t,p]),w=f.useCallback(()=>{p(t,{image_resolution:Gc.image_resolution})},[t,p]),S=f.useCallback(I=>{p(t,{w:I})},[t,p]),C=f.useCallback(()=>{p(t,{w:Gc.w})},[t,p]),_=f.useCallback(I=>{p(t,{h:I})},[t,p]),k=f.useCallback(()=>{p(t,{h:Gc.h})},[t,p]),P=f.useCallback(I=>{p(t,{f:I})},[t,p]),E=f.useCallback(()=>{p(t,{f:Gc.f})},[t,p]);return a.jsxs(Ms,{children:[a.jsx(yt,{label:"Detect Resolution",value:s,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:m||!r}),a.jsx(yt,{label:"Image Resolution",value:o,onChange:b,handleReset:w,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:m||!r}),a.jsx(yt,{label:"W",value:i,onChange:S,handleReset:C,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:m||!r}),a.jsx(yt,{label:"H",value:u,onChange:_,handleReset:k,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:m||!r}),a.jsx(yt,{label:"F",value:d,onChange:P,handleReset:E,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:m||!r})]})},mQ=f.memo(hQ),MC=ts.hed_image_processor.default,gQ=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o},isEnabled:s}=e,i=L(Fr),u=Rs(),d=f.useCallback(b=>{u(t,{detect_resolution:b})},[t,u]),p=f.useCallback(b=>{u(t,{image_resolution:b})},[t,u]),m=f.useCallback(b=>{u(t,{scribble:b.target.checked})},[t,u]),h=f.useCallback(()=>{u(t,{detect_resolution:MC.detect_resolution})},[t,u]),v=f.useCallback(()=>{u(t,{image_resolution:MC.image_resolution})},[t,u]);return a.jsxs(Ms,{children:[a.jsx(yt,{label:"Detect Resolution",value:n,onChange:d,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:i||!s}),a.jsx(yt,{label:"Image Resolution",value:r,onChange:p,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:i||!s}),a.jsx(Pn,{label:"Scribble",isChecked:o,onChange:m,isDisabled:i||!s})]})},vQ=f.memo(gQ),DC=ts.lineart_anime_image_processor.default,yQ=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=Rs(),u=L(Fr),d=f.useCallback(v=>{i(t,{detect_resolution:v})},[t,i]),p=f.useCallback(v=>{i(t,{image_resolution:v})},[t,i]),m=f.useCallback(()=>{i(t,{detect_resolution:DC.detect_resolution})},[t,i]),h=f.useCallback(()=>{i(t,{image_resolution:DC.image_resolution})},[t,i]);return a.jsxs(Ms,{children:[a.jsx(yt,{label:"Detect Resolution",value:s,onChange:d,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(yt,{label:"Image Resolution",value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r})]})},bQ=f.memo(yQ),TC=ts.lineart_image_processor.default,xQ=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,coarse:i}=n,u=Rs(),d=L(Fr),p=f.useCallback(w=>{u(t,{detect_resolution:w})},[t,u]),m=f.useCallback(w=>{u(t,{image_resolution:w})},[t,u]),h=f.useCallback(()=>{u(t,{detect_resolution:TC.detect_resolution})},[t,u]),v=f.useCallback(()=>{u(t,{image_resolution:TC.image_resolution})},[t,u]),b=f.useCallback(w=>{u(t,{coarse:w.target.checked})},[t,u]);return a.jsxs(Ms,{children:[a.jsx(yt,{label:"Detect Resolution",value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:d||!r}),a.jsx(yt,{label:"Image Resolution",value:o,onChange:m,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:d||!r}),a.jsx(Pn,{label:"Coarse",isChecked:i,onChange:b,isDisabled:d||!r})]})},SQ=f.memo(xQ),AC=ts.mediapipe_face_processor.default,wQ=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{max_faces:o,min_confidence:s}=n,i=Rs(),u=L(Fr),d=f.useCallback(v=>{i(t,{max_faces:v})},[t,i]),p=f.useCallback(v=>{i(t,{min_confidence:v})},[t,i]),m=f.useCallback(()=>{i(t,{max_faces:AC.max_faces})},[t,i]),h=f.useCallback(()=>{i(t,{min_confidence:AC.min_confidence})},[t,i]);return a.jsxs(Ms,{children:[a.jsx(yt,{label:"Max Faces",value:o,onChange:d,handleReset:m,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(yt,{label:"Min Confidence",value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:u||!r})]})},CQ=f.memo(wQ),NC=ts.midas_depth_image_processor.default,_Q=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{a_mult:o,bg_th:s}=n,i=Rs(),u=L(Fr),d=f.useCallback(v=>{i(t,{a_mult:v})},[t,i]),p=f.useCallback(v=>{i(t,{bg_th:v})},[t,i]),m=f.useCallback(()=>{i(t,{a_mult:NC.a_mult})},[t,i]),h=f.useCallback(()=>{i(t,{bg_th:NC.bg_th})},[t,i]);return a.jsxs(Ms,{children:[a.jsx(yt,{label:"a_mult",value:o,onChange:d,handleReset:m,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(yt,{label:"bg_th",value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:u||!r})]})},kQ=f.memo(_Q),vf=ts.mlsd_image_processor.default,jQ=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,thr_d:i,thr_v:u}=n,d=Rs(),p=L(Fr),m=f.useCallback(k=>{d(t,{detect_resolution:k})},[t,d]),h=f.useCallback(k=>{d(t,{image_resolution:k})},[t,d]),v=f.useCallback(k=>{d(t,{thr_d:k})},[t,d]),b=f.useCallback(k=>{d(t,{thr_v:k})},[t,d]),w=f.useCallback(()=>{d(t,{detect_resolution:vf.detect_resolution})},[t,d]),S=f.useCallback(()=>{d(t,{image_resolution:vf.image_resolution})},[t,d]),C=f.useCallback(()=>{d(t,{thr_d:vf.thr_d})},[t,d]),_=f.useCallback(()=>{d(t,{thr_v:vf.thr_v})},[t,d]);return a.jsxs(Ms,{children:[a.jsx(yt,{label:"Detect Resolution",value:s,onChange:m,handleReset:w,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(yt,{label:"Image Resolution",value:o,onChange:h,handleReset:S,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(yt,{label:"W",value:i,onChange:v,handleReset:C,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(yt,{label:"H",value:u,onChange:b,handleReset:_,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:p||!r})]})},PQ=f.memo(jQ),$C=ts.normalbae_image_processor.default,IQ=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=Rs(),u=L(Fr),d=f.useCallback(v=>{i(t,{detect_resolution:v})},[t,i]),p=f.useCallback(v=>{i(t,{image_resolution:v})},[t,i]),m=f.useCallback(()=>{i(t,{detect_resolution:$C.detect_resolution})},[t,i]),h=f.useCallback(()=>{i(t,{image_resolution:$C.image_resolution})},[t,i]);return a.jsxs(Ms,{children:[a.jsx(yt,{label:"Detect Resolution",value:s,onChange:d,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(yt,{label:"Image Resolution",value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r})]})},EQ=f.memo(IQ),zC=ts.openpose_image_processor.default,OQ=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,hand_and_face:i}=n,u=Rs(),d=L(Fr),p=f.useCallback(w=>{u(t,{detect_resolution:w})},[t,u]),m=f.useCallback(w=>{u(t,{image_resolution:w})},[t,u]),h=f.useCallback(()=>{u(t,{detect_resolution:zC.detect_resolution})},[t,u]),v=f.useCallback(()=>{u(t,{image_resolution:zC.image_resolution})},[t,u]),b=f.useCallback(w=>{u(t,{hand_and_face:w.target.checked})},[t,u]);return a.jsxs(Ms,{children:[a.jsx(yt,{label:"Detect Resolution",value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:d||!r}),a.jsx(yt,{label:"Image Resolution",value:o,onChange:m,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:d||!r}),a.jsx(Pn,{label:"Hand and Face",isChecked:i,onChange:b,isDisabled:d||!r})]})},RQ=f.memo(OQ),LC=ts.pidi_image_processor.default,MQ=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,scribble:i,safe:u}=n,d=Rs(),p=L(Fr),m=f.useCallback(C=>{d(t,{detect_resolution:C})},[t,d]),h=f.useCallback(C=>{d(t,{image_resolution:C})},[t,d]),v=f.useCallback(()=>{d(t,{detect_resolution:LC.detect_resolution})},[t,d]),b=f.useCallback(()=>{d(t,{image_resolution:LC.image_resolution})},[t,d]),w=f.useCallback(C=>{d(t,{scribble:C.target.checked})},[t,d]),S=f.useCallback(C=>{d(t,{safe:C.target.checked})},[t,d]);return a.jsxs(Ms,{children:[a.jsx(yt,{label:"Detect Resolution",value:s,onChange:m,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(yt,{label:"Image Resolution",value:o,onChange:h,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Pn,{label:"Scribble",isChecked:i,onChange:w}),a.jsx(Pn,{label:"Safe",isChecked:u,onChange:S,isDisabled:p||!r})]})},DQ=f.memo(MQ),TQ=e=>null,AQ=f.memo(TQ),NQ=e=>{const{controlNetId:t}=e,n=f.useMemo(()=>we(Tt,({controlNet:s})=>{const{isEnabled:i,processorNode:u}=s.controlNets[t];return{isEnabled:i,processorNode:u}},ut),[t]),{isEnabled:r,processorNode:o}=L(n);return o.type==="canny_image_processor"?a.jsx(pQ,{controlNetId:t,processorNode:o,isEnabled:r}):o.type==="hed_image_processor"?a.jsx(vQ,{controlNetId:t,processorNode:o,isEnabled:r}):o.type==="lineart_image_processor"?a.jsx(SQ,{controlNetId:t,processorNode:o,isEnabled:r}):o.type==="content_shuffle_image_processor"?a.jsx(mQ,{controlNetId:t,processorNode:o,isEnabled:r}):o.type==="lineart_anime_image_processor"?a.jsx(bQ,{controlNetId:t,processorNode:o,isEnabled:r}):o.type==="mediapipe_face_processor"?a.jsx(CQ,{controlNetId:t,processorNode:o,isEnabled:r}):o.type==="midas_depth_image_processor"?a.jsx(kQ,{controlNetId:t,processorNode:o,isEnabled:r}):o.type==="mlsd_image_processor"?a.jsx(PQ,{controlNetId:t,processorNode:o,isEnabled:r}):o.type==="normalbae_image_processor"?a.jsx(EQ,{controlNetId:t,processorNode:o,isEnabled:r}):o.type==="openpose_image_processor"?a.jsx(RQ,{controlNetId:t,processorNode:o,isEnabled:r}):o.type==="pidi_image_processor"?a.jsx(DQ,{controlNetId:t,processorNode:o,isEnabled:r}):o.type==="zoe_depth_image_processor"?a.jsx(AQ,{controlNetId:t,processorNode:o,isEnabled:r}):null},$Q=f.memo(NQ),zQ=e=>{const{controlNetId:t}=e,n=ne(),r=f.useMemo(()=>we(Tt,({controlNet:d})=>{const{isEnabled:p,shouldAutoConfig:m}=d.controlNets[t];return{isEnabled:p,shouldAutoConfig:m}},ut),[t]),{isEnabled:o,shouldAutoConfig:s}=L(r),i=L(Fr),u=f.useCallback(()=>{n(uO({controlNetId:t}))},[t,n]);return a.jsx(Pn,{label:"Auto configure processor","aria-label":"Auto configure processor",isChecked:s,onChange:u,isDisabled:i||!o})},LQ=f.memo(zQ),FC=e=>`${Math.round(e*100)}%`,FQ=e=>{const{controlNetId:t}=e,n=ne(),r=f.useMemo(()=>we(Tt,({controlNet:d})=>{const{beginStepPct:p,endStepPct:m,isEnabled:h}=d.controlNets[t];return{beginStepPct:p,endStepPct:m,isEnabled:h}},ut),[t]),{beginStepPct:o,endStepPct:s,isEnabled:i}=L(r),u=f.useCallback(d=>{n(jx({controlNetId:t,beginStepPct:d[0]})),n(Px({controlNetId:t,endStepPct:d[1]}))},[t,n]);return f.useCallback(()=>{n(jx({controlNetId:t,beginStepPct:0})),n(Px({controlNetId:t,endStepPct:1}))},[t,n]),a.jsxs(Vn,{isDisabled:!i,children:[a.jsx(Zn,{children:"Begin / End Step Percentage"}),a.jsx(ni,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(b5,{"aria-label":["Begin Step %","End Step %"],value:[o,s],onChange:u,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!i,children:[a.jsx(x5,{children:a.jsx(S5,{})}),a.jsx(fr,{label:FC(o),placement:"top",hasArrow:!0,children:a.jsx(k0,{index:0})}),a.jsx(fr,{label:FC(s),placement:"top",hasArrow:!0,children:a.jsx(k0,{index:1})}),a.jsx(kf,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(kf,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(kf,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})},BQ=f.memo(FQ),HQ=[{label:"Balanced",value:"balanced"},{label:"Prompt",value:"more_prompt"},{label:"Control",value:"more_control"},{label:"Mega Control",value:"unbalanced"}];function VQ(e){const{controlNetId:t}=e,n=ne(),r=f.useMemo(()=>we(Tt,({controlNet:u})=>{const{controlMode:d,isEnabled:p}=u.controlNets[t];return{controlMode:d,isEnabled:p}},ut),[t]),{controlMode:o,isEnabled:s}=L(r);pe();const i=f.useCallback(u=>{n(dO({controlNetId:t,controlMode:u}))},[t,n]);return a.jsx(Ys,{disabled:!s,label:"Control Mode",data:HQ,value:String(o),onChange:i})}const WQ=we(rl,e=>Xs(ts,n=>({value:n.type,label:n.label})).sort((n,r)=>n.value==="none"?-1:r.value==="none"?1:n.label.localeCompare(r.label)).filter(n=>!e.sd.disabledControlNetProcessors.includes(n.value)),ut),UQ=e=>{const t=ne(),{controlNetId:n}=e,r=f.useMemo(()=>we(Tt,({controlNet:p})=>{const{isEnabled:m,processorNode:h}=p.controlNets[n];return{isEnabled:m,processorNode:h}},ut),[n]),o=L(Fr),s=L(WQ),{isEnabled:i,processorNode:u}=L(r),d=f.useCallback(p=>{t(fO({controlNetId:n,processorType:p}))},[n,t]);return a.jsx(gr,{label:"Processor",value:u.type??"canny_image_processor",data:s,onChange:d,disabled:o||!i})},GQ=f.memo(UQ),qQ=e=>{const{controlNetId:t}=e,n=ne(),r=we(Tt,({controlNet:h})=>{const{isEnabled:v,shouldAutoConfig:b}=h.controlNets[t];return{isEnabled:v,shouldAutoConfig:b}},ut),{isEnabled:o,shouldAutoConfig:s}=L(r),[i,u]=tB(!1),d=f.useCallback(()=>{n(pO({controlNetId:t}))},[t,n]),p=f.useCallback(()=>{n(hO({sourceControlNetId:t,newControlNetId:ei()}))},[t,n]),m=f.useCallback(()=>{n(mO({controlNetId:t}))},[t,n]);return a.jsxs(G,{sx:{flexDir:"column",gap:2,p:3,borderRadius:"base",position:"relative",bg:"base.200",_dark:{bg:"base.850"}},children:[a.jsxs(G,{sx:{gap:2,alignItems:"center"},children:[a.jsx(Pn,{tooltip:"Toggle this ControlNet","aria-label":"Toggle this ControlNet",isChecked:o,onChange:m}),a.jsx(Be,{sx:{w:"full",minW:0,opacity:o?1:.5,pointerEvents:o?"auto":"none",transitionProperty:"common",transitionDuration:"0.1s"},children:a.jsx(lQ,{controlNetId:t})}),a.jsx(Ae,{size:"sm",tooltip:"Duplicate","aria-label":"Duplicate",onClick:p,icon:a.jsx(gc,{})}),a.jsx(Ae,{size:"sm",tooltip:"Delete","aria-label":"Delete",colorScheme:"error",onClick:d,icon:a.jsx(mo,{})}),a.jsx(Ae,{size:"sm",tooltip:i?"Hide Advanced":"Show Advanced","aria-label":i?"Hide Advanced":"Show Advanced",onClick:u,variant:"link",icon:a.jsx(m1,{sx:{boxSize:4,color:"base.700",transform:i?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal",_dark:{color:"base.300"}}})}),!s&&a.jsx(Be,{sx:{position:"absolute",w:1.5,h:1.5,borderRadius:"full",top:4,insetInlineEnd:4,bg:"accent.700",_dark:{bg:"accent.400"}}})]}),a.jsxs(G,{sx:{w:"full",flexDirection:"column"},children:[a.jsxs(G,{sx:{gap:4,w:"full",alignItems:"center"},children:[a.jsxs(G,{sx:{flexDir:"column",gap:3,h:28,w:"full",paddingInlineStart:1,paddingInlineEnd:i?1:0,pb:2,justifyContent:"space-between"},children:[a.jsx(uQ,{controlNetId:t}),a.jsx(BQ,{controlNetId:t})]}),!i&&a.jsx(G,{sx:{alignItems:"center",justifyContent:"center",h:28,w:28,aspectRatio:"1/1",mt:3},children:a.jsx(OC,{controlNetId:t,height:28})})]}),a.jsx(Be,{mt:2,children:a.jsx(VQ,{controlNetId:t})}),a.jsx(GQ,{controlNetId:t})]}),i&&a.jsxs(a.Fragment,{children:[a.jsx(OC,{controlNetId:t,height:"392px"}),a.jsx(LQ,{controlNetId:t}),a.jsx($Q,{controlNetId:t})]})]})},KQ=f.memo(qQ),YQ=we(Tt,e=>{const{isEnabled:t}=e.controlNet;return{isEnabled:t}},ut),QQ=()=>{const{isEnabled:e}=L(YQ),t=ne(),n=f.useCallback(()=>{t(gO())},[t]);return a.jsx(Pn,{label:"Enable ControlNet",isChecked:e,onChange:n})},XQ=we(vO,e=>{const{controlNets:t,isEnabled:n}=e,r=yO(t),o=n&&r.length>0?`${r.length} Active`:void 0;return{controlNetsArray:Xs(t),activeLabel:o}},ut),ZQ=()=>{pe();const{controlNetsArray:e,activeLabel:t}=L(XQ),n=sr("controlNet").isFeatureDisabled,r=ne(),{firstModel:o}=Ev(void 0,{selectFromResult:i=>{var d,p;return{firstModel:(p=i.data)==null?void 0:p.entities[(d=i.data)==null?void 0:d.ids[0]]}}}),s=f.useCallback(()=>{if(!o)return;const i=ei();r(bO({controlNetId:i})),r(o3({controlNetId:i,model:o}))},[r,o]);return n?null:a.jsx(So,{label:"ControlNet",activeLabel:t,children:a.jsxs(G,{sx:{flexDir:"column",gap:3},children:[a.jsx(QQ,{}),a.jsx(Ut,{isDisabled:!o,flexGrow:1,size:"sm",onClick:s,children:"Add ControlNet"}),e.map((i,u)=>a.jsxs(f.Fragment,{children:[u>0&&a.jsx(Ia,{}),a.jsx(KQ,{controlNetId:i.controlNetId})]},i.controlNetId))]})})},ly=f.memo(ZQ),cy=e=>{e.stopPropagation()},JQ=rt((e,t)=>{const n=ne(),r=f.useCallback(s=>{s.shiftKey&&n(Zo(!0))},[n]),o=f.useCallback(s=>{s.shiftKey||n(Zo(!1))},[n]);return a.jsx(_5,{ref:t,onPaste:cy,onKeyDown:r,onKeyUp:o,...e})}),GP=f.memo(JQ),eX=e=>{const{onClick:t}=e;return a.jsx(Ae,{size:"sm","aria-label":"Add Embedding",tooltip:"Add Embedding",icon:a.jsx(l1,{}),sx:{p:2,color:"base.500",_hover:{color:"base.600"},_active:{color:"base.700"},_dark:{color:"base.500",_hover:{color:"base.400"},_active:{color:"base.300"}}},variant:"link",onClick:t})},qP=f.memo(eX),KP=e=>{const{onSelect:t,isOpen:n,onClose:r,children:o}=e,{data:s}=xO(),i=f.useRef(null),u=L(m=>m.generation.model),d=f.useMemo(()=>{if(!s)return[];const m=[];return es(s.entities,(h,v)=>{if(!h)return;const b=(u==null?void 0:u.base_model)!==h.base_model;m.push({value:h.model_name,label:h.model_name,group:Mr[h.base_model],disabled:b,tooltip:b?`Incompatible base model: ${h.base_model}`:void 0})}),m.sort((h,v)=>h.disabled&&!v.disabled?1:-1)},[s,u==null?void 0:u.base_model]),p=f.useCallback(m=>{m&&t(m)},[t]);return a.jsxs(n1,{initialFocusRef:i,isOpen:n,onClose:r,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(t1,{children:o}),a.jsx(r1,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(d5,{sx:{p:0,w:`calc(${ry} - 2rem )`},children:d.length===0?a.jsx(G,{sx:{justifyContent:"center",p:2},children:a.jsx(tt,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No Embeddings Loaded"})}):a.jsx(gr,{inputRef:i,autoFocus:!0,placeholder:"Add Embedding",value:null,data:d,nothingFound:"No matching Embeddings",itemComponent:Sc,disabled:d.length===0,onDropdownClose:r,filter:(m,h)=>{var v;return((v=h.label)==null?void 0:v.toLowerCase().includes(m.toLowerCase().trim()))||h.value.toLowerCase().includes(m.toLowerCase().trim())},onChange:p})})})]})},uy=()=>{const e=L(h=>h.generation.negativePrompt),t=f.useRef(null),{isOpen:n,onClose:r,onOpen:o}=va(),s=ne(),{t:i}=pe(),u=f.useCallback(h=>{s(ru(h.target.value))},[s]),d=f.useCallback(h=>{h.key==="<"&&o()},[o]),p=f.useCallback(h=>{if(!t.current)return;const v=t.current.selectionStart;if(v===void 0)return;let b=e.slice(0,v);b[b.length-1]!=="<"&&(b+="<"),b+=`${h}>`;const w=b.length;b+=e.slice(v),dc.flushSync(()=>{s(ru(b))}),t.current.selectionEnd=w,r()},[s,r,e]),m=sr("embedding").isFeatureEnabled;return a.jsxs(Vn,{children:[a.jsx(KP,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(GP,{id:"negativePrompt",name:"negativePrompt",ref:t,value:e,placeholder:i("parameters.negativePromptPlaceholder"),onChange:u,resize:"vertical",fontSize:"sm",minH:16,...m&&{onKeyDown:d}})}),!n&&m&&a.jsx(Be,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(qP,{onClick:o})})]})},tX=e=>{const r=e.split(",").map(o=>o.split(":")).map(o=>({seed:Number(o[0]),weight:Number(o[1])}));return dy(r)?r:!1},dy=e=>typeof e=="string"?!!tX(e):!!(e.length&&!e.some(t=>{const{seed:n,weight:r}=t,o=!isNaN(parseInt(n.toString(),10)),s=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(o&&s)})),nX=we([Tt,yr],(e,t)=>{const{generation:n,system:r}=e,{shouldGenerateVariations:o,seedWeights:s,initialImage:i,seed:u}=n,{isProcessing:d,isConnected:p}=r;let m=!0;const h=[];t==="img2img"&&!i&&(m=!1,h.push("No initial image selected"));const{isSuccess:v}=SO.endpoints.getMainModels.select()(e);return v||(m=!1,h.push("Models are not loaded")),d&&(m=!1,h.push("System Busy")),p||(m=!1,h.push("System Disconnected")),o&&(!(dy(s)||s==="")||u===-1)&&(m=!1,h.push("Seed-Weights badly formatted.")),es(e.controlNet.controlNets,(b,w)=>{b.model||(m=!1,h.push("ControlNet ${id} has no model selected."))}),{isReady:m,reasonsWhyNotReady:h}},ut),fy=()=>{const{isReady:e}=L(nX);return e},rX=we([Tt,yr],({generation:e,ui:t},n)=>({shouldPinParametersPanel:t.shouldPinParametersPanel,prompt:e.positivePrompt,activeTabName:n}),{memoizeOptions:{resultEqualityCheck:Yt}}),py=()=>{const e=ne(),{prompt:t,shouldPinParametersPanel:n,activeTabName:r}=L(rX),o=fy(),s=f.useRef(null),{isOpen:i,onClose:u,onOpen:d}=va(),{t:p}=pe(),m=f.useCallback(w=>{e(nu(w.target.value))},[e]);Ze("alt+a",()=>{var w;(w=s.current)==null||w.focus()},[]);const h=f.useCallback(w=>{if(!s.current)return;const S=s.current.selectionStart;if(S===void 0)return;let C=t.slice(0,S);C[C.length-1]!=="<"&&(C+="<"),C+=`${w}>`;const _=C.length;C+=t.slice(S),dc.flushSync(()=>{e(nu(C))}),s.current.selectionStart=_,s.current.selectionEnd=_,u()},[e,u,t]),v=sr("embedding").isFeatureEnabled,b=f.useCallback(w=>{w.key==="Enter"&&w.shiftKey===!1&&o&&(w.preventDefault(),e(Ov()),e(Rv(r))),v&&w.key==="<"&&d()},[o,e,r,d,v]);return a.jsxs(Be,{position:"relative",children:[a.jsx(Vn,{children:a.jsx(KP,{isOpen:i,onClose:u,onSelect:h,children:a.jsx(GP,{id:"prompt",name:"prompt",ref:s,value:t,placeholder:p("parameters.positivePromptPlaceholder"),onChange:m,onKeyDown:b,resize:"vertical",minH:32})})}),!i&&v&&a.jsx(Be,{sx:{position:"absolute",top:n?6:0,insetInlineEnd:0},children:a.jsx(qP,{onClick:d})})]})},oX=we(Tt,e=>{const{shouldUseNoiseSettings:t,shouldUseCpuNoise:n}=e.generation;return{isDisabled:!t,shouldUseCpuNoise:n}},ut),sX=()=>{const e=ne(),{isDisabled:t,shouldUseCpuNoise:n}=L(oX);pe();const r=o=>e(wO(o.target.checked));return a.jsx(Pn,{isDisabled:t,label:"Use CPU Noise",isChecked:n,onChange:r})},aX=we(Tt,e=>{const{shouldUseNoiseSettings:t,threshold:n}=e.generation;return{isDisabled:!t,threshold:n}},ut);function iX(){const e=ne(),{threshold:t,isDisabled:n}=L(aX),{t:r}=pe();return a.jsx(yt,{isDisabled:n,label:r("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:o=>e(Ix(o)),handleReset:()=>e(Ix(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const lX=()=>{const e=ne(),t=L(r=>r.generation.shouldUseNoiseSettings);pe();const n=r=>e(CO(r.target.checked));return a.jsx(Pn,{label:"Enable Noise Settings",isChecked:t,onChange:n})},cX=we(Tt,e=>{const{shouldUseNoiseSettings:t,perlin:n}=e.generation;return{isDisabled:!t,perlin:n}},ut);function uX(){const e=ne(),{perlin:t,isDisabled:n}=L(cX),{t:r}=pe();return a.jsx(yt,{isDisabled:n,label:r("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:o=>e(Ex(o)),handleReset:()=>e(Ex(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const dX=we(Tt,e=>{const{shouldUseNoiseSettings:t}=e.generation;return{activeLabel:t?"Enabled":void 0}},ut),fX=()=>{const{t:e}=pe(),t=sr("noise").isFeatureEnabled,n=sr("perlinNoise").isFeatureEnabled,r=sr("noiseThreshold").isFeatureEnabled,{activeLabel:o}=L(dX);return t?a.jsx(So,{label:e("parameters.noiseSettings"),activeLabel:o,children:a.jsxs(G,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(lX,{}),a.jsx(sX,{}),n&&a.jsx(uX,{}),r&&a.jsx(iX,{})]})}):null},YP=f.memo(fX),pX=we(ns,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},ut),hX=()=>{const{t:e}=pe(),{seamlessXAxis:t}=L(pX),n=ne(),r=f.useCallback(o=>{n(_O(o.target.checked))},[n]);return a.jsx(Pn,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},mX=f.memo(hX),gX=we(ns,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},ut),vX=()=>{const{t:e}=pe(),{seamlessYAxis:t}=L(gX),n=ne(),r=f.useCallback(o=>{n(kO(o.target.checked))},[n]);return a.jsx(Pn,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},yX=f.memo(vX),bX=(e,t)=>{if(e&&t)return"X & Y";if(e)return"X";if(t)return"Y"},xX=we(ns,e=>{const{seamlessXAxis:t,seamlessYAxis:n}=e;return{activeLabel:bX(t,n)}},ut),SX=()=>{const{t:e}=pe(),{activeLabel:t}=L(xX);return sr("seamless").isFeatureEnabled?a.jsx(So,{label:e("parameters.seamlessTiling"),activeLabel:t,children:a.jsxs(G,{sx:{gap:5},children:[a.jsx(Be,{flexGrow:1,children:a.jsx(mX,{})}),a.jsx(Be,{flexGrow:1,children:a.jsx(yX,{})})]})}):null},QP=f.memo(SX);function wX(){const e=L(o=>o.generation.horizontalSymmetrySteps),t=L(o=>o.generation.steps),n=ne(),{t:r}=pe();return a.jsx(yt,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(Ox(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(Ox(0))})}function CX(){const e=L(o=>o.generation.verticalSymmetrySteps),t=L(o=>o.generation.steps),n=ne(),{t:r}=pe();return a.jsx(yt,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(Rx(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(Rx(0))})}function _X(){const e=L(n=>n.generation.shouldUseSymmetry),t=ne();return a.jsx(Pn,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(jO(n.target.checked))})}const kX=we(Tt,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),ut),jX=()=>{const{t:e}=pe(),{activeLabel:t}=L(kX);return sr("symmetry").isFeatureEnabled?a.jsx(So,{label:e("parameters.symmetry"),activeLabel:t,children:a.jsxs(G,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(_X,{}),a.jsx(wX,{}),a.jsx(CX,{})]})}):null},hy=f.memo(jX);function PX(){const e=L(o=>o.generation.variationAmount),t=L(o=>o.generation.shouldGenerateVariations),{t:n}=pe(),r=ne();return a.jsx(yt,{label:n("parameters.variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:o=>r(Mx(o)),handleReset:()=>r(Mx(.1)),withInput:!0,withReset:!0,withSliderMarks:!0})}const IX=()=>{const e=ne(),t=L(r=>r.generation.shouldGenerateVariations);pe();const n=r=>e(PO(r.target.checked));return a.jsx(Pn,{label:"Enable Variations",isChecked:t,onChange:n})},EX=e=>{const{label:t="",isDisabled:n=!1,isInvalid:r,formControlProps:o,...s}=e,i=ne(),u=f.useCallback(p=>{p.shiftKey&&i(Zo(!0))},[i]),d=f.useCallback(p=>{p.shiftKey||i(Zo(!1))},[i]);return a.jsxs(Vn,{isInvalid:r,isDisabled:n,...o,children:[t!==""&&a.jsx(Zn,{children:t}),a.jsx(Tu,{...s,onPaste:cy,onKeyDown:u,onKeyUp:d})]})},qr=f.memo(EX);function OX(){const e=L(s=>s.generation.seedWeights),t=L(s=>s.generation.shouldGenerateVariations),{t:n}=pe(),r=ne(),o=s=>r(IO(s.target.value));return a.jsx(qr,{label:n("parameters.seedWeights"),value:e,isInvalid:t&&!(dy(e)||e===""),isDisabled:!t,onChange:o})}const RX=we(Tt,e=>({activeLabel:e.generation.shouldGenerateVariations?"Enabled":void 0}),ut),MX=()=>{const{t:e}=pe(),{activeLabel:t}=L(RX);return sr("variation").isFeatureEnabled?a.jsx(So,{label:e("parameters.variations"),activeLabel:t,children:a.jsxs(G,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(IX,{}),a.jsx(PX,{}),a.jsx(OX,{})]})}):null},my=f.memo(MX),DX=we(yo,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable,currentIteration:e.currentIteration,totalIterations:e.totalIterations,sessionId:e.sessionId,cancelType:e.cancelType,isCancelScheduled:e.isCancelScheduled}),{memoizeOptions:{resultEqualityCheck:Yt}}),TX=e=>{const t=ne(),{btnGroupWidth:n="auto",...r}=e,{isProcessing:o,isConnected:s,isCancelable:i,cancelType:u,isCancelScheduled:d,sessionId:p}=L(DX),m=f.useCallback(()=>{if(p){if(u==="scheduled"){t(EO());return}t(OO({session_id:p}))}},[t,p,u]),{t:h}=pe(),v=f.useCallback(S=>{const C=Array.isArray(S)?S[0]:S;t(RO(C))},[t]);Ze("shift+x",()=>{(s||o)&&i&&m()},[s,o,i]);const b=f.useMemo(()=>h(d?"parameters.cancel.isScheduled":u==="immediate"?"parameters.cancel.immediate":"parameters.cancel.schedule"),[h,u,d]),w=f.useMemo(()=>d?a.jsx(MO,{}):u==="immediate"?a.jsx(uB,{}):a.jsx(sB,{}),[u,d]);return a.jsxs(dr,{isAttached:!0,width:n,children:[a.jsx(Ae,{icon:w,tooltip:b,"aria-label":b,isDisabled:!s||!o||!i,onClick:m,colorScheme:"error",id:"cancel-button",...r}),a.jsxs(ph,{closeOnSelect:!1,children:[a.jsx(hh,{as:Ae,tooltip:h("parameters.cancel.setType"),"aria-label":h("parameters.cancel.setType"),icon:a.jsx(K$,{w:"1em",h:"1em"}),paddingX:0,paddingY:0,colorScheme:"error",minWidth:5,...r}),a.jsx($u,{minWidth:"240px",children:a.jsxs(Zv,{value:u,title:"Cancel Type",type:"radio",onChange:v,children:[a.jsx(hu,{value:"immediate",children:h("parameters.cancel.immediate")}),a.jsx(hu,{value:"scheduled",children:h("parameters.cancel.schedule")})]})})]})]})},qh=f.memo(TX),AX=we(yo,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:Yt}}),NX=()=>{const{t:e}=pe(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=L(AX),s=n?Math.round(n*100/r):0;return a.jsx(p5,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!o,height:"full",colorScheme:"accent"})},XP=f.memo(NX),BC={_disabled:{bg:"none",color:"base.600",cursor:"not-allowed",_hover:{color:"base.600",bg:"none"}}};function gy(e){const{iconButton:t=!1,...n}=e,r=ne(),o=fy(),s=L(yr),i=L(p=>p.system.isProcessing),u=f.useCallback(()=>{r(Ov()),r(Rv(s))},[r,s]),{t:d}=pe();return Ze(["ctrl+enter","meta+enter"],u,{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,s]),a.jsx(Be,{style:{flexGrow:4},position:"relative",children:a.jsxs(Be,{style:{position:"relative"},children:[!o&&a.jsx(Be,{borderRadius:"base",style:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip"},...n,children:a.jsx(XP,{})}),t?a.jsx(Ae,{"aria-label":d("parameters.invoke"),type:"submit",icon:a.jsx(t_,{}),isDisabled:!o||i,onClick:u,tooltip:d("parameters.invoke"),tooltipProps:{placement:"top"},colorScheme:"accent",id:"invoke-button",...n,sx:{w:"full",flexGrow:1,...i?BC:{}}}):a.jsx(Ut,{"aria-label":d("parameters.invoke"),type:"submit",isDisabled:!o||i,onClick:u,colorScheme:"accent",id:"invoke-button",...n,sx:{w:"full",flexGrow:1,fontWeight:700,...i?BC:{}},children:"Invoke"})]})})}const vy=()=>a.jsxs(G,{gap:2,children:[a.jsx(gy,{}),a.jsx(qh,{})]}),Qp=/^-?(0\.)?\.?$/,$X=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:i,min:u,max:d,isInteger:p=!0,formControlProps:m,formLabelProps:h,numberInputFieldProps:v,numberInputStepperProps:b,tooltipProps:w,...S}=e,C=ne(),[_,k]=f.useState(String(s));f.useEffect(()=>{!_.match(Qp)&&s!==Number(_)&&k(String(s))},[s,_]);const P=O=>{k(O),O.match(Qp)||i(p?Math.floor(Number(O)):Number(O))},E=O=>{const D=qs(p?Math.floor(Number(O.target.value)):Number(O.target.value),u,d);k(String(D)),i(D)},I=f.useCallback(O=>{O.shiftKey&&C(Zo(!0))},[C]),R=f.useCallback(O=>{O.shiftKey||C(Zo(!1))},[C]);return a.jsx(fr,{...w,children:a.jsxs(Vn,{isDisabled:n,isInvalid:o,...m,children:[t&&a.jsx(Zn,{...h,children:t}),a.jsxs(s3,{value:_,min:u,max:d,keepWithinRange:!0,clampValueOnBlur:!1,onChange:P,onBlur:E,...S,onPaste:cy,children:[a.jsx(a3,{...v,onKeyDown:I,onKeyUp:R}),r&&a.jsxs(i3,{children:[a.jsx(l3,{...b}),a.jsx(c3,{...b})]})]})]})})},tc=f.memo($X),zX=we([ns,rl,Xr,Ou],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:i,inputMax:u}=t.sd.guidance,{cfgScale:d}=e,{shouldUseSliders:p}=n,{shift:m}=r;return{cfgScale:d,initial:o,min:s,sliderMax:i,inputMax:u,shouldUseSliders:p,shift:m}},ut),LX=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:i}=L(zX),u=ne(),{t:d}=pe(),p=f.useCallback(h=>u(Tf(h)),[u]),m=f.useCallback(()=>u(Tf(t)),[u,t]);return s?a.jsx(yt,{label:d("parameters.cfgScale"),step:i?.1:.5,min:n,max:r,onChange:p,handleReset:m,value:e,sliderNumberInputProps:{max:o},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1}):a.jsx(tc,{label:d("parameters.cfgScale"),step:.5,min:n,max:o,onChange:p,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})},nc=f.memo(LX),FX=we([Tt],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:i}=e.config.sd.iterations,{iterations:u}=e.generation,{shouldUseSliders:d}=e.ui,p=e.dynamicPrompts.isEnabled&&e.dynamicPrompts.combinatorial,m=e.hotkeys.shift?s:i;return{iterations:u,initial:t,min:n,sliderMax:r,inputMax:o,step:m,shouldUseSliders:d,isDisabled:p}},ut),BX=()=>{const{iterations:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i,isDisabled:u}=L(FX),d=ne(),{t:p}=pe(),m=f.useCallback(v=>{d(Dx(v))},[d]),h=f.useCallback(()=>{d(Dx(t))},[d,t]);return i?a.jsx(yt,{isDisabled:u,label:p("parameters.images"),step:s,min:n,max:r,onChange:m,handleReset:h,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):a.jsx(tc,{isDisabled:u,label:p("parameters.images"),step:s,min:n,max:o,onChange:m,value:e,numberInputFieldProps:{textAlign:"center"}})},rc=f.memo(BX),HX=ah.child({module:"models"}),ZP=e=>{const[t,n,r]=e.split("/"),o=DO.safeParse({base_model:t,model_name:r});if(!o.success){HX.error({mainModelId:e,errors:o.error.format()},"Failed to parse main model id");return}return o.data},VX=we(Tt,e=>({model:e.generation.model}),ut),WX=()=>{const e=ne(),{t}=pe(),{model:n}=L(VX),{data:r,isLoading:o}=Kl(),s=f.useMemo(()=>{if(!r)return[];const d=[];return es(r.entities,(p,m)=>{p&&d.push({value:m,label:p.model_name,group:Mr[p.base_model]})}),d},[r]),i=f.useMemo(()=>(r==null?void 0:r.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])??null,[r==null?void 0:r.entities,n]),u=f.useCallback(d=>{if(!d)return;const p=ZP(d);p&&e(a0(p))},[e]);return o?a.jsx(gr,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsx(gr,{tooltip:i==null?void 0:i.description,label:t("modelManager.model"),value:i==null?void 0:i.id,placeholder:s.length>0?"Select a model":"No models available",data:s,error:s.length===0,disabled:s.length===0,onChange:u})},UX=f.memo(WX),GX=ah.child({module:"models"}),JP=e=>{const[t,n,r]=e.split("/"),o=TO.safeParse({base_model:t,model_name:r});if(!o.success){GX.error({vaeModelId:e,errors:o.error.format()},"Failed to parse VAE model id");return}return o.data},qX=we(Tt,({generation:e})=>{const{model:t,vae:n}=e;return{model:t,vae:n}},ut),KX=()=>{const e=ne(),{t}=pe(),{model:n,vae:r}=L(qX),{data:o}=u3(),s=f.useMemo(()=>{if(!o)return[];const d=[{value:"default",label:"Default",group:"Default"}];return es(o.entities,(p,m)=>{if(!p)return;const h=(n==null?void 0:n.base_model)!==p.base_model;d.push({value:m,label:p.model_name,group:Mr[p.base_model],disabled:h,tooltip:h?`Incompatible base model: ${p.base_model}`:void 0})}),d.sort((p,m)=>p.disabled&&!m.disabled?1:-1)},[o,n==null?void 0:n.base_model]),i=f.useMemo(()=>(o==null?void 0:o.entities[`${r==null?void 0:r.base_model}/vae/${r==null?void 0:r.model_name}`])??null,[o==null?void 0:o.entities,r]),u=f.useCallback(d=>{if(!d||d==="default"){e(Tx(null));return}const p=JP(d);p&&e(Tx(p))},[e]);return a.jsx(gr,{itemComponent:Sc,tooltip:i==null?void 0:i.description,label:t("modelManager.vae"),value:(i==null?void 0:i.id)??"default",placeholder:"Default",data:s,onChange:u,disabled:s.length===0,clearable:!0})},YX=f.memo(KX),QX=we([Xr,ns],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=e3.map(s=>({value:s,label:t3[s],group:r.includes(s)?"Favorites":void 0})).sort((s,i)=>s.label.localeCompare(i.label));return{scheduler:n,data:o}},ut),XX=()=>{const e=ne(),{t}=pe(),{scheduler:n,data:r}=L(QX),o=f.useCallback(s=>{s&&e(i0(s))},[e]);return a.jsx(gr,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})},ZX=f.memo(XX),JX=()=>{const e=sr("vae").isFeatureEnabled;return a.jsxs(G,{gap:3,w:"full",flexWrap:e?"wrap":"nowrap",children:[a.jsx(Be,{w:"full",children:a.jsx(UX,{})}),a.jsxs(G,{gap:3,w:"full",children:[e&&a.jsx(Be,{w:"full",children:a.jsx(YX,{})}),a.jsx(Be,{w:"full",children:a.jsx(ZX,{})})]})]})},oc=f.memo(JX),eZ=[{name:"Free",value:null},{name:"Portrait",value:.67/1},{name:"Wide",value:16/9},{name:"Square",value:1/1}];function eI(){const e=L(o=>o.ui.aspectRatio),t=ne(),n=L(o=>o.generation.shouldFitToWidthHeight),r=L(yr);return a.jsx(G,{gap:2,flexGrow:1,children:a.jsx(dr,{isAttached:!0,children:eZ.map(o=>a.jsx(Ut,{size:"sm",isChecked:e===o.value,isDisabled:r==="img2img"?!n:!1,onClick:()=>t(AO(o.value)),children:o.name},o.name))})})}const tZ=we([ns,Ou,rl,Xr],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:i,inputMax:u,fineStep:d,coarseStep:p}=n.sd.height,{height:m}=e,{aspectRatio:h}=r,v=t.shift?d:p;return{height:m,initial:o,min:s,sliderMax:i,inputMax:u,step:v,aspectRatio:h}},ut),nZ=e=>{const{height:t,initial:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:u}=L(tZ),d=ne(),{t:p}=pe(),m=f.useCallback(v=>{if(d(ql(v)),u){const b=ms(v*u,8);d(Gl(b))}},[d,u]),h=f.useCallback(()=>{if(d(ql(n)),u){const v=ms(n*u,8);d(Gl(v))}},[d,n,u]);return a.jsx(yt,{label:p("parameters.height"),value:t,min:r,step:i,max:o,onChange:m,handleReset:h,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},rZ=f.memo(nZ),oZ=we([ns,Ou,rl,Xr],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:i,inputMax:u,fineStep:d,coarseStep:p}=n.sd.width,{width:m}=e,{aspectRatio:h}=r,v=t.shift?d:p;return{width:m,initial:o,min:s,sliderMax:i,inputMax:u,step:v,aspectRatio:h}},ut),sZ=e=>{const{width:t,initial:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:u}=L(oZ),d=ne(),{t:p}=pe(),m=f.useCallback(v=>{if(d(Gl(v)),u){const b=ms(v/u,8);d(ql(b))}},[d,u]),h=f.useCallback(()=>{if(d(Gl(n)),u){const v=ms(n/u,8);d(ql(v))}},[d,n,u]);return a.jsx(yt,{label:p("parameters.width"),value:t,min:r,step:i,max:o,onChange:m,handleReset:h,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},aZ=f.memo(sZ);function Xp(){const{t:e}=pe(),t=ne(),n=L(o=>o.generation.shouldFitToWidthHeight),r=L(yr);return a.jsxs(G,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsxs(G,{alignItems:"center",gap:2,children:[a.jsx(tt,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:e("parameters.aspectRatio")}),a.jsx(li,{}),a.jsx(eI,{}),a.jsx(Ae,{tooltip:e("ui.swapSizes"),"aria-label":e("ui.swapSizes"),size:"sm",icon:a.jsx(nk,{}),fontSize:20,isDisabled:r==="img2img"?!n:!1,onClick:()=>t(NO())})]}),a.jsx(G,{gap:2,alignItems:"center",children:a.jsxs(G,{gap:2,flexDirection:"column",width:"full",children:[a.jsx(aZ,{isDisabled:r==="img2img"?!n:!1}),a.jsx(rZ,{isDisabled:r==="img2img"?!n:!1})]})})]})}const iZ=we([ns,rl,Xr,Ou],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:i,inputMax:u,fineStep:d,coarseStep:p}=t.sd.steps,{steps:m}=e,{shouldUseSliders:h}=n,v=r.shift?d:p;return{steps:m,initial:o,min:s,sliderMax:i,inputMax:u,step:v,shouldUseSliders:h}},ut),lZ=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i}=L(iZ),u=ne(),{t:d}=pe(),p=f.useCallback(v=>{u(Af(v))},[u]),m=f.useCallback(()=>{u(Af(t))},[u,t]),h=f.useCallback(()=>{u(Ov())},[u]);return i?a.jsx(yt,{label:d("parameters.steps"),min:n,max:r,step:s,onChange:p,handleReset:m,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):a.jsx(tc,{label:d("parameters.steps"),min:n,max:o,step:s,onChange:p,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:h})},sc=f.memo(lZ);function cZ(){const e=ne(),t=L(o=>o.generation.shouldFitToWidthHeight),n=o=>e($O(o.target.checked)),{t:r}=pe();return a.jsx(Pn,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}const uZ=we([ns,Ou,rl],(e,t,n)=>{const{initial:r,min:o,sliderMax:s,inputMax:i,fineStep:u,coarseStep:d}=n.sd.img2imgStrength,{img2imgStrength:p}=e,m=t.shift?u:d;return{img2imgStrength:p,initial:r,min:o,sliderMax:s,inputMax:i,step:m}},ut),dZ=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=L(uZ),i=ne(),{t:u}=pe(),d=f.useCallback(m=>i(Nf(m)),[i]),p=f.useCallback(()=>{i(Nf(t))},[i,t]);return a.jsx(yt,{label:`${u("parameters.denoisingStrength")}`,step:s,min:n,max:r,onChange:d,handleReset:p,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,sliderNumberInputProps:{max:o}})},tI=f.memo(dZ);function fZ(){const e=L(i=>i.generation.seed),t=L(i=>i.generation.shouldRandomizeSeed),n=L(i=>i.generation.shouldGenerateVariations),{t:r}=pe(),o=ne(),s=i=>o(Df(i));return a.jsx(tc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:d3,max:f3,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e,formControlProps:{display:"flex",alignItems:"center",gap:3}})}const pZ=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function hZ(){const e=ne(),t=L(o=>o.generation.shouldRandomizeSeed),{t:n}=pe(),r=()=>e(Df(pZ(d3,f3)));return a.jsx(Ae,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:a.jsx(L$,{})})}const mZ=()=>{const e=ne(),{t}=pe(),n=L(o=>o.generation.shouldRandomizeSeed),r=o=>e(zO(o.target.checked));return a.jsx(Pn,{label:t("common.random"),isChecked:n,onChange:r})},gZ=f.memo(mZ),vZ=()=>a.jsxs(G,{sx:{gap:4,alignItems:"center"},children:[a.jsx(fZ,{}),a.jsx(hZ,{}),a.jsx(gZ,{})]}),ac=f.memo(vZ),yZ=we([Xr,ns],(e,t)=>{const{shouldUseSliders:n}=e,{shouldFitToWidthHeight:r,shouldRandomizeSeed:o}=t;return{shouldUseSliders:n,shouldFitToWidthHeight:r,activeLabel:o?void 0:"Manual Seed"}},ut),bZ=()=>{const{shouldUseSliders:e,shouldFitToWidthHeight:t,activeLabel:n}=L(yZ);return a.jsx(So,{label:"General",activeLabel:n,defaultIsOpen:!0,children:a.jsxs(G,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(rc,{}),a.jsx(sc,{}),a.jsx(nc,{}),a.jsx(oc,{}),a.jsx(Be,{pt:2,children:a.jsx(ac,{})}),a.jsx(Xp,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(G,{gap:3,children:[a.jsx(rc,{}),a.jsx(sc,{}),a.jsx(nc,{})]}),a.jsx(oc,{}),a.jsx(Be,{pt:2,children:a.jsx(ac,{})}),a.jsx(Xp,{})]}),a.jsx(tI,{}),a.jsx(cZ,{})]})})},xZ=f.memo(bZ),SZ=()=>a.jsxs(a.Fragment,{children:[a.jsx(py,{}),a.jsx(uy,{}),a.jsx(vy,{}),a.jsx(xZ,{}),a.jsx(ly,{}),a.jsx(ay,{}),a.jsx(sy,{}),a.jsx(my,{}),a.jsx(YP,{}),a.jsx(hy,{}),a.jsx(QP,{}),a.jsx(iy,{})]}),nI=f.memo(SZ),wZ=()=>{const e=ne(),t=f.useRef(null),n=f.useCallback(()=>{t.current&&t.current.setLayout([50,50])},[]);return a.jsxs(G,{sx:{gap:4,w:"full",h:"full"},children:[a.jsx(oy,{children:a.jsx(nI,{})}),a.jsx(Be,{sx:{w:"full",h:"full"},children:a.jsxs(ny,{ref:t,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},children:[a.jsx(wu,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:a.jsx(pY,{})}),a.jsx(FP,{onDoubleClick:n}),a.jsx(wu,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,onResize:()=>{e(js())},children:a.jsx(VP,{})})]})})]})},CZ=f.memo(wZ);var _Z=function(t){return kZ(t)&&!jZ(t)};function kZ(e){return!!e&&typeof e=="object"}function jZ(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||EZ(e)}var PZ=typeof Symbol=="function"&&Symbol.for,IZ=PZ?Symbol.for("react.element"):60103;function EZ(e){return e.$$typeof===IZ}function OZ(e){return Array.isArray(e)?[]:{}}function Zp(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Cu(OZ(e),e,t):e}function RZ(e,t,n){return e.concat(t).map(function(r){return Zp(r,n)})}function MZ(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(o){r[o]=Zp(e[o],n)}),Object.keys(t).forEach(function(o){!n.isMergeableObject(t[o])||!e[o]?r[o]=Zp(t[o],n):r[o]=Cu(e[o],t[o],n)}),r}function Cu(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||RZ,n.isMergeableObject=n.isMergeableObject||_Z;var r=Array.isArray(t),o=Array.isArray(e),s=r===o;return s?r?n.arrayMerge(e,t,n):MZ(e,t,n):Zp(t,n)}Cu.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Cu(r,o,n)},{})};var rv=Cu,HC=Array.isArray,VC=Object.keys,DZ=Object.prototype.hasOwnProperty,TZ=typeof Element<"u";function ov(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=HC(e),r=HC(t),o,s,i;if(n&&r){if(s=e.length,s!=t.length)return!1;for(o=s;o--!==0;)if(!ov(e[o],t[o]))return!1;return!0}if(n!=r)return!1;var u=e instanceof Date,d=t instanceof Date;if(u!=d)return!1;if(u&&d)return e.getTime()==t.getTime();var p=e instanceof RegExp,m=t instanceof RegExp;if(p!=m)return!1;if(p&&m)return e.toString()==t.toString();var h=VC(e);if(s=h.length,s!==VC(t).length)return!1;for(o=s;o--!==0;)if(!DZ.call(t,h[o]))return!1;if(TZ&&e instanceof Element&&t instanceof Element)return e===t;for(o=s;o--!==0;)if(i=h[o],!(i==="_owner"&&e.$$typeof)&&!ov(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var AZ=function(t,n){try{return ov(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}};const ki=lc(AZ);var NZ=!0;function $Z(e,t){if(!NZ){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}function Bn(){return Bn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bn.apply(this,arguments)}function Ml(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Kh=f.createContext(void 0);Kh.displayName="FormikContext";var zZ=Kh.Provider;Kh.Consumer;function rI(){var e=f.useContext(Kh);return e||$Z(!1),e}var Io=function(t){return typeof t=="function"},Yh=function(t){return t!==null&&typeof t=="object"},LZ=function(t){return String(Math.floor(Number(t)))===t},Xg=function(t){return Object.prototype.toString.call(t)==="[object String]"},FZ=function(t){return f.Children.count(t)===0},Zg=function(t){return Yh(t)&&Io(t.then)};function Po(e,t,n,r){r===void 0&&(r=0);for(var o=B3(t);e&&r<o.length;)e=e[o[r++]];return r!==o.length&&!e||e===void 0?n:e}function zi(e,t,n){for(var r=Qx(e),o=r,s=0,i=B3(t);s<i.length-1;s++){var u=i[s],d=Po(e,i.slice(0,s+1));if(d&&(Yh(d)||Array.isArray(d)))o=o[u]=Qx(d);else{var p=i[s+1];o=o[u]=LZ(p)&&Number(p)>=0?[]:{}}}return(s===0?e:o)[i[s]]===n?e:(n===void 0?delete o[i[s]]:o[i[s]]=n,s===0&&n===void 0&&delete r[i[s]],r)}function oI(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var o=0,s=Object.keys(e);o<s.length;o++){var i=s[o],u=e[i];Yh(u)?n.get(u)||(n.set(u,!0),r[i]=Array.isArray(u)?[]:{},oI(u,t,n,r[i])):r[i]=t}return r}function BZ(e,t){switch(t.type){case"SET_VALUES":return Bn({},e,{values:t.payload});case"SET_TOUCHED":return Bn({},e,{touched:t.payload});case"SET_ERRORS":return ki(e.errors,t.payload)?e:Bn({},e,{errors:t.payload});case"SET_STATUS":return Bn({},e,{status:t.payload});case"SET_ISSUBMITTING":return Bn({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Bn({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Bn({},e,{values:zi(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Bn({},e,{touched:zi(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Bn({},e,{errors:zi(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Bn({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Bn({},e,{touched:oI(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return Bn({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return Bn({},e,{isSubmitting:!1});default:return e}}var xi={},yf={};function HZ(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,o=r===void 0?!0:r,s=e.validateOnMount,i=s===void 0?!1:s,u=e.isInitialValid,d=e.enableReinitialize,p=d===void 0?!1:d,m=e.onSubmit,h=Ml(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),v=Bn({validateOnChange:n,validateOnBlur:o,validateOnMount:i,onSubmit:m},h),b=f.useRef(v.initialValues),w=f.useRef(v.initialErrors||xi),S=f.useRef(v.initialTouched||yf),C=f.useRef(v.initialStatus),_=f.useRef(!1),k=f.useRef({});f.useEffect(function(){return _.current=!0,function(){_.current=!1}},[]);var P=f.useState(0),E=P[1],I=f.useRef({values:v.initialValues,errors:v.initialErrors||xi,touched:v.initialTouched||yf,status:v.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),R=I.current,O=f.useCallback(function(Y){var Ce=I.current;I.current=BZ(Ce,Y),Ce!==I.current&&E(function(te){return te+1})},[]),D=f.useCallback(function(Y,Ce){return new Promise(function(te,fe){var Te=v.validate(Y,Ce);Te==null?te(xi):Zg(Te)?Te.then(function(Ke){te(Ke||xi)},function(Ke){fe(Ke)}):te(Te)})},[v.validate]),T=f.useCallback(function(Y,Ce){var te=v.validationSchema,fe=Io(te)?te(Ce):te,Te=Ce&&fe.validateAt?fe.validateAt(Ce,Y):WZ(Y,fe);return new Promise(function(Ke,bt){Te.then(function(){Ke(xi)},function(Xt){Xt.name==="ValidationError"?Ke(VZ(Xt)):bt(Xt)})})},[v.validationSchema]),$=f.useCallback(function(Y,Ce){return new Promise(function(te){return te(k.current[Y].validate(Ce))})},[]),B=f.useCallback(function(Y){var Ce=Object.keys(k.current).filter(function(fe){return Io(k.current[fe].validate)}),te=Ce.length>0?Ce.map(function(fe){return $(fe,Po(Y,fe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(te).then(function(fe){return fe.reduce(function(Te,Ke,bt){return Ke==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ke&&(Te=zi(Te,Ce[bt],Ke)),Te},{})})},[$]),ee=f.useCallback(function(Y){return Promise.all([B(Y),v.validationSchema?T(Y):{},v.validate?D(Y):{}]).then(function(Ce){var te=Ce[0],fe=Ce[1],Te=Ce[2],Ke=rv.all([te,fe,Te],{arrayMerge:UZ});return Ke})},[v.validate,v.validationSchema,B,D,T]),F=Ho(function(Y){return Y===void 0&&(Y=R.values),O({type:"SET_ISVALIDATING",payload:!0}),ee(Y).then(function(Ce){return _.current&&(O({type:"SET_ISVALIDATING",payload:!1}),O({type:"SET_ERRORS",payload:Ce})),Ce})});f.useEffect(function(){i&&_.current===!0&&ki(b.current,v.initialValues)&&F(b.current)},[i,F]);var N=f.useCallback(function(Y){var Ce=Y&&Y.values?Y.values:b.current,te=Y&&Y.errors?Y.errors:w.current?w.current:v.initialErrors||{},fe=Y&&Y.touched?Y.touched:S.current?S.current:v.initialTouched||{},Te=Y&&Y.status?Y.status:C.current?C.current:v.initialStatus;b.current=Ce,w.current=te,S.current=fe,C.current=Te;var Ke=function(){O({type:"RESET_FORM",payload:{isSubmitting:!!Y&&!!Y.isSubmitting,errors:te,touched:fe,status:Te,values:Ce,isValidating:!!Y&&!!Y.isValidating,submitCount:Y&&Y.submitCount&&typeof Y.submitCount=="number"?Y.submitCount:0}})};if(v.onReset){var bt=v.onReset(R.values,Ne);Zg(bt)?bt.then(Ke):Ke()}else Ke()},[v.initialErrors,v.initialStatus,v.initialTouched]);f.useEffect(function(){_.current===!0&&!ki(b.current,v.initialValues)&&p&&(b.current=v.initialValues,N(),i&&F(b.current))},[p,v.initialValues,N,i,F]),f.useEffect(function(){p&&_.current===!0&&!ki(w.current,v.initialErrors)&&(w.current=v.initialErrors||xi,O({type:"SET_ERRORS",payload:v.initialErrors||xi}))},[p,v.initialErrors]),f.useEffect(function(){p&&_.current===!0&&!ki(S.current,v.initialTouched)&&(S.current=v.initialTouched||yf,O({type:"SET_TOUCHED",payload:v.initialTouched||yf}))},[p,v.initialTouched]),f.useEffect(function(){p&&_.current===!0&&!ki(C.current,v.initialStatus)&&(C.current=v.initialStatus,O({type:"SET_STATUS",payload:v.initialStatus}))},[p,v.initialStatus,v.initialTouched]);var H=Ho(function(Y){if(k.current[Y]&&Io(k.current[Y].validate)){var Ce=Po(R.values,Y),te=k.current[Y].validate(Ce);return Zg(te)?(O({type:"SET_ISVALIDATING",payload:!0}),te.then(function(fe){return fe}).then(function(fe){O({type:"SET_FIELD_ERROR",payload:{field:Y,value:fe}}),O({type:"SET_ISVALIDATING",payload:!1})})):(O({type:"SET_FIELD_ERROR",payload:{field:Y,value:te}}),Promise.resolve(te))}else if(v.validationSchema)return O({type:"SET_ISVALIDATING",payload:!0}),T(R.values,Y).then(function(fe){return fe}).then(function(fe){O({type:"SET_FIELD_ERROR",payload:{field:Y,value:Po(fe,Y)}}),O({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),K=f.useCallback(function(Y,Ce){var te=Ce.validate;k.current[Y]={validate:te}},[]),A=f.useCallback(function(Y){delete k.current[Y]},[]),U=Ho(function(Y,Ce){O({type:"SET_TOUCHED",payload:Y});var te=Ce===void 0?o:Ce;return te?F(R.values):Promise.resolve()}),V=f.useCallback(function(Y){O({type:"SET_ERRORS",payload:Y})},[]),W=Ho(function(Y,Ce){var te=Io(Y)?Y(R.values):Y;O({type:"SET_VALUES",payload:te});var fe=Ce===void 0?n:Ce;return fe?F(te):Promise.resolve()}),re=f.useCallback(function(Y,Ce){O({type:"SET_FIELD_ERROR",payload:{field:Y,value:Ce}})},[]),be=Ho(function(Y,Ce,te){O({type:"SET_FIELD_VALUE",payload:{field:Y,value:Ce}});var fe=te===void 0?n:te;return fe?F(zi(R.values,Y,Ce)):Promise.resolve()}),ce=f.useCallback(function(Y,Ce){var te=Ce,fe=Y,Te;if(!Xg(Y)){Y.persist&&Y.persist();var Ke=Y.target?Y.target:Y.currentTarget,bt=Ke.type,Xt=Ke.name,ln=Ke.id,_n=Ke.value,pr=Ke.checked,cn=Ke.outerHTML,Un=Ke.options,Re=Ke.multiple;te=Ce||Xt||ln,fe=/number|range/.test(bt)?(Te=parseFloat(_n),isNaN(Te)?"":Te):/checkbox/.test(bt)?qZ(Po(R.values,te),pr,_n):Un&&Re?GZ(Un):_n}te&&be(te,fe)},[be,R.values]),se=Ho(function(Y){if(Xg(Y))return function(Ce){return ce(Ce,Y)};ce(Y)}),X=Ho(function(Y,Ce,te){Ce===void 0&&(Ce=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:Y,value:Ce}});var fe=te===void 0?o:te;return fe?F(R.values):Promise.resolve()}),ie=f.useCallback(function(Y,Ce){Y.persist&&Y.persist();var te=Y.target,fe=te.name,Te=te.id,Ke=te.outerHTML,bt=Ce||fe||Te;X(bt,!0)},[X]),de=Ho(function(Y){if(Xg(Y))return function(Ce){return ie(Ce,Y)};ie(Y)}),xe=f.useCallback(function(Y){Io(Y)?O({type:"SET_FORMIK_STATE",payload:Y}):O({type:"SET_FORMIK_STATE",payload:function(){return Y}})},[]),oe=f.useCallback(function(Y){O({type:"SET_STATUS",payload:Y})},[]),ve=f.useCallback(function(Y){O({type:"SET_ISSUBMITTING",payload:Y})},[]),he=Ho(function(){return O({type:"SUBMIT_ATTEMPT"}),F().then(function(Y){var Ce=Y instanceof Error,te=!Ce&&Object.keys(Y).length===0;if(te){var fe;try{if(fe=ge(),fe===void 0)return}catch(Te){throw Te}return Promise.resolve(fe).then(function(Te){return _.current&&O({type:"SUBMIT_SUCCESS"}),Te}).catch(function(Te){if(_.current)throw O({type:"SUBMIT_FAILURE"}),Te})}else if(_.current&&(O({type:"SUBMIT_FAILURE"}),Ce))throw Y})}),je=Ho(function(Y){Y&&Y.preventDefault&&Io(Y.preventDefault)&&Y.preventDefault(),Y&&Y.stopPropagation&&Io(Y.stopPropagation)&&Y.stopPropagation(),he().catch(function(Ce){console.warn("Warning: An unhandled error was caught from submitForm()",Ce)})}),Ne={resetForm:N,validateForm:F,validateField:H,setErrors:V,setFieldError:re,setFieldTouched:X,setFieldValue:be,setStatus:oe,setSubmitting:ve,setTouched:U,setValues:W,setFormikState:xe,submitForm:he},ge=Ho(function(){return m(R.values,Ne)}),Oe=Ho(function(Y){Y&&Y.preventDefault&&Io(Y.preventDefault)&&Y.preventDefault(),Y&&Y.stopPropagation&&Io(Y.stopPropagation)&&Y.stopPropagation(),N()}),at=f.useCallback(function(Y){return{value:Po(R.values,Y),error:Po(R.errors,Y),touched:!!Po(R.touched,Y),initialValue:Po(b.current,Y),initialTouched:!!Po(S.current,Y),initialError:Po(w.current,Y)}},[R.errors,R.touched,R.values]),Fe=f.useCallback(function(Y){return{setValue:function(te,fe){return be(Y,te,fe)},setTouched:function(te,fe){return X(Y,te,fe)},setError:function(te){return re(Y,te)}}},[be,X,re]),qe=f.useCallback(function(Y){var Ce=Yh(Y),te=Ce?Y.name:Y,fe=Po(R.values,te),Te={name:te,value:fe,onChange:se,onBlur:de};if(Ce){var Ke=Y.type,bt=Y.value,Xt=Y.as,ln=Y.multiple;Ke==="checkbox"?bt===void 0?Te.checked=!!fe:(Te.checked=!!(Array.isArray(fe)&&~fe.indexOf(bt)),Te.value=bt):Ke==="radio"?(Te.checked=fe===bt,Te.value=bt):Xt==="select"&&ln&&(Te.value=Te.value||[],Te.multiple=!0)}return Te},[de,se,R.values]),Pt=f.useMemo(function(){return!ki(b.current,R.values)},[b.current,R.values]),St=f.useMemo(function(){return typeof u<"u"?Pt?R.errors&&Object.keys(R.errors).length===0:u!==!1&&Io(u)?u(v):u:R.errors&&Object.keys(R.errors).length===0},[u,Pt,R.errors,v]),zn=Bn({},R,{initialValues:b.current,initialErrors:w.current,initialTouched:S.current,initialStatus:C.current,handleBlur:de,handleChange:se,handleReset:Oe,handleSubmit:je,resetForm:N,setErrors:V,setFormikState:xe,setFieldTouched:X,setFieldValue:be,setFieldError:re,setStatus:oe,setSubmitting:ve,setTouched:U,setValues:W,submitForm:he,validateForm:F,validateField:H,isValid:St,dirty:Pt,unregisterField:A,registerField:K,getFieldProps:qe,getFieldMeta:at,getFieldHelpers:Fe,validateOnBlur:o,validateOnChange:n,validateOnMount:i});return zn}function yy(e){var t=HZ(e),n=e.component,r=e.children,o=e.render,s=e.innerRef;return f.useImperativeHandle(s,function(){return t}),f.createElement(zZ,{value:t},n?f.createElement(n,t):o?o(t):r?Io(r)?r(t):FZ(r)?null:f.Children.only(r):null)}function VZ(e){var t={};if(e.inner){if(e.inner.length===0)return zi(t,e.path,e.message);for(var o=e.inner,n=Array.isArray(o),r=0,o=n?o:o[Symbol.iterator]();;){var s;if(n){if(r>=o.length)break;s=o[r++]}else{if(r=o.next(),r.done)break;s=r.value}var i=s;Po(t,i.path)||(t=zi(t,i.path,i.message))}}return t}function WZ(e,t,n,r){n===void 0&&(n=!1);var o=sv(e);return t[n?"validateSync":"validate"](o,{abortEarly:!1,context:r||o})}function sv(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(o){return Array.isArray(o)===!0||Ax(o)?sv(o):o!==""?o:void 0}):Ax(e[r])?t[r]=sv(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function UZ(e,t,n){var r=e.slice();return t.forEach(function(s,i){if(typeof r[i]>"u"){var u=n.clone!==!1,d=u&&n.isMergeableObject(s);r[i]=d?rv(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[i]=rv(e[i],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function GZ(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function qZ(e,t,n){if(typeof e=="boolean")return!!t;var r=[],o=!1,s=-1;if(Array.isArray(e))r=e,s=e.indexOf(n),o=s>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!o?r.concat(n):o?r.slice(0,s).concat(r.slice(s+1)):r}var KZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?f.useLayoutEffect:f.useEffect;function Ho(e){var t=f.useRef(e);return KZ(function(){t.current=e}),f.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current.apply(void 0,r)},[])}function po(e){var t=e.validate,n=e.name,r=e.render,o=e.children,s=e.as,i=e.component,u=Ml(e,["validate","name","render","children","as","component"]),d=rI(),p=Ml(d,["validate","validationSchema"]),m=p.registerField,h=p.unregisterField;f.useEffect(function(){return m(n,{validate:t}),function(){h(n)}},[m,h,n,t]);var v=p.getFieldProps(Bn({name:n},u)),b=p.getFieldMeta(n),w={field:v,form:p};if(r)return r(Bn({},w,{meta:b}));if(Io(o))return o(Bn({},w,{meta:b}));if(i){if(typeof i=="string"){var S=u.innerRef,C=Ml(u,["innerRef"]);return f.createElement(i,Bn({ref:S},v,C),o)}return f.createElement(i,Bn({field:v,form:p},u),o)}var _=s||"input";if(typeof _=="string"){var k=u.innerRef,P=Ml(u,["innerRef"]);return f.createElement(_,Bn({ref:k},v,P),o)}return f.createElement(_,Bn({},v,u),o)}var YZ=f.forwardRef(function(e,t){var n=e.action,r=Ml(e,["action"]),o=n??"#",s=rI(),i=s.handleReset,u=s.handleSubmit;return f.createElement("form",Bn({onSubmit:u,ref:t,onReset:i,action:o},r))});YZ.displayName="Form";const by=Ue.form;function fs({children:e}){const{colorMode:t}=Qr();return a.jsx(G,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:Pe("base.100","base.900")(t)},children:e})}const sI=we([yo],e=>{const{model_list:t}=e,n=[];return es(t,r=>{n.push(r.weights)}),n});function WC({model:e,modelsToAdd:t,setModelsToAdd:n}){const{t:r}=pe(),o=L(sI),s=i=>{t.includes(i.target.value)?n(kR(t,u=>u!==i.target.value)):n([...t,i.target.value])};return a.jsxs(G,{flexDirection:"column",gap:2,backgroundColor:t.includes(e.name)?"accent.650":"base.800",paddingX:4,paddingY:2,borderRadius:4,children:[a.jsxs(G,{gap:4,alignItems:"center",justifyContent:"space-between",children:[a.jsx(En,{value:e.name,label:a.jsx(tt,{fontWeight:500,children:e.name}),isChecked:t.includes(e.name),isDisabled:o.includes(e.location),onChange:s}),o.includes(e.location)&&a.jsx(Hi,{colorScheme:"accent",children:r("modelManager.modelExists")})]}),a.jsx(tt,{fontStyle:"italic",variant:"subtext",children:e.location})]})}function QZ(){const e=ne(),{t}=pe(),n=L(P=>P.system.searchFolder),r=L(P=>P.system.foundModels),o=L(sI),s=L(P=>P.ui.shouldShowExistingModelsInSearch),i=L(P=>P.system.isProcessing),[u,d]=z.useState([]),[p,m]=z.useState("v1"),[h,v]=z.useState(""),b=()=>{e(FO(null)),e(BO(null)),d([])},w=P=>{e(searchForModels(P.checkpointFolder))},S=()=>{d([]),r&&r.forEach(P=>{o.includes(P.location)||d(E=>[...E,P.name])})},C=()=>{d([])},_=()=>{const P=r==null?void 0:r.filter(I=>u.includes(I.name)),E={v1:"configs/stable-diffusion/v1-inference.yaml",v2_base:"configs/stable-diffusion/v2-inference-v.yaml",v2_768:"configs/stable-diffusion/v2-inference-v.yaml",inpainting:"configs/stable-diffusion/v1-inpainting-inference.yaml",custom:h};P==null||P.forEach(I=>{const R={name:I.name,description:"",config:E[p],weights:I.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(addNewModel(R))}),d([])},k=()=>{const P=[],E=[];return r&&r.forEach((I,R)=>{o.includes(I.location)?E.push(a.jsx(WC,{model:I,modelsToAdd:u,setModelsToAdd:d},R)):P.push(a.jsx(WC,{model:I,modelsToAdd:u,setModelsToAdd:d},R))}),a.jsxs(G,{flexDirection:"column",rowGap:4,children:[P,s&&E]})};return a.jsxs(a.Fragment,{children:[n?a.jsxs(G,{sx:{padding:4,gap:2,position:"relative",borderRadius:"base",alignItems:"center",w:"full",bg:"base.900"},children:[a.jsxs(G,{sx:{flexDir:"column",gap:2},children:[a.jsx(tt,{sx:{fontWeight:500},variant:"subtext",children:t("modelManager.checkpointFolder")}),a.jsx(tt,{sx:{fontWeight:500},children:n})]}),a.jsx(li,{}),a.jsx(Ae,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:a.jsx(L2,{}),fontSize:18,disabled:i,onClick:()=>e(searchForModels(n))}),a.jsx(Ae,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:a.jsx(mo,{}),onClick:b})]}):a.jsx(yy,{initialValues:{checkpointFolder:""},onSubmit:P=>{w(P)},children:({handleSubmit:P})=>a.jsx(by,{onSubmit:P,width:"100%",children:a.jsxs(ni,{columnGap:2,alignItems:"flex-end",children:[a.jsx(Vn,{flexGrow:1,children:a.jsx(po,{as:qr,id:"checkpointFolder",name:"checkpointFolder",type:"text",size:"md",label:t("modelManager.checkpointFolder")})}),a.jsx(Ut,{leftIcon:a.jsx(L2,{}),"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),type:"submit",disabled:i,px:8,children:t("modelManager.findModels")})]})})}),r&&a.jsxs(G,{flexDirection:"column",rowGap:4,width:"full",children:[a.jsxs(G,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs("p",{children:[t("modelManager.modelsFound"),": ",r.length]}),a.jsxs("p",{children:[t("modelManager.selected"),": ",u.length]})]}),a.jsxs(G,{columnGap:2,justifyContent:"space-between",children:[a.jsxs(G,{columnGap:2,children:[a.jsx(Ut,{isDisabled:u.length===r.length,onClick:S,children:t("modelManager.selectAll")}),a.jsx(Ut,{isDisabled:u.length===0,onClick:C,children:t("modelManager.deselectAll")}),a.jsx(En,{label:t("modelManager.showExisting"),isChecked:s,onChange:()=>e(LO(!s))})]}),a.jsx(Ut,{isDisabled:u.length===0,onClick:_,colorScheme:"accent",children:t("modelManager.addSelected")})]}),a.jsxs(G,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:[a.jsxs(G,{gap:4,children:[a.jsx(tt,{fontWeight:500,variant:"subtext",children:t("modelManager.pickModelType")}),a.jsx(o1,{value:p,onChange:P=>m(P),defaultValue:"v1",name:"model_type",children:a.jsxs(G,{gap:4,children:[a.jsx(Ws,{value:"v1",children:a.jsx(tt,{fontSize:"sm",children:t("modelManager.v1")})}),a.jsx(Ws,{value:"v2_base",children:a.jsx(tt,{fontSize:"sm",children:t("modelManager.v2_base")})}),a.jsx(Ws,{value:"v2_768",children:a.jsx(tt,{fontSize:"sm",children:t("modelManager.v2_768")})}),a.jsx(Ws,{value:"inpainting",children:a.jsx(tt,{fontSize:"sm",children:t("modelManager.inpainting")})}),a.jsx(Ws,{value:"custom",children:a.jsx(tt,{fontSize:"sm",children:t("modelManager.customConfig")})})]})})]}),p==="custom"&&a.jsxs(G,{flexDirection:"column",rowGap:2,children:[a.jsx(tt,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:t("modelManager.pathToCustomConfig")}),a.jsx(qr,{value:h,onChange:P=>{P.target.value!==""&&v(P.target.value)},width:"full"})]})]}),a.jsx(G,{flexDirection:"column",maxHeight:72,overflowY:"scroll",borderRadius:"sm",gap:2,children:r.length>0?k():a.jsx(tt,{fontWeight:"500",padding:2,borderRadius:"sm",textAlign:"center",variant:"subtext",children:t("modelManager.noModelsFound")})})]})]})}const UC=64,GC=2048;function XZ(){const e=ne(),{t}=pe(),n=L(p=>p.system.isProcessing);function r(p){return/\s/.test(p)}function o(p){let m;return r(p)&&(m=t("modelManager.cannotUseSpaces")),m}const s={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},i=p=>{e(addNewModel(p)),e(Ff(null))},[u,d]=z.useState(!1);return a.jsxs(_r,{gap:2,alignItems:"flex-start",children:[a.jsxs(G,{columnGap:4,children:[a.jsx(En,{isChecked:!u,label:t("modelManager.scanForModels"),onChange:()=>d(!u)}),a.jsx(En,{label:t("modelManager.addManually"),isChecked:u,onChange:()=>d(!u)})]}),u?a.jsx(yy,{initialValues:s,onSubmit:i,children:({handleSubmit:p,errors:m,touched:h})=>a.jsx(by,{onSubmit:p,sx:{w:"full"},children:a.jsxs(_r,{rowGap:2,children:[a.jsx(tt,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelManager.manual")}),a.jsx(fs,{children:a.jsxs(Vn,{isInvalid:!!m.name&&h.name,isRequired:!0,children:[a.jsx(Zn,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{as:qr,id:"name",name:"name",type:"text",validate:o,width:"full"}),m.name&&h.name?a.jsx(fo,{children:m.name}):a.jsx(Eo,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),a.jsx(fs,{children:a.jsxs(Vn,{isInvalid:!!m.description&&h.description,isRequired:!0,children:[a.jsx(Zn,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{as:qr,id:"description",name:"description",type:"text",width:"full"}),m.description&&h.description?a.jsx(fo,{children:m.description}):a.jsx(Eo,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),a.jsx(fs,{children:a.jsxs(Vn,{isInvalid:!!m.config&&h.config,isRequired:!0,children:[a.jsx(Zn,{htmlFor:"config",fontSize:"sm",children:t("modelManager.config")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{as:qr,id:"config",name:"config",type:"text",width:"full"}),m.config&&h.config?a.jsx(fo,{children:m.config}):a.jsx(Eo,{margin:0,children:t("modelManager.configValidationMsg")})]})]})}),a.jsx(fs,{children:a.jsxs(Vn,{isInvalid:!!m.weights&&h.weights,isRequired:!0,children:[a.jsx(Zn,{htmlFor:"config",fontSize:"sm",children:t("modelManager.modelLocation")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{as:qr,id:"weights",name:"weights",type:"text",width:"full"}),m.weights&&h.weights?a.jsx(fo,{children:m.weights}):a.jsx(Eo,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]})}),a.jsx(fs,{children:a.jsxs(Vn,{isInvalid:!!m.vae&&h.vae,children:[a.jsx(Zn,{htmlFor:"vae",fontSize:"sm",children:t("modelManager.vaeLocation")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{as:qr,id:"vae",name:"vae",type:"text",width:"full"}),m.vae&&h.vae?a.jsx(fo,{children:m.vae}):a.jsx(Eo,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]})}),a.jsxs(ni,{width:"100%",children:[a.jsx(fs,{children:a.jsxs(Vn,{isInvalid:!!m.width&&h.width,children:[a.jsx(Zn,{htmlFor:"width",fontSize:"sm",children:t("modelManager.width")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{id:"width",name:"width",children:({field:v,form:b})=>a.jsx(tc,{id:"width",name:"width",min:UC,max:GC,step:64,value:b.values.width,onChange:w=>b.setFieldValue(v.name,Number(w))})}),m.width&&h.width?a.jsx(fo,{children:m.width}):a.jsx(Eo,{margin:0,children:t("modelManager.widthValidationMsg")})]})]})}),a.jsx(fs,{children:a.jsxs(Vn,{isInvalid:!!m.height&&h.height,children:[a.jsx(Zn,{htmlFor:"height",fontSize:"sm",children:t("modelManager.height")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{id:"height",name:"height",children:({field:v,form:b})=>a.jsx(tc,{id:"height",name:"height",min:UC,max:GC,step:64,value:b.values.height,onChange:w=>b.setFieldValue(v.name,Number(w))})}),m.height&&h.height?a.jsx(fo,{children:m.height}):a.jsx(Eo,{margin:0,children:t("modelManager.heightValidationMsg")})]})]})})]}),a.jsx(Ut,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelManager.addModel")})]})})}):a.jsx(QZ,{})]})}function ZZ(){const e=ne(),{t}=pe(),n=L(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function o(u){let d;return r(u)&&(d=t("modelManager.cannotUseSpaces")),d}const s={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},i=u=>{const d=u;u.path===""&&delete d.path,u.repo_id===""&&delete d.repo_id,u.vae.path===""&&delete d.vae.path,u.vae.repo_id===""&&delete d.vae.repo_id,e(addNewModel(d)),e(Ff(null))};return a.jsx(G,{overflow:"scroll",maxHeight:window.innerHeight-270,width:"100%",children:a.jsx(yy,{initialValues:s,onSubmit:i,children:({handleSubmit:u,errors:d,touched:p})=>{var m,h,v,b,w,S,C,_,k,P;return a.jsx(by,{onSubmit:u,w:"full",children:a.jsxs(_r,{rowGap:2,children:[a.jsx(fs,{children:a.jsxs(Vn,{isInvalid:!!d.name&&p.name,isRequired:!0,children:[a.jsx(Zn,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{as:qr,id:"name",name:"name",type:"text",validate:o,isRequired:!0}),d.name&&p.name?a.jsx(fo,{children:d.name}):a.jsx(Eo,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),a.jsx(fs,{children:a.jsxs(Vn,{isInvalid:!!d.description&&p.description,isRequired:!0,children:[a.jsx(Zn,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{as:qr,id:"description",name:"description",type:"text",isRequired:!0}),d.description&&p.description?a.jsx(fo,{children:d.description}):a.jsx(Eo,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),a.jsxs(fs,{children:[a.jsx(tt,{fontWeight:"bold",fontSize:"sm",children:t("modelManager.formMessageDiffusersModelLocation")}),a.jsx(tt,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersModelLocationDesc")}),a.jsxs(Vn,{isInvalid:!!d.path&&p.path,children:[a.jsx(Zn,{htmlFor:"path",fontSize:"sm",children:t("modelManager.modelLocation")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{as:qr,id:"path",name:"path",type:"text"}),d.path&&p.path?a.jsx(fo,{children:d.path}):a.jsx(Eo,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),a.jsxs(Vn,{isInvalid:!!d.repo_id&&p.repo_id,children:[a.jsx(Zn,{htmlFor:"repo_id",fontSize:"sm",children:t("modelManager.repo_id")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{as:qr,id:"repo_id",name:"repo_id",type:"text"}),d.repo_id&&p.repo_id?a.jsx(fo,{children:d.repo_id}):a.jsx(Eo,{margin:0,children:t("modelManager.repoIDValidationMsg")})]})]})]}),a.jsxs(fs,{children:[a.jsx(tt,{fontWeight:"bold",children:t("modelManager.formMessageDiffusersVAELocation")}),a.jsx(tt,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersVAELocationDesc")}),a.jsxs(Vn,{isInvalid:!!((m=d.vae)!=null&&m.path)&&((h=p.vae)==null?void 0:h.path),children:[a.jsx(Zn,{htmlFor:"vae.path",fontSize:"sm",children:t("modelManager.vaeLocation")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{as:qr,id:"vae.path",name:"vae.path",type:"text"}),(v=d.vae)!=null&&v.path&&((b=p.vae)!=null&&b.path)?a.jsx(fo,{children:(w=d.vae)==null?void 0:w.path}):a.jsx(Eo,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),a.jsxs(Vn,{isInvalid:!!((S=d.vae)!=null&&S.repo_id)&&((C=p.vae)==null?void 0:C.repo_id),children:[a.jsx(Zn,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelManager.vaeRepoID")}),a.jsxs(_r,{alignItems:"start",children:[a.jsx(po,{as:qr,id:"vae.repo_id",name:"vae.repo_id",type:"text"}),(_=d.vae)!=null&&_.repo_id&&((k=p.vae)!=null&&k.repo_id)?a.jsx(fo,{children:(P=d.vae)==null?void 0:P.repo_id}):a.jsx(Eo,{margin:0,children:t("modelManager.vaeRepoIDValidationMsg")})]})]})]}),a.jsx(Ut,{type:"submit",isLoading:n,children:t("modelManager.addModel")})]})})}})})}function JZ(){const e=L(r=>r.ui.addNewModelUIOption);Qr();const t=ne(),{t:n}=pe();return a.jsxs(G,{flexDirection:"column",gap:4,children:[a.jsxs(G,{columnGap:4,children:[a.jsx(Ut,{onClick:()=>t(Ff("ckpt")),isChecked:e=="ckpt",children:n("modelManager.addCheckpointModel")}),a.jsx(Ut,{onClick:()=>t(Ff("diffusers")),isChecked:e=="diffusers",children:n("modelManager.addDiffuserModel")})]}),a.jsx(Ia,{}),e=="ckpt"&&a.jsx(XZ,{}),e=="diffusers"&&a.jsx(ZZ,{})]})}const eJ=[{label:"Stable Diffusion 1",value:"sd-1"},{label:"Stable Diffusion 2",value:"sd-2"}];function tJ(){const{t:e}=pe(),{colorMode:t}=Qr(),n=ne(),{data:r}=Kl(),[o,{isLoading:s}]=HO(),[i,u]=f.useState("sd-1"),d=Nx(r==null?void 0:r.entities,(N,H)=>(N==null?void 0:N.model_format)==="diffusers"&&(N==null?void 0:N.base_model)==="sd-1"),p=Nx(r==null?void 0:r.entities,(N,H)=>(N==null?void 0:N.model_format)==="diffusers"&&(N==null?void 0:N.base_model)==="sd-2"),m=f.useMemo(()=>({"sd-1":d,"sd-2":p}),[d,p]),[h,v]=f.useState(Object.keys(m[i])[0]),[b,w]=f.useState(Object.keys(m[i])[1]),[S,C]=f.useState(null),[_,k]=f.useState(""),[P,E]=f.useState(.5),[I,R]=f.useState("weighted_sum");f.useState("root"),f.useState("");const[O,D]=f.useState(!1),T=Object.keys(m[i]).filter(N=>N!==b&&N!==S),$=Object.keys(m[i]).filter(N=>N!==h&&N!==S),B=Object.keys(m[i]).filter(N=>N!==h&&N!==b),ee=N=>{u(N),v(null),w(null)},F=()=>{const N=[];let H=[h,b,S];H=H.filter(A=>A!==null),H.forEach(A=>{A&&N.push(A==null?void 0:A.split("/")[2])});const K={model_names:N,merged_model_name:_!==""?_:N.join("-"),alpha:P,interp:I,force:O};o({base_model:i,body:K}).unwrap().then(A=>{n(_s(ks({title:e("modelManager.modelsMerged"),status:"success"})))}).catch(A=>{A&&n(_s(ks({title:e("modelManager.modelsMergeFailed"),status:"error"})))})};return a.jsxs(G,{flexDirection:"column",rowGap:4,children:[a.jsxs(G,{sx:{flexDirection:"column",rowGap:1},children:[a.jsx(tt,{children:e("modelManager.modelMergeHeaderHelp1")}),a.jsx(tt,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),a.jsxs(G,{columnGap:4,children:[a.jsx(Ys,{label:"Model Type",w:"100%",data:eJ,value:i,onChange:ee}),a.jsx(gr,{label:e("modelManager.modelOne"),w:"100%",value:h,placeholder:e("modelManager.selectModel"),data:T,onChange:N=>v(N)}),a.jsx(gr,{label:e("modelManager.modelTwo"),w:"100%",placeholder:e("modelManager.selectModel"),value:b,data:$,onChange:N=>w(N)}),a.jsx(gr,{label:e("modelManager.modelThree"),data:B,w:"100%",placeholder:e("modelManager.selectModel"),clearable:!0,onChange:N=>{N?(C(N),R("weighted_sum")):(C(null),R("add_difference"))}})]}),a.jsx(qr,{label:e("modelManager.mergedModelName"),value:_,onChange:N=>k(N.target.value)}),a.jsxs(G,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:Pe("base.100","base.800")(t)},children:[a.jsx(yt,{label:e("modelManager.alpha"),min:.01,max:.99,step:.01,value:P,onChange:N=>E(N),withInput:!0,withReset:!0,handleReset:()=>E(.5),withSliderMarks:!0}),a.jsx(tt,{variant:"subtext",fontSize:"sm",children:e("modelManager.modelMergeAlphaHelp")})]}),a.jsxs(G,{sx:{padding:4,borderRadius:"base",gap:4,bg:Pe("base.100","base.800")(t)},children:[a.jsx(tt,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),a.jsx(o1,{value:I,onChange:N=>R(N),children:a.jsx(G,{columnGap:4,children:S===null?a.jsxs(a.Fragment,{children:[a.jsx(Ws,{value:"weighted_sum",children:a.jsx(tt,{fontSize:"sm",children:e("modelManager.weightedSum")})}),a.jsx(Ws,{value:"sigmoid",children:a.jsx(tt,{fontSize:"sm",children:e("modelManager.sigmoid")})}),a.jsx(Ws,{value:"inv_sigmoid",children:a.jsx(tt,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):a.jsx(Ws,{value:"add_difference",children:a.jsx(fr,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:a.jsx(tt,{fontSize:"sm",children:e("modelManager.addDifference")})})})})})]}),a.jsx(En,{label:e("modelManager.ignoreMismatch"),isChecked:O,onChange:N=>D(N.target.checked),fontWeight:"500"}),a.jsx(Ut,{onClick:F,isLoading:s,isDisabled:h===null||b===null,children:e("modelManager.merge")})]})}var nJ=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n};const qC=lc(nJ);function av(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,n)=>{const r=e[n];return r!=null&&r!==!1&&(t[n]=r),t},{})}var rJ=Object.defineProperty,KC=Object.getOwnPropertySymbols,oJ=Object.prototype.hasOwnProperty,sJ=Object.prototype.propertyIsEnumerable,YC=(e,t,n)=>t in e?rJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aJ=(e,t)=>{for(var n in t||(t={}))oJ.call(t,n)&&YC(e,n,t[n]);if(KC)for(var n of KC(t))sJ.call(t,n)&&YC(e,n,t[n]);return e};function aI(e,t){if(t===null||typeof t!="object")return{};const n=aJ({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const iJ="__MANTINE_FORM_INDEX__";function QC(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${iJ}`)):!1:!1}function XC(e,t,n){typeof n.value=="object"&&(n.value=Dl(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Dl(e){if(typeof e!="object")return e;var t=0,n,r,o,s=Object.prototype.toString.call(e);if(s==="[object Object]"?o=Object.create(e.__proto__||null):s==="[object Array]"?o=Array(e.length):s==="[object Set]"?(o=new Set,e.forEach(function(i){o.add(Dl(i))})):s==="[object Map]"?(o=new Map,e.forEach(function(i,u){o.set(Dl(u),Dl(i))})):s==="[object Date]"?o=new Date(+e):s==="[object RegExp]"?o=new RegExp(e.source,e.flags):s==="[object DataView]"?o=new e.constructor(Dl(e.buffer)):s==="[object ArrayBuffer]"?o=e.slice(0):s.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)XC(o,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(o,n=r[t])&&o[n]===e[n]||XC(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function iI(e){return typeof e!="string"?[]:e.split(".")}function Qh(e,t,n){const r=iI(e);if(r.length===0)return n;const o=Dl(n);if(r.length===1)return o[r[0]]=t,o;let s=o[r[0]];for(let i=1;i<r.length-1;i+=1){if(s===void 0)return o;s=s[r[i]]}return s[r[r.length-1]]=t,o}function ua(e,t){const n=iI(e);if(n.length===0||typeof t!="object"||t===null)return;let r=t[n[0]];for(let o=1;o<n.length&&r!==void 0;o+=1)r=r[n[o]];return r}function ZC(e){const t=av(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function iv(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,s)=>{const i=e[s],u=`${n===""?"":`${n}.`}${s}`,d=ua(u,t);let p=!1;return typeof i=="function"&&(o[u]=i(d,t,u)),typeof i=="object"&&Array.isArray(d)&&(p=!0,d.forEach((m,h)=>iv(i,t,`${u}.${h}`,o))),typeof i=="object"&&typeof d=="object"&&d!==null&&(p||iv(i,t,u,o)),o},r)}function lv(e,t){return ZC(typeof e=="function"?e(t):iv(e,t))}function bf(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=lv(t,n),o=Object.keys(r.errors).find(s=>e.split(".").every((i,u)=>i===s.split(".")[u]));return{hasError:!!o,error:o?r.errors[o]:null}}function lJ(e,{from:t,to:n},r){const o=ua(e,r);if(!Array.isArray(o))return r;const s=[...o],i=o[t];return s.splice(t,1),s.splice(n,0,i),Qh(e,s,r)}var cJ=Object.defineProperty,JC=Object.getOwnPropertySymbols,uJ=Object.prototype.hasOwnProperty,dJ=Object.prototype.propertyIsEnumerable,e4=(e,t,n)=>t in e?cJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fJ=(e,t)=>{for(var n in t||(t={}))uJ.call(t,n)&&e4(e,n,t[n]);if(JC)for(var n of JC(t))dJ.call(t,n)&&e4(e,n,t[n]);return e};function pJ(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,i=fJ({},r);return Object.keys(r).every(u=>{let d,p;if(u.startsWith(o)&&(d=u,p=u.replace(o,s)),u.startsWith(s)&&(d=u.replace(s,o),p=u),d&&p){const m=i[d],h=i[p];return h===void 0?delete i[d]:i[d]=h,m===void 0?delete i[p]:i[p]=m,!1}return!0}),i}function hJ(e,t,n){const r=ua(e,n);return Array.isArray(r)?Qh(e,r.filter((o,s)=>s!==t),n):n}var mJ=Object.defineProperty,t4=Object.getOwnPropertySymbols,gJ=Object.prototype.hasOwnProperty,vJ=Object.prototype.propertyIsEnumerable,n4=(e,t,n)=>t in e?mJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yJ=(e,t)=>{for(var n in t||(t={}))gJ.call(t,n)&&n4(e,n,t[n]);if(t4)for(var n of t4(t))vJ.call(t,n)&&n4(e,n,t[n]);return e};function r4(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function o4(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=aI(`${o}.${t}`,s));const i=yJ({},s),u=new Set;return Object.entries(s).filter(([d])=>{if(!d.startsWith(`${o}.`))return!1;const p=r4(d,o);return Number.isNaN(p)?!1:p>=t}).forEach(([d,p])=>{const m=r4(d,o),h=d.replace(`${o}.${m}`,`${o}.${m+r}`);i[h]=p,u.add(h),u.has(d)||delete i[d]}),i}function bJ(e,t,n,r){const o=ua(e,r);if(!Array.isArray(o))return r;const s=[...o];return s.splice(typeof n=="number"?n:s.length,0,t),Qh(e,s,r)}function s4(e,t){const n=Object.keys(e);if(typeof t=="string"){const r=n.filter(o=>o.startsWith(`${t}.`));return e[t]||r.some(o=>e[o])||!1}return n.some(r=>e[r])}function xJ(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n instanceof HTMLInputElement?n.type==="checkbox"?e(n.checked):e(n.value):(n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&e(n.value)}else e(t)}}var SJ=Object.defineProperty,wJ=Object.defineProperties,CJ=Object.getOwnPropertyDescriptors,a4=Object.getOwnPropertySymbols,_J=Object.prototype.hasOwnProperty,kJ=Object.prototype.propertyIsEnumerable,i4=(e,t,n)=>t in e?SJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wa=(e,t)=>{for(var n in t||(t={}))_J.call(t,n)&&i4(e,n,t[n]);if(a4)for(var n of a4(t))kJ.call(t,n)&&i4(e,n,t[n]);return e},Jg=(e,t)=>wJ(e,CJ(t));function lI({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:s=!1,validateInputOnBlur:i=!1,transformValues:u=p=>p,validate:d}={}){const[p,m]=f.useState(r),[h,v]=f.useState(n),[b,w]=f.useState(e),[S,C]=f.useState(av(t)),_=f.useRef(e),k=X=>{_.current=X},P=f.useCallback(()=>m({}),[]),E=X=>{const ie=X?Wa(Wa({},b),X):b;k(ie),v({})},I=f.useCallback(X=>C(ie=>av(typeof X=="function"?X(ie):X)),[]),R=f.useCallback(()=>C({}),[]),O=f.useCallback(()=>{w(e),R(),k(e),v({}),P()},[]),D=f.useCallback((X,ie)=>I(de=>Jg(Wa({},de),{[X]:ie})),[]),T=f.useCallback(X=>I(ie=>{if(typeof X!="string")return ie;const de=Wa({},ie);return delete de[X],de}),[]),$=f.useCallback(X=>v(ie=>{if(typeof X!="string")return ie;const de=aI(X,ie);return delete de[X],de}),[]),B=f.useCallback((X,ie)=>{const de=QC(X,s);$(X),m(xe=>Jg(Wa({},xe),{[X]:!0})),w(xe=>{const oe=Qh(X,ie,xe);if(de){const ve=bf(X,d,oe);ve.hasError?D(X,ve.error):T(X)}return oe}),!de&&o&&D(X,null)},[]),ee=f.useCallback(X=>{w(ie=>{const de=typeof X=="function"?X(ie):X;return Wa(Wa({},ie),de)}),o&&R()},[]),F=f.useCallback((X,ie)=>{$(X),w(de=>lJ(X,ie,de)),C(de=>pJ(X,ie,de))},[]),N=f.useCallback((X,ie)=>{$(X),w(de=>hJ(X,ie,de)),C(de=>o4(X,ie,de,-1))},[]),H=f.useCallback((X,ie,de)=>{$(X),w(xe=>bJ(X,ie,de,xe)),C(xe=>o4(X,de,xe,1))},[]),K=f.useCallback(()=>{const X=lv(d,b);return C(X.errors),X},[b,d]),A=f.useCallback(X=>{const ie=bf(X,d,b);return ie.hasError?D(X,ie.error):T(X),ie},[b,d]),U=(X,{type:ie="input",withError:de=!0,withFocus:xe=!0}={})=>{const ve={onChange:xJ(he=>B(X,he))};return de&&(ve.error=S[X]),ie==="checkbox"?ve.checked=ua(X,b):ve.value=ua(X,b),xe&&(ve.onFocus=()=>m(he=>Jg(Wa({},he),{[X]:!0})),ve.onBlur=()=>{if(QC(X,i)){const he=bf(X,d,b);he.hasError?D(X,he.error):T(X)}}),ve},V=(X,ie)=>de=>{de==null||de.preventDefault();const xe=K();xe.hasErrors?ie==null||ie(xe.errors,b,de):X==null||X(u(b),de)},W=X=>u(X||b),re=f.useCallback(X=>{X.preventDefault(),O()},[]),be=X=>{if(X){const de=ua(X,h);if(typeof de=="boolean")return de;const xe=ua(X,b),oe=ua(X,_.current);return!qC(xe,oe)}return Object.keys(h).length>0?s4(h):!qC(b,_.current)},ce=f.useCallback(X=>s4(p,X),[p]),se=f.useCallback(X=>X?!bf(X,d,b).hasError:!lv(d,b).hasErrors,[b,d]);return{values:b,errors:S,setValues:ee,setErrors:I,setFieldValue:B,setFieldError:D,clearFieldError:T,clearErrors:R,reset:O,validate:K,validateField:A,reorderListItem:F,removeListItem:N,insertListItem:H,getInputProps:U,onSubmit:V,onReset:re,isDirty:be,isTouched:ce,setTouched:m,setDirty:v,resetTouched:P,resetDirty:E,isValid:se,getTransformedValues:W}}function Ri(e){const{...t}=e,{base50:n,base100:r,base200:o,base300:s,base800:i,base700:u,base900:d,accent500:p,accent300:m}=Z1(),{colorMode:h}=Qr();return a.jsx(wP,{styles:()=>({input:{color:Pe(d,r)(h),backgroundColor:Pe(n,d)(h),borderColor:Pe(o,i)(h),borderWidth:2,outline:"none",":focus":{borderColor:Pe(m,p)(h)}},label:{color:Pe(u,s)(h),fontWeight:"normal"}}),...t})}const jJ=rt((e,t)=>{const{t:n}=pe(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:i,children:u,title:d,triggerComponent:p}=e,{isOpen:m,onOpen:h,onClose:v}=va(),b=f.useRef(null),w=()=>{o(),v()},S=()=>{i&&i(),v()};return a.jsxs(a.Fragment,{children:[f.cloneElement(p,{onClick:h,ref:t}),a.jsx(zu,{isOpen:m,leastDestructiveRef:b,onClose:v,isCentered:!0,children:a.jsx(Sa,{children:a.jsxs(Lu,{children:[a.jsx(xa,{fontSize:"lg",fontWeight:"bold",children:d}),a.jsx(wa,{children:u}),a.jsxs(ba,{children:[a.jsx(Ut,{ref:b,onClick:S,children:s}),a.jsx(Ut,{colorScheme:"error",onClick:w,ml:3,children:r})]})]})})})]})}),xy=f.memo(jJ);function PJ(e){const{model:t}=e,n=ne(),{t:r}=pe(),[o,{isLoading:s}]=VO(),[i,u]=f.useState("same");f.useState(""),f.useEffect(()=>{u("same")},[t]);const d=()=>{u("same")},p=()=>{const m={base_model:t.base_model,model_name:t.model_name};o(m).unwrap().then(h=>{n(_s(ks({title:`${r("modelManager.modelConverted")}: ${t.model_name}`,status:"success"})))}).catch(h=>{n(_s(ks({title:`${r("modelManager.modelConversionFailed")}: ${t.model_name}`,status:"error"})))})};return a.jsx(xy,{title:`${r("modelManager.convert")} ${t.model_name}`,acceptCallback:p,cancelCallback:d,acceptButtonText:`${r("modelManager.convert")}`,triggerComponent:a.jsxs(Ut,{size:"sm","aria-label":r("modelManager.convertToDiffusers"),className:" modal-close-btn",isLoading:s,children:["🧨 ",r("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:a.jsxs(G,{flexDirection:"column",rowGap:4,children:[a.jsx(tt,{children:r("modelManager.convertToDiffusersHelpText1")}),a.jsxs(fh,{children:[a.jsx(Oo,{children:r("modelManager.convertToDiffusersHelpText2")}),a.jsx(Oo,{children:r("modelManager.convertToDiffusersHelpText3")}),a.jsx(Oo,{children:r("modelManager.convertToDiffusersHelpText4")}),a.jsx(Oo,{children:r("modelManager.convertToDiffusersHelpText5")})]}),a.jsx(tt,{children:r("modelManager.convertToDiffusersHelpText6")})]})})}const IJ=[{value:"sd-1",label:Mr["sd-1"]},{value:"sd-2",label:Mr["sd-2"]}],EJ=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function OJ(e){const t=L(Fr),{model:n}=e,[r,{isLoading:o}]=p3(),s=ne(),{t:i}=pe(),u=lI({initialValues:{model_name:n.model_name?n.model_name:"",base_model:n.base_model,model_type:"main",path:n.path?n.path:"",description:n.description?n.description:"",model_format:"checkpoint",vae:n.vae?n.vae:"",config:n.config?n.config:"",variant:n.variant},validate:{path:p=>p.trim().length===0?"Must provide a path":null}}),d=f.useCallback(p=>{const m={base_model:n.base_model,model_name:n.model_name,body:p};r(m).unwrap().then(h=>{u.setValues(h),s(_s(ks({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(h=>{u.reset(),s(_s(ks({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[u,s,n.base_model,n.model_name,i,r]);return a.jsxs(G,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(G,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs(G,{flexDirection:"column",children:[a.jsx(tt,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(tt,{fontSize:"sm",color:"base.400",children:[Mr[n.base_model]," Model"]})]}),a.jsx(PJ,{model:n})]}),a.jsx(Ia,{}),a.jsx(G,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",children:a.jsx("form",{onSubmit:u.onSubmit(p=>d(p)),children:a.jsxs(G,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(Ri,{label:i("modelManager.description"),...u.getInputProps("description")}),a.jsx(Ys,{label:i("modelManager.baseModel"),data:IJ,...u.getInputProps("base_model")}),a.jsx(Ys,{label:i("modelManager.variant"),data:EJ,...u.getInputProps("variant")}),a.jsx(Ri,{label:i("modelManager.modelLocation"),...u.getInputProps("path")}),a.jsx(Ri,{label:i("modelManager.vaeLocation"),...u.getInputProps("vae")}),a.jsx(Ri,{label:i("modelManager.config"),...u.getInputProps("config")}),a.jsx(Ut,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})})]})}const RJ=[{value:"sd-1",label:Mr["sd-1"]},{value:"sd-2",label:Mr["sd-2"]}],MJ=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function DJ(e){const t=L(Fr),{model:n}=e,[r,{isLoading:o}]=p3(),s=ne(),{t:i}=pe(),u=lI({initialValues:{model_name:n.model_name?n.model_name:"",base_model:n.base_model,model_type:"main",path:n.path?n.path:"",description:n.description?n.description:"",model_format:"diffusers",vae:n.vae?n.vae:"",variant:n.variant},validate:{path:p=>p.trim().length===0?"Must provide a path":null}}),d=f.useCallback(p=>{const m={base_model:n.base_model,model_name:n.model_name,body:p};r(m).unwrap().then(h=>{u.setValues(h),s(_s(ks({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(h=>{u.reset(),s(_s(ks({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[u,s,n.base_model,n.model_name,i,r]);return a.jsxs(G,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(G,{flexDirection:"column",children:[a.jsx(tt,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(tt,{fontSize:"sm",color:"base.400",children:[Mr[n.base_model]," Model"]})]}),a.jsx(Ia,{}),a.jsx("form",{onSubmit:u.onSubmit(p=>d(p)),children:a.jsxs(G,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(Ri,{label:i("modelManager.description"),...u.getInputProps("description")}),a.jsx(Ys,{label:i("modelManager.baseModel"),data:RJ,...u.getInputProps("base_model")}),a.jsx(Ys,{label:i("modelManager.variant"),data:MJ,...u.getInputProps("variant")}),a.jsx(Ri,{label:i("modelManager.modelLocation"),...u.getInputProps("path")}),a.jsx(Ri,{label:i("modelManager.vaeLocation"),...u.getInputProps("vae")}),a.jsx(Ut,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})]})}function l4(e){const t=L(Fr),{t:n}=pe(),[r]=WO(),{model:o,isSelected:s,setSelectedModelId:i}=e,u=f.useCallback(()=>{i(o.id)},[o.id,i]),d=f.useCallback(()=>{r(o),i(void 0)},[r,o,i]);return a.jsxs(G,{sx:{gap:2,alignItems:"center",w:"full"},children:[a.jsx(G,{as:Ut,isChecked:s,sx:{justifyContent:"start",p:2,borderRadius:"base",w:"full",alignItems:"center",bg:s?"accent.400":"base.100",color:s?"base.50":"base.800",_hover:{bg:s?"accent.500":"base.200",color:s?"base.50":"base.800"},_dark:{color:s?"base.50":"base.100",bg:s?"accent.600":"base.850",_hover:{color:s?"base.50":"base.100",bg:s?"accent.550":"base.800"}}},onClick:u,children:a.jsx(fr,{label:o.description,hasArrow:!0,placement:"bottom",children:a.jsx(tt,{sx:{fontWeight:500},children:o.model_name})})}),a.jsx(xy,{title:n("modelManager.deleteModel"),acceptCallback:d,acceptButtonText:n("modelManager.delete"),triggerComponent:a.jsx(Ae,{icon:a.jsx(q$,{}),"aria-label":n("modelManager.deleteConfig"),isDisabled:t,colorScheme:"error"}),children:a.jsxs(G,{rowGap:4,flexDirection:"column",children:[a.jsx("p",{style:{fontWeight:"bold"},children:n("modelManager.deleteMsg1")}),a.jsx("p",{children:n("modelManager.deleteMsg2")})]})})]})}const TJ=e=>{const{selectedModelId:t,setSelectedModelId:n}=e,{t:r}=pe(),[o,s]=f.useState(""),[i,u]=f.useState("all"),{filteredDiffusersModels:d}=Kl(void 0,{selectFromResult:({data:h})=>({filteredDiffusersModels:c4(h,"diffusers",o)})}),{filteredCheckpointModels:p}=Kl(void 0,{selectFromResult:({data:h})=>({filteredCheckpointModels:c4(h,"checkpoint",o)})}),m=f.useCallback(h=>{s(h.target.value)},[]);return a.jsxs(G,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:[a.jsx(qr,{onChange:m,label:r("modelManager.search")}),a.jsxs(G,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-240,overflow:"scroll",paddingInlineEnd:4,children:[a.jsxs(dr,{isAttached:!0,children:[a.jsx(Ut,{onClick:()=>u("all"),isChecked:i==="all",size:"sm",children:r("modelManager.allModels")}),a.jsx(Ut,{size:"sm",onClick:()=>u("diffusers"),isChecked:i==="diffusers",children:r("modelManager.diffusersModels")}),a.jsx(Ut,{size:"sm",onClick:()=>u("checkpoint"),isChecked:i==="checkpoint",children:r("modelManager.checkpointModels")})]}),["all","diffusers"].includes(i)&&d.length>0&&a.jsxs(G,{sx:{gap:2,flexDir:"column"},children:[a.jsx(tt,{variant:"subtext",fontSize:"sm",children:"Diffusers"}),d.map(h=>a.jsx(l4,{model:h,isSelected:t===h.id,setSelectedModelId:n},h.id))]}),["all","checkpoint"].includes(i)&&p.length>0&&a.jsxs(G,{sx:{gap:2,flexDir:"column"},children:[a.jsx(tt,{variant:"subtext",fontSize:"sm",children:"Checkpoint"}),p.map(h=>a.jsx(l4,{model:h,isSelected:t===h.id,setSelectedModelId:n},h.id))]})]})]})},c4=(e,t,n)=>{const r=[];return es(e==null?void 0:e.entities,o=>{if(!o)return;const s=o.model_name.toLowerCase().includes(n.toLowerCase()),i=o.model_format===t;s&&i&&r.push(o)}),r};function AJ(){const[e,t]=f.useState(),{model:n}=Kl(void 0,{selectFromResult:({data:r})=>({model:e?r==null?void 0:r.entities[e]:void 0})});return a.jsxs(G,{sx:{gap:8,w:"full",h:"full"},children:[a.jsx(TJ,{selectedModelId:e,setSelectedModelId:t}),a.jsx(NJ,{model:n})]})}const NJ=e=>{const{model:t}=e;return(t==null?void 0:t.model_format)==="checkpoint"?a.jsx(OJ,{model:t},t.id):(t==null?void 0:t.model_format)==="diffusers"?a.jsx(DJ,{model:t},t.id):a.jsx(G,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",maxH:96,userSelect:"none"},children:a.jsx(tt,{variant:"subtext",children:"No Model Selected"})})},u4=[{id:"modelManager",label:wr.t("modelManager.modelManager"),content:a.jsx(AJ,{})},{id:"addModels",label:wr.t("modelManager.addModel"),content:a.jsx(JZ,{})},{id:"mergeModels",label:wr.t("modelManager.mergeModels"),content:a.jsx(tJ,{})}],$J=()=>a.jsxs(xh,{isLazy:!0,variant:"line",layerStyle:"first",sx:{w:"full",h:"full",p:4,gap:4,borderRadius:"base"},children:[a.jsx(Sh,{children:u4.map(e=>a.jsx(_h,{sx:{borderTopRadius:"base"},children:e.label},e.id))}),a.jsx(Ch,{sx:{w:"full",h:"full",p:4},children:u4.map(e=>a.jsx(wh,{sx:{w:"full",h:"full"},children:e.content},e.id))})]}),zJ=f.memo($J);const LJ=e=>we([t=>t.nodes],t=>{const n=t.invocationTemplates[e];if(n)return n},{memoizeOptions:{resultEqualityCheck:(t,n)=>t!==void 0&&n!==void 0&&t.type===n.type}}),FJ=(e,t)=>{const n={id:e,name:t.name,type:t.type};return t.inputRequirement!=="never"&&(t.type==="string"&&(n.value=t.default??""),t.type==="integer"&&(n.value=t.default??0),t.type==="float"&&(n.value=t.default??0),t.type==="boolean"&&(n.value=t.default??!1),t.type==="enum"&&(t.enumType==="number"&&(n.value=t.default??0),t.enumType==="string"&&(n.value=t.default??"")),t.type==="array"&&(n.value=t.default??1),t.type==="image"&&(n.value=void 0),t.type==="image_collection"&&(n.value=[]),t.type==="latents"&&(n.value=void 0),t.type==="conditioning"&&(n.value=void 0),t.type==="unet"&&(n.value=void 0),t.type==="clip"&&(n.value=void 0),t.type==="vae"&&(n.value=void 0),t.type==="control"&&(n.value=void 0),t.type==="model"&&(n.value=void 0),t.type==="vae_model"&&(n.value=void 0),t.type==="lora_model"&&(n.value=void 0),t.type==="controlnet_model"&&(n.value=void 0)),n},BJ=we([e=>e.nodes],e=>e.invocationTemplates),Sy="node-drag-handle",d4={dragHandle:`.${Sy}`},HJ=()=>{const e=L(BJ),t=ih();return f.useCallback(n=>{if(n==="progress_image"){const{x:m,y:h}=t.project({x:window.innerWidth/2.5,y:window.innerHeight/8});return{...d4,id:"progress_image",type:"progress_image",position:{x:m,y:h},data:{}}}const r=e[n];if(r===void 0){console.error(`Unable to find template ${n}.`);return}const o=ei(),s=$x(r.inputs,(m,h,v)=>{const b=ei(),w=FJ(b,h);return m[v]=w,m},{}),i=$x(r.outputs,(m,h,v)=>{const w={id:ei(),name:v,type:h.type};return m[v]=w,m},{}),{x:u,y:d}=t.project({x:window.innerWidth/2.5,y:window.innerHeight/8});return{...d4,id:o,type:"invocation",position:{x:u,y:d},data:{id:o,type:n,inputs:s,outputs:i}}},[e,t])},VJ=e=>{const{nodeId:t,title:n,description:r}=e;return a.jsxs(G,{className:Sy,sx:{borderTopRadius:"md",alignItems:"center",justifyContent:"space-between",px:2,py:1,bg:"base.300",_dark:{bg:"base.700"}},children:[a.jsx(fr,{label:t,children:a.jsx(ca,{size:"xs",sx:{fontWeight:600,color:"base.900",_dark:{color:"base.100"}},children:n})}),a.jsx(fr,{label:r,placement:"top",hasArrow:!0,shouldWrapChildren:!0,children:a.jsx(oo,{sx:{h:"min-content",color:"base.700",_dark:{color:"base.300"}},as:M$})})]})},cI=f.memo(VJ),uI=()=>{const e=ih();return f.useCallback(({source:n,sourceHandle:r,target:o,targetHandle:s})=>(e.getEdges(),e.getNodes(),!0),[e])},WJ={position:"absolute",width:"1rem",height:"1rem",borderWidth:0},UJ={left:"-1rem"},GJ={right:"-0.5rem"},qJ=e=>{const{field:t,isValidConnection:n,handleType:r,styles:o}=e,{name:s,type:i}=t;return a.jsx(fr,{label:i,placement:r==="target"?"start":"end",hasArrow:!0,openDelay:h3,children:a.jsx(UO,{type:r,id:s,isValidConnection:n,position:r==="target"?zx.Left:zx.Right,style:{backgroundColor:m3[i].colorCssVar,...o,...WJ,...r==="target"?UJ:GJ}})})},dI=f.memo(qJ),KJ=e=>a.jsx(T$,{}),YJ=f.memo(KJ),QJ=e=>{const{nodeId:t,field:n}=e,r=ne(),o=s=>{r(Jo({nodeId:t,fieldName:n.name,value:s.target.checked}))};return a.jsx(s1,{onChange:o,isChecked:n.value})},XJ=f.memo(QJ),ZJ=e=>null,JJ=f.memo(ZJ);function Xh(){return(Xh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function fI(e,t){if(e==null)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)t.indexOf(n=s[r])>=0||(o[n]=e[n]);return o}function cv(e){var t=f.useRef(e),n=f.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var ic=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},du=function(e){return"touches"in e},uv=function(e){return e&&e.ownerDocument.defaultView||self},f4=function(e,t,n){var r=e.getBoundingClientRect(),o=du(t)?function(s,i){for(var u=0;u<s.length;u++)if(s[u].identifier===i)return s[u];return s[0]}(t.touches,n):t;return{left:ic((o.pageX-(r.left+uv(e).pageXOffset))/r.width),top:ic((o.pageY-(r.top+uv(e).pageYOffset))/r.height)}},p4=function(e){!du(e)&&e.preventDefault()},wy=z.memo(function(e){var t=e.onMove,n=e.onKey,r=fI(e,["onMove","onKey"]),o=f.useRef(null),s=cv(t),i=cv(n),u=f.useRef(null),d=f.useRef(!1),p=f.useMemo(function(){var b=function(C){p4(C),(du(C)?C.touches.length>0:C.buttons>0)&&o.current?s(f4(o.current,C,u.current)):S(!1)},w=function(){return S(!1)};function S(C){var _=d.current,k=uv(o.current),P=C?k.addEventListener:k.removeEventListener;P(_?"touchmove":"mousemove",b),P(_?"touchend":"mouseup",w)}return[function(C){var _=C.nativeEvent,k=o.current;if(k&&(p4(_),!function(E,I){return I&&!du(E)}(_,d.current)&&k)){if(du(_)){d.current=!0;var P=_.changedTouches||[];P.length&&(u.current=P[0].identifier)}k.focus(),s(f4(k,_,u.current)),S(!0)}},function(C){var _=C.which||C.keyCode;_<37||_>40||(C.preventDefault(),i({left:_===39?.05:_===37?-.05:0,top:_===40?.05:_===38?-.05:0}))},S]},[i,s]),m=p[0],h=p[1],v=p[2];return f.useEffect(function(){return v},[v]),z.createElement("div",Xh({},r,{onTouchStart:m,onMouseDown:m,className:"react-colorful__interactive",ref:o,onKeyDown:h,tabIndex:0,role:"slider"}))}),Zh=function(e){return e.filter(Boolean).join(" ")},Cy=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=Zh(["react-colorful__pointer",e.className]);return z.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},z.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},so=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},pI=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:so(e.h),s:so(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:so(o/2),a:so(r,2)}},dv=function(e){var t=pI(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},e0=function(e){var t=pI(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},eee=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var s=Math.floor(t),i=r*(1-n),u=r*(1-(t-s)*n),d=r*(1-(1-t+s)*n),p=s%6;return{r:so(255*[r,u,i,i,d,r][p]),g:so(255*[d,r,r,u,i,i][p]),b:so(255*[i,i,d,r,r,u][p]),a:so(o,2)}},tee=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),i=s-Math.min(t,n,r),u=i?s===t?(n-r)/i:s===n?2+(r-t)/i:4+(t-n)/i:0;return{h:so(60*(u<0?u+6:u)),s:so(s?i/s*100:0),v:so(s/255*100),a:o}},nee=z.memo(function(e){var t=e.hue,n=e.onChange,r=Zh(["react-colorful__hue",e.className]);return z.createElement("div",{className:r},z.createElement(wy,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:ic(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":so(t),"aria-valuemax":"360","aria-valuemin":"0"},z.createElement(Cy,{className:"react-colorful__hue-pointer",left:t/360,color:dv({h:t,s:100,v:100,a:1})})))}),ree=z.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:dv({h:t.h,s:100,v:100,a:1})};return z.createElement("div",{className:"react-colorful__saturation",style:r},z.createElement(wy,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:ic(t.s+100*o.left,0,100),v:ic(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+so(t.s)+"%, Brightness "+so(t.v)+"%"},z.createElement(Cy,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:dv(t)})))}),hI=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function oee(e,t,n){var r=cv(n),o=f.useState(function(){return e.toHsva(t)}),s=o[0],i=o[1],u=f.useRef({color:t,hsva:s});f.useEffect(function(){if(!e.equal(t,u.current.color)){var p=e.toHsva(t);u.current={hsva:p,color:t},i(p)}},[t,e]),f.useEffect(function(){var p;hI(s,u.current.hsva)||e.equal(p=e.fromHsva(s),u.current.color)||(u.current={hsva:s,color:p},r(p))},[s,e,r]);var d=f.useCallback(function(p){i(function(m){return Object.assign({},m,p)})},[]);return[s,d]}var see=typeof window<"u"?f.useLayoutEffect:f.useEffect,aee=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},h4=new Map,iee=function(e){see(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!h4.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,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,h4.set(t,n);var r=aee();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},lee=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+e0(Object.assign({},n,{a:0}))+", "+e0(Object.assign({},n,{a:1}))+")"},s=Zh(["react-colorful__alpha",t]),i=so(100*n.a);return z.createElement("div",{className:s},z.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),z.createElement(wy,{onMove:function(u){r({a:u.left})},onKey:function(u){r({a:ic(n.a+u.left)})},"aria-label":"Alpha","aria-valuetext":i+"%","aria-valuenow":i,"aria-valuemin":"0","aria-valuemax":"100"},z.createElement(Cy,{className:"react-colorful__alpha-pointer",left:n.a,color:e0(n)})))},cee=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,i=fI(e,["className","colorModel","color","onChange"]),u=f.useRef(null);iee(u);var d=oee(n,o,s),p=d[0],m=d[1],h=Zh(["react-colorful",t]);return z.createElement("div",Xh({},i,{ref:u,className:h}),z.createElement(ree,{hsva:p,onChange:m}),z.createElement(nee,{hue:p.h,onChange:m}),z.createElement(lee,{hsva:p,onChange:m,className:"react-colorful__last-control"}))},uee={defaultColor:{r:0,g:0,b:0,a:1},toHsva:tee,fromHsva:eee,equal:hI},mI=function(e){return z.createElement(cee,Xh({},e,{colorModel:uee}))};const dee=e=>{const{nodeId:t,field:n}=e,r=ne(),o=s=>{r(Jo({nodeId:t,fieldName:n.name,value:s}))};return a.jsx(mI,{className:"nodrag",color:n.value,onChange:o})},fee=f.memo(dee),pee=e=>null,hee=f.memo(pee),mee=e=>null,gee=f.memo(mee),vee=e=>{const{nodeId:t,field:n}=e,r=n.value,o=ne();pe();const{data:s}=Ev(),i=f.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/controlnet/${r==null?void 0:r.model_name}`])??null,[r==null?void 0:r.base_model,r==null?void 0:r.model_name,s==null?void 0:s.entities]),u=f.useMemo(()=>{if(!s)return[];const p=[];return es(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:Mr[m.base_model]})}),p},[s]),d=f.useCallback(p=>{if(!p)return;const m=UP(p);m&&o(Jo({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(Ys,{tooltip:i==null?void 0:i.description,label:(i==null?void 0:i.base_model)&&Mr[i==null?void 0:i.base_model],value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:u,onChange:d})},yee=f.memo(vee),bee=e=>{const{nodeId:t,field:n,template:r}=e,o=ne(),s=i=>{o(Jo({nodeId:t,fieldName:n.name,value:i.target.value}))};return a.jsx(g5,{onChange:s,value:n.value,children:r.options.map(i=>a.jsx("option",{children:i},i))})},xee=f.memo(bee),See=e=>{var p;const{nodeId:t,field:n}=e,r=ne();f.useCallback(({image_name:m})=>{r(Jo({nodeId:t,fieldName:n.name,value:GO([...n.value??[],{image_name:m}],"image_name")}))},[r,n.name,n.value,t]);const o={id:`node-${t}-${n.name}`,actionType:"SET_MULTI_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}},{isOver:s,setNodeRef:i,active:u,over:d}=wv({id:`node_${t}`,data:o});return f.useCallback(()=>{r(Jo({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),a.jsxs(G,{ref:i,sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",position:"relative",minH:"10rem"},children:[(p=n.value)==null?void 0:p.map(({image_name:m})=>a.jsx(Cee,{imageName:m},m)),Mf(o,u)&&a.jsx(sp,{isOver:s})]})},wee=f.memo(See),Cee=e=>{const{currentData:t}=Cs(e.imageName);return a.jsx(si,{imageDTO:t,isDropDisabled:!0,isDragDisabled:!0})},_ee=e=>{var v;const{nodeId:t,field:n}=e,r=ne(),{currentData:o,isLoading:s,isError:i,isSuccess:u}=Cs(((v=n.value)==null?void 0:v.image_name)??Yo.skipToken),d=f.useCallback(()=>{r(Jo({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),p=f.useMemo(()=>{if(o)return{id:`node-${t}-${n.name}`,payloadType:"IMAGE_DTO",payload:{imageDTO:o}}},[n.name,o,t]),m=f.useMemo(()=>({id:`node-${t}-${n.name}`,actionType:"SET_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}}),[n.name,t]),h=f.useMemo(()=>({type:"SET_NODES_IMAGE",nodeId:t,fieldName:n.name}),[t,n.name]);return a.jsx(G,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(si,{imageDTO:o,droppableData:m,draggableData:p,onClickReset:d,postUploadAction:h})})},kee=f.memo(_ee),jee=e=>a.jsx(d$,{}),m4=f.memo(jee),Pee=e=>null,Iee=f.memo(Pee),Eee=ah.child({module:"models"}),Oee=e=>{const[t,n,r]=e.split("/"),o=qO.safeParse({base_model:t,model_name:r});if(!o.success){Eee.error({loraModelId:e,errors:o.error.format()},"Failed to parse LoRA model id");return}return o.data},Ree=e=>{const{nodeId:t,field:n}=e,r=n.value,o=ne(),{data:s}=r3(),i=f.useMemo(()=>{if(!s)return[];const p=[];return es(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:Mr[m.base_model]})}),p.sort((m,h)=>m.disabled&&!h.disabled?1:-1)},[s]),u=f.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/lora/${r==null?void 0:r.model_name}`])??null,[s==null?void 0:s.entities,r==null?void 0:r.base_model,r==null?void 0:r.model_name]),d=f.useCallback(p=>{if(!p)return;const m=Oee(p);m&&o(Jo({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return(s==null?void 0:s.ids.length)===0?a.jsx(G,{sx:{justifyContent:"center",p:2},children:a.jsx(tt,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(gr,{value:(u==null?void 0:u.id)??null,label:(u==null?void 0:u.base_model)&&Mr[u==null?void 0:u.base_model],placeholder:i.length>0?"Select a LoRA":"No LoRAs available",data:i,nothingFound:"No matching LoRAs",itemComponent:Sc,disabled:i.length===0,filter:(p,m)=>{var h;return((h=m.label)==null?void 0:h.toLowerCase().includes(p.toLowerCase().trim()))||m.value.toLowerCase().includes(p.toLowerCase().trim())},onChange:d})},Mee=f.memo(Ree),Dee=e=>{var m,h;const{nodeId:t,field:n}=e,r=ne(),{t:o}=pe(),{data:s,isLoading:i}=Kl(),u=f.useMemo(()=>{if(!s)return[];const v=[];return es(s.entities,(b,w)=>{b&&v.push({value:w,label:b.model_name,group:Mr[b.base_model]})}),v},[s]),d=f.useMemo(()=>{var v,b;return(s==null?void 0:s.entities[`${(v=n.value)==null?void 0:v.base_model}/main/${(b=n.value)==null?void 0:b.model_name}`])??null},[(m=n.value)==null?void 0:m.base_model,(h=n.value)==null?void 0:h.model_name,s==null?void 0:s.entities]),p=f.useCallback(v=>{if(!v)return;const b=ZP(v);b&&r(Jo({nodeId:t,fieldName:n.name,value:b}))},[r,n.name,t]);return i?a.jsx(gr,{label:o("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsx(gr,{tooltip:d==null?void 0:d.description,label:(d==null?void 0:d.base_model)&&Mr[d==null?void 0:d.base_model],value:d==null?void 0:d.id,placeholder:u.length>0?"Select a model":"No models available",data:u,error:u.length===0,disabled:u.length===0,onChange:p})},Tee=f.memo(Dee),Aee=e=>{const{nodeId:t,field:n}=e,r=ne(),[o,s]=f.useState(String(n.value)),i=u=>{s(u),u.match(Qp)||r(Jo({nodeId:t,fieldName:n.name,value:e.template.type==="integer"?Math.floor(Number(u)):Number(u)}))};return f.useEffect(()=>{!o.match(Qp)&&n.value!==Number(o)&&s(String(n.value))},[n.value,o]),a.jsxs(s3,{onChange:i,value:o,step:e.template.type==="integer"?1:.1,precision:e.template.type==="integer"?0:3,children:[a.jsx(a3,{}),a.jsxs(i3,{children:[a.jsx(l3,{}),a.jsx(c3,{})]})]})},Nee=f.memo(Aee),$ee=e=>{const{nodeId:t,field:n}=e,r=ne(),o=s=>{r(Jo({nodeId:t,fieldName:n.name,value:s.target.value}))};return a.jsx(Tu,{onChange:o,value:n.value})},zee=f.memo($ee),Lee=e=>null,Fee=f.memo(Lee),Bee=e=>null,Hee=f.memo(Bee),Vee=e=>{const{nodeId:t,field:n}=e,r=n.value,o=ne();pe();const{data:s}=u3(),i=f.useMemo(()=>{if(!s)return[];const p=[{value:"default",label:"Default",group:"Default"}];return es(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:Mr[m.base_model]})}),p.sort((m,h)=>m.disabled&&!h.disabled?1:-1)},[s]),u=f.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/vae/${r==null?void 0:r.model_name}`])??null,[s==null?void 0:s.entities,r]),d=f.useCallback(p=>{if(!p)return;const m=JP(p);m&&o(Jo({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(gr,{itemComponent:Sc,tooltip:u==null?void 0:u.description,label:(u==null?void 0:u.base_model)&&Mr[u==null?void 0:u.base_model],value:(u==null?void 0:u.id)??"default",placeholder:"Default",data:i,onChange:d,disabled:i.length===0,clearable:!0})},Wee=f.memo(Vee),Uee=e=>{const{nodeId:t,field:n,template:r}=e,{type:o}=n;return o==="string"&&r.type==="string"?a.jsx(zee,{nodeId:t,field:n,template:r}):o==="boolean"&&r.type==="boolean"?a.jsx(XJ,{nodeId:t,field:n,template:r}):o==="integer"&&r.type==="integer"||o==="float"&&r.type==="float"?a.jsx(Nee,{nodeId:t,field:n,template:r}):o==="enum"&&r.type==="enum"?a.jsx(xee,{nodeId:t,field:n,template:r}):o==="image"&&r.type==="image"?a.jsx(kee,{nodeId:t,field:n,template:r}):o==="latents"&&r.type==="latents"?a.jsx(Iee,{nodeId:t,field:n,template:r}):o==="conditioning"&&r.type==="conditioning"?a.jsx(hee,{nodeId:t,field:n,template:r}):o==="unet"&&r.type==="unet"?a.jsx(Fee,{nodeId:t,field:n,template:r}):o==="clip"&&r.type==="clip"?a.jsx(JJ,{nodeId:t,field:n,template:r}):o==="vae"&&r.type==="vae"?a.jsx(Hee,{nodeId:t,field:n,template:r}):o==="control"&&r.type==="control"?a.jsx(gee,{nodeId:t,field:n,template:r}):o==="model"&&r.type==="model"?a.jsx(Tee,{nodeId:t,field:n,template:r}):o==="vae_model"&&r.type==="vae_model"?a.jsx(Wee,{nodeId:t,field:n,template:r}):o==="lora_model"&&r.type==="lora_model"?a.jsx(Mee,{nodeId:t,field:n,template:r}):o==="controlnet_model"&&r.type==="controlnet_model"?a.jsx(yee,{nodeId:t,field:n,template:r}):o==="array"&&r.type==="array"?a.jsx(YJ,{nodeId:t,field:n,template:r}):o==="item"&&r.type==="item"?a.jsx(m4,{nodeId:t,field:n,template:r}):o==="color"&&r.type==="color"?a.jsx(fee,{nodeId:t,field:n,template:r}):o==="item"&&r.type==="item"?a.jsx(m4,{nodeId:t,field:n,template:r}):o==="image_collection"&&r.type==="image_collection"?a.jsx(wee,{nodeId:t,field:n,template:r}):a.jsxs(Be,{p:2,children:["Unknown field type: ",o]})},Gee=f.memo(Uee);function qee(e){const{nodeId:t,input:n,template:r,connected:o}=e,s=uI();return a.jsx(Be,{className:"nopan",position:"relative",borderColor:r?!o&&["always","connectionOnly"].includes(String(r==null?void 0:r.inputRequirement))&&n.value===void 0?"warning.400":void 0:"error.400",children:a.jsx(Vn,{isDisabled:r?o:!0,pl:2,children:r?a.jsxs(a.Fragment,{children:[a.jsxs(ni,{justifyContent:"space-between",alignItems:"center",children:[a.jsx(ni,{children:a.jsx(fr,{label:r==null?void 0:r.description,placement:"top",hasArrow:!0,shouldWrapChildren:!0,openDelay:h3,children:a.jsx(Zn,{children:r==null?void 0:r.title})})}),a.jsx(Gee,{nodeId:t,field:n,template:r})]}),!["never","directOnly"].includes((r==null?void 0:r.inputRequirement)??"")&&a.jsx(dI,{nodeId:t,field:r,isValidConnection:s,handleType:"target"})]}):a.jsx(ni,{justifyContent:"space-between",alignItems:"center",children:a.jsxs(Zn,{children:["Unknown input: ",n.name]})})})})}const Kee=e=>{const{nodeId:t,template:n,inputs:r}=e,o=L(i=>i.nodes.edges);return f.useCallback(()=>{const i=[],u=Xs(r);return u.forEach((d,p)=>{const m=n.inputs[d.name],h=!!o.filter(v=>v.target===t&&v.targetHandle===d.name).length;p<u.length&&i.push(a.jsx(Ia,{},`${d.id}.divider`)),i.push(a.jsx(qee,{nodeId:t,input:d,template:m,connected:h},d.id))}),a.jsx(G,{className:"nopan",flexDir:"column",gap:2,p:2,children:i})},[o,r,t,n.inputs])()},Yee=f.memo(Kee);function Qee(e){const{nodeId:t,output:n,template:r,connected:o}=e,s=uI();return a.jsx(Be,{position:"relative",children:a.jsx(Vn,{isDisabled:r?o:!0,paddingRight:3,children:r?a.jsxs(a.Fragment,{children:[a.jsx(Zn,{textAlign:"end",padding:1,children:r==null?void 0:r.title}),a.jsx(dI,{nodeId:t,field:r,isValidConnection:s,handleType:"source"},n.id)]}):a.jsx(ni,{justifyContent:"space-between",alignItems:"center",children:a.jsxs(Zn,{color:"error.400",children:["Unknown Output: ",n.name]})})})})}const Xee=e=>{const{nodeId:t,template:n,outputs:r}=e,o=L(i=>i.nodes.edges);return f.useCallback(()=>{const i=[];return Xs(r).forEach(d=>{const p=n.outputs[d.name],m=!!o.filter(h=>h.source===t&&h.sourceHandle===d.name).length;i.push(a.jsx(Qee,{nodeId:t,output:d,template:p,connected:m},d.id))}),a.jsx(G,{flexDir:"column",children:i})},[o,t,r,n.outputs])()},Zee=f.memo(Xee),Jee=e=>{const{...t}=e;return a.jsx(AA,{style:{position:"absolute",border:"none",background:"transparent",width:15,height:15,bottom:0,right:0},minWidth:g3,...t})},fv=f.memo(Jee),pv=e=>{const[t,n]=uc("shadows",["nodeSelectedOutline","dark-lg"]),r=L(o=>o.hotkeys.shift);return a.jsx(Be,{className:r?Sy:"nopan",sx:{position:"relative",borderRadius:"md",minWidth:g3,shadow:e.selected?`${t}, ${n}`:`${n}`},children:e.children})},gI=f.memo(e=>{const{id:t,data:n,selected:r}=e,{type:o,inputs:s,outputs:i}=n,u=f.useMemo(()=>LJ(o),[o]),d=L(u);return d?a.jsxs(pv,{selected:r,children:[a.jsx(cI,{nodeId:t,title:d.title,description:d.description}),a.jsxs(G,{className:"nopan",sx:{cursor:"auto",flexDirection:"column",borderBottomRadius:"md",py:2,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(Zee,{nodeId:t,outputs:i,template:d}),a.jsx(Yee,{nodeId:t,inputs:s,template:d})]}),a.jsx(fv,{})]}):a.jsx(pv,{selected:r,children:a.jsxs(G,{className:"nopan",sx:{alignItems:"center",justifyContent:"center",cursor:"auto"},children:[a.jsx(oo,{as:w$,sx:{boxSize:32,color:"base.600",_dark:{color:"base.400"}}}),a.jsx(fv,{})]})})});gI.displayName="InvocationComponent";const ete=e=>{const t=L(r=>r.system.progressImage),{selected:n}=e;return a.jsxs(pv,{selected:n,children:[a.jsx(cI,{title:"Progress Image",description:"Displays the progress image in the Node Editor"}),a.jsx(G,{className:"nopan",sx:{flexDirection:"column",borderBottomRadius:"md",p:2,bg:"base.200",_dark:{bg:"base.800"}},children:t?a.jsx(Eu,{src:t.dataURL,sx:{w:"full",h:"full",objectFit:"contain"}}):a.jsx(G,{sx:{w:"full",h:"full",minW:32,minH:32,alignItems:"center",justifyContent:"center"},children:a.jsx(Zi,{})})}),a.jsx(fv,{maxHeight:(t==null?void 0:t.height)??512,maxWidth:(t==null?void 0:t.width)??512})]})},tte=f.memo(ete),nte=()=>{const{zoomIn:e,zoomOut:t,fitView:n}=ih(),r=ne(),o=L(p=>p.nodes.shouldShowGraphOverlay),s=f.useCallback(()=>{e()},[e]),i=f.useCallback(()=>{t()},[t]),u=f.useCallback(()=>{n()},[n]),d=f.useCallback(()=>{r(KO(!o))},[o,r]);return a.jsxs(dr,{isAttached:!0,orientation:"vertical",children:[a.jsx(Ae,{onClick:s,"aria-label":"Zoom In",icon:a.jsx(jh,{})}),a.jsx(Ae,{onClick:i,"aria-label":"Zoom Out",icon:a.jsx(N$,{})}),a.jsx(Ae,{onClick:u,"aria-label":"Fit to Viewport",icon:a.jsx(k$,{})}),a.jsx(Ae,{isChecked:o,onClick:d,"aria-label":"Show/Hide Graph",icon:a.jsx(l1,{})})]})},rte=f.memo(nte),ote=()=>a.jsx(Pu,{position:"bottom-left",children:a.jsx(rte,{})}),ste=f.memo(ote),ate=()=>{const e=xf({background:"var(--invokeai-colors-base-200)"},{background:"var(--invokeai-colors-base-500)"}),t=xf("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-700)"),n=xf("var(--invokeai-colors-blackAlpha-300)","var(--invokeai-colors-blackAlpha-600)");return a.jsx(kA,{nodeStrokeWidth:3,pannable:!0,zoomable:!0,nodeBorderRadius:30,style:e,nodeColor:t,maskColor:n})},ite=f.memo(ate),lte=()=>{const{t:e}=pe(),t=ne(),{fitView:n}=ih(),r=f.useRef(null),o=f.useCallback(s=>{var u;if(!s)return;const i=new FileReader;i.onload=async()=>{const d=i.result,p=await JSON.parse(String(d));p||t(_s(ks({title:e("toast.nodesLoadedFailed"),status:"error"}))),p&&(t(YO(p.nodes)),t(QO(p.edges)),n(),t(_s(ks({title:e("toast.nodesLoaded"),status:"success"})))),i.abort()},i.readAsText(s),(u=r.current)==null||u.call(r)},[n,t,e]);return a.jsx(aP,{resetRef:r,accept:"application/json",onChange:o,children:s=>a.jsx(Ae,{icon:a.jsx(Hu,{}),tooltip:e("nodes.loadNodes"),"aria-label":e("nodes.loadNodes"),...s})})},cte=f.memo(lte);function ute(e){const{iconButton:t=!1,...n}=e,r=ne(),o=L(yr),s=fy(),i=f.useCallback(()=>{r(Rv("nodes"))},[r]),{t:u}=pe();return Ze(["ctrl+enter","meta+enter"],i,{enabled:()=>s,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[s,o]),a.jsx(Be,{style:{flexGrow:4},position:"relative",children:a.jsxs(Be,{style:{position:"relative"},children:[!s&&a.jsx(Be,{borderRadius:"base",style:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip"},children:a.jsx(XP,{})}),t?a.jsx(Ae,{"aria-label":u("parameters.invoke"),type:"submit",icon:a.jsx(t_,{}),isDisabled:!s,onClick:i,flexGrow:1,w:"100%",tooltip:u("parameters.invoke"),tooltipProps:{placement:"bottom"},colorScheme:"accent",id:"invoke-button",_disabled:{background:"none",_hover:{background:"none"}},...n}):a.jsx(Ut,{"aria-label":u("parameters.invoke"),type:"submit",isDisabled:!s,onClick:i,flexGrow:1,w:"100%",colorScheme:"accent",id:"invoke-button",fontWeight:700,_disabled:{background:"none",_hover:{background:"none"}},...n,children:"Invoke"})]})})}function dte(){const{t:e}=pe(),t=ne(),n=f.useCallback(()=>{t(XO())},[t]);return a.jsx(Ae,{icon:a.jsx(U$,{}),tooltip:e("nodes.reloadSchema"),"aria-label":e("nodes.reloadSchema"),onClick:n})}const fte=()=>{const{t:e}=pe(),t=L(o=>o.nodes.editorInstance),n=L(o=>o.nodes.nodes),r=f.useCallback(()=>{if(t){const o=t.toObject();o.edges=Xs(o.edges,u=>ZO(u,["style"]));const s=new Blob([JSON.stringify(o)]),i=document.createElement("a");i.href=URL.createObjectURL(s),i.download="MyNodes.json",document.body.appendChild(i),i.click(),i.remove()}},[t]);return a.jsx(Ae,{icon:a.jsx(Ph,{}),fontSize:18,tooltip:e("nodes.saveNodes"),"aria-label":e("nodes.saveNodes"),onClick:r,isDisabled:n.length===0})},pte=f.memo(fte),hte=()=>{const{t:e}=pe(),t=ne(),{isOpen:n,onOpen:r,onClose:o}=va(),s=f.useRef(null),i=L(d=>d.nodes.nodes),u=f.useCallback(()=>{t(JO()),t(_s(ks({title:e("toast.nodesCleared"),status:"success"}))),o()},[t,e,o]);return a.jsxs(a.Fragment,{children:[a.jsx(Ae,{icon:a.jsx(mo,{}),tooltip:e("nodes.clearNodes"),"aria-label":e("nodes.clearNodes"),onClick:r,isDisabled:i.length===0}),a.jsxs(zu,{isOpen:n,onClose:o,leastDestructiveRef:s,isCentered:!0,children:[a.jsx(Sa,{}),a.jsxs(Lu,{children:[a.jsx(xa,{fontSize:"lg",fontWeight:"bold",children:e("nodes.clearNodes")}),a.jsx(wa,{children:a.jsx(tt,{children:e("common.clearNodes")})}),a.jsxs(ba,{children:[a.jsx(Rf,{ref:s,onClick:o,children:e("common.cancel")}),a.jsx(Rf,{colorScheme:"red",ml:3,onClick:u,children:e("common.accept")})]})]})]})]})},mte=f.memo(hte),gte=()=>a.jsx(Pu,{position:"top-center",children:a.jsxs(ni,{children:[a.jsx(ute,{}),a.jsx(qh,{}),a.jsx(dte,{}),a.jsx(pte,{}),a.jsx(cte,{}),a.jsx(mte,{})]})}),vte=f.memo(gte),yte=we(e7,e=>{const t=Xs(e.invocationTemplates,n=>({label:n.title,value:n.type,description:n.description}));return t.push({label:"Progress Image",value:"progress_image",description:"Displays the progress image in the Node Editor"}),{data:t}},ut),bte=()=>{const e=ne(),{data:t}=L(yte),n=HJ(),r=Iu(),o=f.useCallback(i=>{const u=n(i);if(!u){r({status:"error",title:`Unknown Invocation type ${i}`});return}e(t7(u))},[e,n,r]),s=f.useCallback(i=>{i&&o(i)},[o]);return a.jsx(G,{sx:{gap:2,alignItems:"center"},children:a.jsx(gr,{selectOnBlur:!1,placeholder:"Add Node",value:null,data:t,maxDropdownHeight:400,nothingFound:"No matching nodes",itemComponent:vI,filter:(i,u)=>u.label.toLowerCase().includes(i.toLowerCase().trim())||u.value.toLowerCase().includes(i.toLowerCase().trim())||u.description.toLowerCase().includes(i.toLowerCase().trim()),onChange:s,sx:{width:"18rem"}})})},vI=f.forwardRef(({label:e,description:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs("div",{children:[a.jsx(tt,{children:e}),a.jsx(tt,{size:"xs",color:"base.600",children:t})]})}));vI.displayName="SelectItem";const xte=()=>a.jsx(Pu,{position:"top-left",children:a.jsx(bte,{})}),Ste=f.memo(xte),wte=()=>a.jsx(G,{sx:{gap:2,flexDir:"column"},children:Xs(m3,({title:e,description:t,color:n},r)=>a.jsx(fr,{label:t,children:a.jsx(Hi,{colorScheme:n,sx:{userSelect:"none"},textAlign:"center",children:e})},r))}),Cte=f.memo(wte),_te=()=>{const e=L(n=>n),t=n7(e);return a.jsx(Be,{as:"pre",sx:{fontFamily:"monospace",position:"absolute",top:2,right:2,opacity:.7,p:2,maxHeight:500,maxWidth:500,overflowY:"scroll",borderRadius:"base",bg:"base.200",_dark:{bg:"base.800"}},children:JSON.stringify(t,null,2)})},kte=f.memo(_te),jte=()=>{const e=L(t=>t.nodes.shouldShowGraphOverlay);return a.jsxs(Pu,{position:"top-right",children:[a.jsx(Cte,{}),e&&a.jsx(kte,{})]})},Pte=f.memo(jte),Ite={invocation:gI,progress_image:tte},Ete=()=>{const e=ne(),t=L(p=>p.nodes.nodes),n=L(p=>p.nodes.edges),r=f.useCallback(p=>{e(r7(p))},[e]),o=f.useCallback(p=>{e(o7(p))},[e]),s=f.useCallback((p,m)=>{e(s7(m))},[e]),i=f.useCallback(p=>{e(a7(p))},[e]),u=f.useCallback(()=>{e(i7())},[e]),d=f.useCallback(p=>{e(l7(p)),p&&p.fitView()},[e]);return a.jsxs(c7,{nodeTypes:Ite,nodes:t,edges:n,onNodesChange:r,onEdgesChange:o,onConnectStart:s,onConnect:i,onConnectEnd:u,onInit:d,defaultEdgeOptions:{style:{strokeWidth:2}},children:[a.jsx(Ste,{}),a.jsx(vte,{}),a.jsx(Pte,{}),a.jsx(ste,{}),a.jsx(RA,{}),a.jsx(ite,{})]})},Ote=()=>a.jsx(Be,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base"},children:a.jsx(u7,{children:a.jsx(Ete,{})})}),Rte=f.memo(Ote),Mte=()=>a.jsx(Rte,{}),Dte=f.memo(Mte),Tte=e=>e.postprocessing,Ate=we([Tte],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:Yt}}),Nte=()=>{const{hiresFix:e,hiresStrength:t}=L(Ate),n=ne(),{t:r}=pe(),o=i=>{n(Lx(i))},s=()=>{n(Lx(.75))};return a.jsx(yt,{label:r("parameters.hiresStrength"),step:.01,min:.01,max:.99,onChange:o,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s,isDisabled:!e})},$te=()=>{const e=ne(),t=L(o=>o.postprocessing.hiresFix),{t:n}=pe(),r=o=>e(d7(o.target.checked));return a.jsx(Pn,{label:n("parameters.hiresOptim"),isChecked:t,onChange:r})},zte=we(Tt,e=>({activeLabel:e.postprocessing.hiresFix?"Enabled":void 0}),ut),Lte=()=>{const{t:e}=pe(),{activeLabel:t}=L(zte);return sr("hires").isFeatureEnabled?a.jsx(So,{label:e("parameters.hiresOptim"),activeLabel:t,children:a.jsxs(G,{sx:{gap:2,flexDirection:"column"},children:[a.jsx($te,{}),a.jsx(Nte,{})]})}):null},Fte=f.memo(Lte),Bte=we(Tt,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},ut),Hte=()=>{const{shouldUseSliders:e,activeLabel:t}=L(Bte);return a.jsx(So,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsx(G,{sx:{flexDirection:"column",gap:3},children:e?a.jsxs(a.Fragment,{children:[a.jsx(rc,{}),a.jsx(sc,{}),a.jsx(nc,{}),a.jsx(oc,{}),a.jsx(Be,{pt:2,children:a.jsx(ac,{})}),a.jsx(Xp,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(G,{gap:3,children:[a.jsx(rc,{}),a.jsx(sc,{}),a.jsx(nc,{})]}),a.jsx(oc,{}),a.jsx(Be,{pt:2,children:a.jsx(ac,{})}),a.jsx(Xp,{})]})})})},Vte=f.memo(Hte),Wte=()=>a.jsxs(a.Fragment,{children:[a.jsx(py,{}),a.jsx(uy,{}),a.jsx(vy,{}),a.jsx(Vte,{}),a.jsx(ly,{}),a.jsx(ay,{}),a.jsx(sy,{}),a.jsx(my,{}),a.jsx(YP,{}),a.jsx(hy,{}),a.jsx(Fte,{}),a.jsx(QP,{}),a.jsx(iy,{})]}),yI=f.memo(Wte),Ute=()=>a.jsxs(G,{sx:{gap:4,w:"full",h:"full"},children:[a.jsx(oy,{children:a.jsx(yI,{})}),a.jsx(VP,{})]}),Gte=f.memo(Ute);var hv={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=Fx;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=Fx;e.exports=r.Konva})(hv,hv.exports);var qte=hv.exports;const _u=lc(qte);var bI={exports:{}};/**
|
||
* @license React
|
||
* react-reconciler.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Kte=function(t){var n={},r=f,o=Sf,s=Object.assign;function i(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g<arguments.length;g++)c+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,d=Symbol.for("react.element"),p=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),w=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),I=Symbol.iterator;function R(l){return l===null||typeof l!="object"?null:(l=I&&l[I]||l["@@iterator"],typeof l=="function"?l:null)}function O(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case m:return"Fragment";case p:return"Portal";case v:return"Profiler";case h:return"StrictMode";case C:return"Suspense";case _:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case w:return(l.displayName||"Context")+".Consumer";case b:return(l._context.displayName||"Context")+".Provider";case S:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case k:return c=l.displayName||null,c!==null?c:O(l.type)||"Memo";case P:c=l._payload,l=l._init;try{return O(l(c))}catch{}}return null}function D(l){var c=l.type;switch(l.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=c.render,l=l.displayName||l.name||"",c.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return O(c);case 8:return c===h?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function T(l){var c=l,g=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,c.flags&4098&&(g=c.return),l=c.return;while(l)}return c.tag===3?g:null}function $(l){if(T(l)!==l)throw Error(i(188))}function B(l){var c=l.alternate;if(!c){if(c=T(l),c===null)throw Error(i(188));return c!==l?null:l}for(var g=l,y=c;;){var x=g.return;if(x===null)break;var j=x.alternate;if(j===null){if(y=x.return,y!==null){g=y;continue}break}if(x.child===j.child){for(j=x.child;j;){if(j===g)return $(x),l;if(j===y)return $(x),c;j=j.sibling}throw Error(i(188))}if(g.return!==y.return)g=x,y=j;else{for(var M=!1,Q=x.child;Q;){if(Q===g){M=!0,g=x,y=j;break}if(Q===y){M=!0,y=x,g=j;break}Q=Q.sibling}if(!M){for(Q=j.child;Q;){if(Q===g){M=!0,g=j,y=x;break}if(Q===y){M=!0,y=j,g=x;break}Q=Q.sibling}if(!M)throw Error(i(189))}}if(g.alternate!==y)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?l:c}function ee(l){return l=B(l),l!==null?F(l):null}function F(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var c=F(l);if(c!==null)return c;l=l.sibling}return null}function N(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){if(l.tag!==4){var c=N(l);if(c!==null)return c}l=l.sibling}return null}var H=Array.isArray,K=t.getPublicInstance,A=t.getRootHostContext,U=t.getChildHostContext,V=t.prepareForCommit,W=t.resetAfterCommit,re=t.createInstance,be=t.appendInitialChild,ce=t.finalizeInitialChildren,se=t.prepareUpdate,X=t.shouldSetTextContent,ie=t.createTextInstance,de=t.scheduleTimeout,xe=t.cancelTimeout,oe=t.noTimeout,ve=t.isPrimaryRenderer,he=t.supportsMutation,je=t.supportsPersistence,Ne=t.supportsHydration,ge=t.getInstanceFromNode,Oe=t.preparePortalMount,at=t.getCurrentEventPriority,Fe=t.detachDeletedInstance,qe=t.supportsMicrotasks,Pt=t.scheduleMicrotask,St=t.supportsTestSelectors,zn=t.findFiberRoot,Y=t.getBoundingRect,Ce=t.getTextContent,te=t.isHiddenSubtree,fe=t.matchAccessibilityRole,Te=t.setFocusIfFocusable,Ke=t.setupIntersectionObserver,bt=t.appendChild,Xt=t.appendChildToContainer,ln=t.commitTextUpdate,_n=t.commitMount,pr=t.commitUpdate,cn=t.insertBefore,Un=t.insertInContainerBefore,Re=t.removeChild,Je=t.removeChildFromContainer,it=t.resetTextContent,dt=t.hideInstance,$t=t.hideTextInstance,hr=t.unhideInstance,un=t.unhideTextInstance,xn=t.clearContainer,xr=t.cloneInstance,kn=t.createContainerChildSet,In=t.appendChildToContainerChildSet,os=t.finalizeContainerChildren,dn=t.replaceContainerChildren,Mo=t.cloneHiddenInstance,Do=t.cloneHiddenTextInstance,Nn=t.canHydrateInstance,ss=t.canHydrateTextInstance,Ra=t.canHydrateSuspenseInstance,kr=t.isSuspenseInstancePending,To=t.isSuspenseInstanceFallback,ta=t.getSuspenseInstanceFallbackErrorDetails,Ma=t.registerSuspenseInstanceRetry,as=t.getNextHydratableSibling,q=t.getFirstHydratableChild,Z=t.getFirstHydratableChildWithinContainer,ue=t.getFirstHydratableChildWithinSuspenseInstance,ye=t.hydrateInstance,Se=t.hydrateTextInstance,Ye=t.hydrateSuspenseInstance,ht=t.getNextHydratableInstanceAfterSuspenseInstance,zt=t.commitHydratedContainer,lt=t.commitHydratedSuspenseInstance,He=t.clearSuspenseBoundary,Ge=t.clearSuspenseBoundaryFromContainer,_e=t.shouldDeleteUnhydratedTailInstances,Ve=t.didNotMatchHydratedContainerTextInstance,wt=t.didNotMatchHydratedTextInstance,_t;function Rt(l){if(_t===void 0)try{throw Error()}catch(g){var c=g.stack.trim().match(/\n( *(at )?)/);_t=c&&c[1]||""}return`
|
||
`+_t+l}var Ft=!1;function Gt(l,c){if(!l||Ft)return"";Ft=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(De){var y=De}Reflect.construct(l,[],c)}else{try{c.call()}catch(De){y=De}l.call(c.prototype)}else{try{throw Error()}catch(De){y=De}l()}}catch(De){if(De&&y&&typeof De.stack=="string"){for(var x=De.stack.split(`
|
||
`),j=y.stack.split(`
|
||
`),M=x.length-1,Q=j.length-1;1<=M&&0<=Q&&x[M]!==j[Q];)Q--;for(;1<=M&&0<=Q;M--,Q--)if(x[M]!==j[Q]){if(M!==1||Q!==1)do if(M--,Q--,0>Q||x[M]!==j[Q]){var le=`
|
||
`+x[M].replace(" at new "," at ");return l.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",l.displayName)),le}while(1<=M&&0<=Q);break}}}finally{Ft=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?Rt(l):""}var Bt=Object.prototype.hasOwnProperty,Ie=[],mt=-1;function Mt(l){return{current:l}}function Dt(l){0>mt||(l.current=Ie[mt],Ie[mt]=null,mt--)}function Lt(l,c){mt++,Ie[mt]=l.current,l.current=c}var fn={},Wt=Mt(fn),Zt=Mt(!1),Cn=fn;function jr(l,c){var g=l.type.contextTypes;if(!g)return fn;var y=l.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var x={},j;for(j in g)x[j]=c[j];return y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=x),x}function Gn(l){return l=l.childContextTypes,l!=null}function Ct(){Dt(Zt),Dt(Wt)}function Sn(l,c,g){if(Wt.current!==fn)throw Error(i(168));Lt(Wt,c),Lt(Zt,g)}function jn(l,c,g){var y=l.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return g;y=y.getChildContext();for(var x in y)if(!(x in c))throw Error(i(108,D(l)||"Unknown",x));return s({},g,y)}function qn(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||fn,Cn=Wt.current,Lt(Wt,l),Lt(Zt,Zt.current),!0}function ir(l,c,g){var y=l.stateNode;if(!y)throw Error(i(169));g?(l=jn(l,c,Cn),y.__reactInternalMemoizedMergedChildContext=l,Dt(Zt),Dt(Wt),Lt(Wt,l)):Dt(Zt),Lt(Zt,g)}var Rn=Math.clz32?Math.clz32:gn,Mn=Math.log,nn=Math.LN2;function gn(l){return l>>>=0,l===0?32:31-(Mn(l)/nn|0)|0}var wn=64,pn=4194304;function hn(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function We(l,c){var g=l.pendingLanes;if(g===0)return 0;var y=0,x=l.suspendedLanes,j=l.pingedLanes,M=g&268435455;if(M!==0){var Q=M&~x;Q!==0?y=hn(Q):(j&=M,j!==0&&(y=hn(j)))}else M=g&~x,M!==0?y=hn(M):j!==0&&(y=hn(j));if(y===0)return 0;if(c!==0&&c!==y&&!(c&x)&&(x=y&-y,j=c&-c,x>=j||x===16&&(j&4194240)!==0))return c;if(y&4&&(y|=g&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=y;0<c;)g=31-Rn(c),x=1<<g,y|=l[g],c&=~x;return y}function kt(l,c){switch(l){case 1:case 2:case 4:return c+250;case 8:case 16:case 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 c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vt(l,c){for(var g=l.suspendedLanes,y=l.pingedLanes,x=l.expirationTimes,j=l.pendingLanes;0<j;){var M=31-Rn(j),Q=1<<M,le=x[M];le===-1?(!(Q&g)||Q&y)&&(x[M]=kt(Q,c)):le<=c&&(l.expiredLanes|=Q),j&=~Q}}function et(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function gt(){var l=wn;return wn<<=1,!(wn&4194240)&&(wn=64),l}function At(l){for(var c=[],g=0;31>g;g++)c.push(l);return c}function ft(l,c,g){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-Rn(c),l[c]=g}function Xe(l,c){var g=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var y=l.eventTimes;for(l=l.expirationTimes;0<g;){var x=31-Rn(g),j=1<<x;c[x]=0,y[x]=-1,l[x]=-1,g&=~j}}function Ee(l,c){var g=l.entangledLanes|=c;for(l=l.entanglements;g;){var y=31-Rn(g),x=1<<y;x&c|l[y]&c&&(l[y]|=c),g&=~x}}var ke=0;function Me(l){return l&=-l,1<l?4<l?l&268435455?16:536870912:4:1}var $e=o.unstable_scheduleCallback,Qe=o.unstable_cancelCallback,It=o.unstable_shouldYield,jt=o.unstable_requestPaint,ze=o.unstable_now,qt=o.unstable_ImmediatePriority,mn=o.unstable_UserBlockingPriority,on=o.unstable_NormalPriority,lr=o.unstable_IdlePriority,Ln=null,an=null;function $n(l){if(an&&typeof an.onCommitFiberRoot=="function")try{an.onCommitFiberRoot(Ln,l,void 0,(l.current.flags&128)===128)}catch{}}function Jr(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var rn=typeof Object.is=="function"?Object.is:Jr,Dn=null,Nr=!1,Pr=!1;function Da(l){Dn===null?Dn=[l]:Dn.push(l)}function Ku(l){Nr=!0,Da(l)}function wo(){if(!Pr&&Dn!==null){Pr=!0;var l=0,c=ke;try{var g=Dn;for(ke=1;l<g.length;l++){var y=g[l];do y=y(!0);while(y!==null)}Dn=null,Nr=!1}catch(x){throw Dn!==null&&(Dn=Dn.slice(l+1)),$e(qt,wo),x}finally{ke=c,Pr=!1}}return null}var na=[],Ds=0,ra=null,eo=0,to=[],no=0,Ao=null,Co=1,Br="";function fi(l,c){na[Ds++]=eo,na[Ds++]=ra,ra=l,eo=c}function Py(l,c,g){to[no++]=Co,to[no++]=Br,to[no++]=Ao,Ao=l;var y=Co;l=Br;var x=32-Rn(y)-1;y&=~(1<<x),g+=1;var j=32-Rn(c)+x;if(30<j){var M=x-x%5;j=(y&(1<<M)-1).toString(32),y>>=M,x-=M,Co=1<<32-Rn(c)+x|g<<x|y,Br=j+l}else Co=1<<j|g<<x|y,Br=l}function em(l){l.return!==null&&(fi(l,1),Py(l,1,0))}function tm(l){for(;l===ra;)ra=na[--Ds],na[Ds]=null,eo=na[--Ds],na[Ds]=null;for(;l===Ao;)Ao=to[--no],to[no]=null,Br=to[--no],to[no]=null,Co=to[--no],to[no]=null}var _o=null,No=null,Kn=!1,wc=!1,is=null;function Iy(l,c){var g=Bo(5,null,null,0);g.elementType="DELETED",g.stateNode=c,g.return=l,c=l.deletions,c===null?(l.deletions=[g],l.flags|=16):c.push(g)}function Ey(l,c){switch(l.tag){case 5:return c=Nn(c,l.type,l.pendingProps),c!==null?(l.stateNode=c,_o=l,No=q(c),!0):!1;case 6:return c=ss(c,l.pendingProps),c!==null?(l.stateNode=c,_o=l,No=null,!0):!1;case 13:if(c=Ra(c),c!==null){var g=Ao!==null?{id:Co,overflow:Br}:null;return l.memoizedState={dehydrated:c,treeContext:g,retryLane:1073741824},g=Bo(18,null,null,0),g.stateNode=c,g.return=l,l.child=g,_o=l,No=null,!0}return!1;default:return!1}}function nm(l){return(l.mode&1)!==0&&(l.flags&128)===0}function rm(l){if(Kn){var c=No;if(c){var g=c;if(!Ey(l,c)){if(nm(l))throw Error(i(418));c=as(g);var y=_o;c&&Ey(l,c)?Iy(y,g):(l.flags=l.flags&-4097|2,Kn=!1,_o=l)}}else{if(nm(l))throw Error(i(418));l.flags=l.flags&-4097|2,Kn=!1,_o=l}}}function Oy(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;_o=l}function Yu(l){if(!Ne||l!==_o)return!1;if(!Kn)return Oy(l),Kn=!0,!1;if(l.tag!==3&&(l.tag!==5||_e(l.type)&&!X(l.type,l.memoizedProps))){var c=No;if(c){if(nm(l))throw Ry(),Error(i(418));for(;c;)Iy(l,c),c=as(c)}}if(Oy(l),l.tag===13){if(!Ne)throw Error(i(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));No=ht(l)}else No=_o?as(l.stateNode):null;return!0}function Ry(){for(var l=No;l;)l=as(l)}function sl(){Ne&&(No=_o=null,wc=Kn=!1)}function om(l){is===null?is=[l]:is.push(l)}var $I=u.ReactCurrentBatchConfig;function Qu(l,c){if(rn(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var g=Object.keys(l),y=Object.keys(c);if(g.length!==y.length)return!1;for(y=0;y<g.length;y++){var x=g[y];if(!Bt.call(c,x)||!rn(l[x],c[x]))return!1}return!0}function zI(l){switch(l.tag){case 5:return Rt(l.type);case 16:return Rt("Lazy");case 13:return Rt("Suspense");case 19:return Rt("SuspenseList");case 0:case 2:case 15:return l=Gt(l.type,!1),l;case 11:return l=Gt(l.type.render,!1),l;case 1:return l=Gt(l.type,!0),l;default:return""}}function ls(l,c){if(l&&l.defaultProps){c=s({},c),l=l.defaultProps;for(var g in l)c[g]===void 0&&(c[g]=l[g]);return c}return c}var Xu=Mt(null),Zu=null,al=null,sm=null;function am(){sm=al=Zu=null}function My(l,c,g){ve?(Lt(Xu,c._currentValue),c._currentValue=g):(Lt(Xu,c._currentValue2),c._currentValue2=g)}function im(l){var c=Xu.current;Dt(Xu),ve?l._currentValue=c:l._currentValue2=c}function lm(l,c,g){for(;l!==null;){var y=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),l===g)break;l=l.return}}function il(l,c){Zu=l,sm=al=null,l=l.dependencies,l!==null&&l.firstContext!==null&&(l.lanes&c&&(ao=!0),l.firstContext=null)}function $o(l){var c=ve?l._currentValue:l._currentValue2;if(sm!==l)if(l={context:l,memoizedValue:c,next:null},al===null){if(Zu===null)throw Error(i(308));al=l,Zu.dependencies={lanes:0,firstContext:l}}else al=al.next=l;return c}var pi=null;function cm(l){pi===null?pi=[l]:pi.push(l)}function Dy(l,c,g,y){var x=c.interleaved;return x===null?(g.next=g,cm(c)):(g.next=x.next,x.next=g),c.interleaved=g,Ts(l,y)}function Ts(l,c){l.lanes|=c;var g=l.alternate;for(g!==null&&(g.lanes|=c),g=l,l=l.return;l!==null;)l.childLanes|=c,g=l.alternate,g!==null&&(g.childLanes|=c),g=l,l=l.return;return g.tag===3?g.stateNode:null}var Ta=!1;function um(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ty(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function oa(l,c){return{eventTime:l,lane:c,tag:0,payload:null,callback:null,next:null}}function Aa(l,c,g){var y=l.updateQueue;if(y===null)return null;if(y=y.shared,Jt&2){var x=y.pending;return x===null?c.next=c:(c.next=x.next,x.next=c),y.pending=c,Ts(l,g)}return x=y.interleaved,x===null?(c.next=c,cm(y)):(c.next=x.next,x.next=c),y.interleaved=c,Ts(l,g)}function Ju(l,c,g){if(c=c.updateQueue,c!==null&&(c=c.shared,(g&4194240)!==0)){var y=c.lanes;y&=l.pendingLanes,g|=y,c.lanes=g,Ee(l,g)}}function Ay(l,c){var g=l.updateQueue,y=l.alternate;if(y!==null&&(y=y.updateQueue,g===y)){var x=null,j=null;if(g=g.firstBaseUpdate,g!==null){do{var M={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};j===null?x=j=M:j=j.next=M,g=g.next}while(g!==null);j===null?x=j=c:j=j.next=c}else x=j=c;g={baseState:y.baseState,firstBaseUpdate:x,lastBaseUpdate:j,shared:y.shared,effects:y.effects},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=c:l.next=c,g.lastBaseUpdate=c}function ed(l,c,g,y){var x=l.updateQueue;Ta=!1;var j=x.firstBaseUpdate,M=x.lastBaseUpdate,Q=x.shared.pending;if(Q!==null){x.shared.pending=null;var le=Q,De=le.next;le.next=null,M===null?j=De:M.next=De,M=le;var pt=l.alternate;pt!==null&&(pt=pt.updateQueue,Q=pt.lastBaseUpdate,Q!==M&&(Q===null?pt.firstBaseUpdate=De:Q.next=De,pt.lastBaseUpdate=le))}if(j!==null){var Ht=x.baseState;M=0,pt=De=le=null,Q=j;do{var nt=Q.lane,Fn=Q.eventTime;if((y&nt)===nt){pt!==null&&(pt=pt.next={eventTime:Fn,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var Tn=l,co=Q;switch(nt=c,Fn=g,co.tag){case 1:if(Tn=co.payload,typeof Tn=="function"){Ht=Tn.call(Fn,Ht,nt);break e}Ht=Tn;break e;case 3:Tn.flags=Tn.flags&-65537|128;case 0:if(Tn=co.payload,nt=typeof Tn=="function"?Tn.call(Fn,Ht,nt):Tn,nt==null)break e;Ht=s({},Ht,nt);break e;case 2:Ta=!0}}Q.callback!==null&&Q.lane!==0&&(l.flags|=64,nt=x.effects,nt===null?x.effects=[Q]:nt.push(Q))}else Fn={eventTime:Fn,lane:nt,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},pt===null?(De=pt=Fn,le=Ht):pt=pt.next=Fn,M|=nt;if(Q=Q.next,Q===null){if(Q=x.shared.pending,Q===null)break;nt=Q,Q=nt.next,nt.next=null,x.lastBaseUpdate=nt,x.shared.pending=null}}while(1);if(pt===null&&(le=Ht),x.baseState=le,x.firstBaseUpdate=De,x.lastBaseUpdate=pt,c=x.shared.interleaved,c!==null){x=c;do M|=x.lane,x=x.next;while(x!==c)}else j===null&&(x.shared.lanes=0);mi|=M,l.lanes=M,l.memoizedState=Ht}}function Ny(l,c,g){if(l=c.effects,c.effects=null,l!==null)for(c=0;c<l.length;c++){var y=l[c],x=y.callback;if(x!==null){if(y.callback=null,y=g,typeof x!="function")throw Error(i(191,x));x.call(y)}}}var $y=new r.Component().refs;function dm(l,c,g,y){c=l.memoizedState,g=g(y,c),g=g==null?c:s({},c,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var td={isMounted:function(l){return(l=l._reactInternals)?T(l)===l:!1},enqueueSetState:function(l,c,g){l=l._reactInternals;var y=Ur(),x=za(l),j=oa(y,x);j.payload=c,g!=null&&(j.callback=g),c=Aa(l,j,x),c!==null&&(Fo(c,l,x,y),Ju(c,l,x))},enqueueReplaceState:function(l,c,g){l=l._reactInternals;var y=Ur(),x=za(l),j=oa(y,x);j.tag=1,j.payload=c,g!=null&&(j.callback=g),c=Aa(l,j,x),c!==null&&(Fo(c,l,x,y),Ju(c,l,x))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var g=Ur(),y=za(l),x=oa(g,y);x.tag=2,c!=null&&(x.callback=c),c=Aa(l,x,y),c!==null&&(Fo(c,l,y,g),Ju(c,l,y))}};function zy(l,c,g,y,x,j,M){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(y,j,M):c.prototype&&c.prototype.isPureReactComponent?!Qu(g,y)||!Qu(x,j):!0}function Ly(l,c,g){var y=!1,x=fn,j=c.contextType;return typeof j=="object"&&j!==null?j=$o(j):(x=Gn(c)?Cn:Wt.current,y=c.contextTypes,j=(y=y!=null)?jr(l,x):fn),c=new c(g,j),l.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=td,l.stateNode=c,c._reactInternals=l,y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=x,l.__reactInternalMemoizedMaskedChildContext=j),c}function Fy(l,c,g,y){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(g,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(g,y),c.state!==l&&td.enqueueReplaceState(c,c.state,null)}function fm(l,c,g,y){var x=l.stateNode;x.props=g,x.state=l.memoizedState,x.refs=$y,um(l);var j=c.contextType;typeof j=="object"&&j!==null?x.context=$o(j):(j=Gn(c)?Cn:Wt.current,x.context=jr(l,j)),x.state=l.memoizedState,j=c.getDerivedStateFromProps,typeof j=="function"&&(dm(l,c,j,g),x.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(c=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),c!==x.state&&td.enqueueReplaceState(x,x.state,null),ed(l,g,x,y),x.state=l.memoizedState),typeof x.componentDidMount=="function"&&(l.flags|=4194308)}function Cc(l,c,g){if(l=g.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(i(309));var y=g.stateNode}if(!y)throw Error(i(147,l));var x=y,j=""+l;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===j?c.ref:(c=function(M){var Q=x.refs;Q===$y&&(Q=x.refs={}),M===null?delete Q[j]:Q[j]=M},c._stringRef=j,c)}if(typeof l!="string")throw Error(i(284));if(!g._owner)throw Error(i(290,l))}return l}function nd(l,c){throw l=Object.prototype.toString.call(c),Error(i(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l))}function By(l){var c=l._init;return c(l._payload)}function Hy(l){function c(ae,J){if(l){var me=ae.deletions;me===null?(ae.deletions=[J],ae.flags|=16):me.push(J)}}function g(ae,J){if(!l)return null;for(;J!==null;)c(ae,J),J=J.sibling;return null}function y(ae,J){for(ae=new Map;J!==null;)J.key!==null?ae.set(J.key,J):ae.set(J.index,J),J=J.sibling;return ae}function x(ae,J){return ae=Fa(ae,J),ae.index=0,ae.sibling=null,ae}function j(ae,J,me){return ae.index=me,l?(me=ae.alternate,me!==null?(me=me.index,me<J?(ae.flags|=2,J):me):(ae.flags|=2,J)):(ae.flags|=1048576,J)}function M(ae){return l&&ae.alternate===null&&(ae.flags|=2),ae}function Q(ae,J,me,st){return J===null||J.tag!==6?(J=Jm(me,ae.mode,st),J.return=ae,J):(J=x(J,me),J.return=ae,J)}function le(ae,J,me,st){var Et=me.type;return Et===m?pt(ae,J,me.props.children,st,me.key):J!==null&&(J.elementType===Et||typeof Et=="object"&&Et!==null&&Et.$$typeof===P&&By(Et)===J.type)?(st=x(J,me.props),st.ref=Cc(ae,J,me),st.return=ae,st):(st=Id(me.type,me.key,me.props,null,ae.mode,st),st.ref=Cc(ae,J,me),st.return=ae,st)}function De(ae,J,me,st){return J===null||J.tag!==4||J.stateNode.containerInfo!==me.containerInfo||J.stateNode.implementation!==me.implementation?(J=eg(me,ae.mode,st),J.return=ae,J):(J=x(J,me.children||[]),J.return=ae,J)}function pt(ae,J,me,st,Et){return J===null||J.tag!==7?(J=bi(me,ae.mode,st,Et),J.return=ae,J):(J=x(J,me),J.return=ae,J)}function Ht(ae,J,me){if(typeof J=="string"&&J!==""||typeof J=="number")return J=Jm(""+J,ae.mode,me),J.return=ae,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case d:return me=Id(J.type,J.key,J.props,null,ae.mode,me),me.ref=Cc(ae,null,J),me.return=ae,me;case p:return J=eg(J,ae.mode,me),J.return=ae,J;case P:var st=J._init;return Ht(ae,st(J._payload),me)}if(H(J)||R(J))return J=bi(J,ae.mode,me,null),J.return=ae,J;nd(ae,J)}return null}function nt(ae,J,me,st){var Et=J!==null?J.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return Et!==null?null:Q(ae,J,""+me,st);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case d:return me.key===Et?le(ae,J,me,st):null;case p:return me.key===Et?De(ae,J,me,st):null;case P:return Et=me._init,nt(ae,J,Et(me._payload),st)}if(H(me)||R(me))return Et!==null?null:pt(ae,J,me,st,null);nd(ae,me)}return null}function Fn(ae,J,me,st,Et){if(typeof st=="string"&&st!==""||typeof st=="number")return ae=ae.get(me)||null,Q(J,ae,""+st,Et);if(typeof st=="object"&&st!==null){switch(st.$$typeof){case d:return ae=ae.get(st.key===null?me:st.key)||null,le(J,ae,st,Et);case p:return ae=ae.get(st.key===null?me:st.key)||null,De(J,ae,st,Et);case P:var Qt=st._init;return Fn(ae,J,me,Qt(st._payload),Et)}if(H(st)||R(st))return ae=ae.get(me)||null,pt(J,ae,st,Et,null);nd(J,st)}return null}function Tn(ae,J,me,st){for(var Et=null,Qt=null,Vt=J,vn=J=0,Ar=null;Vt!==null&&vn<me.length;vn++){Vt.index>vn?(Ar=Vt,Vt=null):Ar=Vt.sibling;var yn=nt(ae,Vt,me[vn],st);if(yn===null){Vt===null&&(Vt=Ar);break}l&&Vt&&yn.alternate===null&&c(ae,Vt),J=j(yn,J,vn),Qt===null?Et=yn:Qt.sibling=yn,Qt=yn,Vt=Ar}if(vn===me.length)return g(ae,Vt),Kn&&fi(ae,vn),Et;if(Vt===null){for(;vn<me.length;vn++)Vt=Ht(ae,me[vn],st),Vt!==null&&(J=j(Vt,J,vn),Qt===null?Et=Vt:Qt.sibling=Vt,Qt=Vt);return Kn&&fi(ae,vn),Et}for(Vt=y(ae,Vt);vn<me.length;vn++)Ar=Fn(Vt,ae,vn,me[vn],st),Ar!==null&&(l&&Ar.alternate!==null&&Vt.delete(Ar.key===null?vn:Ar.key),J=j(Ar,J,vn),Qt===null?Et=Ar:Qt.sibling=Ar,Qt=Ar);return l&&Vt.forEach(function(Ba){return c(ae,Ba)}),Kn&&fi(ae,vn),Et}function co(ae,J,me,st){var Et=R(me);if(typeof Et!="function")throw Error(i(150));if(me=Et.call(me),me==null)throw Error(i(151));for(var Qt=Et=null,Vt=J,vn=J=0,Ar=null,yn=me.next();Vt!==null&&!yn.done;vn++,yn=me.next()){Vt.index>vn?(Ar=Vt,Vt=null):Ar=Vt.sibling;var Ba=nt(ae,Vt,yn.value,st);if(Ba===null){Vt===null&&(Vt=Ar);break}l&&Vt&&Ba.alternate===null&&c(ae,Vt),J=j(Ba,J,vn),Qt===null?Et=Ba:Qt.sibling=Ba,Qt=Ba,Vt=Ar}if(yn.done)return g(ae,Vt),Kn&&fi(ae,vn),Et;if(Vt===null){for(;!yn.done;vn++,yn=me.next())yn=Ht(ae,yn.value,st),yn!==null&&(J=j(yn,J,vn),Qt===null?Et=yn:Qt.sibling=yn,Qt=yn);return Kn&&fi(ae,vn),Et}for(Vt=y(ae,Vt);!yn.done;vn++,yn=me.next())yn=Fn(Vt,ae,vn,yn.value,st),yn!==null&&(l&&yn.alternate!==null&&Vt.delete(yn.key===null?vn:yn.key),J=j(yn,J,vn),Qt===null?Et=yn:Qt.sibling=yn,Qt=yn);return l&&Vt.forEach(function(hE){return c(ae,hE)}),Kn&&fi(ae,vn),Et}function ia(ae,J,me,st){if(typeof me=="object"&&me!==null&&me.type===m&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case d:e:{for(var Et=me.key,Qt=J;Qt!==null;){if(Qt.key===Et){if(Et=me.type,Et===m){if(Qt.tag===7){g(ae,Qt.sibling),J=x(Qt,me.props.children),J.return=ae,ae=J;break e}}else if(Qt.elementType===Et||typeof Et=="object"&&Et!==null&&Et.$$typeof===P&&By(Et)===Qt.type){g(ae,Qt.sibling),J=x(Qt,me.props),J.ref=Cc(ae,Qt,me),J.return=ae,ae=J;break e}g(ae,Qt);break}else c(ae,Qt);Qt=Qt.sibling}me.type===m?(J=bi(me.props.children,ae.mode,st,me.key),J.return=ae,ae=J):(st=Id(me.type,me.key,me.props,null,ae.mode,st),st.ref=Cc(ae,J,me),st.return=ae,ae=st)}return M(ae);case p:e:{for(Qt=me.key;J!==null;){if(J.key===Qt)if(J.tag===4&&J.stateNode.containerInfo===me.containerInfo&&J.stateNode.implementation===me.implementation){g(ae,J.sibling),J=x(J,me.children||[]),J.return=ae,ae=J;break e}else{g(ae,J);break}else c(ae,J);J=J.sibling}J=eg(me,ae.mode,st),J.return=ae,ae=J}return M(ae);case P:return Qt=me._init,ia(ae,J,Qt(me._payload),st)}if(H(me))return Tn(ae,J,me,st);if(R(me))return co(ae,J,me,st);nd(ae,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,J!==null&&J.tag===6?(g(ae,J.sibling),J=x(J,me),J.return=ae,ae=J):(g(ae,J),J=Jm(me,ae.mode,st),J.return=ae,ae=J),M(ae)):g(ae,J)}return ia}var ll=Hy(!0),Vy=Hy(!1),_c={},zo=Mt(_c),kc=Mt(_c),cl=Mt(_c);function As(l){if(l===_c)throw Error(i(174));return l}function pm(l,c){Lt(cl,c),Lt(kc,l),Lt(zo,_c),l=A(c),Dt(zo),Lt(zo,l)}function ul(){Dt(zo),Dt(kc),Dt(cl)}function Wy(l){var c=As(cl.current),g=As(zo.current);c=U(g,l.type,c),g!==c&&(Lt(kc,l),Lt(zo,c))}function hm(l){kc.current===l&&(Dt(zo),Dt(kc))}var tr=Mt(0);function rd(l){for(var c=l;c!==null;){if(c.tag===13){var g=c.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||kr(g)||To(g)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var mm=[];function gm(){for(var l=0;l<mm.length;l++){var c=mm[l];ve?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}mm.length=0}var od=u.ReactCurrentDispatcher,vm=u.ReactCurrentBatchConfig,hi=0,nr=null,Ir=null,Dr=null,sd=!1,jc=!1,Pc=0,LI=0;function Hr(){throw Error(i(321))}function ym(l,c){if(c===null)return!1;for(var g=0;g<c.length&&g<l.length;g++)if(!rn(l[g],c[g]))return!1;return!0}function bm(l,c,g,y,x,j){if(hi=j,nr=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,od.current=l===null||l.memoizedState===null?VI:WI,l=g(y,x),jc){j=0;do{if(jc=!1,Pc=0,25<=j)throw Error(i(301));j+=1,Dr=Ir=null,c.updateQueue=null,od.current=UI,l=g(y,x)}while(jc)}if(od.current=ld,c=Ir!==null&&Ir.next!==null,hi=0,Dr=Ir=nr=null,sd=!1,c)throw Error(i(300));return l}function xm(){var l=Pc!==0;return Pc=0,l}function Ns(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dr===null?nr.memoizedState=Dr=l:Dr=Dr.next=l,Dr}function Lo(){if(Ir===null){var l=nr.alternate;l=l!==null?l.memoizedState:null}else l=Ir.next;var c=Dr===null?nr.memoizedState:Dr.next;if(c!==null)Dr=c,Ir=l;else{if(l===null)throw Error(i(310));Ir=l,l={memoizedState:Ir.memoizedState,baseState:Ir.baseState,baseQueue:Ir.baseQueue,queue:Ir.queue,next:null},Dr===null?nr.memoizedState=Dr=l:Dr=Dr.next=l}return Dr}function Ic(l,c){return typeof c=="function"?c(l):c}function Sm(l){var c=Lo(),g=c.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var y=Ir,x=y.baseQueue,j=g.pending;if(j!==null){if(x!==null){var M=x.next;x.next=j.next,j.next=M}y.baseQueue=x=j,g.pending=null}if(x!==null){j=x.next,y=y.baseState;var Q=M=null,le=null,De=j;do{var pt=De.lane;if((hi&pt)===pt)le!==null&&(le=le.next={lane:0,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null}),y=De.hasEagerState?De.eagerState:l(y,De.action);else{var Ht={lane:pt,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null};le===null?(Q=le=Ht,M=y):le=le.next=Ht,nr.lanes|=pt,mi|=pt}De=De.next}while(De!==null&&De!==j);le===null?M=y:le.next=Q,rn(y,c.memoizedState)||(ao=!0),c.memoizedState=y,c.baseState=M,c.baseQueue=le,g.lastRenderedState=y}if(l=g.interleaved,l!==null){x=l;do j=x.lane,nr.lanes|=j,mi|=j,x=x.next;while(x!==l)}else x===null&&(g.lanes=0);return[c.memoizedState,g.dispatch]}function wm(l){var c=Lo(),g=c.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var y=g.dispatch,x=g.pending,j=c.memoizedState;if(x!==null){g.pending=null;var M=x=x.next;do j=l(j,M.action),M=M.next;while(M!==x);rn(j,c.memoizedState)||(ao=!0),c.memoizedState=j,c.baseQueue===null&&(c.baseState=j),g.lastRenderedState=j}return[j,y]}function Uy(){}function Gy(l,c){var g=nr,y=Lo(),x=c(),j=!rn(y.memoizedState,x);if(j&&(y.memoizedState=x,ao=!0),y=y.queue,Cm(Yy.bind(null,g,y,l),[l]),y.getSnapshot!==c||j||Dr!==null&&Dr.memoizedState.tag&1){if(g.flags|=2048,Ec(9,Ky.bind(null,g,y,x,c),void 0,null),Tr===null)throw Error(i(349));hi&30||qy(g,c,x)}return x}function qy(l,c,g){l.flags|=16384,l={getSnapshot:c,value:g},c=nr.updateQueue,c===null?(c={lastEffect:null,stores:null},nr.updateQueue=c,c.stores=[l]):(g=c.stores,g===null?c.stores=[l]:g.push(l))}function Ky(l,c,g,y){c.value=g,c.getSnapshot=y,Qy(c)&&Xy(l)}function Yy(l,c,g){return g(function(){Qy(c)&&Xy(l)})}function Qy(l){var c=l.getSnapshot;l=l.value;try{var g=c();return!rn(l,g)}catch{return!0}}function Xy(l){var c=Ts(l,1);c!==null&&Fo(c,l,1,-1)}function Zy(l){var c=Ns();return typeof l=="function"&&(l=l()),c.memoizedState=c.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ic,lastRenderedState:l},c.queue=l,l=l.dispatch=HI.bind(null,nr,l),[c.memoizedState,l]}function Ec(l,c,g,y){return l={tag:l,create:c,destroy:g,deps:y,next:null},c=nr.updateQueue,c===null?(c={lastEffect:null,stores:null},nr.updateQueue=c,c.lastEffect=l.next=l):(g=c.lastEffect,g===null?c.lastEffect=l.next=l:(y=g.next,g.next=l,l.next=y,c.lastEffect=l)),l}function Jy(){return Lo().memoizedState}function ad(l,c,g,y){var x=Ns();nr.flags|=l,x.memoizedState=Ec(1|c,g,void 0,y===void 0?null:y)}function id(l,c,g,y){var x=Lo();y=y===void 0?null:y;var j=void 0;if(Ir!==null){var M=Ir.memoizedState;if(j=M.destroy,y!==null&&ym(y,M.deps)){x.memoizedState=Ec(c,g,j,y);return}}nr.flags|=l,x.memoizedState=Ec(1|c,g,j,y)}function eb(l,c){return ad(8390656,8,l,c)}function Cm(l,c){return id(2048,8,l,c)}function tb(l,c){return id(4,2,l,c)}function nb(l,c){return id(4,4,l,c)}function rb(l,c){if(typeof c=="function")return l=l(),c(l),function(){c(null)};if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function ob(l,c,g){return g=g!=null?g.concat([l]):null,id(4,4,rb.bind(null,c,l),g)}function _m(){}function sb(l,c){var g=Lo();c=c===void 0?null:c;var y=g.memoizedState;return y!==null&&c!==null&&ym(c,y[1])?y[0]:(g.memoizedState=[l,c],l)}function ab(l,c){var g=Lo();c=c===void 0?null:c;var y=g.memoizedState;return y!==null&&c!==null&&ym(c,y[1])?y[0]:(l=l(),g.memoizedState=[l,c],l)}function ib(l,c,g){return hi&21?(rn(g,c)||(g=gt(),nr.lanes|=g,mi|=g,l.baseState=!0),c):(l.baseState&&(l.baseState=!1,ao=!0),l.memoizedState=g)}function FI(l,c){var g=ke;ke=g!==0&&4>g?g:4,l(!0);var y=vm.transition;vm.transition={};try{l(!1),c()}finally{ke=g,vm.transition=y}}function lb(){return Lo().memoizedState}function BI(l,c,g){var y=za(l);if(g={lane:y,action:g,hasEagerState:!1,eagerState:null,next:null},cb(l))ub(c,g);else if(g=Dy(l,c,g,y),g!==null){var x=Ur();Fo(g,l,y,x),db(g,c,y)}}function HI(l,c,g){var y=za(l),x={lane:y,action:g,hasEagerState:!1,eagerState:null,next:null};if(cb(l))ub(c,x);else{var j=l.alternate;if(l.lanes===0&&(j===null||j.lanes===0)&&(j=c.lastRenderedReducer,j!==null))try{var M=c.lastRenderedState,Q=j(M,g);if(x.hasEagerState=!0,x.eagerState=Q,rn(Q,M)){var le=c.interleaved;le===null?(x.next=x,cm(c)):(x.next=le.next,le.next=x),c.interleaved=x;return}}catch{}finally{}g=Dy(l,c,x,y),g!==null&&(x=Ur(),Fo(g,l,y,x),db(g,c,y))}}function cb(l){var c=l.alternate;return l===nr||c!==null&&c===nr}function ub(l,c){jc=sd=!0;var g=l.pending;g===null?c.next=c:(c.next=g.next,g.next=c),l.pending=c}function db(l,c,g){if(g&4194240){var y=c.lanes;y&=l.pendingLanes,g|=y,c.lanes=g,Ee(l,g)}}var ld={readContext:$o,useCallback:Hr,useContext:Hr,useEffect:Hr,useImperativeHandle:Hr,useInsertionEffect:Hr,useLayoutEffect:Hr,useMemo:Hr,useReducer:Hr,useRef:Hr,useState:Hr,useDebugValue:Hr,useDeferredValue:Hr,useTransition:Hr,useMutableSource:Hr,useSyncExternalStore:Hr,useId:Hr,unstable_isNewReconciler:!1},VI={readContext:$o,useCallback:function(l,c){return Ns().memoizedState=[l,c===void 0?null:c],l},useContext:$o,useEffect:eb,useImperativeHandle:function(l,c,g){return g=g!=null?g.concat([l]):null,ad(4194308,4,rb.bind(null,c,l),g)},useLayoutEffect:function(l,c){return ad(4194308,4,l,c)},useInsertionEffect:function(l,c){return ad(4,2,l,c)},useMemo:function(l,c){var g=Ns();return c=c===void 0?null:c,l=l(),g.memoizedState=[l,c],l},useReducer:function(l,c,g){var y=Ns();return c=g!==void 0?g(c):c,y.memoizedState=y.baseState=c,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:c},y.queue=l,l=l.dispatch=BI.bind(null,nr,l),[y.memoizedState,l]},useRef:function(l){var c=Ns();return l={current:l},c.memoizedState=l},useState:Zy,useDebugValue:_m,useDeferredValue:function(l){return Ns().memoizedState=l},useTransition:function(){var l=Zy(!1),c=l[0];return l=FI.bind(null,l[1]),Ns().memoizedState=l,[c,l]},useMutableSource:function(){},useSyncExternalStore:function(l,c,g){var y=nr,x=Ns();if(Kn){if(g===void 0)throw Error(i(407));g=g()}else{if(g=c(),Tr===null)throw Error(i(349));hi&30||qy(y,c,g)}x.memoizedState=g;var j={value:g,getSnapshot:c};return x.queue=j,eb(Yy.bind(null,y,j,l),[l]),y.flags|=2048,Ec(9,Ky.bind(null,y,j,g,c),void 0,null),g},useId:function(){var l=Ns(),c=Tr.identifierPrefix;if(Kn){var g=Br,y=Co;g=(y&~(1<<32-Rn(y)-1)).toString(32)+g,c=":"+c+"R"+g,g=Pc++,0<g&&(c+="H"+g.toString(32)),c+=":"}else g=LI++,c=":"+c+"r"+g.toString(32)+":";return l.memoizedState=c},unstable_isNewReconciler:!1},WI={readContext:$o,useCallback:sb,useContext:$o,useEffect:Cm,useImperativeHandle:ob,useInsertionEffect:tb,useLayoutEffect:nb,useMemo:ab,useReducer:Sm,useRef:Jy,useState:function(){return Sm(Ic)},useDebugValue:_m,useDeferredValue:function(l){var c=Lo();return ib(c,Ir.memoizedState,l)},useTransition:function(){var l=Sm(Ic)[0],c=Lo().memoizedState;return[l,c]},useMutableSource:Uy,useSyncExternalStore:Gy,useId:lb,unstable_isNewReconciler:!1},UI={readContext:$o,useCallback:sb,useContext:$o,useEffect:Cm,useImperativeHandle:ob,useInsertionEffect:tb,useLayoutEffect:nb,useMemo:ab,useReducer:wm,useRef:Jy,useState:function(){return wm(Ic)},useDebugValue:_m,useDeferredValue:function(l){var c=Lo();return Ir===null?c.memoizedState=l:ib(c,Ir.memoizedState,l)},useTransition:function(){var l=wm(Ic)[0],c=Lo().memoizedState;return[l,c]},useMutableSource:Uy,useSyncExternalStore:Gy,useId:lb,unstable_isNewReconciler:!1};function dl(l,c){try{var g="",y=c;do g+=zI(y),y=y.return;while(y);var x=g}catch(j){x=`
|
||
Error generating stack: `+j.message+`
|
||
`+j.stack}return{value:l,source:c,stack:x,digest:null}}function km(l,c,g){return{value:l,source:null,stack:g??null,digest:c??null}}function jm(l,c){try{console.error(c.value)}catch(g){setTimeout(function(){throw g})}}var GI=typeof WeakMap=="function"?WeakMap:Map;function fb(l,c,g){g=oa(-1,g),g.tag=3,g.payload={element:null};var y=c.value;return g.callback=function(){wd||(wd=!0,Gm=y),jm(l,c)},g}function pb(l,c,g){g=oa(-1,g),g.tag=3;var y=l.type.getDerivedStateFromError;if(typeof y=="function"){var x=c.value;g.payload=function(){return y(x)},g.callback=function(){jm(l,c)}}var j=l.stateNode;return j!==null&&typeof j.componentDidCatch=="function"&&(g.callback=function(){jm(l,c),typeof y!="function"&&(Na===null?Na=new Set([this]):Na.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})}),g}function hb(l,c,g){var y=l.pingCache;if(y===null){y=l.pingCache=new GI;var x=new Set;y.set(c,x)}else x=y.get(c),x===void 0&&(x=new Set,y.set(c,x));x.has(g)||(x.add(g),l=aE.bind(null,l,c,g),c.then(l,l))}function mb(l){do{var c;if((c=l.tag===13)&&(c=l.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return l;l=l.return}while(l!==null);return null}function gb(l,c,g,y,x){return l.mode&1?(l.flags|=65536,l.lanes=x,l):(l===c?l.flags|=65536:(l.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(c=oa(-1,1),c.tag=2,Aa(g,c,1))),g.lanes|=1),l)}var qI=u.ReactCurrentOwner,ao=!1;function ro(l,c,g,y){c.child=l===null?Vy(c,null,g,y):ll(c,l.child,g,y)}function vb(l,c,g,y,x){g=g.render;var j=c.ref;return il(c,x),y=bm(l,c,g,y,j,x),g=xm(),l!==null&&!ao?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~x,sa(l,c,x)):(Kn&&g&&em(c),c.flags|=1,ro(l,c,y,x),c.child)}function yb(l,c,g,y,x){if(l===null){var j=g.type;return typeof j=="function"&&!Zm(j)&&j.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(c.tag=15,c.type=j,bb(l,c,j,y,x)):(l=Id(g.type,null,y,c,c.mode,x),l.ref=c.ref,l.return=c,c.child=l)}if(j=l.child,!(l.lanes&x)){var M=j.memoizedProps;if(g=g.compare,g=g!==null?g:Qu,g(M,y)&&l.ref===c.ref)return sa(l,c,x)}return c.flags|=1,l=Fa(j,y),l.ref=c.ref,l.return=c,c.child=l}function bb(l,c,g,y,x){if(l!==null){var j=l.memoizedProps;if(Qu(j,y)&&l.ref===c.ref)if(ao=!1,c.pendingProps=y=j,(l.lanes&x)!==0)l.flags&131072&&(ao=!0);else return c.lanes=l.lanes,sa(l,c,x)}return Pm(l,c,g,y,x)}function xb(l,c,g){var y=c.pendingProps,x=y.children,j=l!==null?l.memoizedState:null;if(y.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Lt(pl,ko),ko|=g;else{if(!(g&1073741824))return l=j!==null?j.baseLanes|g:g,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null,transitions:null},c.updateQueue=null,Lt(pl,ko),ko|=l,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=j!==null?j.baseLanes:g,Lt(pl,ko),ko|=y}else j!==null?(y=j.baseLanes|g,c.memoizedState=null):y=g,Lt(pl,ko),ko|=y;return ro(l,c,x,g),c.child}function Sb(l,c){var g=c.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(c.flags|=512,c.flags|=2097152)}function Pm(l,c,g,y,x){var j=Gn(g)?Cn:Wt.current;return j=jr(c,j),il(c,x),g=bm(l,c,g,y,j,x),y=xm(),l!==null&&!ao?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~x,sa(l,c,x)):(Kn&&y&&em(c),c.flags|=1,ro(l,c,g,x),c.child)}function wb(l,c,g,y,x){if(Gn(g)){var j=!0;qn(c)}else j=!1;if(il(c,x),c.stateNode===null)ud(l,c),Ly(c,g,y),fm(c,g,y,x),y=!0;else if(l===null){var M=c.stateNode,Q=c.memoizedProps;M.props=Q;var le=M.context,De=g.contextType;typeof De=="object"&&De!==null?De=$o(De):(De=Gn(g)?Cn:Wt.current,De=jr(c,De));var pt=g.getDerivedStateFromProps,Ht=typeof pt=="function"||typeof M.getSnapshotBeforeUpdate=="function";Ht||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Q!==y||le!==De)&&Fy(c,M,y,De),Ta=!1;var nt=c.memoizedState;M.state=nt,ed(c,y,M,x),le=c.memoizedState,Q!==y||nt!==le||Zt.current||Ta?(typeof pt=="function"&&(dm(c,g,pt,y),le=c.memoizedState),(Q=Ta||zy(c,g,Q,y,nt,le,De))?(Ht||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(c.flags|=4194308)):(typeof M.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=le),M.props=y,M.state=le,M.context=De,y=Q):(typeof M.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{M=c.stateNode,Ty(l,c),Q=c.memoizedProps,De=c.type===c.elementType?Q:ls(c.type,Q),M.props=De,Ht=c.pendingProps,nt=M.context,le=g.contextType,typeof le=="object"&&le!==null?le=$o(le):(le=Gn(g)?Cn:Wt.current,le=jr(c,le));var Fn=g.getDerivedStateFromProps;(pt=typeof Fn=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Q!==Ht||nt!==le)&&Fy(c,M,y,le),Ta=!1,nt=c.memoizedState,M.state=nt,ed(c,y,M,x);var Tn=c.memoizedState;Q!==Ht||nt!==Tn||Zt.current||Ta?(typeof Fn=="function"&&(dm(c,g,Fn,y),Tn=c.memoizedState),(De=Ta||zy(c,g,De,y,nt,Tn,le)||!1)?(pt||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(y,Tn,le),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(y,Tn,le)),typeof M.componentDidUpdate=="function"&&(c.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof M.componentDidUpdate!="function"||Q===l.memoizedProps&&nt===l.memoizedState||(c.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||Q===l.memoizedProps&&nt===l.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Tn),M.props=y,M.state=Tn,M.context=le,y=De):(typeof M.componentDidUpdate!="function"||Q===l.memoizedProps&&nt===l.memoizedState||(c.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||Q===l.memoizedProps&&nt===l.memoizedState||(c.flags|=1024),y=!1)}return Im(l,c,g,y,j,x)}function Im(l,c,g,y,x,j){Sb(l,c);var M=(c.flags&128)!==0;if(!y&&!M)return x&&ir(c,g,!1),sa(l,c,j);y=c.stateNode,qI.current=c;var Q=M&&typeof g.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,l!==null&&M?(c.child=ll(c,l.child,null,j),c.child=ll(c,null,Q,j)):ro(l,c,Q,j),c.memoizedState=y.state,x&&ir(c,g,!0),c.child}function Cb(l){var c=l.stateNode;c.pendingContext?Sn(l,c.pendingContext,c.pendingContext!==c.context):c.context&&Sn(l,c.context,!1),pm(l,c.containerInfo)}function _b(l,c,g,y,x){return sl(),om(x),c.flags|=256,ro(l,c,g,y),c.child}var Em={dehydrated:null,treeContext:null,retryLane:0};function Om(l){return{baseLanes:l,cachePool:null,transitions:null}}function kb(l,c,g){var y=c.pendingProps,x=tr.current,j=!1,M=(c.flags&128)!==0,Q;if((Q=M)||(Q=l!==null&&l.memoizedState===null?!1:(x&2)!==0),Q?(j=!0,c.flags&=-129):(l===null||l.memoizedState!==null)&&(x|=1),Lt(tr,x&1),l===null)return rm(c),l=c.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?(c.mode&1?To(l)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(M=y.children,l=y.fallback,j?(y=c.mode,j=c.child,M={mode:"hidden",children:M},!(y&1)&&j!==null?(j.childLanes=0,j.pendingProps=M):j=Ed(M,y,0,null),l=bi(l,y,g,null),j.return=c,l.return=c,j.sibling=l,c.child=j,c.child.memoizedState=Om(g),c.memoizedState=Em,l):Rm(c,M));if(x=l.memoizedState,x!==null&&(Q=x.dehydrated,Q!==null))return KI(l,c,M,y,Q,x,g);if(j){j=y.fallback,M=c.mode,x=l.child,Q=x.sibling;var le={mode:"hidden",children:y.children};return!(M&1)&&c.child!==x?(y=c.child,y.childLanes=0,y.pendingProps=le,c.deletions=null):(y=Fa(x,le),y.subtreeFlags=x.subtreeFlags&14680064),Q!==null?j=Fa(Q,j):(j=bi(j,M,g,null),j.flags|=2),j.return=c,y.return=c,y.sibling=j,c.child=y,y=j,j=c.child,M=l.child.memoizedState,M=M===null?Om(g):{baseLanes:M.baseLanes|g,cachePool:null,transitions:M.transitions},j.memoizedState=M,j.childLanes=l.childLanes&~g,c.memoizedState=Em,y}return j=l.child,l=j.sibling,y=Fa(j,{mode:"visible",children:y.children}),!(c.mode&1)&&(y.lanes=g),y.return=c,y.sibling=null,l!==null&&(g=c.deletions,g===null?(c.deletions=[l],c.flags|=16):g.push(l)),c.child=y,c.memoizedState=null,y}function Rm(l,c){return c=Ed({mode:"visible",children:c},l.mode,0,null),c.return=l,l.child=c}function cd(l,c,g,y){return y!==null&&om(y),ll(c,l.child,null,g),l=Rm(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function KI(l,c,g,y,x,j,M){if(g)return c.flags&256?(c.flags&=-257,y=km(Error(i(422))),cd(l,c,M,y)):c.memoizedState!==null?(c.child=l.child,c.flags|=128,null):(j=y.fallback,x=c.mode,y=Ed({mode:"visible",children:y.children},x,0,null),j=bi(j,x,M,null),j.flags|=2,y.return=c,j.return=c,y.sibling=j,c.child=y,c.mode&1&&ll(c,l.child,null,M),c.child.memoizedState=Om(M),c.memoizedState=Em,j);if(!(c.mode&1))return cd(l,c,M,null);if(To(x))return y=ta(x).digest,j=Error(i(419)),y=km(j,y,void 0),cd(l,c,M,y);if(g=(M&l.childLanes)!==0,ao||g){if(y=Tr,y!==null){switch(M&-M){case 4:x=2;break;case 16:x=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:x=32;break;case 536870912:x=268435456;break;default:x=0}x=x&(y.suspendedLanes|M)?0:x,x!==0&&x!==j.retryLane&&(j.retryLane=x,Ts(l,x),Fo(y,l,x,-1))}return Xm(),y=km(Error(i(421))),cd(l,c,M,y)}return kr(x)?(c.flags|=128,c.child=l.child,c=iE.bind(null,l),Ma(x,c),null):(l=j.treeContext,Ne&&(No=ue(x),_o=c,Kn=!0,is=null,wc=!1,l!==null&&(to[no++]=Co,to[no++]=Br,to[no++]=Ao,Co=l.id,Br=l.overflow,Ao=c)),c=Rm(c,y.children),c.flags|=4096,c)}function jb(l,c,g){l.lanes|=c;var y=l.alternate;y!==null&&(y.lanes|=c),lm(l.return,c,g)}function Mm(l,c,g,y,x){var j=l.memoizedState;j===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:g,tailMode:x}:(j.isBackwards=c,j.rendering=null,j.renderingStartTime=0,j.last=y,j.tail=g,j.tailMode=x)}function Pb(l,c,g){var y=c.pendingProps,x=y.revealOrder,j=y.tail;if(ro(l,c,y.children,g),y=tr.current,y&2)y=y&1|2,c.flags|=128;else{if(l!==null&&l.flags&128)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&jb(l,g,c);else if(l.tag===19)jb(l,g,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}y&=1}if(Lt(tr,y),!(c.mode&1))c.memoizedState=null;else switch(x){case"forwards":for(g=c.child,x=null;g!==null;)l=g.alternate,l!==null&&rd(l)===null&&(x=g),g=g.sibling;g=x,g===null?(x=c.child,c.child=null):(x=g.sibling,g.sibling=null),Mm(c,!1,x,g,j);break;case"backwards":for(g=null,x=c.child,c.child=null;x!==null;){if(l=x.alternate,l!==null&&rd(l)===null){c.child=x;break}l=x.sibling,x.sibling=g,g=x,x=l}Mm(c,!0,g,null,j);break;case"together":Mm(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function ud(l,c){!(c.mode&1)&&l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2)}function sa(l,c,g){if(l!==null&&(c.dependencies=l.dependencies),mi|=c.lanes,!(g&c.childLanes))return null;if(l!==null&&c.child!==l.child)throw Error(i(153));if(c.child!==null){for(l=c.child,g=Fa(l,l.pendingProps),c.child=g,g.return=c;l.sibling!==null;)l=l.sibling,g=g.sibling=Fa(l,l.pendingProps),g.return=c;g.sibling=null}return c.child}function YI(l,c,g){switch(c.tag){case 3:Cb(c),sl();break;case 5:Wy(c);break;case 1:Gn(c.type)&&qn(c);break;case 4:pm(c,c.stateNode.containerInfo);break;case 10:My(c,c.type._context,c.memoizedProps.value);break;case 13:var y=c.memoizedState;if(y!==null)return y.dehydrated!==null?(Lt(tr,tr.current&1),c.flags|=128,null):g&c.child.childLanes?kb(l,c,g):(Lt(tr,tr.current&1),l=sa(l,c,g),l!==null?l.sibling:null);Lt(tr,tr.current&1);break;case 19:if(y=(g&c.childLanes)!==0,l.flags&128){if(y)return Pb(l,c,g);c.flags|=128}var x=c.memoizedState;if(x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),Lt(tr,tr.current),y)break;return null;case 22:case 23:return c.lanes=0,xb(l,c,g)}return sa(l,c,g)}function $s(l){l.flags|=4}function Ib(l,c){if(l!==null&&l.child===c.child)return!0;if(c.flags&16)return!1;for(l=c.child;l!==null;){if(l.flags&12854||l.subtreeFlags&12854)return!1;l=l.sibling}return!0}var Oc,Rc,dd,fd;if(he)Oc=function(l,c){for(var g=c.child;g!==null;){if(g.tag===5||g.tag===6)be(l,g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===c)break;for(;g.sibling===null;){if(g.return===null||g.return===c)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},Rc=function(){},dd=function(l,c,g,y,x){if(l=l.memoizedProps,l!==y){var j=c.stateNode,M=As(zo.current);g=se(j,g,l,y,x,M),(c.updateQueue=g)&&$s(c)}},fd=function(l,c,g,y){g!==y&&$s(c)};else if(je){Oc=function(l,c,g,y){for(var x=c.child;x!==null;){if(x.tag===5){var j=x.stateNode;g&&y&&(j=Mo(j,x.type,x.memoizedProps,x)),be(l,j)}else if(x.tag===6)j=x.stateNode,g&&y&&(j=Do(j,x.memoizedProps,x)),be(l,j);else if(x.tag!==4){if(x.tag===22&&x.memoizedState!==null)j=x.child,j!==null&&(j.return=x),Oc(l,x,!0,!0);else if(x.child!==null){x.child.return=x,x=x.child;continue}}if(x===c)break;for(;x.sibling===null;){if(x.return===null||x.return===c)return;x=x.return}x.sibling.return=x.return,x=x.sibling}};var Eb=function(l,c,g,y){for(var x=c.child;x!==null;){if(x.tag===5){var j=x.stateNode;g&&y&&(j=Mo(j,x.type,x.memoizedProps,x)),In(l,j)}else if(x.tag===6)j=x.stateNode,g&&y&&(j=Do(j,x.memoizedProps,x)),In(l,j);else if(x.tag!==4){if(x.tag===22&&x.memoizedState!==null)j=x.child,j!==null&&(j.return=x),Eb(l,x,!0,!0);else if(x.child!==null){x.child.return=x,x=x.child;continue}}if(x===c)break;for(;x.sibling===null;){if(x.return===null||x.return===c)return;x=x.return}x.sibling.return=x.return,x=x.sibling}};Rc=function(l,c){var g=c.stateNode;if(!Ib(l,c)){l=g.containerInfo;var y=kn(l);Eb(y,c,!1,!1),g.pendingChildren=y,$s(c),os(l,y)}},dd=function(l,c,g,y,x){var j=l.stateNode,M=l.memoizedProps;if((l=Ib(l,c))&&M===y)c.stateNode=j;else{var Q=c.stateNode,le=As(zo.current),De=null;M!==y&&(De=se(Q,g,M,y,x,le)),l&&De===null?c.stateNode=j:(j=xr(j,De,g,M,y,c,l,Q),ce(j,g,y,x,le)&&$s(c),c.stateNode=j,l?$s(c):Oc(j,c,!1,!1))}},fd=function(l,c,g,y){g!==y?(l=As(cl.current),g=As(zo.current),c.stateNode=ie(y,l,g,c),$s(c)):c.stateNode=l.stateNode}}else Rc=function(){},dd=function(){},fd=function(){};function Mc(l,c){if(!Kn)switch(l.tailMode){case"hidden":c=l.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var y=null;g!==null;)g.alternate!==null&&(y=g),g=g.sibling;y===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:y.sibling=null}}function Vr(l){var c=l.alternate!==null&&l.alternate.child===l.child,g=0,y=0;if(c)for(var x=l.child;x!==null;)g|=x.lanes|x.childLanes,y|=x.subtreeFlags&14680064,y|=x.flags&14680064,x.return=l,x=x.sibling;else for(x=l.child;x!==null;)g|=x.lanes|x.childLanes,y|=x.subtreeFlags,y|=x.flags,x.return=l,x=x.sibling;return l.subtreeFlags|=y,l.childLanes=g,c}function QI(l,c,g){var y=c.pendingProps;switch(tm(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vr(c),null;case 1:return Gn(c.type)&&Ct(),Vr(c),null;case 3:return g=c.stateNode,ul(),Dt(Zt),Dt(Wt),gm(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(l===null||l.child===null)&&(Yu(c)?$s(c):l===null||l.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,is!==null&&(Ym(is),is=null))),Rc(l,c),Vr(c),null;case 5:hm(c),g=As(cl.current);var x=c.type;if(l!==null&&c.stateNode!=null)dd(l,c,x,y,g),l.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(i(166));return Vr(c),null}if(l=As(zo.current),Yu(c)){if(!Ne)throw Error(i(175));l=ye(c.stateNode,c.type,c.memoizedProps,g,l,c,!wc),c.updateQueue=l,l!==null&&$s(c)}else{var j=re(x,y,g,l,c);Oc(j,c,!1,!1),c.stateNode=j,ce(j,x,y,g,l)&&$s(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Vr(c),null;case 6:if(l&&c.stateNode!=null)fd(l,c,l.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(i(166));if(l=As(cl.current),g=As(zo.current),Yu(c)){if(!Ne)throw Error(i(176));if(l=c.stateNode,g=c.memoizedProps,(y=Se(l,g,c,!wc))&&(x=_o,x!==null))switch(x.tag){case 3:Ve(x.stateNode.containerInfo,l,g,(x.mode&1)!==0);break;case 5:wt(x.type,x.memoizedProps,x.stateNode,l,g,(x.mode&1)!==0)}y&&$s(c)}else c.stateNode=ie(y,l,g,c)}return Vr(c),null;case 13:if(Dt(tr),y=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Kn&&No!==null&&c.mode&1&&!(c.flags&128))Ry(),sl(),c.flags|=98560,x=!1;else if(x=Yu(c),y!==null&&y.dehydrated!==null){if(l===null){if(!x)throw Error(i(318));if(!Ne)throw Error(i(344));if(x=c.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(i(317));Ye(x,c)}else sl(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Vr(c),x=!1}else is!==null&&(Ym(is),is=null),x=!0;if(!x)return c.flags&65536?c:null}return c.flags&128?(c.lanes=g,c):(g=y!==null,g!==(l!==null&&l.memoizedState!==null)&&g&&(c.child.flags|=8192,c.mode&1&&(l===null||tr.current&1?Er===0&&(Er=3):Xm())),c.updateQueue!==null&&(c.flags|=4),Vr(c),null);case 4:return ul(),Rc(l,c),l===null&&Oe(c.stateNode.containerInfo),Vr(c),null;case 10:return im(c.type._context),Vr(c),null;case 17:return Gn(c.type)&&Ct(),Vr(c),null;case 19:if(Dt(tr),x=c.memoizedState,x===null)return Vr(c),null;if(y=(c.flags&128)!==0,j=x.rendering,j===null)if(y)Mc(x,!1);else{if(Er!==0||l!==null&&l.flags&128)for(l=c.child;l!==null;){if(j=rd(l),j!==null){for(c.flags|=128,Mc(x,!1),l=j.updateQueue,l!==null&&(c.updateQueue=l,c.flags|=4),c.subtreeFlags=0,l=g,g=c.child;g!==null;)y=g,x=l,y.flags&=14680066,j=y.alternate,j===null?(y.childLanes=0,y.lanes=x,y.child=null,y.subtreeFlags=0,y.memoizedProps=null,y.memoizedState=null,y.updateQueue=null,y.dependencies=null,y.stateNode=null):(y.childLanes=j.childLanes,y.lanes=j.lanes,y.child=j.child,y.subtreeFlags=0,y.deletions=null,y.memoizedProps=j.memoizedProps,y.memoizedState=j.memoizedState,y.updateQueue=j.updateQueue,y.type=j.type,x=j.dependencies,y.dependencies=x===null?null:{lanes:x.lanes,firstContext:x.firstContext}),g=g.sibling;return Lt(tr,tr.current&1|2),c.child}l=l.sibling}x.tail!==null&&ze()>Um&&(c.flags|=128,y=!0,Mc(x,!1),c.lanes=4194304)}else{if(!y)if(l=rd(j),l!==null){if(c.flags|=128,y=!0,l=l.updateQueue,l!==null&&(c.updateQueue=l,c.flags|=4),Mc(x,!0),x.tail===null&&x.tailMode==="hidden"&&!j.alternate&&!Kn)return Vr(c),null}else 2*ze()-x.renderingStartTime>Um&&g!==1073741824&&(c.flags|=128,y=!0,Mc(x,!1),c.lanes=4194304);x.isBackwards?(j.sibling=c.child,c.child=j):(l=x.last,l!==null?l.sibling=j:c.child=j,x.last=j)}return x.tail!==null?(c=x.tail,x.rendering=c,x.tail=c.sibling,x.renderingStartTime=ze(),c.sibling=null,l=tr.current,Lt(tr,y?l&1|2:l&1),c):(Vr(c),null);case 22:case 23:return Qm(),g=c.memoizedState!==null,l!==null&&l.memoizedState!==null!==g&&(c.flags|=8192),g&&c.mode&1?ko&1073741824&&(Vr(c),he&&c.subtreeFlags&6&&(c.flags|=8192)):Vr(c),null;case 24:return null;case 25:return null}throw Error(i(156,c.tag))}function XI(l,c){switch(tm(c),c.tag){case 1:return Gn(c.type)&&Ct(),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return ul(),Dt(Zt),Dt(Wt),gm(),l=c.flags,l&65536&&!(l&128)?(c.flags=l&-65537|128,c):null;case 5:return hm(c),null;case 13:if(Dt(tr),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(i(340));sl()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return Dt(tr),null;case 4:return ul(),null;case 10:return im(c.type._context),null;case 22:case 23:return Qm(),null;case 24:return null;default:return null}}var pd=!1,Wr=!1,ZI=typeof WeakSet=="function"?WeakSet:Set,ct=null;function fl(l,c){var g=l.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(y){Yn(l,c,y)}else g.current=null}function Dm(l,c,g){try{g()}catch(y){Yn(l,c,y)}}var Ob=!1;function JI(l,c){for(V(l.containerInfo),ct=c;ct!==null;)if(l=ct,c=l.child,(l.subtreeFlags&1028)!==0&&c!==null)c.return=l,ct=c;else for(;ct!==null;){l=ct;try{var g=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,x=g.memoizedState,j=l.stateNode,M=j.getSnapshotBeforeUpdate(l.elementType===l.type?y:ls(l.type,y),x);j.__reactInternalSnapshotBeforeUpdate=M}break;case 3:he&&xn(l.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Q){Yn(l,l.return,Q)}if(c=l.sibling,c!==null){c.return=l.return,ct=c;break}ct=l.return}return g=Ob,Ob=!1,g}function Dc(l,c,g){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var x=y=y.next;do{if((x.tag&l)===l){var j=x.destroy;x.destroy=void 0,j!==void 0&&Dm(c,g,j)}x=x.next}while(x!==y)}}function hd(l,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var g=c=c.next;do{if((g.tag&l)===l){var y=g.create;g.destroy=y()}g=g.next}while(g!==c)}}function Tm(l){var c=l.ref;if(c!==null){var g=l.stateNode;switch(l.tag){case 5:l=K(g);break;default:l=g}typeof c=="function"?c(l):c.current=l}}function Rb(l){var c=l.alternate;c!==null&&(l.alternate=null,Rb(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&Fe(c)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Mb(l){return l.tag===5||l.tag===3||l.tag===4}function Db(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Mb(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Am(l,c,g){var y=l.tag;if(y===5||y===6)l=l.stateNode,c?Un(g,l,c):Xt(g,l);else if(y!==4&&(l=l.child,l!==null))for(Am(l,c,g),l=l.sibling;l!==null;)Am(l,c,g),l=l.sibling}function Nm(l,c,g){var y=l.tag;if(y===5||y===6)l=l.stateNode,c?cn(g,l,c):bt(g,l);else if(y!==4&&(l=l.child,l!==null))for(Nm(l,c,g),l=l.sibling;l!==null;)Nm(l,c,g),l=l.sibling}var $r=null,cs=!1;function zs(l,c,g){for(g=g.child;g!==null;)$m(l,c,g),g=g.sibling}function $m(l,c,g){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(Ln,g)}catch{}switch(g.tag){case 5:Wr||fl(g,c);case 6:if(he){var y=$r,x=cs;$r=null,zs(l,c,g),$r=y,cs=x,$r!==null&&(cs?Je($r,g.stateNode):Re($r,g.stateNode))}else zs(l,c,g);break;case 18:he&&$r!==null&&(cs?Ge($r,g.stateNode):He($r,g.stateNode));break;case 4:he?(y=$r,x=cs,$r=g.stateNode.containerInfo,cs=!0,zs(l,c,g),$r=y,cs=x):(je&&(y=g.stateNode.containerInfo,x=kn(y),dn(y,x)),zs(l,c,g));break;case 0:case 11:case 14:case 15:if(!Wr&&(y=g.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){x=y=y.next;do{var j=x,M=j.destroy;j=j.tag,M!==void 0&&(j&2||j&4)&&Dm(g,c,M),x=x.next}while(x!==y)}zs(l,c,g);break;case 1:if(!Wr&&(fl(g,c),y=g.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=g.memoizedProps,y.state=g.memoizedState,y.componentWillUnmount()}catch(Q){Yn(g,c,Q)}zs(l,c,g);break;case 21:zs(l,c,g);break;case 22:g.mode&1?(Wr=(y=Wr)||g.memoizedState!==null,zs(l,c,g),Wr=y):zs(l,c,g);break;default:zs(l,c,g)}}function Tb(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var g=l.stateNode;g===null&&(g=l.stateNode=new ZI),c.forEach(function(y){var x=lE.bind(null,l,y);g.has(y)||(g.add(y),y.then(x,x))})}}function us(l,c){var g=c.deletions;if(g!==null)for(var y=0;y<g.length;y++){var x=g[y];try{var j=l,M=c;if(he){var Q=M;e:for(;Q!==null;){switch(Q.tag){case 5:$r=Q.stateNode,cs=!1;break e;case 3:$r=Q.stateNode.containerInfo,cs=!0;break e;case 4:$r=Q.stateNode.containerInfo,cs=!0;break e}Q=Q.return}if($r===null)throw Error(i(160));$m(j,M,x),$r=null,cs=!1}else $m(j,M,x);var le=x.alternate;le!==null&&(le.return=null),x.return=null}catch(De){Yn(x,c,De)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Ab(c,l),c=c.sibling}function Ab(l,c){var g=l.alternate,y=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(us(c,l),Ls(l),y&4){try{Dc(3,l,l.return),hd(3,l)}catch(nt){Yn(l,l.return,nt)}try{Dc(5,l,l.return)}catch(nt){Yn(l,l.return,nt)}}break;case 1:us(c,l),Ls(l),y&512&&g!==null&&fl(g,g.return);break;case 5:if(us(c,l),Ls(l),y&512&&g!==null&&fl(g,g.return),he){if(l.flags&32){var x=l.stateNode;try{it(x)}catch(nt){Yn(l,l.return,nt)}}if(y&4&&(x=l.stateNode,x!=null)){var j=l.memoizedProps;if(g=g!==null?g.memoizedProps:j,y=l.type,c=l.updateQueue,l.updateQueue=null,c!==null)try{pr(x,c,y,g,j,l)}catch(nt){Yn(l,l.return,nt)}}}break;case 6:if(us(c,l),Ls(l),y&4&&he){if(l.stateNode===null)throw Error(i(162));x=l.stateNode,j=l.memoizedProps,g=g!==null?g.memoizedProps:j;try{ln(x,g,j)}catch(nt){Yn(l,l.return,nt)}}break;case 3:if(us(c,l),Ls(l),y&4){if(he&&Ne&&g!==null&&g.memoizedState.isDehydrated)try{zt(c.containerInfo)}catch(nt){Yn(l,l.return,nt)}if(je){x=c.containerInfo,j=c.pendingChildren;try{dn(x,j)}catch(nt){Yn(l,l.return,nt)}}}break;case 4:if(us(c,l),Ls(l),y&4&&je){j=l.stateNode,x=j.containerInfo,j=j.pendingChildren;try{dn(x,j)}catch(nt){Yn(l,l.return,nt)}}break;case 13:us(c,l),Ls(l),x=l.child,x.flags&8192&&(j=x.memoizedState!==null,x.stateNode.isHidden=j,!j||x.alternate!==null&&x.alternate.memoizedState!==null||(Wm=ze())),y&4&&Tb(l);break;case 22:var M=g!==null&&g.memoizedState!==null;if(l.mode&1?(Wr=(g=Wr)||M,us(c,l),Wr=g):us(c,l),Ls(l),y&8192){if(g=l.memoizedState!==null,(l.stateNode.isHidden=g)&&!M&&l.mode&1)for(ct=l,y=l.child;y!==null;){for(c=ct=y;ct!==null;){M=ct;var Q=M.child;switch(M.tag){case 0:case 11:case 14:case 15:Dc(4,M,M.return);break;case 1:fl(M,M.return);var le=M.stateNode;if(typeof le.componentWillUnmount=="function"){var De=M,pt=M.return;try{var Ht=De;le.props=Ht.memoizedProps,le.state=Ht.memoizedState,le.componentWillUnmount()}catch(nt){Yn(De,pt,nt)}}break;case 5:fl(M,M.return);break;case 22:if(M.memoizedState!==null){zb(c);continue}}Q!==null?(Q.return=M,ct=Q):zb(c)}y=y.sibling}if(he){e:if(y=null,he)for(c=l;;){if(c.tag===5){if(y===null){y=c;try{x=c.stateNode,g?dt(x):hr(c.stateNode,c.memoizedProps)}catch(nt){Yn(l,l.return,nt)}}}else if(c.tag===6){if(y===null)try{j=c.stateNode,g?$t(j):un(j,c.memoizedProps)}catch(nt){Yn(l,l.return,nt)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===l)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break e;for(;c.sibling===null;){if(c.return===null||c.return===l)break e;y===c&&(y=null),c=c.return}y===c&&(y=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:us(c,l),Ls(l),y&4&&Tb(l);break;case 21:break;default:us(c,l),Ls(l)}}function Ls(l){var c=l.flags;if(c&2){try{if(he){e:{for(var g=l.return;g!==null;){if(Mb(g)){var y=g;break e}g=g.return}throw Error(i(160))}switch(y.tag){case 5:var x=y.stateNode;y.flags&32&&(it(x),y.flags&=-33);var j=Db(l);Nm(l,j,x);break;case 3:case 4:var M=y.stateNode.containerInfo,Q=Db(l);Am(l,Q,M);break;default:throw Error(i(161))}}}catch(le){Yn(l,l.return,le)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function eE(l,c,g){ct=l,Nb(l)}function Nb(l,c,g){for(var y=(l.mode&1)!==0;ct!==null;){var x=ct,j=x.child;if(x.tag===22&&y){var M=x.memoizedState!==null||pd;if(!M){var Q=x.alternate,le=Q!==null&&Q.memoizedState!==null||Wr;Q=pd;var De=Wr;if(pd=M,(Wr=le)&&!De)for(ct=x;ct!==null;)M=ct,le=M.child,M.tag===22&&M.memoizedState!==null?Lb(x):le!==null?(le.return=M,ct=le):Lb(x);for(;j!==null;)ct=j,Nb(j),j=j.sibling;ct=x,pd=Q,Wr=De}$b(l)}else x.subtreeFlags&8772&&j!==null?(j.return=x,ct=j):$b(l)}}function $b(l){for(;ct!==null;){var c=ct;if(c.flags&8772){var g=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Wr||hd(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!Wr)if(g===null)y.componentDidMount();else{var x=c.elementType===c.type?g.memoizedProps:ls(c.type,g.memoizedProps);y.componentDidUpdate(x,g.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var j=c.updateQueue;j!==null&&Ny(c,j,y);break;case 3:var M=c.updateQueue;if(M!==null){if(g=null,c.child!==null)switch(c.child.tag){case 5:g=K(c.child.stateNode);break;case 1:g=c.child.stateNode}Ny(c,M,g)}break;case 5:var Q=c.stateNode;g===null&&c.flags&4&&_n(Q,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(Ne&&c.memoizedState===null){var le=c.alternate;if(le!==null){var De=le.memoizedState;if(De!==null){var pt=De.dehydrated;pt!==null&<(pt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}Wr||c.flags&512&&Tm(c)}catch(Ht){Yn(c,c.return,Ht)}}if(c===l){ct=null;break}if(g=c.sibling,g!==null){g.return=c.return,ct=g;break}ct=c.return}}function zb(l){for(;ct!==null;){var c=ct;if(c===l){ct=null;break}var g=c.sibling;if(g!==null){g.return=c.return,ct=g;break}ct=c.return}}function Lb(l){for(;ct!==null;){var c=ct;try{switch(c.tag){case 0:case 11:case 15:var g=c.return;try{hd(4,c)}catch(le){Yn(c,g,le)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var x=c.return;try{y.componentDidMount()}catch(le){Yn(c,x,le)}}var j=c.return;try{Tm(c)}catch(le){Yn(c,j,le)}break;case 5:var M=c.return;try{Tm(c)}catch(le){Yn(c,M,le)}}}catch(le){Yn(c,c.return,le)}if(c===l){ct=null;break}var Q=c.sibling;if(Q!==null){Q.return=c.return,ct=Q;break}ct=c.return}}var md=0,gd=1,vd=2,yd=3,bd=4;if(typeof Symbol=="function"&&Symbol.for){var Tc=Symbol.for;md=Tc("selector.component"),gd=Tc("selector.has_pseudo_class"),vd=Tc("selector.role"),yd=Tc("selector.test_id"),bd=Tc("selector.text")}function zm(l){var c=ge(l);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(i(364));return c}if(l=zn(l),l===null)throw Error(i(362));return l.stateNode.current}function Lm(l,c){switch(c.$$typeof){case md:if(l.type===c.value)return!0;break;case gd:e:{c=c.value,l=[l,0];for(var g=0;g<l.length;){var y=l[g++],x=l[g++],j=c[x];if(y.tag!==5||!te(y)){for(;j!=null&&Lm(y,j);)x++,j=c[x];if(x===c.length){c=!0;break e}else for(y=y.child;y!==null;)l.push(y,x),y=y.sibling}}c=!1}return c;case vd:if(l.tag===5&&fe(l.stateNode,c.value))return!0;break;case bd:if((l.tag===5||l.tag===6)&&(l=Ce(l),l!==null&&0<=l.indexOf(c.value)))return!0;break;case yd:if(l.tag===5&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function Fm(l){switch(l.$$typeof){case md:return"<"+(O(l.value)||"Unknown")+">";case gd:return":has("+(Fm(l)||"")+")";case vd:return'[role="'+l.value+'"]';case bd:return'"'+l.value+'"';case yd:return'[data-testname="'+l.value+'"]';default:throw Error(i(365))}}function Fb(l,c){var g=[];l=[l,0];for(var y=0;y<l.length;){var x=l[y++],j=l[y++],M=c[j];if(x.tag!==5||!te(x)){for(;M!=null&&Lm(x,M);)j++,M=c[j];if(j===c.length)g.push(x);else for(x=x.child;x!==null;)l.push(x,j),x=x.sibling}}return g}function Bm(l,c){if(!St)throw Error(i(363));l=zm(l),l=Fb(l,c),c=[],l=Array.from(l);for(var g=0;g<l.length;){var y=l[g++];if(y.tag===5)te(y)||c.push(y.stateNode);else for(y=y.child;y!==null;)l.push(y),y=y.sibling}return c}var tE=Math.ceil,xd=u.ReactCurrentDispatcher,Hm=u.ReactCurrentOwner,mr=u.ReactCurrentBatchConfig,Jt=0,Tr=null,Sr=null,zr=0,ko=0,pl=Mt(0),Er=0,Ac=null,mi=0,Sd=0,Vm=0,Nc=null,io=null,Wm=0,Um=1/0,aa=null;function hl(){Um=ze()+500}var wd=!1,Gm=null,Na=null,Cd=!1,$a=null,_d=0,$c=0,qm=null,kd=-1,jd=0;function Ur(){return Jt&6?ze():kd!==-1?kd:kd=ze()}function za(l){return l.mode&1?Jt&2&&zr!==0?zr&-zr:$I.transition!==null?(jd===0&&(jd=gt()),jd):(l=ke,l!==0?l:at()):1}function Fo(l,c,g,y){if(50<$c)throw $c=0,qm=null,Error(i(185));ft(l,g,y),(!(Jt&2)||l!==Tr)&&(l===Tr&&(!(Jt&2)&&(Sd|=g),Er===4&&La(l,zr)),lo(l,y),g===1&&Jt===0&&!(c.mode&1)&&(hl(),Nr&&wo()))}function lo(l,c){var g=l.callbackNode;vt(l,c);var y=We(l,l===Tr?zr:0);if(y===0)g!==null&&Qe(g),l.callbackNode=null,l.callbackPriority=0;else if(c=y&-y,l.callbackPriority!==c){if(g!=null&&Qe(g),c===1)l.tag===0?Ku(Hb.bind(null,l)):Da(Hb.bind(null,l)),qe?Pt(function(){!(Jt&6)&&wo()}):$e(qt,wo),g=null;else{switch(Me(y)){case 1:g=qt;break;case 4:g=mn;break;case 16:g=on;break;case 536870912:g=lr;break;default:g=on}g=Xb(g,Bb.bind(null,l))}l.callbackPriority=c,l.callbackNode=g}}function Bb(l,c){if(kd=-1,jd=0,Jt&6)throw Error(i(327));var g=l.callbackNode;if(yi()&&l.callbackNode!==g)return null;var y=We(l,l===Tr?zr:0);if(y===0)return null;if(y&30||y&l.expiredLanes||c)c=Pd(l,y);else{c=y;var x=Jt;Jt|=2;var j=Ub();(Tr!==l||zr!==c)&&(aa=null,hl(),gi(l,c));do try{oE();break}catch(Q){Wb(l,Q)}while(1);am(),xd.current=j,Jt=x,Sr!==null?c=0:(Tr=null,zr=0,c=Er)}if(c!==0){if(c===2&&(x=et(l),x!==0&&(y=x,c=Km(l,x))),c===1)throw g=Ac,gi(l,0),La(l,y),lo(l,ze()),g;if(c===6)La(l,y);else{if(x=l.current.alternate,!(y&30)&&!nE(x)&&(c=Pd(l,y),c===2&&(j=et(l),j!==0&&(y=j,c=Km(l,j))),c===1))throw g=Ac,gi(l,0),La(l,y),lo(l,ze()),g;switch(l.finishedWork=x,l.finishedLanes=y,c){case 0:case 1:throw Error(i(345));case 2:vi(l,io,aa);break;case 3:if(La(l,y),(y&130023424)===y&&(c=Wm+500-ze(),10<c)){if(We(l,0)!==0)break;if(x=l.suspendedLanes,(x&y)!==y){Ur(),l.pingedLanes|=l.suspendedLanes&x;break}l.timeoutHandle=de(vi.bind(null,l,io,aa),c);break}vi(l,io,aa);break;case 4:if(La(l,y),(y&4194240)===y)break;for(c=l.eventTimes,x=-1;0<y;){var M=31-Rn(y);j=1<<M,M=c[M],M>x&&(x=M),y&=~j}if(y=x,y=ze()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*tE(y/1960))-y,10<y){l.timeoutHandle=de(vi.bind(null,l,io,aa),y);break}vi(l,io,aa);break;case 5:vi(l,io,aa);break;default:throw Error(i(329))}}}return lo(l,ze()),l.callbackNode===g?Bb.bind(null,l):null}function Km(l,c){var g=Nc;return l.current.memoizedState.isDehydrated&&(gi(l,c).flags|=256),l=Pd(l,c),l!==2&&(c=io,io=g,c!==null&&Ym(c)),l}function Ym(l){io===null?io=l:io.push.apply(io,l)}function nE(l){for(var c=l;;){if(c.flags&16384){var g=c.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var y=0;y<g.length;y++){var x=g[y],j=x.getSnapshot;x=x.value;try{if(!rn(j(),x))return!1}catch{return!1}}}if(g=c.child,c.subtreeFlags&16384&&g!==null)g.return=c,c=g;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function La(l,c){for(c&=~Vm,c&=~Sd,l.suspendedLanes|=c,l.pingedLanes&=~c,l=l.expirationTimes;0<c;){var g=31-Rn(c),y=1<<g;l[g]=-1,c&=~y}}function Hb(l){if(Jt&6)throw Error(i(327));yi();var c=We(l,0);if(!(c&1))return lo(l,ze()),null;var g=Pd(l,c);if(l.tag!==0&&g===2){var y=et(l);y!==0&&(c=y,g=Km(l,y))}if(g===1)throw g=Ac,gi(l,0),La(l,c),lo(l,ze()),g;if(g===6)throw Error(i(345));return l.finishedWork=l.current.alternate,l.finishedLanes=c,vi(l,io,aa),lo(l,ze()),null}function Vb(l){$a!==null&&$a.tag===0&&!(Jt&6)&&yi();var c=Jt;Jt|=1;var g=mr.transition,y=ke;try{if(mr.transition=null,ke=1,l)return l()}finally{ke=y,mr.transition=g,Jt=c,!(Jt&6)&&wo()}}function Qm(){ko=pl.current,Dt(pl)}function gi(l,c){l.finishedWork=null,l.finishedLanes=0;var g=l.timeoutHandle;if(g!==oe&&(l.timeoutHandle=oe,xe(g)),Sr!==null)for(g=Sr.return;g!==null;){var y=g;switch(tm(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Ct();break;case 3:ul(),Dt(Zt),Dt(Wt),gm();break;case 5:hm(y);break;case 4:ul();break;case 13:Dt(tr);break;case 19:Dt(tr);break;case 10:im(y.type._context);break;case 22:case 23:Qm()}g=g.return}if(Tr=l,Sr=l=Fa(l.current,null),zr=ko=c,Er=0,Ac=null,Vm=Sd=mi=0,io=Nc=null,pi!==null){for(c=0;c<pi.length;c++)if(g=pi[c],y=g.interleaved,y!==null){g.interleaved=null;var x=y.next,j=g.pending;if(j!==null){var M=j.next;j.next=x,y.next=M}g.pending=y}pi=null}return l}function Wb(l,c){do{var g=Sr;try{if(am(),od.current=ld,sd){for(var y=nr.memoizedState;y!==null;){var x=y.queue;x!==null&&(x.pending=null),y=y.next}sd=!1}if(hi=0,Dr=Ir=nr=null,jc=!1,Pc=0,Hm.current=null,g===null||g.return===null){Er=1,Ac=c,Sr=null;break}e:{var j=l,M=g.return,Q=g,le=c;if(c=zr,Q.flags|=32768,le!==null&&typeof le=="object"&&typeof le.then=="function"){var De=le,pt=Q,Ht=pt.tag;if(!(pt.mode&1)&&(Ht===0||Ht===11||Ht===15)){var nt=pt.alternate;nt?(pt.updateQueue=nt.updateQueue,pt.memoizedState=nt.memoizedState,pt.lanes=nt.lanes):(pt.updateQueue=null,pt.memoizedState=null)}var Fn=mb(M);if(Fn!==null){Fn.flags&=-257,gb(Fn,M,Q,j,c),Fn.mode&1&&hb(j,De,c),c=Fn,le=De;var Tn=c.updateQueue;if(Tn===null){var co=new Set;co.add(le),c.updateQueue=co}else Tn.add(le);break e}else{if(!(c&1)){hb(j,De,c),Xm();break e}le=Error(i(426))}}else if(Kn&&Q.mode&1){var ia=mb(M);if(ia!==null){!(ia.flags&65536)&&(ia.flags|=256),gb(ia,M,Q,j,c),om(dl(le,Q));break e}}j=le=dl(le,Q),Er!==4&&(Er=2),Nc===null?Nc=[j]:Nc.push(j),j=M;do{switch(j.tag){case 3:j.flags|=65536,c&=-c,j.lanes|=c;var ae=fb(j,le,c);Ay(j,ae);break e;case 1:Q=le;var J=j.type,me=j.stateNode;if(!(j.flags&128)&&(typeof J.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(Na===null||!Na.has(me)))){j.flags|=65536,c&=-c,j.lanes|=c;var st=pb(j,Q,c);Ay(j,st);break e}}j=j.return}while(j!==null)}qb(g)}catch(Et){c=Et,Sr===g&&g!==null&&(Sr=g=g.return);continue}break}while(1)}function Ub(){var l=xd.current;return xd.current=ld,l===null?ld:l}function Xm(){(Er===0||Er===3||Er===2)&&(Er=4),Tr===null||!(mi&268435455)&&!(Sd&268435455)||La(Tr,zr)}function Pd(l,c){var g=Jt;Jt|=2;var y=Ub();(Tr!==l||zr!==c)&&(aa=null,gi(l,c));do try{rE();break}catch(x){Wb(l,x)}while(1);if(am(),Jt=g,xd.current=y,Sr!==null)throw Error(i(261));return Tr=null,zr=0,Er}function rE(){for(;Sr!==null;)Gb(Sr)}function oE(){for(;Sr!==null&&!It();)Gb(Sr)}function Gb(l){var c=Qb(l.alternate,l,ko);l.memoizedProps=l.pendingProps,c===null?qb(l):Sr=c,Hm.current=null}function qb(l){var c=l;do{var g=c.alternate;if(l=c.return,c.flags&32768){if(g=XI(g,c),g!==null){g.flags&=32767,Sr=g;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Er=6,Sr=null;return}}else if(g=QI(g,c,ko),g!==null){Sr=g;return}if(c=c.sibling,c!==null){Sr=c;return}Sr=c=l}while(c!==null);Er===0&&(Er=5)}function vi(l,c,g){var y=ke,x=mr.transition;try{mr.transition=null,ke=1,sE(l,c,g,y)}finally{mr.transition=x,ke=y}return null}function sE(l,c,g,y){do yi();while($a!==null);if(Jt&6)throw Error(i(327));g=l.finishedWork;var x=l.finishedLanes;if(g===null)return null;if(l.finishedWork=null,l.finishedLanes=0,g===l.current)throw Error(i(177));l.callbackNode=null,l.callbackPriority=0;var j=g.lanes|g.childLanes;if(Xe(l,j),l===Tr&&(Sr=Tr=null,zr=0),!(g.subtreeFlags&2064)&&!(g.flags&2064)||Cd||(Cd=!0,Xb(on,function(){return yi(),null})),j=(g.flags&15990)!==0,g.subtreeFlags&15990||j){j=mr.transition,mr.transition=null;var M=ke;ke=1;var Q=Jt;Jt|=4,Hm.current=null,JI(l,g),Ab(g,l),W(l.containerInfo),l.current=g,eE(g),jt(),Jt=Q,ke=M,mr.transition=j}else l.current=g;if(Cd&&(Cd=!1,$a=l,_d=x),j=l.pendingLanes,j===0&&(Na=null),$n(g.stateNode),lo(l,ze()),c!==null)for(y=l.onRecoverableError,g=0;g<c.length;g++)x=c[g],y(x.value,{componentStack:x.stack,digest:x.digest});if(wd)throw wd=!1,l=Gm,Gm=null,l;return _d&1&&l.tag!==0&&yi(),j=l.pendingLanes,j&1?l===qm?$c++:($c=0,qm=l):$c=0,wo(),null}function yi(){if($a!==null){var l=Me(_d),c=mr.transition,g=ke;try{if(mr.transition=null,ke=16>l?16:l,$a===null)var y=!1;else{if(l=$a,$a=null,_d=0,Jt&6)throw Error(i(331));var x=Jt;for(Jt|=4,ct=l.current;ct!==null;){var j=ct,M=j.child;if(ct.flags&16){var Q=j.deletions;if(Q!==null){for(var le=0;le<Q.length;le++){var De=Q[le];for(ct=De;ct!==null;){var pt=ct;switch(pt.tag){case 0:case 11:case 15:Dc(8,pt,j)}var Ht=pt.child;if(Ht!==null)Ht.return=pt,ct=Ht;else for(;ct!==null;){pt=ct;var nt=pt.sibling,Fn=pt.return;if(Rb(pt),pt===De){ct=null;break}if(nt!==null){nt.return=Fn,ct=nt;break}ct=Fn}}}var Tn=j.alternate;if(Tn!==null){var co=Tn.child;if(co!==null){Tn.child=null;do{var ia=co.sibling;co.sibling=null,co=ia}while(co!==null)}}ct=j}}if(j.subtreeFlags&2064&&M!==null)M.return=j,ct=M;else e:for(;ct!==null;){if(j=ct,j.flags&2048)switch(j.tag){case 0:case 11:case 15:Dc(9,j,j.return)}var ae=j.sibling;if(ae!==null){ae.return=j.return,ct=ae;break e}ct=j.return}}var J=l.current;for(ct=J;ct!==null;){M=ct;var me=M.child;if(M.subtreeFlags&2064&&me!==null)me.return=M,ct=me;else e:for(M=J;ct!==null;){if(Q=ct,Q.flags&2048)try{switch(Q.tag){case 0:case 11:case 15:hd(9,Q)}}catch(Et){Yn(Q,Q.return,Et)}if(Q===M){ct=null;break e}var st=Q.sibling;if(st!==null){st.return=Q.return,ct=st;break e}ct=Q.return}}if(Jt=x,wo(),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Ln,l)}catch{}y=!0}return y}finally{ke=g,mr.transition=c}}return!1}function Kb(l,c,g){c=dl(g,c),c=fb(l,c,1),l=Aa(l,c,1),c=Ur(),l!==null&&(ft(l,1,c),lo(l,c))}function Yn(l,c,g){if(l.tag===3)Kb(l,l,g);else for(;c!==null;){if(c.tag===3){Kb(c,l,g);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Na===null||!Na.has(y))){l=dl(g,l),l=pb(c,l,1),c=Aa(c,l,1),l=Ur(),c!==null&&(ft(c,1,l),lo(c,l));break}}c=c.return}}function aE(l,c,g){var y=l.pingCache;y!==null&&y.delete(c),c=Ur(),l.pingedLanes|=l.suspendedLanes&g,Tr===l&&(zr&g)===g&&(Er===4||Er===3&&(zr&130023424)===zr&&500>ze()-Wm?gi(l,0):Vm|=g),lo(l,c)}function Yb(l,c){c===0&&(l.mode&1?(c=pn,pn<<=1,!(pn&130023424)&&(pn=4194304)):c=1);var g=Ur();l=Ts(l,c),l!==null&&(ft(l,c,g),lo(l,g))}function iE(l){var c=l.memoizedState,g=0;c!==null&&(g=c.retryLane),Yb(l,g)}function lE(l,c){var g=0;switch(l.tag){case 13:var y=l.stateNode,x=l.memoizedState;x!==null&&(g=x.retryLane);break;case 19:y=l.stateNode;break;default:throw Error(i(314))}y!==null&&y.delete(c),Yb(l,g)}var Qb;Qb=function(l,c,g){if(l!==null)if(l.memoizedProps!==c.pendingProps||Zt.current)ao=!0;else{if(!(l.lanes&g)&&!(c.flags&128))return ao=!1,YI(l,c,g);ao=!!(l.flags&131072)}else ao=!1,Kn&&c.flags&1048576&&Py(c,eo,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;ud(l,c),l=c.pendingProps;var x=jr(c,Wt.current);il(c,g),x=bm(null,c,y,l,x,g);var j=xm();return c.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Gn(y)?(j=!0,qn(c)):j=!1,c.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,um(c),x.updater=td,c.stateNode=x,x._reactInternals=c,fm(c,y,l,g),c=Im(null,c,y,!0,j,g)):(c.tag=0,Kn&&j&&em(c),ro(null,c,x,g),c=c.child),c;case 16:y=c.elementType;e:{switch(ud(l,c),l=c.pendingProps,x=y._init,y=x(y._payload),c.type=y,x=c.tag=uE(y),l=ls(y,l),x){case 0:c=Pm(null,c,y,l,g);break e;case 1:c=wb(null,c,y,l,g);break e;case 11:c=vb(null,c,y,l,g);break e;case 14:c=yb(null,c,y,ls(y.type,l),g);break e}throw Error(i(306,y,""))}return c;case 0:return y=c.type,x=c.pendingProps,x=c.elementType===y?x:ls(y,x),Pm(l,c,y,x,g);case 1:return y=c.type,x=c.pendingProps,x=c.elementType===y?x:ls(y,x),wb(l,c,y,x,g);case 3:e:{if(Cb(c),l===null)throw Error(i(387));y=c.pendingProps,j=c.memoizedState,x=j.element,Ty(l,c),ed(c,y,null,g);var M=c.memoizedState;if(y=M.element,Ne&&j.isDehydrated)if(j={element:y,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},c.updateQueue.baseState=j,c.memoizedState=j,c.flags&256){x=dl(Error(i(423)),c),c=_b(l,c,y,g,x);break e}else if(y!==x){x=dl(Error(i(424)),c),c=_b(l,c,y,g,x);break e}else for(Ne&&(No=Z(c.stateNode.containerInfo),_o=c,Kn=!0,is=null,wc=!1),g=Vy(c,null,y,g),c.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(sl(),y===x){c=sa(l,c,g);break e}ro(l,c,y,g)}c=c.child}return c;case 5:return Wy(c),l===null&&rm(c),y=c.type,x=c.pendingProps,j=l!==null?l.memoizedProps:null,M=x.children,X(y,x)?M=null:j!==null&&X(y,j)&&(c.flags|=32),Sb(l,c),ro(l,c,M,g),c.child;case 6:return l===null&&rm(c),null;case 13:return kb(l,c,g);case 4:return pm(c,c.stateNode.containerInfo),y=c.pendingProps,l===null?c.child=ll(c,null,y,g):ro(l,c,y,g),c.child;case 11:return y=c.type,x=c.pendingProps,x=c.elementType===y?x:ls(y,x),vb(l,c,y,x,g);case 7:return ro(l,c,c.pendingProps,g),c.child;case 8:return ro(l,c,c.pendingProps.children,g),c.child;case 12:return ro(l,c,c.pendingProps.children,g),c.child;case 10:e:{if(y=c.type._context,x=c.pendingProps,j=c.memoizedProps,M=x.value,My(c,y,M),j!==null)if(rn(j.value,M)){if(j.children===x.children&&!Zt.current){c=sa(l,c,g);break e}}else for(j=c.child,j!==null&&(j.return=c);j!==null;){var Q=j.dependencies;if(Q!==null){M=j.child;for(var le=Q.firstContext;le!==null;){if(le.context===y){if(j.tag===1){le=oa(-1,g&-g),le.tag=2;var De=j.updateQueue;if(De!==null){De=De.shared;var pt=De.pending;pt===null?le.next=le:(le.next=pt.next,pt.next=le),De.pending=le}}j.lanes|=g,le=j.alternate,le!==null&&(le.lanes|=g),lm(j.return,g,c),Q.lanes|=g;break}le=le.next}}else if(j.tag===10)M=j.type===c.type?null:j.child;else if(j.tag===18){if(M=j.return,M===null)throw Error(i(341));M.lanes|=g,Q=M.alternate,Q!==null&&(Q.lanes|=g),lm(M,g,c),M=j.sibling}else M=j.child;if(M!==null)M.return=j;else for(M=j;M!==null;){if(M===c){M=null;break}if(j=M.sibling,j!==null){j.return=M.return,M=j;break}M=M.return}j=M}ro(l,c,x.children,g),c=c.child}return c;case 9:return x=c.type,y=c.pendingProps.children,il(c,g),x=$o(x),y=y(x),c.flags|=1,ro(l,c,y,g),c.child;case 14:return y=c.type,x=ls(y,c.pendingProps),x=ls(y.type,x),yb(l,c,y,x,g);case 15:return bb(l,c,c.type,c.pendingProps,g);case 17:return y=c.type,x=c.pendingProps,x=c.elementType===y?x:ls(y,x),ud(l,c),c.tag=1,Gn(y)?(l=!0,qn(c)):l=!1,il(c,g),Ly(c,y,x),fm(c,y,x,g),Im(null,c,y,!0,l,g);case 19:return Pb(l,c,g);case 22:return xb(l,c,g)}throw Error(i(156,c.tag))};function Xb(l,c){return $e(l,c)}function cE(l,c,g,y){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bo(l,c,g,y){return new cE(l,c,g,y)}function Zm(l){return l=l.prototype,!(!l||!l.isReactComponent)}function uE(l){if(typeof l=="function")return Zm(l)?1:0;if(l!=null){if(l=l.$$typeof,l===S)return 11;if(l===k)return 14}return 2}function Fa(l,c){var g=l.alternate;return g===null?(g=Bo(l.tag,c,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=c,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&14680064,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,c=l.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g}function Id(l,c,g,y,x,j){var M=2;if(y=l,typeof l=="function")Zm(l)&&(M=1);else if(typeof l=="string")M=5;else e:switch(l){case m:return bi(g.children,x,j,c);case h:M=8,x|=8;break;case v:return l=Bo(12,g,c,x|2),l.elementType=v,l.lanes=j,l;case C:return l=Bo(13,g,c,x),l.elementType=C,l.lanes=j,l;case _:return l=Bo(19,g,c,x),l.elementType=_,l.lanes=j,l;case E:return Ed(g,x,j,c);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case b:M=10;break e;case w:M=9;break e;case S:M=11;break e;case k:M=14;break e;case P:M=16,y=null;break e}throw Error(i(130,l==null?l:typeof l,""))}return c=Bo(M,g,c,x),c.elementType=l,c.type=y,c.lanes=j,c}function bi(l,c,g,y){return l=Bo(7,l,y,c),l.lanes=g,l}function Ed(l,c,g,y){return l=Bo(22,l,y,c),l.elementType=E,l.lanes=g,l.stateNode={isHidden:!1},l}function Jm(l,c,g){return l=Bo(6,l,null,c),l.lanes=g,l}function eg(l,c,g){return c=Bo(4,l.children!==null?l.children:[],l.key,c),c.lanes=g,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function dE(l,c,g,y,x){this.tag=c,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=oe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=At(0),this.expirationTimes=At(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=At(0),this.identifierPrefix=y,this.onRecoverableError=x,Ne&&(this.mutableSourceEagerHydrationData=null)}function Zb(l,c,g,y,x,j,M,Q,le){return l=new dE(l,c,g,Q,le),c===1?(c=1,j===!0&&(c|=8)):c=0,j=Bo(3,null,null,c),l.current=j,j.stateNode=l,j.memoizedState={element:y,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},um(j),l}function Jb(l){if(!l)return fn;l=l._reactInternals;e:{if(T(l)!==l||l.tag!==1)throw Error(i(170));var c=l;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Gn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(i(171))}if(l.tag===1){var g=l.type;if(Gn(g))return jn(l,g,c)}return c}function ex(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(i(188)):(l=Object.keys(l).join(","),Error(i(268,l)));return l=ee(c),l===null?null:l.stateNode}function tx(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<c?g:c}}function Od(l,c){tx(l,c),(l=l.alternate)&&tx(l,c)}function fE(l){return l=ee(l),l===null?null:l.stateNode}function pE(){return null}return n.attemptContinuousHydration=function(l){if(l.tag===13){var c=Ts(l,134217728);if(c!==null){var g=Ur();Fo(c,l,134217728,g)}Od(l,134217728)}},n.attemptDiscreteHydration=function(l){if(l.tag===13){var c=Ts(l,1);if(c!==null){var g=Ur();Fo(c,l,1,g)}Od(l,1)}},n.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13){var c=za(l),g=Ts(l,c);if(g!==null){var y=Ur();Fo(g,l,c,y)}Od(l,c)}},n.attemptSynchronousHydration=function(l){switch(l.tag){case 3:var c=l.stateNode;if(c.current.memoizedState.isDehydrated){var g=hn(c.pendingLanes);g!==0&&(Ee(c,g|1),lo(c,ze()),!(Jt&6)&&(hl(),wo()))}break;case 13:Vb(function(){var y=Ts(l,1);if(y!==null){var x=Ur();Fo(y,l,1,x)}}),Od(l,1)}},n.batchedUpdates=function(l,c){var g=Jt;Jt|=1;try{return l(c)}finally{Jt=g,Jt===0&&(hl(),Nr&&wo())}},n.createComponentSelector=function(l){return{$$typeof:md,value:l}},n.createContainer=function(l,c,g,y,x,j,M){return Zb(l,c,!1,null,g,y,x,j,M)},n.createHasPseudoClassSelector=function(l){return{$$typeof:gd,value:l}},n.createHydrationContainer=function(l,c,g,y,x,j,M,Q,le){return l=Zb(g,y,!0,l,x,j,M,Q,le),l.context=Jb(null),g=l.current,y=Ur(),x=za(g),j=oa(y,x),j.callback=c??null,Aa(g,j,x),l.current.lanes=x,ft(l,x,y),lo(l,y),l},n.createPortal=function(l,c,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:y==null?null:""+y,children:l,containerInfo:c,implementation:g}},n.createRoleSelector=function(l){return{$$typeof:vd,value:l}},n.createTestNameSelector=function(l){return{$$typeof:yd,value:l}},n.createTextSelector=function(l){return{$$typeof:bd,value:l}},n.deferredUpdates=function(l){var c=ke,g=mr.transition;try{return mr.transition=null,ke=16,l()}finally{ke=c,mr.transition=g}},n.discreteUpdates=function(l,c,g,y,x){var j=ke,M=mr.transition;try{return mr.transition=null,ke=1,l(c,g,y,x)}finally{ke=j,mr.transition=M,Jt===0&&hl()}},n.findAllNodes=Bm,n.findBoundingRects=function(l,c){if(!St)throw Error(i(363));c=Bm(l,c),l=[];for(var g=0;g<c.length;g++)l.push(Y(c[g]));for(c=l.length-1;0<c;c--){g=l[c];for(var y=g.x,x=y+g.width,j=g.y,M=j+g.height,Q=c-1;0<=Q;Q--)if(c!==Q){var le=l[Q],De=le.x,pt=De+le.width,Ht=le.y,nt=Ht+le.height;if(y>=De&&j>=Ht&&x<=pt&&M<=nt){l.splice(c,1);break}else if(y!==De||g.width!==le.width||nt<j||Ht>M){if(!(j!==Ht||g.height!==le.height||pt<y||De>x)){De>y&&(le.width+=De-y,le.x=y),pt<x&&(le.width=x-De),l.splice(c,1);break}}else{Ht>j&&(le.height+=Ht-j,le.y=j),nt<M&&(le.height=M-Ht),l.splice(c,1);break}}}return l},n.findHostInstance=ex,n.findHostInstanceWithNoPortals=function(l){return l=B(l),l=l!==null?N(l):null,l===null?null:l.stateNode},n.findHostInstanceWithWarning=function(l){return ex(l)},n.flushControlled=function(l){var c=Jt;Jt|=1;var g=mr.transition,y=ke;try{mr.transition=null,ke=1,l()}finally{ke=y,mr.transition=g,Jt=c,Jt===0&&(hl(),wo())}},n.flushPassiveEffects=yi,n.flushSync=Vb,n.focusWithin=function(l,c){if(!St)throw Error(i(363));for(l=zm(l),c=Fb(l,c),c=Array.from(c),l=0;l<c.length;){var g=c[l++];if(!te(g)){if(g.tag===5&&Te(g.stateNode))return!0;for(g=g.child;g!==null;)c.push(g),g=g.sibling}}return!1},n.getCurrentUpdatePriority=function(){return ke},n.getFindAllNodesFailureDescription=function(l,c){if(!St)throw Error(i(363));var g=0,y=[];l=[zm(l),0];for(var x=0;x<l.length;){var j=l[x++],M=l[x++],Q=c[M];if((j.tag!==5||!te(j))&&(Lm(j,Q)&&(y.push(Fm(Q)),M++,M>g&&(g=M)),M<c.length))for(j=j.child;j!==null;)l.push(j,M),j=j.sibling}if(g<c.length){for(l=[];g<c.length;g++)l.push(Fm(c[g]));return`findAllNodes was able to match part of the selector:
|
||
`+(y.join(" > ")+`
|
||
|
||
No matching component was found for:
|
||
`)+l.join(" > ")}return null},n.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return K(l.child.stateNode);default:return l.child.stateNode}},n.injectIntoDevTools=function(l){if(l={bundleType:l.bundleType,version:l.version,rendererPackageName:l.rendererPackageName,rendererConfig:l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:fE,findFiberByHostInstance:l.findFiberByHostInstance||pE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)l=!0;else{try{Ln=c.inject(l),an=c}catch{}l=!!c.checkDCE}}return l},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(l,c,g,y){if(!St)throw Error(i(363));l=Bm(l,c);var x=Ke(l,g,y).disconnect;return{disconnect:function(){x()}}},n.registerMutableSourceForHydration=function(l,c){var g=c._getVersion;g=g(c._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[c,g]:l.mutableSourceEagerHydrationData.push(c,g)},n.runWithPriority=function(l,c){var g=ke;try{return ke=l,c()}finally{ke=g}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(l,c,g,y){var x=c.current,j=Ur(),M=za(x);return g=Jb(g),c.context===null?c.context=g:c.pendingContext=g,c=oa(j,M),c.payload={element:l},y=y===void 0?null:y,y!==null&&(c.callback=y),l=Aa(x,c,M),l!==null&&(Fo(l,x,M,j),Ju(l,x,M)),M},n};bI.exports=Kte;var Yte=bI.exports;const Qte=lc(Yte);var xI={exports:{}},ol={};/**
|
||
* @license React
|
||
* react-reconciler-constants.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/ol.ConcurrentRoot=1;ol.ContinuousEventPriority=4;ol.DefaultEventPriority=16;ol.DiscreteEventPriority=1;ol.IdleEventPriority=536870912;ol.LegacyRoot=0;xI.exports=ol;var SI=xI.exports;const g4={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let v4=!1,y4=!1;const _y=".react-konva-event",Xte=`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
|
||
`,Zte=`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
|
||
`,Jte={};function Jh(e,t,n=Jte){if(!v4&&"zIndex"in t&&(console.warn(Zte),v4=!0),!y4&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(Xte),y4=!0)}for(var s in n)if(!g4[s]){var i=s.slice(0,2)==="on",u=n[s]!==t[s];if(i&&u){var d=s.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),e.off(d,n[s])}var p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var m=t._useStrictMode,h={},v=!1;const b={};for(var s in t)if(!g4[s]){var i=s.slice(0,2)==="on",w=n[s]!==t[s];if(i&&w){var d=s.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),t[s]&&(b[d]=t[s])}!i&&(t[s]!==n[s]||m&&t[s]!==e.getAttr(s))&&(v=!0,h[s]=t[s])}v&&(e.setAttrs(h),di(e));for(var d in b)e.on(d+_y,b[d])}function di(e){if(!f7.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const wI={},ene={};_u.Node.prototype._applyProps=Jh;function tne(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),di(e)}function nne(e,t,n){let r=_u[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=_u.Group);const o={},s={};for(var i in t){var u=i.slice(0,2)==="on";u?s[i]=t[i]:o[i]=t[i]}const d=new r(o);return Jh(d,s),d}function rne(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function one(e,t,n){return!1}function sne(e){return e}function ane(){return null}function ine(){return null}function lne(e,t,n,r){return ene}function cne(){}function une(e){}function dne(e,t){return!1}function fne(){return wI}function pne(){return wI}const hne=setTimeout,mne=clearTimeout,gne=-1;function vne(e,t){return!1}const yne=!1,bne=!0,xne=!0;function Sne(e,t){t.parent===e?t.moveToTop():e.add(t),di(e)}function wne(e,t){t.parent===e?t.moveToTop():e.add(t),di(e)}function CI(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),di(e)}function Cne(e,t,n){CI(e,t,n)}function _ne(e,t){t.destroy(),t.off(_y),di(e)}function kne(e,t){t.destroy(),t.off(_y),di(e)}function jne(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function Pne(e,t,n){}function Ine(e,t,n,r,o){Jh(e,o,r)}function Ene(e){e.hide(),di(e)}function One(e){}function Rne(e,t){(t.visible==null||t.visible)&&e.show()}function Mne(e,t){}function Dne(e){}function Tne(){}const Ane=()=>SI.DefaultEventPriority,Nne=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Sne,appendChildToContainer:wne,appendInitialChild:tne,cancelTimeout:mne,clearContainer:Dne,commitMount:Pne,commitTextUpdate:jne,commitUpdate:Ine,createInstance:nne,createTextInstance:rne,detachDeletedInstance:Tne,finalizeInitialChildren:one,getChildHostContext:pne,getCurrentEventPriority:Ane,getPublicInstance:sne,getRootHostContext:fne,hideInstance:Ene,hideTextInstance:One,idlePriority:Sf.unstable_IdlePriority,insertBefore:CI,insertInContainerBefore:Cne,isPrimaryRenderer:yne,noTimeout:gne,now:Sf.unstable_now,prepareForCommit:ane,preparePortalMount:ine,prepareUpdate:lne,removeChild:_ne,removeChildFromContainer:kne,resetAfterCommit:cne,resetTextContent:une,run:Sf.unstable_runWithPriority,scheduleTimeout:hne,shouldDeprioritizeSubtree:dne,shouldSetTextContent:vne,supportsMutation:xne,unhideInstance:Rne,unhideTextInstance:Mne,warnsIfNotActing:bne},Symbol.toStringTag,{value:"Module"}));var $ne=Object.defineProperty,zne=Object.defineProperties,Lne=Object.getOwnPropertyDescriptors,b4=Object.getOwnPropertySymbols,Fne=Object.prototype.hasOwnProperty,Bne=Object.prototype.propertyIsEnumerable,x4=(e,t,n)=>t in e?$ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S4=(e,t)=>{for(var n in t||(t={}))Fne.call(t,n)&&x4(e,n,t[n]);if(b4)for(var n of b4(t))Bne.call(t,n)&&x4(e,n,t[n]);return e},Hne=(e,t)=>zne(e,Lne(t));function _I(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=_I(r,t,n);if(o)return o;r=t?null:r.sibling}}function kI(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const ky=kI(f.createContext(null));class jI extends f.Component{render(){return f.createElement(ky.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:w4,ReactCurrentDispatcher:C4}=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Vne(){const e=f.useContext(ky);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=f.useId();return f.useMemo(()=>{for(const r of[w4==null?void 0:w4.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=_I(r,!1,s=>{let i=s.memoizedState;for(;i;){if(i.memoizedState===t)return!0;i=i.next}});if(o)return o}},[e,t])}function Wne(){var e,t;const n=Vne(),[r]=f.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==ky&&!r.has(s)&&r.set(s,(t=C4==null?void 0:C4.current)==null?void 0:t.readContext(kI(s))),o=o.return}return r}function Une(){const e=Wne();return f.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>f.createElement(t,null,f.createElement(n.Provider,Hne(S4({},r),{value:e.get(n)}))),t=>f.createElement(jI,S4({},t))),[e])}function Gne(e){const t=z.useRef({});return z.useLayoutEffect(()=>{t.current=e}),z.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const qne=e=>{const t=z.useRef(),n=z.useRef(),r=z.useRef(),o=Gne(e),s=Une(),i=u=>{const{forwardedRef:d}=e;d&&(typeof d=="function"?d(u):d.current=u)};return z.useLayoutEffect(()=>(n.current=new _u.Stage({width:e.width,height:e.height,container:t.current}),i(n.current),r.current=eu.createContainer(n.current,SI.LegacyRoot,!1,null),eu.updateContainer(z.createElement(s,{},e.children),r.current),()=>{_u.isBrowser&&(i(null),eu.updateContainer(null,r.current,null),n.current.destroy())}),[]),z.useLayoutEffect(()=>{i(n.current),Jh(n.current,e,o),eu.updateContainer(z.createElement(s,{},e.children),r.current,null)}),z.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},qc="Layer",ka="Group",Qs="Rect",Si="Circle",Jp="Line",PI="Image",Kne="Transformer",eu=Qte(Nne);eu.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:z.version,rendererPackageName:"react-konva"});const Yne=z.forwardRef((e,t)=>z.createElement(jI,{},z.createElement(qne,{...e,forwardedRef:t}))),Qne=we([tn,er],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:Yt}}),Xne=()=>{const e=ne(),{tool:t,isStaging:n,isMovingBoundingBox:r}=L(Qne);return{handleDragStart:f.useCallback(()=>{(t==="move"||n)&&!r&&e(Bf(!0))},[e,r,n,t]),handleDragMove:f.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(v3(s))},[e,r,n,t]),handleDragEnd:f.useCallback(()=>{(t==="move"||n)&&!r&&e(Bf(!1))},[e,r,n,t])}},Zne=we([tn,yr,er],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isMaskEnabled:u,shouldSnapToGrid:d}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isStaging:n,isMaskEnabled:u,shouldSnapToGrid:d}},{memoizeOptions:{resultEqualityCheck:Yt}}),Jne=()=>{const e=ne(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:i}=L(Zne),u=f.useRef(null),d=y3(),p=()=>e(Mv());Ze(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const m=()=>e(Ru(!s));Ze(["h"],()=>{m()},{enabled:()=>!o,preventDefault:!0},[s]),Ze(["n"],()=>{e(Hf(!i))},{enabled:!0,preventDefault:!0},[i]),Ze("esc",()=>{e(p7())},{enabled:()=>!0,preventDefault:!0}),Ze("shift+h",()=>{e(h7(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),Ze(["space"],h=>{h.repeat||(d==null||d.container().focus(),r!=="move"&&(u.current=r,e(Gs("move"))),r==="move"&&u.current&&u.current!=="move"&&(e(Gs(u.current)),u.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,u])},jy=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}},II=()=>{const e=ne(),t=ya(),n=y3();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=m7.pixelRatio,[s,i,u,d]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;e(g7({r:s,g:i,b:u,a:d}))},commitColorUnderCursor:()=>{e(v7())}}},ere=we([yr,tn,er],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Yt}}),tre=e=>{const t=ne(),{tool:n,isStaging:r}=L(ere),{commitColorUnderCursor:o}=II();return f.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(Bf(!0));return}if(n==="colorPicker"){o();return}const i=jy(e.current);i&&(s.evt.preventDefault(),t(b3(!0)),t(y7([i.x,i.y])))},[e,n,r,t,o])},nre=we([yr,tn,er],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Yt}}),rre=(e,t,n)=>{const r=ne(),{isDrawing:o,tool:s,isStaging:i}=L(nre),{updateColorUnderCursor:u}=II();return f.useCallback(()=>{if(!e.current)return;const d=jy(e.current);if(d){if(r(b7(d)),n.current=d,s==="colorPicker"){u();return}!o||s==="move"||i||(t.current=!0,r(x3([d.x,d.y])))}},[t,r,o,i,n,e,s,u])},ore=()=>{const e=ne();return f.useCallback(()=>{e(x7())},[e])},sre=we([yr,tn,er],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Yt}}),are=(e,t)=>{const n=ne(),{tool:r,isDrawing:o,isStaging:s}=L(sre);return f.useCallback(()=>{if(r==="move"||s){n(Bf(!1));return}if(!t.current&&o&&e.current){const i=jy(e.current);if(!i)return;n(x3([i.x,i.y]))}else t.current=!1;n(b3(!1))},[t,n,o,s,e,r])},ire=we([tn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:Yt}}),lre=e=>{const t=ne(),{isMoveStageKeyHeld:n,stageScale:r}=L(ire);return f.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const i={x:(s.x-e.current.x())/r,y:(s.y-e.current.y())/r};let u=o.evt.deltaY;o.evt.ctrlKey&&(u=-u);const d=qs(r*C7**u,w7,S7),p={x:s.x-i.x*d,y:s.y-i.y*d};t(_7(d)),t(v3(p))},[e,n,r,t])},cre=we(tn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:Yt}}),ure=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=L(cre);return a.jsxs(ka,{children:[a.jsx(Qs,{offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),a.jsx(Qs,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},dre=we([tn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:Yt}}),fre=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=L(dre),{colorMode:r}=Qr(),[o,s]=f.useState([]),[i,u]=uc("colors",["base.800","base.200"]),d=f.useCallback(p=>p/e,[e]);return f.useLayoutEffect(()=>{const{width:p,height:m}=n,{x:h,y:v}=t,b={x1:0,y1:0,x2:p,y2:m,offset:{x:d(h),y:d(v)}},w={x:Math.ceil(d(h)/64)*64,y:Math.ceil(d(v)/64)*64},S={x1:-w.x,y1:-w.y,x2:d(p)-w.x+64,y2:d(m)-w.y+64},_={x1:Math.min(b.x1,S.x1),y1:Math.min(b.y1,S.y1),x2:Math.max(b.x2,S.x2),y2:Math.max(b.y2,S.y2)},k=_.x2-_.x1,P=_.y2-_.y1,E=Math.round(k/64)+1,I=Math.round(P/64)+1,R=Xx(0,E).map(D=>a.jsx(Jp,{x:_.x1+D*64,y:_.y1,points:[0,0,0,P],stroke:r==="dark"?i:u,strokeWidth:1},`x_${D}`)),O=Xx(0,I).map(D=>a.jsx(Jp,{x:_.x1,y:_.y1+D*64,points:[0,0,k,0],stroke:r==="dark"?i:u,strokeWidth:1},`y_${D}`));s(R.concat(O))},[e,t,n,d,r,i,u]),a.jsx(ka,{children:o})},pre=we([yo,tn],(e,t)=>{const{progressImage:n,sessionId:r}=e,{sessionId:o,boundingBox:s}=t.layerState.stagingArea;return{boundingBox:s,progressImage:r===o?n:void 0}},{memoizeOptions:{resultEqualityCheck:Yt}}),hre=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=L(pre),[o,s]=f.useState(null);return f.useEffect(()=>{if(!n)return;const i=new Image;i.onload=()=>{s(i)},i.src=n.dataURL},[n]),n&&r&&o?a.jsx(PI,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},Li=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},mre=we(tn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Li(t)}}),_4=e=>`data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||
<svg width="60px" height="60px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||
<g transform="matrix(0.5,0,0,0.5,0,0)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,2.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,7.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,10)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,12.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,15)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,17.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,20)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,22.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,25)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,27.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,30)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-2.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-7.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-10)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-12.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-15)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-17.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-20)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-22.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-25)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-27.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-30)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
</svg>`.replaceAll("black",e),gre=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=L(mre),[i,u]=f.useState(null),[d,p]=f.useState(0),m=f.useRef(null),h=f.useCallback(()=>{p(d+1),setTimeout(h,500)},[d]);return f.useEffect(()=>{if(i)return;const v=new Image;v.onload=()=>{u(v)},v.src=_4(n)},[i,n]),f.useEffect(()=>{i&&(i.src=_4(n))},[i,n]),f.useEffect(()=>{const v=setInterval(()=>p(b=>(b+1)%5),50);return()=>clearInterval(v)},[]),!i||!vl(r.x)||!vl(r.y)||!vl(s)||!vl(o.width)||!vl(o.height)?null:a.jsx(Qs,{ref:m,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:i,fillPatternOffsetY:vl(d)?d:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},vre=we([tn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Yt}}),yre=e=>{const{...t}=e,{objects:n}=L(vre);return a.jsx(ka,{listening:!1,...t,children:n.filter(k7).map((r,o)=>a.jsx(Jp,{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"},o))})};var wi=f,bre=function(t,n,r){const o=wi.useRef("loading"),s=wi.useRef(),[i,u]=wi.useState(0),d=wi.useRef(),p=wi.useRef(),m=wi.useRef();return(d.current!==t||p.current!==n||m.current!==r)&&(o.current="loading",s.current=void 0,d.current=t,p.current=n,m.current=r),wi.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function v(){o.current="loaded",s.current=h,u(Math.random())}function b(){o.current="failed",s.current=void 0,u(Math.random())}return h.addEventListener("load",v),h.addEventListener("error",b),n&&(h.crossOrigin=n),r&&(h.referrerPolicy=r),h.src=t,function(){h.removeEventListener("load",v),h.removeEventListener("error",b)}},[t,n,r]),[s.current,o.current]};const xre=lc(bre),EI=e=>{const{width:t,height:n,x:r,y:o,imageName:s}=e.canvasImage,{currentData:i,isError:u}=Cs(s??Yo.skipToken),[d]=xre((i==null?void 0:i.image_url)??"",j7.get()?"use-credentials":"anonymous");return u?a.jsx(Qs,{x:r,y:o,width:t,height:n,fill:"red"}):a.jsx(PI,{x:r,y:o,image:d,listening:!1})},Sre=we([tn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Yt}}),wre=()=>{const{objects:e}=L(Sre);return e?a.jsx(ka,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(P7(t))return a.jsx(EI,{canvasImage:t},n);if(I7(t)){const r=a.jsx(Jp,{points:t.points,stroke:t.color?Li(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?a.jsx(ka,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(E7(t))return a.jsx(Qs,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Li(t.color)},n);if(O7(t))return a.jsx(Qs,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Cre=we([tn],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:{x:o,y:s},boundingBoxDimensions:{width:i,height:u}}=e,{selectedImageIndex:d,images:p}=t.stagingArea;return{currentStagingAreaImage:p.length>0&&d!==void 0?p[d]:void 0,isOnFirstImage:d===0,isOnLastImage:d===p.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:o,y:s,width:i,height:u}},{memoizeOptions:{resultEqualityCheck:Yt}}),_re=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:i,width:u,height:d}=L(Cre);return a.jsxs(ka,{...t,children:[r&&n&&a.jsx(EI,{canvasImage:n}),o&&a.jsxs(ka,{children:[a.jsx(Qs,{x:s,y:i,width:u,height:d,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(Qs,{x:s,y:i,width:u,height:d,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},kre=we([tn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n,sessionId:r}},shouldShowStagingOutline:o,shouldShowStagingImage:s}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:s,shouldShowStagingOutline:o,sessionId:r}},{memoizeOptions:{resultEqualityCheck:Yt}}),jre=()=>{const e=ne(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o,sessionId:s}=L(kre),{t:i}=pe(),u=f.useCallback(()=>{e(Bx(!0))},[e]),d=f.useCallback(()=>{e(Bx(!1))},[e]);Ze(["left"],()=>{p()},{enabled:()=>!0,preventDefault:!0}),Ze(["right"],()=>{m()},{enabled:()=>!0,preventDefault:!0}),Ze(["enter"],()=>{h()},{enabled:()=>!0,preventDefault:!0});const p=f.useCallback(()=>e(R7()),[e]),m=f.useCallback(()=>e(M7()),[e]),h=f.useCallback(()=>e(D7(s)),[e,s]);return r?a.jsx(G,{pos:"absolute",bottom:4,w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:u,onMouseOut:d,children:a.jsxs(dr,{isAttached:!0,children:[a.jsx(Ae,{tooltip:`${i("unifiedCanvas.previous")} (Left)`,"aria-label":`${i("unifiedCanvas.previous")} (Left)`,icon:a.jsx(m$,{}),onClick:p,colorScheme:"accent",isDisabled:t}),a.jsx(Ae,{tooltip:`${i("unifiedCanvas.next")} (Right)`,"aria-label":`${i("unifiedCanvas.next")} (Right)`,icon:a.jsx(g$,{}),onClick:m,colorScheme:"accent",isDisabled:n}),a.jsx(Ae,{tooltip:`${i("unifiedCanvas.accept")} (Enter)`,"aria-label":`${i("unifiedCanvas.accept")} (Enter)`,icon:a.jsx(b$,{}),onClick:h,colorScheme:"accent"}),a.jsx(Ae,{tooltip:i("unifiedCanvas.showHide"),"aria-label":i("unifiedCanvas.showHide"),"data-alert":!o,icon:o?a.jsx(P$,{}):a.jsx(j$,{}),onClick:()=>e(T7(!o)),colorScheme:"accent"}),a.jsx(Ae,{tooltip:i("unifiedCanvas.saveToGallery"),"aria-label":i("unifiedCanvas.saveToGallery"),icon:a.jsx(Ph,{}),onClick:()=>e(A7({imageName:r.imageName})),colorScheme:"accent"}),a.jsx(Ae,{tooltip:i("unifiedCanvas.discardAll"),"aria-label":i("unifiedCanvas.discardAll"),icon:a.jsx(jh,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(N7()),colorScheme:"error",fontSize:20})]})}):null},Tl=e=>Math.round(e*100)/100,Pre=we([tn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Tl(n)}, ${Tl(r)})`}},{memoizeOptions:{resultEqualityCheck:Yt}});function Ire(){const{cursorCoordinatesString:e}=L(Pre),{t}=pe();return a.jsx(Be,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const mv="var(--invokeai-colors-warning-500)",Ere=we([tn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:i},scaledBoundingBoxDimensions:{width:u,height:d},boundingBoxCoordinates:{x:p,y:m},stageScale:h,shouldShowCanvasDebugInfo:v,layer:b,boundingBoxScaleMethod:w,shouldPreserveMaskedArea:S}=e;let C="inherit";return(w==="none"&&(s<512||i<512)||w==="manual"&&u*d<512*512)&&(C=mv),{activeLayerColor:b==="mask"?mv:"inherit",activeLayerString:b.charAt(0).toUpperCase()+b.slice(1),boundingBoxColor:C,boundingBoxCoordinatesString:`(${Tl(p)}, ${Tl(m)})`,boundingBoxDimensionsString:`${s}×${i}`,scaledBoundingBoxDimensionsString:`${u}×${d}`,canvasCoordinatesString:`${Tl(r)}×${Tl(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:v,shouldShowBoundingBox:w!=="auto",shouldShowScaledBoundingBox:w!=="none",shouldPreserveMaskedArea:S}},{memoizeOptions:{resultEqualityCheck:Yt}}),Ore=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:i,canvasCoordinatesString:u,canvasDimensionsString:d,canvasScaleString:p,shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:h,shouldPreserveMaskedArea:v}=L(Ere),{t:b}=pe();return a.jsxs(G,{sx:{flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,opacity:.65,display:"flex",fontSize:"sm",padding:1,px:2,minWidth:48,margin:1,borderRadius:"base",pointerEvents:"none",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(Be,{style:{color:e},children:`${b("unifiedCanvas.activeLayer")}: ${t}`}),a.jsx(Be,{children:`${b("unifiedCanvas.canvasScale")}: ${p}%`}),v&&a.jsx(Be,{style:{color:mv},children:"Preserve Masked Area: On"}),h&&a.jsx(Be,{style:{color:n},children:`${b("unifiedCanvas.boundingBox")}: ${o}`}),i&&a.jsx(Be,{style:{color:n},children:`${b("unifiedCanvas.scaledBoundingBox")}: ${s}`}),m&&a.jsxs(a.Fragment,{children:[a.jsx(Be,{children:`${b("unifiedCanvas.boundingBoxPosition")}: ${r}`}),a.jsx(Be,{children:`${b("unifiedCanvas.canvasDimensions")}: ${d}`}),a.jsx(Be,{children:`${b("unifiedCanvas.canvasPosition")}: ${u}`}),a.jsx(Ire,{})]})]})},Rre=we([tn,Xr],(e,t)=>{const{boundingBoxCoordinates:n,boundingBoxDimensions:r,stageScale:o,isDrawing:s,isTransformingBoundingBox:i,isMovingBoundingBox:u,tool:d,shouldSnapToGrid:p}=e,{aspectRatio:m}=t;return{boundingBoxCoordinates:n,boundingBoxDimensions:r,isDrawing:s,isMovingBoundingBox:u,isTransformingBoundingBox:i,stageScale:o,shouldSnapToGrid:p,tool:d,hitStrokeWidth:20/o,aspectRatio:m}},{memoizeOptions:{resultEqualityCheck:Yt}}),Mre=e=>{const{...t}=e,n=ne(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:i,isTransformingBoundingBox:u,stageScale:d,shouldSnapToGrid:p,tool:m,hitStrokeWidth:h,aspectRatio:v}=L(Rre),b=f.useRef(null),w=f.useRef(null),[S,C]=f.useState(!1);f.useEffect(()=>{var F;!b.current||!w.current||(b.current.nodes([w.current]),(F=b.current.getLayer())==null||F.batchDraw())},[]);const _=64*d,k=f.useCallback(F=>{if(!p){n(og({x:Math.floor(F.target.x()),y:Math.floor(F.target.y())}));return}const N=F.target.x(),H=F.target.y(),K=ms(N,64),A=ms(H,64);F.target.x(K),F.target.y(A),n(og({x:K,y:A}))},[n,p]),P=f.useCallback(()=>{if(!w.current)return;const F=w.current,N=F.scaleX(),H=F.scaleY(),K=Math.round(F.width()*N),A=Math.round(F.height()*H),U=Math.round(F.x()),V=Math.round(F.y());if(v){const W=ms(K/v,64);n(Us({width:K,height:W}))}else n(Us({width:K,height:A}));n(og({x:p?Dd(U,64):U,y:p?Dd(V,64):V})),F.scaleX(1),F.scaleY(1)},[n,p,v]),E=f.useCallback((F,N,H)=>{const K=F.x%_,A=F.y%_;return{x:Dd(N.x,_)+K,y:Dd(N.y,_)+A}},[_]),I=()=>{n(sg(!0))},R=()=>{n(sg(!1)),n(ag(!1)),n(Td(!1)),C(!1)},O=()=>{n(ag(!0))},D=()=>{n(sg(!1)),n(ag(!1)),n(Td(!1)),C(!1)},T=()=>{C(!0)},$=()=>{!u&&!i&&C(!1)},B=()=>{n(Td(!0))},ee=()=>{n(Td(!1))};return a.jsxs(ka,{...t,children:[a.jsx(Qs,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:B,onMouseOver:B,onMouseLeave:ee,onMouseOut:ee}),a.jsx(Qs,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:h,listening:!s&&m==="move",onDragStart:O,onDragEnd:D,onDragMove:k,onMouseDown:O,onMouseOut:$,onMouseOver:T,onMouseEnter:T,onMouseUp:D,onTransform:P,onTransformEnd:R,ref:w,stroke:S?"rgba(255,255,255,0.7)":"white",strokeWidth:(S?8:1)/d,width:o.width,x:r.x,y:r.y}),a.jsx(Kne,{anchorCornerRadius:3,anchorDragBoundFunc:E,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:m==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&m==="move",onDragStart:O,onDragEnd:D,onMouseDown:I,onMouseUp:R,onTransformEnd:R,ref:b,rotateEnabled:!1})]})},Dre=we(tn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:i,layer:u,shouldShowBrush:d,isMovingBoundingBox:p,isTransformingBoundingBox:m,stageScale:h,stageDimensions:v,boundingBoxCoordinates:b,boundingBoxDimensions:w,shouldRestrictStrokesToBox:S}=e,C=S?{clipX:b.x,clipY:b.y,clipWidth:w.width,clipHeight:w.height}:{};return{cursorPosition:t,brushX:t?t.x:v.width/2,brushY:t?t.y:v.height/2,radius:n/2,colorPickerOuterRadius:Hx/h,colorPickerInnerRadius:(Hx-c0+1)/h,maskColorString:Li({...o,a:.5}),brushColorString:Li(s),colorPickerColorString:Li(r),tool:i,layer:u,shouldShowBrush:d,shouldDrawBrushPreview:!(p||m||!t)&&d,strokeWidth:1.5/h,dotRadius:1.5/h,clip:C}},{memoizeOptions:{resultEqualityCheck:Yt}}),Tre=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:i,layer:u,shouldDrawBrushPreview:d,dotRadius:p,strokeWidth:m,brushColorString:h,colorPickerColorString:v,colorPickerInnerRadius:b,colorPickerOuterRadius:w,clip:S}=L(Dre);return d?a.jsxs(ka,{listening:!1,...S,...t,children:[i==="colorPicker"?a.jsxs(a.Fragment,{children:[a.jsx(Si,{x:n,y:r,radius:w,stroke:h,strokeWidth:c0,strokeScaleEnabled:!1}),a.jsx(Si,{x:n,y:r,radius:b,stroke:v,strokeWidth:c0,strokeScaleEnabled:!1})]}):a.jsxs(a.Fragment,{children:[a.jsx(Si,{x:n,y:r,radius:o,fill:u==="mask"?s:h,globalCompositeOperation:i==="eraser"?"destination-out":"source-out"}),a.jsx(Si,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:m*2,strokeEnabled:!0,listening:!1}),a.jsx(Si,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:m,strokeEnabled:!0,listening:!1})]}),a.jsx(Si,{x:n,y:r,radius:p*2,fill:"rgba(255,255,255,0.4)",listening:!1}),a.jsx(Si,{x:n,y:r,radius:p,fill:"rgba(0,0,0,1)",listening:!1})]}):null},Are=we([tn,er],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:i,isMovingBoundingBox:u,stageDimensions:d,stageCoordinates:p,tool:m,isMovingStage:h,shouldShowIntermediates:v,shouldShowGrid:b,shouldRestrictStrokesToBox:w,shouldAntialias:S}=e;let C="none";return m==="move"||t?h?C="grabbing":C="grab":s?C=void 0:w&&!i&&(C="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||u,shouldShowBoundingBox:o,shouldShowGrid:b,stageCoordinates:p,stageCursor:C,stageDimensions:d,stageScale:r,tool:m,isStaging:t,shouldShowIntermediates:v,shouldAntialias:S}},ut),Nre=Ue(Yne,{shouldForwardProp:e=>!["sx"].includes(e)}),k4=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:i,stageScale:u,tool:d,isStaging:p,shouldShowIntermediates:m,shouldAntialias:h}=L(Are);Jne();const v=f.useRef(null),b=f.useRef(null),w=f.useCallback($=>{z7($),v.current=$},[]),S=f.useCallback($=>{$7($),b.current=$},[]),C=f.useRef({x:0,y:0}),_=f.useRef(!1),k=lre(v),P=tre(v),E=are(v,_),I=rre(v,_,C),R=ore(),{handleDragStart:O,handleDragMove:D,handleDragEnd:T}=Xne();return a.jsx(G,{sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:a.jsxs(Be,{sx:{position:"relative"},children:[a.jsxs(Nre,{tabIndex:-1,ref:w,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:i.width,height:i.height,scale:{x:u,y:u},onTouchStart:P,onTouchMove:I,onTouchEnd:E,onMouseDown:P,onMouseLeave:R,onMouseMove:I,onMouseUp:E,onDragStart:O,onDragMove:D,onDragEnd:T,onContextMenu:$=>$.evt.preventDefault(),onWheel:k,draggable:(d==="move"||p)&&!t,children:[a.jsx(qc,{id:"grid",visible:r,children:a.jsx(fre,{})}),a.jsx(qc,{id:"base",ref:S,listening:!1,imageSmoothingEnabled:h,children:a.jsx(wre,{})}),a.jsxs(qc,{id:"mask",visible:e,listening:!1,children:[a.jsx(yre,{visible:!0,listening:!1}),a.jsx(gre,{listening:!1})]}),a.jsx(qc,{children:a.jsx(ure,{})}),a.jsxs(qc,{id:"preview",imageSmoothingEnabled:h,children:[!p&&a.jsx(Tre,{visible:d!=="move",listening:!1}),a.jsx(_re,{visible:p}),m&&a.jsx(hre,{}),a.jsx(Mre,{visible:n&&!p})]})]}),a.jsx(Ore,{}),a.jsx(jre,{})]})})},$re=we(tn,L7,yr,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}}),j4=()=>{const e=ne(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=L($re),s=f.useRef(null);return f.useLayoutEffect(()=>{window.setTimeout(()=>{if(!s.current)return;const{clientWidth:i,clientHeight:u}=s.current;e(F7({width:i,height:u})),e(o?B7():sh()),e(B4(!1))},0)},[e,r,t,n,o]),a.jsx(G,{ref:s,sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,width:"100%",height:"100%"},children:a.jsx(fc,{thickness:"2px",size:"xl"})})};function OI(e,t,n=250){const[r,o]=f.useState(0);return f.useEffect(()=>{const s=setTimeout(()=>{r===1&&e(),o(0)},n);return r===2&&t(),()=>clearTimeout(s)},[r,e,t,n]),()=>o(s=>s+1)}const zre=Ue(mI,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),t0={width:6,height:6,borderColor:"base.100"},Lre=e=>{const{styleClass:t="",...n}=e;return a.jsx(zre,{sx:{".react-colorful__hue-pointer":t0,".react-colorful__saturation-pointer":t0,".react-colorful__alpha-pointer":t0},className:t,...n})},eh=f.memo(Lre),Fre=we([tn,er],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Li(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Yt}}),Bre=()=>{const e=ne(),{t}=pe(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:i}=L(Fre);Ze(["q"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[n]),Ze(["shift+c"],()=>{d()},{enabled:()=>!i,preventDefault:!0},[]),Ze(["h"],()=>{p()},{enabled:()=>!i,preventDefault:!0},[o]);const u=()=>{e(Vf(n==="mask"?"base":"mask"))},d=()=>e(Mv()),p=()=>e(Ru(!o));return a.jsx(da,{triggerComponent:a.jsx(dr,{children:a.jsx(Ae,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:a.jsx(A$,{}),isChecked:n==="mask",isDisabled:i})}),children:a.jsxs(G,{direction:"column",gap:2,children:[a.jsx(En,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:p}),a.jsx(En,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:m=>e(S3(m.target.checked))}),a.jsx(eh,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:m=>e(w3(m))}),a.jsxs(Ut,{size:"sm",leftIcon:a.jsx(mo,{}),onClick:d,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},Hre=we([tn,yr,yo],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Yt}});function RI(){const e=ne(),{canRedo:t,activeTabName:n}=L(Hre),{t:r}=pe(),o=()=>{e(H7())};return Ze(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),a.jsx(Ae,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:a.jsx(F$,{}),onClick:o,isDisabled:!t})}const MI=()=>{const e=L(er),t=ne(),{t:n}=pe();return a.jsxs(xy,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(V7()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:a.jsx(Ut,{size:"sm",leftIcon:a.jsx(mo,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),a.jsx("br",{}),a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},Vre=we([tn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:u,shouldRestrictStrokesToBox:d,shouldAntialias:p}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:u,shouldRestrictStrokesToBox:d,shouldAntialias:p}},{memoizeOptions:{resultEqualityCheck:Yt}}),Wre=()=>{const e=ne(),{t}=pe(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:i,shouldShowIntermediates:u,shouldSnapToGrid:d,shouldRestrictStrokesToBox:p,shouldAntialias:m}=L(Vre);Ze(["n"],()=>{e(Hf(!d))},{enabled:!0,preventDefault:!0},[d]);const h=v=>e(Hf(v.target.checked));return a.jsx(da,{isLazy:!1,triggerComponent:a.jsx(Ae,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(p1,{})}),children:a.jsxs(G,{direction:"column",gap:2,children:[a.jsx(En,{label:t("unifiedCanvas.showIntermediates"),isChecked:u,onChange:v=>e(C3(v.target.checked))}),a.jsx(En,{label:t("unifiedCanvas.showGrid"),isChecked:i,onChange:v=>e(_3(v.target.checked))}),a.jsx(En,{label:t("unifiedCanvas.snapToGrid"),isChecked:d,onChange:h}),a.jsx(En,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:v=>e(k3(v.target.checked))}),a.jsx(En,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:v=>e(j3(v.target.checked))}),a.jsx(En,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:v=>e(P3(v.target.checked))}),a.jsx(En,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:v=>e(I3(v.target.checked))}),a.jsx(En,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:v=>e(E3(v.target.checked))}),a.jsx(En,{label:t("unifiedCanvas.antialiasing"),isChecked:m,onChange:v=>e(O3(v.target.checked))}),a.jsx(MI,{})]})})},Ure=we([tn,er,yo],(e,t,n)=>{const{isProcessing:r}=n,{tool:o,brushColor:s,brushSize:i}=e;return{tool:o,isStaging:t,isProcessing:r,brushColor:s,brushSize:i}},{memoizeOptions:{resultEqualityCheck:Yt}}),Gre=()=>{const e=ne(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=L(Ure),{t:s}=pe();Ze(["b"],()=>{i()},{enabled:()=>!o,preventDefault:!0},[]),Ze(["e"],()=>{u()},{enabled:()=>!o,preventDefault:!0},[t]),Ze(["c"],()=>{d()},{enabled:()=>!o,preventDefault:!0},[t]),Ze(["shift+f"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),Ze(["delete","backspace"],()=>{m()},{enabled:()=>!o,preventDefault:!0}),Ze(["BracketLeft"],()=>{e(Nl(Math.max(r-5,5)))},{enabled:()=>!o,preventDefault:!0},[r]),Ze(["BracketRight"],()=>{e(Nl(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),Ze(["shift+BracketLeft"],()=>{e($l({...n,a:qs(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),Ze(["shift+BracketRight"],()=>{e($l({...n,a:qs(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const i=()=>e(Gs("brush")),u=()=>e(Gs("eraser")),d=()=>e(Gs("colorPicker")),p=()=>e(R3()),m=()=>e(M3());return a.jsxs(dr,{isAttached:!0,children:[a.jsx(Ae,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:a.jsx(e_,{}),isChecked:t==="brush"&&!o,onClick:i,isDisabled:o}),a.jsx(Ae,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:a.jsx(Q5,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:u}),a.jsx(Ae,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(Z5,{}),isDisabled:o,onClick:p}),a.jsx(Ae,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(jh,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:m}),a.jsx(Ae,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(X5,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:d}),a.jsx(da,{triggerComponent:a.jsx(Ae,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:a.jsx(d1,{})}),children:a.jsxs(G,{minWidth:60,direction:"column",gap:4,width:"100%",children:[a.jsx(G,{gap:4,justifyContent:"space-between",children:a.jsx(yt,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:h=>e(Nl(h)),sliderNumberInputProps:{max:500}})}),a.jsx(eh,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:h=>e($l(h))})]})})]})},qre=we([tn,yr,yo],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Yt}});function DI(){const e=ne(),{t}=pe(),{canUndo:n,activeTabName:r}=L(qre),o=()=>{e(W7())};return Ze(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),a.jsx(Ae,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:a.jsx(f1,{}),onClick:o,isDisabled:!n})}const Kre=we([yo,tn,er],(e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:s,layer:i,isMaskEnabled:u}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:u,tool:o,layer:i,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:Yt}}),Yre=()=>{const e=ne(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s}=L(Kre),i=ya(),{t:u}=pe(),{openUploader:d}=kh();Ze(["v"],()=>{p()},{enabled:()=>!n,preventDefault:!0},[]),Ze(["r"],()=>{h()},{enabled:()=>!0,preventDefault:!0},[i]),Ze(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[i,t]),Ze(["shift+s"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[i,t]),Ze(["meta+c","ctrl+c"],()=>{S()},{enabled:()=>!n,preventDefault:!0},[i,t]),Ze(["shift+d"],()=>{C()},{enabled:()=>!n,preventDefault:!0},[i,t]);const p=()=>e(Gs("move")),m=OI(()=>h(!1),()=>h(!0)),h=(k=!1)=>{const P=ya();if(!P)return;const E=P.getClientRect({skipTransform:!0});e(D3({contentRect:E,shouldScaleTo1:k}))},v=()=>{e(L3()),e(sh())},b=()=>{e(T3())},w=()=>{e(A3())},S=()=>{e(N3())},C=()=>{e($3())},_=k=>{const P=k;e(Vf(P)),P==="mask"&&!r&&e(Ru(!0))};return a.jsxs(G,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[a.jsx(Be,{w:24,children:a.jsx(gr,{tooltip:`${u("unifiedCanvas.layer")} (Q)`,value:o,data:z3,onChange:_,disabled:n})}),a.jsx(Bre,{}),a.jsx(Gre,{}),a.jsxs(dr,{isAttached:!0,children:[a.jsx(Ae,{"aria-label":`${u("unifiedCanvas.move")} (V)`,tooltip:`${u("unifiedCanvas.move")} (V)`,icon:a.jsx(K5,{}),isChecked:s==="move"||n,onClick:p}),a.jsx(Ae,{"aria-label":`${u("unifiedCanvas.resetView")} (R)`,tooltip:`${u("unifiedCanvas.resetView")} (R)`,icon:a.jsx(Y5,{}),onClick:m})]}),a.jsxs(dr,{isAttached:!0,children:[a.jsx(Ae,{"aria-label":`${u("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${u("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(u1,{}),onClick:b,isDisabled:n}),a.jsx(Ae,{"aria-label":`${u("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${u("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(Ph,{}),onClick:w,isDisabled:n}),a.jsx(Ae,{"aria-label":`${u("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${u("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(gc,{}),onClick:S,isDisabled:n}),a.jsx(Ae,{"aria-label":`${u("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${u("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(c1,{}),onClick:C,isDisabled:n})]}),a.jsxs(dr,{isAttached:!0,children:[a.jsx(DI,{}),a.jsx(RI,{})]}),a.jsxs(dr,{isAttached:!0,children:[a.jsx(Ae,{"aria-label":`${u("common.upload")}`,tooltip:`${u("common.upload")}`,icon:a.jsx(Hu,{}),onClick:d,isDisabled:n}),a.jsx(Ae,{"aria-label":`${u("unifiedCanvas.clearCanvas")}`,tooltip:`${u("unifiedCanvas.clearCanvas")}`,icon:a.jsx(mo,{}),onClick:v,colorScheme:"error",isDisabled:n})]}),a.jsx(dr,{isAttached:!0,children:a.jsx(Wre,{})})]})};function Qre(){const e=ne(),t=L(o=>o.canvas.brushSize),{t:n}=pe(),r=L(er);return Ze(["BracketLeft"],()=>{e(Nl(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),Ze(["BracketRight"],()=>{e(Nl(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),a.jsx(yt,{label:n("unifiedCanvas.brushSize"),value:t,withInput:!0,onChange:o=>e(Nl(o)),sliderNumberInputProps:{max:500},isCompact:!0})}const Xre=we([tn,er],(e,t)=>{const{brushColor:n,maskColor:r,layer:o}=e;return{brushColor:n,maskColor:r,layer:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Yt}});function Zre(){const e=ne(),{brushColor:t,maskColor:n,layer:r,isStaging:o}=L(Xre),s=()=>{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($l({...t,a:qs(t.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),Ze(["shift+BracketRight"],()=>{e($l({...t,a:qs(t.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),a.jsx(da,{triggerComponent:a.jsx(Be,{sx:{width:7,height:7,minWidth:7,minHeight:7,borderRadius:"full",bg:s(),cursor:"pointer"}}),children:a.jsxs(G,{minWidth:60,direction:"column",gap:4,width:"100%",children:[r==="base"&&a.jsx(eh,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:t,onChange:i=>e($l(i))}),r==="mask"&&a.jsx(eh,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:i=>e(w3(i))})]})})}function TI(){return a.jsxs(G,{columnGap:4,alignItems:"center",children:[a.jsx(Qre,{}),a.jsx(Zre,{})]})}function Jre(){const e=ne(),t=L(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=pe();return a.jsx(En,{label:n("unifiedCanvas.betaLimitToBox"),isChecked:t,onChange:r=>e(I3(r.target.checked))})}function eoe(){return a.jsxs(G,{gap:4,alignItems:"center",children:[a.jsx(TI,{}),a.jsx(Jre,{})]})}function toe(){const e=ne(),{t}=pe(),n=()=>e(Mv());return a.jsx(Ut,{size:"sm",leftIcon:a.jsx(mo,{}),onClick:n,tooltip:`${t("unifiedCanvas.clearMask")} (Shift+C)`,children:t("unifiedCanvas.betaClear")})}function noe(){const e=L(o=>o.canvas.isMaskEnabled),t=ne(),{t:n}=pe(),r=()=>t(Ru(!e));return a.jsx(En,{label:`${n("unifiedCanvas.enableMask")} (H)`,isChecked:e,onChange:r})}function roe(){const e=ne(),{t}=pe(),n=L(r=>r.canvas.shouldPreserveMaskedArea);return a.jsx(En,{label:t("unifiedCanvas.betaPreserveMasked"),isChecked:n,onChange:r=>e(S3(r.target.checked))})}function ooe(){return a.jsxs(G,{gap:4,alignItems:"center",children:[a.jsx(TI,{}),a.jsx(noe,{}),a.jsx(roe,{}),a.jsx(toe,{})]})}function soe(){const e=L(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=ne(),{t:n}=pe();return a.jsx(En,{label:n("unifiedCanvas.betaDarkenOutside"),isChecked:e,onChange:r=>t(k3(r.target.checked))})}function aoe(){const e=L(r=>r.canvas.shouldShowGrid),t=ne(),{t:n}=pe();return a.jsx(En,{label:n("unifiedCanvas.showGrid"),isChecked:e,onChange:r=>t(_3(r.target.checked))})}function ioe(){const e=L(o=>o.canvas.shouldSnapToGrid),t=ne(),{t:n}=pe(),r=o=>t(Hf(o.target.checked));return a.jsx(En,{label:`${n("unifiedCanvas.snapToGrid")} (N)`,isChecked:e,onChange:r})}function loe(){return a.jsxs(G,{alignItems:"center",gap:4,children:[a.jsx(aoe,{}),a.jsx(ioe,{}),a.jsx(soe,{})]})}const coe=we([tn],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:Yt}});function uoe(){const{tool:e,layer:t}=L(coe);return a.jsxs(G,{height:8,minHeight:8,maxHeight:8,alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&a.jsx(eoe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&a.jsx(ooe,{}),e=="move"&&a.jsx(loe,{})]})}const doe=we([tn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o,shouldAntialias:s}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o,shouldAntialias:s}},{memoizeOptions:{resultEqualityCheck:Yt}}),foe=()=>{const e=ne(),{t}=pe(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:o,shouldShowIntermediates:s,shouldAntialias:i}=L(doe);return a.jsx(da,{isLazy:!1,triggerComponent:a.jsx(Ae,{tooltip:t("unifiedCanvas.canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(p1,{})}),children:a.jsxs(G,{direction:"column",gap:2,children:[a.jsx(En,{label:t("unifiedCanvas.showIntermediates"),isChecked:s,onChange:u=>e(C3(u.target.checked))}),a.jsx(En,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:u=>e(j3(u.target.checked))}),a.jsx(En,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:u=>e(P3(u.target.checked))}),a.jsx(En,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:o,onChange:u=>e(E3(u.target.checked))}),a.jsx(En,{label:t("unifiedCanvas.antialiasing"),isChecked:i,onChange:u=>e(O3(u.target.checked))}),a.jsx(MI,{})]})})};function poe(){const e=L(er),t=ya(),n=L(i=>i.system.isProcessing),r=ne(),{t:o}=pe();Ze(["meta+c","ctrl+c"],()=>{s()},{enabled:()=>!e,preventDefault:!0},[t,n]);const s=()=>{r(N3())};return a.jsx(Ae,{"aria-label":`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(gc,{}),onClick:s,isDisabled:e})}function hoe(){const e=ne(),{t}=pe(),n=ya(),r=L(er);Ze(["shift+d"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]);const o=()=>{e($3())};return a.jsx(Ae,{"aria-label":`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(c1,{}),onClick:o,isDisabled:r})}function moe(){const e=L(er),{openUploader:t}=kh(),{t:n}=pe();return a.jsx(Ae,{"aria-label":n("common.upload"),tooltip:n("common.upload"),icon:a.jsx(Hu,{}),onClick:t,isDisabled:e})}const goe=we([tn,er],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Yt}});function voe(){const e=ne(),{t}=pe(),{layer:n,isMaskEnabled:r,isStaging:o}=L(goe),s=()=>{e(Vf(n==="mask"?"base":"mask"))};Ze(["q"],()=>{s()},{enabled:()=>!o,preventDefault:!0},[n]);const i=u=>{const d=u;e(Vf(d)),d==="mask"&&!r&&e(Ru(!0))};return a.jsx(Ys,{tooltip:`${t("unifiedCanvas.layer")} (Q)`,"aria-label":`${t("unifiedCanvas.layer")} (Q)`,value:n,data:z3,onChange:i,disabled:o,w:"full"})}function yoe(){const e=ne(),{t}=pe(),n=ya(),r=L(er),o=L(i=>i.system.isProcessing);Ze(["shift+m"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n,o]);const s=()=>{e(T3())};return a.jsx(Ae,{"aria-label":`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(u1,{}),onClick:s,isDisabled:r})}function boe(){const e=L(s=>s.canvas.tool),t=L(er),n=ne(),{t:r}=pe();Ze(["v"],()=>{o()},{enabled:()=>!t,preventDefault:!0},[]);const o=()=>n(Gs("move"));return a.jsx(Ae,{"aria-label":`${r("unifiedCanvas.move")} (V)`,tooltip:`${r("unifiedCanvas.move")} (V)`,icon:a.jsx(K5,{}),isChecked:e==="move"||t,onClick:o})}function xoe(){const e=L(s=>s.ui.shouldPinParametersPanel),t=L(s=>s.ui.shouldShowParametersPanel),n=ne(),{t:r}=pe(),o=()=>{n(Dv(!0)),e&&n(js())};return!e||!t?a.jsxs(G,{flexDirection:"column",gap:2,children:[a.jsx(Ae,{tooltip:`${r("parameters.showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":r("parameters.showOptionsPanel"),onClick:o,children:a.jsx(d1,{})}),a.jsx(G,{children:a.jsx(gy,{iconButton:!0})}),a.jsx(G,{children:a.jsx(qh,{width:"100%",height:"40px",btnGroupWidth:"100%"})})]}):null}function Soe(){const e=ne(),{t}=pe(),n=L(er),r=()=>{e(L3()),e(sh())};return a.jsx(Ae,{"aria-label":t("unifiedCanvas.clearCanvas"),tooltip:t("unifiedCanvas.clearCanvas"),icon:a.jsx(mo,{}),onClick:r,isDisabled:n,colorScheme:"error"})}function woe(){const e=ya(),t=ne(),{t:n}=pe();Ze(["r"],()=>{o()},{enabled:()=>!0,preventDefault:!0},[e]);const r=OI(()=>o(!1),()=>o(!0)),o=(s=!1)=>{const i=ya();if(!i)return;const u=i.getClientRect({skipTransform:!0});t(D3({contentRect:u,shouldScaleTo1:s}))};return a.jsx(Ae,{"aria-label":`${n("unifiedCanvas.resetView")} (R)`,tooltip:`${n("unifiedCanvas.resetView")} (R)`,icon:a.jsx(Y5,{}),onClick:r})}function Coe(){const e=L(er),t=ya(),n=L(i=>i.system.isProcessing),r=ne(),{t:o}=pe();Ze(["shift+s"],()=>{s()},{enabled:()=>!e,preventDefault:!0},[t,n]);const s=()=>{r(A3())};return a.jsx(Ae,{"aria-label":`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(Ph,{}),onClick:s,isDisabled:e})}const _oe=we([tn,er,yo],(e,t,n)=>{const{isProcessing:r}=n,{tool:o}=e;return{tool:o,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:Yt}}),koe=()=>{const e=ne(),{t}=pe(),{tool:n,isStaging:r}=L(_oe);Ze(["b"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[]),Ze(["e"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n]),Ze(["c"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[n]),Ze(["shift+f"],()=>{u()},{enabled:()=>!r,preventDefault:!0}),Ze(["delete","backspace"],()=>{d()},{enabled:()=>!r,preventDefault:!0});const o=()=>e(Gs("brush")),s=()=>e(Gs("eraser")),i=()=>e(Gs("colorPicker")),u=()=>e(R3()),d=()=>e(M3());return a.jsxs(G,{flexDirection:"column",gap:2,children:[a.jsxs(dr,{children:[a.jsx(Ae,{"aria-label":`${t("unifiedCanvas.brush")} (B)`,tooltip:`${t("unifiedCanvas.brush")} (B)`,icon:a.jsx(e_,{}),isChecked:n==="brush"&&!r,onClick:o,isDisabled:r}),a.jsx(Ae,{"aria-label":`${t("unifiedCanvas.eraser")} (E)`,tooltip:`${t("unifiedCanvas.eraser")} (B)`,icon:a.jsx(Q5,{}),isChecked:n==="eraser"&&!r,isDisabled:r,onClick:s})]}),a.jsxs(dr,{children:[a.jsx(Ae,{"aria-label":`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(Z5,{}),isDisabled:r,onClick:u}),a.jsx(Ae,{"aria-label":`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(jh,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:d})]}),a.jsx(Ae,{"aria-label":`${t("unifiedCanvas.colorPicker")} (C)`,tooltip:`${t("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(X5,{}),isChecked:n==="colorPicker"&&!r,isDisabled:r,onClick:i,width:"max-content"})]})},joe=()=>a.jsxs(G,{flexDirection:"column",rowGap:2,width:"min-content",children:[a.jsx(voe,{}),a.jsx(koe,{}),a.jsxs(G,{gap:2,children:[a.jsx(boe,{}),a.jsx(woe,{})]}),a.jsxs(G,{columnGap:2,children:[a.jsx(yoe,{}),a.jsx(Coe,{})]}),a.jsxs(G,{columnGap:2,children:[a.jsx(poe,{}),a.jsx(hoe,{})]}),a.jsxs(G,{gap:2,children:[a.jsx(DI,{}),a.jsx(RI,{})]}),a.jsxs(G,{gap:2,children:[a.jsx(moe,{}),a.jsx(Soe,{})]}),a.jsx(foe,{}),a.jsx(xoe,{})]}),Poe=we([tn,Xr],(e,t)=>{const{doesCanvasNeedScaling:n}=e,{shouldUseCanvasBetaLayout:r}=t;return{doesCanvasNeedScaling:n,shouldUseCanvasBetaLayout:r}},ut),n0={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},Ioe=()=>{const e=ne(),{doesCanvasNeedScaling:t,shouldUseCanvasBetaLayout:n}=L(Poe),{isOver:r,setNodeRef:o,active:s}=wv({id:"unifiedCanvas",data:n0});return f.useLayoutEffect(()=>{const i=()=>{e(js())};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[e]),n?a.jsx(Be,{layerStyle:"first",ref:o,tabIndex:0,sx:{w:"full",h:"full",p:4,borderRadius:"base"},children:a.jsxs(G,{sx:{w:"full",h:"full",gap:4},children:[a.jsx(joe,{}),a.jsxs(G,{sx:{flexDir:"column",w:"full",h:"full",gap:4,position:"relative"},children:[a.jsx(uoe,{}),a.jsxs(Be,{sx:{w:"full",h:"full",position:"relative"},children:[t?a.jsx(j4,{}):a.jsx(k4,{}),Mf(n0,s)&&a.jsx(sp,{isOver:r,label:"Set Canvas Initial Image"})]})]})]})}):a.jsx(Be,{ref:o,tabIndex:-1,sx:{layerStyle:"first",w:"full",h:"full",p:4,borderRadius:"base"},children:a.jsxs(G,{sx:{flexDirection:"column",alignItems:"center",gap:4,w:"full",h:"full"},children:[a.jsx(Yre,{}),a.jsx(G,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,w:"full",h:"full"},children:a.jsxs(Be,{sx:{w:"full",h:"full",position:"relative"},children:[t?a.jsx(j4,{}):a.jsx(k4,{}),Mf(n0,s)&&a.jsx(sp,{isOver:r,label:"Set Canvas Initial Image"})]})})]})})},Eoe=f.memo(Ioe),Ooe=we([Tt],({generation:e})=>{const{infillMethod:t}=e;return{infillMethod:t}},ut),Roe=()=>{const e=ne(),{infillMethod:t}=L(Ooe),{data:n,isLoading:r}=U7(),o=n==null?void 0:n.infill_methods,{t:s}=pe(),i=f.useCallback(u=>{e(G7(u))},[e]);return a.jsx(Ys,{disabled:(o==null?void 0:o.length)===0,placeholder:r?"Loading...":void 0,label:s("parameters.infillMethod"),value:t,data:o??[],onChange:i})},Moe=f.memo(Roe),Doe=we([ns],e=>{const{tileSize:t,infillMethod:n}=e;return{tileSize:t,infillMethod:n}},ut),Toe=()=>{const e=ne(),{tileSize:t,infillMethod:n}=L(Doe),{t:r}=pe(),o=f.useCallback(i=>{e(Vx(i))},[e]),s=f.useCallback(()=>{e(Vx(32))},[e]);return a.jsx(yt,{isDisabled:n!=="tile",label:r("parameters.tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},Aoe=f.memo(Toe),Noe=we([tn],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},ut),$oe=()=>{const e=ne(),{boundingBoxScale:t}=L(Noe),{t:n}=pe(),r=o=>{e(K7(o))};return a.jsx(gr,{label:n("parameters.scaleBeforeProcessing"),data:q7,value:t,onChange:r})},zoe=f.memo($oe),Loe=we([ns,yo,tn],(e,t,n)=>{const{scaledBoundingBoxDimensions:r,boundingBoxScaleMethod:o}=n;return{scaledBoundingBoxDimensions:r,isManual:o==="manual"}},ut),Foe=()=>{const e=ne(),{isManual:t,scaledBoundingBoxDimensions:n}=L(Loe),{t:r}=pe(),o=i=>{e(Wf({...n,height:Math.floor(i)}))},s=()=>{e(Wf({...n,height:Math.floor(512)}))};return a.jsx(yt,{isDisabled:!t,label:r("parameters.scaledHeight"),min:64,max:1024,step:64,value:n.height,onChange:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:s})},Boe=f.memo(Foe),Hoe=we([tn],e=>{const{boundingBoxScaleMethod:t,scaledBoundingBoxDimensions:n}=e;return{scaledBoundingBoxDimensions:n,isManual:t==="manual"}},ut),Voe=()=>{const e=ne(),{isManual:t,scaledBoundingBoxDimensions:n}=L(Hoe),{t:r}=pe(),o=i=>{e(Wf({...n,width:Math.floor(i)}))},s=()=>{e(Wf({...n,width:Math.floor(512)}))};return a.jsx(yt,{isDisabled:!t,label:r("parameters.scaledWidth"),min:64,max:1024,step:64,value:n.width,onChange:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:s})},Woe=f.memo(Voe),Uoe=()=>{const{t:e}=pe();return a.jsx(So,{label:e("parameters.infillScalingHeader"),children:a.jsxs(G,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(Moe,{}),a.jsx(Aoe,{}),a.jsx(zoe,{}),a.jsx(Woe,{}),a.jsx(Boe,{})]})})},Goe=f.memo(Uoe);function qoe(){const e=ne(),t=L(r=>r.generation.seamBlur),{t:n}=pe();return a.jsx(yt,{label:n("parameters.seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(Wx(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Wx(16))}})}function Koe(){const e=ne(),{t}=pe(),n=L(r=>r.generation.seamSize);return a.jsx(yt,{label:t("parameters.seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(Ux(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(Ux(96))})}function Yoe(){const{t:e}=pe(),t=L(r=>r.generation.seamSteps),n=ne();return a.jsx(yt,{label:e("parameters.seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(Gx(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(Gx(30))}})}function Qoe(){const e=ne(),{t}=pe(),n=L(r=>r.generation.seamStrength);return a.jsx(yt,{label:t("parameters.seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(qx(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(qx(.7))}})}const Xoe=()=>{const{t:e}=pe();return a.jsxs(So,{label:e("parameters.seamCorrectionHeader"),children:[a.jsx(Koe,{}),a.jsx(qoe,{}),a.jsx(Qoe,{}),a.jsx(Yoe,{})]})},Zoe=f.memo(Xoe),Joe=we([tn,er,Xr],(e,t,n)=>{const{boundingBoxDimensions:r}=e,{aspectRatio:o}=n;return{boundingBoxDimensions:r,isStaging:t,aspectRatio:o}},ut),ese=()=>{const e=ne(),{boundingBoxDimensions:t,isStaging:n,aspectRatio:r}=L(Joe),{t:o}=pe(),s=u=>{if(e(Us({...t,height:Math.floor(u)})),r){const d=ms(u*r,64);e(Us({width:d,height:Math.floor(u)}))}},i=()=>{if(e(Us({...t,height:Math.floor(512)})),r){const u=ms(512*r,64);e(Us({width:u,height:Math.floor(512)}))}};return a.jsx(yt,{label:o("parameters.boundingBoxHeight"),min:64,max:1024,step:64,value:t.height,onChange:s,isDisabled:n,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:i})},tse=f.memo(ese),nse=we([tn,er,Xr],(e,t,n)=>{const{boundingBoxDimensions:r}=e,{aspectRatio:o}=n;return{boundingBoxDimensions:r,isStaging:t,aspectRatio:o}},ut),rse=()=>{const e=ne(),{boundingBoxDimensions:t,isStaging:n,aspectRatio:r}=L(nse),{t:o}=pe(),s=u=>{if(e(Us({...t,width:Math.floor(u)})),r){const d=ms(u/r,64);e(Us({width:Math.floor(u),height:d}))}},i=()=>{if(e(Us({...t,width:Math.floor(512)})),r){const u=ms(512/r,64);e(Us({width:Math.floor(512),height:u}))}};return a.jsx(yt,{label:o("parameters.boundingBoxWidth"),min:64,max:1024,step:64,value:t.width,onChange:s,isDisabled:n,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:i})},ose=f.memo(rse);function P4(){const e=ne(),{t}=pe();return a.jsxs(G,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsxs(G,{alignItems:"center",gap:2,children:[a.jsx(tt,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:t("parameters.aspectRatio")}),a.jsx(li,{}),a.jsx(eI,{}),a.jsx(Ae,{tooltip:t("ui.swapSizes"),"aria-label":t("ui.swapSizes"),size:"sm",icon:a.jsx(nk,{}),fontSize:20,onClick:()=>e(Y7())})]}),a.jsx(ose,{}),a.jsx(tse,{})]})}const sse=we(Tt,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},ut),ase=()=>{const{shouldUseSliders:e,activeLabel:t}=L(sse);return a.jsx(So,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(G,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(rc,{}),a.jsx(sc,{}),a.jsx(nc,{}),a.jsx(oc,{}),a.jsx(Be,{pt:2,children:a.jsx(ac,{})}),a.jsx(P4,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(G,{gap:3,children:[a.jsx(rc,{}),a.jsx(sc,{}),a.jsx(nc,{})]}),a.jsx(oc,{}),a.jsx(Be,{pt:2,children:a.jsx(ac,{})}),a.jsx(P4,{})]}),a.jsx(tI,{})]})})},ise=f.memo(ase),lse=()=>a.jsxs(a.Fragment,{children:[a.jsx(py,{}),a.jsx(uy,{}),a.jsx(vy,{}),a.jsx(ise,{}),a.jsx(ly,{}),a.jsx(ay,{}),a.jsx(sy,{}),a.jsx(my,{}),a.jsx(hy,{}),a.jsx(Zoe,{}),a.jsx(Goe,{}),a.jsx(iy,{})]}),AI=f.memo(lse),cse=()=>a.jsxs(G,{sx:{gap:4,w:"full",h:"full"},children:[a.jsx(oy,{children:a.jsx(AI,{})}),a.jsx(Eoe,{})]}),use=f.memo(cse),dse=[{id:"txt2img",translationKey:"common.txt2img",icon:a.jsx(oo,{as:E$,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Gte,{})},{id:"img2img",translationKey:"common.img2img",icon:a.jsx(oo,{as:vc,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(CZ,{})},{id:"unifiedCanvas",translationKey:"common.unifiedCanvas",icon:a.jsx(oo,{as:lB,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(use,{})},{id:"nodes",translationKey:"common.nodes",icon:a.jsx(oo,{as:iB,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Dte,{})},{id:"modelManager",translationKey:"modelManager.modelManager",icon:a.jsx(oo,{as:S$,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(zJ,{})}],fse=we(rl,e=>{const{disabledTabs:t}=e;return dse.filter(n=>!t.includes(n.id))},{memoizeOptions:{resultEqualityCheck:Yt}}),pse=300,r0=20,NI=["modelManager"],hse=()=>{const e=L(Q7),t=L(yr),n=L(fse),{shouldPinGallery:r,shouldPinParametersPanel:o,shouldShowGallery:s}=L(w=>w.ui),{t:i}=pe(),u=ne();Ze("f",()=>{u(X7()),(r||o)&&u(js())},[r,o]);const d=f.useCallback(()=>{t==="unifiedCanvas"&&u(js())},[u,t]),p=f.useCallback(w=>{w.target instanceof HTMLElement&&w.target.blur()},[]),m=f.useMemo(()=>n.map(w=>a.jsx(fr,{hasArrow:!0,label:String(i(w.translationKey)),placement:"end",children:a.jsxs(_h,{onClick:p,children:[a.jsx(q3,{children:String(i(w.translationKey))}),w.icon]})},w.id)),[n,i,p]),h=f.useMemo(()=>n.map(w=>a.jsx(wh,{children:w.content},w.id)),[n]),{ref:v,minSizePct:b}=lY(pse,r0,"app");return a.jsxs(xh,{defaultIndex:e,index:e,onChange:w=>{u(Ii(w))},sx:{flexGrow:1,gap:4},isLazy:!0,children:[a.jsxs(Sh,{sx:{pt:2,gap:4,flexDir:"column"},children:[m,a.jsx(li,{}),a.jsx(WK,{})]}),a.jsxs(ny,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},children:[a.jsx(wu,{id:"main",children:a.jsx(Ch,{style:{height:"100%",width:"100%"},children:h})}),r&&s&&!NI.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(FP,{}),a.jsx(wu,{ref:v,onResize:d,id:"gallery",order:3,defaultSize:b>r0?b:r0,minSize:b,maxSize:50,children:a.jsx(ek,{})})]})]})]})},mse=f.memo(hse),gse=we([yr,Xr],(e,t)=>{const{shouldPinGallery:n,shouldShowGallery:r}=t;return{shouldPinGallery:n,shouldShowGalleryButton:NI.includes(e)?!1:!r}},{memoizeOptions:{resultEqualityCheck:Yt}}),vse=()=>{const{t:e}=pe(),{shouldPinGallery:t,shouldShowGalleryButton:n}=L(gse),r=ne(),o=()=>{r(l0(!0)),t&&r(js())};return n?a.jsx(Ae,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":e("accessibility.showGallery"),onClick:o,sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",p:0,insetInlineEnd:0,px:3,h:48,w:8,borderStartEndRadius:0,borderEndEndRadius:0,shadow:"2xl"},children:a.jsx(cB,{})}):null},yse=f.memo(vse),o0={borderStartStartRadius:0,borderEndStartRadius:0,shadow:"2xl"},bse=we([Xr,yr],(e,t)=>{const{shouldPinParametersPanel:n,shouldUseCanvasBetaLayout:r,shouldShowParametersPanel:o}=e,s=r&&t==="unifiedCanvas",i=!s&&(!n||!o),u=!s&&!o&&["txt2img","img2img","unifiedCanvas"].includes(t);return{shouldPinParametersPanel:n,shouldShowParametersPanelButton:u,shouldShowProcessButtons:i}},{memoizeOptions:{resultEqualityCheck:Yt}}),xse=()=>{const e=ne(),{t}=pe(),{shouldShowProcessButtons:n,shouldShowParametersPanelButton:r,shouldPinParametersPanel:o}=L(bse),s=()=>{e(Dv(!0)),o&&e(js())};return r?a.jsxs(G,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"4.5rem",direction:"column",gap:2,children:[a.jsx(Ae,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":t("accessibility.showOptionsPanel"),onClick:s,sx:o0,children:a.jsx(d1,{})}),n&&a.jsxs(a.Fragment,{children:[a.jsx(gy,{iconButton:!0,sx:o0}),a.jsx(qh,{sx:o0})]})]}):null},Sse=f.memo(xse),wse=we([Xr,yr],(e,t)=>{const{shouldPinParametersPanel:n,shouldShowParametersPanel:r}=e;return{activeTabName:t,shouldPinParametersPanel:n,shouldShowParametersPanel:r}},ut),Cse=()=>{const e=ne(),{shouldPinParametersPanel:t,shouldShowParametersPanel:n,activeTabName:r}=L(wse),o=()=>{e(Dv(!1))},s=f.useMemo(()=>r==="txt2img"?a.jsx(yI,{}):r==="img2img"?a.jsx(nI,{}):r==="unifiedCanvas"?a.jsx(AI,{}):null,[r]);return t?null:a.jsx(U5,{direction:"left",isResizable:!1,isOpen:n,onClose:o,children:a.jsxs(G,{sx:{flexDir:"column",h:"full",w:ry,gap:2,position:"relative",flexShrink:0,overflowY:"auto"},children:[a.jsxs(G,{paddingTop:1.5,paddingBottom:4,justifyContent:"space-between",alignItems:"center",children:[a.jsx(rk,{}),a.jsx(LP,{})]}),a.jsx(G,{sx:{gap:2,flexDirection:"column",h:"full",w:"full"},children:s})]})})},_se=f.memo(Cse),kse=e=>{const{imagesUsage:t}=e;return!t||!X4(t)?null:a.jsxs(a.Fragment,{children:[a.jsx(tt,{children:"An image from this board is currently in use in the following features:"}),a.jsxs(fh,{sx:{paddingInlineStart:6},children:[t.isInitialImage&&a.jsx(Oo,{children:"Image to Image"}),t.isCanvasImage&&a.jsx(Oo,{children:"Unified Canvas"}),t.isControlNetImage&&a.jsx(Oo,{children:"ControlNet"}),t.isNodesImage&&a.jsx(Oo,{children:"Node Editor"})]}),a.jsx(tt,{children:"If you delete images from this board, those features will immediately be reset."})]})},jse=()=>{const{t:e}=pe(),{isOpen:t,onClose:n,board:r,handleDeleteBoardImages:o,handleDeleteBoardOnly:s,imagesUsage:i}=f.useContext(V4),u=f.useRef(null);return a.jsx(zu,{isOpen:t,leastDestructiveRef:u,onClose:n,isCentered:!0,children:a.jsx(Sa,{children:r&&a.jsxs(Lu,{children:[a.jsx(xa,{fontSize:"lg",fontWeight:"bold",children:"Delete Board"}),a.jsx(wa,{children:a.jsxs(G,{direction:"column",gap:3,children:[a.jsx(kse,{imagesUsage:i}),a.jsx(Ia,{}),a.jsx(tt,{children:e("common.areYouSure")}),a.jsxs(tt,{fontWeight:"bold",children:["This board has ",r.image_count," image(s) that will be deleted."]})]})}),a.jsxs(ba,{gap:3,children:[a.jsx(Ut,{ref:u,onClick:n,children:"Cancel"}),a.jsx(Ut,{colorScheme:"warning",onClick:()=>s(r.board_id),children:"Delete Board Only"}),a.jsx(Ut,{colorScheme:"error",onClick:()=>o(r.board_id),children:"Delete Board and Images"})]})]})})})},Pse=f.memo(jse),Ise=()=>{const{data:e,isFetching:t}=kv(),{isOpen:n,onClose:r,handleAddToBoard:o,image:s}=f.useContext(W4),[i,u]=f.useState(),d=f.useRef(null),p=e==null?void 0:e.find(m=>m.board_id===(s==null?void 0:s.board_id));return a.jsx(zu,{isOpen:n,leastDestructiveRef:d,onClose:r,isCentered:!0,children:a.jsx(Sa,{children:a.jsxs(Lu,{children:[a.jsx(xa,{fontSize:"lg",fontWeight:"bold",children:p?"Move Image to Board":"Add Image to Board"}),a.jsx(wa,{children:a.jsx(Be,{children:a.jsxs(G,{direction:"column",gap:3,children:[p&&a.jsxs(tt,{children:["Moving this image from"," ",a.jsx("strong",{children:p.board_name})," to"]}),t?a.jsx(fc,{}):a.jsx(gr,{placeholder:"Select Board",onChange:m=>u(m),value:i,data:(e??[]).map(m=>({label:m.board_name,value:m.board_id}))})]})})}),a.jsxs(ba,{children:[a.jsx(Ut,{onClick:r,children:"Cancel"}),a.jsx(Ut,{isDisabled:!i,colorScheme:"accent",onClick:()=>{i&&o(i)},ml:3,children:p?"Move":"Add"})]})]})})})},Ese=f.memo(Ise),Ose=we(e=>e.hotkeys,e=>{const{shift:t}=e;return{shift:t}},{memoizeOptions:{resultEqualityCheck:Yt}}),Rse=()=>{const e=ne(),{shift:t}=L(Ose);return Ze("*",()=>{F5("shift")?!t&&e(Zo(!0)):t&&e(Zo(!1))},{keyup:!0,keydown:!0},[t]),Ze("o",()=>{e(Z7())}),Ze(["shift+o"],()=>{e(J7())}),Ze("g",()=>{e(eR())}),Ze(["shift+g"],()=>{e(Q4())}),Ze("1",()=>{e(Ii("txt2img"))}),Ze("2",()=>{e(Ii("img2img"))}),Ze("3",()=>{e(Ii("unifiedCanvas"))}),Ze("4",()=>{e(Ii("nodes"))}),null},Mse=f.memo(Rse),Dse={},Tse=({config:e=Dse,headerComponent:t})=>{const n=L(J4),r=tR(),o=ne();return f.useEffect(()=>{wr.changeLanguage(n)},[n]),f.useEffect(()=>{r.info({namespace:"App",data:e},"Received config"),o(nR(e))},[o,e,r]),f.useEffect(()=>{o(rR())},[o]),a.jsxs(a.Fragment,{children:[a.jsxs(Bi,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:[a.jsx(UN,{children:a.jsxs(Bi,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[t||a.jsx(BK,{}),a.jsx(G,{sx:{gap:4,w:"full",h:"full"},children:a.jsx(mse,{})})]})}),a.jsx(GF,{}),a.jsx(_se,{}),a.jsx(Ef,{children:a.jsx(Sse,{})}),a.jsx(Ef,{children:a.jsx(yse,{})})]}),a.jsx(ZF,{}),a.jsx(Ese,{}),a.jsx(Pse,{}),a.jsx(oR,{}),a.jsx(Mse,{})]})},Fse=f.memo(Tse);export{Fse as default};
|