mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
170 lines
960 KiB
JavaScript
170 lines
960 KiB
JavaScript
import{a as Tc,b as qj,S as Xj,c as Qj,d as Yj,e as u1,f as Zj,i as d1,g as ER,h as Jj,j as eI,k as MR,l as Hx,m as OR,n as RR,o as aw,p as tI,t as DR,q as AR,r as TR,s as $R,u as NR,v as d,w as a,x as Vx,y as Zp,z as LR,A as zR,B as FR,C as BR,P as HR,D as Wx,E as VR,F as WR,G as UR,H as GR,I as nI,J as _e,K as Tn,L as KR,M as qR,N as XR,O as Wt,Q as Se,R as et,T as un,U as Fe,V as Cd,W as fr,X as jn,Y as Gn,Z as on,_ as fa,$ as al,a0 as dt,a1 as yo,a2 as oc,a3 as pa,a4 as ma,a5 as yh,a6 as Ux,a7 as wd,a8 as fn,a9 as QR,aa as H,ab as lw,ac as YR,ad as rI,ae as f1,af as Sd,ag as $c,ah as ZR,ai as oI,aj as sI,ak as aI,al as Ho,am as JR,an as ae,ao as he,ap as Bt,aq as W,ar as eD,as as iw,at as tD,au as nD,av as rD,aw as ll,ax as te,ay as oD,az as lt,aA as Qt,aB as Ie,aC as N,aD as ur,aE as er,aF as Ce,aG as Z,aH as lI,aI as sD,aJ as aD,aK as lD,aL as iD,aM as qr,aN as Gx,aO as ha,aP as Nr,aQ as kd,aR as cD,aS as uD,aT as cw,aU as Kx,aV as be,aW as Vo,aX as dD,aY as iI,aZ as cI,a_ as uw,a$ as fD,b0 as pD,b1 as mD,b2 as ga,b3 as qx,b4 as bt,b5 as hD,b6 as gD,b7 as uI,b8 as dI,b9 as Ch,ba as vD,bb as dw,bc as fI,bd as xD,be as bD,bf as yD,bg as CD,bh as wD,bi as SD,bj as kD,bk as pI,bl as _D,bm as jD,bn as ID,bo as PD,bp as ED,bq as va,br as bc,bs as MD,bt as eo,bu as OD,bv as RD,bw as DD,bx as fw,by as AD,bz as TD,bA as Js,bB as mI,bC as hI,bD as wh,bE as Xx,bF as Qx,bG as wo,bH as gI,bI as $D,bJ as Bl,bK as Tu,bL as pw,bM as ND,bN as LD,bO as zD,bP as Qf,bQ as Yf,bR as Su,bS as tv,bT as Bu,bU as Hu,bV as Vu,bW as Wu,bX as mw,bY as Jp,bZ as nv,b_ as em,b$ as hw,c0 as p1,c1 as rv,c2 as m1,c3 as ov,c4 as tm,c5 as gw,c6 as Hl,c7 as vw,c8 as Vl,c9 as xw,ca as nm,cb as _d,cc as vI,cd as FD,ce as bw,cf as Yx,cg as rm,ch as xI,ci as Sr,cj as ku,ck as Mi,cl as Zx,cm as bI,cn as Zf,co as Jx,cp as BD,cq as yI,cr as sv,cs as Sh,ct as HD,cu as CI,cv as h1,cw as g1,cx as wI,cy as VD,cz as v1,cA as WD,cB as x1,cC as UD,cD as b1,cE as GD,cF as KD,cG as eb,cH as tb,cI as nb,cJ as rb,cK as ob,cL as kh,cM as sb,cN as Qs,cO as SI,cP as kI,cQ as ab,cR as _I,cS as qD,cT as _u,cU as aa,cV as jI,cW as II,cX as yw,cY as lb,cZ as PI,c_ as ib,c$ as cb,d0 as EI,d1 as Mn,d2 as XD,d3 as Un,d4 as QD,d5 as Nc,d6 as _h,d7 as ub,d8 as MI,d9 as OI,da as YD,db as ZD,dc as JD,dd as eA,de as tA,df as nA,dg as rA,dh as oA,di as sA,dj as aA,dk as Cw,dl as db,dm as lA,dn as iA,dp as jd,dq as cA,dr as uA,ds as jh,dt as dA,du as fA,dv as pA,dw as mA,dx as pn,dy as hA,dz as gA,dA as vA,dB as xA,dC as bA,dD as yA,dE as Zu,dF as ww,dG as Qo,dH as RI,dI as CA,dJ as fb,dK as wA,dL as Sw,dM as SA,dN as kA,dO as _A,dP as DI,dQ as jA,dR as IA,dS as PA,dT as EA,dU as MA,dV as OA,dW as AI,dX as RA,dY as DA,dZ as kw,d_ as AA,d$ as TA,e0 as $A,e1 as NA,e2 as LA,e3 as zA,e4 as FA,e5 as TI,e6 as BA,e7 as HA,e8 as VA,e9 as _w,ea as Jf,eb as _o,ec as WA,ed as UA,ee as GA,ef as KA,eg as qA,eh as XA,ei as Wo,ej as QA,ek as YA,el as ZA,em as JA,en as eT,eo as tT,ep as nT,eq as rT,er as oT,es as sT,et as aT,eu as lT,ev as iT,ew as cT,ex as uT,ey as dT,ez as fT,eA as pT,eB as mT,eC as hT,eD as gT,eE as vT,eF as xT,eG as bT,eH as yT,eI as jw,eJ as Iw,eK as $I,eL as CT,eM as zo,eN as Ju,eO as Wn,eP as wT,eQ as ST,eR as NI,eS as LI,eT as kT,eU as Pw,eV as _T,eW as Ew,eX as Mw,eY as Ow,eZ as jT,e_ as IT,e$ as Rw,f0 as Dw,f1 as PT,f2 as ET,f3 as om,f4 as MT,f5 as Aw,f6 as Tw,f7 as OT,f8 as $w,f9 as RT,fa as sm,fb as am,fc as DT,fd as AT,fe as zI,ff as TT,fg as $T,fh as FI,fi as NT,fj as LT,fk as Nw,fl as zT,fm as Lw,fn as FT,fo as BT,fp as BI,fq as HI,fr as Id,fs as VI,ft as Ol,fu as WI,fv as zw,fw as HT,fx as VT,fy as UI,fz as WT,fA as UT,fB as GT,fC as KT,fD as qT,fE as pb,fF as y1,fG as Fw,fH as ti,fI as XT,fJ as QT,fK as GI,fL as mb,fM as KI,fN as hb,fO as qI,fP as YT,fQ as Zs,fR as ZT,fS as XI,fT as JT,fU as gb,fV as QI,fW as e9,fX as t9,fY as n9,fZ as r9,f_ as o9,f$ as s9,g0 as a9,g1 as lm,g2 as $u,g3 as Yi,g4 as l9,g5 as i9,g6 as c9,g7 as u9,g8 as d9,g9 as f9,ga as p9,gb as m9,gc as Bw,gd as h9,ge as g9,gf as v9,gg as x9,gh as b9,gi as y9,gj as Hw,gk as C9,gl as w9,gm as S9,gn as k9,go as _9,gp as j9,gq as I9,gr as Vw,gs as P9,gt as E9,gu as M9,gv as O9,gw as R9,gx as D9,gy as A9,gz as T9,gA as $9,gB as N9,gC as L9,gD as z9,gE as F9,gF as B9,gG as Pd,gH as H9,gI as V9,gJ as W9,gK as U9,gL as G9,gM as K9,gN as q9,gO as X9,gP as Ww,gQ as Lp,gR as Q9,gS as im,gT as YI,gU as cm,gV as Y9,gW as Z9,gX as sc,gY as ZI,gZ as JI,g_ as vb,g$ as J9,h0 as e$,h1 as t$,h2 as C1,h3 as e5,h4 as n$,h5 as r$,h6 as t5,h7 as o$,h8 as s$,h9 as a$,ha as l$,hb as i$,hc as Uw,hd as Oi,he as c$,hf as u$,hg as d$,hh as f$,hi as p$,hj as m$,hk as Gw,hl as h$,hm as g$,hn as v$,ho as x$,hp as b$,hq as y$,hr as C$,hs as w$,ht as av,hu as lv,hv as iv,hw as ep,hx as Kw,hy as w1,hz as qw,hA as S$,hB as k$,hC as _$,hD as j$,hE as n5,hF as I$,hG as P$,hH as E$,hI as M$,hJ as O$,hK as R$,hL as D$,hM as A$,hN as T$,hO as $$,hP as N$,hQ as tp,hR as cv,hS as L$,hT as z$,hU as F$,hV as B$,hW as H$,hX as V$,hY as W$,hZ as U$,h_ as G$,h$ as K$,i0 as Xw,i1 as Qw,i2 as q$,i3 as X$,i4 as Q$,i5 as Y$}from"./index-2d026cf2.js";import{u as r5,a as xa,b as Z$,r as Re,f as J$,g as Yw,c as mt,d as Rn}from"./MantineProvider-5a15f390.js";var eN=200;function tN(e,t,n,r){var o=-1,s=Qj,l=!0,i=e.length,c=[],p=t.length;if(!i)return c;n&&(t=Tc(t,qj(n))),r?(s=Yj,l=!1):t.length>=eN&&(s=u1,l=!1,t=new Xj(t));e:for(;++o<i;){var m=e[o],h=n==null?m:n(m);if(m=r||m!==0?m:0,l&&h===h){for(var g=p;g--;)if(t[g]===h)continue e;c.push(m)}else s(t,h,r)||c.push(m)}return c}var nN=Zj(function(e,t){return d1(e)?tN(e,ER(t,1,d1,!0)):[]});const rN=nN;function oN(e,t){var n=[];return Jj(e,function(r,o,s){t(r,o,s)&&n.push(r)}),n}function sN(e,t){var n=eI(e)?MR:oN;return n(e,Hx(t))}function aN(e,t){var n=-1,r=OR(e)?Array(e.length):[];return Jj(e,function(o,s,l){r[++n]=t(o,s,l)}),r}function kr(e,t){var n=eI(e)?Tc:aN;return n(e,Hx(t))}function lN(e,t){return Tc(t,function(n){return e[n]})}function iN(e){return e==null?[]:lN(e,RR(e))}var cN=Math.min;function uN(e,t,n){for(var r=n?Yj:Qj,o=e[0].length,s=e.length,l=s,i=Array(s),c=1/0,p=[];l--;){var m=e[l];l&&t&&(m=Tc(m,qj(t))),c=cN(m.length,c),i[l]=!n&&(t||o>=120&&m.length>=120)?new Xj(l&&m):void 0}m=e[0];var h=-1,g=i[0];e:for(;++h<o&&p.length<c;){var x=m[h],y=t?t(x):x;if(x=n||x!==0?x:0,!(g?u1(g,y):r(p,y,n))){for(l=s;--l;){var b=i[l];if(!(b?u1(b,y):r(e[l],y,n)))continue e}g&&g.push(y),p.push(x)}}return p}function dN(e){return d1(e)?e:[]}var fN=Zj(function(e){var t=Tc(e,dN);return t.length&&t[0]===e[0]?uN(t):[]});const pN=fN;function xb(e){return e==null}function mN(e,t,n,r){if(!aw(e))return e;t=tI(t,e);for(var o=-1,s=t.length,l=s-1,i=e;i!=null&&++o<s;){var c=DR(t[o]),p=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(o!=l){var m=i[c];p=r?r(m,c,i):void 0,p===void 0&&(p=aw(m)?m:AR(t[o+1])?[]:{})}TR(i,c,p),i=i[c]}return e}function hN(e,t,n){for(var r=-1,o=t.length,s={};++r<o;){var l=t[r],i=$R(e,l);n(i,l)&&mN(s,tI(l,e),i)}return s}function Zw(e,t){if(e==null)return{};var n=Tc(NR(e),function(r){return[r]});return t=Hx(t),hN(e,n,function(r,o){return t(r,o[0])})}function gN(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}function vN(e,t,n){let r=new Set([...t,void 0]);return e.listen((o,s)=>{r.has(s)&&n(o,s)})}const o5=({id:e,x:t,y:n,width:r,height:o,style:s,color:l,strokeColor:i,strokeWidth:c,className:p,borderRadius:m,shapeRendering:h,onClick:g,selected:x})=>{const{background:y,backgroundColor:b}=s||{},C=l||y||b;return a.jsx("rect",{className:Vx(["react-flow__minimap-node",{selected:x},p]),x:t,y:n,rx:m,ry:m,width:r,height:o,fill:C,stroke:i,strokeWidth:c,shapeRendering:h,onClick:g?S=>g(S,e):void 0})};o5.displayName="MiniMapNode";var xN=d.memo(o5);const bN=e=>e.nodeOrigin,yN=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),uv=e=>e instanceof Function?e:()=>e;function CN({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=xN,onClick:l}){const i=Zp(yN,Wx),c=Zp(bN),p=uv(t),m=uv(e),h=uv(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:i.map(x=>{const{x:y,y:b}=LR(x,c).positionAbsolute;return a.jsx(s,{x:y,y:b,width:x.width,height:x.height,style:x.style,selected:x.selected,className:h(x),color:p(x),borderRadius:r,strokeColor:m(x),strokeWidth:o,shapeRendering:g,onClick:l,id:x.id},x.id)})})}var wN=d.memo(CN);const SN=200,kN=150,_N=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?UR(GR(t,e.nodeOrigin),n):n,rfId:e.rfId}},jN="react-flow__minimap-desc";function s5({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:l=2,nodeComponent:i,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:p="none",maskStrokeWidth:m=1,position:h="bottom-right",onClick:g,onNodeClick:x,pannable:y=!1,zoomable:b=!1,ariaLabel:C="React Flow mini map",inversePan:S=!1,zoomStep:_=10,offsetScale:j=5}){const E=zR(),I=d.useRef(null),{boundingRect:M,viewBB:R,rfId:D}=Zp(_N,Wx),A=(e==null?void 0:e.width)??SN,O=(e==null?void 0:e.height)??kN,$=M.width/A,X=M.height/O,z=Math.max($,X),V=z*A,Q=z*O,G=j*z,F=M.x-(V-M.width)/2-G,U=M.y-(Q-M.height)/2-G,T=V+G*2,B=Q+G*2,Y=`${jN}-${D}`,re=d.useRef(0);re.current=z,d.useEffect(()=>{if(I.current){const q=FR(I.current),K=J=>{const{transform:ie,d3Selection:de,d3Zoom:xe}=E.getState();if(J.sourceEvent.type!=="wheel"||!de||!xe)return;const we=-J.sourceEvent.deltaY*(J.sourceEvent.deltaMode===1?.05:J.sourceEvent.deltaMode?1:.002)*_,ve=ie[2]*Math.pow(2,we);xe.scaleTo(de,ve)},ee=J=>{const{transform:ie,d3Selection:de,d3Zoom:xe,translateExtent:we,width:ve,height:fe}=E.getState();if(J.sourceEvent.type!=="mousemove"||!de||!xe)return;const Oe=re.current*Math.max(1,ie[2])*(S?-1:1),je={x:ie[0]-J.sourceEvent.movementX*Oe,y:ie[1]-J.sourceEvent.movementY*Oe},$e=[[0,0],[ve,fe]],st=VR.translate(je.x,je.y).scale(ie[2]),Ve=xe.constrain()(st,$e,we);xe.transform(de,Ve)},ce=BR().on("zoom",y?ee:null).on("zoom.wheel",b?K:null);return q.call(ce),()=>{q.on("zoom",null)}}},[y,b,S,_]);const le=g?q=>{const K=WR(q);g(q,{x:K[0],y:K[1]})}:void 0,oe=x?(q,K)=>{const ee=E.getState().nodeInternals.get(K);x(q,ee)}:void 0;return a.jsx(HR,{position:h,style:e,className:Vx(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:A,height:O,viewBox:`${F} ${U} ${T} ${B}`,role:"img","aria-labelledby":Y,ref:I,onClick:le,children:[C&&a.jsx("title",{id:Y,children:C}),a.jsx(wN,{onClick:oe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:i}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-G},${U-G}h${T+G*2}v${B+G*2}h${-T-G*2}z
|
||
M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fill:c,fillRule:"evenodd",stroke:p,strokeWidth:m,pointerEvents:"none"})]})})}s5.displayName="MiniMap";var IN=d.memo(s5),Uo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Uo||(Uo={}));function PN({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 EN({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const MN={[Uo.Dots]:"#91919a",[Uo.Lines]:"#eee",[Uo.Cross]:"#e2e2e2"},ON={[Uo.Dots]:1,[Uo.Lines]:1,[Uo.Cross]:6},RN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function a5({id:e,variant:t=Uo.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:l,style:i,className:c}){const p=d.useRef(null),{transform:m,patternId:h}=Zp(RN,Wx),g=l||MN[t],x=r||ON[t],y=t===Uo.Dots,b=t===Uo.Cross,C=Array.isArray(n)?n:[n,n],S=[C[0]*m[2]||1,C[1]*m[2]||1],_=x*m[2],j=b?[_,_]:S,E=y?[_/s,_/s]:[j[0]/s,j[1]/s];return a.jsxs("svg",{className:Vx(["react-flow__background",c]),style:{...i,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]%S[0],y:m[1]%S[1],width:S[0],height:S[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:y?a.jsx(EN,{color:g,radius:_/s}):a.jsx(PN,{dimensions:j,color:g,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${h+e})`})]})}a5.displayName="Background";var DN=d.memo(a5);const Jw=(e,t,n)=>{AN(n);const r=nI(e,t);return l5[n].includes(r)},l5={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},eS=Object.keys(l5),AN=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(eS.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${eS.join("|")}`)};function TN(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var $N=TN();const i5=1/60*1e3,NN=typeof performance<"u"?()=>performance.now():()=>Date.now(),c5=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(NN()),i5);function LN(e){let t=[],n=[],r=0,o=!1,s=!1;const l=new WeakSet,i={schedule:(c,p=!1,m=!1)=>{const h=m&&o,g=h?t:n;return p&&l.add(c),g.indexOf(c)===-1&&(g.push(c),h&&o&&(r=t.length)),c},cancel:c=>{const p=n.indexOf(c);p!==-1&&n.splice(p,1),l.delete(c)},process:c=>{if(o){s=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let p=0;p<r;p++){const m=t[p];m(c),l.has(m)&&(i.schedule(m),e())}o=!1,s&&(s=!1,i.process(c))}};return i}const zN=40;let S1=!0,ed=!1,k1=!1;const ac={delta:0,timestamp:0},Ed=["read","update","preRender","render","postRender"],Ih=Ed.reduce((e,t)=>(e[t]=LN(()=>ed=!0),e),{}),FN=Ed.reduce((e,t)=>{const n=Ih[t];return e[t]=(r,o=!1,s=!1)=>(ed||VN(),n.schedule(r,o,s)),e},{}),BN=Ed.reduce((e,t)=>(e[t]=Ih[t].cancel,e),{});Ed.reduce((e,t)=>(e[t]=()=>Ih[t].process(ac),e),{});const HN=e=>Ih[e].process(ac),u5=e=>{ed=!1,ac.delta=S1?i5:Math.max(Math.min(e-ac.timestamp,zN),1),ac.timestamp=e,k1=!0,Ed.forEach(HN),k1=!1,ed&&(S1=!1,c5(u5))},VN=()=>{ed=!0,S1=!0,k1||c5(u5)},tS=()=>ac;function Ph(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=d.Children.toArray(e.path),l=_e((i,c)=>a.jsx(Tn,{ref:c,viewBox:t,...o,...i,children:s.length?s:a.jsx("path",{fill:"currentColor",d:n})}));return l.displayName=r,l}function d5(e){const{theme:t}=KR(),n=qR();return d.useMemo(()=>XR(t.direction,{...n,...e}),[e,t.direction,n])}var WN=Object.defineProperty,UN=(e,t,n)=>t in e?WN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kn=(e,t,n)=>(UN(e,typeof t!="symbol"?t+"":t,n),n);function nS(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 GN=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function rS(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function oS(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var _1=typeof window<"u"?d.useLayoutEffect:d.useEffect,um=e=>e,KN=class{constructor(){kn(this,"descendants",new Map),kn(this,"register",e=>{if(e!=null)return GN(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),kn(this,"unregister",e=>{this.descendants.delete(e);const t=nS(Array.from(this.descendants.keys()));this.assignIndex(t)}),kn(this,"destroy",()=>{this.descendants.clear()}),kn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),kn(this,"count",()=>this.descendants.size),kn(this,"enabledCount",()=>this.enabledValues().length),kn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),kn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),kn(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),kn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),kn(this,"first",()=>this.item(0)),kn(this,"firstEnabled",()=>this.enabledItem(0)),kn(this,"last",()=>this.item(this.descendants.size-1)),kn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),kn(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),kn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),kn(this,"next",(e,t=!0)=>{const n=rS(e,this.count(),t);return this.item(n)}),kn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=rS(r,this.enabledCount(),t);return this.enabledItem(o)}),kn(this,"prev",(e,t=!0)=>{const n=oS(e,this.count()-1,t);return this.item(n)}),kn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=oS(r,this.enabledCount()-1,t);return this.enabledItem(o)}),kn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=nS(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 qN(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Pt(...e){return t=>{e.forEach(n=>{qN(n,t)})}}function XN(...e){return d.useMemo(()=>Pt(...e),e)}function QN(){const e=d.useRef(new KN);return _1(()=>()=>e.current.destroy()),e.current}var[YN,f5]=Wt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function ZN(e){const t=f5(),[n,r]=d.useState(-1),o=d.useRef(null);_1(()=>()=>{o.current&&t.unregister(o.current)},[]),_1(()=>{if(!o.current)return;const l=Number(o.current.dataset.index);n!=l&&!Number.isNaN(l)&&r(l)});const s=um(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:Pt(s,o)}}function bb(){return[um(YN),()=>um(f5()),()=>QN(),o=>ZN(o)]}var[JN,Eh]=Wt({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[eL,yb]=Wt({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[tL,Y1e,nL,rL]=bb(),Hi=_e(function(t,n){const{getButtonProps:r}=yb(),o=r(t,n),l={display:"flex",alignItems:"center",width:"100%",outline:0,...Eh().button};return a.jsx(Se.button,{...o,className:et("chakra-accordion__button",t.className),__css:l})});Hi.displayName="AccordionButton";function Md(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(g,x)=>g!==x}=e,s=un(r),l=un(o),[i,c]=d.useState(n),p=t!==void 0,m=p?t:i,h=un(g=>{const y=typeof g=="function"?g(m):g;l(m,y)&&(p||c(y),s(y))},[p,s,m,l]);return[m,h]}function oL(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...l}=e;lL(e),iL(e);const i=nL(),[c,p]=d.useState(-1);d.useEffect(()=>()=>{p(-1)},[]);const[m,h]=Md({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:m,setIndex:h,htmlProps:l,getAccordionItemProps:x=>{let y=!1;return x!==null&&(y=Array.isArray(m)?m.includes(x):m===x),{isOpen:y,onChange:C=>{if(x!==null)if(o&&Array.isArray(m)){const S=C?m.concat(x):m.filter(_=>_!==x);h(S)}else C?h(x):s&&h(-1)}}},focusedIndex:c,setFocusedIndex:p,descendants:i}}var[sL,Cb]=Wt({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function aL(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:l}=Cb(),i=d.useRef(null),c=d.useId(),p=r??c,m=`accordion-button-${p}`,h=`accordion-panel-${p}`;cL(e);const{register:g,index:x,descendants:y}=rL({disabled:t&&!n}),{isOpen:b,onChange:C}=s(x===-1?null:x);uL({isOpen:b,isDisabled:t});const S=()=>{C==null||C(!0)},_=()=>{C==null||C(!1)},j=d.useCallback(()=>{C==null||C(!b),l(x)},[x,l,b,C]),E=d.useCallback(D=>{const O={ArrowDown:()=>{const $=y.nextEnabled(x);$==null||$.node.focus()},ArrowUp:()=>{const $=y.prevEnabled(x);$==null||$.node.focus()},Home:()=>{const $=y.firstEnabled();$==null||$.node.focus()},End:()=>{const $=y.lastEnabled();$==null||$.node.focus()}}[D.key];O&&(D.preventDefault(),O(D))},[y,x]),I=d.useCallback(()=>{l(x)},[l,x]),M=d.useCallback(function(A={},O=null){return{...A,type:"button",ref:Pt(g,i,O),id:m,disabled:!!t,"aria-expanded":!!b,"aria-controls":h,onClick:Fe(A.onClick,j),onFocus:Fe(A.onFocus,I),onKeyDown:Fe(A.onKeyDown,E)}},[m,t,b,j,I,E,h,g]),R=d.useCallback(function(A={},O=null){return{...A,ref:O,role:"region",id:h,"aria-labelledby":m,hidden:!b}},[m,b,h]);return{isOpen:b,isDisabled:t,isFocusable:n,onOpen:S,onClose:_,getButtonProps:M,getPanelProps:R,htmlProps:o}}function lL(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;Cd({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function iL(e){Cd({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 cL(e){Cd({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 uL(e){Cd({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Vi(e){const{isOpen:t,isDisabled:n}=yb(),{reduceMotion:r}=Cb(),o=et("chakra-accordion__icon",e.className),s=Eh(),l={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return a.jsx(Tn,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:l,...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Vi.displayName="AccordionIcon";var Wi=_e(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...l}=aL(t),c={...Eh().container,overflowAnchor:"none"},p=d.useMemo(()=>l,[l]);return a.jsx(eL,{value:p,children:a.jsx(Se.div,{ref:n,...s,className:et("chakra-accordion__item",o),__css:c,children:typeof r=="function"?r({isExpanded:!!l.isOpen,isDisabled:!!l.isDisabled}):r})})});Wi.displayName="AccordionItem";var Zi={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Al={enter:{duration:.2,ease:Zi.easeOut},exit:{duration:.1,ease:Zi.easeIn}},ea={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})},dL=e=>e!=null&&parseInt(e.toString(),10)>0,sS={exit:{height:{duration:.2,ease:Zi.ease},opacity:{duration:.3,ease:Zi.ease}},enter:{height:{duration:.3,ease:Zi.ease},opacity:{duration:.4,ease:Zi.ease}}},fL={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:dL(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:ea.exit(sS.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:ea.enter(sS.enter,o)}}},Od=d.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:l="auto",style:i,className:c,transition:p,transitionEnd:m,...h}=e,[g,x]=d.useState(!1);d.useEffect(()=>{const _=setTimeout(()=>{x(!0)});return()=>clearTimeout(_)},[]),Cd({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const y=parseFloat(s.toString())>0,b={startingHeight:s,endingHeight:l,animateOpacity:o,transition:g?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:y?"block":"none"}}},C=r?n:!0,S=n||r?"enter":"exit";return a.jsx(fr,{initial:!1,custom:b,children:C&&a.jsx(jn.div,{ref:t,...h,className:et("chakra-collapse",c),style:{overflow:"hidden",display:"block",...i},custom:b,variants:fL,initial:r?"exit":!1,animate:S,exit:"exit"})})});Od.displayName="Collapse";var pL={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:ea.enter(Al.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:ea.exit(Al.exit,n),transitionEnd:t==null?void 0:t.exit}}},p5={initial:"exit",animate:"enter",exit:"exit",variants:pL},mL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:l,transitionEnd:i,delay:c,...p}=t,m=o||r?"enter":"exit",h=r?o&&r:!0,g={transition:l,transitionEnd:i,delay:c};return a.jsx(fr,{custom:g,children:h&&a.jsx(jn.div,{ref:n,className:et("chakra-fade",s),custom:g,...p5,animate:m,...p})})});mL.displayName="Fade";var hL={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:ea.exit(Al.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:ea.enter(Al.enter,n),transitionEnd:e==null?void 0:e.enter}}},m5={initial:"exit",animate:"enter",exit:"exit",variants:hL},gL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:l=.95,className:i,transition:c,transitionEnd:p,delay:m,...h}=t,g=r?o&&r:!0,x=o||r?"enter":"exit",y={initialScale:l,reverse:s,transition:c,transitionEnd:p,delay:m};return a.jsx(fr,{custom:y,children:g&&a.jsx(jn.div,{ref:n,className:et("chakra-offset-slide",i),...m5,animate:x,custom:y,...h})})});gL.displayName="ScaleFade";var vL={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:ea.exit(Al.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:ea.enter(Al.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var l;const i={x:t,y:e};return{opacity:0,transition:(l=n==null?void 0:n.exit)!=null?l:ea.exit(Al.exit,s),...o?{...i,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...i,...r==null?void 0:r.exit}}}}},j1={initial:"initial",animate:"enter",exit:"exit",variants:vL},xL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:l,offsetX:i=0,offsetY:c=8,transition:p,transitionEnd:m,delay:h,...g}=t,x=r?o&&r:!0,y=o||r?"enter":"exit",b={offsetX:i,offsetY:c,reverse:s,transition:p,transitionEnd:m,delay:h};return a.jsx(fr,{custom:b,children:x&&a.jsx(jn.div,{ref:n,className:et("chakra-offset-slide",l),custom:b,...j1,animate:y,...g})})});xL.displayName="SlideFade";var Ui=_e(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:l}=Cb(),{getPanelProps:i,isOpen:c}=yb(),p=i(s,n),m=et("chakra-accordion__panel",r),h=Eh();l||delete p.hidden;const g=a.jsx(Se.div,{...p,__css:h.panel,className:m});return l?g:a.jsx(Od,{in:c,...o,children:g})});Ui.displayName="AccordionPanel";var h5=_e(function({children:t,reduceMotion:n,...r},o){const s=Gn("Accordion",r),l=on(r),{htmlProps:i,descendants:c,...p}=oL(l),m=d.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return a.jsx(tL,{value:c,children:a.jsx(sL,{value:m,children:a.jsx(JN,{value:s,children:a.jsx(Se.div,{ref:o,...i,className:et("chakra-accordion",r.className),__css:s.root,children:t})})})})});h5.displayName="Accordion";function Mh(e){return d.Children.toArray(e).filter(t=>d.isValidElement(t))}var[bL,yL]=Wt({strict:!1,name:"ButtonGroupContext"}),CL={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}}},wL={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Ht=_e(function(t,n){const{size:r,colorScheme:o,variant:s,className:l,spacing:i="0.5rem",isAttached:c,isDisabled:p,orientation:m="horizontal",...h}=t,g=et("chakra-button__group",l),x=d.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let y={display:"inline-flex",...c?CL[m]:wL[m](i)};const b=m==="vertical";return a.jsx(bL,{value:x,children:a.jsx(Se.div,{ref:n,role:"group",__css:y,className:g,"data-attached":c?"":void 0,"data-orientation":m,flexDir:b?"column":void 0,...h})})});Ht.displayName="ButtonGroup";function SL(e){const[t,n]=d.useState(!e);return{ref:d.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function I1(e){const{children:t,className:n,...r}=e,o=d.isValidElement(t)?d.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=et("chakra-button__icon",n);return a.jsx(Se.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}I1.displayName="ButtonIcon";function P1(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=a.jsx(fa,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:l,...i}=e,c=et("chakra-button__spinner",s),p=n==="start"?"marginEnd":"marginStart",m=d.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[p]:t?r:0,fontSize:"1em",lineHeight:"normal",...l}),[l,t,p,r]);return a.jsx(Se.div,{className:c,...i,__css:m,children:o})}P1.displayName="ButtonSpinner";var Ja=_e((e,t)=>{const n=yL(),r=al("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:l,children:i,leftIcon:c,rightIcon:p,loadingText:m,iconSpacing:h="0.5rem",type:g,spinner:x,spinnerPlacement:y="start",className:b,as:C,...S}=on(e),_=d.useMemo(()=>{const M={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:M}}},[r,n]),{ref:j,type:E}=SL(C),I={rightIcon:p,leftIcon:c,iconSpacing:h,children:i};return a.jsxs(Se.button,{ref:XN(t,j),as:C,type:g??E,"data-active":dt(l),"data-loading":dt(s),__css:_,className:et("chakra-button",b),...S,disabled:o||s,children:[s&&y==="start"&&a.jsx(P1,{className:"chakra-button__spinner--start",label:m,placement:"start",spacing:h,children:x}),s?m||a.jsx(Se.span,{opacity:0,children:a.jsx(aS,{...I})}):a.jsx(aS,{...I}),s&&y==="end"&&a.jsx(P1,{className:"chakra-button__spinner--end",label:m,placement:"end",spacing:h,children:x})]})});Ja.displayName="Button";function aS(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return a.jsxs(a.Fragment,{children:[t&&a.jsx(I1,{marginEnd:o,children:t}),r,n&&a.jsx(I1,{marginStart:o,children:n})]})}var Cs=_e((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...l}=e,i=n||r,c=d.isValidElement(i)?d.cloneElement(i,{"aria-hidden":!0,focusable:!1}):null;return a.jsx(Ja,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...l,children:c})});Cs.displayName="IconButton";var[Z1e,kL]=Wt({name:"CheckboxGroupContext",strict:!1});function _L(e){const[t,n]=d.useState(e),[r,o]=d.useState(!1);return e!==t&&(o(!0),n(e)),r}function jL(e){return a.jsx(Se.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 IL(e){return a.jsx(Se.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 PL(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?IL:jL;return n||t?a.jsx(Se.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(o,{...r})}):null}var[EL,g5]=Wt({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[ML,Rd]=Wt({strict:!1,name:"FormControlContext"});function OL(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...l}=e,i=d.useId(),c=t||`field-${i}`,p=`${c}-label`,m=`${c}-feedback`,h=`${c}-helptext`,[g,x]=d.useState(!1),[y,b]=d.useState(!1),[C,S]=d.useState(!1),_=d.useCallback((R={},D=null)=>({id:h,...R,ref:Pt(D,A=>{A&&b(!0)})}),[h]),j=d.useCallback((R={},D=null)=>({...R,ref:D,"data-focus":dt(C),"data-disabled":dt(o),"data-invalid":dt(r),"data-readonly":dt(s),id:R.id!==void 0?R.id:p,htmlFor:R.htmlFor!==void 0?R.htmlFor:c}),[c,o,C,r,s,p]),E=d.useCallback((R={},D=null)=>({id:m,...R,ref:Pt(D,A=>{A&&x(!0)}),"aria-live":"polite"}),[m]),I=d.useCallback((R={},D=null)=>({...R,...l,ref:D,role:"group"}),[l]),M=d.useCallback((R={},D=null)=>({...R,ref:D,role:"presentation","aria-hidden":!0,children:R.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!C,onFocus:()=>S(!0),onBlur:()=>S(!1),hasFeedbackText:g,setHasFeedbackText:x,hasHelpText:y,setHasHelpText:b,id:c,labelId:p,feedbackId:m,helpTextId:h,htmlProps:l,getHelpTextProps:_,getErrorMessageProps:E,getRootProps:I,getLabelProps:j,getRequiredIndicatorProps:M}}var Zt=_e(function(t,n){const r=Gn("Form",t),o=on(t),{getRootProps:s,htmlProps:l,...i}=OL(o),c=et("chakra-form-control",t.className);return a.jsx(ML,{value:i,children:a.jsx(EL,{value:r,children:a.jsx(Se.div,{...s({},n),className:c,__css:r.container})})})});Zt.displayName="FormControl";var v5=_e(function(t,n){const r=Rd(),o=g5(),s=et("chakra-form__helper-text",t.className);return a.jsx(Se.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});v5.displayName="FormHelperText";var In=_e(function(t,n){var r;const o=al("FormLabel",t),s=on(t),{className:l,children:i,requiredIndicator:c=a.jsx(x5,{}),optionalIndicator:p=null,...m}=s,h=Rd(),g=(r=h==null?void 0:h.getLabelProps(m,n))!=null?r:{ref:n,...m};return a.jsxs(Se.label,{...g,className:et("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[i,h!=null&&h.isRequired?c:p]})});In.displayName="FormLabel";var x5=_e(function(t,n){const r=Rd(),o=g5();if(!(r!=null&&r.isRequired))return null;const s=et("chakra-form__required-indicator",t.className);return a.jsx(Se.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});x5.displayName="RequiredIndicator";function wb(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=Sb(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":yo(n),"aria-required":yo(o),"aria-readonly":yo(r)}}function Sb(e){var t,n,r;const o=Rd(),{id:s,disabled:l,readOnly:i,required:c,isRequired:p,isInvalid:m,isReadOnly:h,isDisabled:g,onFocus:x,onBlur:y,...b}=e,C=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&C.push(o.feedbackId),o!=null&&o.hasHelpText&&C.push(o.helpTextId),{...b,"aria-describedby":C.join(" ")||void 0,id:s??(o==null?void 0:o.id),isDisabled:(t=l??g)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=i??h)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=c??p)!=null?r:o==null?void 0:o.isRequired,isInvalid:m??(o==null?void 0:o.isInvalid),onFocus:Fe(o==null?void 0:o.onFocus,x),onBlur:Fe(o==null?void 0:o.onBlur,y)}}var kb={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},b5=Se("span",{baseStyle:kb});b5.displayName="VisuallyHidden";var RL=Se("input",{baseStyle:kb});RL.displayName="VisuallyHiddenInput";const DL=()=>typeof document<"u";let lS=!1,Dd=null,Wl=!1,E1=!1;const M1=new Set;function _b(e,t){M1.forEach(n=>n(e,t))}const AL=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function TL(e){return!(e.metaKey||!AL&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function iS(e){Wl=!0,TL(e)&&(Dd="keyboard",_b("keyboard",e))}function Ri(e){if(Dd="pointer",e.type==="mousedown"||e.type==="pointerdown"){Wl=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;_b("pointer",e)}}function $L(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function NL(e){$L(e)&&(Wl=!0,Dd="virtual")}function LL(e){e.target===window||e.target===document||(!Wl&&!E1&&(Dd="virtual",_b("virtual",e)),Wl=!1,E1=!1)}function zL(){Wl=!1,E1=!0}function cS(){return Dd!=="pointer"}function FL(){if(!DL()||lS)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Wl=!0,e.apply(this,n)},document.addEventListener("keydown",iS,!0),document.addEventListener("keyup",iS,!0),document.addEventListener("click",NL,!0),window.addEventListener("focus",LL,!0),window.addEventListener("blur",zL,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Ri,!0),document.addEventListener("pointermove",Ri,!0),document.addEventListener("pointerup",Ri,!0)):(document.addEventListener("mousedown",Ri,!0),document.addEventListener("mousemove",Ri,!0),document.addEventListener("mouseup",Ri,!0)),lS=!0}function y5(e){FL(),e(cS());const t=()=>e(cS());return M1.add(t),()=>{M1.delete(t)}}function BL(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function C5(e={}){const t=Sb(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:l,onBlur:i,onFocus:c,"aria-describedby":p}=t,{defaultChecked:m,isChecked:h,isFocusable:g,onChange:x,isIndeterminate:y,name:b,value:C,tabIndex:S=void 0,"aria-label":_,"aria-labelledby":j,"aria-invalid":E,...I}=e,M=BL(I,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),R=un(x),D=un(i),A=un(c),[O,$]=d.useState(!1),[X,z]=d.useState(!1),[V,Q]=d.useState(!1),[G,F]=d.useState(!1);d.useEffect(()=>y5($),[]);const U=d.useRef(null),[T,B]=d.useState(!0),[Y,re]=d.useState(!!m),le=h!==void 0,oe=le?h:Y,q=d.useCallback(fe=>{if(r||n){fe.preventDefault();return}le||re(oe?fe.target.checked:y?!0:fe.target.checked),R==null||R(fe)},[r,n,oe,le,y,R]);oc(()=>{U.current&&(U.current.indeterminate=!!y)},[y]),pa(()=>{n&&z(!1)},[n,z]),oc(()=>{const fe=U.current;if(!(fe!=null&&fe.form))return;const Oe=()=>{re(!!m)};return fe.form.addEventListener("reset",Oe),()=>{var je;return(je=fe.form)==null?void 0:je.removeEventListener("reset",Oe)}},[]);const K=n&&!g,ee=d.useCallback(fe=>{fe.key===" "&&F(!0)},[F]),ce=d.useCallback(fe=>{fe.key===" "&&F(!1)},[F]);oc(()=>{if(!U.current)return;U.current.checked!==oe&&re(U.current.checked)},[U.current]);const J=d.useCallback((fe={},Oe=null)=>{const je=$e=>{X&&$e.preventDefault(),F(!0)};return{...fe,ref:Oe,"data-active":dt(G),"data-hover":dt(V),"data-checked":dt(oe),"data-focus":dt(X),"data-focus-visible":dt(X&&O),"data-indeterminate":dt(y),"data-disabled":dt(n),"data-invalid":dt(s),"data-readonly":dt(r),"aria-hidden":!0,onMouseDown:Fe(fe.onMouseDown,je),onMouseUp:Fe(fe.onMouseUp,()=>F(!1)),onMouseEnter:Fe(fe.onMouseEnter,()=>Q(!0)),onMouseLeave:Fe(fe.onMouseLeave,()=>Q(!1))}},[G,oe,n,X,O,V,y,s,r]),ie=d.useCallback((fe={},Oe=null)=>({...fe,ref:Oe,"data-active":dt(G),"data-hover":dt(V),"data-checked":dt(oe),"data-focus":dt(X),"data-focus-visible":dt(X&&O),"data-indeterminate":dt(y),"data-disabled":dt(n),"data-invalid":dt(s),"data-readonly":dt(r)}),[G,oe,n,X,O,V,y,s,r]),de=d.useCallback((fe={},Oe=null)=>({...M,...fe,ref:Pt(Oe,je=>{je&&B(je.tagName==="LABEL")}),onClick:Fe(fe.onClick,()=>{var je;T||((je=U.current)==null||je.click(),requestAnimationFrame(()=>{var $e;($e=U.current)==null||$e.focus({preventScroll:!0})}))}),"data-disabled":dt(n),"data-checked":dt(oe),"data-invalid":dt(s)}),[M,n,oe,s,T]),xe=d.useCallback((fe={},Oe=null)=>({...fe,ref:Pt(U,Oe),type:"checkbox",name:b,value:C,id:l,tabIndex:S,onChange:Fe(fe.onChange,q),onBlur:Fe(fe.onBlur,D,()=>z(!1)),onFocus:Fe(fe.onFocus,A,()=>z(!0)),onKeyDown:Fe(fe.onKeyDown,ee),onKeyUp:Fe(fe.onKeyUp,ce),required:o,checked:oe,disabled:K,readOnly:r,"aria-label":_,"aria-labelledby":j,"aria-invalid":E?!!E:s,"aria-describedby":p,"aria-disabled":n,style:kb}),[b,C,l,q,D,A,ee,ce,o,oe,K,r,_,j,E,s,p,n,S]),we=d.useCallback((fe={},Oe=null)=>({...fe,ref:Oe,onMouseDown:Fe(fe.onMouseDown,HL),"data-disabled":dt(n),"data-checked":dt(oe),"data-invalid":dt(s)}),[oe,n,s]);return{state:{isInvalid:s,isFocused:X,isChecked:oe,isActive:G,isHovered:V,isIndeterminate:y,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:de,getCheckboxProps:J,getIndicatorProps:ie,getInputProps:xe,getLabelProps:we,htmlProps:M}}function HL(e){e.preventDefault(),e.stopPropagation()}var VL={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},WL={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},UL=ma({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),GL=ma({from:{opacity:0},to:{opacity:1}}),KL=ma({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Ad=_e(function(t,n){const r=kL(),o={...r,...t},s=Gn("Checkbox",o),l=on(t),{spacing:i="0.5rem",className:c,children:p,iconColor:m,iconSize:h,icon:g=a.jsx(PL,{}),isChecked:x,isDisabled:y=r==null?void 0:r.isDisabled,onChange:b,inputProps:C,...S}=l;let _=x;r!=null&&r.value&&l.value&&(_=r.value.includes(l.value));let j=b;r!=null&&r.onChange&&l.value&&(j=yh(r.onChange,b));const{state:E,getInputProps:I,getCheckboxProps:M,getLabelProps:R,getRootProps:D}=C5({...S,isDisabled:y,isChecked:_,onChange:j}),A=_L(E.isChecked),O=d.useMemo(()=>({animation:A?E.isIndeterminate?`${GL} 20ms linear, ${KL} 200ms linear`:`${UL} 200ms linear`:void 0,fontSize:h,color:m,...s.icon}),[m,h,A,E.isIndeterminate,s.icon]),$=d.cloneElement(g,{__css:O,isIndeterminate:E.isIndeterminate,isChecked:E.isChecked});return a.jsxs(Se.label,{__css:{...WL,...s.container},className:et("chakra-checkbox",c),...D(),children:[a.jsx("input",{className:"chakra-checkbox__input",...I(C,n)}),a.jsx(Se.span,{__css:{...VL,...s.control},className:"chakra-checkbox__control",...M(),children:$}),p&&a.jsx(Se.span,{className:"chakra-checkbox__label",...R(),__css:{marginStart:i,...s.label},children:p})]})});Ad.displayName="Checkbox";function qL(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function jb(e,t){let n=qL(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function O1(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function dm(e,t,n){return(e-t)*100/(n-t)}function w5(e,t,n){return(n-t)*e+t}function R1(e,t,n){const r=Math.round((e-t)/n)*n+t,o=O1(n);return jb(r,o)}function lc(e,t,n){return e==null?e:(n<t&&console.warn("clamp: max cannot be less than min"),Math.min(Math.max(e,t),n))}function XL(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:l=Number.MIN_SAFE_INTEGER,max:i=Number.MAX_SAFE_INTEGER,keepWithinRange:c=!0}=e,p=un(t),[m,h]=d.useState(()=>{var O;return r==null?"":(O=dv(r,s,n))!=null?O:""}),g=typeof o<"u",x=g?o:m,y=S5(za(x),s),b=n??y,C=d.useCallback(O=>{O!==x&&(g||h(O.toString()),p==null||p(O.toString(),za(O)))},[p,g,x]),S=d.useCallback(O=>{let $=O;return c&&($=lc($,l,i)),jb($,b)},[b,c,i,l]),_=d.useCallback((O=s)=>{let $;x===""?$=za(O):$=za(x)+O,$=S($),C($)},[S,s,C,x]),j=d.useCallback((O=s)=>{let $;x===""?$=za(-O):$=za(x)-O,$=S($),C($)},[S,s,C,x]),E=d.useCallback(()=>{var O;let $;r==null?$="":$=(O=dv(r,s,n))!=null?O:l,C($)},[r,n,s,C,l]),I=d.useCallback(O=>{var $;const X=($=dv(O,s,b))!=null?$:l;C(X)},[b,s,C,l]),M=za(x);return{isOutOfRange:M>i||M<l,isAtMax:M===i,isAtMin:M===l,precision:b,value:x,valueAsNumber:M,update:C,reset:E,increment:_,decrement:j,clamp:S,cast:I,setValue:h}}function za(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function S5(e,t){return Math.max(O1(t),O1(e))}function dv(e,t,n){const r=za(e);if(Number.isNaN(r))return;const o=S5(r,t);return jb(r,n??o)}var[QL,k5]=Wt({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[YL,Ib]=Wt({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),_5={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},Oh=_e(function(t,n){const{getInputProps:r}=Ib(),o=k5(),s=r(t,n),l=et("chakra-editable__input",t.className);return a.jsx(Se.input,{...s,__css:{outline:0,..._5,...o.input},className:l})});Oh.displayName="EditableInput";var Rh=_e(function(t,n){const{getPreviewProps:r}=Ib(),o=k5(),s=r(t,n),l=et("chakra-editable__preview",t.className);return a.jsx(Se.span,{...s,__css:{cursor:"text",display:"inline-block",..._5,...o.preview},className:l})});Rh.displayName="EditablePreview";function Tl(e,t,n,r){const o=un(n);return d.useEffect(()=>{const s=typeof e=="function"?e():e??document;if(!(!n||!s))return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const s=typeof e=="function"?e():e??document;s==null||s.removeEventListener(t,o,r)}}function ZL(e){return"current"in e}var j5=()=>typeof window<"u";function JL(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var ez=e=>j5()&&e.test(navigator.vendor),tz=e=>j5()&&e.test(JL()),nz=()=>tz(/mac|iphone|ipad|ipod/i),rz=()=>nz()&&ez(/apple/i);function I5(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,l;return(l=(s=t.current)==null?void 0:s.ownerDocument)!=null?l:document};Tl(o,"pointerdown",s=>{if(!rz()||!r)return;const l=s.target,c=(n??[t]).some(p=>{const m=ZL(p)?p.current:p;return(m==null?void 0:m.contains(l))||m===l});o().activeElement!==l&&c&&(s.preventDefault(),l.focus())})}function uS(e,t){return e?e===t||e.contains(t):!1}function oz(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:l,defaultValue:i,startWithEditView:c,isPreviewFocusable:p=!0,submitOnBlur:m=!0,selectAllOnFocus:h=!0,placeholder:g,onEdit:x,finalFocusRef:y,...b}=e,C=un(x),S=!!(c&&!l),[_,j]=d.useState(S),[E,I]=Md({defaultValue:i||"",value:s,onChange:t}),[M,R]=d.useState(E),D=d.useRef(null),A=d.useRef(null),O=d.useRef(null),$=d.useRef(null),X=d.useRef(null);I5({ref:D,enabled:_,elements:[$,X]});const z=!_&&!l;oc(()=>{var J,ie;_&&((J=D.current)==null||J.focus(),h&&((ie=D.current)==null||ie.select()))},[]),pa(()=>{var J,ie,de,xe;if(!_){y?(J=y.current)==null||J.focus():(ie=O.current)==null||ie.focus();return}(de=D.current)==null||de.focus(),h&&((xe=D.current)==null||xe.select()),C==null||C()},[_,C,h]);const V=d.useCallback(()=>{z&&j(!0)},[z]),Q=d.useCallback(()=>{R(E)},[E]),G=d.useCallback(()=>{j(!1),I(M),n==null||n(M),o==null||o(M)},[n,o,I,M]),F=d.useCallback(()=>{j(!1),R(E),r==null||r(E),o==null||o(M)},[E,r,o,M]);d.useEffect(()=>{if(_)return;const J=D.current;(J==null?void 0:J.ownerDocument.activeElement)===J&&(J==null||J.blur())},[_]);const U=d.useCallback(J=>{I(J.currentTarget.value)},[I]),T=d.useCallback(J=>{const ie=J.key,xe={Escape:G,Enter:we=>{!we.shiftKey&&!we.metaKey&&F()}}[ie];xe&&(J.preventDefault(),xe(J))},[G,F]),B=d.useCallback(J=>{const ie=J.key,xe={Escape:G}[ie];xe&&(J.preventDefault(),xe(J))},[G]),Y=E.length===0,re=d.useCallback(J=>{var ie;if(!_)return;const de=J.currentTarget.ownerDocument,xe=(ie=J.relatedTarget)!=null?ie:de.activeElement,we=uS($.current,xe),ve=uS(X.current,xe);!we&&!ve&&(m?F():G())},[m,F,G,_]),le=d.useCallback((J={},ie=null)=>{const de=z&&p?0:void 0;return{...J,ref:Pt(ie,A),children:Y?g:E,hidden:_,"aria-disabled":yo(l),tabIndex:de,onFocus:Fe(J.onFocus,V,Q)}},[l,_,z,p,Y,V,Q,g,E]),oe=d.useCallback((J={},ie=null)=>({...J,hidden:!_,placeholder:g,ref:Pt(ie,D),disabled:l,"aria-disabled":yo(l),value:E,onBlur:Fe(J.onBlur,re),onChange:Fe(J.onChange,U),onKeyDown:Fe(J.onKeyDown,T),onFocus:Fe(J.onFocus,Q)}),[l,_,re,U,T,Q,g,E]),q=d.useCallback((J={},ie=null)=>({...J,hidden:!_,placeholder:g,ref:Pt(ie,D),disabled:l,"aria-disabled":yo(l),value:E,onBlur:Fe(J.onBlur,re),onChange:Fe(J.onChange,U),onKeyDown:Fe(J.onKeyDown,B),onFocus:Fe(J.onFocus,Q)}),[l,_,re,U,B,Q,g,E]),K=d.useCallback((J={},ie=null)=>({"aria-label":"Edit",...J,type:"button",onClick:Fe(J.onClick,V),ref:Pt(ie,O),disabled:l}),[V,l]),ee=d.useCallback((J={},ie=null)=>({...J,"aria-label":"Submit",ref:Pt(X,ie),type:"button",onClick:Fe(J.onClick,F),disabled:l}),[F,l]),ce=d.useCallback((J={},ie=null)=>({"aria-label":"Cancel",id:"cancel",...J,ref:Pt($,ie),type:"button",onClick:Fe(J.onClick,G),disabled:l}),[G,l]);return{isEditing:_,isDisabled:l,isValueEmpty:Y,value:E,onEdit:V,onCancel:G,onSubmit:F,getPreviewProps:le,getInputProps:oe,getTextareaProps:q,getEditButtonProps:K,getSubmitButtonProps:ee,getCancelButtonProps:ce,htmlProps:b}}var Dh=_e(function(t,n){const r=Gn("Editable",t),o=on(t),{htmlProps:s,...l}=oz(o),{isEditing:i,onSubmit:c,onCancel:p,onEdit:m}=l,h=et("chakra-editable",t.className),g=Ux(t.children,{isEditing:i,onSubmit:c,onCancel:p,onEdit:m});return a.jsx(YL,{value:l,children:a.jsx(QL,{value:r,children:a.jsx(Se.div,{ref:n,...s,className:h,children:g})})})});Dh.displayName="Editable";function P5(){const{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}=Ib();return{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}}var E5={exports:{}},sz="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",az=sz,lz=az;function M5(){}function O5(){}O5.resetWarningCache=M5;var iz=function(){function e(r,o,s,l,i,c){if(c!==lz){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:O5,resetWarningCache:M5};return n.PropTypes=n,n};E5.exports=iz();var cz=E5.exports;const en=wd(cz);var D1="data-focus-lock",R5="data-focus-lock-disabled",uz="data-no-focus-lock",dz="data-autofocus-inside",fz="data-no-autofocus";function pz(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mz(e,t){var n=d.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 D5(e,t){return mz(t||null,function(n){return e.forEach(function(r){return pz(r,n)})})}var fv={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 A5(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 Lc(e,t,n,r){function o(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function i(m){try{p(r.next(m))}catch(h){l(h)}}function c(m){try{p(r.throw(m))}catch(h){l(h)}}function p(m){m.done?s(m.value):o(m.value).then(i,c)}p((r=r.apply(e,t||[])).next())})}function zc(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(p){return function(m){return c([p,m])}}function c(p){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=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 dS(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],l;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(i){l={error:i}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return s}function A1(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 T5(e){return e}function $5(e,t){t===void 0&&(t=T5);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 l=t(s,r);return n.push(l),function(){n=n.filter(function(i){return i!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var i=n;n=[],i.forEach(s),l=n}var c=function(){var m=l;l=[],m.forEach(s)},p=function(){return Promise.resolve().then(c)};p(),n={push:function(m){l.push(m),p()},filter:function(m){return l=l.filter(m),n}}}};return o}function Pb(e,t){return t===void 0&&(t=T5),$5(e,t)}function N5(e){e===void 0&&(e={});var t=$5(null);return t.options=vs({async:!0,ssr:!1},e),t}var L5=function(e){var t=e.sideCar,n=A5(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 d.createElement(r,vs({},n))};L5.isSideCarExport=!0;function hz(e,t){return e.useMedium(t),L5}var z5=Pb({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),F5=Pb(),gz=Pb(),vz=N5({async:!0}),xz=[],Eb=d.forwardRef(function(t,n){var r,o=d.useState(),s=o[0],l=o[1],i=d.useRef(),c=d.useRef(!1),p=d.useRef(null),m=t.children,h=t.disabled,g=t.noFocusGuards,x=t.persistentFocus,y=t.crossFrame,b=t.autoFocus;t.allowTextSelection;var C=t.group,S=t.className,_=t.whiteList,j=t.hasPositiveIndices,E=t.shards,I=E===void 0?xz:E,M=t.as,R=M===void 0?"div":M,D=t.lockProps,A=D===void 0?{}:D,O=t.sideCar,$=t.returnFocus,X=t.focusOptions,z=t.onActivation,V=t.onDeactivation,Q=d.useState({}),G=Q[0],F=d.useCallback(function(){p.current=p.current||document&&document.activeElement,i.current&&z&&z(i.current),c.current=!0},[z]),U=d.useCallback(function(){c.current=!1,V&&V(i.current)},[V]);d.useEffect(function(){h||(p.current=null)},[]);var T=d.useCallback(function(ee){var ce=p.current;if(ce&&ce.focus){var J=typeof $=="function"?$(ce):$;if(J){var ie=typeof J=="object"?J:void 0;p.current=null,ee?Promise.resolve().then(function(){return ce.focus(ie)}):ce.focus(ie)}}},[$]),B=d.useCallback(function(ee){c.current&&z5.useMedium(ee)},[]),Y=F5.useMedium,re=d.useCallback(function(ee){i.current!==ee&&(i.current=ee,l(ee))},[]),le=fn((r={},r[R5]=h&&"disabled",r[D1]=C,r),A),oe=g!==!0,q=oe&&g!=="tail",K=D5([n,re]);return d.createElement(d.Fragment,null,oe&&[d.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:fv}),j?d.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:fv}):null],!h&&d.createElement(O,{id:G,sideCar:vz,observed:s,disabled:h,persistentFocus:x,crossFrame:y,autoFocus:b,whiteList:_,shards:I,onActivation:F,onDeactivation:U,returnFocus:T,focusOptions:X}),d.createElement(R,fn({ref:K},le,{className:S,onBlur:Y,onFocus:B}),m),q&&d.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:fv}))});Eb.propTypes={};Eb.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 B5=Eb;function T1(e,t){return T1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},T1(e,t)}function bz(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,T1(e,t)}function yz(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],l;function i(){l=e(s.map(function(p){return p.props})),t(l)}var c=function(p){bz(m,p);function m(){return p.apply(this,arguments)||this}m.peek=function(){return l};var h=m.prototype;return h.componentDidMount=function(){s.push(this),i()},h.componentDidUpdate=function(){i()},h.componentWillUnmount=function(){var x=s.indexOf(this);s.splice(x,1),i()},h.render=function(){return H.createElement(o,this.props)},m}(d.PureComponent);return QR(c,"displayName","SideEffect("+n(o)+")"),c}}var Ds=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},fm=function(e){return Array.isArray(e)?e:[e]},H5=function(e){return Array.isArray(e)?e[0]:e},Cz=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"},V5=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},W5=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},wz=function(e,t){return!e||W5(e)||!Cz(e)&&t(V5(e))},U5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=wz(t,U5.bind(void 0,e));return e.set(t,r),r},Sz=function(e,t){return e&&!W5(e)?jz(e)?t(V5(e)):!1:!0},G5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=Sz(t,G5.bind(void 0,e));return e.set(t,r),r},K5=function(e){return e.dataset},kz=function(e){return e.tagName==="BUTTON"},q5=function(e){return e.tagName==="INPUT"},X5=function(e){return q5(e)&&e.type==="radio"},_z=function(e){return!((q5(e)||kz(e))&&(e.type==="hidden"||e.disabled))},jz=function(e){var t=e.getAttribute(fz);return![!0,"true",""].includes(t)},Mb=function(e){var t;return!!(e&&(!((t=K5(e))===null||t===void 0)&&t.focusGuard))},pm=function(e){return!Mb(e)},Iz=function(e){return!!e},Pz=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},Q5=function(e,t,n){return Ds(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(Pz)},Ez=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Ob=Ez.join(","),Mz="".concat(Ob,", [data-focus-guard]"),Y5=function(e,t){return Ds((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?Mz:Ob)?[r]:[],Y5(r))},[])},Oz=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?Ah([e.contentDocument.body],t):[e]},Ah=function(e,t){return e.reduce(function(n,r){var o,s=Y5(r,t),l=(o=[]).concat.apply(o,s.map(function(i){return Oz(i,t)}));return n.concat(l,r.parentNode?Ds(r.parentNode.querySelectorAll(Ob)).filter(function(i){return i===r}):[])},[])},Rz=function(e){var t=e.querySelectorAll("[".concat(dz,"]"));return Ds(t).map(function(n){return Ah([n])}).reduce(function(n,r){return n.concat(r)},[])},Rb=function(e,t){return Ds(e).filter(function(n){return U5(t,n)}).filter(function(n){return _z(n)})},fS=function(e,t){return t===void 0&&(t=new Map),Ds(e).filter(function(n){return G5(t,n)})},$1=function(e,t,n){return Q5(Rb(Ah(e,n),t),!0,n)},pS=function(e,t){return Q5(Rb(Ah(e),t),!1)},Dz=function(e,t){return Rb(Rz(e),t)},ic=function(e,t){return e.shadowRoot?ic(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Ds(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?ic(o,t):!1}return ic(n,t)})},Az=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(l,i){return!t.has(i)})},Z5=function(e){return e.parentNode?Z5(e.parentNode):e},Db=function(e){var t=fm(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(D1);return n.push.apply(n,o?Az(Ds(Z5(r).querySelectorAll("[".concat(D1,'="').concat(o,'"]:not([').concat(R5,'="disabled"])')))):[r]),n},[])},Tz=function(e){try{return e()}catch{return}},td=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?td(t.shadowRoot):t instanceof HTMLIFrameElement&&Tz(function(){return t.contentWindow.document})?td(t.contentWindow.document):t}},$z=function(e,t){return e===t},Nz=function(e,t){return!!Ds(e.querySelectorAll("iframe")).some(function(n){return $z(n,t)})},J5=function(e,t){return t===void 0&&(t=td(H5(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Db(e).some(function(n){return ic(n,t)||Nz(n,t)})},Lz=function(e){e===void 0&&(e=document);var t=td(e);return t?Ds(e.querySelectorAll("[".concat(uz,"]"))).some(function(n){return ic(n,t)}):!1},zz=function(e,t){return t.filter(X5).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Ab=function(e,t){return X5(e)&&e.name?zz(e,t):e},Fz=function(e){var t=new Set;return e.forEach(function(n){return t.add(Ab(n,e))}),e.filter(function(n){return t.has(n)})},mS=function(e){return e[0]&&e.length>1?Ab(e[0],e):e[0]},hS=function(e,t){return e.length>1?e.indexOf(Ab(e[t],e)):t},e3="NEW_FOCUS",Bz=function(e,t,n,r){var o=e.length,s=e[0],l=e[o-1],i=Mb(n);if(!(n&&e.indexOf(n)>=0)){var c=n!==void 0?t.indexOf(n):-1,p=r?t.indexOf(r):c,m=r?e.indexOf(r):-1,h=c-p,g=t.indexOf(s),x=t.indexOf(l),y=Fz(t),b=n!==void 0?y.indexOf(n):-1,C=b-(r?y.indexOf(r):c),S=hS(e,0),_=hS(e,o-1);if(c===-1||m===-1)return e3;if(!h&&m>=0)return m;if(c<=g&&i&&Math.abs(h)>1)return _;if(c>=x&&i&&Math.abs(h)>1)return S;if(h&&Math.abs(C)>1)return m;if(c<=g)return _;if(c>x)return S;if(h)return Math.abs(h)>1?m:(o+m+h)%o}},Hz=function(e){return function(t){var n,r=(n=K5(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},Vz=function(e,t,n){var r=e.map(function(s){var l=s.node;return l}),o=fS(r.filter(Hz(n)));return o&&o.length?mS(o):mS(fS(t))},N1=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&N1(e.parentNode.host||e.parentNode,t),t},pv=function(e,t){for(var n=N1(e),r=N1(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},t3=function(e,t,n){var r=fm(e),o=fm(t),s=r[0],l=!1;return o.filter(Boolean).forEach(function(i){l=pv(l||i,i)||l,n.filter(Boolean).forEach(function(c){var p=pv(s,c);p&&(!l||ic(p,l)?l=p:l=pv(p,l))})}),l},Wz=function(e,t){return e.reduce(function(n,r){return n.concat(Dz(r,t))},[])},Uz=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(Iz)},Gz=function(e,t){var n=td(fm(e).length>0?document:H5(e).ownerDocument),r=Db(e).filter(pm),o=t3(n||e,e,r),s=new Map,l=pS(r,s),i=$1(r,s).filter(function(x){var y=x.node;return pm(y)});if(!(!i[0]&&(i=l,!i[0]))){var c=pS([o],s).map(function(x){var y=x.node;return y}),p=Uz(c,i),m=p.map(function(x){var y=x.node;return y}),h=Bz(m,c,n,t);if(h===e3){var g=Vz(l,m,Wz(r,s));if(g)return{node:g};console.warn("focus-lock: cannot find any node to move focus into");return}return h===void 0?h:p[h]}},Kz=function(e){var t=Db(e).filter(pm),n=t3(e,e,t),r=new Map,o=$1([n],r,!0),s=$1(t,r).filter(function(l){var i=l.node;return pm(i)}).map(function(l){var i=l.node;return i});return o.map(function(l){var i=l.node,c=l.index;return{node:i,index:c,lockItem:s.indexOf(i)>=0,guard:Mb(i)}})},qz=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},mv=0,hv=!1,n3=function(e,t,n){n===void 0&&(n={});var r=Gz(e,t);if(!hv&&r){if(mv>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),hv=!0,setTimeout(function(){hv=!1},1);return}mv++,qz(r.node,n.focusOptions),mv--}};function Tb(e){setTimeout(e,1)}var Xz=function(){return document&&document.activeElement===document.body},Qz=function(){return Xz()||Lz()},cc=null,Ji=null,uc=null,nd=!1,Yz=function(){return!0},Zz=function(t){return(cc.whiteList||Yz)(t)},Jz=function(t,n){uc={observerNode:t,portaledElement:n}},eF=function(t){return uc&&uc.portaledElement===t};function gS(e,t,n,r){var o=null,s=e;do{var l=r[s];if(l.guard)l.node.dataset.focusAutoGuard&&(o=l);else if(l.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var tF=function(t){return t&&"current"in t?t.current:t},nF=function(t){return t?!!nd:nd==="meanwhile"},rF=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},oF=function(t,n){return n.some(function(r){return rF(t,r,r)})},mm=function(){var t=!1;if(cc){var n=cc,r=n.observed,o=n.persistentFocus,s=n.autoFocus,l=n.shards,i=n.crossFrame,c=n.focusOptions,p=r||uc&&uc.portaledElement,m=document&&document.activeElement;if(p){var h=[p].concat(l.map(tF).filter(Boolean));if((!m||Zz(m))&&(o||nF(i)||!Qz()||!Ji&&s)&&(p&&!(J5(h)||m&&oF(m,h)||eF(m))&&(document&&!Ji&&m&&!s?(m.blur&&m.blur(),document.body.focus()):(t=n3(h,Ji,{focusOptions:c}),uc={})),nd=!1,Ji=document&&document.activeElement),document){var g=document&&document.activeElement,x=Kz(h),y=x.map(function(b){var C=b.node;return C}).indexOf(g);y>-1&&(x.filter(function(b){var C=b.guard,S=b.node;return C&&S.dataset.focusAutoGuard}).forEach(function(b){var C=b.node;return C.removeAttribute("tabIndex")}),gS(y,x.length,1,x),gS(y,-1,-1,x))}}}return t},r3=function(t){mm()&&t&&(t.stopPropagation(),t.preventDefault())},$b=function(){return Tb(mm)},sF=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Jz(r,n)},aF=function(){return null},o3=function(){nd="just",Tb(function(){nd="meanwhile"})},lF=function(){document.addEventListener("focusin",r3),document.addEventListener("focusout",$b),window.addEventListener("blur",o3)},iF=function(){document.removeEventListener("focusin",r3),document.removeEventListener("focusout",$b),window.removeEventListener("blur",o3)};function cF(e){return e.filter(function(t){var n=t.disabled;return!n})}function uF(e){var t=e.slice(-1)[0];t&&!cc&&lF();var n=cc,r=n&&t&&t.id===n.id;cc=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Ji=null,(!r||n.observed!==t.observed)&&t.onActivation(),mm(),Tb(mm)):(iF(),Ji=null)}z5.assignSyncMedium(sF);F5.assignMedium($b);gz.assignMedium(function(e){return e({moveFocusInside:n3,focusInside:J5})});const dF=yz(cF,uF)(aF);var s3=d.forwardRef(function(t,n){return d.createElement(B5,fn({sideCar:dF,ref:n},t))}),a3=B5.propTypes||{};a3.sideCar;gN(a3,["sideCar"]);s3.propTypes={};const vS=s3;function l3(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Nb(e){var t;if(!l3(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function fF(e){var t,n;return(n=(t=i3(e))==null?void 0:t.defaultView)!=null?n:window}function i3(e){return l3(e)?e.ownerDocument:document}function pF(e){return i3(e).activeElement}function mF(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function hF(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function c3(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:Nb(e)&&mF(e)?e:c3(hF(e))}var u3=e=>e.hasAttribute("tabindex"),gF=e=>u3(e)&&e.tabIndex===-1;function vF(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function d3(e){return e.parentElement&&d3(e.parentElement)?!0:e.hidden}function xF(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function f3(e){if(!Nb(e)||d3(e)||vF(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]():xF(e)?!0:u3(e)}function bF(e){return e?Nb(e)&&f3(e)&&!gF(e):!1}var yF=["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]"],CF=yF.join(),wF=e=>e.offsetWidth>0&&e.offsetHeight>0;function p3(e){const t=Array.from(e.querySelectorAll(CF));return t.unshift(e),t.filter(n=>f3(n)&&wF(n))}var xS,SF=(xS=vS.default)!=null?xS:vS,m3=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:l,autoFocus:i,persistentFocus:c,lockFocusAcrossFrames:p}=e,m=d.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&p3(r.current).length===0&&requestAnimationFrame(()=>{var y;(y=r.current)==null||y.focus()})},[t,r]),h=d.useCallback(()=>{var x;(x=n==null?void 0:n.current)==null||x.focus()},[n]),g=o&&!n;return a.jsx(SF,{crossFrame:p,persistentFocus:c,autoFocus:i,disabled:l,onActivation:m,onDeactivation:h,returnFocus:g,children:s})};m3.displayName="FocusLock";var kF=$N?d.useLayoutEffect:d.useEffect;function L1(e,t=[]){const n=d.useRef(e);return kF(()=>{n.current=e}),d.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function _F(e,t,n,r){const o=L1(t);return d.useEffect(()=>{var s;const l=(s=lw(n))!=null?s:document;if(t)return l.addEventListener(e,o,r),()=>{l.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=lw(n))!=null?s:document).removeEventListener(e,o,r)}}function jF(e,t){const n=d.useId();return d.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function IF(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Lr(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=L1(n),l=L1(t),[i,c]=d.useState(e.defaultIsOpen||!1),[p,m]=IF(r,i),h=jF(o,"disclosure"),g=d.useCallback(()=>{p||c(!1),l==null||l()},[p,l]),x=d.useCallback(()=>{p||c(!0),s==null||s()},[p,s]),y=d.useCallback(()=>{(m?g:x)()},[m,x,g]);return{isOpen:!!m,onOpen:x,onClose:g,onToggle:y,isControlled:p,getButtonProps:(b={})=>({...b,"aria-expanded":m,"aria-controls":h,onClick:YR(b.onClick,y)}),getDisclosureProps:(b={})=>({...b,hidden:!m,id:h})}}var[PF,EF]=Wt({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),h3=_e(function(t,n){const r=Gn("Input",t),{children:o,className:s,...l}=on(t),i=et("chakra-input__group",s),c={},p=Mh(o),m=r.field;p.forEach(g=>{var x,y;r&&(m&&g.type.id==="InputLeftElement"&&(c.paddingStart=(x=m.height)!=null?x:m.h),m&&g.type.id==="InputRightElement"&&(c.paddingEnd=(y=m.height)!=null?y:m.h),g.type.id==="InputRightAddon"&&(c.borderEndRadius=0),g.type.id==="InputLeftAddon"&&(c.borderStartRadius=0))});const h=p.map(g=>{var x,y;const b=rI({size:((x=g.props)==null?void 0:x.size)||t.size,variant:((y=g.props)==null?void 0:y.variant)||t.variant});return g.type.id!=="Input"?d.cloneElement(g,b):d.cloneElement(g,Object.assign(b,c,g.props))});return a.jsx(Se.div,{className:i,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...l,children:a.jsx(PF,{value:r,children:h})})});h3.displayName="InputGroup";var MF=Se("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),Th=_e(function(t,n){var r,o;const{placement:s="left",...l}=t,i=EF(),c=i.field,m={[s==="left"?"insetStart":"insetEnd"]:"0",width:(r=c==null?void 0:c.height)!=null?r:c==null?void 0:c.h,height:(o=c==null?void 0:c.height)!=null?o:c==null?void 0:c.h,fontSize:c==null?void 0:c.fontSize,...i.element};return a.jsx(MF,{ref:n,__css:m,...l})});Th.id="InputElement";Th.displayName="InputElement";var g3=_e(function(t,n){const{className:r,...o}=t,s=et("chakra-input__left-element",r);return a.jsx(Th,{ref:n,placement:"left",className:s,...o})});g3.id="InputLeftElement";g3.displayName="InputLeftElement";var Lb=_e(function(t,n){const{className:r,...o}=t,s=et("chakra-input__right-element",r);return a.jsx(Th,{ref:n,placement:"right",className:s,...o})});Lb.id="InputRightElement";Lb.displayName="InputRightElement";var $h=_e(function(t,n){const{htmlSize:r,...o}=t,s=Gn("Input",o),l=on(o),i=wb(l),c=et("chakra-input",t.className);return a.jsx(Se.input,{size:r,...i,__css:s.field,ref:n,className:c})});$h.displayName="Input";$h.id="Input";var Nh=_e(function(t,n){const r=al("Link",t),{className:o,isExternal:s,...l}=on(t);return a.jsx(Se.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:et("chakra-link",o),...l,__css:r})});Nh.displayName="Link";var[OF,v3]=Wt({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),zb=_e(function(t,n){const r=Gn("List",t),{children:o,styleType:s="none",stylePosition:l,spacing:i,...c}=on(t),p=Mh(o),h=i?{["& > *:not(style) ~ *:not(style)"]:{mt:i}}:{};return a.jsx(OF,{value:r,children:a.jsx(Se.ul,{ref:n,listStyleType:s,listStylePosition:l,role:"list",__css:{...r.container,...h},...c,children:p})})});zb.displayName="List";var x3=_e((e,t)=>{const{as:n,...r}=e;return a.jsx(zb,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});x3.displayName="OrderedList";var Td=_e(function(t,n){const{as:r,...o}=t;return a.jsx(zb,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});Td.displayName="UnorderedList";var go=_e(function(t,n){const r=v3();return a.jsx(Se.li,{ref:n,...t,__css:r.item})});go.displayName="ListItem";var RF=_e(function(t,n){const r=v3();return a.jsx(Tn,{ref:n,role:"presentation",...t,__css:r.icon})});RF.displayName="ListIcon";var el=_e(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:l,column:i,row:c,autoFlow:p,autoRows:m,templateRows:h,autoColumns:g,templateColumns:x,...y}=t,b={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:l,gridAutoColumns:g,gridColumn:i,gridRow:c,gridAutoFlow:p,gridAutoRows:m,gridTemplateRows:h,gridTemplateColumns:x};return a.jsx(Se.div,{ref:n,__css:b,...y})});el.displayName="Grid";function b3(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):f1(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var ba=Se("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});ba.displayName="Spacer";var y3=e=>a.jsx(Se.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});y3.displayName="StackItem";function DF(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":b3(n,o=>r[o])}}var Fb=_e((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:l="0.5rem",wrap:i,children:c,divider:p,className:m,shouldWrapChildren:h,...g}=e,x=n?"row":r??"column",y=d.useMemo(()=>DF({spacing:l,direction:x}),[l,x]),b=!!p,C=!h&&!b,S=d.useMemo(()=>{const j=Mh(c);return C?j:j.map((E,I)=>{const M=typeof E.key<"u"?E.key:I,R=I+1===j.length,A=h?a.jsx(y3,{children:E},M):E;if(!b)return A;const O=d.cloneElement(p,{__css:y}),$=R?null:O;return a.jsxs(d.Fragment,{children:[A,$]},M)})},[p,y,b,C,h,c]),_=et("chakra-stack",m);return a.jsx(Se.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:x,flexWrap:i,gap:b?void 0:l,className:_,...g,children:S})});Fb.displayName="Stack";var C3=_e((e,t)=>a.jsx(Fb,{align:"center",...e,direction:"column",ref:t}));C3.displayName="VStack";var Bb=_e((e,t)=>a.jsx(Fb,{align:"center",...e,direction:"row",ref:t}));Bb.displayName="HStack";function bS(e){return b3(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var rd=_e(function(t,n){const{area:r,colSpan:o,colStart:s,colEnd:l,rowEnd:i,rowSpan:c,rowStart:p,...m}=t,h=rI({gridArea:r,gridColumn:bS(o),gridRow:bS(c),gridColumnStart:s,gridColumnEnd:l,gridRowStart:p,gridRowEnd:i});return a.jsx(Se.div,{ref:n,__css:h,...m})});rd.displayName="GridItem";var As=_e(function(t,n){const r=al("Badge",t),{className:o,...s}=on(t);return a.jsx(Se.span,{ref:n,className:et("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});As.displayName="Badge";var Jn=_e(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:l,borderWidth:i,borderStyle:c,borderColor:p,...m}=al("Divider",t),{className:h,orientation:g="horizontal",__css:x,...y}=on(t),b={vertical:{borderLeftWidth:r||l||i||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||i||"1px",width:"100%"}};return a.jsx(Se.hr,{ref:n,"aria-orientation":g,...y,__css:{...m,border:"0",borderColor:p,borderStyle:c,...b[g],...x},className:et("chakra-divider",h)})});Jn.displayName="Divider";function AF(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function TF(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=d.useState([]),s=d.useRef(),l=()=>{s.current&&(clearTimeout(s.current),s.current=null)},i=()=>{l(),s.current=setTimeout(()=>{o([]),s.current=null},t)};d.useEffect(()=>l,[]);function c(p){return m=>{if(m.key==="Backspace"){const h=[...r];h.pop(),o(h);return}if(AF(m)){const h=r.concat(m.key);n(m)&&(m.preventDefault(),m.stopPropagation()),o(h),p(h.join("")),i()}}}return c}function $F(e,t,n,r){if(t==null)return r;if(!r)return e.find(l=>n(l).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 NF(){const e=d.useRef(new Map),t=e.current,n=d.useCallback((o,s,l,i)=>{e.current.set(l,{type:s,el:o,options:i}),o.addEventListener(s,l,i)},[]),r=d.useCallback((o,s,l,i)=>{o.removeEventListener(s,l,i),e.current.delete(l)},[]);return d.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function gv(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function w3(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:l,onMouseUp:i,onClick:c,onKeyDown:p,onKeyUp:m,tabIndex:h,onMouseOver:g,onMouseLeave:x,...y}=e,[b,C]=d.useState(!0),[S,_]=d.useState(!1),j=NF(),E=F=>{F&&F.tagName!=="BUTTON"&&C(!1)},I=b?h:h||0,M=n&&!r,R=d.useCallback(F=>{if(n){F.stopPropagation(),F.preventDefault();return}F.currentTarget.focus(),c==null||c(F)},[n,c]),D=d.useCallback(F=>{S&&gv(F)&&(F.preventDefault(),F.stopPropagation(),_(!1),j.remove(document,"keyup",D,!1))},[S,j]),A=d.useCallback(F=>{if(p==null||p(F),n||F.defaultPrevented||F.metaKey||!gv(F.nativeEvent)||b)return;const U=o&&F.key==="Enter";s&&F.key===" "&&(F.preventDefault(),_(!0)),U&&(F.preventDefault(),F.currentTarget.click()),j.add(document,"keyup",D,!1)},[n,b,p,o,s,j,D]),O=d.useCallback(F=>{if(m==null||m(F),n||F.defaultPrevented||F.metaKey||!gv(F.nativeEvent)||b)return;s&&F.key===" "&&(F.preventDefault(),_(!1),F.currentTarget.click())},[s,b,n,m]),$=d.useCallback(F=>{F.button===0&&(_(!1),j.remove(document,"mouseup",$,!1))},[j]),X=d.useCallback(F=>{if(F.button!==0)return;if(n){F.stopPropagation(),F.preventDefault();return}b||_(!0),F.currentTarget.focus({preventScroll:!0}),j.add(document,"mouseup",$,!1),l==null||l(F)},[n,b,l,j,$]),z=d.useCallback(F=>{F.button===0&&(b||_(!1),i==null||i(F))},[i,b]),V=d.useCallback(F=>{if(n){F.preventDefault();return}g==null||g(F)},[n,g]),Q=d.useCallback(F=>{S&&(F.preventDefault(),_(!1)),x==null||x(F)},[S,x]),G=Pt(t,E);return b?{...y,ref:G,type:"button","aria-disabled":M?void 0:n,disabled:M,onClick:R,onMouseDown:l,onMouseUp:i,onKeyUp:m,onKeyDown:p,onMouseOver:g,onMouseLeave:x}:{...y,ref:G,role:"button","data-active":dt(S),"aria-disabled":n?"true":void 0,tabIndex:M?void 0:I,onClick:R,onMouseDown:X,onMouseUp:z,onKeyUp:O,onKeyDown:A,onMouseOver:V,onMouseLeave:Q}}function LF(e){const t=e.current;if(!t)return!1;const n=pF(t);return!n||t.contains(n)?!1:!!bF(n)}function S3(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;pa(()=>{if(!s||LF(e))return;const l=(o==null?void 0:o.current)||e.current;let i;if(l)return i=requestAnimationFrame(()=>{l.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(i)}},[s,e,o])}var zF={preventScroll:!0,shouldFocus:!1};function FF(e,t=zF){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,l=BF(e)?e.current:e,i=o&&s,c=d.useRef(i),p=d.useRef(s);oc(()=>{!p.current&&s&&(c.current=i),p.current=s},[s,i]);const m=d.useCallback(()=>{if(!(!s||!l||!c.current)&&(c.current=!1,!l.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=p3(l);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[s,r,l,n]);pa(()=>{m()},[m]),Tl(l,"transitionend",m)}function BF(e){return"current"in e}var Di=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),$n={arrowShadowColor:Di("--popper-arrow-shadow-color"),arrowSize:Di("--popper-arrow-size","8px"),arrowSizeHalf:Di("--popper-arrow-size-half"),arrowBg:Di("--popper-arrow-bg"),transformOrigin:Di("--popper-transform-origin"),arrowOffset:Di("--popper-arrow-offset")};function HF(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var VF={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},WF=e=>VF[e],yS={scroll:!0,resize:!0};function UF(e){let t;return typeof e=="object"?t={enabled:!0,options:{...yS,...e}}:t={enabled:e,options:yS},t}var GF={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},KF={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{CS(e)},effect:({state:e})=>()=>{CS(e)}},CS=e=>{e.elements.popper.style.setProperty($n.transformOrigin.var,WF(e.placement))},qF={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{XF(e)}},XF=e=>{var t;if(!e.placement)return;const n=QF(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:$n.arrowSize.varRef,height:$n.arrowSize.varRef,zIndex:-1});const r={[$n.arrowSizeHalf.var]:`calc(${$n.arrowSize.varRef} / 2 - 1px)`,[$n.arrowOffset.var]:`calc(${$n.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},QF=e=>{if(e.startsWith("top"))return{property:"bottom",value:$n.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:$n.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:$n.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:$n.arrowOffset.varRef}},YF={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{wS(e)},effect:({state:e})=>()=>{wS(e)}},wS=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=HF(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:$n.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},ZF={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},JF={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function eB(e,t="ltr"){var n,r;const o=((n=ZF[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=JF[e])!=null?r:o}var Tr="top",So="bottom",ko="right",$r="left",Hb="auto",$d=[Tr,So,ko,$r],yc="start",od="end",tB="clippingParents",k3="viewport",ju="popper",nB="reference",SS=$d.reduce(function(e,t){return e.concat([t+"-"+yc,t+"-"+od])},[]),_3=[].concat($d,[Hb]).reduce(function(e,t){return e.concat([t,t+"-"+yc,t+"-"+od])},[]),rB="beforeRead",oB="read",sB="afterRead",aB="beforeMain",lB="main",iB="afterMain",cB="beforeWrite",uB="write",dB="afterWrite",fB=[rB,oB,sB,aB,lB,iB,cB,uB,dB];function Ss(e){return e?(e.nodeName||"").toLowerCase():null}function to(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ul(e){var t=to(e).Element;return e instanceof t||e instanceof Element}function Co(e){var t=to(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Vb(e){if(typeof ShadowRoot>"u")return!1;var t=to(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function pB(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!Co(s)||!Ss(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(l){var i=o[l];i===!1?s.removeAttribute(l):s.setAttribute(l,i===!0?"":i)}))})}function mB(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},l=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),i=l.reduce(function(c,p){return c[p]="",c},{});!Co(o)||!Ss(o)||(Object.assign(o.style,i),Object.keys(s).forEach(function(c){o.removeAttribute(c)}))})}}const hB={name:"applyStyles",enabled:!0,phase:"write",fn:pB,effect:mB,requires:["computeStyles"]};function ws(e){return e.split("-")[0]}var $l=Math.max,hm=Math.min,Cc=Math.round;function z1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function j3(){return!/^((?!chrome|android).)*safari/i.test(z1())}function wc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&Co(e)&&(o=e.offsetWidth>0&&Cc(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Cc(r.height)/e.offsetHeight||1);var l=Ul(e)?to(e):window,i=l.visualViewport,c=!j3()&&n,p=(r.left+(c&&i?i.offsetLeft:0))/o,m=(r.top+(c&&i?i.offsetTop:0))/s,h=r.width/o,g=r.height/s;return{width:h,height:g,top:m,right:p+h,bottom:m+g,left:p,x:p,y:m}}function Wb(e){var t=wc(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function I3(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Vb(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function la(e){return to(e).getComputedStyle(e)}function gB(e){return["table","td","th"].indexOf(Ss(e))>=0}function il(e){return((Ul(e)?e.ownerDocument:e.document)||window.document).documentElement}function Lh(e){return Ss(e)==="html"?e:e.assignedSlot||e.parentNode||(Vb(e)?e.host:null)||il(e)}function kS(e){return!Co(e)||la(e).position==="fixed"?null:e.offsetParent}function vB(e){var t=/firefox/i.test(z1()),n=/Trident/i.test(z1());if(n&&Co(e)){var r=la(e);if(r.position==="fixed")return null}var o=Lh(e);for(Vb(o)&&(o=o.host);Co(o)&&["html","body"].indexOf(Ss(o))<0;){var s=la(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function Nd(e){for(var t=to(e),n=kS(e);n&&gB(n)&&la(n).position==="static";)n=kS(n);return n&&(Ss(n)==="html"||Ss(n)==="body"&&la(n).position==="static")?t:n||vB(e)||t}function Ub(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Uu(e,t,n){return $l(e,hm(t,n))}function xB(e,t,n){var r=Uu(e,t,n);return r>n?n:r}function P3(){return{top:0,right:0,bottom:0,left:0}}function E3(e){return Object.assign({},P3(),e)}function M3(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var bB=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,E3(typeof t!="number"?t:M3(t,$d))};function yB(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,l=n.modifiersData.popperOffsets,i=ws(n.placement),c=Ub(i),p=[$r,ko].indexOf(i)>=0,m=p?"height":"width";if(!(!s||!l)){var h=bB(o.padding,n),g=Wb(s),x=c==="y"?Tr:$r,y=c==="y"?So:ko,b=n.rects.reference[m]+n.rects.reference[c]-l[c]-n.rects.popper[m],C=l[c]-n.rects.reference[c],S=Nd(s),_=S?c==="y"?S.clientHeight||0:S.clientWidth||0:0,j=b/2-C/2,E=h[x],I=_-g[m]-h[y],M=_/2-g[m]/2+j,R=Uu(E,M,I),D=c;n.modifiersData[r]=(t={},t[D]=R,t.centerOffset=R-M,t)}}function CB(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||I3(t.elements.popper,o)&&(t.elements.arrow=o))}const wB={name:"arrow",enabled:!0,phase:"main",fn:yB,effect:CB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sc(e){return e.split("-")[1]}var SB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function kB(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Cc(n*o)/o||0,y:Cc(r*o)/o||0}}function _S(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,l=e.offsets,i=e.position,c=e.gpuAcceleration,p=e.adaptive,m=e.roundOffsets,h=e.isFixed,g=l.x,x=g===void 0?0:g,y=l.y,b=y===void 0?0:y,C=typeof m=="function"?m({x,y:b}):{x,y:b};x=C.x,b=C.y;var S=l.hasOwnProperty("x"),_=l.hasOwnProperty("y"),j=$r,E=Tr,I=window;if(p){var M=Nd(n),R="clientHeight",D="clientWidth";if(M===to(n)&&(M=il(n),la(M).position!=="static"&&i==="absolute"&&(R="scrollHeight",D="scrollWidth")),M=M,o===Tr||(o===$r||o===ko)&&s===od){E=So;var A=h&&M===I&&I.visualViewport?I.visualViewport.height:M[R];b-=A-r.height,b*=c?1:-1}if(o===$r||(o===Tr||o===So)&&s===od){j=ko;var O=h&&M===I&&I.visualViewport?I.visualViewport.width:M[D];x-=O-r.width,x*=c?1:-1}}var $=Object.assign({position:i},p&&SB),X=m===!0?kB({x,y:b},to(n)):{x,y:b};if(x=X.x,b=X.y,c){var z;return Object.assign({},$,(z={},z[E]=_?"0":"",z[j]=S?"0":"",z.transform=(I.devicePixelRatio||1)<=1?"translate("+x+"px, "+b+"px)":"translate3d("+x+"px, "+b+"px, 0)",z))}return Object.assign({},$,(t={},t[E]=_?b+"px":"",t[j]=S?x+"px":"",t.transform="",t))}function _B(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,l=s===void 0?!0:s,i=n.roundOffsets,c=i===void 0?!0:i,p={placement:ws(t.placement),variation:Sc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,_S(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,_S(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const jB={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_B,data:{}};var np={passive:!0};function IB(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,l=r.resize,i=l===void 0?!0:l,c=to(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&p.forEach(function(m){m.addEventListener("scroll",n.update,np)}),i&&c.addEventListener("resize",n.update,np),function(){s&&p.forEach(function(m){m.removeEventListener("scroll",n.update,np)}),i&&c.removeEventListener("resize",n.update,np)}}const PB={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:IB,data:{}};var EB={left:"right",right:"left",bottom:"top",top:"bottom"};function zp(e){return e.replace(/left|right|bottom|top/g,function(t){return EB[t]})}var MB={start:"end",end:"start"};function jS(e){return e.replace(/start|end/g,function(t){return MB[t]})}function Gb(e){var t=to(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Kb(e){return wc(il(e)).left+Gb(e).scrollLeft}function OB(e,t){var n=to(e),r=il(e),o=n.visualViewport,s=r.clientWidth,l=r.clientHeight,i=0,c=0;if(o){s=o.width,l=o.height;var p=j3();(p||!p&&t==="fixed")&&(i=o.offsetLeft,c=o.offsetTop)}return{width:s,height:l,x:i+Kb(e),y:c}}function RB(e){var t,n=il(e),r=Gb(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=$l(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=$l(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),i=-r.scrollLeft+Kb(e),c=-r.scrollTop;return la(o||n).direction==="rtl"&&(i+=$l(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:l,x:i,y:c}}function qb(e){var t=la(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function O3(e){return["html","body","#document"].indexOf(Ss(e))>=0?e.ownerDocument.body:Co(e)&&qb(e)?e:O3(Lh(e))}function Gu(e,t){var n;t===void 0&&(t=[]);var r=O3(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=to(r),l=o?[s].concat(s.visualViewport||[],qb(r)?r:[]):r,i=t.concat(l);return o?i:i.concat(Gu(Lh(l)))}function F1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function DB(e,t){var n=wc(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function IS(e,t,n){return t===k3?F1(OB(e,n)):Ul(t)?DB(t,n):F1(RB(il(e)))}function AB(e){var t=Gu(Lh(e)),n=["absolute","fixed"].indexOf(la(e).position)>=0,r=n&&Co(e)?Nd(e):e;return Ul(r)?t.filter(function(o){return Ul(o)&&I3(o,r)&&Ss(o)!=="body"}):[]}function TB(e,t,n,r){var o=t==="clippingParents"?AB(e):[].concat(t),s=[].concat(o,[n]),l=s[0],i=s.reduce(function(c,p){var m=IS(e,p,r);return c.top=$l(m.top,c.top),c.right=hm(m.right,c.right),c.bottom=hm(m.bottom,c.bottom),c.left=$l(m.left,c.left),c},IS(e,l,r));return i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}function R3(e){var t=e.reference,n=e.element,r=e.placement,o=r?ws(r):null,s=r?Sc(r):null,l=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2,c;switch(o){case Tr:c={x:l,y:t.y-n.height};break;case So:c={x:l,y:t.y+t.height};break;case ko:c={x:t.x+t.width,y:i};break;case $r:c={x:t.x-n.width,y:i};break;default:c={x:t.x,y:t.y}}var p=o?Ub(o):null;if(p!=null){var m=p==="y"?"height":"width";switch(s){case yc:c[p]=c[p]-(t[m]/2-n[m]/2);break;case od:c[p]=c[p]+(t[m]/2-n[m]/2);break}}return c}function sd(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,l=s===void 0?e.strategy:s,i=n.boundary,c=i===void 0?tB:i,p=n.rootBoundary,m=p===void 0?k3:p,h=n.elementContext,g=h===void 0?ju:h,x=n.altBoundary,y=x===void 0?!1:x,b=n.padding,C=b===void 0?0:b,S=E3(typeof C!="number"?C:M3(C,$d)),_=g===ju?nB:ju,j=e.rects.popper,E=e.elements[y?_:g],I=TB(Ul(E)?E:E.contextElement||il(e.elements.popper),c,m,l),M=wc(e.elements.reference),R=R3({reference:M,element:j,strategy:"absolute",placement:o}),D=F1(Object.assign({},j,R)),A=g===ju?D:M,O={top:I.top-A.top+S.top,bottom:A.bottom-I.bottom+S.bottom,left:I.left-A.left+S.left,right:A.right-I.right+S.right},$=e.modifiersData.offset;if(g===ju&&$){var X=$[o];Object.keys(O).forEach(function(z){var V=[ko,So].indexOf(z)>=0?1:-1,Q=[Tr,So].indexOf(z)>=0?"y":"x";O[z]+=X[Q]*V})}return O}function $B(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,l=n.padding,i=n.flipVariations,c=n.allowedAutoPlacements,p=c===void 0?_3:c,m=Sc(r),h=m?i?SS:SS.filter(function(y){return Sc(y)===m}):$d,g=h.filter(function(y){return p.indexOf(y)>=0});g.length===0&&(g=h);var x=g.reduce(function(y,b){return y[b]=sd(e,{placement:b,boundary:o,rootBoundary:s,padding:l})[ws(b)],y},{});return Object.keys(x).sort(function(y,b){return x[y]-x[b]})}function NB(e){if(ws(e)===Hb)return[];var t=zp(e);return[jS(e),t,jS(t)]}function LB(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,l=n.altAxis,i=l===void 0?!0:l,c=n.fallbackPlacements,p=n.padding,m=n.boundary,h=n.rootBoundary,g=n.altBoundary,x=n.flipVariations,y=x===void 0?!0:x,b=n.allowedAutoPlacements,C=t.options.placement,S=ws(C),_=S===C,j=c||(_||!y?[zp(C)]:NB(C)),E=[C].concat(j).reduce(function(oe,q){return oe.concat(ws(q)===Hb?$B(t,{placement:q,boundary:m,rootBoundary:h,padding:p,flipVariations:y,allowedAutoPlacements:b}):q)},[]),I=t.rects.reference,M=t.rects.popper,R=new Map,D=!0,A=E[0],O=0;O<E.length;O++){var $=E[O],X=ws($),z=Sc($)===yc,V=[Tr,So].indexOf(X)>=0,Q=V?"width":"height",G=sd(t,{placement:$,boundary:m,rootBoundary:h,altBoundary:g,padding:p}),F=V?z?ko:$r:z?So:Tr;I[Q]>M[Q]&&(F=zp(F));var U=zp(F),T=[];if(s&&T.push(G[X]<=0),i&&T.push(G[F]<=0,G[U]<=0),T.every(function(oe){return oe})){A=$,D=!1;break}R.set($,T)}if(D)for(var B=y?3:1,Y=function(q){var K=E.find(function(ee){var ce=R.get(ee);if(ce)return ce.slice(0,q).every(function(J){return J})});if(K)return A=K,"break"},re=B;re>0;re--){var le=Y(re);if(le==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const zB={name:"flip",enabled:!0,phase:"main",fn:LB,requiresIfExists:["offset"],data:{_skip:!1}};function PS(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ES(e){return[Tr,ko,So,$r].some(function(t){return e[t]>=0})}function FB(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,l=sd(t,{elementContext:"reference"}),i=sd(t,{altBoundary:!0}),c=PS(l,r),p=PS(i,o,s),m=ES(c),h=ES(p);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:p,isReferenceHidden:m,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":m,"data-popper-escaped":h})}const BB={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:FB};function HB(e,t,n){var r=ws(e),o=[$r,Tr].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=s[0],i=s[1];return l=l||0,i=(i||0)*o,[$r,ko].indexOf(r)>=0?{x:i,y:l}:{x:l,y:i}}function VB(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,l=_3.reduce(function(m,h){return m[h]=HB(h,t.rects,s),m},{}),i=l[t.placement],c=i.x,p=i.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=l}const WB={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:VB};function UB(e){var t=e.state,n=e.name;t.modifiersData[n]=R3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const GB={name:"popperOffsets",enabled:!0,phase:"read",fn:UB,data:{}};function KB(e){return e==="x"?"y":"x"}function qB(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,l=n.altAxis,i=l===void 0?!1:l,c=n.boundary,p=n.rootBoundary,m=n.altBoundary,h=n.padding,g=n.tether,x=g===void 0?!0:g,y=n.tetherOffset,b=y===void 0?0:y,C=sd(t,{boundary:c,rootBoundary:p,padding:h,altBoundary:m}),S=ws(t.placement),_=Sc(t.placement),j=!_,E=Ub(S),I=KB(E),M=t.modifiersData.popperOffsets,R=t.rects.reference,D=t.rects.popper,A=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,O=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),$=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(M){if(s){var z,V=E==="y"?Tr:$r,Q=E==="y"?So:ko,G=E==="y"?"height":"width",F=M[E],U=F+C[V],T=F-C[Q],B=x?-D[G]/2:0,Y=_===yc?R[G]:D[G],re=_===yc?-D[G]:-R[G],le=t.elements.arrow,oe=x&&le?Wb(le):{width:0,height:0},q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:P3(),K=q[V],ee=q[Q],ce=Uu(0,R[G],oe[G]),J=j?R[G]/2-B-ce-K-O.mainAxis:Y-ce-K-O.mainAxis,ie=j?-R[G]/2+B+ce+ee+O.mainAxis:re+ce+ee+O.mainAxis,de=t.elements.arrow&&Nd(t.elements.arrow),xe=de?E==="y"?de.clientTop||0:de.clientLeft||0:0,we=(z=$==null?void 0:$[E])!=null?z:0,ve=F+J-we-xe,fe=F+ie-we,Oe=Uu(x?hm(U,ve):U,F,x?$l(T,fe):T);M[E]=Oe,X[E]=Oe-F}if(i){var je,$e=E==="x"?Tr:$r,st=E==="x"?So:ko,Ve=M[I],Ct=I==="y"?"height":"width",Ye=Ve+C[$e],Ke=Ve-C[st],ge=[Tr,$r].indexOf(S)!==-1,De=(je=$==null?void 0:$[I])!=null?je:0,ut=ge?Ye:Ve-R[Ct]-D[Ct]-De+O.altAxis,yt=ge?Ve+R[Ct]+D[Ct]-De-O.altAxis:Ke,ye=x&&ge?xB(ut,Ve,yt):Uu(x?ut:Ye,Ve,x?yt:Ke);M[I]=ye,X[I]=ye-Ve}t.modifiersData[r]=X}}const XB={name:"preventOverflow",enabled:!0,phase:"main",fn:qB,requiresIfExists:["offset"]};function QB(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function YB(e){return e===to(e)||!Co(e)?Gb(e):QB(e)}function ZB(e){var t=e.getBoundingClientRect(),n=Cc(t.width)/e.offsetWidth||1,r=Cc(t.height)/e.offsetHeight||1;return n!==1||r!==1}function JB(e,t,n){n===void 0&&(n=!1);var r=Co(t),o=Co(t)&&ZB(t),s=il(t),l=wc(e,o,n),i={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((Ss(t)!=="body"||qb(s))&&(i=YB(t)),Co(t)?(c=wc(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):s&&(c.x=Kb(s))),{x:l.left+i.scrollLeft-c.x,y:l.top+i.scrollTop-c.y,width:l.width,height:l.height}}function eH(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var l=[].concat(s.requires||[],s.requiresIfExists||[]);l.forEach(function(i){if(!n.has(i)){var c=t.get(i);c&&o(c)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function tH(e){var t=eH(e);return fB.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function nH(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function rH(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var MS={placement:"bottom",modifiers:[],strategy:"absolute"};function OS(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function oH(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?MS:o;return function(i,c,p){p===void 0&&(p=s);var m={placement:"bottom",orderedModifiers:[],options:Object.assign({},MS,s),modifiersData:{},elements:{reference:i,popper:c},attributes:{},styles:{}},h=[],g=!1,x={state:m,setOptions:function(S){var _=typeof S=="function"?S(m.options):S;b(),m.options=Object.assign({},s,m.options,_),m.scrollParents={reference:Ul(i)?Gu(i):i.contextElement?Gu(i.contextElement):[],popper:Gu(c)};var j=tH(rH([].concat(r,m.options.modifiers)));return m.orderedModifiers=j.filter(function(E){return E.enabled}),y(),x.update()},forceUpdate:function(){if(!g){var S=m.elements,_=S.reference,j=S.popper;if(OS(_,j)){m.rects={reference:JB(_,Nd(j),m.options.strategy==="fixed"),popper:Wb(j)},m.reset=!1,m.placement=m.options.placement,m.orderedModifiers.forEach(function(O){return m.modifiersData[O.name]=Object.assign({},O.data)});for(var E=0;E<m.orderedModifiers.length;E++){if(m.reset===!0){m.reset=!1,E=-1;continue}var I=m.orderedModifiers[E],M=I.fn,R=I.options,D=R===void 0?{}:R,A=I.name;typeof M=="function"&&(m=M({state:m,options:D,name:A,instance:x})||m)}}}},update:nH(function(){return new Promise(function(C){x.forceUpdate(),C(m)})}),destroy:function(){b(),g=!0}};if(!OS(i,c))return x;x.setOptions(p).then(function(C){!g&&p.onFirstUpdate&&p.onFirstUpdate(C)});function y(){m.orderedModifiers.forEach(function(C){var S=C.name,_=C.options,j=_===void 0?{}:_,E=C.effect;if(typeof E=="function"){var I=E({state:m,name:S,instance:x,options:j}),M=function(){};h.push(I||M)}})}function b(){h.forEach(function(C){return C()}),h=[]}return x}}var sH=[PB,GB,jB,hB,WB,zB,XB,wB,BB],aH=oH({defaultModifiers:sH});function Xb(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:l=!0,offset:i,gutter:c=8,flip:p=!0,boundary:m="clippingParents",preventOverflow:h=!0,matchWidth:g,direction:x="ltr"}=e,y=d.useRef(null),b=d.useRef(null),C=d.useRef(null),S=eB(r,x),_=d.useRef(()=>{}),j=d.useCallback(()=>{var O;!t||!y.current||!b.current||((O=_.current)==null||O.call(_),C.current=aH(y.current,b.current,{placement:S,modifiers:[YF,qF,KF,{...GF,enabled:!!g},{name:"eventListeners",...UF(l)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:i??[0,c]}},{name:"flip",enabled:!!p,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:m}},...n??[]],strategy:o}),C.current.forceUpdate(),_.current=C.current.destroy)},[S,t,n,g,l,s,i,c,p,h,m,o]);d.useEffect(()=>()=>{var O;!y.current&&!b.current&&((O=C.current)==null||O.destroy(),C.current=null)},[]);const E=d.useCallback(O=>{y.current=O,j()},[j]),I=d.useCallback((O={},$=null)=>({...O,ref:Pt(E,$)}),[E]),M=d.useCallback(O=>{b.current=O,j()},[j]),R=d.useCallback((O={},$=null)=>({...O,ref:Pt(M,$),style:{...O.style,position:o,minWidth:g?void 0:"max-content",inset:"0 auto auto 0"}}),[o,M,g]),D=d.useCallback((O={},$=null)=>{const{size:X,shadowColor:z,bg:V,style:Q,...G}=O;return{...G,ref:$,"data-popper-arrow":"",style:lH(O)}},[]),A=d.useCallback((O={},$=null)=>({...O,ref:$,"data-popper-arrow-inner":""}),[]);return{update(){var O;(O=C.current)==null||O.update()},forceUpdate(){var O;(O=C.current)==null||O.forceUpdate()},transformOrigin:$n.transformOrigin.varRef,referenceRef:E,popperRef:M,getPopperProps:R,getArrowProps:D,getArrowInnerProps:A,getReferenceProps:I}}function lH(e){const{size:t,shadowColor:n,bg:r,style:o}=e,s={...o,position:"absolute"};return t&&(s["--popper-arrow-size"]=t),n&&(s["--popper-arrow-shadow-color"]=n),r&&(s["--popper-arrow-bg"]=r),s}function Qb(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=un(n),l=un(t),[i,c]=d.useState(e.defaultIsOpen||!1),p=r!==void 0?r:i,m=r!==void 0,h=d.useId(),g=o??`disclosure-${h}`,x=d.useCallback(()=>{m||c(!1),l==null||l()},[m,l]),y=d.useCallback(()=>{m||c(!0),s==null||s()},[m,s]),b=d.useCallback(()=>{p?x():y()},[p,y,x]);function C(_={}){return{..._,"aria-expanded":p,"aria-controls":g,onClick(j){var E;(E=_.onClick)==null||E.call(_,j),b()}}}function S(_={}){return{..._,hidden:!p,id:g}}return{isOpen:p,onOpen:y,onClose:x,onToggle:b,isControlled:m,getButtonProps:C,getDisclosureProps:S}}function iH(e){const{ref:t,handler:n,enabled:r=!0}=e,o=un(n),l=d.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;d.useEffect(()=>{if(!r)return;const i=h=>{vv(h,t)&&(l.isPointerDown=!0)},c=h=>{if(l.ignoreEmulatedMouseEvents){l.ignoreEmulatedMouseEvents=!1;return}l.isPointerDown&&n&&vv(h,t)&&(l.isPointerDown=!1,o(h))},p=h=>{l.ignoreEmulatedMouseEvents=!0,n&&l.isPointerDown&&vv(h,t)&&(l.isPointerDown=!1,o(h))},m=D3(t.current);return m.addEventListener("mousedown",i,!0),m.addEventListener("mouseup",c,!0),m.addEventListener("touchstart",i,!0),m.addEventListener("touchend",p,!0),()=>{m.removeEventListener("mousedown",i,!0),m.removeEventListener("mouseup",c,!0),m.removeEventListener("touchstart",i,!0),m.removeEventListener("touchend",p,!0)}},[n,t,o,l,r])}function vv(e,t){var n;const r=e.target;return r&&!D3(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function D3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function A3(e){const{isOpen:t,ref:n}=e,[r,o]=d.useState(t),[s,l]=d.useState(!1);return d.useEffect(()=>{s||(o(t),l(!0))},[t,s,r]),Tl(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var c;const p=fF(n.current),m=new p.CustomEvent("animationend",{bubbles:!0});(c=n.current)==null||c.dispatchEvent(m)}}}function Yb(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[cH,uH,dH,fH]=bb(),[pH,Ld]=Wt({strict:!1,name:"MenuContext"});function mH(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function T3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function RS(e){return T3(e).activeElement===e}function hH(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:l,isOpen:i,defaultIsOpen:c,onClose:p,onOpen:m,placement:h="bottom-start",lazyBehavior:g="unmount",direction:x,computePositionOnMount:y=!1,...b}=e,C=d.useRef(null),S=d.useRef(null),_=dH(),j=d.useCallback(()=>{requestAnimationFrame(()=>{var le;(le=C.current)==null||le.focus({preventScroll:!1})})},[]),E=d.useCallback(()=>{const le=setTimeout(()=>{var oe;if(o)(oe=o.current)==null||oe.focus();else{const q=_.firstEnabled();q&&z(q.index)}});U.current.add(le)},[_,o]),I=d.useCallback(()=>{const le=setTimeout(()=>{const oe=_.lastEnabled();oe&&z(oe.index)});U.current.add(le)},[_]),M=d.useCallback(()=>{m==null||m(),s?E():j()},[s,E,j,m]),{isOpen:R,onOpen:D,onClose:A,onToggle:O}=Qb({isOpen:i,defaultIsOpen:c,onClose:p,onOpen:M});iH({enabled:R&&r,ref:C,handler:le=>{var oe;(oe=S.current)!=null&&oe.contains(le.target)||A()}});const $=Xb({...b,enabled:R||y,placement:h,direction:x}),[X,z]=d.useState(-1);pa(()=>{R||z(-1)},[R]),S3(C,{focusRef:S,visible:R,shouldFocus:!0});const V=A3({isOpen:R,ref:C}),[Q,G]=mH(t,"menu-button","menu-list"),F=d.useCallback(()=>{D(),j()},[D,j]),U=d.useRef(new Set([]));wH(()=>{U.current.forEach(le=>clearTimeout(le)),U.current.clear()});const T=d.useCallback(()=>{D(),E()},[E,D]),B=d.useCallback(()=>{D(),I()},[D,I]),Y=d.useCallback(()=>{var le,oe;const q=T3(C.current),K=(le=C.current)==null?void 0:le.contains(q.activeElement);if(!(R&&!K))return;const ce=(oe=_.item(X))==null?void 0:oe.node;ce==null||ce.focus()},[R,X,_]),re=d.useRef(null);return{openAndFocusMenu:F,openAndFocusFirstItem:T,openAndFocusLastItem:B,onTransitionEnd:Y,unstable__animationState:V,descendants:_,popper:$,buttonId:Q,menuId:G,forceUpdate:$.forceUpdate,orientation:"vertical",isOpen:R,onToggle:O,onOpen:D,onClose:A,menuRef:C,buttonRef:S,focusedIndex:X,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:z,isLazy:l,lazyBehavior:g,initialFocusRef:o,rafId:re}}function gH(e={},t=null){const n=Ld(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:l}=n,i=d.useCallback(c=>{const p=c.key,h={Enter:s,ArrowDown:s,ArrowUp:l}[p];h&&(c.preventDefault(),c.stopPropagation(),h(c))},[s,l]);return{...e,ref:Pt(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":dt(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:Fe(e.onClick,r),onKeyDown:Fe(e.onKeyDown,i)}}function B1(e){var t;return yH(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function vH(e={},t=null){const n=Ld();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:l,onClose:i,menuId:c,isLazy:p,lazyBehavior:m,unstable__animationState:h}=n,g=uH(),x=TF({preventDefault:S=>S.key!==" "&&B1(S.target)}),y=d.useCallback(S=>{if(!S.currentTarget.contains(S.target))return;const _=S.key,E={Tab:M=>M.preventDefault(),Escape:i,ArrowDown:()=>{const M=g.nextEnabled(r);M&&o(M.index)},ArrowUp:()=>{const M=g.prevEnabled(r);M&&o(M.index)}}[_];if(E){S.preventDefault(),E(S);return}const I=x(M=>{const R=$F(g.values(),M,D=>{var A,O;return(O=(A=D==null?void 0:D.node)==null?void 0:A.textContent)!=null?O:""},g.item(r));if(R){const D=g.indexOf(R.node);o(D)}});B1(S.target)&&I(S)},[g,r,x,i,o]),b=d.useRef(!1);l&&(b.current=!0);const C=Yb({wasSelected:b.current,enabled:p,mode:m,isSelected:h.present});return{...e,ref:Pt(s,t),children:C?e.children:null,tabIndex:-1,role:"menu",id:c,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:Fe(e.onKeyDown,y)}}function xH(e={}){const{popper:t,isOpen:n}=Ld();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function bH(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:l,isDisabled:i,isFocusable:c,closeOnSelect:p,type:m,...h}=e,g=Ld(),{setFocusedIndex:x,focusedIndex:y,closeOnSelect:b,onClose:C,menuRef:S,isOpen:_,menuId:j,rafId:E}=g,I=d.useRef(null),M=`${j}-menuitem-${d.useId()}`,{index:R,register:D}=fH({disabled:i&&!c}),A=d.useCallback(F=>{n==null||n(F),!i&&x(R)},[x,R,i,n]),O=d.useCallback(F=>{r==null||r(F),I.current&&!RS(I.current)&&A(F)},[A,r]),$=d.useCallback(F=>{o==null||o(F),!i&&x(-1)},[x,i,o]),X=d.useCallback(F=>{s==null||s(F),B1(F.currentTarget)&&(p??b)&&C()},[C,s,b,p]),z=d.useCallback(F=>{l==null||l(F),x(R)},[x,l,R]),V=R===y,Q=i&&!c;pa(()=>{_&&(V&&!Q&&I.current?(E.current&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame(()=>{var F;(F=I.current)==null||F.focus(),E.current=null})):S.current&&!RS(S.current)&&S.current.focus({preventScroll:!0}))},[V,Q,S,_]);const G=w3({onClick:X,onFocus:z,onMouseEnter:A,onMouseMove:O,onMouseLeave:$,ref:Pt(D,I,t),isDisabled:i,isFocusable:c});return{...h,...G,type:m??G.type,id:M,role:"menuitem",tabIndex:V?0:-1}}function yH(e){var t;if(!CH(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function CH(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function wH(e,t=[]){return d.useEffect(()=>()=>e(),t)}var[SH,Fc]=Wt({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),zh=e=>{const{children:t}=e,n=Gn("Menu",e),r=on(e),{direction:o}=Sd(),{descendants:s,...l}=hH({...r,direction:o}),i=d.useMemo(()=>l,[l]),{isOpen:c,onClose:p,forceUpdate:m}=i;return a.jsx(cH,{value:s,children:a.jsx(pH,{value:i,children:a.jsx(SH,{value:n,children:Ux(t,{isOpen:c,onClose:p,forceUpdate:m})})})})};zh.displayName="Menu";var $3=_e((e,t)=>{const n=Fc();return a.jsx(Se.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});$3.displayName="MenuCommand";var kH=_e((e,t)=>{const{type:n,...r}=e,o=Fc(),s=r.as||n?n??void 0:"button",l=d.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(Se.button,{ref:t,type:s,...r,__css:l})}),N3=e=>{const{className:t,children:n,...r}=e,o=Fc(),s=d.Children.only(n),l=d.isValidElement(s)?d.cloneElement(s,{focusable:"false","aria-hidden":!0,className:et("chakra-menu__icon",s.props.className)}):null,i=et("chakra-menu__icon-wrapper",t);return a.jsx(Se.span,{className:i,...r,__css:o.icon,children:l})};N3.displayName="MenuIcon";var Kt=_e((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:l,...i}=e,c=bH(i,t),m=n||o?a.jsx("span",{style:{pointerEvents:"none",flex:1},children:l}):l;return a.jsxs(kH,{...c,className:et("chakra-menu__menuitem",c.className),children:[n&&a.jsx(N3,{fontSize:"0.8em",marginEnd:r,children:n}),m,o&&a.jsx($3,{marginStart:s,children:o})]})});Kt.displayName="MenuItem";var _H={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"}}},jH=Se(jn.div),Gl=_e(function(t,n){var r,o;const{rootProps:s,motionProps:l,...i}=t,{isOpen:c,onTransitionEnd:p,unstable__animationState:m}=Ld(),h=vH(i,n),g=xH(s),x=Fc();return a.jsx(Se.div,{...g,__css:{zIndex:(o=t.zIndex)!=null?o:(r=x.list)==null?void 0:r.zIndex},children:a.jsx(jH,{variants:_H,initial:!1,animate:c?"enter":"exit",__css:{outline:0,...x.list},...l,className:et("chakra-menu__menu-list",h.className),...h,onUpdate:p,onAnimationComplete:yh(m.onComplete,h.onAnimationComplete)})})});Gl.displayName="MenuList";var ad=_e((e,t)=>{const{title:n,children:r,className:o,...s}=e,l=et("chakra-menu__group__title",o),i=Fc();return a.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&a.jsx(Se.p,{className:l,...s,__css:i.groupTitle,children:n}),r]})});ad.displayName="MenuGroup";var IH=_e((e,t)=>{const n=Fc();return a.jsx(Se.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Fh=_e((e,t)=>{const{children:n,as:r,...o}=e,s=gH(o,t),l=r||IH;return a.jsx(l,{...s,className:et("chakra-menu__menu-button",e.className),children:a.jsx(Se.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Fh.displayName="MenuButton";var PH={slideInBottom:{...j1,custom:{offsetY:16,reverse:!0}},slideInRight:{...j1,custom:{offsetX:16,reverse:!0}},scale:{...m5,custom:{initialScale:.95,reverse:!0}},none:{}},EH=Se(jn.section),MH=e=>PH[e||"none"],L3=d.forwardRef((e,t)=>{const{preset:n,motionProps:r=MH(n),...o}=e;return a.jsx(EH,{ref:t,...r,...o})});L3.displayName="ModalTransition";var OH=Object.defineProperty,RH=(e,t,n)=>t in e?OH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DH=(e,t,n)=>(RH(e,typeof t!="symbol"?t+"":t,n),n),AH=class{constructor(){DH(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}},H1=new AH;function z3(e,t){const[n,r]=d.useState(0);return d.useEffect(()=>{const o=e.current;if(o){if(t){const s=H1.add(o);r(s)}return()=>{H1.remove(o),r(0)}}},[t,e]),n}var TH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ai=new WeakMap,rp=new WeakMap,op={},xv=0,F3=function(e){return e&&(e.host||F3(e.parentNode))},$H=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=F3(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})},NH=function(e,t,n,r){var o=$H(t,Array.isArray(e)?e:[e]);op[n]||(op[n]=new WeakMap);var s=op[n],l=[],i=new Set,c=new Set(o),p=function(h){!h||i.has(h)||(i.add(h),p(h.parentNode))};o.forEach(p);var m=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(g){if(i.has(g))m(g);else{var x=g.getAttribute(r),y=x!==null&&x!=="false",b=(Ai.get(g)||0)+1,C=(s.get(g)||0)+1;Ai.set(g,b),s.set(g,C),l.push(g),b===1&&y&&rp.set(g,!0),C===1&&g.setAttribute(n,"true"),y||g.setAttribute(r,"true")}})};return m(t),i.clear(),xv++,function(){l.forEach(function(h){var g=Ai.get(h)-1,x=s.get(h)-1;Ai.set(h,g),s.set(h,x),g||(rp.has(h)||h.removeAttribute(r),rp.delete(h)),x||h.removeAttribute(n)}),xv--,xv||(Ai=new WeakMap,Ai=new WeakMap,rp=new WeakMap,op={})}},LH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||TH(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),NH(r,o,n,"aria-hidden")):function(){return null}};function zH(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:l=!0,onOverlayClick:i,onEsc:c}=e,p=d.useRef(null),m=d.useRef(null),[h,g,x]=BH(r,"chakra-modal","chakra-modal--header","chakra-modal--body");FH(p,t&&l);const y=z3(p,t),b=d.useRef(null),C=d.useCallback(A=>{b.current=A.target},[]),S=d.useCallback(A=>{A.key==="Escape"&&(A.stopPropagation(),s&&(n==null||n()),c==null||c())},[s,n,c]),[_,j]=d.useState(!1),[E,I]=d.useState(!1),M=d.useCallback((A={},O=null)=>({role:"dialog",...A,ref:Pt(O,p),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":_?g:void 0,"aria-describedby":E?x:void 0,onClick:Fe(A.onClick,$=>$.stopPropagation())}),[x,E,h,g,_]),R=d.useCallback(A=>{A.stopPropagation(),b.current===A.target&&H1.isTopModal(p.current)&&(o&&(n==null||n()),i==null||i())},[n,o,i]),D=d.useCallback((A={},O=null)=>({...A,ref:Pt(O,m),onClick:Fe(A.onClick,R),onKeyDown:Fe(A.onKeyDown,S),onMouseDown:Fe(A.onMouseDown,C)}),[S,C,R]);return{isOpen:t,onClose:n,headerId:g,bodyId:x,setBodyMounted:I,setHeaderMounted:j,dialogRef:p,overlayRef:m,getDialogProps:M,getDialogContainerProps:D,index:y}}function FH(e,t){const n=e.current;d.useEffect(()=>{if(!(!e.current||!t))return LH(e.current)},[t,e,n])}function BH(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[HH,Bc]=Wt({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[VH,Kl]=Wt({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),ql=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:l,finalFocusRef:i,returnFocusOnClose:c,blockScrollOnMount:p,allowPinchZoom:m,preserveScrollBarGap:h,motionPreset:g,lockFocusAcrossFrames:x,onCloseComplete:y}=t,b=Gn("Modal",t),S={...zH(t),autoFocus:o,trapFocus:s,initialFocusRef:l,finalFocusRef:i,returnFocusOnClose:c,blockScrollOnMount:p,allowPinchZoom:m,preserveScrollBarGap:h,motionPreset:g,lockFocusAcrossFrames:x};return a.jsx(VH,{value:S,children:a.jsx(HH,{value:b,children:a.jsx(fr,{onExitComplete:y,children:S.isOpen&&a.jsx($c,{...n,children:r})})})})};ql.displayName="Modal";var Fp="right-scroll-bar-position",Bp="width-before-scroll-bar",WH="with-scroll-bars-hidden",UH="--removed-body-scroll-bar-size",B3=N5(),bv=function(){},Bh=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:bv,onWheelCapture:bv,onTouchMoveCapture:bv}),o=r[0],s=r[1],l=e.forwardProps,i=e.children,c=e.className,p=e.removeScrollBar,m=e.enabled,h=e.shards,g=e.sideCar,x=e.noIsolation,y=e.inert,b=e.allowPinchZoom,C=e.as,S=C===void 0?"div":C,_=e.gapMode,j=A5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,I=D5([n,t]),M=vs(vs({},j),o);return d.createElement(d.Fragment,null,m&&d.createElement(E,{sideCar:B3,removeScrollBar:p,shards:h,noIsolation:x,inert:y,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:_}),l?d.cloneElement(d.Children.only(i),vs(vs({},M),{ref:I})):d.createElement(S,vs({},M,{className:c,ref:I}),i))});Bh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bh.classNames={fullWidth:Bp,zeroRight:Fp};var DS,GH=function(){if(DS)return DS;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function KH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=GH();return t&&e.setAttribute("nonce",t),e}function qH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function XH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var QH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=KH())&&(qH(t,n),XH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},YH=function(){var e=QH();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},H3=function(){var e=YH(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ZH={left:0,top:0,right:0,gap:0},yv=function(e){return parseInt(e||"",10)||0},JH=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[yv(n),yv(r),yv(o)]},eV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ZH;var t=JH(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])}},tV=H3(),nV=function(e,t,n,r){var o=e.left,s=e.top,l=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(WH,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(i,"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(l,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(i,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Fp,` {
|
||
right: `).concat(i,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Bp,` {
|
||
margin-right: `).concat(i,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Fp," .").concat(Fp,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(Bp," .").concat(Bp,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body {
|
||
`).concat(UH,": ").concat(i,`px;
|
||
}
|
||
`)},rV=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=d.useMemo(function(){return eV(o)},[o]);return d.createElement(tV,{styles:nV(s,!t,o,n?"":"!important")})},V1=!1;if(typeof window<"u")try{var sp=Object.defineProperty({},"passive",{get:function(){return V1=!0,!0}});window.addEventListener("test",sp,sp),window.removeEventListener("test",sp,sp)}catch{V1=!1}var Ti=V1?{passive:!1}:!1,oV=function(e){return e.tagName==="TEXTAREA"},V3=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!oV(e)&&n[t]==="visible")},sV=function(e){return V3(e,"overflowY")},aV=function(e){return V3(e,"overflowX")},AS=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=W3(e,r);if(o){var s=U3(e,r),l=s[1],i=s[2];if(l>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},iV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},W3=function(e,t){return e==="v"?sV(t):aV(t)},U3=function(e,t){return e==="v"?lV(t):iV(t)},cV=function(e,t){return e==="h"&&t==="rtl"?-1:1},uV=function(e,t,n,r,o){var s=cV(e,window.getComputedStyle(t).direction),l=s*r,i=n.target,c=t.contains(i),p=!1,m=l>0,h=0,g=0;do{var x=U3(e,i),y=x[0],b=x[1],C=x[2],S=b-C-s*y;(y||S)&&W3(e,i)&&(h+=S,g+=y),i=i.parentNode}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(m&&(o&&h===0||!o&&l>h)||!m&&(o&&g===0||!o&&-l>g))&&(p=!0),p},ap=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},TS=function(e){return[e.deltaX,e.deltaY]},$S=function(e){return e&&"current"in e?e.current:e},dV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fV=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},pV=0,$i=[];function mV(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(pV++)[0],s=d.useState(H3)[0],l=d.useRef(e);d.useEffect(function(){l.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=A1([e.lockRef.current],(e.shards||[]).map($S),!0).filter(Boolean);return b.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=d.useCallback(function(b,C){if("touches"in b&&b.touches.length===2)return!l.current.allowPinchZoom;var S=ap(b),_=n.current,j="deltaX"in b?b.deltaX:_[0]-S[0],E="deltaY"in b?b.deltaY:_[1]-S[1],I,M=b.target,R=Math.abs(j)>Math.abs(E)?"h":"v";if("touches"in b&&R==="h"&&M.type==="range")return!1;var D=AS(R,M);if(!D)return!0;if(D?I=R:(I=R==="v"?"h":"v",D=AS(R,M)),!D)return!1;if(!r.current&&"changedTouches"in b&&(j||E)&&(r.current=I),!I)return!0;var A=r.current||I;return uV(A,C,b,A==="h"?j:E,!0)},[]),c=d.useCallback(function(b){var C=b;if(!(!$i.length||$i[$i.length-1]!==s)){var S="deltaY"in C?TS(C):ap(C),_=t.current.filter(function(I){return I.name===C.type&&I.target===C.target&&dV(I.delta,S)})[0];if(_&&_.should){C.cancelable&&C.preventDefault();return}if(!_){var j=(l.current.shards||[]).map($S).filter(Boolean).filter(function(I){return I.contains(C.target)}),E=j.length>0?i(C,j[0]):!l.current.noIsolation;E&&C.cancelable&&C.preventDefault()}}},[]),p=d.useCallback(function(b,C,S,_){var j={name:b,delta:C,target:S,should:_};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(E){return E!==j})},1)},[]),m=d.useCallback(function(b){n.current=ap(b),r.current=void 0},[]),h=d.useCallback(function(b){p(b.type,TS(b),b.target,i(b,e.lockRef.current))},[]),g=d.useCallback(function(b){p(b.type,ap(b),b.target,i(b,e.lockRef.current))},[]);d.useEffect(function(){return $i.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",c,Ti),document.addEventListener("touchmove",c,Ti),document.addEventListener("touchstart",m,Ti),function(){$i=$i.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,Ti),document.removeEventListener("touchmove",c,Ti),document.removeEventListener("touchstart",m,Ti)}},[]);var x=e.removeScrollBar,y=e.inert;return d.createElement(d.Fragment,null,y?d.createElement(s,{styles:fV(o)}):null,x?d.createElement(rV,{gapMode:e.gapMode}):null)}const hV=hz(B3,mV);var G3=d.forwardRef(function(e,t){return d.createElement(Bh,vs({},e,{ref:t,sideCar:hV}))});G3.classNames=Bh.classNames;const gV=G3;function vV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:l,finalFocusRef:i,returnFocusOnClose:c,preserveScrollBarGap:p,lockFocusAcrossFrames:m,isOpen:h}=Kl(),[g,x]=ZR();d.useEffect(()=>{!g&&x&&setTimeout(x)},[g,x]);const y=z3(r,h);return a.jsx(m3,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:i,restoreFocus:c,contentRef:r,lockFocusAcrossFrames:m,children:a.jsx(gV,{removeScrollBar:!p,allowPinchZoom:l,enabled:y===1&&s,forwardProps:!0,children:e.children})})}var Xl=_e((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...l}=e,{getDialogProps:i,getDialogContainerProps:c}=Kl(),p=i(l,t),m=c(o),h=et("chakra-modal__content",n),g=Bc(),x={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...g.dialog},y={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...g.dialogContainer},{motionPreset:b}=Kl();return a.jsx(vV,{children:a.jsx(Se.div,{...m,className:"chakra-modal__content-container",tabIndex:-1,__css:y,children:a.jsx(L3,{preset:b,motionProps:s,className:h,...p,__css:x,children:r})})})});Xl.displayName="ModalContent";function zd(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(ql,{...n,initialFocusRef:t})}var Fd=_e((e,t)=>a.jsx(Xl,{ref:t,role:"alertdialog",...e})),ks=_e((e,t)=>{const{className:n,...r}=e,o=et("chakra-modal__footer",n),l={display:"flex",alignItems:"center",justifyContent:"flex-end",...Bc().footer};return a.jsx(Se.footer,{ref:t,...r,__css:l,className:o})});ks.displayName="ModalFooter";var Yo=_e((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Kl();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const l=et("chakra-modal__header",n),c={flex:0,...Bc().header};return a.jsx(Se.header,{ref:t,className:l,id:o,...r,__css:c})});Yo.displayName="ModalHeader";var xV=Se(jn.div),Zo=_e((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,l=et("chakra-modal__overlay",n),c={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Bc().overlay},{motionPreset:p}=Kl(),h=o||(p==="none"?{}:p5);return a.jsx(xV,{...h,__css:c,ref:t,className:l,...s})});Zo.displayName="ModalOverlay";var Jo=_e((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Kl();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const l=et("chakra-modal__body",n),i=Bc();return a.jsx(Se.div,{ref:t,className:l,id:o,...r,__css:i.body})});Jo.displayName="ModalBody";var Bd=_e((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Kl(),l=et("chakra-modal__close-btn",r),i=Bc();return a.jsx(oI,{ref:t,__css:i.closeButton,className:l,onClick:Fe(n,c=>{c.stopPropagation(),s()}),...o})});Bd.displayName="ModalCloseButton";var bV=e=>a.jsx(Tn,{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})}),yV=e=>a.jsx(Tn,{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"})});function NS(e,t,n,r){d.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,l=Array.isArray(t)?t:[t],i=new s.MutationObserver(c=>{for(const p of c)p.type==="attributes"&&p.attributeName&&l.includes(p.attributeName)&&n(p)});return i.observe(e.current,{attributes:!0,attributeFilter:l}),()=>i.disconnect()})}function CV(e,t){const n=un(e);d.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var wV=50,LS=300;function SV(e,t){const[n,r]=d.useState(!1),[o,s]=d.useState(null),[l,i]=d.useState(!0),c=d.useRef(null),p=()=>clearTimeout(c.current);CV(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?wV:null);const m=d.useCallback(()=>{l&&e(),c.current=setTimeout(()=>{i(!1),r(!0),s("increment")},LS)},[e,l]),h=d.useCallback(()=>{l&&t(),c.current=setTimeout(()=>{i(!1),r(!0),s("decrement")},LS)},[t,l]),g=d.useCallback(()=>{i(!0),r(!1),p()},[]);return d.useEffect(()=>()=>p(),[]),{up:m,down:h,stop:g,isSpinning:n}}var kV=/^[Ee0-9+\-.]$/;function _V(e){return kV.test(e)}function jV(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function IV(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:o=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:l=1,isReadOnly:i,isDisabled:c,isRequired:p,isInvalid:m,pattern:h="[0-9]*(.[0-9]+)?",inputMode:g="decimal",allowMouseWheel:x,id:y,onChange:b,precision:C,name:S,"aria-describedby":_,"aria-label":j,"aria-labelledby":E,onFocus:I,onBlur:M,onInvalid:R,getAriaValueText:D,isValidCharacter:A,format:O,parse:$,...X}=e,z=un(I),V=un(M),Q=un(R),G=un(A??_V),F=un(D),U=XL(e),{update:T,increment:B,decrement:Y}=U,[re,le]=d.useState(!1),oe=!(i||c),q=d.useRef(null),K=d.useRef(null),ee=d.useRef(null),ce=d.useRef(null),J=d.useCallback(ye=>ye.split("").filter(G).join(""),[G]),ie=d.useCallback(ye=>{var tt;return(tt=$==null?void 0:$(ye))!=null?tt:ye},[$]),de=d.useCallback(ye=>{var tt;return((tt=O==null?void 0:O(ye))!=null?tt:ye).toString()},[O]);pa(()=>{(U.valueAsNumber>s||U.valueAsNumber<o)&&(Q==null||Q("rangeOverflow",de(U.value),U.valueAsNumber))},[U.valueAsNumber,U.value,de,Q]),oc(()=>{if(!q.current)return;if(q.current.value!=U.value){const tt=ie(q.current.value);U.setValue(J(tt))}},[ie,J]);const xe=d.useCallback((ye=l)=>{oe&&B(ye)},[B,oe,l]),we=d.useCallback((ye=l)=>{oe&&Y(ye)},[Y,oe,l]),ve=SV(xe,we);NS(ee,"disabled",ve.stop,ve.isSpinning),NS(ce,"disabled",ve.stop,ve.isSpinning);const fe=d.useCallback(ye=>{if(ye.nativeEvent.isComposing)return;const ct=ie(ye.currentTarget.value);T(J(ct)),K.current={start:ye.currentTarget.selectionStart,end:ye.currentTarget.selectionEnd}},[T,J,ie]),Oe=d.useCallback(ye=>{var tt,ct,ft;z==null||z(ye),K.current&&(ye.target.selectionStart=(ct=K.current.start)!=null?ct:(tt=ye.currentTarget.value)==null?void 0:tt.length,ye.currentTarget.selectionEnd=(ft=K.current.end)!=null?ft:ye.currentTarget.selectionStart)},[z]),je=d.useCallback(ye=>{if(ye.nativeEvent.isComposing)return;jV(ye,G)||ye.preventDefault();const tt=$e(ye)*l,ct=ye.key,Me={ArrowUp:()=>xe(tt),ArrowDown:()=>we(tt),Home:()=>T(o),End:()=>T(s)}[ct];Me&&(ye.preventDefault(),Me(ye))},[G,l,xe,we,T,o,s]),$e=ye=>{let tt=1;return(ye.metaKey||ye.ctrlKey)&&(tt=.1),ye.shiftKey&&(tt=10),tt},st=d.useMemo(()=>{const ye=F==null?void 0:F(U.value);if(ye!=null)return ye;const tt=U.value.toString();return tt||void 0},[U.value,F]),Ve=d.useCallback(()=>{let ye=U.value;if(U.value==="")return;/^[eE]/.test(U.value.toString())?U.setValue(""):(U.valueAsNumber<o&&(ye=o),U.valueAsNumber>s&&(ye=s),U.cast(ye))},[U,s,o]),Ct=d.useCallback(()=>{le(!1),n&&Ve()},[n,le,Ve]),Ye=d.useCallback(()=>{t&&requestAnimationFrame(()=>{var ye;(ye=q.current)==null||ye.focus()})},[t]),Ke=d.useCallback(ye=>{ye.preventDefault(),ve.up(),Ye()},[Ye,ve]),ge=d.useCallback(ye=>{ye.preventDefault(),ve.down(),Ye()},[Ye,ve]);Tl(()=>q.current,"wheel",ye=>{var tt,ct;const Me=((ct=(tt=q.current)==null?void 0:tt.ownerDocument)!=null?ct:document).activeElement===q.current;if(!x||!Me)return;ye.preventDefault();const Ne=$e(ye)*l,Ut=Math.sign(ye.deltaY);Ut===-1?xe(Ne):Ut===1&&we(Ne)},{passive:!1});const De=d.useCallback((ye={},tt=null)=>{const ct=c||r&&U.isAtMax;return{...ye,ref:Pt(tt,ee),role:"button",tabIndex:-1,onPointerDown:Fe(ye.onPointerDown,ft=>{ft.button!==0||ct||Ke(ft)}),onPointerLeave:Fe(ye.onPointerLeave,ve.stop),onPointerUp:Fe(ye.onPointerUp,ve.stop),disabled:ct,"aria-disabled":yo(ct)}},[U.isAtMax,r,Ke,ve.stop,c]),ut=d.useCallback((ye={},tt=null)=>{const ct=c||r&&U.isAtMin;return{...ye,ref:Pt(tt,ce),role:"button",tabIndex:-1,onPointerDown:Fe(ye.onPointerDown,ft=>{ft.button!==0||ct||ge(ft)}),onPointerLeave:Fe(ye.onPointerLeave,ve.stop),onPointerUp:Fe(ye.onPointerUp,ve.stop),disabled:ct,"aria-disabled":yo(ct)}},[U.isAtMin,r,ge,ve.stop,c]),yt=d.useCallback((ye={},tt=null)=>{var ct,ft,Me,Ne;return{name:S,inputMode:g,type:"text",pattern:h,"aria-labelledby":E,"aria-label":j,"aria-describedby":_,id:y,disabled:c,...ye,readOnly:(ct=ye.readOnly)!=null?ct:i,"aria-readonly":(ft=ye.readOnly)!=null?ft:i,"aria-required":(Me=ye.required)!=null?Me:p,required:(Ne=ye.required)!=null?Ne:p,ref:Pt(q,tt),value:de(U.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(U.valueAsNumber)?void 0:U.valueAsNumber,"aria-invalid":yo(m??U.isOutOfRange),"aria-valuetext":st,autoComplete:"off",autoCorrect:"off",onChange:Fe(ye.onChange,fe),onKeyDown:Fe(ye.onKeyDown,je),onFocus:Fe(ye.onFocus,Oe,()=>le(!0)),onBlur:Fe(ye.onBlur,V,Ct)}},[S,g,h,E,j,de,_,y,c,p,i,m,U.value,U.valueAsNumber,U.isOutOfRange,o,s,st,fe,je,Oe,V,Ct]);return{value:de(U.value),valueAsNumber:U.valueAsNumber,isFocused:re,isDisabled:c,isReadOnly:i,getIncrementButtonProps:De,getDecrementButtonProps:ut,getInputProps:yt,htmlProps:X}}var[PV,Hh]=Wt({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[EV,Zb]=Wt({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Vh=_e(function(t,n){const r=Gn("NumberInput",t),o=on(t),s=Sb(o),{htmlProps:l,...i}=IV(s),c=d.useMemo(()=>i,[i]);return a.jsx(EV,{value:c,children:a.jsx(PV,{value:r,children:a.jsx(Se.div,{...l,ref:n,className:et("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Vh.displayName="NumberInput";var Wh=_e(function(t,n){const r=Hh();return a.jsx(Se.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});Wh.displayName="NumberInputStepper";var Uh=_e(function(t,n){const{getInputProps:r}=Zb(),o=r(t,n),s=Hh();return a.jsx(Se.input,{...o,className:et("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Uh.displayName="NumberInputField";var K3=Se("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Gh=_e(function(t,n){var r;const o=Hh(),{getDecrementButtonProps:s}=Zb(),l=s(t,n);return a.jsx(K3,{...l,__css:o.stepper,children:(r=t.children)!=null?r:a.jsx(bV,{})})});Gh.displayName="NumberDecrementStepper";var Kh=_e(function(t,n){var r;const{getIncrementButtonProps:o}=Zb(),s=o(t,n),l=Hh();return a.jsx(K3,{...s,__css:l.stepper,children:(r=t.children)!=null?r:a.jsx(yV,{})})});Kh.displayName="NumberIncrementStepper";var[MV,ni]=Wt({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[OV,qh]=Wt({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Xh(e){const t=d.Children.only(e.children),{getTriggerProps:n}=ni();return d.cloneElement(t,n(t.props,t.ref))}Xh.displayName="PopoverTrigger";var Ni={click:"click",hover:"hover"};function RV(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:l=!0,arrowSize:i,arrowShadowColor:c,trigger:p=Ni.click,openDelay:m=200,closeDelay:h=200,isLazy:g,lazyBehavior:x="unmount",computePositionOnMount:y,...b}=e,{isOpen:C,onClose:S,onOpen:_,onToggle:j}=Qb(e),E=d.useRef(null),I=d.useRef(null),M=d.useRef(null),R=d.useRef(!1),D=d.useRef(!1);C&&(D.current=!0);const[A,O]=d.useState(!1),[$,X]=d.useState(!1),z=d.useId(),V=o??z,[Q,G,F,U]=["popover-trigger","popover-content","popover-header","popover-body"].map(fe=>`${fe}-${V}`),{referenceRef:T,getArrowProps:B,getPopperProps:Y,getArrowInnerProps:re,forceUpdate:le}=Xb({...b,enabled:C||!!y}),oe=A3({isOpen:C,ref:M});I5({enabled:C,ref:I}),S3(M,{focusRef:I,visible:C,shouldFocus:s&&p===Ni.click}),FF(M,{focusRef:r,visible:C,shouldFocus:l&&p===Ni.click});const q=Yb({wasSelected:D.current,enabled:g,mode:x,isSelected:oe.present}),K=d.useCallback((fe={},Oe=null)=>{const je={...fe,style:{...fe.style,transformOrigin:$n.transformOrigin.varRef,[$n.arrowSize.var]:i?`${i}px`:void 0,[$n.arrowShadowColor.var]:c},ref:Pt(M,Oe),children:q?fe.children:null,id:G,tabIndex:-1,role:"dialog",onKeyDown:Fe(fe.onKeyDown,$e=>{n&&$e.key==="Escape"&&S()}),onBlur:Fe(fe.onBlur,$e=>{const st=zS($e),Ve=Cv(M.current,st),Ct=Cv(I.current,st);C&&t&&(!Ve&&!Ct)&&S()}),"aria-labelledby":A?F:void 0,"aria-describedby":$?U:void 0};return p===Ni.hover&&(je.role="tooltip",je.onMouseEnter=Fe(fe.onMouseEnter,()=>{R.current=!0}),je.onMouseLeave=Fe(fe.onMouseLeave,$e=>{$e.nativeEvent.relatedTarget!==null&&(R.current=!1,setTimeout(()=>S(),h))})),je},[q,G,A,F,$,U,p,n,S,C,t,h,c,i]),ee=d.useCallback((fe={},Oe=null)=>Y({...fe,style:{visibility:C?"visible":"hidden",...fe.style}},Oe),[C,Y]),ce=d.useCallback((fe,Oe=null)=>({...fe,ref:Pt(Oe,E,T)}),[E,T]),J=d.useRef(),ie=d.useRef(),de=d.useCallback(fe=>{E.current==null&&T(fe)},[T]),xe=d.useCallback((fe={},Oe=null)=>{const je={...fe,ref:Pt(I,Oe,de),id:Q,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":G};return p===Ni.click&&(je.onClick=Fe(fe.onClick,j)),p===Ni.hover&&(je.onFocus=Fe(fe.onFocus,()=>{J.current===void 0&&_()}),je.onBlur=Fe(fe.onBlur,$e=>{const st=zS($e),Ve=!Cv(M.current,st);C&&t&&Ve&&S()}),je.onKeyDown=Fe(fe.onKeyDown,$e=>{$e.key==="Escape"&&S()}),je.onMouseEnter=Fe(fe.onMouseEnter,()=>{R.current=!0,J.current=window.setTimeout(()=>_(),m)}),je.onMouseLeave=Fe(fe.onMouseLeave,()=>{R.current=!1,J.current&&(clearTimeout(J.current),J.current=void 0),ie.current=window.setTimeout(()=>{R.current===!1&&S()},h)})),je},[Q,C,G,p,de,j,_,t,S,m,h]);d.useEffect(()=>()=>{J.current&&clearTimeout(J.current),ie.current&&clearTimeout(ie.current)},[]);const we=d.useCallback((fe={},Oe=null)=>({...fe,id:F,ref:Pt(Oe,je=>{O(!!je)})}),[F]),ve=d.useCallback((fe={},Oe=null)=>({...fe,id:U,ref:Pt(Oe,je=>{X(!!je)})}),[U]);return{forceUpdate:le,isOpen:C,onAnimationComplete:oe.onComplete,onClose:S,getAnchorProps:ce,getArrowProps:B,getArrowInnerProps:re,getPopoverPositionerProps:ee,getPopoverProps:K,getTriggerProps:xe,getHeaderProps:we,getBodyProps:ve}}function Cv(e,t){return e===t||(e==null?void 0:e.contains(t))}function zS(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function Hd(e){const t=Gn("Popover",e),{children:n,...r}=on(e),o=Sd(),s=RV({...r,direction:o.direction});return a.jsx(MV,{value:s,children:a.jsx(OV,{value:t,children:Ux(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}Hd.displayName="Popover";function q3(e){const t=d.Children.only(e.children),{getAnchorProps:n}=ni();return d.cloneElement(t,n(t.props,t.ref))}q3.displayName="PopoverAnchor";var wv=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function X3(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:l,shadowColor:i}=e,{getArrowProps:c,getArrowInnerProps:p}=ni(),m=qh(),h=(t=n??r)!=null?t:o,g=s??l;return a.jsx(Se.div,{...c(),className:"chakra-popover__arrow-positioner",children:a.jsx(Se.div,{className:et("chakra-popover__arrow",e.className),...p(e),__css:{"--popper-arrow-shadow-color":wv("colors",i),"--popper-arrow-bg":wv("colors",h),"--popper-arrow-shadow":wv("shadows",g),...m.arrow}})})}X3.displayName="PopoverArrow";var Qh=_e(function(t,n){const{getBodyProps:r}=ni(),o=qh();return a.jsx(Se.div,{...r(t,n),className:et("chakra-popover__body",t.className),__css:o.body})});Qh.displayName="PopoverBody";var Q3=_e(function(t,n){const{onClose:r}=ni(),o=qh();return a.jsx(oI,{size:"sm",onClick:r,className:et("chakra-popover__close-btn",t.className),__css:o.closeButton,ref:n,...t})});Q3.displayName="PopoverCloseButton";function DV(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var AV={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]}}},TV=Se(jn.section),Y3=_e(function(t,n){const{variants:r=AV,...o}=t,{isOpen:s}=ni();return a.jsx(TV,{ref:n,variants:DV(r),initial:!1,animate:s?"enter":"exit",...o})});Y3.displayName="PopoverTransition";var Vd=_e(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:l,getPopoverPositionerProps:i,onAnimationComplete:c}=ni(),p=qh(),m={position:"relative",display:"flex",flexDirection:"column",...p.content};return a.jsx(Se.div,{...i(r),__css:p.popper,className:"chakra-popover__popper",children:a.jsx(Y3,{...o,...l(s,n),onAnimationComplete:yh(c,s.onAnimationComplete),className:et("chakra-popover__content",t.className),__css:m})})});Vd.displayName="PopoverContent";var W1=e=>a.jsx(Se.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});W1.displayName="Circle";function $V(e,t,n){return(e-t)*100/(n-t)}var NV=ma({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),LV=ma({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),zV=ma({"0%":{left:"-40%"},"100%":{left:"100%"}}),FV=ma({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function Z3(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:l,role:i="progressbar"}=e,c=$V(t,n,r);return{bind:{"data-indeterminate":l?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":l?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,c):o})(),role:i},percent:c,value:t}}var J3=e=>{const{size:t,isIndeterminate:n,...r}=e;return a.jsx(Se.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${LV} 2s linear infinite`:void 0},...r})};J3.displayName="Shape";var U1=_e((e,t)=>{var n;const{size:r="48px",max:o=100,min:s=0,valueText:l,getValueText:i,value:c,capIsRound:p,children:m,thickness:h="10px",color:g="#0078d4",trackColor:x="#edebe9",isIndeterminate:y,...b}=e,C=Z3({min:s,max:o,value:c,valueText:l,getValueText:i,isIndeterminate:y}),S=y?void 0:((n=C.percent)!=null?n:0)*2.64,_=S==null?void 0:`${S} ${264-S}`,j=y?{css:{animation:`${NV} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:_,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},E={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:r};return a.jsxs(Se.div,{ref:t,className:"chakra-progress",...C.bind,...b,__css:E,children:[a.jsxs(J3,{size:r,isIndeterminate:y,children:[a.jsx(W1,{stroke:x,strokeWidth:h,className:"chakra-progress__track"}),a.jsx(W1,{stroke:g,strokeWidth:h,className:"chakra-progress__indicator",strokeLinecap:p?"round":void 0,opacity:C.value===0&&!y?0:void 0,...j})]}),m]})});U1.displayName="CircularProgress";var[BV,HV]=Wt({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),VV=_e((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:l,...i}=e,c=Z3({value:o,min:n,max:r,isIndeterminate:s,role:l}),m={height:"100%",...HV().filledTrack};return a.jsx(Se.div,{ref:t,style:{width:`${c.percent}%`,...i.style},...c.bind,...i,__css:m})}),eP=_e((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:l,isAnimated:i,children:c,borderRadius:p,isIndeterminate:m,"aria-label":h,"aria-labelledby":g,"aria-valuetext":x,title:y,role:b,...C}=on(e),S=Gn("Progress",e),_=p??((n=S.track)==null?void 0:n.borderRadius),j={animation:`${FV} 1s linear infinite`},M={...!m&&l&&i&&j,...m&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${zV} 1s ease infinite normal none running`}},R={overflow:"hidden",position:"relative",...S.track};return a.jsx(Se.div,{ref:t,borderRadius:_,__css:R,...C,children:a.jsxs(BV,{value:S,children:[a.jsx(VV,{"aria-label":h,"aria-labelledby":g,"aria-valuetext":x,min:o,max:s,value:r,isIndeterminate:m,css:M,borderRadius:_,title:y,role:b}),c]})})});eP.displayName="Progress";function WV(e){return e&&f1(e)&&f1(e.target)}function UV(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:l,isNative:i,...c}=e,[p,m]=d.useState(r||""),h=typeof n<"u",g=h?n:p,x=d.useRef(null),y=d.useCallback(()=>{const I=x.current;if(!I)return;let M="input:not(:disabled):checked";const R=I.querySelector(M);if(R){R.focus();return}M="input:not(:disabled)";const D=I.querySelector(M);D==null||D.focus()},[]),C=`radio-${d.useId()}`,S=o||C,_=d.useCallback(I=>{const M=WV(I)?I.target.value:I;h||m(M),t==null||t(String(M))},[t,h]),j=d.useCallback((I={},M=null)=>({...I,ref:Pt(M,x),role:"radiogroup"}),[]),E=d.useCallback((I={},M=null)=>({...I,ref:M,name:S,[i?"checked":"isChecked"]:g!=null?I.value===g:void 0,onChange(D){_(D)},"data-radiogroup":!0}),[i,S,_,g]);return{getRootProps:j,getRadioProps:E,name:S,ref:x,focus:y,setValue:m,value:g,onChange:_,isDisabled:s,isFocusable:l,htmlProps:c}}var[GV,tP]=Wt({name:"RadioGroupContext",strict:!1}),gm=_e((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:l,isDisabled:i,isFocusable:c,...p}=e,{value:m,onChange:h,getRootProps:g,name:x,htmlProps:y}=UV(p),b=d.useMemo(()=>({name:x,size:r,onChange:h,colorScheme:n,value:m,variant:o,isDisabled:i,isFocusable:c}),[x,r,h,n,m,o,i,c]);return a.jsx(GV,{value:b,children:a.jsx(Se.div,{...g(y,t),className:et("chakra-radio-group",l),children:s})})});gm.displayName="RadioGroup";var KV={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function qV(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:l,onChange:i,isInvalid:c,name:p,value:m,id:h,"data-radiogroup":g,"aria-describedby":x,...y}=e,b=`radio-${d.useId()}`,C=Rd(),_=!!tP()||!!g;let E=!!C&&!_?C.id:b;E=h??E;const I=o??(C==null?void 0:C.isDisabled),M=s??(C==null?void 0:C.isReadOnly),R=l??(C==null?void 0:C.isRequired),D=c??(C==null?void 0:C.isInvalid),[A,O]=d.useState(!1),[$,X]=d.useState(!1),[z,V]=d.useState(!1),[Q,G]=d.useState(!1),[F,U]=d.useState(!!t),T=typeof n<"u",B=T?n:F;d.useEffect(()=>y5(O),[]);const Y=d.useCallback(de=>{if(M||I){de.preventDefault();return}T||U(de.target.checked),i==null||i(de)},[T,I,M,i]),re=d.useCallback(de=>{de.key===" "&&G(!0)},[G]),le=d.useCallback(de=>{de.key===" "&&G(!1)},[G]),oe=d.useCallback((de={},xe=null)=>({...de,ref:xe,"data-active":dt(Q),"data-hover":dt(z),"data-disabled":dt(I),"data-invalid":dt(D),"data-checked":dt(B),"data-focus":dt($),"data-focus-visible":dt($&&A),"data-readonly":dt(M),"aria-hidden":!0,onMouseDown:Fe(de.onMouseDown,()=>G(!0)),onMouseUp:Fe(de.onMouseUp,()=>G(!1)),onMouseEnter:Fe(de.onMouseEnter,()=>V(!0)),onMouseLeave:Fe(de.onMouseLeave,()=>V(!1))}),[Q,z,I,D,B,$,M,A]),{onFocus:q,onBlur:K}=C??{},ee=d.useCallback((de={},xe=null)=>{const we=I&&!r;return{...de,id:E,ref:xe,type:"radio",name:p,value:m,onChange:Fe(de.onChange,Y),onBlur:Fe(K,de.onBlur,()=>X(!1)),onFocus:Fe(q,de.onFocus,()=>X(!0)),onKeyDown:Fe(de.onKeyDown,re),onKeyUp:Fe(de.onKeyUp,le),checked:B,disabled:we,readOnly:M,required:R,"aria-invalid":yo(D),"aria-disabled":yo(we),"aria-required":yo(R),"data-readonly":dt(M),"aria-describedby":x,style:KV}},[I,r,E,p,m,Y,K,q,re,le,B,M,R,D,x]);return{state:{isInvalid:D,isFocused:$,isChecked:B,isActive:Q,isHovered:z,isDisabled:I,isReadOnly:M,isRequired:R},getCheckboxProps:oe,getRadioProps:oe,getInputProps:ee,getLabelProps:(de={},xe=null)=>({...de,ref:xe,onMouseDown:Fe(de.onMouseDown,XV),"data-disabled":dt(I),"data-checked":dt(B),"data-invalid":dt(D)}),getRootProps:(de,xe=null)=>({...de,ref:xe,"data-disabled":dt(I),"data-checked":dt(B),"data-invalid":dt(D)}),htmlProps:y}}function XV(e){e.preventDefault(),e.stopPropagation()}function QV(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 qs=_e((e,t)=>{var n;const r=tP(),{onChange:o,value:s}=e,l=Gn("Radio",{...r,...e}),i=on(e),{spacing:c="0.5rem",children:p,isDisabled:m=r==null?void 0:r.isDisabled,isFocusable:h=r==null?void 0:r.isFocusable,inputProps:g,...x}=i;let y=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(y=r.value===s);let b=o;r!=null&&r.onChange&&s!=null&&(b=yh(r.onChange,o));const C=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:S,getCheckboxProps:_,getLabelProps:j,getRootProps:E,htmlProps:I}=qV({...x,isChecked:y,isFocusable:h,isDisabled:m,onChange:b,name:C}),[M,R]=QV(I,sI),D=_(R),A=S(g,t),O=j(),$=Object.assign({},M,E()),X={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...l.container},z={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...l.control},V={userSelect:"none",marginStart:c,...l.label};return a.jsxs(Se.label,{className:"chakra-radio",...$,__css:X,children:[a.jsx("input",{className:"chakra-radio__input",...A}),a.jsx(Se.span,{className:"chakra-radio__control",...D,__css:z}),p&&a.jsx(Se.span,{className:"chakra-radio__label",...O,__css:V,children:p})]})});qs.displayName="Radio";var nP=_e(function(t,n){const{children:r,placeholder:o,className:s,...l}=t;return a.jsxs(Se.select,{...l,ref:n,className:et("chakra-select",s),children:[o&&a.jsx("option",{value:"",children:o}),r]})});nP.displayName="SelectField";function YV(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 rP=_e((e,t)=>{var n;const r=Gn("Select",e),{rootProps:o,placeholder:s,icon:l,color:i,height:c,h:p,minH:m,minHeight:h,iconColor:g,iconSize:x,...y}=on(e),[b,C]=YV(y,sI),S=wb(C),_={width:"100%",height:"fit-content",position:"relative",color:i},j={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return a.jsxs(Se.div,{className:"chakra-select__wrapper",__css:_,...b,...o,children:[a.jsx(nP,{ref:t,height:p??c,minH:m??h,placeholder:s,...S,__css:j,children:e.children}),a.jsx(oP,{"data-disabled":dt(S.disabled),...(g||i)&&{color:g||i},__css:r.icon,...x&&{fontSize:x},children:l})]})});rP.displayName="Select";var ZV=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"})}),JV=Se("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),oP=e=>{const{children:t=a.jsx(ZV,{}),...n}=e,r=d.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return a.jsx(JV,{...n,className:"chakra-select__icon-wrapper",children:d.isValidElement(t)?r:null})};oP.displayName="SelectIcon";function eW(){const e=d.useRef(!0);return d.useEffect(()=>{e.current=!1},[]),e.current}function tW(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}var nW=Se("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),G1=aI("skeleton-start-color"),K1=aI("skeleton-end-color"),rW=ma({from:{opacity:0},to:{opacity:1}}),oW=ma({from:{borderColor:G1.reference,background:G1.reference},to:{borderColor:K1.reference,background:K1.reference}}),Yh=_e((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=al("Skeleton",n),o=eW(),{startColor:s="",endColor:l="",isLoaded:i,fadeDuration:c,speed:p,className:m,fitContent:h,...g}=on(n),[x,y]=Ho("colors",[s,l]),b=tW(i),C=et("chakra-skeleton",m),S={...x&&{[G1.variable]:x},...y&&{[K1.variable]:y}};if(i){const _=o||b?"none":`${rW} ${c}s`;return a.jsx(Se.div,{ref:t,className:C,__css:{animation:_},...g})}return a.jsx(nW,{ref:t,className:C,...g,__css:{width:h?"fit-content":void 0,...r,...S,_dark:{...r._dark,...S},animation:`${p}s linear infinite alternate ${oW}`}})});Yh.displayName="Skeleton";var po=e=>e?"":void 0,dc=e=>e?!0:void 0,cl=(...e)=>e.filter(Boolean).join(" ");function fc(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function sW(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function Nu(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var Hp={width:0,height:0},lp=e=>e||Hp;function sP(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=b=>{var C;const S=(C=r[b])!=null?C:Hp;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Nu({orientation:t,vertical:{bottom:`calc(${n[b]}% - ${S.height/2}px)`},horizontal:{left:`calc(${n[b]}% - ${S.width/2}px)`}})}},l=t==="vertical"?r.reduce((b,C)=>lp(b).height>lp(C).height?b:C,Hp):r.reduce((b,C)=>lp(b).width>lp(C).width?b:C,Hp),i={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Nu({orientation:t,vertical:l?{paddingLeft:l.width/2,paddingRight:l.width/2}:{},horizontal:l?{paddingTop:l.height/2,paddingBottom:l.height/2}:{}})},c={position:"absolute",...Nu({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},p=n.length===1,m=[0,o?100-n[0]:n[0]],h=p?m:n;let g=h[0];!p&&o&&(g=100-g);const x=Math.abs(h[h.length-1]-h[0]),y={...c,...Nu({orientation:t,vertical:o?{height:`${x}%`,top:`${g}%`}:{height:`${x}%`,bottom:`${g}%`},horizontal:o?{width:`${x}%`,right:`${g}%`}:{width:`${x}%`,left:`${g}%`}})};return{trackStyle:c,innerTrackStyle:y,rootStyle:i,getThumbStyle:s}}function aP(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function aW(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function lW(e){const t=cW(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function lP(e){return!!e.touches}function iW(e){return lP(e)&&e.touches.length>1}function cW(e){var t;return(t=e.view)!=null?t:window}function uW(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function dW(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function iP(e,t="page"){return lP(e)?uW(e,t):dW(e,t)}function fW(e){return t=>{const n=lW(t);(!n||n&&t.button===0)&&e(t)}}function pW(e,t=!1){function n(o){e(o,{point:iP(o)})}return t?fW(n):n}function Vp(e,t,n,r){return aW(e,t,pW(n,t==="pointerdown"),r)}var mW=Object.defineProperty,hW=(e,t,n)=>t in e?mW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,No=(e,t,n)=>(hW(e,typeof t!="symbol"?t+"":t,n),n),gW=class{constructor(e,t,n){No(this,"history",[]),No(this,"startEvent",null),No(this,"lastEvent",null),No(this,"lastEventInfo",null),No(this,"handlers",{}),No(this,"removeListeners",()=>{}),No(this,"threshold",3),No(this,"win"),No(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const i=Sv(this.lastEventInfo,this.history),c=this.startEvent!==null,p=yW(i.offset,{x:0,y:0})>=this.threshold;if(!c&&!p)return;const{timestamp:m}=tS();this.history.push({...i.point,timestamp:m});const{onStart:h,onMove:g}=this.handlers;c||(h==null||h(this.lastEvent,i),this.startEvent=this.lastEvent),g==null||g(this.lastEvent,i)}),No(this,"onPointerMove",(i,c)=>{this.lastEvent=i,this.lastEventInfo=c,FN.update(this.updatePoint,!0)}),No(this,"onPointerUp",(i,c)=>{const p=Sv(c,this.history),{onEnd:m,onSessionEnd:h}=this.handlers;h==null||h(i,p),this.end(),!(!m||!this.startEvent)&&(m==null||m(i,p))});var r;if(this.win=(r=e.view)!=null?r:window,iW(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:iP(e)},{timestamp:s}=tS();this.history=[{...o.point,timestamp:s}];const{onSessionStart:l}=t;l==null||l(e,Sv(o,this.history)),this.removeListeners=bW(Vp(this.win,"pointermove",this.onPointerMove),Vp(this.win,"pointerup",this.onPointerUp),Vp(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),BN.update(this.updatePoint)}};function FS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Sv(e,t){return{point:e.point,delta:FS(e.point,t[t.length-1]),offset:FS(e.point,t[0]),velocity:xW(t,.1)}}var vW=e=>e*1e3;function xW(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=e[e.length-1];for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>vW(t)));)n--;if(!r)return{x:0,y:0};const s=(o.timestamp-r.timestamp)/1e3;if(s===0)return{x:0,y:0};const l={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function bW(...e){return t=>e.reduce((n,r)=>r(n),t)}function kv(e,t){return Math.abs(e-t)}function BS(e){return"x"in e&&"y"in e}function yW(e,t){if(typeof e=="number"&&typeof t=="number")return kv(e,t);if(BS(e)&&BS(t)){const n=kv(e.x,t.x),r=kv(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function cP(e){const t=d.useRef(null);return t.current=e,t}function uP(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:l,threshold:i}=t,c=!!(n||r||o||s||l),p=d.useRef(null),m=cP({onSessionStart:s,onSessionEnd:l,onStart:r,onMove:n,onEnd(h,g){p.current=null,o==null||o(h,g)}});d.useEffect(()=>{var h;(h=p.current)==null||h.updateHandlers(m.current)}),d.useEffect(()=>{const h=e.current;if(!h||!c)return;function g(x){p.current=new gW(x,m.current,i)}return Vp(h,"pointerdown",g)},[e,c,m,i]),d.useEffect(()=>()=>{var h;(h=p.current)==null||h.end(),p.current=null},[])}function CW(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[s]=o;let l,i;if("borderBoxSize"in s){const c=s.borderBoxSize,p=Array.isArray(c)?c[0]:c;l=p.inlineSize,i=p.blockSize}else l=e.offsetWidth,i=e.offsetHeight;t({width:l,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var wW=globalThis!=null&&globalThis.document?d.useLayoutEffect:d.useEffect;function SW(e,t){var n,r;if(!e||!e.parentElement)return;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window,s=new o.MutationObserver(()=>{t()});return s.observe(e.parentElement,{childList:!0}),()=>{s.disconnect()}}function dP({getNodes:e,observeMutation:t=!0}){const[n,r]=d.useState([]),[o,s]=d.useState(0);return wW(()=>{const l=e(),i=l.map((c,p)=>CW(c,m=>{r(h=>[...h.slice(0,p),m,...h.slice(p+1)])}));if(t){const c=l[0];i.push(SW(c,()=>{s(p=>p+1)}))}return()=>{i.forEach(c=>{c==null||c()})}},[o]),n}function kW(e){return typeof e=="object"&&e!==null&&"current"in e}function _W(e){const[t]=dP({observeMutation:!1,getNodes(){return[kW(e)?e.current:e]}});return t}function jW(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:l,direction:i="ltr",orientation:c="horizontal",id:p,isDisabled:m,isReadOnly:h,onChangeStart:g,onChangeEnd:x,step:y=1,getAriaValueText:b,"aria-valuetext":C,"aria-label":S,"aria-labelledby":_,name:j,focusThumbOnChange:E=!0,minStepsBetweenThumbs:I=0,...M}=e,R=un(g),D=un(x),A=un(b),O=aP({isReversed:l,direction:i,orientation:c}),[$,X]=Md({value:o,defaultValue:s??[25,75],onChange:r});if(!Array.isArray($))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof $}\``);const[z,V]=d.useState(!1),[Q,G]=d.useState(!1),[F,U]=d.useState(-1),T=!(m||h),B=d.useRef($),Y=$.map(ke=>lc(ke,t,n)),re=I*y,le=IW(Y,t,n,re),oe=d.useRef({eventSource:null,value:[],valueBounds:[]});oe.current.value=Y,oe.current.valueBounds=le;const q=Y.map(ke=>n-ke+t),ee=(O?q:Y).map(ke=>dm(ke,t,n)),ce=c==="vertical",J=d.useRef(null),ie=d.useRef(null),de=dP({getNodes(){const ke=ie.current,ze=ke==null?void 0:ke.querySelectorAll("[role=slider]");return ze?Array.from(ze):[]}}),xe=d.useId(),ve=sW(p??xe),fe=d.useCallback(ke=>{var ze,Le;if(!J.current)return;oe.current.eventSource="pointer";const Ge=J.current.getBoundingClientRect(),{clientX:pt,clientY:Pn}=(Le=(ze=ke.touches)==null?void 0:ze[0])!=null?Le:ke,At=ce?Ge.bottom-Pn:pt-Ge.left,Tt=ce?Ge.height:Ge.width;let mr=At/Tt;return O&&(mr=1-mr),w5(mr,t,n)},[ce,O,n,t]),Oe=(n-t)/10,je=y||(n-t)/100,$e=d.useMemo(()=>({setValueAtIndex(ke,ze){if(!T)return;const Le=oe.current.valueBounds[ke];ze=parseFloat(R1(ze,Le.min,je)),ze=lc(ze,Le.min,Le.max);const Ge=[...oe.current.value];Ge[ke]=ze,X(Ge)},setActiveIndex:U,stepUp(ke,ze=je){const Le=oe.current.value[ke],Ge=O?Le-ze:Le+ze;$e.setValueAtIndex(ke,Ge)},stepDown(ke,ze=je){const Le=oe.current.value[ke],Ge=O?Le+ze:Le-ze;$e.setValueAtIndex(ke,Ge)},reset(){X(B.current)}}),[je,O,X,T]),st=d.useCallback(ke=>{const ze=ke.key,Ge={ArrowRight:()=>$e.stepUp(F),ArrowUp:()=>$e.stepUp(F),ArrowLeft:()=>$e.stepDown(F),ArrowDown:()=>$e.stepDown(F),PageUp:()=>$e.stepUp(F,Oe),PageDown:()=>$e.stepDown(F,Oe),Home:()=>{const{min:pt}=le[F];$e.setValueAtIndex(F,pt)},End:()=>{const{max:pt}=le[F];$e.setValueAtIndex(F,pt)}}[ze];Ge&&(ke.preventDefault(),ke.stopPropagation(),Ge(ke),oe.current.eventSource="keyboard")},[$e,F,Oe,le]),{getThumbStyle:Ve,rootStyle:Ct,trackStyle:Ye,innerTrackStyle:Ke}=d.useMemo(()=>sP({isReversed:O,orientation:c,thumbRects:de,thumbPercents:ee}),[O,c,ee,de]),ge=d.useCallback(ke=>{var ze;const Le=ke??F;if(Le!==-1&&E){const Ge=ve.getThumb(Le),pt=(ze=ie.current)==null?void 0:ze.ownerDocument.getElementById(Ge);pt&&setTimeout(()=>pt.focus())}},[E,F,ve]);pa(()=>{oe.current.eventSource==="keyboard"&&(D==null||D(oe.current.value))},[Y,D]);const De=ke=>{const ze=fe(ke)||0,Le=oe.current.value.map(Tt=>Math.abs(Tt-ze)),Ge=Math.min(...Le);let pt=Le.indexOf(Ge);const Pn=Le.filter(Tt=>Tt===Ge);Pn.length>1&&ze>oe.current.value[pt]&&(pt=pt+Pn.length-1),U(pt),$e.setValueAtIndex(pt,ze),ge(pt)},ut=ke=>{if(F==-1)return;const ze=fe(ke)||0;U(F),$e.setValueAtIndex(F,ze),ge(F)};uP(ie,{onPanSessionStart(ke){T&&(V(!0),De(ke),R==null||R(oe.current.value))},onPanSessionEnd(){T&&(V(!1),D==null||D(oe.current.value))},onPan(ke){T&&ut(ke)}});const yt=d.useCallback((ke={},ze=null)=>({...ke,...M,id:ve.root,ref:Pt(ze,ie),tabIndex:-1,"aria-disabled":dc(m),"data-focused":po(Q),style:{...ke.style,...Ct}}),[M,m,Q,Ct,ve]),ye=d.useCallback((ke={},ze=null)=>({...ke,ref:Pt(ze,J),id:ve.track,"data-disabled":po(m),style:{...ke.style,...Ye}}),[m,Ye,ve]),tt=d.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:ve.innerTrack,style:{...ke.style,...Ke}}),[Ke,ve]),ct=d.useCallback((ke,ze=null)=>{var Le;const{index:Ge,...pt}=ke,Pn=Y[Ge];if(Pn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${Ge}\`. The \`value\` or \`defaultValue\` length is : ${Y.length}`);const At=le[Ge];return{...pt,ref:ze,role:"slider",tabIndex:T?0:void 0,id:ve.getThumb(Ge),"data-active":po(z&&F===Ge),"aria-valuetext":(Le=A==null?void 0:A(Pn))!=null?Le:C==null?void 0:C[Ge],"aria-valuemin":At.min,"aria-valuemax":At.max,"aria-valuenow":Pn,"aria-orientation":c,"aria-disabled":dc(m),"aria-readonly":dc(h),"aria-label":S==null?void 0:S[Ge],"aria-labelledby":S!=null&&S[Ge]||_==null?void 0:_[Ge],style:{...ke.style,...Ve(Ge)},onKeyDown:fc(ke.onKeyDown,st),onFocus:fc(ke.onFocus,()=>{G(!0),U(Ge)}),onBlur:fc(ke.onBlur,()=>{G(!1),U(-1)})}},[ve,Y,le,T,z,F,A,C,c,m,h,S,_,Ve,st,G]),ft=d.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:ve.output,htmlFor:Y.map((Le,Ge)=>ve.getThumb(Ge)).join(" "),"aria-live":"off"}),[ve,Y]),Me=d.useCallback((ke,ze=null)=>{const{value:Le,...Ge}=ke,pt=!(Le<t||Le>n),Pn=Le>=Y[0]&&Le<=Y[Y.length-1];let At=dm(Le,t,n);At=O?100-At:At;const Tt={position:"absolute",pointerEvents:"none",...Nu({orientation:c,vertical:{bottom:`${At}%`},horizontal:{left:`${At}%`}})};return{...Ge,ref:ze,id:ve.getMarker(ke.value),role:"presentation","aria-hidden":!0,"data-disabled":po(m),"data-invalid":po(!pt),"data-highlighted":po(Pn),style:{...ke.style,...Tt}}},[m,O,n,t,c,Y,ve]),Ne=d.useCallback((ke,ze=null)=>{const{index:Le,...Ge}=ke;return{...Ge,ref:ze,id:ve.getInput(Le),type:"hidden",value:Y[Le],name:Array.isArray(j)?j[Le]:`${j}-${Le}`}},[j,Y,ve]);return{state:{value:Y,isFocused:Q,isDragging:z,getThumbPercent:ke=>ee[ke],getThumbMinValue:ke=>le[ke].min,getThumbMaxValue:ke=>le[ke].max},actions:$e,getRootProps:yt,getTrackProps:ye,getInnerTrackProps:tt,getThumbProps:ct,getMarkerProps:Me,getInputProps:Ne,getOutputProps:ft}}function IW(e,t,n,r){return e.map((o,s)=>{const l=s===0?t:e[s-1]+r,i=s===e.length-1?n:e[s+1]-r;return{min:l,max:i}})}var[PW,Zh]=Wt({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[EW,Jh]=Wt({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),fP=_e(function(t,n){const r={orientation:"horizontal",...t},o=Gn("Slider",r),s=on(r),{direction:l}=Sd();s.direction=l;const{getRootProps:i,...c}=jW(s),p=d.useMemo(()=>({...c,name:r.name}),[c,r.name]);return a.jsx(PW,{value:p,children:a.jsx(EW,{value:o,children:a.jsx(Se.div,{...i({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});fP.displayName="RangeSlider";var q1=_e(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=Zh(),l=Jh(),i=r(t,n);return a.jsxs(Se.div,{...i,className:cl("chakra-slider__thumb",t.className),__css:l.thumb,children:[i.children,s&&a.jsx("input",{...o({index:t.index})})]})});q1.displayName="RangeSliderThumb";var pP=_e(function(t,n){const{getTrackProps:r}=Zh(),o=Jh(),s=r(t,n);return a.jsx(Se.div,{...s,className:cl("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});pP.displayName="RangeSliderTrack";var mP=_e(function(t,n){const{getInnerTrackProps:r}=Zh(),o=Jh(),s=r(t,n);return a.jsx(Se.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});mP.displayName="RangeSliderFilledTrack";var Wp=_e(function(t,n){const{getMarkerProps:r}=Zh(),o=Jh(),s=r(t,n);return a.jsx(Se.div,{...s,className:cl("chakra-slider__marker",t.className),__css:o.mark})});Wp.displayName="RangeSliderMark";function MW(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:l,isReversed:i,direction:c="ltr",orientation:p="horizontal",id:m,isDisabled:h,isReadOnly:g,onChangeStart:x,onChangeEnd:y,step:b=1,getAriaValueText:C,"aria-valuetext":S,"aria-label":_,"aria-labelledby":j,name:E,focusThumbOnChange:I=!0,...M}=e,R=un(x),D=un(y),A=un(C),O=aP({isReversed:i,direction:c,orientation:p}),[$,X]=Md({value:s,defaultValue:l??RW(n,r),onChange:o}),[z,V]=d.useState(!1),[Q,G]=d.useState(!1),F=!(h||g),U=(r-n)/10,T=b||(r-n)/100,B=lc($,n,r),Y=r-B+n,le=dm(O?Y:B,n,r),oe=p==="vertical",q=cP({min:n,max:r,step:b,isDisabled:h,value:B,isInteractive:F,isReversed:O,isVertical:oe,eventSource:null,focusThumbOnChange:I,orientation:p}),K=d.useRef(null),ee=d.useRef(null),ce=d.useRef(null),J=d.useId(),ie=m??J,[de,xe]=[`slider-thumb-${ie}`,`slider-track-${ie}`],we=d.useCallback(Me=>{var Ne,Ut;if(!K.current)return;const ke=q.current;ke.eventSource="pointer";const ze=K.current.getBoundingClientRect(),{clientX:Le,clientY:Ge}=(Ut=(Ne=Me.touches)==null?void 0:Ne[0])!=null?Ut:Me,pt=oe?ze.bottom-Ge:Le-ze.left,Pn=oe?ze.height:ze.width;let At=pt/Pn;O&&(At=1-At);let Tt=w5(At,ke.min,ke.max);return ke.step&&(Tt=parseFloat(R1(Tt,ke.min,ke.step))),Tt=lc(Tt,ke.min,ke.max),Tt},[oe,O,q]),ve=d.useCallback(Me=>{const Ne=q.current;Ne.isInteractive&&(Me=parseFloat(R1(Me,Ne.min,T)),Me=lc(Me,Ne.min,Ne.max),X(Me))},[T,X,q]),fe=d.useMemo(()=>({stepUp(Me=T){const Ne=O?B-Me:B+Me;ve(Ne)},stepDown(Me=T){const Ne=O?B+Me:B-Me;ve(Ne)},reset(){ve(l||0)},stepTo(Me){ve(Me)}}),[ve,O,B,T,l]),Oe=d.useCallback(Me=>{const Ne=q.current,ke={ArrowRight:()=>fe.stepUp(),ArrowUp:()=>fe.stepUp(),ArrowLeft:()=>fe.stepDown(),ArrowDown:()=>fe.stepDown(),PageUp:()=>fe.stepUp(U),PageDown:()=>fe.stepDown(U),Home:()=>ve(Ne.min),End:()=>ve(Ne.max)}[Me.key];ke&&(Me.preventDefault(),Me.stopPropagation(),ke(Me),Ne.eventSource="keyboard")},[fe,ve,U,q]),je=(t=A==null?void 0:A(B))!=null?t:S,$e=_W(ee),{getThumbStyle:st,rootStyle:Ve,trackStyle:Ct,innerTrackStyle:Ye}=d.useMemo(()=>{const Me=q.current,Ne=$e??{width:0,height:0};return sP({isReversed:O,orientation:Me.orientation,thumbRects:[Ne],thumbPercents:[le]})},[O,$e,le,q]),Ke=d.useCallback(()=>{q.current.focusThumbOnChange&&setTimeout(()=>{var Ne;return(Ne=ee.current)==null?void 0:Ne.focus()})},[q]);pa(()=>{const Me=q.current;Ke(),Me.eventSource==="keyboard"&&(D==null||D(Me.value))},[B,D]);function ge(Me){const Ne=we(Me);Ne!=null&&Ne!==q.current.value&&X(Ne)}uP(ce,{onPanSessionStart(Me){const Ne=q.current;Ne.isInteractive&&(V(!0),Ke(),ge(Me),R==null||R(Ne.value))},onPanSessionEnd(){const Me=q.current;Me.isInteractive&&(V(!1),D==null||D(Me.value))},onPan(Me){q.current.isInteractive&&ge(Me)}});const De=d.useCallback((Me={},Ne=null)=>({...Me,...M,ref:Pt(Ne,ce),tabIndex:-1,"aria-disabled":dc(h),"data-focused":po(Q),style:{...Me.style,...Ve}}),[M,h,Q,Ve]),ut=d.useCallback((Me={},Ne=null)=>({...Me,ref:Pt(Ne,K),id:xe,"data-disabled":po(h),style:{...Me.style,...Ct}}),[h,xe,Ct]),yt=d.useCallback((Me={},Ne=null)=>({...Me,ref:Ne,style:{...Me.style,...Ye}}),[Ye]),ye=d.useCallback((Me={},Ne=null)=>({...Me,ref:Pt(Ne,ee),role:"slider",tabIndex:F?0:void 0,id:de,"data-active":po(z),"aria-valuetext":je,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":B,"aria-orientation":p,"aria-disabled":dc(h),"aria-readonly":dc(g),"aria-label":_,"aria-labelledby":_?void 0:j,style:{...Me.style,...st(0)},onKeyDown:fc(Me.onKeyDown,Oe),onFocus:fc(Me.onFocus,()=>G(!0)),onBlur:fc(Me.onBlur,()=>G(!1))}),[F,de,z,je,n,r,B,p,h,g,_,j,st,Oe]),tt=d.useCallback((Me,Ne=null)=>{const Ut=!(Me.value<n||Me.value>r),ke=B>=Me.value,ze=dm(Me.value,n,r),Le={position:"absolute",pointerEvents:"none",...OW({orientation:p,vertical:{bottom:O?`${100-ze}%`:`${ze}%`},horizontal:{left:O?`${100-ze}%`:`${ze}%`}})};return{...Me,ref:Ne,role:"presentation","aria-hidden":!0,"data-disabled":po(h),"data-invalid":po(!Ut),"data-highlighted":po(ke),style:{...Me.style,...Le}}},[h,O,r,n,p,B]),ct=d.useCallback((Me={},Ne=null)=>({...Me,ref:Ne,type:"hidden",value:B,name:E}),[E,B]);return{state:{value:B,isFocused:Q,isDragging:z},actions:fe,getRootProps:De,getTrackProps:ut,getInnerTrackProps:yt,getThumbProps:ye,getMarkerProps:tt,getInputProps:ct}}function OW(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function RW(e,t){return t<e?e:e+(t-e)/2}var[DW,eg]=Wt({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[AW,tg]=Wt({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),Jb=_e((e,t)=>{var n;const r={...e,orientation:(n=e==null?void 0:e.orientation)!=null?n:"horizontal"},o=Gn("Slider",r),s=on(r),{direction:l}=Sd();s.direction=l;const{getInputProps:i,getRootProps:c,...p}=MW(s),m=c(),h=i({},t);return a.jsx(DW,{value:p,children:a.jsx(AW,{value:o,children:a.jsxs(Se.div,{...m,className:cl("chakra-slider",r.className),__css:o.container,children:[r.children,a.jsx("input",{...h})]})})})});Jb.displayName="Slider";var ey=_e((e,t)=>{const{getThumbProps:n}=eg(),r=tg(),o=n(e,t);return a.jsx(Se.div,{...o,className:cl("chakra-slider__thumb",e.className),__css:r.thumb})});ey.displayName="SliderThumb";var ty=_e((e,t)=>{const{getTrackProps:n}=eg(),r=tg(),o=n(e,t);return a.jsx(Se.div,{...o,className:cl("chakra-slider__track",e.className),__css:r.track})});ty.displayName="SliderTrack";var ny=_e((e,t)=>{const{getInnerTrackProps:n}=eg(),r=tg(),o=n(e,t);return a.jsx(Se.div,{...o,className:cl("chakra-slider__filled-track",e.className),__css:r.filledTrack})});ny.displayName="SliderFilledTrack";var Gi=_e((e,t)=>{const{getMarkerProps:n}=eg(),r=tg(),o=n(e,t);return a.jsx(Se.div,{...o,className:cl("chakra-slider__marker",e.className),__css:r.mark})});Gi.displayName="SliderMark";var[TW,hP]=Wt({name:"StatStylesContext",errorMessage:`useStatStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Stat />" `}),gP=_e(function(t,n){const r=Gn("Stat",t),o={position:"relative",flex:"1 1 0%",...r.container},{className:s,children:l,...i}=on(t);return a.jsx(TW,{value:r,children:a.jsx(Se.div,{ref:n,...i,className:et("chakra-stat",s),__css:o,children:a.jsx("dl",{children:l})})})});gP.displayName="Stat";var vP=_e(function(t,n){return a.jsx(Se.div,{...t,ref:n,role:"group",className:et("chakra-stat__group",t.className),__css:{display:"flex",flexWrap:"wrap",justifyContent:"space-around",alignItems:"flex-start"}})});vP.displayName="StatGroup";var xP=_e(function(t,n){const r=hP();return a.jsx(Se.dt,{ref:n,...t,className:et("chakra-stat__label",t.className),__css:r.label})});xP.displayName="StatLabel";var bP=_e(function(t,n){const r=hP();return a.jsx(Se.dd,{ref:n,...t,className:et("chakra-stat__number",t.className),__css:{...r.number,fontFeatureSettings:"pnum",fontVariantNumeric:"proportional-nums"}})});bP.displayName="StatNumber";var ry=_e(function(t,n){const r=Gn("Switch",t),{spacing:o="0.5rem",children:s,...l}=on(t),{getIndicatorProps:i,getInputProps:c,getCheckboxProps:p,getRootProps:m,getLabelProps:h}=C5(l),g=d.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),x=d.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),y=d.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return a.jsxs(Se.label,{...m(),className:et("chakra-switch",t.className),__css:g,children:[a.jsx("input",{className:"chakra-switch__input",...c({},n)}),a.jsx(Se.span,{...p(),className:"chakra-switch__track",__css:x,children:a.jsx(Se.span,{__css:r.thumb,className:"chakra-switch__thumb",...i()})}),s&&a.jsx(Se.span,{className:"chakra-switch__label",...h(),__css:y,children:s})]})});ry.displayName="Switch";var[$W,NW,LW,zW]=bb();function FW(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:l,lazyBehavior:i="unmount",orientation:c="horizontal",direction:p="ltr",...m}=e,[h,g]=d.useState(n??0),[x,y]=Md({defaultValue:n??0,value:o,onChange:r});d.useEffect(()=>{o!=null&&g(o)},[o]);const b=LW(),C=d.useId();return{id:`tabs-${(t=e.id)!=null?t:C}`,selectedIndex:x,focusedIndex:h,setSelectedIndex:y,setFocusedIndex:g,isManual:s,isLazy:l,lazyBehavior:i,orientation:c,descendants:b,direction:p,htmlProps:m}}var[BW,ng]=Wt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function HW(e){const{focusedIndex:t,orientation:n,direction:r}=ng(),o=NW(),s=d.useCallback(l=>{const i=()=>{var _;const j=o.nextEnabled(t);j&&((_=j.node)==null||_.focus())},c=()=>{var _;const j=o.prevEnabled(t);j&&((_=j.node)==null||_.focus())},p=()=>{var _;const j=o.firstEnabled();j&&((_=j.node)==null||_.focus())},m=()=>{var _;const j=o.lastEnabled();j&&((_=j.node)==null||_.focus())},h=n==="horizontal",g=n==="vertical",x=l.key,y=r==="ltr"?"ArrowLeft":"ArrowRight",b=r==="ltr"?"ArrowRight":"ArrowLeft",S={[y]:()=>h&&c(),[b]:()=>h&&i(),ArrowDown:()=>g&&i(),ArrowUp:()=>g&&c(),Home:p,End:m}[x];S&&(l.preventDefault(),S(l))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Fe(e.onKeyDown,s)}}function VW(e){const{isDisabled:t=!1,isFocusable:n=!1,...r}=e,{setSelectedIndex:o,isManual:s,id:l,setFocusedIndex:i,selectedIndex:c}=ng(),{index:p,register:m}=zW({disabled:t&&!n}),h=p===c,g=()=>{o(p)},x=()=>{i(p),!s&&!(t&&n)&&o(p)},y=w3({...r,ref:Pt(m,e.ref),isDisabled:t,isFocusable:n,onClick:Fe(e.onClick,g)}),b="button";return{...y,id:yP(l,p),role:"tab",tabIndex:h?0:-1,type:b,"aria-selected":h,"aria-controls":CP(l,p),onFocus:t?void 0:Fe(e.onFocus,x)}}var[WW,UW]=Wt({});function GW(e){const t=ng(),{id:n,selectedIndex:r}=t,s=Mh(e.children).map((l,i)=>d.createElement(WW,{key:i,value:{isSelected:i===r,id:CP(n,i),tabId:yP(n,i),selectedIndex:r}},l));return{...e,children:s}}function KW(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=ng(),{isSelected:s,id:l,tabId:i}=UW(),c=d.useRef(!1);s&&(c.current=!0);const p=Yb({wasSelected:c.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:p?t:null,role:"tabpanel","aria-labelledby":i,hidden:!s,id:l}}function yP(e,t){return`${e}--tab-${t}`}function CP(e,t){return`${e}--tabpanel-${t}`}var[qW,rg]=Wt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),ri=_e(function(t,n){const r=Gn("Tabs",t),{children:o,className:s,...l}=on(t),{htmlProps:i,descendants:c,...p}=FW(l),m=d.useMemo(()=>p,[p]),{isFitted:h,...g}=i;return a.jsx($W,{value:c,children:a.jsx(BW,{value:m,children:a.jsx(qW,{value:r,children:a.jsx(Se.div,{className:et("chakra-tabs",s),ref:n,...g,__css:r.root,children:o})})})})});ri.displayName="Tabs";var oi=_e(function(t,n){const r=HW({...t,ref:n}),s={display:"flex",...rg().tablist};return a.jsx(Se.div,{...r,className:et("chakra-tabs__tablist",t.className),__css:s})});oi.displayName="TabList";var Qr=_e(function(t,n){const r=KW({...t,ref:n}),o=rg();return a.jsx(Se.div,{outline:"0",...r,className:et("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});Qr.displayName="TabPanel";var Hc=_e(function(t,n){const r=GW(t),o=rg();return a.jsx(Se.div,{...r,width:"100%",ref:n,className:et("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});Hc.displayName="TabPanels";var yr=_e(function(t,n){const r=rg(),o=VW({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return a.jsx(Se.button,{...o,className:et("chakra-tabs__tab",t.className),__css:s})});yr.displayName="Tab";function XW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var QW=["h","minH","height","minHeight"],wP=_e((e,t)=>{const n=al("Textarea",e),{className:r,rows:o,...s}=on(e),l=wb(s),i=o?XW(n,QW):n;return a.jsx(Se.textarea,{ref:t,rows:o,...l,className:et("chakra-textarea",r),__css:i})});wP.displayName="Textarea";var YW={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},X1=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Up=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function ZW(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:l=o,closeOnEsc:i=!0,onOpen:c,onClose:p,placement:m,id:h,isOpen:g,defaultIsOpen:x,arrowSize:y=10,arrowShadowColor:b,arrowPadding:C,modifiers:S,isDisabled:_,gutter:j,offset:E,direction:I,...M}=e,{isOpen:R,onOpen:D,onClose:A}=Qb({isOpen:g,defaultIsOpen:x,onOpen:c,onClose:p}),{referenceRef:O,getPopperProps:$,getArrowInnerProps:X,getArrowProps:z}=Xb({enabled:R,placement:m,arrowPadding:C,modifiers:S,gutter:j,offset:E,direction:I}),V=d.useId(),G=`tooltip-${h??V}`,F=d.useRef(null),U=d.useRef(),T=d.useCallback(()=>{U.current&&(clearTimeout(U.current),U.current=void 0)},[]),B=d.useRef(),Y=d.useCallback(()=>{B.current&&(clearTimeout(B.current),B.current=void 0)},[]),re=d.useCallback(()=>{Y(),A()},[A,Y]),le=JW(F,re),oe=d.useCallback(()=>{if(!_&&!U.current){R&&le();const xe=Up(F);U.current=xe.setTimeout(D,t)}},[le,_,R,D,t]),q=d.useCallback(()=>{T();const xe=Up(F);B.current=xe.setTimeout(re,n)},[n,re,T]),K=d.useCallback(()=>{R&&r&&q()},[r,q,R]),ee=d.useCallback(()=>{R&&l&&q()},[l,q,R]),ce=d.useCallback(xe=>{R&&xe.key==="Escape"&&q()},[R,q]);Tl(()=>X1(F),"keydown",i?ce:void 0),Tl(()=>{const xe=F.current;if(!xe)return null;const we=c3(xe);return we.localName==="body"?Up(F):we},"scroll",()=>{R&&s&&re()},{passive:!0,capture:!0}),d.useEffect(()=>{_&&(T(),R&&A())},[_,R,A,T]),d.useEffect(()=>()=>{T(),Y()},[T,Y]),Tl(()=>F.current,"pointerleave",q);const J=d.useCallback((xe={},we=null)=>({...xe,ref:Pt(F,we,O),onPointerEnter:Fe(xe.onPointerEnter,fe=>{fe.pointerType!=="touch"&&oe()}),onClick:Fe(xe.onClick,K),onPointerDown:Fe(xe.onPointerDown,ee),onFocus:Fe(xe.onFocus,oe),onBlur:Fe(xe.onBlur,q),"aria-describedby":R?G:void 0}),[oe,q,ee,R,G,K,O]),ie=d.useCallback((xe={},we=null)=>$({...xe,style:{...xe.style,[$n.arrowSize.var]:y?`${y}px`:void 0,[$n.arrowShadowColor.var]:b}},we),[$,y,b]),de=d.useCallback((xe={},we=null)=>{const ve={...xe.style,position:"relative",transformOrigin:$n.transformOrigin.varRef};return{ref:we,...M,...xe,id:G,role:"tooltip",style:ve}},[M,G]);return{isOpen:R,show:oe,hide:q,getTriggerProps:J,getTooltipProps:de,getTooltipPositionerProps:ie,getArrowProps:z,getArrowInnerProps:X}}var _v="chakra-ui:close-tooltip";function JW(e,t){return d.useEffect(()=>{const n=X1(e);return n.addEventListener(_v,t),()=>n.removeEventListener(_v,t)},[t,e]),()=>{const n=X1(e),r=Up(e);n.dispatchEvent(new r.CustomEvent(_v))}}function eU(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function tU(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var nU=Se(jn.div),Vt=_e((e,t)=>{var n,r;const o=al("Tooltip",e),s=on(e),l=Sd(),{children:i,label:c,shouldWrapChildren:p,"aria-label":m,hasArrow:h,bg:g,portalProps:x,background:y,backgroundColor:b,bgColor:C,motionProps:S,..._}=s,j=(r=(n=y??b)!=null?n:g)!=null?r:C;if(j){o.bg=j;const $=JR(l,"colors",j);o[$n.arrowBg.var]=$}const E=ZW({..._,direction:l.direction}),I=typeof i=="string"||p;let M;if(I)M=a.jsx(Se.span,{display:"inline-block",tabIndex:0,...E.getTriggerProps(),children:i});else{const $=d.Children.only(i);M=d.cloneElement($,E.getTriggerProps($.props,$.ref))}const R=!!m,D=E.getTooltipProps({},t),A=R?eU(D,["role","id"]):D,O=tU(D,["role","id"]);return c?a.jsxs(a.Fragment,{children:[M,a.jsx(fr,{children:E.isOpen&&a.jsx($c,{...x,children:a.jsx(Se.div,{...E.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:a.jsxs(nU,{variants:YW,initial:"exit",animate:"enter",exit:"exit",...S,...A,__css:o,children:[c,R&&a.jsx(Se.span,{srOnly:!0,...O,children:m}),h&&a.jsx(Se.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:a.jsx(Se.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):a.jsx(a.Fragment,{children:i})});Vt.displayName="Tooltip";function og(e,t={}){let n=d.useCallback(o=>t.keys?vN(e,t.keys,o):e.listen(o),[t.keys,e]),r=e.get.bind(e);return d.useSyncExternalStore(n,r,r)}const rU=ae(he,({system:e})=>{const{consoleLogLevel:t,shouldLogToConsole:n}=e;return{consoleLogLevel:t,shouldLogToConsole:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),SP=e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=W(rU);return d.useEffect(()=>{n?(localStorage.setItem("ROARR_LOG","true"),localStorage.setItem("ROARR_FILTER",`context.logLevel:>=${eD[t]}`)):localStorage.setItem("ROARR_LOG","false"),iw.ROARR.write=tD.createLogWriter()},[t,n]),d.useEffect(()=>{const o={...nD};rD.set(iw.Roarr.child(o))},[]),d.useMemo(()=>ll(e),[e])},oU=()=>{const e=te(),t=W(r=>r.system.toastQueue),n=d5();return d.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(oD())},[e,n,t]),null},si=()=>{const e=te();return d.useCallback(n=>e(lt(Qt(n))),[e])},sU=d.memo(oU);var aU=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 Wd(e,t){var n=lU(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 lU(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=aU.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var iU=[".DS_Store","Thumbs.db"];function cU(e){return Lc(this,void 0,void 0,function(){return zc(this,function(t){return vm(e)&&uU(e.dataTransfer)?[2,mU(e.dataTransfer,e.type)]:dU(e)?[2,fU(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,pU(e)]:[2,[]]})})}function uU(e){return vm(e)}function dU(e){return vm(e)&&vm(e.target)}function vm(e){return typeof e=="object"&&e!==null}function fU(e){return Q1(e.target.files).map(function(t){return Wd(t)})}function pU(e){return Lc(this,void 0,void 0,function(){var t;return zc(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 Wd(r)})]}})})}function mU(e,t){return Lc(this,void 0,void 0,function(){var n,r;return zc(this,function(o){switch(o.label){case 0:return e.items?(n=Q1(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(hU))]):[3,2];case 1:return r=o.sent(),[2,HS(kP(r))];case 2:return[2,HS(Q1(e.files).map(function(s){return Wd(s)}))]}})})}function HS(e){return e.filter(function(t){return iU.indexOf(t.name)===-1})}function Q1(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function hU(e){if(typeof e.webkitGetAsEntry!="function")return VS(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?_P(t):VS(e)}function kP(e){return e.reduce(function(t,n){return A1(A1([],dS(t),!1),dS(Array.isArray(n)?kP(n):[n]),!1)},[])}function VS(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=Wd(t);return Promise.resolve(n)}function gU(e){return Lc(this,void 0,void 0,function(){return zc(this,function(t){return[2,e.isDirectory?_P(e):vU(e)]})})}function _P(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var l=this;t.readEntries(function(i){return Lc(l,void 0,void 0,function(){var c,p,m;return zc(this,function(h){switch(h.label){case 0:if(i.length)return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return c=h.sent(),n(c),[3,4];case 3:return p=h.sent(),r(p),[3,4];case 4:return[3,6];case 5:m=Promise.all(i.map(gU)),o.push(m),s(),h.label=6;case 6:return[2]}})})},function(i){r(i)})}s()})}function vU(e){return Lc(this,void 0,void 0,function(){return zc(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=Wd(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var xU=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(l){var i=l.trim().toLowerCase();return i.charAt(0)==="."?r.toLowerCase().endsWith(i):i.endsWith("/*")?s===i.replace(/\/.*$/,""):o===i})}return!0};function WS(e){return CU(e)||yU(e)||IP(e)||bU()}function bU(){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 yU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CU(e){if(Array.isArray(e))return Y1(e)}function US(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 GS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?US(Object(n),!0).forEach(function(r){jP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):US(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ld(e,t){return kU(e)||SU(e,t)||IP(e,t)||wU()}function wU(){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 IP(e,t){if(e){if(typeof e=="string")return Y1(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 Y1(e,t)}}function Y1(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 SU(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,l,i;try{for(n=n.call(e);!(o=(l=n.next()).done)&&(r.push(l.value),!(t&&r.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw i}}return r}}function kU(e){if(Array.isArray(e))return e}var _U="file-invalid-type",jU="file-too-large",IU="file-too-small",PU="too-many-files",EU=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:_U,message:"File type must be ".concat(n)}},KS=function(t){return{code:jU,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},qS=function(t){return{code:IU,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},MU={code:PU,message:"Too many files"};function PP(e,t){var n=e.type==="application/x-moz-file"||xU(e,t);return[n,n?null:EU(t)]}function EP(e,t,n){if(El(e.size))if(El(t)&&El(n)){if(e.size>n)return[!1,KS(n)];if(e.size<t)return[!1,qS(t)]}else{if(El(t)&&e.size<t)return[!1,qS(t)];if(El(n)&&e.size>n)return[!1,KS(n)]}return[!0,null]}function El(e){return e!=null}function OU(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,l=e.maxFiles,i=e.validator;return!s&&t.length>1||s&&l>=1&&t.length>l?!1:t.every(function(c){var p=PP(c,n),m=ld(p,1),h=m[0],g=EP(c,r,o),x=ld(g,1),y=x[0],b=i?i(c):null;return h&&y&&!b})}function xm(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function ip(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 XS(e){e.preventDefault()}function RU(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function DU(e){return e.indexOf("Edge/")!==-1}function AU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return RU(e)||DU(e)}function ms(){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),l=1;l<o;l++)s[l-1]=arguments[l];return t.some(function(i){return!xm(r)&&i&&i.apply(void 0,[r].concat(s)),xm(r)})}}function TU(){return"showOpenFilePicker"in window}function $U(e){if(El(e)){var t=Object.entries(e).filter(function(n){var r=ld(n,2),o=r[0],s=r[1],l=!0;return MP(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.')),l=!1),(!Array.isArray(s)||!s.every(OP))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),l=!1),l}).reduce(function(n,r){var o=ld(r,2),s=o[0],l=o[1];return GS(GS({},n),{},jP({},s,l))},{});return[{description:"Files",accept:t}]}return e}function NU(e){if(El(e))return Object.entries(e).reduce(function(t,n){var r=ld(n,2),o=r[0],s=r[1];return[].concat(WS(t),[o],WS(s))},[]).filter(function(t){return MP(t)||OP(t)}).join(",")}function LU(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function zU(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function MP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function OP(e){return/^.*\.[\w]+$/.test(e)}var FU=["children"],BU=["open"],HU=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],VU=["refKey","onChange","onClick"];function WU(e){return KU(e)||GU(e)||RP(e)||UU()}function UU(){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 GU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function KU(e){if(Array.isArray(e))return Z1(e)}function jv(e,t){return QU(e)||XU(e,t)||RP(e,t)||qU()}function qU(){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 RP(e,t){if(e){if(typeof e=="string")return Z1(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 Z1(e,t)}}function Z1(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 XU(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,l,i;try{for(n=n.call(e);!(o=(l=n.next()).done)&&(r.push(l.value),!(t&&r.length===t));o=!0);}catch(c){s=!0,i=c}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw i}}return r}}function QU(e){if(Array.isArray(e))return e}function QS(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 xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QS(Object(n),!0).forEach(function(r){J1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function J1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bm(e,t){if(e==null)return{};var n=YU(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 YU(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 oy=d.forwardRef(function(e,t){var n=e.children,r=bm(e,FU),o=sy(r),s=o.open,l=bm(o,BU);return d.useImperativeHandle(t,function(){return{open:s}},[s]),H.createElement(d.Fragment,null,n(xn(xn({},l),{},{open:s})))});oy.displayName="Dropzone";var DP={disabled:!1,getFilesFromEvent:cU,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};oy.defaultProps=DP;oy.propTypes={children:en.func,accept:en.objectOf(en.arrayOf(en.string)),multiple:en.bool,preventDropOnDocument:en.bool,noClick:en.bool,noKeyboard:en.bool,noDrag:en.bool,noDragEventsBubbling:en.bool,minSize:en.number,maxSize:en.number,maxFiles:en.number,disabled:en.bool,getFilesFromEvent:en.func,onFileDialogCancel:en.func,onFileDialogOpen:en.func,useFsAccessApi:en.bool,autoFocus:en.bool,onDragEnter:en.func,onDragLeave:en.func,onDragOver:en.func,onDrop:en.func,onDropAccepted:en.func,onDropRejected:en.func,onError:en.func,validator:en.func};var ex={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function sy(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=xn(xn({},DP),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,l=t.minSize,i=t.multiple,c=t.maxFiles,p=t.onDragEnter,m=t.onDragLeave,h=t.onDragOver,g=t.onDrop,x=t.onDropAccepted,y=t.onDropRejected,b=t.onFileDialogCancel,C=t.onFileDialogOpen,S=t.useFsAccessApi,_=t.autoFocus,j=t.preventDropOnDocument,E=t.noClick,I=t.noKeyboard,M=t.noDrag,R=t.noDragEventsBubbling,D=t.onError,A=t.validator,O=d.useMemo(function(){return NU(n)},[n]),$=d.useMemo(function(){return $U(n)},[n]),X=d.useMemo(function(){return typeof C=="function"?C:YS},[C]),z=d.useMemo(function(){return typeof b=="function"?b:YS},[b]),V=d.useRef(null),Q=d.useRef(null),G=d.useReducer(ZU,ex),F=jv(G,2),U=F[0],T=F[1],B=U.isFocused,Y=U.isFileDialogActive,re=d.useRef(typeof window<"u"&&window.isSecureContext&&S&&TU()),le=function(){!re.current&&Y&&setTimeout(function(){if(Q.current){var De=Q.current.files;De.length||(T({type:"closeDialog"}),z())}},300)};d.useEffect(function(){return window.addEventListener("focus",le,!1),function(){window.removeEventListener("focus",le,!1)}},[Q,Y,z,re]);var oe=d.useRef([]),q=function(De){V.current&&V.current.contains(De.target)||(De.preventDefault(),oe.current=[])};d.useEffect(function(){return j&&(document.addEventListener("dragover",XS,!1),document.addEventListener("drop",q,!1)),function(){j&&(document.removeEventListener("dragover",XS),document.removeEventListener("drop",q))}},[V,j]),d.useEffect(function(){return!r&&_&&V.current&&V.current.focus(),function(){}},[V,_,r]);var K=d.useCallback(function(ge){D?D(ge):console.error(ge)},[D]),ee=d.useCallback(function(ge){ge.preventDefault(),ge.persist(),Ve(ge),oe.current=[].concat(WU(oe.current),[ge.target]),ip(ge)&&Promise.resolve(o(ge)).then(function(De){if(!(xm(ge)&&!R)){var ut=De.length,yt=ut>0&&OU({files:De,accept:O,minSize:l,maxSize:s,multiple:i,maxFiles:c,validator:A}),ye=ut>0&&!yt;T({isDragAccept:yt,isDragReject:ye,isDragActive:!0,type:"setDraggedFiles"}),p&&p(ge)}}).catch(function(De){return K(De)})},[o,p,K,R,O,l,s,i,c,A]),ce=d.useCallback(function(ge){ge.preventDefault(),ge.persist(),Ve(ge);var De=ip(ge);if(De&&ge.dataTransfer)try{ge.dataTransfer.dropEffect="copy"}catch{}return De&&h&&h(ge),!1},[h,R]),J=d.useCallback(function(ge){ge.preventDefault(),ge.persist(),Ve(ge);var De=oe.current.filter(function(yt){return V.current&&V.current.contains(yt)}),ut=De.indexOf(ge.target);ut!==-1&&De.splice(ut,1),oe.current=De,!(De.length>0)&&(T({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),ip(ge)&&m&&m(ge))},[V,m,R]),ie=d.useCallback(function(ge,De){var ut=[],yt=[];ge.forEach(function(ye){var tt=PP(ye,O),ct=jv(tt,2),ft=ct[0],Me=ct[1],Ne=EP(ye,l,s),Ut=jv(Ne,2),ke=Ut[0],ze=Ut[1],Le=A?A(ye):null;if(ft&&ke&&!Le)ut.push(ye);else{var Ge=[Me,ze];Le&&(Ge=Ge.concat(Le)),yt.push({file:ye,errors:Ge.filter(function(pt){return pt})})}}),(!i&&ut.length>1||i&&c>=1&&ut.length>c)&&(ut.forEach(function(ye){yt.push({file:ye,errors:[MU]})}),ut.splice(0)),T({acceptedFiles:ut,fileRejections:yt,type:"setFiles"}),g&&g(ut,yt,De),yt.length>0&&y&&y(yt,De),ut.length>0&&x&&x(ut,De)},[T,i,O,l,s,c,g,x,y,A]),de=d.useCallback(function(ge){ge.preventDefault(),ge.persist(),Ve(ge),oe.current=[],ip(ge)&&Promise.resolve(o(ge)).then(function(De){xm(ge)&&!R||ie(De,ge)}).catch(function(De){return K(De)}),T({type:"reset"})},[o,ie,K,R]),xe=d.useCallback(function(){if(re.current){T({type:"openDialog"}),X();var ge={multiple:i,types:$};window.showOpenFilePicker(ge).then(function(De){return o(De)}).then(function(De){ie(De,null),T({type:"closeDialog"})}).catch(function(De){LU(De)?(z(De),T({type:"closeDialog"})):zU(De)?(re.current=!1,Q.current?(Q.current.value=null,Q.current.click()):K(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."))):K(De)});return}Q.current&&(T({type:"openDialog"}),X(),Q.current.value=null,Q.current.click())},[T,X,z,S,ie,K,$,i]),we=d.useCallback(function(ge){!V.current||!V.current.isEqualNode(ge.target)||(ge.key===" "||ge.key==="Enter"||ge.keyCode===32||ge.keyCode===13)&&(ge.preventDefault(),xe())},[V,xe]),ve=d.useCallback(function(){T({type:"focus"})},[]),fe=d.useCallback(function(){T({type:"blur"})},[]),Oe=d.useCallback(function(){E||(AU()?setTimeout(xe,0):xe())},[E,xe]),je=function(De){return r?null:De},$e=function(De){return I?null:je(De)},st=function(De){return M?null:je(De)},Ve=function(De){R&&De.stopPropagation()},Ct=d.useMemo(function(){return function(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},De=ge.refKey,ut=De===void 0?"ref":De,yt=ge.role,ye=ge.onKeyDown,tt=ge.onFocus,ct=ge.onBlur,ft=ge.onClick,Me=ge.onDragEnter,Ne=ge.onDragOver,Ut=ge.onDragLeave,ke=ge.onDrop,ze=bm(ge,HU);return xn(xn(J1({onKeyDown:$e(ms(ye,we)),onFocus:$e(ms(tt,ve)),onBlur:$e(ms(ct,fe)),onClick:je(ms(ft,Oe)),onDragEnter:st(ms(Me,ee)),onDragOver:st(ms(Ne,ce)),onDragLeave:st(ms(Ut,J)),onDrop:st(ms(ke,de)),role:typeof yt=="string"&&yt!==""?yt:"presentation"},ut,V),!r&&!I?{tabIndex:0}:{}),ze)}},[V,we,ve,fe,Oe,ee,ce,J,de,I,M,r]),Ye=d.useCallback(function(ge){ge.stopPropagation()},[]),Ke=d.useMemo(function(){return function(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},De=ge.refKey,ut=De===void 0?"ref":De,yt=ge.onChange,ye=ge.onClick,tt=bm(ge,VU),ct=J1({accept:O,multiple:i,type:"file",style:{display:"none"},onChange:je(ms(yt,de)),onClick:je(ms(ye,Ye)),tabIndex:-1},ut,Q);return xn(xn({},ct),tt)}},[Q,n,i,de,r]);return xn(xn({},U),{},{isFocused:B&&!r,getRootProps:Ct,getInputProps:Ke,rootRef:V,inputRef:Q,open:je(xe)})}function ZU(e,t){switch(t.type){case"focus":return xn(xn({},e),{},{isFocused:!0});case"blur":return xn(xn({},e),{},{isFocused:!1});case"openDialog":return xn(xn({},ex),{},{isFileDialogActive:!0});case"closeDialog":return xn(xn({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return xn(xn({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return xn(xn({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return xn({},ex);default:return e}}function YS(){}function tx(){return tx=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},tx.apply(this,arguments)}var AP=["shift","alt","meta","mod","ctrl"],JU={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 Va(e){return(JU[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function eG(e){return AP.includes(e)}function Iv(e,t){return t===void 0&&(t=","),e.split(t)}function Pv(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(l){return Va(l)}),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(l){return!AP.includes(l)});return tx({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&TP([Va(e.key),Va(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&$P([Va(e.key),Va(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Wa.clear()})})();var Wa=new Set;function ay(e){return Array.isArray(e)}function Gp(e,t){t===void 0&&(t=",");var n=ay(e)?e:e.split(t);return n.every(function(r){return Wa.has(r.trim().toLowerCase())})}function TP(e){var t=Array.isArray(e)?e:[e];Wa.has("meta")&&Wa.forEach(function(n){return!eG(n)&&Wa.delete(n.toLowerCase())}),t.forEach(function(n){return Wa.add(n.toLowerCase())})}function $P(e){var t=Array.isArray(e)?e:[e];e==="meta"?Wa.clear():t.forEach(function(n){return Wa.delete(n.toLowerCase())})}function tG(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function nG(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function rG(e){return NP(e,["input","textarea","select"])}function NP(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return ay(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function oG(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 sG=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,l=n.mod,i=n.shift,c=n.ctrl,p=n.keys,m=t.key,h=t.code,g=t.ctrlKey,x=t.metaKey,y=t.shiftKey,b=t.altKey,C=Va(h),S=m.toLowerCase();if(!r){if(o===!b&&S!=="alt"||i===!y&&S!=="shift")return!1;if(l){if(!x&&!g)return!1}else if(s===!x&&S!=="meta"&&S!=="os"||c===!g&&S!=="ctrl"&&S!=="control")return!1}return p&&p.length===1&&(p.includes(S)||p.includes(C))?!0:p?Gp(p):!p},aG=d.createContext(void 0),lG=function(){return d.useContext(aG)};function LP(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&&LP(e[r],t[r])},!0):e===t}var iG=d.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),cG=function(){return d.useContext(iG)};function uG(e){var t=d.useRef(void 0);return LP(t.current,e)||(t.current=e),t.current}var ZS=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},dG=typeof window<"u"?d.useLayoutEffect:d.useEffect;function nt(e,t,n,r){var o=d.useRef(null),s=d.useRef(!1),l=n instanceof Array?r instanceof Array?void 0:r:n,i=ay(e)?e.join(l==null?void 0:l.splitKey):e,c=n instanceof Array?n:r instanceof Array?r:void 0,p=d.useCallback(t,c??[]),m=d.useRef(p);c?m.current=p:m.current=t;var h=uG(l),g=cG(),x=g.enabledScopes,y=lG();return dG(function(){if(!((h==null?void 0:h.enabled)===!1||!oG(x,h==null?void 0:h.scopes))){var b=function(E,I){var M;if(I===void 0&&(I=!1),!(rG(E)&&!NP(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)){ZS(E);return}(M=E.target)!=null&&M.isContentEditable&&!(h!=null&&h.enableOnContentEditable)||Iv(i,h==null?void 0:h.splitKey).forEach(function(R){var D,A=Pv(R,h==null?void 0:h.combinationKey);if(sG(E,A,h==null?void 0:h.ignoreModifiers)||(D=A.keys)!=null&&D.includes("*")){if(I&&s.current)return;if(tG(E,A,h==null?void 0:h.preventDefault),!nG(E,A,h==null?void 0:h.enabled)){ZS(E);return}m.current(E,A),I||(s.current=!0)}})}},C=function(E){E.key!==void 0&&(TP(Va(E.code)),((h==null?void 0:h.keydown)===void 0&&(h==null?void 0:h.keyup)!==!0||h!=null&&h.keydown)&&b(E))},S=function(E){E.key!==void 0&&($P(Va(E.code)),s.current=!1,h!=null&&h.keyup&&b(E,!0))},_=o.current||(l==null?void 0:l.document)||document;return _.addEventListener("keyup",S),_.addEventListener("keydown",C),y&&Iv(i,h==null?void 0:h.splitKey).forEach(function(j){return y.addHotkey(Pv(j,h==null?void 0:h.combinationKey,h==null?void 0:h.description))}),function(){_.removeEventListener("keyup",S),_.removeEventListener("keydown",C),y&&Iv(i,h==null?void 0:h.splitKey).forEach(function(j){return y.removeHotkey(Pv(j,h==null?void 0:h.combinationKey,h==null?void 0:h.description))})}}},[i,h,x]),o}const fG=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return nt("esc",()=>{r(!1)}),a.jsxs(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:[a.jsx(N,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:"base.700",_dark:{bg:"base.900"},opacity:.7,alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(N,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"full",height:"full",alignItems:"center",justifyContent:"center",p:4},children:a.jsx(N,{sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",flexDir:"column",gap:4,borderWidth:3,borderRadius:"xl",borderStyle:"dashed",color:"base.100",borderColor:"base.100",_dark:{borderColor:"base.200"}},children:t?a.jsx(ur,{size:"lg",children:"Drop to Upload"}):a.jsxs(a.Fragment,{children:[a.jsx(ur,{size:"lg",children:"Invalid Upload"}),a.jsx(ur,{size:"md",children:"Must be single JPEG or PNG image"})]})})})]})},pG=d.memo(fG),mG=ae([he,er],({gallery:e},t)=>{let n={type:"TOAST"};t==="unifiedCanvas"&&(n={type:"SET_CANVAS_INITIAL_IMAGE"}),t==="img2img"&&(n={type:"SET_INITIAL_IMAGE"});const{autoAddBoardId:r}=e;return{autoAddBoardId:r,postUploadAction:n}},Ce),hG=e=>{const{children:t}=e,{autoAddBoardId:n,postUploadAction:r}=W(mG),o=si(),{t:s}=Z(),[l,i]=d.useState(!1),[c]=lI(),p=d.useCallback(j=>{i(!0),o({title:s("toast.uploadFailed"),description:j.errors.map(E=>E.message).join(`
|
||
`),status:"error"})},[s,o]),m=d.useCallback(async j=>{c({file:j,image_category:"user",is_intermediate:!1,postUploadAction:r,board_id:n==="none"?void 0:n})},[n,r,c]),h=d.useCallback((j,E)=>{if(E.length>1){o({title:s("toast.uploadFailed"),description:s("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}E.forEach(I=>{p(I)}),j.forEach(I=>{m(I)})},[s,o,m,p]),g=d.useCallback(()=>{i(!0)},[]),{getRootProps:x,getInputProps:y,isDragAccept:b,isDragReject:C,isDragActive:S,inputRef:_}=sy({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:g,multiple:!1});return d.useEffect(()=>{const j=async E=>{var I,M;_.current&&(I=E.clipboardData)!=null&&I.files&&(_.current.files=E.clipboardData.files,(M=_.current)==null||M.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",j),()=>{document.removeEventListener("paste",j)}},[_]),a.jsxs(Ie,{...x({style:{}}),onKeyDown:j=>{j.key},children:[a.jsx("input",{...y()}),t,a.jsx(fr,{children:S&&l&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(pG,{isDragAccept:b,isDragReject:C,setIsHandlingUpload:i})},"image-upload-overlay")})]})},gG=d.memo(hG),vG=_e((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...l}={},isChecked:i,...c}=e;return a.jsx(Vt,{label:r,placement:o,hasArrow:s,...l,children:a.jsx(Ja,{ref:t,colorScheme:i?"accent":"base",...c,children:n})})}),ot=d.memo(vG);function xG(e){const t=d.createContext(null);return[({children:o,value:s})=>H.createElement(t.Provider,{value:s},o),()=>{const o=d.useContext(t);if(o===null)throw new Error(e);return o}]}function zP(e){return Array.isArray(e)?e:[e]}const bG=()=>{};function yG(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||bG:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function FP({data:e}){const t=[],n=[],r=e.reduce((o,s,l)=>(s.group?o[s.group]?o[s.group].push(l):o[s.group]=[l]:n.push(l),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(s=>e[s]))}),t.push(...n.map(o=>e[o])),t}function BP(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==H.Fragment:!1}function HP(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=HP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function VP(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=HP(t))&&(r&&(r+=" "),r+=n);return r}const CG={app:100,modal:200,popover:300,overlay:400,max:9999};function ly(e){return CG[e]}function wG(e,t){const n=d.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 SG=sD({key:"mantine",prepend:!0});function kG(){return r5()||SG}var _G=Object.defineProperty,JS=Object.getOwnPropertySymbols,jG=Object.prototype.hasOwnProperty,IG=Object.prototype.propertyIsEnumerable,e4=(e,t,n)=>t in e?_G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PG=(e,t)=>{for(var n in t||(t={}))jG.call(t,n)&&e4(e,n,t[n]);if(JS)for(var n of JS(t))IG.call(t,n)&&e4(e,n,t[n]);return e};const Ev="ref";function EG(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(!(Ev in n))return{args:e,ref:t};t=n[Ev];const r=PG({},n);return delete r[Ev],{args:[r],ref:t}}const{cssFactory:MG}=(()=>{function e(n,r,o){const s=[],l=iD(n,s,o);return s.length<2?o:l+r(s)}function t(n){const{cache:r}=n,o=(...l)=>{const{ref:i,args:c}=EG(l),p=aD(c,r.registered);return lD(r,p,!1),`${r.key}-${p.name}${i===void 0?"":` ${i}`}`};return{css:o,cx:(...l)=>e(r.registered,o,VP(l))}}return{cssFactory:t}})();function WP(){const e=kG();return wG(()=>MG({cache:e}),[e])}function OG({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const l=n.reduce((i,c)=>(Object.keys(c.classNames).forEach(p=>{typeof i[p]!="string"?i[p]=`${c.classNames[p]}`:i[p]=`${i[p]} ${c.classNames[p]}`}),i),{});return Object.keys(t).reduce((i,c)=>(i[c]=e(t[c],l[c],r!=null&&r[c],Array.isArray(o)?o.filter(Boolean).map(p=>`${(s==null?void 0:s.key)||"mantine"}-${p}-${c}`).join(" "):o?`${(s==null?void 0:s.key)||"mantine"}-${o}-${c}`:null),i),{})}var RG=Object.defineProperty,t4=Object.getOwnPropertySymbols,DG=Object.prototype.hasOwnProperty,AG=Object.prototype.propertyIsEnumerable,n4=(e,t,n)=>t in e?RG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mv=(e,t)=>{for(var n in t||(t={}))DG.call(t,n)&&n4(e,n,t[n]);if(t4)for(var n of t4(t))AG.call(t,n)&&n4(e,n,t[n]);return e};function nx(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=Mv(Mv({},e[n]),t[n]):e[n]=Mv({},t[n])}),e}function r4(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,l)=>nx(s,l),{}):o(e)}function TG({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,l)=>(l.variants&&r in l.variants&&nx(s,l.variants[r](t,n,{variant:r,size:o})),l.sizes&&o in l.sizes&&nx(s,l.sizes[o](t,n,{variant:r,size:o})),s),{})}function pr(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=xa(),l=Z$(o==null?void 0:o.name),i=r5(),c={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:p,cx:m}=WP(),h=t(s,r,c),g=r4(o==null?void 0:o.styles,s,r,c),x=r4(l,s,r,c),y=TG({ctx:l,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),b=Object.fromEntries(Object.keys(h).map(C=>{const S=m({[p(h[C])]:!(o!=null&&o.unstyled)},p(y[C]),p(x[C]),p(g[C]));return[C,S]}));return{classes:OG({cx:m,classes:b,context:l,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:i}),cx:m,theme:s}}return n}function o4(e){return`___ref-${e||""}`}var $G=Object.defineProperty,NG=Object.defineProperties,LG=Object.getOwnPropertyDescriptors,s4=Object.getOwnPropertySymbols,zG=Object.prototype.hasOwnProperty,FG=Object.prototype.propertyIsEnumerable,a4=(e,t,n)=>t in e?$G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Iu=(e,t)=>{for(var n in t||(t={}))zG.call(t,n)&&a4(e,n,t[n]);if(s4)for(var n of s4(t))FG.call(t,n)&&a4(e,n,t[n]);return e},Pu=(e,t)=>NG(e,LG(t));const Eu={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${Re(10)})`},transitionProperty:"transform, opacity"},cp={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(-${Re(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(${Re(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(${Re(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Re(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:Pu(Iu({},Eu),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Pu(Iu({},Eu),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Pu(Iu({},Eu),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Pu(Iu({},Eu),{common:{transformOrigin:"top left"}}),"pop-top-right":Pu(Iu({},Eu),{common:{transformOrigin:"top right"}})},l4=["mousedown","touchstart"];function BG(e,t,n){const r=d.useRef();return d.useEffect(()=>{const o=s=>{const{target:l}=s??{};if(Array.isArray(n)){const i=(l==null?void 0:l.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(l)&&l.tagName!=="HTML";n.every(p=>!!p&&!s.composedPath().includes(p))&&!i&&e()}else r.current&&!r.current.contains(l)&&e()};return(t||l4).forEach(s=>document.addEventListener(s,o)),()=>{(t||l4).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function HG(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function VG(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function WG(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=d.useState(n?t:VG(e,t)),s=d.useRef();return d.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),HG(s.current,l=>o(l.matches))},[e]),r}const UP=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Go(e,t){const n=d.useRef(!1);d.useEffect(()=>()=>{n.current=!1},[]),d.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function UG({opened:e,shouldReturnFocus:t=!0}){const n=d.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Go(()=>{let o=-1;const s=l=>{l.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 GG=/input|select|textarea|button|object/,GP="a, input, select, textarea, button, object, [tabindex]";function KG(e){return e.style.display==="none"}function qG(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(KG(n))return!1;n=n.parentNode}return!0}function KP(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function rx(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(KP(e));return(GG.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&qG(e)}function qP(e){const t=KP(e);return(Number.isNaN(t)||t>=0)&&rx(e)}function XG(e){return Array.from(e.querySelectorAll(GP)).filter(qP)}function QG(e,t){const n=XG(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 l=n[t.shiftKey?n.length-1:0];l&&l.focus()}function iy(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function YG(e,t="body > :not(script)"){const n=iy(),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 l=o.getAttribute("aria-hidden"),i=o.getAttribute("data-hidden"),c=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),l===null||l==="false"?o.setAttribute("aria-hidden","true"):!i&&!c&&o.setAttribute("data-hidden",l),{node:o,ariaHidden:i||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 ZG(e=!0){const t=d.useRef(),n=d.useRef(null),r=s=>{let l=s.querySelector("[data-autofocus]");if(!l){const i=Array.from(s.querySelectorAll(GP));l=i.find(qP)||i.find(rx)||null,!l&&rx(s)&&(l=s)}l&&l.focus({preventScroll:!0})},o=d.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=YG(s),t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)}},[e]);return d.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=l=>{l.key==="Tab"&&t.current&&QG(t.current,l)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const JG=H["useId".toString()]||(()=>{});function eK(){const e=JG();return e?`mantine-${e.replace(/:/g,"")}`:""}function cy(e){const t=eK(),[n,r]=d.useState(t);return UP(()=>{r(iy())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function i4(e,t,n){d.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function XP(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function tK(...e){return t=>{e.forEach(n=>XP(n,t))}}function Ud(...e){return d.useCallback(tK(...e),e)}function id({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=d.useState(t!==void 0?t:n),l=i=>{s(i),r==null||r(i)};return e!==void 0?[e,r,!0]:[o,l,!1]}function QP(e,t){return WG("(prefers-reduced-motion: reduce)",e,t)}const nK=e=>e<.5?2*e*e:-1+(4-2*e)*e,rK=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const l=!!n,c=(n||document.body).getBoundingClientRect(),p=t.getBoundingClientRect(),m=h=>p[h]-c[h];if(e==="y"){const h=m("top");if(h===0)return 0;if(r==="start"){const x=h-o;return x<=p.height*(s?0:1)||!s?x:0}const g=l?c.height:window.innerHeight;if(r==="end"){const x=h+o-g+p.height;return x>=-p.height*(s?0:1)||!s?x:0}return r==="center"?h-g/2+p.height/2:0}if(e==="x"){const h=m("left");if(h===0)return 0;if(r==="start"){const x=h-o;return x<=p.width||!s?x:0}const g=l?c.width:window.innerWidth;if(r==="end"){const x=h+o-g+p.width;return x>=-p.width||!s?x:0}return r==="center"?h-g/2+p.width/2:0}return 0},oK=({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]},sK=({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 YP({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=nK,offset:o=0,cancelable:s=!0,isList:l=!1}={}){const i=d.useRef(0),c=d.useRef(0),p=d.useRef(!1),m=d.useRef(null),h=d.useRef(null),g=QP(),x=()=>{i.current&&cancelAnimationFrame(i.current)},y=d.useCallback(({alignment:C="start"}={})=>{var S;p.current=!1,i.current&&x();const _=(S=oK({parent:m.current,axis:t}))!=null?S:0,j=rK({parent:m.current,target:h.current,axis:t,alignment:C,offset:o,isList:l})-(m.current?0:_);function E(){c.current===0&&(c.current=performance.now());const M=performance.now()-c.current,R=g||e===0?1:M/e,D=_+j*r(R);sK({parent:m.current,axis:t,distance:D}),!p.current&&R<1?i.current=requestAnimationFrame(E):(typeof n=="function"&&n(),c.current=0,i.current=0,x())}E()},[t,e,r,l,o,n,g]),b=()=>{s&&(p.current=!0)};return i4("wheel",b,{passive:!0}),i4("touchmove",b,{passive:!0}),d.useEffect(()=>x,[]),{scrollableRef:m,targetRef:h,scrollIntoView:y,cancel:x}}var c4=Object.getOwnPropertySymbols,aK=Object.prototype.hasOwnProperty,lK=Object.prototype.propertyIsEnumerable,iK=(e,t)=>{var n={};for(var r in e)aK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&c4)for(var r of c4(e))t.indexOf(r)<0&&lK.call(e,r)&&(n[r]=e[r]);return n};function sg(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:l,ml:i,mr:c,p,px:m,py:h,pt:g,pb:x,pl:y,pr:b,bg:C,c:S,opacity:_,ff:j,fz:E,fw:I,lts:M,ta:R,lh:D,fs:A,tt:O,td:$,w:X,miw:z,maw:V,h:Q,mih:G,mah:F,bgsz:U,bgp:T,bgr:B,bga:Y,pos:re,top:le,left:oe,bottom:q,right:K,inset:ee,display:ce}=t,J=iK(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:J$({m:n,mx:r,my:o,mt:s,mb:l,ml:i,mr:c,p,px:m,py:h,pt:g,pb:x,pl:y,pr:b,bg:C,c:S,opacity:_,ff:j,fz:E,fw:I,lts:M,ta:R,lh:D,fs:A,tt:O,td:$,w:X,miw:z,maw:V,h:Q,mih:G,mah:F,bgsz:U,bgp:T,bgr:B,bga:Y,pos:re,top:le,left:oe,bottom:q,right:K,inset:ee,display:ce}),rest:J}}function cK(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>Yw(mt({size:r,sizes:t.breakpoints}))-Yw(mt({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function uK({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return cK(e,t).reduce((l,i)=>{if(i==="base"&&e.base!==void 0){const p=n(e.base,t);return Array.isArray(r)?(r.forEach(m=>{l[m]=p}),l):(l[r]=p,l)}const c=n(e[i],t);return Array.isArray(r)?(l[t.fn.largerThan(i)]={},r.forEach(p=>{l[t.fn.largerThan(i)][p]=c}),l):(l[t.fn.largerThan(i)]={[r]:c},l)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,l)=>(s[l]=o,s),{}):{[r]:o}}function dK(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 fK(e){return Re(e)}function pK(e){return e}function mK(e,t){return mt({size:e,sizes:t.fontSizes})}const hK=["-xs","-sm","-md","-lg","-xl"];function gK(e,t){return hK.includes(e)?`calc(${mt({size:e.replace("-",""),sizes:t.spacing})} * -1)`:mt({size:e,sizes:t.spacing})}const vK={identity:pK,color:dK,size:fK,fontSize:mK,spacing:gK},xK={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 bK=Object.defineProperty,u4=Object.getOwnPropertySymbols,yK=Object.prototype.hasOwnProperty,CK=Object.prototype.propertyIsEnumerable,d4=(e,t,n)=>t in e?bK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f4=(e,t)=>{for(var n in t||(t={}))yK.call(t,n)&&d4(e,n,t[n]);if(u4)for(var n of u4(t))CK.call(t,n)&&d4(e,n,t[n]);return e};function p4(e,t,n=xK){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(uK({value:e[s],getValue:vK[n[s].type],property:n[s].property,theme:t})),o),[]).reduce((o,s)=>(Object.keys(s).forEach(l=>{typeof s[l]=="object"&&s[l]!==null&&l in o?o[l]=f4(f4({},o[l]),s[l]):o[l]=s[l]}),o),{})}function m4(e,t){return typeof e=="function"?e(t):e}function wK(e,t,n){const r=xa(),{css:o,cx:s}=WP();return Array.isArray(e)?s(n,o(p4(t,r)),e.map(l=>o(m4(l,r)))):s(n,o(m4(e,r)),o(p4(t,r)))}var SK=Object.defineProperty,ym=Object.getOwnPropertySymbols,ZP=Object.prototype.hasOwnProperty,JP=Object.prototype.propertyIsEnumerable,h4=(e,t,n)=>t in e?SK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kK=(e,t)=>{for(var n in t||(t={}))ZP.call(t,n)&&h4(e,n,t[n]);if(ym)for(var n of ym(t))JP.call(t,n)&&h4(e,n,t[n]);return e},_K=(e,t)=>{var n={};for(var r in e)ZP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ym)for(var r of ym(e))t.indexOf(r)<0&&JP.call(e,r)&&(n[r]=e[r]);return n};const e6=d.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:l}=n,i=_K(n,["className","component","style","sx"]);const{systemStyles:c,rest:p}=sg(i),m=o||"div";return H.createElement(m,kK({ref:t,className:wK(l,c,r),style:s},p))});e6.displayName="@mantine/core/Box";const zr=e6;var jK=Object.defineProperty,IK=Object.defineProperties,PK=Object.getOwnPropertyDescriptors,g4=Object.getOwnPropertySymbols,EK=Object.prototype.hasOwnProperty,MK=Object.prototype.propertyIsEnumerable,v4=(e,t,n)=>t in e?jK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,x4=(e,t)=>{for(var n in t||(t={}))EK.call(t,n)&&v4(e,n,t[n]);if(g4)for(var n of g4(t))MK.call(t,n)&&v4(e,n,t[n]);return e},OK=(e,t)=>IK(e,PK(t)),RK=pr(e=>({root:OK(x4(x4({},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 DK=RK;var AK=Object.defineProperty,Cm=Object.getOwnPropertySymbols,t6=Object.prototype.hasOwnProperty,n6=Object.prototype.propertyIsEnumerable,b4=(e,t,n)=>t in e?AK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,TK=(e,t)=>{for(var n in t||(t={}))t6.call(t,n)&&b4(e,n,t[n]);if(Cm)for(var n of Cm(t))n6.call(t,n)&&b4(e,n,t[n]);return e},$K=(e,t)=>{var n={};for(var r in e)t6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cm)for(var r of Cm(e))t.indexOf(r)<0&&n6.call(e,r)&&(n[r]=e[r]);return n};const r6=d.forwardRef((e,t)=>{const n=Rn("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:l}=n,i=$K(n,["className","component","unstyled","variant"]),{classes:c,cx:p}=DK(null,{name:"UnstyledButton",unstyled:s,variant:l});return H.createElement(zr,TK({component:o,ref:t,className:p(c.root,r),type:o==="button"?"button":void 0},i))});r6.displayName="@mantine/core/UnstyledButton";const NK=r6;var LK=Object.defineProperty,zK=Object.defineProperties,FK=Object.getOwnPropertyDescriptors,y4=Object.getOwnPropertySymbols,BK=Object.prototype.hasOwnProperty,HK=Object.prototype.propertyIsEnumerable,C4=(e,t,n)=>t in e?LK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ox=(e,t)=>{for(var n in t||(t={}))BK.call(t,n)&&C4(e,n,t[n]);if(y4)for(var n of y4(t))HK.call(t,n)&&C4(e,n,t[n]);return e},w4=(e,t)=>zK(e,FK(t));const VK=["subtle","filled","outline","light","default","transparent","gradient"],up={xs:Re(18),sm:Re(22),md:Re(28),lg:Re(34),xl:Re(44)};function WK({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%"})}:VK.includes(e)?ox({border:`${Re(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var UK=pr((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:w4(ox({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:mt({size:s,sizes:up}),minHeight:mt({size:s,sizes:up}),width:mt({size:s,sizes:up}),minWidth:mt({size:s,sizes:up})},WK({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":w4(ox({content:'""'},e.fn.cover(Re(-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 GK=UK;var KK=Object.defineProperty,wm=Object.getOwnPropertySymbols,o6=Object.prototype.hasOwnProperty,s6=Object.prototype.propertyIsEnumerable,S4=(e,t,n)=>t in e?KK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k4=(e,t)=>{for(var n in t||(t={}))o6.call(t,n)&&S4(e,n,t[n]);if(wm)for(var n of wm(t))s6.call(t,n)&&S4(e,n,t[n]);return e},_4=(e,t)=>{var n={};for(var r in e)o6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wm)for(var r of wm(e))t.indexOf(r)<0&&s6.call(e,r)&&(n[r]=e[r]);return n};function qK(e){var t=e,{size:n,color:r}=t,o=_4(t,["size","color"]);const s=o,{style:l}=s,i=_4(s,["style"]);return H.createElement("svg",k4({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,style:k4({width:n},l)},i),H.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},H.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"}),H.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"})),H.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},H.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"}),H.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"})),H.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},H.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"}),H.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"})),H.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},H.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"}),H.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 XK=Object.defineProperty,Sm=Object.getOwnPropertySymbols,a6=Object.prototype.hasOwnProperty,l6=Object.prototype.propertyIsEnumerable,j4=(e,t,n)=>t in e?XK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I4=(e,t)=>{for(var n in t||(t={}))a6.call(t,n)&&j4(e,n,t[n]);if(Sm)for(var n of Sm(t))l6.call(t,n)&&j4(e,n,t[n]);return e},P4=(e,t)=>{var n={};for(var r in e)a6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sm)for(var r of Sm(e))t.indexOf(r)<0&&l6.call(e,r)&&(n[r]=e[r]);return n};function QK(e){var t=e,{size:n,color:r}=t,o=P4(t,["size","color"]);const s=o,{style:l}=s,i=P4(s,["style"]);return H.createElement("svg",I4({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r,style:I4({width:n,height:n},l)},i),H.createElement("g",{fill:"none",fillRule:"evenodd"},H.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},H.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),H.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},H.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var YK=Object.defineProperty,km=Object.getOwnPropertySymbols,i6=Object.prototype.hasOwnProperty,c6=Object.prototype.propertyIsEnumerable,E4=(e,t,n)=>t in e?YK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M4=(e,t)=>{for(var n in t||(t={}))i6.call(t,n)&&E4(e,n,t[n]);if(km)for(var n of km(t))c6.call(t,n)&&E4(e,n,t[n]);return e},O4=(e,t)=>{var n={};for(var r in e)i6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&km)for(var r of km(e))t.indexOf(r)<0&&c6.call(e,r)&&(n[r]=e[r]);return n};function ZK(e){var t=e,{size:n,color:r}=t,o=O4(t,["size","color"]);const s=o,{style:l}=s,i=O4(s,["style"]);return H.createElement("svg",M4({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,style:M4({width:n},l)},i),H.createElement("circle",{cx:"15",cy:"15",r:"15"},H.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},H.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("circle",{cx:"105",cy:"15",r:"15"},H.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var JK=Object.defineProperty,_m=Object.getOwnPropertySymbols,u6=Object.prototype.hasOwnProperty,d6=Object.prototype.propertyIsEnumerable,R4=(e,t,n)=>t in e?JK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eq=(e,t)=>{for(var n in t||(t={}))u6.call(t,n)&&R4(e,n,t[n]);if(_m)for(var n of _m(t))d6.call(t,n)&&R4(e,n,t[n]);return e},tq=(e,t)=>{var n={};for(var r in e)u6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_m)for(var r of _m(e))t.indexOf(r)<0&&d6.call(e,r)&&(n[r]=e[r]);return n};const Ov={bars:qK,oval:QK,dots:ZK},nq={xs:Re(18),sm:Re(22),md:Re(36),lg:Re(44),xl:Re(58)},rq={size:"md"};function f6(e){const t=Rn("Loader",rq,e),{size:n,color:r,variant:o}=t,s=tq(t,["size","color","variant"]),l=xa(),i=o in Ov?o:l.loader;return H.createElement(zr,eq({role:"presentation",component:Ov[i]||Ov.bars,size:mt({size:n,sizes:nq}),color:l.fn.variant({variant:"filled",primaryFallback:!1,color:r||l.primaryColor}).background},s))}f6.displayName="@mantine/core/Loader";var oq=Object.defineProperty,jm=Object.getOwnPropertySymbols,p6=Object.prototype.hasOwnProperty,m6=Object.prototype.propertyIsEnumerable,D4=(e,t,n)=>t in e?oq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A4=(e,t)=>{for(var n in t||(t={}))p6.call(t,n)&&D4(e,n,t[n]);if(jm)for(var n of jm(t))m6.call(t,n)&&D4(e,n,t[n]);return e},sq=(e,t)=>{var n={};for(var r in e)p6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jm)for(var r of jm(e))t.indexOf(r)<0&&m6.call(e,r)&&(n[r]=e[r]);return n};const aq={color:"gray",size:"md",variant:"subtle"},h6=d.forwardRef((e,t)=>{const n=Rn("ActionIcon",aq,e),{className:r,color:o,children:s,radius:l,size:i,variant:c,gradient:p,disabled:m,loaderProps:h,loading:g,unstyled:x,__staticSelector:y}=n,b=sq(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:C,cx:S,theme:_}=GK({radius:l,color:o,gradient:p},{name:["ActionIcon",y],unstyled:x,size:i,variant:c}),j=H.createElement(f6,A4({color:_.fn.variant({color:o,variant:c}).color,size:"100%","data-action-icon-loader":!0},h));return H.createElement(NK,A4({className:S(C.root,r),ref:t,disabled:m,"data-disabled":m||void 0,"data-loading":g||void 0,unstyled:x},b),g?j:s)});h6.displayName="@mantine/core/ActionIcon";const lq=h6;var iq=Object.defineProperty,cq=Object.defineProperties,uq=Object.getOwnPropertyDescriptors,Im=Object.getOwnPropertySymbols,g6=Object.prototype.hasOwnProperty,v6=Object.prototype.propertyIsEnumerable,T4=(e,t,n)=>t in e?iq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dq=(e,t)=>{for(var n in t||(t={}))g6.call(t,n)&&T4(e,n,t[n]);if(Im)for(var n of Im(t))v6.call(t,n)&&T4(e,n,t[n]);return e},fq=(e,t)=>cq(e,uq(t)),pq=(e,t)=>{var n={};for(var r in e)g6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Im)for(var r of Im(e))t.indexOf(r)<0&&v6.call(e,r)&&(n[r]=e[r]);return n};function x6(e){const t=Rn("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,l=pq(t,["children","target","className","innerRef"]),i=xa(),[c,p]=d.useState(!1),m=d.useRef();return UP(()=>(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]),c?qr.createPortal(H.createElement("div",fq(dq({className:o,dir:i.dir},l),{ref:s}),n),m.current):null}x6.displayName="@mantine/core/Portal";var mq=Object.defineProperty,Pm=Object.getOwnPropertySymbols,b6=Object.prototype.hasOwnProperty,y6=Object.prototype.propertyIsEnumerable,$4=(e,t,n)=>t in e?mq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hq=(e,t)=>{for(var n in t||(t={}))b6.call(t,n)&&$4(e,n,t[n]);if(Pm)for(var n of Pm(t))y6.call(t,n)&&$4(e,n,t[n]);return e},gq=(e,t)=>{var n={};for(var r in e)b6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Pm)for(var r of Pm(e))t.indexOf(r)<0&&y6.call(e,r)&&(n[r]=e[r]);return n};function C6(e){var t=e,{withinPortal:n=!0,children:r}=t,o=gq(t,["withinPortal","children"]);return n?H.createElement(x6,hq({},o),r):H.createElement(H.Fragment,null,r)}C6.displayName="@mantine/core/OptionalPortal";var vq=Object.defineProperty,Em=Object.getOwnPropertySymbols,w6=Object.prototype.hasOwnProperty,S6=Object.prototype.propertyIsEnumerable,N4=(e,t,n)=>t in e?vq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L4=(e,t)=>{for(var n in t||(t={}))w6.call(t,n)&&N4(e,n,t[n]);if(Em)for(var n of Em(t))S6.call(t,n)&&N4(e,n,t[n]);return e},xq=(e,t)=>{var n={};for(var r in e)w6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Em)for(var r of Em(e))t.indexOf(r)<0&&S6.call(e,r)&&(n[r]=e[r]);return n};function k6(e){const t=e,{width:n,height:r,style:o}=t,s=xq(t,["width","height","style"]);return H.createElement("svg",L4({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:L4({width:n,height:r},o)},s),H.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"}))}k6.displayName="@mantine/core/CloseIcon";var bq=Object.defineProperty,Mm=Object.getOwnPropertySymbols,_6=Object.prototype.hasOwnProperty,j6=Object.prototype.propertyIsEnumerable,z4=(e,t,n)=>t in e?bq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yq=(e,t)=>{for(var n in t||(t={}))_6.call(t,n)&&z4(e,n,t[n]);if(Mm)for(var n of Mm(t))j6.call(t,n)&&z4(e,n,t[n]);return e},Cq=(e,t)=>{var n={};for(var r in e)_6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mm)for(var r of Mm(e))t.indexOf(r)<0&&j6.call(e,r)&&(n[r]=e[r]);return n};const wq={xs:Re(12),sm:Re(16),md:Re(20),lg:Re(28),xl:Re(34)},Sq={size:"sm"},I6=d.forwardRef((e,t)=>{const n=Rn("CloseButton",Sq,e),{iconSize:r,size:o,children:s}=n,l=Cq(n,["iconSize","size","children"]),i=Re(r||wq[o]);return H.createElement(lq,yq({ref:t,__staticSelector:"CloseButton",size:o},l),s||H.createElement(k6,{width:i,height:i}))});I6.displayName="@mantine/core/CloseButton";const P6=I6;var kq=Object.defineProperty,_q=Object.defineProperties,jq=Object.getOwnPropertyDescriptors,F4=Object.getOwnPropertySymbols,Iq=Object.prototype.hasOwnProperty,Pq=Object.prototype.propertyIsEnumerable,B4=(e,t,n)=>t in e?kq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dp=(e,t)=>{for(var n in t||(t={}))Iq.call(t,n)&&B4(e,n,t[n]);if(F4)for(var n of F4(t))Pq.call(t,n)&&B4(e,n,t[n]);return e},Eq=(e,t)=>_q(e,jq(t));function Mq({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function Oq({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 Rq(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function Dq({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 Aq=pr((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:l,gradient:i,weight:c,transform:p,align:m,strikethrough:h,italic:g},{size:x})=>{const y=e.fn.variant({variant:"gradient",gradient:i});return{root:Eq(dp(dp(dp(dp({},e.fn.fontStyles()),e.fn.focusStyles()),Rq(n)),Dq({theme:e,truncate:r})),{color:Oq({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||x===void 0?"inherit":mt({size:x,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:Mq({underline:l,strikethrough:h}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":c,textTransform:p,textAlign:m,fontStyle:g?"italic":void 0}),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const Tq=Aq;var $q=Object.defineProperty,Om=Object.getOwnPropertySymbols,E6=Object.prototype.hasOwnProperty,M6=Object.prototype.propertyIsEnumerable,H4=(e,t,n)=>t in e?$q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nq=(e,t)=>{for(var n in t||(t={}))E6.call(t,n)&&H4(e,n,t[n]);if(Om)for(var n of Om(t))M6.call(t,n)&&H4(e,n,t[n]);return e},Lq=(e,t)=>{var n={};for(var r in e)E6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Om)for(var r of Om(e))t.indexOf(r)<0&&M6.call(e,r)&&(n[r]=e[r]);return n};const zq={variant:"text"},O6=d.forwardRef((e,t)=>{const n=Rn("Text",zq,e),{className:r,size:o,weight:s,transform:l,color:i,align:c,variant:p,lineClamp:m,truncate:h,gradient:g,inline:x,inherit:y,underline:b,strikethrough:C,italic:S,classNames:_,styles:j,unstyled:E,span:I,__staticSelector:M}=n,R=Lq(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:D,cx:A}=Tq({color:i,lineClamp:m,truncate:h,inline:x,inherit:y,underline:b,strikethrough:C,italic:S,weight:s,transform:l,align:c,gradient:g},{unstyled:E,name:M||"Text",variant:p,size:o});return H.createElement(zr,Nq({ref:t,className:A(D.root,{[D.gradient]:p==="gradient"},r),component:I?"span":"div"},R))});O6.displayName="@mantine/core/Text";const kc=O6,fp={xs:Re(1),sm:Re(2),md:Re(3),lg:Re(4),xl:Re(5)};function pp(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 Fq=pr((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:Re(1),borderTop:`${mt({size:n,sizes:fp})} ${r} ${pp(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${mt({size:n,sizes:fp})} ${r} ${pp(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:Re(mt({size:n,sizes:fp})),borderTopColor:pp(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:Re(mt({size:n,sizes:fp})),borderLeftColor:pp(e,t),borderLeftStyle:r}}));const Bq=Fq;var Hq=Object.defineProperty,Vq=Object.defineProperties,Wq=Object.getOwnPropertyDescriptors,Rm=Object.getOwnPropertySymbols,R6=Object.prototype.hasOwnProperty,D6=Object.prototype.propertyIsEnumerable,V4=(e,t,n)=>t in e?Hq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W4=(e,t)=>{for(var n in t||(t={}))R6.call(t,n)&&V4(e,n,t[n]);if(Rm)for(var n of Rm(t))D6.call(t,n)&&V4(e,n,t[n]);return e},Uq=(e,t)=>Vq(e,Wq(t)),Gq=(e,t)=>{var n={};for(var r in e)R6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rm)for(var r of Rm(e))t.indexOf(r)<0&&D6.call(e,r)&&(n[r]=e[r]);return n};const Kq={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},sx=d.forwardRef((e,t)=>{const n=Rn("Divider",Kq,e),{className:r,color:o,orientation:s,size:l,label:i,labelPosition:c,labelProps:p,variant:m,styles:h,classNames:g,unstyled:x}=n,y=Gq(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:b,cx:C}=Bq({color:o},{classNames:g,styles:h,unstyled:x,name:"Divider",variant:m,size:l}),S=s==="vertical",_=s==="horizontal",j=!!i&&_,E=!(p!=null&&p.color);return H.createElement(zr,W4({ref:t,className:C(b.root,{[b.vertical]:S,[b.horizontal]:_,[b.withLabel]:j},r),role:"separator"},y),j&&H.createElement(kc,Uq(W4({},p),{size:(p==null?void 0:p.size)||"xs",mt:Re(2),className:C(b.label,b[c],{[b.labelDefaultStyles]:E})}),i))});sx.displayName="@mantine/core/Divider";var qq=Object.defineProperty,Xq=Object.defineProperties,Qq=Object.getOwnPropertyDescriptors,U4=Object.getOwnPropertySymbols,Yq=Object.prototype.hasOwnProperty,Zq=Object.prototype.propertyIsEnumerable,G4=(e,t,n)=>t in e?qq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K4=(e,t)=>{for(var n in t||(t={}))Yq.call(t,n)&&G4(e,n,t[n]);if(U4)for(var n of U4(t))Zq.call(t,n)&&G4(e,n,t[n]);return e},Jq=(e,t)=>Xq(e,Qq(t)),eX=pr((e,t,{size:n})=>({item:Jq(K4({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${mt({size:n,sizes:e.spacing})} / 1.5) ${mt({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:mt({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]":K4({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(${mt({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${mt({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${mt({size:n,sizes:e.spacing})} / 1.5) ${mt({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const tX=eX;var nX=Object.defineProperty,q4=Object.getOwnPropertySymbols,rX=Object.prototype.hasOwnProperty,oX=Object.prototype.propertyIsEnumerable,X4=(e,t,n)=>t in e?nX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sX=(e,t)=>{for(var n in t||(t={}))rX.call(t,n)&&X4(e,n,t[n]);if(q4)for(var n of q4(t))oX.call(t,n)&&X4(e,n,t[n]);return e};function uy({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:l,onItemHover:i,onItemSelect:c,itemsRefs:p,itemComponent:m,size:h,nothingFound:g,creatable:x,createLabel:y,unstyled:b,variant:C}){const{classes:S}=tX(null,{classNames:n,styles:r,unstyled:b,name:l,variant:C,size:h}),_=[],j=[];let E=null;const I=(R,D)=>{const A=typeof o=="function"?o(R.value):!1;return H.createElement(m,sX({key:R.value,className:S.item,"data-disabled":R.disabled||void 0,"data-hovered":!R.disabled&&t===D||void 0,"data-selected":!R.disabled&&A||void 0,selected:A,onMouseEnter:()=>i(D),id:`${s}-${D}`,role:"option",tabIndex:-1,"aria-selected":t===D,ref:O=>{p&&p.current&&(p.current[R.value]=O)},onMouseDown:R.disabled?null:O=>{O.preventDefault(),c(R)},disabled:R.disabled,variant:C},R))};let M=null;if(e.forEach((R,D)=>{R.creatable?E=D:R.group?(M!==R.group&&(M=R.group,j.push(H.createElement("div",{className:S.separator,key:`__mantine-divider-${D}`},H.createElement(sx,{classNames:{label:S.separatorLabel},label:R.group})))),j.push(I(R,D))):_.push(I(R,D))}),x){const R=e[E];_.push(H.createElement("div",{key:iy(),className:S.item,"data-hovered":t===E||void 0,onMouseEnter:()=>i(E),onMouseDown:D=>{D.preventDefault(),c(R)},tabIndex:-1,ref:D=>{p&&p.current&&(p.current[R.value]=D)}},y))}return j.length>0&&_.length>0&&_.unshift(H.createElement("div",{className:S.separator,key:"empty-group-separator"},H.createElement(sx,null))),j.length>0||_.length>0?H.createElement(H.Fragment,null,j,_):H.createElement(kc,{size:h,unstyled:b,className:S.nothingFound},g)}uy.displayName="@mantine/core/SelectItems";var aX=Object.defineProperty,Dm=Object.getOwnPropertySymbols,A6=Object.prototype.hasOwnProperty,T6=Object.prototype.propertyIsEnumerable,Q4=(e,t,n)=>t in e?aX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lX=(e,t)=>{for(var n in t||(t={}))A6.call(t,n)&&Q4(e,n,t[n]);if(Dm)for(var n of Dm(t))T6.call(t,n)&&Q4(e,n,t[n]);return e},iX=(e,t)=>{var n={};for(var r in e)A6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dm)for(var r of Dm(e))t.indexOf(r)<0&&T6.call(e,r)&&(n[r]=e[r]);return n};const dy=d.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=iX(n,["label","value"]);return H.createElement("div",lX({ref:t},s),r||o)});dy.displayName="@mantine/core/DefaultItem";function cX(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function $6(...e){return t=>e.forEach(n=>cX(n,t))}function ai(...e){return d.useCallback($6(...e),e)}const N6=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(dX);if(s){const l=s.props.children,i=o.map(c=>c===s?d.Children.count(l)>1?d.Children.only(null):d.isValidElement(l)?l.props.children:null:c);return d.createElement(ax,fn({},r,{ref:t}),d.isValidElement(l)?d.cloneElement(l,void 0,i):null)}return d.createElement(ax,fn({},r,{ref:t}),n)});N6.displayName="Slot";const ax=d.forwardRef((e,t)=>{const{children:n,...r}=e;return d.isValidElement(n)?d.cloneElement(n,{...fX(r,n.props),ref:$6(t,n.ref)}):d.Children.count(n)>1?d.Children.only(null):null});ax.displayName="SlotClone";const uX=({children:e})=>d.createElement(d.Fragment,null,e);function dX(e){return d.isValidElement(e)&&e.type===uX}function fX(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]=(...i)=>{s(...i),o(...i)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}const pX=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Gd=pX.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...l}=r,i=s?N6:t;return d.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),d.createElement(i,fn({},l,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),lx=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function mX(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Kd=e=>{const{present:t,children:n}=e,r=hX(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=ai(r.ref,o.ref);return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Kd.displayName="Presence";function hX(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),l=e?"mounted":"unmounted",[i,c]=mX(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const p=mp(r.current);s.current=i==="mounted"?p:"none"},[i]),lx(()=>{const p=r.current,m=o.current;if(m!==e){const g=s.current,x=mp(p);e?c("MOUNT"):x==="none"||(p==null?void 0:p.display)==="none"?c("UNMOUNT"):c(m&&g!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),lx(()=>{if(t){const p=h=>{const x=mp(r.current).includes(h.animationName);h.target===t&&x&&qr.flushSync(()=>c("ANIMATION_END"))},m=h=>{h.target===t&&(s.current=mp(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 c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:d.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function mp(e){return(e==null?void 0:e.animationName)||"none"}function gX(e,t=[]){let n=[];function r(s,l){const i=d.createContext(l),c=n.length;n=[...n,l];function p(h){const{scope:g,children:x,...y}=h,b=(g==null?void 0:g[e][c])||i,C=d.useMemo(()=>y,Object.values(y));return d.createElement(b.Provider,{value:C},x)}function m(h,g){const x=(g==null?void 0:g[e][c])||i,y=d.useContext(x);if(y)return y;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${s}\``)}return p.displayName=s+"Provider",[p,m]}const o=()=>{const s=n.map(l=>d.createContext(l));return function(i){const c=(i==null?void 0:i[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return o.scopeName=e,[r,vX(o,...t)]}function vX(...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 l=r.reduce((i,{useScope:c,scopeName:p})=>{const h=c(s)[`__scope${p}`];return{...i,...h}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Ml(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const xX=d.createContext(void 0);function bX(e){const t=d.useContext(xX);return e||t||"ltr"}function yX(e,[t,n]){return Math.min(n,Math.max(t,e))}function Nl(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 CX(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const L6="ScrollArea",[z6,J1e]=gX(L6),[wX,jo]=z6(L6),SX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...l}=e,[i,c]=d.useState(null),[p,m]=d.useState(null),[h,g]=d.useState(null),[x,y]=d.useState(null),[b,C]=d.useState(null),[S,_]=d.useState(0),[j,E]=d.useState(0),[I,M]=d.useState(!1),[R,D]=d.useState(!1),A=ai(t,$=>c($)),O=bX(o);return d.createElement(wX,{scope:n,type:r,dir:O,scrollHideDelay:s,scrollArea:i,viewport:p,onViewportChange:m,content:h,onContentChange:g,scrollbarX:x,onScrollbarXChange:y,scrollbarXEnabled:I,onScrollbarXEnabledChange:M,scrollbarY:b,onScrollbarYChange:C,scrollbarYEnabled:R,onScrollbarYEnabledChange:D,onCornerWidthChange:_,onCornerHeightChange:E},d.createElement(Gd.div,fn({dir:O},l,{ref:A,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})))}),kX="ScrollAreaViewport",_X=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=jo(kX,n),l=d.useRef(null),i=ai(t,l,s.onViewportChange);return d.createElement(d.Fragment,null,d.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}"}}),d.createElement(Gd.div,fn({"data-radix-scroll-area-viewport":""},o,{ref:i,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),d.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),ya="ScrollAreaScrollbar",jX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jo(ya,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=o,i=e.orientation==="horizontal";return d.useEffect(()=>(i?s(!0):l(!0),()=>{i?s(!1):l(!1)}),[i,s,l]),o.type==="hover"?d.createElement(IX,fn({},r,{ref:t,forceMount:n})):o.type==="scroll"?d.createElement(PX,fn({},r,{ref:t,forceMount:n})):o.type==="auto"?d.createElement(F6,fn({},r,{ref:t,forceMount:n})):o.type==="always"?d.createElement(fy,fn({},r,{ref:t})):null}),IX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jo(ya,e.__scopeScrollArea),[s,l]=d.useState(!1);return d.useEffect(()=>{const i=o.scrollArea;let c=0;if(i){const p=()=>{window.clearTimeout(c),l(!0)},m=()=>{c=window.setTimeout(()=>l(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",p),i.addEventListener("pointerleave",m),()=>{window.clearTimeout(c),i.removeEventListener("pointerenter",p),i.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),d.createElement(Kd,{present:n||s},d.createElement(F6,fn({"data-state":s?"visible":"hidden"},r,{ref:t})))}),PX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jo(ya,e.__scopeScrollArea),s=e.orientation==="horizontal",l=lg(()=>c("SCROLL_END"),100),[i,c]=CX("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 d.useEffect(()=>{if(i==="idle"){const p=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[i,o.scrollHideDelay,c]),d.useEffect(()=>{const p=o.viewport,m=s?"scrollLeft":"scrollTop";if(p){let h=p[m];const g=()=>{const x=p[m];h!==x&&(c("SCROLL"),l()),h=x};return p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[o.viewport,s,c,l]),d.createElement(Kd,{present:n||i!=="hidden"},d.createElement(fy,fn({"data-state":i==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Nl(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Nl(e.onPointerLeave,()=>c("POINTER_LEAVE"))})))}),F6=d.forwardRef((e,t)=>{const n=jo(ya,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,l]=d.useState(!1),i=e.orientation==="horizontal",c=lg(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;l(i?p:m)}},10);return _c(n.viewport,c),_c(n.content,c),d.createElement(Kd,{present:r||s},d.createElement(fy,fn({"data-state":s?"visible":"hidden"},o,{ref:t})))}),fy=d.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=jo(ya,e.__scopeScrollArea),s=d.useRef(null),l=d.useRef(0),[i,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=W6(i.viewport,i.content),m={...r,sizes:i,onSizesChange:c,hasThumb:p>0&&p<1,onThumbChange:g=>s.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function h(g,x){return $X(g,l.current,i,x)}return n==="horizontal"?d.createElement(EX,fn({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const g=o.viewport.scrollLeft,x=Y4(g,i,o.dir);s.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollLeft=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollLeft=h(g,o.dir))}})):n==="vertical"?d.createElement(MX,fn({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const g=o.viewport.scrollTop,x=Y4(g,i);s.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollTop=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollTop=h(g))}})):null}),EX=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=jo(ya,e.__scopeScrollArea),[l,i]=d.useState(),c=d.useRef(null),p=ai(t,c,s.onScrollbarXChange);return d.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),d.createElement(H6,fn({"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":ag(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,h)=>{if(s.viewport){const g=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),G6(g,h)&&m.preventDefault()}},onResize:()=>{c.current&&s.viewport&&l&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Am(l.paddingLeft),paddingEnd:Am(l.paddingRight)}})}}))}),MX=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=jo(ya,e.__scopeScrollArea),[l,i]=d.useState(),c=d.useRef(null),p=ai(t,c,s.onScrollbarYChange);return d.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),d.createElement(H6,fn({"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":ag(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,h)=>{if(s.viewport){const g=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),G6(g,h)&&m.preventDefault()}},onResize:()=>{c.current&&s.viewport&&l&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Am(l.paddingTop),paddingEnd:Am(l.paddingBottom)}})}}))}),[OX,B6]=z6(ya),H6=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:l,onThumbPointerDown:i,onThumbPositionChange:c,onDragScroll:p,onWheelScroll:m,onResize:h,...g}=e,x=jo(ya,n),[y,b]=d.useState(null),C=ai(t,A=>b(A)),S=d.useRef(null),_=d.useRef(""),j=x.viewport,E=r.content-r.viewport,I=Ml(m),M=Ml(c),R=lg(h,10);function D(A){if(S.current){const O=A.clientX-S.current.left,$=A.clientY-S.current.top;p({x:O,y:$})}}return d.useEffect(()=>{const A=O=>{const $=O.target;(y==null?void 0:y.contains($))&&I(O,E)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[j,y,E,I]),d.useEffect(M,[r,M]),_c(y,R),_c(x.content,R),d.createElement(OX,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:Ml(s),onThumbPointerUp:Ml(l),onThumbPositionChange:M,onThumbPointerDown:Ml(i)},d.createElement(Gd.div,fn({},g,{ref:C,style:{position:"absolute",...g.style},onPointerDown:Nl(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),S.current=y.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",D(A))}),onPointerMove:Nl(e.onPointerMove,D),onPointerUp:Nl(e.onPointerUp,A=>{const O=A.target;O.hasPointerCapture(A.pointerId)&&O.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=_.current,S.current=null})})))}),ix="ScrollAreaThumb",RX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=B6(ix,e.__scopeScrollArea);return d.createElement(Kd,{present:n||o.hasThumb},d.createElement(DX,fn({ref:t},r)))}),DX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=jo(ix,n),l=B6(ix,n),{onThumbPositionChange:i}=l,c=ai(t,h=>l.onThumbChange(h)),p=d.useRef(),m=lg(()=>{p.current&&(p.current(),p.current=void 0)},100);return d.useEffect(()=>{const h=s.viewport;if(h){const g=()=>{if(m(),!p.current){const x=NX(h,i);p.current=x,i()}};return i(),h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[s.viewport,m,i]),d.createElement(Gd.div,fn({"data-state":l.hasThumb?"visible":"hidden"},o,{ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Nl(e.onPointerDownCapture,h=>{const x=h.target.getBoundingClientRect(),y=h.clientX-x.left,b=h.clientY-x.top;l.onThumbPointerDown({x:y,y:b})}),onPointerUp:Nl(e.onPointerUp,l.onThumbPointerUp)}))}),V6="ScrollAreaCorner",AX=d.forwardRef((e,t)=>{const n=jo(V6,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.createElement(TX,fn({},e,{ref:t})):null}),TX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=jo(V6,n),[s,l]=d.useState(0),[i,c]=d.useState(0),p=!!(s&&i);return _c(o.scrollbarX,()=>{var m;const h=((m=o.scrollbarX)===null||m===void 0?void 0:m.offsetHeight)||0;o.onCornerHeightChange(h),c(h)}),_c(o.scrollbarY,()=>{var m;const h=((m=o.scrollbarY)===null||m===void 0?void 0:m.offsetWidth)||0;o.onCornerWidthChange(h),l(h)}),p?d.createElement(Gd.div,fn({},r,{ref:t,style:{width:s,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Am(e){return e?parseInt(e,10):0}function W6(e,t){const n=e/t;return isNaN(n)?0:n}function ag(e){const t=W6(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function $X(e,t,n,r="ltr"){const o=ag(n),s=o/2,l=t||s,i=o-l,c=n.scrollbar.paddingStart+l,p=n.scrollbar.size-n.scrollbar.paddingEnd-i,m=n.content-n.viewport,h=r==="ltr"?[0,m]:[m*-1,0];return U6([c,p],h)(e)}function Y4(e,t,n="ltr"){const r=ag(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,l=t.content-t.viewport,i=s-r,c=n==="ltr"?[0,l]:[l*-1,0],p=yX(e,c);return U6([0,l],[0,i])(p)}function U6(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 G6(e,t){return e>0&&e<t}const NX=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},l=n.left!==s.left,i=n.top!==s.top;(l||i)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function lg(e,t){const n=Ml(e),r=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),d.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function _c(e,t){const n=Ml(t);lx(()=>{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 LX=SX,zX=_X,Z4=jX,J4=RX,FX=AX;var BX=pr((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?Re(t):void 0,paddingBottom:n?Re(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${Re(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${o4("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:Re(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:Re(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:o4("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:Re(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:Re(44),minHeight:Re(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 HX=BX;var VX=Object.defineProperty,WX=Object.defineProperties,UX=Object.getOwnPropertyDescriptors,Tm=Object.getOwnPropertySymbols,K6=Object.prototype.hasOwnProperty,q6=Object.prototype.propertyIsEnumerable,ek=(e,t,n)=>t in e?VX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cx=(e,t)=>{for(var n in t||(t={}))K6.call(t,n)&&ek(e,n,t[n]);if(Tm)for(var n of Tm(t))q6.call(t,n)&&ek(e,n,t[n]);return e},X6=(e,t)=>WX(e,UX(t)),Q6=(e,t)=>{var n={};for(var r in e)K6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tm)for(var r of Tm(e))t.indexOf(r)<0&&q6.call(e,r)&&(n[r]=e[r]);return n};const Y6={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},ig=d.forwardRef((e,t)=>{const n=Rn("ScrollArea",Y6,e),{children:r,className:o,classNames:s,styles:l,scrollbarSize:i,scrollHideDelay:c,type:p,dir:m,offsetScrollbars:h,viewportRef:g,onScrollPositionChange:x,unstyled:y,variant:b,viewportProps:C}=n,S=Q6(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[_,j]=d.useState(!1),E=xa(),{classes:I,cx:M}=HX({scrollbarSize:i,offsetScrollbars:h,scrollbarHovered:_,hidden:p==="never"},{name:"ScrollArea",classNames:s,styles:l,unstyled:y,variant:b});return H.createElement(LX,{type:p==="never"?"always":p,scrollHideDelay:c,dir:m||E.dir,ref:t,asChild:!0},H.createElement(zr,cx({className:M(I.root,o)},S),H.createElement(zX,X6(cx({},C),{className:I.viewport,ref:g,onScroll:typeof x=="function"?({currentTarget:R})=>x({x:R.scrollLeft,y:R.scrollTop}):void 0}),r),H.createElement(Z4,{orientation:"horizontal",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(J4,{className:I.thumb})),H.createElement(Z4,{orientation:"vertical",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(J4,{className:I.thumb})),H.createElement(FX,{className:I.corner})))}),Z6=d.forwardRef((e,t)=>{const n=Rn("ScrollAreaAutosize",Y6,e),{children:r,classNames:o,styles:s,scrollbarSize:l,scrollHideDelay:i,type:c,dir:p,offsetScrollbars:m,viewportRef:h,onScrollPositionChange:g,unstyled:x,sx:y,variant:b,viewportProps:C}=n,S=Q6(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return H.createElement(zr,X6(cx({},S),{ref:t,sx:[{display:"flex"},...zP(y)]}),H.createElement(zr,{sx:{display:"flex",flexDirection:"column",flex:1}},H.createElement(ig,{classNames:o,styles:s,scrollHideDelay:i,scrollbarSize:l,type:c,dir:p,offsetScrollbars:m,viewportRef:h,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:C},r)))});Z6.displayName="@mantine/core/ScrollAreaAutosize";ig.displayName="@mantine/core/ScrollArea";ig.Autosize=Z6;const J6=ig;var GX=Object.defineProperty,KX=Object.defineProperties,qX=Object.getOwnPropertyDescriptors,$m=Object.getOwnPropertySymbols,eE=Object.prototype.hasOwnProperty,tE=Object.prototype.propertyIsEnumerable,tk=(e,t,n)=>t in e?GX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nk=(e,t)=>{for(var n in t||(t={}))eE.call(t,n)&&tk(e,n,t[n]);if($m)for(var n of $m(t))tE.call(t,n)&&tk(e,n,t[n]);return e},XX=(e,t)=>KX(e,qX(t)),QX=(e,t)=>{var n={};for(var r in e)eE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$m)for(var r of $m(e))t.indexOf(r)<0&&tE.call(e,r)&&(n[r]=e[r]);return n};const cg=d.forwardRef((e,t)=>{var n=e,{style:r}=n,o=QX(n,["style"]);return H.createElement(J6,XX(nk({},o),{style:nk({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});cg.displayName="@mantine/core/SelectScrollArea";var YX=pr(()=>({dropdown:{},itemsWrapper:{padding:Re(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const ZX=YX;function Vc(e){return e.split("-")[1]}function py(e){return e==="y"?"height":"width"}function Ko(e){return e.split("-")[0]}function ul(e){return["top","bottom"].includes(Ko(e))?"x":"y"}function rk(e,t,n){let{reference:r,floating:o}=e;const s=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,i=ul(t),c=py(i),p=r[c]/2-o[c]/2,m=i==="x";let h;switch(Ko(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:l};break;case"left":h={x:r.x-o.width,y:l};break;default:h={x:r.x,y:r.y}}switch(Vc(t)){case"start":h[i]-=p*(n&&m?-1:1);break;case"end":h[i]+=p*(n&&m?-1:1)}return h}const JX=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:l}=n,i=s.filter(Boolean),c=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:h}=rk(p,r,c),g=r,x={},y=0;for(let b=0;b<i.length;b++){const{name:C,fn:S}=i[b],{x:_,y:j,data:E,reset:I}=await S({x:m,y:h,initialPlacement:r,placement:g,strategy:o,middlewareData:x,rects:p,platform:l,elements:{reference:e,floating:t}});m=_??m,h=j??h,x={...x,[C]:{...x[C],...E}},I&&y<=50&&(y++,typeof I=="object"&&(I.placement&&(g=I.placement),I.rects&&(p=I.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:m,y:h}=rk(p,g,c)),b=-1)}return{x:m,y:h,placement:g,strategy:o,middlewareData:x}};function ia(e,t){return typeof e=="function"?e(t):e}function my(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 jc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function hy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:l,elements:i,strategy:c}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:g=!1,padding:x=0}=ia(t,e),y=my(x),b=i[g?h==="floating"?"reference":"floating":h],C=jc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:p,rootBoundary:m,strategy:c})),S=h==="floating"?{...l.floating,x:r,y:o}:l.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),j=await(s.isElement==null?void 0:s.isElement(_))&&await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1},E=jc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:_,strategy:c}):S);return{top:(C.top-E.top+y.top)/j.y,bottom:(E.bottom-C.bottom+y.bottom)/j.y,left:(C.left-E.left+y.left)/j.x,right:(E.right-C.right+y.right)/j.x}}const tl=Math.min,hs=Math.max;function ux(e,t,n){return hs(e,tl(t,n))}const ok=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:l,elements:i}=t,{element:c,padding:p=0}=ia(e,t)||{};if(c==null)return{};const m=my(p),h={x:n,y:r},g=ul(o),x=py(g),y=await l.getDimensions(c),b=g==="y",C=b?"top":"left",S=b?"bottom":"right",_=b?"clientHeight":"clientWidth",j=s.reference[x]+s.reference[g]-h[g]-s.floating[x],E=h[g]-s.reference[g],I=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let M=I?I[_]:0;M&&await(l.isElement==null?void 0:l.isElement(I))||(M=i.floating[_]||s.floating[x]);const R=j/2-E/2,D=M/2-y[x]/2-1,A=tl(m[C],D),O=tl(m[S],D),$=A,X=M-y[x]-O,z=M/2-y[x]/2+R,V=ux($,z,X),Q=Vc(o)!=null&&z!=V&&s.reference[x]/2-(z<$?A:O)-y[x]/2<0?z<$?$-z:X-z:0;return{[g]:h[g]-Q,data:{[g]:V,centerOffset:z-V+Q}}}}),eQ=["top","right","bottom","left"];eQ.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const tQ={left:"right",right:"left",bottom:"top",top:"bottom"};function Nm(e){return e.replace(/left|right|bottom|top/g,t=>tQ[t])}function nQ(e,t,n){n===void 0&&(n=!1);const r=Vc(e),o=ul(e),s=py(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(l=Nm(l)),{main:l,cross:Nm(l)}}const rQ={start:"end",end:"start"};function Rv(e){return e.replace(/start|end/g,t=>rQ[t])}const oQ=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:s,initialPlacement:l,platform:i,elements:c}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...b}=ia(e,t),C=Ko(r),S=Ko(l)===l,_=await(i.isRTL==null?void 0:i.isRTL(c.floating)),j=h||(S||!y?[Nm(l)]:function($){const X=Nm($);return[Rv($),X,Rv(X)]}(l));h||x==="none"||j.push(...function($,X,z,V){const Q=Vc($);let G=function(F,U,T){const B=["left","right"],Y=["right","left"],re=["top","bottom"],le=["bottom","top"];switch(F){case"top":case"bottom":return T?U?Y:B:U?B:Y;case"left":case"right":return U?re:le;default:return[]}}(Ko($),z==="start",V);return Q&&(G=G.map(F=>F+"-"+Q),X&&(G=G.concat(G.map(Rv)))),G}(l,y,x,_));const E=[l,...j],I=await hy(t,b),M=[];let R=((n=o.flip)==null?void 0:n.overflows)||[];if(p&&M.push(I[C]),m){const{main:$,cross:X}=nQ(r,s,_);M.push(I[$],I[X])}if(R=[...R,{placement:r,overflows:M}],!M.every($=>$<=0)){var D,A;const $=(((D=o.flip)==null?void 0:D.index)||0)+1,X=E[$];if(X)return{data:{index:$,overflows:R},reset:{placement:X}};let z=(A=R.filter(V=>V.overflows[0]<=0).sort((V,Q)=>V.overflows[1]-Q.overflows[1])[0])==null?void 0:A.placement;if(!z)switch(g){case"bestFit":{var O;const V=(O=R.map(Q=>[Q.placement,Q.overflows.filter(G=>G>0).reduce((G,F)=>G+F,0)]).sort((Q,G)=>Q[1]-G[1])[0])==null?void 0:O[0];V&&(z=V);break}case"initialPlacement":z=l}if(r!==z)return{reset:{placement:z}}}return{}}}};function sk(e){const t=tl(...e.map(r=>r.left)),n=tl(...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 sQ=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:l}=t,{padding:i=2,x:c,y:p}=ia(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),h=function(b){const C=b.slice().sort((j,E)=>j.y-E.y),S=[];let _=null;for(let j=0;j<C.length;j++){const E=C[j];!_||E.y-_.y>_.height/2?S.push([E]):S[S.length-1].push(E),_=E}return S.map(j=>jc(sk(j)))}(m),g=jc(sk(m)),x=my(i),y=await s.getElementRects({reference:{getBoundingClientRect:function(){if(h.length===2&&h[0].left>h[1].right&&c!=null&&p!=null)return h.find(b=>c>b.left-x.left&&c<b.right+x.right&&p>b.top-x.top&&p<b.bottom+x.bottom)||g;if(h.length>=2){if(ul(n)==="x"){const I=h[0],M=h[h.length-1],R=Ko(n)==="top",D=I.top,A=M.bottom,O=R?I.left:M.left,$=R?I.right:M.right;return{top:D,bottom:A,left:O,right:$,width:$-O,height:A-D,x:O,y:D}}const b=Ko(n)==="left",C=hs(...h.map(I=>I.right)),S=tl(...h.map(I=>I.left)),_=h.filter(I=>b?I.left===S:I.right===C),j=_[0].top,E=_[_.length-1].bottom;return{top:j,bottom:E,left:S,right:C,width:C-S,height:E-j,x:S,y:j}}return g}},floating:r.floating,strategy:l});return o.reference.x!==y.reference.x||o.reference.y!==y.reference.y||o.reference.width!==y.reference.width||o.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},aQ=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,l){const{placement:i,platform:c,elements:p}=s,m=await(c.isRTL==null?void 0:c.isRTL(p.floating)),h=Ko(i),g=Vc(i),x=ul(i)==="x",y=["left","top"].includes(h)?-1:1,b=m&&x?-1:1,C=ia(l,s);let{mainAxis:S,crossAxis:_,alignmentAxis:j}=typeof C=="number"?{mainAxis:C,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...C};return g&&typeof j=="number"&&(_=g==="end"?-1*j:j),x?{x:_*b,y:S*y}:{x:S*y,y:_*b}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function nE(e){return e==="x"?"y":"x"}const lQ=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:l=!1,limiter:i={fn:C=>{let{x:S,y:_}=C;return{x:S,y:_}}},...c}=ia(e,t),p={x:n,y:r},m=await hy(t,c),h=ul(Ko(o)),g=nE(h);let x=p[h],y=p[g];if(s){const C=h==="y"?"bottom":"right";x=ux(x+m[h==="y"?"top":"left"],x,x-m[C])}if(l){const C=g==="y"?"bottom":"right";y=ux(y+m[g==="y"?"top":"left"],y,y-m[C])}const b=i.fn({...t,[h]:x,[g]:y});return{...b,data:{x:b.x-n,y:b.y-r}}}}},iQ=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:l}=t,{offset:i=0,mainAxis:c=!0,crossAxis:p=!0}=ia(e,t),m={x:n,y:r},h=ul(o),g=nE(h);let x=m[h],y=m[g];const b=ia(i,t),C=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const j=h==="y"?"height":"width",E=s.reference[h]-s.floating[j]+C.mainAxis,I=s.reference[h]+s.reference[j]-C.mainAxis;x<E?x=E:x>I&&(x=I)}if(p){var S,_;const j=h==="y"?"width":"height",E=["top","left"].includes(Ko(o)),I=s.reference[g]-s.floating[j]+(E&&((S=l.offset)==null?void 0:S[g])||0)+(E?0:C.crossAxis),M=s.reference[g]+s.reference[j]+(E?0:((_=l.offset)==null?void 0:_[g])||0)-(E?C.crossAxis:0);y<I?y=I:y>M&&(y=M)}return{[h]:x,[g]:y}}}},cQ=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:l=()=>{},...i}=ia(e,t),c=await hy(t,i),p=Ko(n),m=Vc(n),h=ul(n)==="x",{width:g,height:x}=r.floating;let y,b;p==="top"||p==="bottom"?(y=p,b=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=p,y=m==="end"?"top":"bottom");const C=x-c[y],S=g-c[b],_=!t.middlewareData.shift;let j=C,E=S;if(h){const M=g-c.left-c.right;E=m||_?tl(S,M):M}else{const M=x-c.top-c.bottom;j=m||_?tl(C,M):M}if(_&&!m){const M=hs(c.left,0),R=hs(c.right,0),D=hs(c.top,0),A=hs(c.bottom,0);h?E=g-2*(M!==0||R!==0?M+R:hs(c.left,c.right)):j=x-2*(D!==0||A!==0?D+A:hs(c.top,c.bottom))}await l({...t,availableWidth:E,availableHeight:j});const I=await o.getDimensions(s.floating);return g!==I.width||x!==I.height?{reset:{rects:!0}}:{}}}};function Yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _s(e){return Yr(e).getComputedStyle(e)}function rE(e){return e instanceof Yr(e).Node}function nl(e){return rE(e)?(e.nodeName||"").toLowerCase():"#document"}function es(e){return e instanceof HTMLElement||e instanceof Yr(e).HTMLElement}function ak(e){return typeof ShadowRoot<"u"&&(e instanceof Yr(e).ShadowRoot||e instanceof ShadowRoot)}function cd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_s(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function uQ(e){return["table","td","th"].includes(nl(e))}function dx(e){const t=gy(),n=_s(e);return n.transform!=="none"||n.perspective!=="none"||!!n.containerType&&n.containerType!=="normal"||!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 gy(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ug(e){return["html","body","#document"].includes(nl(e))}const fx=Math.min,pc=Math.max,Lm=Math.round,hp=Math.floor,rl=e=>({x:e,y:e});function oE(e){const t=_s(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=es(e),s=o?e.offsetWidth:n,l=o?e.offsetHeight:r,i=Lm(n)!==s||Lm(r)!==l;return i&&(n=s,r=l),{width:n,height:r,$:i}}function ta(e){return e instanceof Element||e instanceof Yr(e).Element}function vy(e){return ta(e)?e:e.contextElement}function mc(e){const t=vy(e);if(!es(t))return rl(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=oE(t);let l=(s?Lm(n.width):n.width)/r,i=(s?Lm(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),i&&Number.isFinite(i)||(i=1),{x:l,y:i}}const dQ=rl(0);function sE(e){const t=Yr(e);return gy()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:dQ}function Ql(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=vy(e);let l=rl(1);t&&(r?ta(r)&&(l=mc(r)):l=mc(e));const i=function(g,x,y){return x===void 0&&(x=!1),!(!y||x&&y!==Yr(g))&&x}(s,n,r)?sE(s):rl(0);let c=(o.left+i.x)/l.x,p=(o.top+i.y)/l.y,m=o.width/l.x,h=o.height/l.y;if(s){const g=Yr(s),x=r&&ta(r)?Yr(r):r;let y=g.frameElement;for(;y&&r&&x!==g;){const b=mc(y),C=y.getBoundingClientRect(),S=getComputedStyle(y),_=C.left+(y.clientLeft+parseFloat(S.paddingLeft))*b.x,j=C.top+(y.clientTop+parseFloat(S.paddingTop))*b.y;c*=b.x,p*=b.y,m*=b.x,h*=b.y,c+=_,p+=j,y=Yr(y).frameElement}}return jc({width:m,height:h,x:c,y:p})}function dg(e){return ta(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function na(e){var t;return(t=(rE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function aE(e){return Ql(na(e)).left+dg(e).scrollLeft}function Ic(e){if(nl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ak(e)&&e.host||na(e);return ak(t)?t.host:t}function lE(e){const t=Ic(e);return ug(t)?e.ownerDocument?e.ownerDocument.body:e.body:es(t)&&cd(t)?t:lE(t)}function zm(e,t){var n;t===void 0&&(t=[]);const r=lE(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Yr(r);return o?t.concat(s,s.visualViewport||[],cd(r)?r:[]):t.concat(r,zm(r))}function lk(e,t,n){let r;if(t==="viewport")r=function(o,s){const l=Yr(o),i=na(o),c=l.visualViewport;let p=i.clientWidth,m=i.clientHeight,h=0,g=0;if(c){p=c.width,m=c.height;const x=gy();(!x||x&&s==="fixed")&&(h=c.offsetLeft,g=c.offsetTop)}return{width:p,height:m,x:h,y:g}}(e,n);else if(t==="document")r=function(o){const s=na(o),l=dg(o),i=o.ownerDocument.body,c=pc(s.scrollWidth,s.clientWidth,i.scrollWidth,i.clientWidth),p=pc(s.scrollHeight,s.clientHeight,i.scrollHeight,i.clientHeight);let m=-l.scrollLeft+aE(o);const h=-l.scrollTop;return _s(i).direction==="rtl"&&(m+=pc(s.clientWidth,i.clientWidth)-c),{width:c,height:p,x:m,y:h}}(na(e));else if(ta(t))r=function(o,s){const l=Ql(o,!0,s==="fixed"),i=l.top+o.clientTop,c=l.left+o.clientLeft,p=es(o)?mc(o):rl(1);return{width:o.clientWidth*p.x,height:o.clientHeight*p.y,x:c*p.x,y:i*p.y}}(t,n);else{const o=sE(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return jc(r)}function iE(e,t){const n=Ic(e);return!(n===t||!ta(n)||ug(n))&&(_s(n).position==="fixed"||iE(n,t))}function fQ(e,t,n){const r=es(t),o=na(t),s=n==="fixed",l=Ql(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const c=rl(0);if(r||!r&&!s)if((nl(t)!=="body"||cd(o))&&(i=dg(t)),es(t)){const p=Ql(t,!0,s,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&(c.x=aE(o));return{x:l.left+i.scrollLeft-c.x,y:l.top+i.scrollTop-c.y,width:l.width,height:l.height}}function ik(e,t){return es(e)&&_s(e).position!=="fixed"?t?t(e):e.offsetParent:null}function ck(e,t){const n=Yr(e);if(!es(e))return n;let r=ik(e,t);for(;r&&uQ(r)&&_s(r).position==="static";)r=ik(r,t);return r&&(nl(r)==="html"||nl(r)==="body"&&_s(r).position==="static"&&!dx(r))?n:r||function(o){let s=Ic(o);for(;es(s)&&!ug(s);){if(dx(s))return s;s=Ic(s)}return null}(e)||n}const pQ={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=es(n),s=na(n);if(n===s)return t;let l={scrollLeft:0,scrollTop:0},i=rl(1);const c=rl(0);if((o||!o&&r!=="fixed")&&((nl(n)!=="body"||cd(s))&&(l=dg(n)),es(n))){const p=Ql(n);i=mc(n),c.x=p.x+n.clientLeft,c.y=p.y+n.clientTop}return{width:t.width*i.x,height:t.height*i.y,x:t.x*i.x-l.scrollLeft*i.x+c.x,y:t.y*i.y-l.scrollTop*i.y+c.y}},getDocumentElement:na,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?function(c,p){const m=p.get(c);if(m)return m;let h=zm(c).filter(b=>ta(b)&&nl(b)!=="body"),g=null;const x=_s(c).position==="fixed";let y=x?Ic(c):c;for(;ta(y)&&!ug(y);){const b=_s(y),C=dx(y);C||b.position!=="fixed"||(g=null),(x?!C&&!g:!C&&b.position==="static"&&g&&["absolute","fixed"].includes(g.position)||cd(y)&&!C&&iE(c,y))?h=h.filter(S=>S!==y):g=b,y=Ic(y)}return p.set(c,h),h}(t,this._c):[].concat(n),r],l=s[0],i=s.reduce((c,p)=>{const m=lk(t,p,o);return c.top=pc(m.top,c.top),c.right=fx(m.right,c.right),c.bottom=fx(m.bottom,c.bottom),c.left=pc(m.left,c.left),c},lk(t,l,o));return{width:i.right-i.left,height:i.bottom-i.top,x:i.left,y:i.top}},getOffsetParent:ck,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ck,s=this.getDimensions;return{reference:fQ(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return oE(e)},getScale:mc,isElement:ta,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function mQ(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,p=vy(e),m=o||s?[...p?zm(p):[],...zm(t)]:[];m.forEach(C=>{o&&C.addEventListener("scroll",n,{passive:!0}),s&&C.addEventListener("resize",n)});const h=p&&i?function(C,S){let _,j=null;const E=na(C);function I(){clearTimeout(_),j&&j.disconnect(),j=null}return function M(R,D){R===void 0&&(R=!1),D===void 0&&(D=1),I();const{left:A,top:O,width:$,height:X}=C.getBoundingClientRect();if(R||S(),!$||!X)return;const z={rootMargin:-hp(O)+"px "+-hp(E.clientWidth-(A+$))+"px "+-hp(E.clientHeight-(O+X))+"px "+-hp(A)+"px",threshold:pc(0,fx(1,D))||1};let V=!0;function Q(G){const F=G[0].intersectionRatio;if(F!==D){if(!V)return M();F?M(!1,F):_=setTimeout(()=>{M(!1,1e-7)},100)}V=!1}try{j=new IntersectionObserver(Q,{...z,root:E.ownerDocument})}catch{j=new IntersectionObserver(Q,z)}j.observe(C)}(!0),I}(p,n):null;let g,x=-1,y=null;l&&(y=new ResizeObserver(C=>{let[S]=C;S&&S.target===p&&y&&(y.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),p&&!c&&y.observe(p),y.observe(t));let b=c?Ql(e):null;return c&&function C(){const S=Ql(e);!b||S.x===b.x&&S.y===b.y&&S.width===b.width&&S.height===b.height||n(),b=S,g=requestAnimationFrame(C)}(),n(),()=>{m.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),h&&h(),y&&y.disconnect(),y=null,c&&cancelAnimationFrame(g)}}const hQ=(e,t,n)=>{const r=new Map,o={platform:pQ,...n},s={...o.platform,_c:r};return JX(e,t,{...o,platform:s})},gQ=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?ok({element:t.current,padding:n}).fn(o):{}:t?ok({element:t,padding:n}).fn(o):{}}}};var Kp=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Fm(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(!Fm(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)&&!Fm(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function uk(e){const t=d.useRef(e);return Kp(()=>{t.current=e}),t}function vQ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:l}=e,[i,c]=d.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(r);Fm(p,r)||m(r);const h=d.useRef(null),g=d.useRef(null),x=d.useRef(i),y=uk(s),b=uk(o),[C,S]=d.useState(null),[_,j]=d.useState(null),E=d.useCallback(O=>{h.current!==O&&(h.current=O,S(O))},[]),I=d.useCallback(O=>{g.current!==O&&(g.current=O,j(O))},[]),M=d.useCallback(()=>{if(!h.current||!g.current)return;const O={placement:t,strategy:n,middleware:p};b.current&&(O.platform=b.current),hQ(h.current,g.current,O).then($=>{const X={...$,isPositioned:!0};R.current&&!Fm(x.current,X)&&(x.current=X,qr.flushSync(()=>{c(X)}))})},[p,t,n,b]);Kp(()=>{l===!1&&x.current.isPositioned&&(x.current.isPositioned=!1,c(O=>({...O,isPositioned:!1})))},[l]);const R=d.useRef(!1);Kp(()=>(R.current=!0,()=>{R.current=!1}),[]),Kp(()=>{if(C&&_){if(y.current)return y.current(C,_,M);M()}},[C,_,M,y]);const D=d.useMemo(()=>({reference:h,floating:g,setReference:E,setFloating:I}),[E,I]),A=d.useMemo(()=>({reference:C,floating:_}),[C,_]);return d.useMemo(()=>({...i,update:M,refs:D,elements:A,reference:E,floating:I}),[i,M,D,A,E,I])}var xQ=typeof document<"u"?d.useLayoutEffect:d.useEffect;function bQ(){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 yQ=d.createContext(null),CQ=()=>d.useContext(yQ);function wQ(e){return(e==null?void 0:e.ownerDocument)||document}function SQ(e){return wQ(e).defaultView||window}function gp(e){return e?e instanceof SQ(e).Element:!1}const kQ=Gx["useInsertionEffect".toString()],_Q=kQ||(e=>e());function jQ(e){const t=d.useRef(()=>{});return _Q(()=>{t.current=e}),d.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 IQ(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=vQ(e),s=CQ(),l=d.useRef(null),i=d.useRef({}),c=d.useState(()=>bQ())[0],[p,m]=d.useState(null),h=d.useCallback(S=>{const _=gp(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;o.refs.setReference(_)},[o.refs]),g=d.useCallback(S=>{(gp(S)||S===null)&&(l.current=S,m(S)),(gp(o.refs.reference.current)||o.refs.reference.current===null||S!==null&&!gp(S))&&o.refs.setReference(S)},[o.refs]),x=d.useMemo(()=>({...o.refs,setReference:g,setPositionReference:h,domReference:l}),[o.refs,g,h]),y=d.useMemo(()=>({...o.elements,domReference:p}),[o.elements,p]),b=jQ(n),C=d.useMemo(()=>({...o,refs:x,elements:y,dataRef:i,nodeId:r,events:c,open:t,onOpenChange:b}),[o,r,c,t,b,x,y]);return xQ(()=>{const S=s==null?void 0:s.nodesRef.current.find(_=>_.id===r);S&&(S.context=C)}),d.useMemo(()=>({...o,context:C,refs:x,reference:g,positionReference:h}),[o,x,C,g,h])}function PQ({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=d.useState(0);d.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return mQ(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Go(()=>{t.update()},r),Go(()=>{s(l=>l+1)},[e])}function EQ(e){const t=[aQ(e.offset)];return e.middlewares.shift&&t.push(lQ({limiter:iQ()})),e.middlewares.flip&&t.push(oQ()),e.middlewares.inline&&t.push(sQ()),t.push(gQ({element:e.arrowRef,padding:e.arrowOffset})),t}function MQ(e){const[t,n]=id({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var l;(l=e.onClose)==null||l.call(e),n(!1)},o=()=>{var l,i;t?((l=e.onClose)==null||l.call(e),n(!1)):((i=e.onOpen)==null||i.call(e),n(!0))},s=IQ({placement:e.position,middleware:[...EQ(e),...e.width==="target"?[cQ({apply({rects:l}){var i,c;Object.assign((c=(i=s.refs.floating.current)==null?void 0:i.style)!=null?c:{},{width:`${l.reference.width}px`})}})]:[]]});return PQ({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),Go(()=>{var l;(l=e.onPositionChange)==null||l.call(e,s.placement)},[s.placement]),Go(()=>{var l,i;e.opened?(i=e.onOpen)==null||i.call(e):(l=e.onClose)==null||l.call(e)},[e.opened]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const cE={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"},[OQ,uE]=xG(cE.context);var RQ=Object.defineProperty,DQ=Object.defineProperties,AQ=Object.getOwnPropertyDescriptors,Bm=Object.getOwnPropertySymbols,dE=Object.prototype.hasOwnProperty,fE=Object.prototype.propertyIsEnumerable,dk=(e,t,n)=>t in e?RQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vp=(e,t)=>{for(var n in t||(t={}))dE.call(t,n)&&dk(e,n,t[n]);if(Bm)for(var n of Bm(t))fE.call(t,n)&&dk(e,n,t[n]);return e},TQ=(e,t)=>DQ(e,AQ(t)),$Q=(e,t)=>{var n={};for(var r in e)dE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Bm)for(var r of Bm(e))t.indexOf(r)<0&&fE.call(e,r)&&(n[r]=e[r]);return n};const NQ={refProp:"ref",popupType:"dialog"},pE=d.forwardRef((e,t)=>{const n=Rn("PopoverTarget",NQ,e),{children:r,refProp:o,popupType:s}=n,l=$Q(n,["children","refProp","popupType"]);if(!BP(r))throw new Error(cE.children);const i=l,c=uE(),p=Ud(c.reference,r.ref,t),m=c.withRoles?{"aria-haspopup":s,"aria-expanded":c.opened,"aria-controls":c.getDropdownId(),id:c.getTargetId()}:{};return d.cloneElement(r,vp(TQ(vp(vp(vp({},i),m),c.targetProps),{className:VP(c.targetProps.className,i.className,r.props.className),[o]:p}),c.controlled?null:{onClick:c.onToggle}))});pE.displayName="@mantine/core/PopoverTarget";var LQ=pr((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${Re(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:`${Re(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const zQ=LQ;var FQ=Object.defineProperty,fk=Object.getOwnPropertySymbols,BQ=Object.prototype.hasOwnProperty,HQ=Object.prototype.propertyIsEnumerable,pk=(e,t,n)=>t in e?FQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Li=(e,t)=>{for(var n in t||(t={}))BQ.call(t,n)&&pk(e,n,t[n]);if(fk)for(var n of fk(t))HQ.call(t,n)&&pk(e,n,t[n]);return e};const mk={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function VQ({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in cp?Li(Li(Li({transitionProperty:cp[e].transitionProperty},o),cp[e].common),cp[e][mk[t]]):null:Li(Li(Li({transitionProperty:e.transitionProperty},o),e.common),e[mk[t]])}function WQ({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:l,onExited:i}){const c=xa(),p=QP(),m=c.respectReducedMotion?p:!1,[h,g]=d.useState(m?0:e),[x,y]=d.useState(r?"entered":"exited"),b=d.useRef(-1),C=S=>{const _=S?o:s,j=S?l:i;y(S?"pre-entering":"pre-exiting"),window.clearTimeout(b.current);const E=m?0:S?e:t;if(g(E),E===0)typeof _=="function"&&_(),typeof j=="function"&&j(),y(S?"entered":"exited");else{const I=window.setTimeout(()=>{typeof _=="function"&&_(),y(S?"entering":"exiting")},10);b.current=window.setTimeout(()=>{window.clearTimeout(I),typeof j=="function"&&j(),y(S?"entered":"exited")},E)}};return Go(()=>{C(r)},[r]),d.useEffect(()=>()=>window.clearTimeout(b.current),[]),{transitionDuration:h,transitionStatus:x,transitionTimingFunction:n||c.transitionTimingFunction}}function mE({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:l,onExit:i,onEntered:c,onEnter:p,onExited:m}){const{transitionDuration:h,transitionStatus:g,transitionTimingFunction:x}=WQ({mounted:o,exitDuration:r,duration:n,timingFunction:l,onExit:i,onEntered:c,onEnter:p,onExited:m});return h===0?o?H.createElement(H.Fragment,null,s({})):e?s({display:"none"}):null:g==="exited"?e?s({display:"none"}):null:H.createElement(H.Fragment,null,s(VQ({transition:t,duration:h,state:g,timingFunction:x})))}mE.displayName="@mantine/core/Transition";function hE({children:e,active:t=!0,refProp:n="ref"}){const r=ZG(t),o=Ud(r,e==null?void 0:e.ref);return BP(e)?d.cloneElement(e,{[n]:o}):e}hE.displayName="@mantine/core/FocusTrap";var UQ=Object.defineProperty,GQ=Object.defineProperties,KQ=Object.getOwnPropertyDescriptors,hk=Object.getOwnPropertySymbols,qQ=Object.prototype.hasOwnProperty,XQ=Object.prototype.propertyIsEnumerable,gk=(e,t,n)=>t in e?UQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$a=(e,t)=>{for(var n in t||(t={}))qQ.call(t,n)&&gk(e,n,t[n]);if(hk)for(var n of hk(t))XQ.call(t,n)&&gk(e,n,t[n]);return e},xp=(e,t)=>GQ(e,KQ(t));function vk(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function xk(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 QQ={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function YQ({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:l,dir:i}){const[c,p="center"]=e.split("-"),m={width:Re(t),height:Re(t),transform:"rotate(45deg)",position:"absolute",[QQ[c]]:Re(r)},h=Re(-t/2);return c==="left"?xp($a($a({},m),vk(p,l,n,o)),{right:h,borderLeftColor:"transparent",borderBottomColor:"transparent"}):c==="right"?xp($a($a({},m),vk(p,l,n,o)),{left:h,borderRightColor:"transparent",borderTopColor:"transparent"}):c==="top"?xp($a($a({},m),xk(p,s,n,o,i)),{bottom:h,borderTopColor:"transparent",borderLeftColor:"transparent"}):c==="bottom"?xp($a($a({},m),xk(p,s,n,o,i)),{top:h,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var ZQ=Object.defineProperty,JQ=Object.defineProperties,eY=Object.getOwnPropertyDescriptors,Hm=Object.getOwnPropertySymbols,gE=Object.prototype.hasOwnProperty,vE=Object.prototype.propertyIsEnumerable,bk=(e,t,n)=>t in e?ZQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tY=(e,t)=>{for(var n in t||(t={}))gE.call(t,n)&&bk(e,n,t[n]);if(Hm)for(var n of Hm(t))vE.call(t,n)&&bk(e,n,t[n]);return e},nY=(e,t)=>JQ(e,eY(t)),rY=(e,t)=>{var n={};for(var r in e)gE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hm)for(var r of Hm(e))t.indexOf(r)<0&&vE.call(e,r)&&(n[r]=e[r]);return n};const xE=d.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:l,arrowPosition:i,visible:c,arrowX:p,arrowY:m}=n,h=rY(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const g=xa();return c?H.createElement("div",nY(tY({},h),{ref:t,style:YQ({position:r,arrowSize:o,arrowOffset:s,arrowRadius:l,arrowPosition:i,dir:g.dir,arrowX:p,arrowY:m})})):null});xE.displayName="@mantine/core/FloatingArrow";var oY=Object.defineProperty,sY=Object.defineProperties,aY=Object.getOwnPropertyDescriptors,Vm=Object.getOwnPropertySymbols,bE=Object.prototype.hasOwnProperty,yE=Object.prototype.propertyIsEnumerable,yk=(e,t,n)=>t in e?oY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zi=(e,t)=>{for(var n in t||(t={}))bE.call(t,n)&&yk(e,n,t[n]);if(Vm)for(var n of Vm(t))yE.call(t,n)&&yk(e,n,t[n]);return e},bp=(e,t)=>sY(e,aY(t)),lY=(e,t)=>{var n={};for(var r in e)bE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vm)for(var r of Vm(e))t.indexOf(r)<0&&yE.call(e,r)&&(n[r]=e[r]);return n};const iY={};function CE(e){var t;const n=Rn("PopoverDropdown",iY,e),{style:r,className:o,children:s,onKeyDownCapture:l}=n,i=lY(n,["style","className","children","onKeyDownCapture"]),c=uE(),{classes:p,cx:m}=zQ({radius:c.radius,shadow:c.shadow},{name:c.__staticSelector,classNames:c.classNames,styles:c.styles,unstyled:c.unstyled,variant:c.variant}),h=UG({opened:c.opened,shouldReturnFocus:c.returnFocus}),g=c.withRoles?{"aria-labelledby":c.getTargetId(),id:c.getDropdownId(),role:"dialog"}:{};return c.disabled?null:H.createElement(C6,bp(zi({},c.portalProps),{withinPortal:c.withinPortal}),H.createElement(mE,bp(zi({mounted:c.opened},c.transitionProps),{transition:c.transitionProps.transition||"fade",duration:(t=c.transitionProps.duration)!=null?t:150,keepMounted:c.keepMounted,exitDuration:typeof c.transitionProps.exitDuration=="number"?c.transitionProps.exitDuration:c.transitionProps.duration}),x=>{var y,b;return H.createElement(hE,{active:c.trapFocus},H.createElement(zr,zi(bp(zi({},g),{tabIndex:-1,ref:c.floating,style:bp(zi(zi({},r),x),{zIndex:c.zIndex,top:(y=c.y)!=null?y:0,left:(b=c.x)!=null?b:0,width:c.width==="target"?void 0:Re(c.width)}),className:m(p.dropdown,o),onKeyDownCapture:yG(c.onClose,{active:c.closeOnEscape,onTrigger:h,onKeyDown:l}),"data-position":c.placement}),i),s,H.createElement(xE,{ref:c.arrowRef,arrowX:c.arrowX,arrowY:c.arrowY,visible:c.withArrow,position:c.placement,arrowSize:c.arrowSize,arrowRadius:c.arrowRadius,arrowOffset:c.arrowOffset,arrowPosition:c.arrowPosition,className:p.arrow})))}))}CE.displayName="@mantine/core/PopoverDropdown";function cY(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 Ck=Object.getOwnPropertySymbols,uY=Object.prototype.hasOwnProperty,dY=Object.prototype.propertyIsEnumerable,fY=(e,t)=>{var n={};for(var r in e)uY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ck)for(var r of Ck(e))t.indexOf(r)<0&&dY.call(e,r)&&(n[r]=e[r]);return n};const pY={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:ly("popover"),__staticSelector:"Popover",width:"max-content"};function Wc(e){var t,n,r,o,s,l;const i=d.useRef(null),c=Rn("Popover",pY,e),{children:p,position:m,offset:h,onPositionChange:g,positionDependencies:x,opened:y,transitionProps:b,width:C,middlewares:S,withArrow:_,arrowSize:j,arrowOffset:E,arrowRadius:I,arrowPosition:M,unstyled:R,classNames:D,styles:A,closeOnClickOutside:O,withinPortal:$,portalProps:X,closeOnEscape:z,clickOutsideEvents:V,trapFocus:Q,onClose:G,onOpen:F,onChange:U,zIndex:T,radius:B,shadow:Y,id:re,defaultOpened:le,__staticSelector:oe,withRoles:q,disabled:K,returnFocus:ee,variant:ce,keepMounted:J}=c,ie=fY(c,["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"]),[de,xe]=d.useState(null),[we,ve]=d.useState(null),fe=cy(re),Oe=xa(),je=MQ({middlewares:S,width:C,position:cY(Oe.dir,m),offset:typeof h=="number"?h+(_?j/2:0):h,arrowRef:i,arrowOffset:E,onPositionChange:g,positionDependencies:x,opened:y,defaultOpened:le,onChange:U,onOpen:F,onClose:G});BG(()=>je.opened&&O&&je.onClose(),V,[de,we]);const $e=d.useCallback(Ve=>{xe(Ve),je.floating.reference(Ve)},[je.floating.reference]),st=d.useCallback(Ve=>{ve(Ve),je.floating.floating(Ve)},[je.floating.floating]);return H.createElement(OQ,{value:{returnFocus:ee,disabled:K,controlled:je.controlled,reference:$e,floating:st,x:je.floating.x,y:je.floating.y,arrowX:(r=(n=(t=je.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(l=(s=(o=je.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:l.y,opened:je.opened,arrowRef:i,transitionProps:b,width:C,withArrow:_,arrowSize:j,arrowOffset:E,arrowRadius:I,arrowPosition:M,placement:je.floating.placement,trapFocus:Q,withinPortal:$,portalProps:X,zIndex:T,radius:B,shadow:Y,closeOnEscape:z,onClose:je.onClose,onToggle:je.onToggle,getTargetId:()=>`${fe}-target`,getDropdownId:()=>`${fe}-dropdown`,withRoles:q,targetProps:ie,__staticSelector:oe,classNames:D,styles:A,unstyled:R,variant:ce,keepMounted:J}},p)}Wc.Target=pE;Wc.Dropdown=CE;Wc.displayName="@mantine/core/Popover";var mY=Object.defineProperty,Wm=Object.getOwnPropertySymbols,wE=Object.prototype.hasOwnProperty,SE=Object.prototype.propertyIsEnumerable,wk=(e,t,n)=>t in e?mY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hY=(e,t)=>{for(var n in t||(t={}))wE.call(t,n)&&wk(e,n,t[n]);if(Wm)for(var n of Wm(t))SE.call(t,n)&&wk(e,n,t[n]);return e},gY=(e,t)=>{var n={};for(var r in e)wE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wm)for(var r of Wm(e))t.indexOf(r)<0&&SE.call(e,r)&&(n[r]=e[r]);return n};function vY(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:l,innerRef:i,__staticSelector:c,styles:p,classNames:m,unstyled:h}=t,g=gY(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:x}=ZX(null,{name:c,styles:p,classNames:m,unstyled:h});return H.createElement(Wc.Dropdown,hY({p:0,onMouseDown:y=>y.preventDefault()},g),H.createElement("div",{style:{maxHeight:Re(o),display:"flex"}},H.createElement(zr,{component:r||"div",id:`${l}-items`,"aria-labelledby":`${l}-label`,role:"listbox",onMouseDown:y=>y.preventDefault(),style:{flex:1,overflowY:r!==cg?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:i},H.createElement("div",{className:x.itemsWrapper,style:{flexDirection:s}},n))))}function Ka({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:s,__staticSelector:l,onDirectionChange:i,switchDirectionOnFlip:c,zIndex:p,dropdownPosition:m,positionDependencies:h=[],classNames:g,styles:x,unstyled:y,readOnly:b,variant:C}){return H.createElement(Wc,{unstyled:y,classNames:g,styles:x,width:"target",withRoles:!1,opened:e,middlewares:{flip:m==="flip",shift:!1},position:m==="flip"?"bottom":m,positionDependencies:h,zIndex:p,__staticSelector:l,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:b,onPositionChange:S=>c&&(i==null?void 0:i(S==="top"?"column-reverse":"column")),variant:C},s)}Ka.Target=Wc.Target;Ka.Dropdown=vY;var xY=Object.defineProperty,bY=Object.defineProperties,yY=Object.getOwnPropertyDescriptors,Um=Object.getOwnPropertySymbols,kE=Object.prototype.hasOwnProperty,_E=Object.prototype.propertyIsEnumerable,Sk=(e,t,n)=>t in e?xY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yp=(e,t)=>{for(var n in t||(t={}))kE.call(t,n)&&Sk(e,n,t[n]);if(Um)for(var n of Um(t))_E.call(t,n)&&Sk(e,n,t[n]);return e},CY=(e,t)=>bY(e,yY(t)),wY=(e,t)=>{var n={};for(var r in e)kE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Um)for(var r of Um(e))t.indexOf(r)<0&&_E.call(e,r)&&(n[r]=e[r]);return n};function jE(e,t,n){const r=Rn(e,t,n),{label:o,description:s,error:l,required:i,classNames:c,styles:p,className:m,unstyled:h,__staticSelector:g,sx:x,errorProps:y,labelProps:b,descriptionProps:C,wrapperProps:S,id:_,size:j,style:E,inputContainer:I,inputWrapperOrder:M,withAsterisk:R,variant:D}=r,A=wY(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),O=cy(_),{systemStyles:$,rest:X}=sg(A),z=yp({label:o,description:s,error:l,required:i,classNames:c,className:m,__staticSelector:g,sx:x,errorProps:y,labelProps:b,descriptionProps:C,unstyled:h,styles:p,id:O,size:j,style:E,inputContainer:I,inputWrapperOrder:M,withAsterisk:R,variant:D},S);return CY(yp({},X),{classNames:c,styles:p,unstyled:h,wrapperProps:yp(yp({},z),$),inputProps:{required:i,classNames:c,styles:p,unstyled:h,id:O,size:j,__staticSelector:g,error:l,variant:D}})}var SY=pr((e,t,{size:n})=>({label:{display:"inline-block",fontSize:mt({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 kY=SY;var _Y=Object.defineProperty,Gm=Object.getOwnPropertySymbols,IE=Object.prototype.hasOwnProperty,PE=Object.prototype.propertyIsEnumerable,kk=(e,t,n)=>t in e?_Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jY=(e,t)=>{for(var n in t||(t={}))IE.call(t,n)&&kk(e,n,t[n]);if(Gm)for(var n of Gm(t))PE.call(t,n)&&kk(e,n,t[n]);return e},IY=(e,t)=>{var n={};for(var r in e)IE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gm)for(var r of Gm(e))t.indexOf(r)<0&&PE.call(e,r)&&(n[r]=e[r]);return n};const PY={labelElement:"label",size:"sm"},xy=d.forwardRef((e,t)=>{const n=Rn("InputLabel",PY,e),{labelElement:r,children:o,required:s,size:l,classNames:i,styles:c,unstyled:p,className:m,htmlFor:h,__staticSelector:g,variant:x,onMouseDown:y}=n,b=IY(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:C,cx:S}=kY(null,{name:["InputWrapper",g],classNames:i,styles:c,unstyled:p,variant:x,size:l});return H.createElement(zr,jY({component:r,ref:t,className:S(C.label,m),htmlFor:r==="label"?h:void 0,onMouseDown:_=>{y==null||y(_),!_.defaultPrevented&&_.detail>1&&_.preventDefault()}},b),o,s&&H.createElement("span",{className:C.required,"aria-hidden":!0}," *"))});xy.displayName="@mantine/core/InputLabel";var EY=pr((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${mt({size:n,sizes:e.fontSizes})} - ${Re(2)})`,lineHeight:1.2,display:"block"}}));const MY=EY;var OY=Object.defineProperty,Km=Object.getOwnPropertySymbols,EE=Object.prototype.hasOwnProperty,ME=Object.prototype.propertyIsEnumerable,_k=(e,t,n)=>t in e?OY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RY=(e,t)=>{for(var n in t||(t={}))EE.call(t,n)&&_k(e,n,t[n]);if(Km)for(var n of Km(t))ME.call(t,n)&&_k(e,n,t[n]);return e},DY=(e,t)=>{var n={};for(var r in e)EE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Km)for(var r of Km(e))t.indexOf(r)<0&&ME.call(e,r)&&(n[r]=e[r]);return n};const AY={size:"sm"},by=d.forwardRef((e,t)=>{const n=Rn("InputError",AY,e),{children:r,className:o,classNames:s,styles:l,unstyled:i,size:c,__staticSelector:p,variant:m}=n,h=DY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:g,cx:x}=MY(null,{name:["InputWrapper",p],classNames:s,styles:l,unstyled:i,variant:m,size:c});return H.createElement(kc,RY({className:x(g.error,o),ref:t},h),r)});by.displayName="@mantine/core/InputError";var TY=pr((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${mt({size:n,sizes:e.fontSizes})} - ${Re(2)})`,lineHeight:1.2,display:"block"}}));const $Y=TY;var NY=Object.defineProperty,qm=Object.getOwnPropertySymbols,OE=Object.prototype.hasOwnProperty,RE=Object.prototype.propertyIsEnumerable,jk=(e,t,n)=>t in e?NY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LY=(e,t)=>{for(var n in t||(t={}))OE.call(t,n)&&jk(e,n,t[n]);if(qm)for(var n of qm(t))RE.call(t,n)&&jk(e,n,t[n]);return e},zY=(e,t)=>{var n={};for(var r in e)OE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qm)for(var r of qm(e))t.indexOf(r)<0&&RE.call(e,r)&&(n[r]=e[r]);return n};const FY={size:"sm"},yy=d.forwardRef((e,t)=>{const n=Rn("InputDescription",FY,e),{children:r,className:o,classNames:s,styles:l,unstyled:i,size:c,__staticSelector:p,variant:m}=n,h=zY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:g,cx:x}=$Y(null,{name:["InputWrapper",p],classNames:s,styles:l,unstyled:i,variant:m,size:c});return H.createElement(kc,LY({color:"dimmed",className:x(g.description,o),ref:t,unstyled:i},h),r)});yy.displayName="@mantine/core/InputDescription";const DE=d.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),BY=DE.Provider,HY=()=>d.useContext(DE);function VY(e,{hasDescription:t,hasError:n}){const r=e.findIndex(c=>c==="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 WY=Object.defineProperty,UY=Object.defineProperties,GY=Object.getOwnPropertyDescriptors,Ik=Object.getOwnPropertySymbols,KY=Object.prototype.hasOwnProperty,qY=Object.prototype.propertyIsEnumerable,Pk=(e,t,n)=>t in e?WY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XY=(e,t)=>{for(var n in t||(t={}))KY.call(t,n)&&Pk(e,n,t[n]);if(Ik)for(var n of Ik(t))qY.call(t,n)&&Pk(e,n,t[n]);return e},QY=(e,t)=>UY(e,GY(t)),YY=pr(e=>({root:QY(XY({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const ZY=YY;var JY=Object.defineProperty,eZ=Object.defineProperties,tZ=Object.getOwnPropertyDescriptors,Xm=Object.getOwnPropertySymbols,AE=Object.prototype.hasOwnProperty,TE=Object.prototype.propertyIsEnumerable,Ek=(e,t,n)=>t in e?JY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Na=(e,t)=>{for(var n in t||(t={}))AE.call(t,n)&&Ek(e,n,t[n]);if(Xm)for(var n of Xm(t))TE.call(t,n)&&Ek(e,n,t[n]);return e},Mk=(e,t)=>eZ(e,tZ(t)),nZ=(e,t)=>{var n={};for(var r in e)AE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xm)for(var r of Xm(e))t.indexOf(r)<0&&TE.call(e,r)&&(n[r]=e[r]);return n};const rZ={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},$E=d.forwardRef((e,t)=>{const n=Rn("InputWrapper",rZ,e),{className:r,label:o,children:s,required:l,id:i,error:c,description:p,labelElement:m,labelProps:h,descriptionProps:g,errorProps:x,classNames:y,styles:b,size:C,inputContainer:S,__staticSelector:_,unstyled:j,inputWrapperOrder:E,withAsterisk:I,variant:M}=n,R=nZ(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:D,cx:A}=ZY(null,{classNames:y,styles:b,name:["InputWrapper",_],unstyled:j,variant:M,size:C}),O={classNames:y,styles:b,unstyled:j,size:C,variant:M,__staticSelector:_},$=typeof I=="boolean"?I:l,X=i?`${i}-error`:x==null?void 0:x.id,z=i?`${i}-description`:g==null?void 0:g.id,Q=`${!!c&&typeof c!="boolean"?X:""} ${p?z:""}`,G=Q.trim().length>0?Q.trim():void 0,F=o&&H.createElement(xy,Na(Na({key:"label",labelElement:m,id:i?`${i}-label`:void 0,htmlFor:i,required:$},O),h),o),U=p&&H.createElement(yy,Mk(Na(Na({key:"description"},g),O),{size:(g==null?void 0:g.size)||O.size,id:(g==null?void 0:g.id)||z}),p),T=H.createElement(d.Fragment,{key:"input"},S(s)),B=typeof c!="boolean"&&c&&H.createElement(by,Mk(Na(Na({},x),O),{size:(x==null?void 0:x.size)||O.size,key:"error",id:(x==null?void 0:x.id)||X}),c),Y=E.map(re=>{switch(re){case"label":return F;case"input":return T;case"description":return U;case"error":return B;default:return null}});return H.createElement(BY,{value:Na({describedBy:G},VY(E,{hasDescription:!!U,hasError:!!B}))},H.createElement(zr,Na({className:A(D.root,r),ref:t},R),Y))});$E.displayName="@mantine/core/InputWrapper";var oZ=Object.defineProperty,Qm=Object.getOwnPropertySymbols,NE=Object.prototype.hasOwnProperty,LE=Object.prototype.propertyIsEnumerable,Ok=(e,t,n)=>t in e?oZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sZ=(e,t)=>{for(var n in t||(t={}))NE.call(t,n)&&Ok(e,n,t[n]);if(Qm)for(var n of Qm(t))LE.call(t,n)&&Ok(e,n,t[n]);return e},aZ=(e,t)=>{var n={};for(var r in e)NE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qm)for(var r of Qm(e))t.indexOf(r)<0&&LE.call(e,r)&&(n[r]=e[r]);return n};const lZ={},zE=d.forwardRef((e,t)=>{const n=Rn("InputPlaceholder",lZ,e),{sx:r}=n,o=aZ(n,["sx"]);return H.createElement(zr,sZ({component:"span",sx:[s=>s.fn.placeholderStyles(),...zP(r)],ref:t},o))});zE.displayName="@mantine/core/InputPlaceholder";var iZ=Object.defineProperty,cZ=Object.defineProperties,uZ=Object.getOwnPropertyDescriptors,Rk=Object.getOwnPropertySymbols,dZ=Object.prototype.hasOwnProperty,fZ=Object.prototype.propertyIsEnumerable,Dk=(e,t,n)=>t in e?iZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cp=(e,t)=>{for(var n in t||(t={}))dZ.call(t,n)&&Dk(e,n,t[n]);if(Rk)for(var n of Rk(t))fZ.call(t,n)&&Dk(e,n,t[n]);return e},Dv=(e,t)=>cZ(e,uZ(t));const fo={xs:Re(30),sm:Re(36),md:Re(42),lg:Re(50),xl:Re(60)},pZ=["default","filled","unstyled"];function mZ({theme:e,variant:t}){return pZ.includes(t)?t==="default"?{border:`${Re(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:`${Re(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:Re(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var hZ=pr((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:l,offsetBottom:i,offsetTop:c,pointer:p},{variant:m,size:h})=>{const g=e.fn.variant({variant:"filled",color:"red"}).background,x=m==="default"||m==="filled"?{minHeight:mt({size:h,sizes:fo}),paddingLeft:`calc(${mt({size:h,sizes:fo})} / 3)`,paddingRight:s?o||mt({size:h,sizes:fo}):`calc(${mt({size:h,sizes:fo})} / 3)`,borderRadius:e.fn.radius(n)}:m==="unstyled"&&s?{paddingRight:o||mt({size:h,sizes:fo})}:null;return{wrapper:{position:"relative",marginTop:c?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:i?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:Dv(Cp(Cp(Dv(Cp({},e.fn.fontStyles()),{height:t?m==="unstyled"?void 0:"auto":mt({size:h,sizes:fo}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${mt({size:h,sizes:fo})} - ${Re(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:mt({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}),mZ({theme:e,variant:m})),x),{"&: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:g,borderColor:g,"&::placeholder":{opacity:1,color:g}},"&[data-with-icon]":{paddingLeft:typeof l=="number"?Re(l):mt({size:h,sizes:fo})},"&::placeholder":Dv(Cp({},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:l?Re(l):mt({size:h,sizes:fo}),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||mt({size:h,sizes:fo})}}});const gZ=hZ;var vZ=Object.defineProperty,xZ=Object.defineProperties,bZ=Object.getOwnPropertyDescriptors,Ym=Object.getOwnPropertySymbols,FE=Object.prototype.hasOwnProperty,BE=Object.prototype.propertyIsEnumerable,Ak=(e,t,n)=>t in e?vZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wp=(e,t)=>{for(var n in t||(t={}))FE.call(t,n)&&Ak(e,n,t[n]);if(Ym)for(var n of Ym(t))BE.call(t,n)&&Ak(e,n,t[n]);return e},Tk=(e,t)=>xZ(e,bZ(t)),yZ=(e,t)=>{var n={};for(var r in e)FE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ym)for(var r of Ym(e))t.indexOf(r)<0&&BE.call(e,r)&&(n[r]=e[r]);return n};const CZ={size:"sm",variant:"default"},li=d.forwardRef((e,t)=>{const n=Rn("Input",CZ,e),{className:r,error:o,required:s,disabled:l,variant:i,icon:c,style:p,rightSectionWidth:m,iconWidth:h,rightSection:g,rightSectionProps:x,radius:y,size:b,wrapperProps:C,classNames:S,styles:_,__staticSelector:j,multiline:E,sx:I,unstyled:M,pointer:R}=n,D=yZ(n,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:A,offsetTop:O,describedBy:$}=HY(),{classes:X,cx:z}=gZ({radius:y,multiline:E,invalid:!!o,rightSectionWidth:m?Re(m):void 0,iconWidth:h,withRightSection:!!g,offsetBottom:A,offsetTop:O,pointer:R},{classNames:S,styles:_,name:["Input",j],unstyled:M,variant:i,size:b}),{systemStyles:V,rest:Q}=sg(D);return H.createElement(zr,wp(wp({className:z(X.wrapper,r),sx:I,style:p},V),C),c&&H.createElement("div",{className:X.icon},c),H.createElement(zr,Tk(wp({component:"input"},Q),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":$,disabled:l,"data-disabled":l||void 0,"data-with-icon":!!c||void 0,"data-invalid":!!o||void 0,className:X.input})),g&&H.createElement("div",Tk(wp({},x),{className:X.rightSection}),g))});li.displayName="@mantine/core/Input";li.Wrapper=$E;li.Label=xy;li.Description=yy;li.Error=by;li.Placeholder=zE;const Pc=li;var wZ=Object.defineProperty,Zm=Object.getOwnPropertySymbols,HE=Object.prototype.hasOwnProperty,VE=Object.prototype.propertyIsEnumerable,$k=(e,t,n)=>t in e?wZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nk=(e,t)=>{for(var n in t||(t={}))HE.call(t,n)&&$k(e,n,t[n]);if(Zm)for(var n of Zm(t))VE.call(t,n)&&$k(e,n,t[n]);return e},SZ=(e,t)=>{var n={};for(var r in e)HE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Zm)for(var r of Zm(e))t.indexOf(r)<0&&VE.call(e,r)&&(n[r]=e[r]);return n};const kZ={multiple:!1},WE=d.forwardRef((e,t)=>{const n=Rn("FileButton",kZ,e),{onChange:r,children:o,multiple:s,accept:l,name:i,form:c,resetRef:p,disabled:m,capture:h,inputProps:g}=n,x=SZ(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),y=d.useRef(),b=()=>{!m&&y.current.click()},C=_=>{r(s?Array.from(_.currentTarget.files):_.currentTarget.files[0]||null)};return XP(p,()=>{y.current.value=""}),H.createElement(H.Fragment,null,o(Nk({onClick:b},x)),H.createElement("input",Nk({style:{display:"none"},type:"file",accept:l,multiple:s,onChange:C,ref:Ud(t,y),name:i,form:c,capture:h},g)))});WE.displayName="@mantine/core/FileButton";const UE={xs:Re(16),sm:Re(22),md:Re(26),lg:Re(30),xl:Re(36)},_Z={xs:Re(10),sm:Re(12),md:Re(14),lg:Re(16),xl:Re(18)};var jZ=pr((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:mt({size:o,sizes:UE}),paddingLeft:`calc(${mt({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?mt({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:mt({size:o,sizes:_Z}),borderRadius:mt({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${Re(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${mt({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const IZ=jZ;var PZ=Object.defineProperty,Jm=Object.getOwnPropertySymbols,GE=Object.prototype.hasOwnProperty,KE=Object.prototype.propertyIsEnumerable,Lk=(e,t,n)=>t in e?PZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EZ=(e,t)=>{for(var n in t||(t={}))GE.call(t,n)&&Lk(e,n,t[n]);if(Jm)for(var n of Jm(t))KE.call(t,n)&&Lk(e,n,t[n]);return e},MZ=(e,t)=>{var n={};for(var r in e)GE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jm)for(var r of Jm(e))t.indexOf(r)<0&&KE.call(e,r)&&(n[r]=e[r]);return n};const OZ={xs:16,sm:22,md:24,lg:26,xl:30};function qE(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:l,disabled:i,readOnly:c,size:p,radius:m="sm",variant:h,unstyled:g}=t,x=MZ(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:y,cx:b}=IZ({disabled:i,readOnly:c,radius:m},{name:"MultiSelect",classNames:r,styles:o,unstyled:g,size:p,variant:h});return H.createElement("div",EZ({className:b(y.defaultValue,s)},x),H.createElement("span",{className:y.defaultValueLabel},n),!i&&!c&&H.createElement(P6,{"aria-hidden":!0,onMouseDown:l,size:OZ[p],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:y.defaultValueRemove,tabIndex:-1,unstyled:g}))}qE.displayName="@mantine/core/MultiSelect/DefaultValue";function RZ({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,disableSelectedItemFiltering:l}){if(!t&&s.length===0)return e;if(!t){const c=[];for(let p=0;p<e.length;p+=1)(l||!s.some(m=>m===e[p].value&&!e[p].disabled))&&c.push(e[p]);return c}const i=[];for(let c=0;c<e.length&&(o(r,!l&&s.some(p=>p===e[c].value&&!e[c].disabled),e[c])&&i.push(e[c]),!(i.length>=n));c+=1);return i}var DZ=Object.defineProperty,eh=Object.getOwnPropertySymbols,XE=Object.prototype.hasOwnProperty,QE=Object.prototype.propertyIsEnumerable,zk=(e,t,n)=>t in e?DZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fk=(e,t)=>{for(var n in t||(t={}))XE.call(t,n)&&zk(e,n,t[n]);if(eh)for(var n of eh(t))QE.call(t,n)&&zk(e,n,t[n]);return e},AZ=(e,t)=>{var n={};for(var r in e)XE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&eh)for(var r of eh(e))t.indexOf(r)<0&&QE.call(e,r)&&(n[r]=e[r]);return n};const TZ={xs:Re(14),sm:Re(18),md:Re(20),lg:Re(24),xl:Re(28)};function $Z(e){var t=e,{size:n,error:r,style:o}=t,s=AZ(t,["size","error","style"]);const l=xa(),i=mt({size:n,sizes:TZ});return H.createElement("svg",Fk({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Fk({color:r?l.colors.red[6]:l.colors.gray[6],width:i,height:i},o),"data-chevron":!0},s),H.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 NZ=Object.defineProperty,LZ=Object.defineProperties,zZ=Object.getOwnPropertyDescriptors,Bk=Object.getOwnPropertySymbols,FZ=Object.prototype.hasOwnProperty,BZ=Object.prototype.propertyIsEnumerable,Hk=(e,t,n)=>t in e?NZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,HZ=(e,t)=>{for(var n in t||(t={}))FZ.call(t,n)&&Hk(e,n,t[n]);if(Bk)for(var n of Bk(t))BZ.call(t,n)&&Hk(e,n,t[n]);return e},VZ=(e,t)=>LZ(e,zZ(t));function YE({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?H.createElement(P6,VZ(HZ({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):H.createElement($Z,{error:o,size:r})}YE.displayName="@mantine/core/SelectRightSection";var WZ=Object.defineProperty,UZ=Object.defineProperties,GZ=Object.getOwnPropertyDescriptors,th=Object.getOwnPropertySymbols,ZE=Object.prototype.hasOwnProperty,JE=Object.prototype.propertyIsEnumerable,Vk=(e,t,n)=>t in e?WZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Av=(e,t)=>{for(var n in t||(t={}))ZE.call(t,n)&&Vk(e,n,t[n]);if(th)for(var n of th(t))JE.call(t,n)&&Vk(e,n,t[n]);return e},Wk=(e,t)=>UZ(e,GZ(t)),KZ=(e,t)=>{var n={};for(var r in e)ZE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&th)for(var r of th(e))t.indexOf(r)<0&&JE.call(e,r)&&(n[r]=e[r]);return n};function eM(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,l=KZ(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const i=typeof n=="function"?n(s):n;return{rightSection:!l.readOnly&&!(l.disabled&&l.shouldClear)&&H.createElement(YE,Av({},l)),styles:Wk(Av({},i),{rightSection:Wk(Av({},i==null?void 0:i.rightSection),{pointerEvents:l.shouldClear?void 0:"none"})})}}var qZ=Object.defineProperty,XZ=Object.defineProperties,QZ=Object.getOwnPropertyDescriptors,Uk=Object.getOwnPropertySymbols,YZ=Object.prototype.hasOwnProperty,ZZ=Object.prototype.propertyIsEnumerable,Gk=(e,t,n)=>t in e?qZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JZ=(e,t)=>{for(var n in t||(t={}))YZ.call(t,n)&&Gk(e,n,t[n]);if(Uk)for(var n of Uk(t))ZZ.call(t,n)&&Gk(e,n,t[n]);return e},eJ=(e,t)=>XZ(e,QZ(t)),tJ=pr((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(${mt({size:n,sizes:fo})} - ${Re(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:mt({size:n,sizes:fo})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${Re(2)}) calc(${e.spacing.xs} / 2)`},searchInput:eJ(JZ({},e.fn.fontStyles()),{flex:1,minWidth:Re(60),backgroundColor:"transparent",border:0,outline:0,fontSize:mt({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:mt({size:n,sizes:UE}),"&::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 nJ=tJ;var rJ=Object.defineProperty,oJ=Object.defineProperties,sJ=Object.getOwnPropertyDescriptors,nh=Object.getOwnPropertySymbols,tM=Object.prototype.hasOwnProperty,nM=Object.prototype.propertyIsEnumerable,Kk=(e,t,n)=>t in e?rJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fi=(e,t)=>{for(var n in t||(t={}))tM.call(t,n)&&Kk(e,n,t[n]);if(nh)for(var n of nh(t))nM.call(t,n)&&Kk(e,n,t[n]);return e},qk=(e,t)=>oJ(e,sJ(t)),aJ=(e,t)=>{var n={};for(var r in e)tM.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nh)for(var r of nh(e))t.indexOf(r)<0&&nM.call(e,r)&&(n[r]=e[r]);return n};function lJ(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function iJ(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function Xk(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 cJ={size:"sm",valueComponent:qE,itemComponent:dy,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:lJ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:iJ,switchDirectionOnFlip:!1,zIndex:ly("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},rM=d.forwardRef((e,t)=>{const n=Rn("MultiSelect",cJ,e),{className:r,style:o,required:s,label:l,description:i,size:c,error:p,classNames:m,styles:h,wrapperProps:g,value:x,defaultValue:y,data:b,onChange:C,valueComponent:S,itemComponent:_,id:j,transitionProps:E,maxDropdownHeight:I,shadow:M,nothingFound:R,onFocus:D,onBlur:A,searchable:O,placeholder:$,filter:X,limit:z,clearSearchOnChange:V,clearable:Q,clearSearchOnBlur:G,variant:F,onSearchChange:U,searchValue:T,disabled:B,initiallyOpened:Y,radius:re,icon:le,rightSection:oe,rightSectionWidth:q,creatable:K,getCreateLabel:ee,shouldCreate:ce,onCreate:J,sx:ie,dropdownComponent:de,onDropdownClose:xe,onDropdownOpen:we,maxSelectedValues:ve,withinPortal:fe,portalProps:Oe,switchDirectionOnFlip:je,zIndex:$e,selectOnBlur:st,name:Ve,dropdownPosition:Ct,errorProps:Ye,labelProps:Ke,descriptionProps:ge,form:De,positionDependencies:ut,onKeyDown:yt,unstyled:ye,inputContainer:tt,inputWrapperOrder:ct,readOnly:ft,withAsterisk:Me,clearButtonProps:Ne,hoverOnSearchChange:Ut,disableSelectedItemFiltering:ke}=n,ze=aJ(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","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:Le,cx:Ge,theme:pt}=nJ({invalid:!!p},{name:"MultiSelect",classNames:m,styles:h,unstyled:ye,size:c,variant:F}),{systemStyles:Pn,rest:At}=sg(ze),Tt=d.useRef(),mr=d.useRef({}),Nn=cy(j),[Sn,hn]=d.useState(Y),[an,jr]=d.useState(-1),[Mo,hr]=d.useState("column"),[gr,Ns]=id({value:T,defaultValue:"",finalValue:void 0,onChange:U}),[Ls,Sa]=d.useState(!1),{scrollIntoView:ka,targetRef:mi,scrollableRef:_a}=YP({duration:0,offset:5,cancelable:!1,isList:!0}),hi=K&&typeof ee=="function";let Ze=null;const Gt=b.map(rt=>typeof rt=="string"?{label:rt,value:rt}:rt),Ln=FP({data:Gt}),[kt,ja]=id({value:Xk(x,b),defaultValue:Xk(y,b),finalValue:[],onChange:C}),Wr=d.useRef(!!ve&&ve<kt.length),nf=rt=>{if(!ft){const Et=kt.filter(_t=>_t!==rt);ja(Et),ve&&Et.length<ve&&(Wr.current=!1)}},Wg=rt=>{Ns(rt.currentTarget.value),!B&&!Wr.current&&O&&hn(!0)},Ug=rt=>{typeof D=="function"&&D(rt),!B&&!Wr.current&&O&&hn(!0)},zn=RZ({data:Ln,searchable:O,searchValue:gr,limit:z,filter:X,value:kt,disableSelectedItemFiltering:ke});hi&&ce(gr,Ln)&&(Ze=ee(gr),zn.push({label:gr,value:gr,creatable:!0}));const zs=Math.min(an,zn.length-1),rf=(rt,Et,_t)=>{let Mt=rt;for(;_t(Mt);)if(Mt=Et(Mt),!zn[Mt].disabled)return Mt;return rt};Go(()=>{jr(Ut&&gr?0:-1)},[gr,Ut]),Go(()=>{!B&&kt.length>b.length&&hn(!1),ve&&kt.length<ve&&(Wr.current=!1),ve&&kt.length>=ve&&(Wr.current=!0,hn(!1))},[kt]);const gi=rt=>{if(!ft)if(V&&Ns(""),kt.includes(rt.value))nf(rt.value);else{if(rt.creatable&&typeof J=="function"){const Et=J(rt.value);typeof Et<"u"&&Et!==null&&ja(typeof Et=="string"?[...kt,Et]:[...kt,Et.value])}else ja([...kt,rt.value]);kt.length===ve-1&&(Wr.current=!0,hn(!1)),zn.length===1&&hn(!1)}},nu=rt=>{typeof A=="function"&&A(rt),st&&zn[zs]&&Sn&&gi(zn[zs]),G&&Ns(""),hn(!1)},vl=rt=>{if(Ls||(yt==null||yt(rt),ft)||rt.key!=="Backspace"&&ve&&Wr.current)return;const Et=Mo==="column",_t=()=>{jr(rr=>{var rn;const Dn=rf(rr,vr=>vr+1,vr=>vr<zn.length-1);return Sn&&(mi.current=mr.current[(rn=zn[Dn])==null?void 0:rn.value],ka({alignment:Et?"end":"start"})),Dn})},Mt=()=>{jr(rr=>{var rn;const Dn=rf(rr,vr=>vr-1,vr=>vr>0);return Sn&&(mi.current=mr.current[(rn=zn[Dn])==null?void 0:rn.value],ka({alignment:Et?"start":"end"})),Dn})};switch(rt.key){case"ArrowUp":{rt.preventDefault(),hn(!0),Et?Mt():_t();break}case"ArrowDown":{rt.preventDefault(),hn(!0),Et?_t():Mt();break}case"Enter":{rt.preventDefault(),zn[zs]&&Sn?gi(zn[zs]):hn(!0);break}case" ":{O||(rt.preventDefault(),zn[zs]&&Sn?gi(zn[zs]):hn(!0));break}case"Backspace":{kt.length>0&&gr.length===0&&(ja(kt.slice(0,-1)),hn(!0),ve&&(Wr.current=!1));break}case"Home":{if(!O){rt.preventDefault(),Sn||hn(!0);const rr=zn.findIndex(rn=>!rn.disabled);jr(rr),ka({alignment:Et?"end":"start"})}break}case"End":{if(!O){rt.preventDefault(),Sn||hn(!0);const rr=zn.map(rn=>!!rn.disabled).lastIndexOf(!1);jr(rr),ka({alignment:Et?"end":"start"})}break}case"Escape":hn(!1)}},ru=kt.map(rt=>{let Et=Ln.find(_t=>_t.value===rt&&!_t.disabled);return!Et&&hi&&(Et={value:rt,label:rt}),Et}).filter(rt=>!!rt).map((rt,Et)=>H.createElement(S,qk(Fi({},rt),{variant:F,disabled:B,className:Le.value,readOnly:ft,onRemove:_t=>{_t.preventDefault(),_t.stopPropagation(),nf(rt.value)},key:rt.value,size:c,styles:h,classNames:m,radius:re,index:Et}))),ou=rt=>kt.includes(rt),Gg=()=>{var rt;Ns(""),ja([]),(rt=Tt.current)==null||rt.focus(),ve&&(Wr.current=!1)},Ia=!ft&&(zn.length>0?Sn:Sn&&!!R);return Go(()=>{const rt=Ia?we:xe;typeof rt=="function"&&rt()},[Ia]),H.createElement(Pc.Wrapper,Fi(Fi({required:s,id:Nn,label:l,error:p,description:i,size:c,className:r,style:o,classNames:m,styles:h,__staticSelector:"MultiSelect",sx:ie,errorProps:Ye,descriptionProps:ge,labelProps:Ke,inputContainer:tt,inputWrapperOrder:ct,unstyled:ye,withAsterisk:Me,variant:F},Pn),g),H.createElement(Ka,{opened:Ia,transitionProps:E,shadow:"sm",withinPortal:fe,portalProps:Oe,__staticSelector:"MultiSelect",onDirectionChange:hr,switchDirectionOnFlip:je,zIndex:$e,dropdownPosition:Ct,positionDependencies:[...ut,gr],classNames:m,styles:h,unstyled:ye,variant:F},H.createElement(Ka.Target,null,H.createElement("div",{className:Le.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":Sn&&Ia?`${Nn}-items`:null,"aria-controls":Nn,"aria-expanded":Sn,onMouseLeave:()=>jr(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:Ve,value:kt.join(","),form:De,disabled:B}),H.createElement(Pc,Fi({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:c,variant:F,disabled:B,error:p,required:s,radius:re,icon:le,unstyled:ye,onMouseDown:rt=>{var Et;rt.preventDefault(),!B&&!Wr.current&&hn(!Sn),(Et=Tt.current)==null||Et.focus()},classNames:qk(Fi({},m),{input:Ge({[Le.input]:!O},m==null?void 0:m.input)})},eM({theme:pt,rightSection:oe,rightSectionWidth:q,styles:h,size:c,shouldClear:Q&&kt.length>0,onClear:Gg,error:p,disabled:B,clearButtonProps:Ne,readOnly:ft})),H.createElement("div",{className:Le.values,"data-clearable":Q||void 0},ru,H.createElement("input",Fi({ref:Ud(t,Tt),type:"search",id:Nn,className:Ge(Le.searchInput,{[Le.searchInputPointer]:!O,[Le.searchInputInputHidden]:!Sn&&kt.length>0||!O&&kt.length>0,[Le.searchInputEmpty]:kt.length===0}),onKeyDown:vl,value:gr,onChange:Wg,onFocus:Ug,onBlur:nu,readOnly:!O||Wr.current||ft,placeholder:kt.length===0?$:void 0,disabled:B,"data-mantine-stop-propagation":Sn,autoComplete:"off",onCompositionStart:()=>Sa(!0),onCompositionEnd:()=>Sa(!1)},At)))))),H.createElement(Ka.Dropdown,{component:de||cg,maxHeight:I,direction:Mo,id:Nn,innerRef:_a,__staticSelector:"MultiSelect",classNames:m,styles:h},H.createElement(uy,{data:zn,hovered:zs,classNames:m,styles:h,uuid:Nn,__staticSelector:"MultiSelect",onItemHover:jr,onItemSelect:gi,itemsRefs:mr,itemComponent:_,size:c,nothingFound:R,isItemSelected:ou,creatable:K&&!!Ze,createLabel:Ze,unstyled:ye,variant:F}))))});rM.displayName="@mantine/core/MultiSelect";var uJ=Object.defineProperty,dJ=Object.defineProperties,fJ=Object.getOwnPropertyDescriptors,rh=Object.getOwnPropertySymbols,oM=Object.prototype.hasOwnProperty,sM=Object.prototype.propertyIsEnumerable,Qk=(e,t,n)=>t in e?uJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tv=(e,t)=>{for(var n in t||(t={}))oM.call(t,n)&&Qk(e,n,t[n]);if(rh)for(var n of rh(t))sM.call(t,n)&&Qk(e,n,t[n]);return e},pJ=(e,t)=>dJ(e,fJ(t)),mJ=(e,t)=>{var n={};for(var r in e)oM.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rh)for(var r of rh(e))t.indexOf(r)<0&&sM.call(e,r)&&(n[r]=e[r]);return n};const hJ={type:"text",size:"sm",__staticSelector:"TextInput"},aM=d.forwardRef((e,t)=>{const n=jE("TextInput",hJ,e),{inputProps:r,wrapperProps:o}=n,s=mJ(n,["inputProps","wrapperProps"]);return H.createElement(Pc.Wrapper,Tv({},o),H.createElement(Pc,pJ(Tv(Tv({},r),s),{ref:t})))});aM.displayName="@mantine/core/TextInput";function gJ({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:l}){if(!t)return e;const i=s!=null&&e.find(p=>p.value===s)||null;if(i&&!l&&(i==null?void 0:i.label)===r){if(n){if(n>=e.length)return e;const p=e.indexOf(i),m=p+n,h=m-e.length;return h>0?e.slice(p-h):e.slice(p,m)}return e}const c=[];for(let p=0;p<e.length&&(o(r,e[p])&&c.push(e[p]),!(c.length>=n));p+=1);return c}var vJ=pr(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const xJ=vJ;var bJ=Object.defineProperty,yJ=Object.defineProperties,CJ=Object.getOwnPropertyDescriptors,oh=Object.getOwnPropertySymbols,lM=Object.prototype.hasOwnProperty,iM=Object.prototype.propertyIsEnumerable,Yk=(e,t,n)=>t in e?bJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mu=(e,t)=>{for(var n in t||(t={}))lM.call(t,n)&&Yk(e,n,t[n]);if(oh)for(var n of oh(t))iM.call(t,n)&&Yk(e,n,t[n]);return e},$v=(e,t)=>yJ(e,CJ(t)),wJ=(e,t)=>{var n={};for(var r in e)lM.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oh)for(var r of oh(e))t.indexOf(r)<0&&iM.call(e,r)&&(n[r]=e[r]);return n};function SJ(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function kJ(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const _J={required:!1,size:"sm",shadow:"sm",itemComponent:dy,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:SJ,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:kJ,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:ly("popover"),positionDependencies:[],dropdownPosition:"flip"},Cy=d.forwardRef((e,t)=>{const n=jE("Select",_J,e),{inputProps:r,wrapperProps:o,shadow:s,data:l,value:i,defaultValue:c,onChange:p,itemComponent:m,onKeyDown:h,onBlur:g,onFocus:x,transitionProps:y,initiallyOpened:b,unstyled:C,classNames:S,styles:_,filter:j,maxDropdownHeight:E,searchable:I,clearable:M,nothingFound:R,limit:D,disabled:A,onSearchChange:O,searchValue:$,rightSection:X,rightSectionWidth:z,creatable:V,getCreateLabel:Q,shouldCreate:G,selectOnBlur:F,onCreate:U,dropdownComponent:T,onDropdownClose:B,onDropdownOpen:Y,withinPortal:re,portalProps:le,switchDirectionOnFlip:oe,zIndex:q,name:K,dropdownPosition:ee,allowDeselect:ce,placeholder:J,filterDataOnExactSearchMatch:ie,form:de,positionDependencies:xe,readOnly:we,clearButtonProps:ve,hoverOnSearchChange:fe}=n,Oe=wJ(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:je,cx:$e,theme:st}=xJ(),[Ve,Ct]=d.useState(b),[Ye,Ke]=d.useState(-1),ge=d.useRef(),De=d.useRef({}),[ut,yt]=d.useState("column"),ye=ut==="column",{scrollIntoView:tt,targetRef:ct,scrollableRef:ft}=YP({duration:0,offset:5,cancelable:!1,isList:!0}),Me=ce===void 0?M:ce,Ne=Ze=>{if(Ve!==Ze){Ct(Ze);const Gt=Ze?Y:B;typeof Gt=="function"&&Gt()}},Ut=V&&typeof Q=="function";let ke=null;const ze=l.map(Ze=>typeof Ze=="string"?{label:Ze,value:Ze}:Ze),Le=FP({data:ze}),[Ge,pt,Pn]=id({value:i,defaultValue:c,finalValue:null,onChange:p}),At=Le.find(Ze=>Ze.value===Ge),[Tt,mr]=id({value:$,defaultValue:(At==null?void 0:At.label)||"",finalValue:void 0,onChange:O}),Nn=Ze=>{mr(Ze),I&&typeof O=="function"&&O(Ze)},Sn=()=>{var Ze;we||(pt(null),Pn||Nn(""),(Ze=ge.current)==null||Ze.focus())};d.useEffect(()=>{const Ze=Le.find(Gt=>Gt.value===Ge);Ze?Nn(Ze.label):(!Ut||!Ge)&&Nn("")},[Ge]),d.useEffect(()=>{At&&(!I||!Ve)&&Nn(At.label)},[At==null?void 0:At.label]);const hn=Ze=>{if(!we)if(Me&&(At==null?void 0:At.value)===Ze.value)pt(null),Ne(!1);else{if(Ze.creatable&&typeof U=="function"){const Gt=U(Ze.value);typeof Gt<"u"&&Gt!==null&&pt(typeof Gt=="string"?Gt:Gt.value)}else pt(Ze.value);Pn||Nn(Ze.label),Ke(-1),Ne(!1),ge.current.focus()}},an=gJ({data:Le,searchable:I,limit:D,searchValue:Tt,filter:j,filterDataOnExactSearchMatch:ie,value:Ge});Ut&&G(Tt,an)&&(ke=Q(Tt),an.push({label:Tt,value:Tt,creatable:!0}));const jr=(Ze,Gt,Ln)=>{let kt=Ze;for(;Ln(kt);)if(kt=Gt(kt),!an[kt].disabled)return kt;return Ze};Go(()=>{Ke(fe&&Tt?0:-1)},[Tt,fe]);const Mo=Ge?an.findIndex(Ze=>Ze.value===Ge):0,hr=!we&&(an.length>0?Ve:Ve&&!!R),gr=()=>{Ke(Ze=>{var Gt;const Ln=jr(Ze,kt=>kt-1,kt=>kt>0);return ct.current=De.current[(Gt=an[Ln])==null?void 0:Gt.value],hr&&tt({alignment:ye?"start":"end"}),Ln})},Ns=()=>{Ke(Ze=>{var Gt;const Ln=jr(Ze,kt=>kt+1,kt=>kt<an.length-1);return ct.current=De.current[(Gt=an[Ln])==null?void 0:Gt.value],hr&&tt({alignment:ye?"end":"start"}),Ln})},Ls=()=>window.setTimeout(()=>{var Ze;ct.current=De.current[(Ze=an[Mo])==null?void 0:Ze.value],tt({alignment:ye?"end":"start"})},50);Go(()=>{hr&&Ls()},[hr]);const Sa=Ze=>{switch(typeof h=="function"&&h(Ze),Ze.key){case"ArrowUp":{Ze.preventDefault(),Ve?ye?gr():Ns():(Ke(Mo),Ne(!0),Ls());break}case"ArrowDown":{Ze.preventDefault(),Ve?ye?Ns():gr():(Ke(Mo),Ne(!0),Ls());break}case"Home":{if(!I){Ze.preventDefault(),Ve||Ne(!0);const Gt=an.findIndex(Ln=>!Ln.disabled);Ke(Gt),hr&&tt({alignment:ye?"end":"start"})}break}case"End":{if(!I){Ze.preventDefault(),Ve||Ne(!0);const Gt=an.map(Ln=>!!Ln.disabled).lastIndexOf(!1);Ke(Gt),hr&&tt({alignment:ye?"end":"start"})}break}case"Escape":{Ze.preventDefault(),Ne(!1),Ke(-1);break}case" ":{I||(Ze.preventDefault(),an[Ye]&&Ve?hn(an[Ye]):(Ne(!0),Ke(Mo),Ls()));break}case"Enter":I||Ze.preventDefault(),an[Ye]&&Ve&&(Ze.preventDefault(),hn(an[Ye]))}},ka=Ze=>{typeof g=="function"&&g(Ze);const Gt=Le.find(Ln=>Ln.value===Ge);F&&an[Ye]&&Ve&&hn(an[Ye]),Nn((Gt==null?void 0:Gt.label)||""),Ne(!1)},mi=Ze=>{typeof x=="function"&&x(Ze),I&&Ne(!0)},_a=Ze=>{we||(Nn(Ze.currentTarget.value),M&&Ze.currentTarget.value===""&&pt(null),Ke(-1),Ne(!0))},hi=()=>{we||(Ne(!Ve),Ge&&!Ve&&Ke(Mo))};return H.createElement(Pc.Wrapper,$v(Mu({},o),{__staticSelector:"Select"}),H.createElement(Ka,{opened:hr,transitionProps:y,shadow:s,withinPortal:re,portalProps:le,__staticSelector:"Select",onDirectionChange:yt,switchDirectionOnFlip:oe,zIndex:q,dropdownPosition:ee,positionDependencies:[...xe,Tt],classNames:S,styles:_,unstyled:C,variant:r.variant},H.createElement(Ka.Target,null,H.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":hr?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":hr,onMouseLeave:()=>Ke(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:K,value:Ge||"",form:de,disabled:A}),H.createElement(Pc,Mu($v(Mu(Mu({autoComplete:"off",type:"search"},r),Oe),{ref:Ud(t,ge),onKeyDown:Sa,__staticSelector:"Select",value:Tt,placeholder:J,onChange:_a,"aria-autocomplete":"list","aria-controls":hr?`${r.id}-items`:null,"aria-activedescendant":Ye>=0?`${r.id}-${Ye}`:null,onMouseDown:hi,onBlur:ka,onFocus:mi,readOnly:!I||we,disabled:A,"data-mantine-stop-propagation":hr,name:null,classNames:$v(Mu({},S),{input:$e({[je.input]:!I},S==null?void 0:S.input)})}),eM({theme:st,rightSection:X,rightSectionWidth:z,styles:_,size:r.size,shouldClear:M&&!!At,onClear:Sn,error:o.error,clearButtonProps:ve,disabled:A,readOnly:we}))))),H.createElement(Ka.Dropdown,{component:T||cg,maxHeight:E,direction:ut,id:r.id,innerRef:ft,__staticSelector:"Select",classNames:S,styles:_},H.createElement(uy,{data:an,hovered:Ye,classNames:S,styles:_,isItemSelected:Ze=>Ze===Ge,uuid:r.id,__staticSelector:"Select",onItemHover:Ke,onItemSelect:hn,itemsRefs:De,itemComponent:m,size:r.size,nothingFound:R,creatable:Ut&&!!ke,createLabel:ke,"aria-label":o.label,unstyled:C,variant:r.variant}))))});Cy.displayName="@mantine/core/Select";const qd=()=>{const[e,t,n,r,o,s,l,i,c,p,m,h,g,x,y,b,C,S,_,j,E,I,M,R,D,A,O,$,X,z,V,Q,G,F,U,T,B,Y,re,le,oe,q,K,ee,ce,J,ie,de,xe,we,ve,fe,Oe,je,$e,st,Ve,Ct,Ye,Ke,ge,De,ut,yt,ye,tt,ct,ft,Me,Ne,Ut,ke,ze,Le,Ge,pt]=Ho("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","baseAlpha.50","baseAlpha.100","baseAlpha.150","baseAlpha.200","baseAlpha.250","baseAlpha.300","baseAlpha.350","baseAlpha.400","baseAlpha.450","baseAlpha.500","baseAlpha.550","baseAlpha.600","baseAlpha.650","baseAlpha.700","baseAlpha.750","baseAlpha.800","baseAlpha.850","baseAlpha.900","baseAlpha.950","accentAlpha.50","accentAlpha.100","accentAlpha.150","accentAlpha.200","accentAlpha.250","accentAlpha.300","accentAlpha.350","accentAlpha.400","accentAlpha.450","accentAlpha.500","accentAlpha.550","accentAlpha.600","accentAlpha.650","accentAlpha.700","accentAlpha.750","accentAlpha.800","accentAlpha.850","accentAlpha.900","accentAlpha.950"]);return{base50:e,base100:t,base150:n,base200:r,base250:o,base300:s,base350:l,base400:i,base450:c,base500:p,base550:m,base600:h,base650:g,base700:x,base750:y,base800:b,base850:C,base900:S,base950:_,accent50:j,accent100:E,accent150:I,accent200:M,accent250:R,accent300:D,accent350:A,accent400:O,accent450:$,accent500:X,accent550:z,accent600:V,accent650:Q,accent700:G,accent750:F,accent800:U,accent850:T,accent900:B,accent950:Y,baseAlpha50:re,baseAlpha100:le,baseAlpha150:oe,baseAlpha200:q,baseAlpha250:K,baseAlpha300:ee,baseAlpha350:ce,baseAlpha400:J,baseAlpha450:ie,baseAlpha500:de,baseAlpha550:xe,baseAlpha600:we,baseAlpha650:ve,baseAlpha700:fe,baseAlpha750:Oe,baseAlpha800:je,baseAlpha850:$e,baseAlpha900:st,baseAlpha950:Ve,accentAlpha50:Ct,accentAlpha100:Ye,accentAlpha150:Ke,accentAlpha200:ge,accentAlpha250:De,accentAlpha300:ut,accentAlpha350:yt,accentAlpha400:ye,accentAlpha450:tt,accentAlpha500:ct,accentAlpha550:ft,accentAlpha600:Me,accentAlpha650:Ne,accentAlpha700:Ut,accentAlpha750:ke,accentAlpha800:ze,accentAlpha850:Le,accentAlpha900:Ge,accentAlpha950:pt}},Ae=(e,t)=>n=>n==="light"?e:t,cM=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:l,base700:i,base800:c,base900:p,accent200:m,accent300:h,accent400:g,accent500:x,accent600:y}=qd(),{colorMode:b}=ha(),[C]=Ho("shadows",["dark-lg"]),[S,_,j]=Ho("space",[1,2,6]),[E]=Ho("radii",["base"]),[I]=Ho("lineHeights",["base"]);return d.useCallback(()=>({label:{color:Ae(i,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,i)(b)}},input:{border:"unset",backgroundColor:Ae(e,p)(b),borderRadius:E,borderStyle:"solid",borderWidth:"2px",borderColor:Ae(n,c)(b),color:Ae(p,t)(b),minHeight:"unset",lineHeight:I,height:"auto",paddingRight:0,paddingLeft:0,paddingInlineStart:_,paddingInlineEnd:j,paddingTop:S,paddingBottom:S,fontWeight:600,"&:hover":{borderColor:Ae(r,l)(b)},"&:focus":{borderColor:Ae(h,y)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(m,y)(b)},"&[data-disabled]":{backgroundColor:Ae(r,i)(b),color:Ae(l,o)(b),cursor:"not-allowed"}},value:{backgroundColor:Ae(t,p)(b),color:Ae(p,t)(b),button:{color:Ae(p,t)(b)},"&:hover":{backgroundColor:Ae(r,i)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,c)(b),borderColor:Ae(n,c)(b),boxShadow:C},item:{backgroundColor:Ae(n,c)(b),color:Ae(c,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,i)(b)},"&[data-active]":{backgroundColor:Ae(r,i)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,i)(b)}},"&[data-selected]":{backgroundColor:Ae(g,y)(b),color:Ae(e,t)(b),fontWeight:600,"&:hover":{backgroundColor:Ae(x,x)(b),color:Ae("white",e)(b)}},"&[data-disabled]":{color:Ae(s,l)(b),cursor:"not-allowed"}},rightSection:{width:32,button:{color:Ae(p,t)(b)}}}),[m,h,g,x,y,t,n,r,o,e,s,l,i,c,p,C,b,I,E,S,_,j])},uM=_e((e,t)=>{const{searchable:n=!0,tooltip:r,inputRef:o,onChange:s,label:l,disabled:i,...c}=e,p=te(),[m,h]=d.useState(""),g=d.useCallback(C=>{C.shiftKey&&p(Nr(!0))},[p]),x=d.useCallback(C=>{C.shiftKey||p(Nr(!1))},[p]),y=d.useCallback(C=>{s&&s(C)},[s]),b=cM();return a.jsx(Vt,{label:r,placement:"top",hasArrow:!0,children:a.jsxs(Zt,{ref:t,isDisabled:i,position:"static","data-testid":`select-${l||e.placeholder}`,children:[l&&a.jsx(In,{children:l}),a.jsx(Cy,{ref:o,disabled:i,searchValue:m,onSearchChange:h,onChange:y,onKeyDown:g,onKeyUp:x,searchable:n,maxDropdownHeight:300,styles:b,...c})]})})});uM.displayName="IAIMantineSearchableSelect";const nn=d.memo(uM),jJ=ae([he],({changeBoardModal:e})=>{const{isModalOpen:t,imagesToChange:n}=e;return{isModalOpen:t,imagesToChange:n}},Ce),IJ=()=>{const e=te(),[t,n]=d.useState(),{data:r,isFetching:o}=kd(),{imagesToChange:s,isModalOpen:l}=W(jJ),[i]=cD(),[c]=uD(),{t:p}=Z(),m=d.useMemo(()=>{const y=[{label:p("boards.uncategorized"),value:"none"}];return(r??[]).forEach(b=>y.push({label:b.board_name,value:b.board_id})),y},[r,p]),h=d.useCallback(()=>{e(cw()),e(Kx(!1))},[e]),g=d.useCallback(()=>{!s.length||!t||(t==="none"?c({imageDTOs:s}):i({imageDTOs:s,board_id:t}),n(null),e(cw()))},[i,e,s,c,t]),x=d.useRef(null);return a.jsx(zd,{isOpen:l,onClose:h,leastDestructiveRef:x,isCentered:!0,children:a.jsx(Zo,{children:a.jsxs(Fd,{children:[a.jsx(Yo,{fontSize:"lg",fontWeight:"bold",children:p("boards.changeBoard")}),a.jsx(Jo,{children:a.jsxs(N,{sx:{flexDir:"column",gap:4},children:[a.jsxs(be,{children:["Moving ",`${s.length}`," image",`${s.length>1?"s":""}`," to board:"]}),a.jsx(nn,{placeholder:p(o?"boards.loading":"boards.selectBoard"),disabled:o,onChange:y=>n(y),value:t,data:m})]})}),a.jsxs(ks,{children:[a.jsx(ot,{ref:x,onClick:h,children:p("boards.cancel")}),a.jsx(ot,{colorScheme:"accent",onClick:g,ml:3,children:p("boards.move")})]})]})})})},PJ=d.memo(IJ),dM=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:l,helperText:i,...c}=e;return a.jsx(Vt,{label:l,hasArrow:!0,placement:"top",isDisabled:!l,children:a.jsx(Zt,{isDisabled:n,width:r,alignItems:"center",...o,children:a.jsxs(N,{sx:{flexDir:"column",w:"full"},children:[a.jsxs(N,{sx:{alignItems:"center",w:"full"},children:[t&&a.jsx(In,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx,pe:4},...s,children:t}),a.jsx(ry,{...c})]}),i&&a.jsx(v5,{children:a.jsx(be,{variant:"subtext",children:i})})]})})})};dM.displayName="IAISwitch";const Cn=d.memo(dM),EJ=e=>{const{t}=Z(),{imageUsage:n,topMessage:r=t("gallery.currentlyInUse"),bottomMessage:o=t("gallery.featuresWillReset")}=e;return!n||!Vo(n)?null:a.jsxs(a.Fragment,{children:[a.jsx(be,{children:r}),a.jsxs(Td,{sx:{paddingInlineStart:6},children:[n.isInitialImage&&a.jsx(go,{children:t("common.img2img")}),n.isCanvasImage&&a.jsx(go,{children:t("common.unifiedCanvas")}),n.isControlImage&&a.jsx(go,{children:t("common.controlNet")}),n.isNodesImage&&a.jsx(go,{children:t("common.nodeEditor")})]}),a.jsx(be,{children:o})]})},fM=d.memo(EJ),MJ=ae([he,dD],(e,t)=>{const{system:n,config:r,deleteImageModal:o}=e,{shouldConfirmOnDelete:s}=n,{canRestoreDeletedImagesFromBin:l}=r,{imagesToDelete:i,isModalOpen:c}=o,p=(i??[]).map(({image_name:h})=>iI(e,h)),m={isInitialImage:Vo(p,h=>h.isInitialImage),isCanvasImage:Vo(p,h=>h.isCanvasImage),isNodesImage:Vo(p,h=>h.isNodesImage),isControlImage:Vo(p,h=>h.isControlImage)};return{shouldConfirmOnDelete:s,canRestoreDeletedImagesFromBin:l,imagesToDelete:i,imagesUsage:t,isModalOpen:c,imageUsageSummary:m}},Ce),OJ=()=>{const e=te(),{t}=Z(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imagesToDelete:o,imagesUsage:s,isModalOpen:l,imageUsageSummary:i}=W(MJ),c=d.useCallback(g=>e(cI(!g.target.checked)),[e]),p=d.useCallback(()=>{e(uw()),e(fD(!1))},[e]),m=d.useCallback(()=>{!o.length||!s.length||(e(uw()),e(pD({imageDTOs:o,imagesUsage:s})))},[e,o,s]),h=d.useRef(null);return a.jsx(zd,{isOpen:l,onClose:p,leastDestructiveRef:h,isCentered:!0,children:a.jsx(Zo,{children:a.jsxs(Fd,{children:[a.jsx(Yo,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),a.jsx(Jo,{children:a.jsxs(N,{direction:"column",gap:3,children:[a.jsx(fM,{imageUsage:i}),a.jsx(Jn,{}),a.jsx(be,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),a.jsx(be,{children:t("common.areYouSure")}),a.jsx(Cn,{label:t("common.dontAskMeAgain"),isChecked:!n,onChange:c})]})}),a.jsxs(ks,{children:[a.jsx(ot,{ref:h,onClick:p,children:"Cancel"}),a.jsx(ot,{colorScheme:"error",onClick:m,ml:3,children:"Delete"})]})]})})})},RJ=d.memo(OJ),pM=_e((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...l}=e;return a.jsx(Vt,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:a.jsx(Cs,{ref:t,role:n,colorScheme:s?"accent":"base","data-testid":r,...l})})});pM.displayName="IAIIconButton";const Be=d.memo(pM);var mM={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Zk=H.createContext&&H.createContext(mM),qa=globalThis&&globalThis.__assign||function(){return qa=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},qa.apply(this,arguments)},DJ=globalThis&&globalThis.__rest||function(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 hM(e){return e&&e.map(function(t,n){return H.createElement(t.tag,qa({key:n},t.attr),hM(t.child))})}function Te(e){return function(t){return H.createElement(AJ,qa({attr:qa({},e.attr)},t),hM(e.child))}}function AJ(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,l=DJ(e,["attr","size","title"]),i=o||n.size||"1em",c;return n.className&&(c=n.className),e.className&&(c=(c?c+" ":"")+e.className),H.createElement("svg",qa({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,l,{className:c,style:qa(qa({color:e.color||n.color},n.style),e.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),s&&H.createElement("title",null,s),e.children)};return Zk!==void 0?H.createElement(Zk.Consumer,null,function(n){return t(n)}):t(mM)}function TJ(e){return Te({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 $J(e){return Te({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 NJ(e){return Te({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 LJ(e){return Te({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 zJ(e){return Te({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 FJ(e){return Te({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 BJ(e){return Te({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 HJ(e){return Te({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 gM(e){return Te({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 VJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"}}]})(e)}function WJ(e){return Te({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 vM(e){return Te({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 UJ(e){return Te({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 xM(e){return Te({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 bM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"}}]})(e)}function Uc(e){return Te({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 GJ(e){return Te({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 KJ(e){return Te({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 Gc(e){return Te({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 qJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"}}]})(e)}function XJ(e){return Te({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 QJ(e){return Te({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 YJ(e){return Te({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 yM(e){return Te({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 wy(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"}}]})(e)}function ZJ(e){return Te({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 JJ(e){return Te({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 eee(e){return Te({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 tee(e){return Te({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 CM(e){return Te({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 nee(e){return Te({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 ree(e){return Te({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 Yl(e){return Te({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 oee(e){return Te({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 wM(e){return Te({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 see(e){return Te({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 aee(e){return Te({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 SM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"}}]})(e)}function kM(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"}}]})(e)}function lee(e){return Te({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"}}]})(e)}function _M(e){return Te({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 iee(e){return Te({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 cee(e){return Te({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 uee(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}}]})(e)}function dee(e){return Te({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 Xa(e){return Te({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 jM(e){return Te({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 fee(e){return Te({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 pee(e){return Te({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 mee(e){return Te({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M168 416c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88V32c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v448c0 17.67 14.33 32 32 32h192c17.67 0 32-14.33 32-32v-64h-88z"}}]})(e)}function fg(e){return Te({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 hee(e){return Te({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 IM(e){return Te({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 gee(e){return Te({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 Jk(e){return Te({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 PM(e){return Te({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 vee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M16 128h416c8.84 0 16-7.16 16-16V48c0-8.84-7.16-16-16-16H16C7.16 32 0 39.16 0 48v64c0 8.84 7.16 16 16 16zm480 80H80c-8.84 0-16 7.16-16 16v64c0 8.84 7.16 16 16 16h416c8.84 0 16-7.16 16-16v-64c0-8.84-7.16-16-16-16zm-64 176H16c-8.84 0-16 7.16-16 16v64c0 8.84 7.16 16 16 16h416c8.84 0 16-7.16 16-16v-64c0-8.84-7.16-16-16-16z"}}]})(e)}function xee(e){return Te({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 EM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M440.65 12.57l4 82.77A247.16 247.16 0 0 0 255.83 8C134.73 8 33.91 94.92 12.29 209.82A12 12 0 0 0 24.09 224h49.05a12 12 0 0 0 11.67-9.26 175.91 175.91 0 0 1 317-56.94l-101.46-4.86a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12H500a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12h-47.37a12 12 0 0 0-11.98 12.57zM255.83 432a175.61 175.61 0 0 1-146-77.8l101.8 4.87a12 12 0 0 0 12.57-12v-47.4a12 12 0 0 0-12-12H12a12 12 0 0 0-12 12V500a12 12 0 0 0 12 12h47.35a12 12 0 0 0 12-12.6l-4.15-82.57A247.17 247.17 0 0 0 255.83 504c121.11 0 221.93-86.92 243.55-201.82a12 12 0 0 0-11.8-14.18h-49.05a12 12 0 0 0-11.67 9.26A175.86 175.86 0 0 1 255.83 432z"}}]})(e)}function Ec(e){return Te({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"}}]})(e)}function Fr(e){return Te({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 pg(e){return Te({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 mg(e){return Te({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 bee(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function MM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const Dt=e=>{const t=W(l=>l.config.disabledTabs),n=W(l=>l.config.disabledFeatures),r=W(l=>l.config.disabledSDFeatures),o=d.useMemo(()=>n.includes(e)||r.includes(e)||t.includes(e),[n,r,t,e]),s=d.useMemo(()=>!(n.includes(e)||r.includes(e)||t.includes(e)),[n,r,t,e]);return{isFeatureDisabled:o,isFeatureEnabled:s}};function yee(e){const{title:t,hotkey:n,description:r}=e;return a.jsxs(el,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs(el,{children:[a.jsx(be,{fontWeight:600,children:t}),r&&a.jsx(be,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),a.jsx(Ie,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function Cee({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Lr(),{t:o}=Z(),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.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"}],l=[{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.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"}],i=[{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.increaseGalleryThumbSize.title"),desc:o("hotkeys.increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:o("hotkeys.decreaseGalleryThumbSize.title"),desc:o("hotkeys.decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],c=[{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=[{title:o("hotkeys.addNodes.title"),desc:o("hotkeys.addNodes.desc"),hotkey:"Shift + A / Space"}],m=h=>a.jsx(N,{flexDir:"column",gap:4,children:h.map((g,x)=>a.jsxs(N,{flexDir:"column",px:2,gap:4,children:[a.jsx(yee,{title:g.title,description:g.desc,hotkey:g.hotkey}),x<h.length-1&&a.jsx(Jn,{})]},x))});return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:n}),a.jsxs(ql,{isOpen:t,onClose:r,children:[a.jsx(Zo,{}),a.jsxs(Xl,{children:[a.jsx(Yo,{children:o("hotkeys.keyboardShortcuts")}),a.jsx(Bd,{}),a.jsx(Jo,{children:a.jsx(h5,{allowMultiple:!0,children:a.jsxs(N,{flexDir:"column",gap:2,children:[a.jsxs(Wi,{children:[a.jsx(Hi,{children:a.jsxs(N,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.appHotkeys")}),a.jsx(Vi,{})]})}),a.jsx(Ui,{children:m(s)})]}),a.jsxs(Wi,{children:[a.jsx(Hi,{children:a.jsxs(N,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.generalHotkeys")}),a.jsx(Vi,{})]})}),a.jsx(Ui,{children:m(l)})]}),a.jsxs(Wi,{children:[a.jsx(Hi,{children:a.jsxs(N,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),a.jsx(Vi,{})]})}),a.jsx(Ui,{children:m(i)})]}),a.jsxs(Wi,{children:[a.jsx(Hi,{children:a.jsxs(N,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),a.jsx(Vi,{})]})}),a.jsx(Ui,{children:m(c)})]}),a.jsxs(Wi,{children:[a.jsx(Hi,{children:a.jsxs(N,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.nodesHotkeys")}),a.jsx(Vi,{})]})}),a.jsx(Ui,{children:m(p)})]})]})})}),a.jsx(ks,{})]})]})]})}function e_(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function t_(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var wee=function(e,t){return typeof t=="boolean"?t:!e},See=function(e){return d.useReducer(wee,e)};const kee=See;function _ee(e,t){t===void 0&&(t=0);var n=d.useRef(!1),r=d.useRef(),o=d.useRef(e),s=d.useCallback(function(){return n.current},[]),l=d.useCallback(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},t)},[t]),i=d.useCallback(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return d.useEffect(function(){o.current=e},[e]),d.useEffect(function(){return l(),i},[t]),[s,i,l]}function jee(e,t,n){t===void 0&&(t=0),n===void 0&&(n=[]);var r=_ee(e,t),o=r[0],s=r[1],l=r[2];return d.useEffect(l,n),[o,s]}var Iee=function(e,t){t===void 0&&(t=!0);var n=d.useState(!1),r=n[0],o=n[1];return d.useEffect(function(){var s=function(){return o(!0)},l=function(){return o(!1)};t&&e&&e.current&&(e_(e.current,"mouseover",s),e_(e.current,"mouseout",l));var i=e.current;return function(){t&&i&&(t_(i,"mouseover",s),t_(i,"mouseout",l))}},[t,e]),r};const OM=Iee,Pee=({showVersion:e=!0})=>{const{data:t}=mD(),n=d.useRef(null),r=OM(n);return a.jsxs(N,{alignItems:"center",gap:5,ps:1,ref:n,children:[a.jsx(ga,{src:qx,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),a.jsxs(N,{sx:{gap:3,alignItems:"center"},children:[a.jsxs(be,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",a.jsx("strong",{children:"ai"})]}),a.jsx(fr,{children:e&&r&&t&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(be,{sx:{fontWeight:600,marginTop:1,color:"base.300",fontSize:14},variant:"subtext",children:t.version})},"statusText")})]})]})},Eee=d.memo(Pee),RM=_e((e,t)=>{const{tooltip:n,inputRef:r,label:o,disabled:s,required:l,...i}=e,c=cM();return a.jsx(Vt,{label:n,placement:"top",hasArrow:!0,children:a.jsxs(Zt,{ref:t,isRequired:l,isDisabled:s,position:"static","data-testid":`select-${o||e.placeholder}`,children:[a.jsx(In,{children:o}),a.jsx(Cy,{disabled:s,ref:r,styles:c,...i})]})})});RM.displayName="IAIMantineSelect";const On=d.memo(RM),Mee={ar:bt.t("common.langArabic",{lng:"ar"}),nl:bt.t("common.langDutch",{lng:"nl"}),en:bt.t("common.langEnglish",{lng:"en"}),fr:bt.t("common.langFrench",{lng:"fr"}),de:bt.t("common.langGerman",{lng:"de"}),he:bt.t("common.langHebrew",{lng:"he"}),it:bt.t("common.langItalian",{lng:"it"}),ja:bt.t("common.langJapanese",{lng:"ja"}),ko:bt.t("common.langKorean",{lng:"ko"}),pl:bt.t("common.langPolish",{lng:"pl"}),pt_BR:bt.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:bt.t("common.langPortuguese",{lng:"pt"}),ru:bt.t("common.langRussian",{lng:"ru"}),zh_CN:bt.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:bt.t("common.langSpanish",{lng:"es"}),uk:bt.t("common.langUkranian",{lng:"ua"})},Oee={CONNECTED:"common.statusConnected",DISCONNECTED:"common.statusDisconnected",PROCESSING:"common.statusProcessing",ERROR:"common.statusError",LOADING_MODEL:"common.statusLoadingModel"},DM=ae(he,({system:e})=>e.language,Ce);function Lo(e){const{t}=Z(),{label:n,textProps:r,useBadge:o=!1,badgeLabel:s=t("settings.experimental"),badgeProps:l,...i}=e;return a.jsxs(N,{justifyContent:"space-between",py:1,children:[a.jsxs(N,{gap:2,alignItems:"center",children:[a.jsx(be,{sx:{fontSize:14,_dark:{color:"base.300"}},...r,children:n}),o&&a.jsx(As,{size:"xs",sx:{px:2,color:"base.700",bg:"accent.200",_dark:{bg:"accent.500",color:"base.200"}},...l,children:s})]}),a.jsx(Cn,{...i})]})}const Ree=e=>a.jsx(N,{sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base",bg:"base.100",_dark:{bg:"base.900"}},children:e.children}),Ki=d.memo(Ree);function Dee(){const{t:e}=Z(),t=te(),{data:n,refetch:r}=hD(),[o,{isLoading:s}]=gD(),l=d.useCallback(()=>{o().unwrap().then(i=>{t(uI()),t(dI()),t(lt({title:e("settings.intermediatesCleared",{count:i}),status:"info"}))}).catch(()=>{t(lt({title:e("settings.intermediatesClearedFailed"),status:"error"}))})},[e,o,t]);return d.useEffect(()=>{r()},[r]),a.jsxs(Ki,{children:[a.jsx(ur,{size:"sm",children:e("settings.clearIntermediates")}),a.jsx(ot,{colorScheme:"warning",onClick:l,isLoading:s,isDisabled:!n,children:e("settings.clearIntermediatesWithCount",{count:n??0})}),a.jsx(be,{fontWeight:"bold",children:e("settings.clearIntermediatesDesc1")}),a.jsx(be,{variant:"subtext",children:e("settings.clearIntermediatesDesc2")}),a.jsx(be,{variant:"subtext",children:e("settings.clearIntermediatesDesc3")})]})}const Aee=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:l,base700:i,base800:c,base900:p,accent200:m,accent300:h,accent400:g,accent500:x,accent600:y}=qd(),{colorMode:b}=ha(),[C]=Ho("shadows",["dark-lg"]);return d.useCallback(()=>({label:{color:Ae(i,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,i)(b)}},searchInput:{":placeholder":{color:Ae(r,i)(b)}},input:{backgroundColor:Ae(e,p)(b),borderWidth:"2px",borderColor:Ae(n,c)(b),color:Ae(p,t)(b),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Ae(r,l)(b)},"&:focus":{borderColor:Ae(h,y)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(m,y)(b)},"&[data-disabled]":{backgroundColor:Ae(r,i)(b),color:Ae(l,o)(b),cursor:"not-allowed"}},value:{backgroundColor:Ae(n,c)(b),color:Ae(p,t)(b),button:{color:Ae(p,t)(b)},"&:hover":{backgroundColor:Ae(r,i)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,c)(b),borderColor:Ae(n,c)(b),boxShadow:C},item:{backgroundColor:Ae(n,c)(b),color:Ae(c,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,i)(b)},"&[data-active]":{backgroundColor:Ae(r,i)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,i)(b)}},"&[data-selected]":{backgroundColor:Ae(g,y)(b),color:Ae(e,t)(b),fontWeight:600,"&:hover":{backgroundColor:Ae(x,x)(b),color:Ae("white",e)(b)}},"&[data-disabled]":{color:Ae(s,l)(b),cursor:"not-allowed"}},rightSection:{width:24,padding:20,button:{color:Ae(p,t)(b)}}}),[m,h,g,x,y,t,n,r,o,e,s,l,i,c,p,C,b])},AM=_e((e,t)=>{const{searchable:n=!0,tooltip:r,inputRef:o,label:s,disabled:l,...i}=e,c=te(),p=d.useCallback(g=>{g.shiftKey&&c(Nr(!0))},[c]),m=d.useCallback(g=>{g.shiftKey||c(Nr(!1))},[c]),h=Aee();return a.jsx(Vt,{label:r,placement:"top",hasArrow:!0,isOpen:!0,children:a.jsxs(Zt,{ref:t,isDisabled:l,position:"static",children:[s&&a.jsx(In,{children:s}),a.jsx(rM,{ref:o,disabled:l,onKeyDown:p,onKeyUp:m,searchable:n,maxDropdownHeight:300,styles:h,...i})]})})});AM.displayName="IAIMantineMultiSelect";const Tee=d.memo(AM),$ee=kr(Ch,(e,t)=>({value:t,label:e})).sort((e,t)=>e.label.localeCompare(t.label));function Nee(){const e=te(),{t}=Z(),n=W(o=>o.ui.favoriteSchedulers),r=d.useCallback(o=>{e(vD(o))},[e]);return a.jsx(Tee,{label:t("settings.favoriteSchedulers"),value:n,data:$ee,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const Lee=ae([he],({system:e,ui:t})=>{const{shouldConfirmOnDelete:n,enableImageDebugging:r,consoleLogLevel:o,shouldLogToConsole:s,shouldAntialiasProgressImage:l,shouldUseNSFWChecker:i,shouldUseWatermarker:c,shouldEnableInformationalPopovers:p}=e,{shouldUseSliders:m,shouldShowProgressInViewer:h,shouldAutoChangeDimensions:g}=t;return{shouldConfirmOnDelete:n,enableImageDebugging:r,shouldUseSliders:m,shouldShowProgressInViewer:h,consoleLogLevel:o,shouldLogToConsole:s,shouldAntialiasProgressImage:l,shouldUseNSFWChecker:i,shouldUseWatermarker:c,shouldAutoChangeDimensions:g,shouldEnableInformationalPopovers:p}},{memoizeOptions:{resultEqualityCheck:Bt}}),zee=({children:e,config:t})=>{const n=te(),{t:r}=Z(),[o,s]=d.useState(3),l=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,i=(t==null?void 0:t.shouldShowResetWebUiText)??!0,c=(t==null?void 0:t.shouldShowClearIntermediates)??!0,p=(t==null?void 0:t.shouldShowLocalizationToggle)??!0;d.useEffect(()=>{l||n(dw(!1))},[l,n]);const{isNSFWCheckerAvailable:m,isWatermarkerAvailable:h}=fI(void 0,{selectFromResult:({data:Y})=>({isNSFWCheckerAvailable:(Y==null?void 0:Y.nsfw_methods.includes("nsfw_checker"))??!1,isWatermarkerAvailable:(Y==null?void 0:Y.watermarking_methods.includes("invisible_watermark"))??!1})}),{isOpen:g,onOpen:x,onClose:y}=Lr(),{isOpen:b,onOpen:C,onClose:S}=Lr(),{shouldConfirmOnDelete:_,enableImageDebugging:j,shouldUseSliders:E,shouldShowProgressInViewer:I,consoleLogLevel:M,shouldLogToConsole:R,shouldAntialiasProgressImage:D,shouldUseNSFWChecker:A,shouldUseWatermarker:O,shouldAutoChangeDimensions:$,shouldEnableInformationalPopovers:X}=W(Lee),z=d.useCallback(()=>{Object.keys(window.localStorage).forEach(Y=>{(xD.includes(Y)||Y.startsWith(bD))&&localStorage.removeItem(Y)}),y(),C(),setInterval(()=>s(Y=>Y-1),1e3)},[y,C]);d.useEffect(()=>{o<=0&&window.location.reload()},[o]);const V=d.useCallback(Y=>{n(yD(Y))},[n]),Q=d.useCallback(Y=>{n(CD(Y))},[n]),G=d.useCallback(Y=>{n(dw(Y.target.checked))},[n]),{colorMode:F,toggleColorMode:U}=ha(),T=Dt("localization").isFeatureEnabled,B=W(DM);return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:x}),a.jsxs(ql,{isOpen:g,onClose:y,size:"2xl",isCentered:!0,children:[a.jsx(Zo,{}),a.jsxs(Xl,{children:[a.jsx(Yo,{bg:"none",children:r("common.settingsLabel")}),a.jsx(Bd,{}),a.jsx(Jo,{children:a.jsxs(N,{sx:{gap:4,flexDirection:"column"},children:[a.jsxs(Ki,{children:[a.jsx(ur,{size:"sm",children:r("settings.general")}),a.jsx(Lo,{label:r("settings.confirmOnDelete"),isChecked:_,onChange:Y=>n(cI(Y.target.checked))})]}),a.jsxs(Ki,{children:[a.jsx(ur,{size:"sm",children:r("settings.generation")}),a.jsx(Nee,{}),a.jsx(Lo,{label:"Enable NSFW Checker",isDisabled:!m,isChecked:A,onChange:Y=>n(wD(Y.target.checked))}),a.jsx(Lo,{label:"Enable Invisible Watermark",isDisabled:!h,isChecked:O,onChange:Y=>n(SD(Y.target.checked))})]}),a.jsxs(Ki,{children:[a.jsx(ur,{size:"sm",children:r("settings.ui")}),a.jsx(Lo,{label:r("common.darkMode"),isChecked:F==="dark",onChange:U}),a.jsx(Lo,{label:r("settings.useSlidersForAll"),isChecked:E,onChange:Y=>n(kD(Y.target.checked))}),a.jsx(Lo,{label:r("settings.showProgressInViewer"),isChecked:I,onChange:Y=>n(pI(Y.target.checked))}),a.jsx(Lo,{label:r("settings.antialiasProgressImages"),isChecked:D,onChange:Y=>n(_D(Y.target.checked))}),a.jsx(Lo,{label:r("settings.autoChangeDimensions"),isChecked:$,onChange:Y=>n(jD(Y.target.checked))}),p&&a.jsx(On,{disabled:!T,label:r("common.languagePickerLabel"),value:B,data:Object.entries(Mee).map(([Y,re])=>({value:Y,label:re})),onChange:Q}),a.jsx(Lo,{label:"Enable informational popovers",isChecked:X,onChange:Y=>n(ID(Y.target.checked))})]}),l&&a.jsxs(Ki,{children:[a.jsx(ur,{size:"sm",children:r("settings.developer")}),a.jsx(Lo,{label:r("settings.shouldLogToConsole"),isChecked:R,onChange:G}),a.jsx(On,{disabled:!R,label:r("settings.consoleLogLevel"),onChange:V,value:M,data:PD.concat()}),a.jsx(Lo,{label:r("settings.enableImageDebugging"),isChecked:j,onChange:Y=>n(ED(Y.target.checked))})]}),c&&a.jsx(Dee,{}),a.jsxs(Ki,{children:[a.jsx(ur,{size:"sm",children:r("settings.resetWebUI")}),a.jsx(ot,{colorScheme:"error",onClick:z,children:r("settings.resetWebUI")}),i&&a.jsxs(a.Fragment,{children:[a.jsx(be,{variant:"subtext",children:r("settings.resetWebUIDesc1")}),a.jsx(be,{variant:"subtext",children:r("settings.resetWebUIDesc2")})]})]})]})}),a.jsx(ks,{children:a.jsx(ot,{onClick:y,children:r("common.close")})})]})]}),a.jsxs(ql,{closeOnOverlayClick:!1,isOpen:b,onClose:S,isCentered:!0,closeOnEsc:!1,children:[a.jsx(Zo,{backdropFilter:"blur(40px)"}),a.jsxs(Xl,{children:[a.jsx(Yo,{}),a.jsx(Jo,{children:a.jsx(N,{justifyContent:"center",children:a.jsx(be,{fontSize:"lg",children:a.jsxs(be,{children:[r("settings.resetComplete")," Reloading in ",o,"..."]})})})}),a.jsx(ks,{})]})]})]})},Fee=d.memo(zee),Bee=ae(he,({system:e})=>{const{isConnected:t,status:n}=e;return{isConnected:t,statusTranslationKey:Oee[n]}},Ce),n_={ok:"green.400",working:"yellow.400",error:"red.400"},r_={ok:"green.600",working:"yellow.500",error:"red.500"},Hee=()=>{const{isConnected:e,statusTranslationKey:t}=W(Bee),{t:n}=Z(),r=d.useRef(null),{data:o}=va(),s=d.useMemo(()=>e?o!=null&&o.queue.in_progress?"working":"ok":"error",[o==null?void 0:o.queue.in_progress,e]),l=OM(r);return a.jsxs(N,{ref:r,h:"full",px:2,alignItems:"center",gap:5,children:[a.jsx(fr,{children:l&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(be,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:r_[s],_dark:{color:n_[s]}},children:n(t)})},"statusText")}),a.jsx(Tn,{as:UJ,sx:{boxSize:"0.5rem",color:r_[s],_dark:{color:n_[s]}}})]})},Vee=d.memo(Hee),Wee=()=>{const{t:e}=Z(),t=Dt("bugLink").isFeatureEnabled,n=Dt("discordLink").isFeatureEnabled,r=Dt("githubLink").isFeatureEnabled,o="http://github.com/invoke-ai/InvokeAI",s="https://discord.gg/ZmtBAhwWhy";return a.jsxs(N,{sx:{gap:2,alignItems:"center"},children:[a.jsx(Eee,{}),a.jsx(ba,{}),a.jsx(Vee,{}),a.jsxs(zh,{children:[a.jsx(Fh,{as:Be,variant:"link","aria-label":e("accessibility.menu"),icon:a.jsx(VJ,{}),sx:{boxSize:8}}),a.jsxs(Gl,{motionProps:bc,children:[a.jsxs(ad,{title:e("common.communityLabel"),children:[r&&a.jsx(Kt,{as:"a",href:o,target:"_blank",icon:a.jsx($J,{}),children:e("common.githubLabel")}),t&&a.jsx(Kt,{as:"a",href:`${o}/issues`,target:"_blank",icon:a.jsx(WJ,{}),children:e("common.reportBugLabel")}),n&&a.jsx(Kt,{as:"a",href:s,target:"_blank",icon:a.jsx(TJ,{}),children:e("common.discordLabel")})]}),a.jsxs(ad,{title:e("common.settingsLabel"),children:[a.jsx(Cee,{children:a.jsx(Kt,{as:"button",icon:a.jsx(see,{}),children:e("common.hotkeysLabel")})}),a.jsx(Fee,{children:a.jsx(Kt,{as:"button",icon:a.jsx(bM,{}),children:e("common.settingsLabel")})})]})]})]})]})},Uee=d.memo(Wee);/*!
|
||
* OverlayScrollbars
|
||
* Version: 2.2.1
|
||
*
|
||
* Copyright (c) Rene Haas | KingSora.
|
||
* https://github.com/KingSora
|
||
*
|
||
* Released under the MIT license.
|
||
*/function Ft(e,t){if(gg(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Ft(Object.keys(e),n=>t(e[n],n,e));return e}function dr(e,t){const n=dl(t);if(ns(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?l_(e,s,t):t.reduce((l,i)=>(l[i]=l_(e,s,i),l),o)}return o}e&&Ft(no(t),o=>lte(e,o,t[o]))}const Fo=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,l;const i=(m,h)=>{const g=s,x=m,y=h||(r?!r(g,x):g!==x);return(y||o)&&(s=x,l=g),[s,y,l]};return[t?m=>i(t(s,l),m):i,m=>[s,!!m,l]]},Xd=()=>typeof window<"u",TM=Xd()&&Node.ELEMENT_NODE,{toString:Gee,hasOwnProperty:Nv}=Object.prototype,Ca=e=>e===void 0,hg=e=>e===null,Kee=e=>Ca(e)||hg(e)?`${e}`:Gee.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Qa=e=>typeof e=="number",dl=e=>typeof e=="string",Sy=e=>typeof e=="boolean",ts=e=>typeof e=="function",ns=e=>Array.isArray(e),ud=e=>typeof e=="object"&&!ns(e)&&!hg(e),gg=e=>{const t=!!e&&e.length,n=Qa(t)&&t>-1&&t%1==0;return ns(e)||!ts(e)&&n?t>0&&ud(e)?t-1 in e:!0:!1},px=e=>{if(!e||!ud(e)||Kee(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=Nv.call(e,n),l=o&&Nv.call(o,"isPrototypeOf");if(r&&!s&&!l)return!1;for(t in e);return Ca(t)||Nv.call(e,t)},sh=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===TM:!1},vg=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===TM:!1},ky=(e,t,n)=>e.indexOf(t,n),Xt=(e,t,n)=>(!n&&!dl(t)&&gg(t)?Array.prototype.push.apply(e,t):e.push(t),e),Zl=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{Xt(n,r)}):Ft(e,r=>{Xt(n,r)}),n)},_y=e=>!!e&&e.length===0,Ts=(e,t,n)=>{Ft(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},xg=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),no=e=>e?Object.keys(e):[],yn=(e,t,n,r,o,s,l)=>{const i=[t,n,r,o,s,l];return(typeof e!="object"||hg(e))&&!ts(e)&&(e={}),Ft(i,c=>{Ft(no(c),p=>{const m=c[p];if(e===m)return!0;const h=ns(m);if(m&&(px(m)||h)){const g=e[p];let x=g;h&&!ns(g)?x=[]:!h&&!px(g)&&(x={}),e[p]=yn(x,m)}else e[p]=m})}),e},jy=e=>{for(const t in e)return!1;return!0},$M=(e,t,n,r)=>{if(Ca(r))return n?n[e]:t;n&&(dl(r)||Qa(r))&&(n[e]=r)},cr=(e,t,n)=>{if(Ca(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},Rr=(e,t)=>{e&&e.removeAttribute(t)},Ll=(e,t,n,r)=>{if(n){const o=cr(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const l=Zl(s).join(" ").trim();cr(e,t,l)}},qee=(e,t,n)=>{const r=cr(e,t)||"";return new Set(r.split(" ")).has(n)},qo=(e,t)=>$M("scrollLeft",0,e,t),ra=(e,t)=>$M("scrollTop",0,e,t),mx=Xd()&&Element.prototype,NM=(e,t)=>{const n=[],r=t?vg(t)?t:null:document;return r?Xt(n,r.querySelectorAll(e)):n},Xee=(e,t)=>{const n=t?vg(t)?t:null:document;return n?n.querySelector(e):null},ah=(e,t)=>vg(e)?(mx.matches||mx.msMatchesSelector).call(e,t):!1,Iy=e=>e?Zl(e.childNodes):[],ca=e=>e?e.parentElement:null,ec=(e,t)=>{if(vg(e)){const n=mx.closest;if(n)return n.call(e,t);do{if(ah(e,t))return e;e=ca(e)}while(e)}return null},Qee=(e,t,n)=>{const r=e&&ec(e,t),o=e&&Xee(n,r),s=ec(o,t)===r;return r&&o?r===e||o===e||s&&ec(ec(e,n),t)!==r:!1},Py=(e,t,n)=>{if(n&&e){let r=t,o;gg(n)?(o=document.createDocumentFragment(),Ft(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)}},vo=(e,t)=>{Py(e,null,t)},Yee=(e,t)=>{Py(ca(e),e,t)},o_=(e,t)=>{Py(ca(e),e&&e.nextSibling,t)},js=e=>{if(gg(e))Ft(Zl(e),t=>js(t));else if(e){const t=ca(e);t&&t.removeChild(e)}},zl=e=>{const t=document.createElement("div");return e&&cr(t,"class",e),t},LM=e=>{const t=zl();return t.innerHTML=e.trim(),Ft(Iy(t),n=>js(n))},hx=e=>e.charAt(0).toUpperCase()+e.slice(1),Zee=()=>zl().style,Jee=["-webkit-","-moz-","-o-","-ms-"],ete=["WebKit","Moz","O","MS","webkit","moz","o","ms"],Lv={},zv={},tte=e=>{let t=zv[e];if(xg(zv,e))return t;const n=hx(e),r=Zee();return Ft(Jee,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,hx(s)+n].find(i=>r[i]!==void 0))}),zv[e]=t||""},Qd=e=>{if(Xd()){let t=Lv[e]||window[e];return xg(Lv,e)||(Ft(ete,n=>(t=t||window[n+hx(e)],!t)),Lv[e]=t),t}},nte=Qd("MutationObserver"),s_=Qd("IntersectionObserver"),tc=Qd("ResizeObserver"),zM=Qd("cancelAnimationFrame"),FM=Qd("requestAnimationFrame"),lh=Xd()&&window.setTimeout,gx=Xd()&&window.clearTimeout,rte=/[^\x20\t\r\n\f]+/g,BM=(e,t,n)=>{const r=e&&e.classList;let o,s=0,l=!1;if(r&&t&&dl(t)){const i=t.match(rte)||[];for(l=i.length>0;o=i[s++];)l=!!n(r,o)&&l}return l},Ey=(e,t)=>{BM(e,t,(n,r)=>n.remove(r))},oa=(e,t)=>(BM(e,t,(n,r)=>n.add(r)),Ey.bind(0,e,t)),bg=(e,t,n,r)=>{if(e&&t){let o=!0;return Ft(n,s=>{const l=r?r(e[s]):e[s],i=r?r(t[s]):t[s];l!==i&&(o=!1)}),o}return!1},HM=(e,t)=>bg(e,t,["w","h"]),VM=(e,t)=>bg(e,t,["x","y"]),ote=(e,t)=>bg(e,t,["t","r","b","l"]),a_=(e,t,n)=>bg(e,t,["width","height"],n&&(r=>Math.round(r))),mo=()=>{},qi=e=>{let t;const n=e?lh:FM,r=e?gx:zM;return[o=>{r(t),t=n(o,ts(e)?e():e)},()=>r(t)]},My=(e,t)=>{let n,r,o,s=mo;const{v:l,g:i,p:c}=t||{},p=function(y){s(),gx(n),n=r=void 0,s=mo,e.apply(this,y)},m=x=>c&&r?c(r,x):x,h=()=>{s!==mo&&p(m(o)||o)},g=function(){const y=Zl(arguments),b=ts(l)?l():l;if(Qa(b)&&b>=0){const S=ts(i)?i():i,_=Qa(S)&&S>=0,j=b>0?lh:FM,E=b>0?gx:zM,M=m(y)||y,R=p.bind(0,M);s();const D=j(R,b);s=()=>E(D),_&&!n&&(n=lh(h,S)),r=o=M}else p(y)};return g.m=h,g},ste={opacity:1,zindex:1},Sp=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},ate=(e,t)=>!ste[e.toLowerCase()]&&Qa(t)?`${t}px`:t,l_=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],lte=(e,t,n)=>{try{const{style:r}=e;Ca(r[t])?r.setProperty(t,n):r[t]=ate(t,n)}catch{}},dd=e=>dr(e,"direction")==="rtl",i_=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,l=`${r}right${o}`,i=`${r}bottom${o}`,c=`${r}left${o}`,p=dr(e,[s,l,i,c]);return{t:Sp(p[s],!0),r:Sp(p[l],!0),b:Sp(p[i],!0),l:Sp(p[c],!0)}},{round:c_}=Math,Oy={w:0,h:0},fd=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:Oy,qp=e=>e?{w:e.clientWidth,h:e.clientHeight}:Oy,ih=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:Oy,ch=e=>{const t=parseFloat(dr(e,"height"))||0,n=parseFloat(dr(e,"width"))||0;return{w:n-c_(n),h:t-c_(t)}},bs=e=>e.getBoundingClientRect();let kp;const ite=()=>{if(Ca(kp)){kp=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){kp=!0}}))}catch{}}return kp},WM=e=>e.split(" "),cte=(e,t,n,r)=>{Ft(WM(t),o=>{e.removeEventListener(o,n,r)})},Vn=(e,t,n,r)=>{var o;const s=ite(),l=(o=s&&r&&r.S)!=null?o:s,i=r&&r.$||!1,c=r&&r.C||!1,p=[],m=s?{passive:l,capture:i}:i;return Ft(WM(t),h=>{const g=c?x=>{e.removeEventListener(h,g,i),n&&n(x)}:n;Xt(p,cte.bind(null,e,h,g,i)),e.addEventListener(h,g,m)}),Ts.bind(0,p)},UM=e=>e.stopPropagation(),GM=e=>e.preventDefault(),ute={x:0,y:0},Fv=e=>{const t=e?bs(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:ute},u_=(e,t)=>{Ft(ns(t)?t:[t],e)},Ry=e=>{const t=new Map,n=(s,l)=>{if(s){const i=t.get(s);u_(c=>{i&&i[c?"delete":"clear"](c)},l)}else t.forEach(i=>{i.clear()}),t.clear()},r=(s,l)=>{if(dl(s)){const p=t.get(s)||new Set;return t.set(s,p),u_(m=>{ts(m)&&p.add(m)},l),n.bind(0,s,l)}Sy(l)&&l&&n();const i=no(s),c=[];return Ft(i,p=>{const m=s[p];m&&Xt(c,r(p,m))}),Ts.bind(0,c)},o=(s,l)=>{const i=t.get(s);Ft(Zl(i),c=>{l&&!_y(l)?c.apply(0,l):c()})};return r(e||{}),[r,n,o]},d_=e=>JSON.stringify(e,(t,n)=>{if(ts(n))throw new Error;return n}),dte={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"]}},KM=(e,t)=>{const n={},r=no(t).concat(no(e));return Ft(r,o=>{const s=e[o],l=t[o];if(ud(s)&&ud(l))yn(n[o]={},KM(s,l)),jy(n[o])&&delete n[o];else if(xg(t,o)&&l!==s){let i=!0;if(ns(s)||ns(l))try{d_(s)===d_(l)&&(i=!1)}catch{}i&&(n[o]=l)}}),n},qM="os-environment",XM=`${qM}-flexbox-glue`,fte=`${XM}-max`,QM="os-scrollbar-hidden",Bv="data-overlayscrollbars-initialize",Bo="data-overlayscrollbars",YM=`${Bo}-overflow-x`,ZM=`${Bo}-overflow-y`,hc="overflowVisible",pte="scrollbarHidden",f_="scrollbarPressed",uh="updating",Fa="data-overlayscrollbars-viewport",Hv="arrange",JM="scrollbarHidden",gc=hc,vx="data-overlayscrollbars-padding",mte=gc,p_="data-overlayscrollbars-content",Dy="os-size-observer",hte=`${Dy}-appear`,gte=`${Dy}-listener`,vte="os-trinsic-observer",xte="os-no-css-vars",bte="os-theme-none",Br="os-scrollbar",yte=`${Br}-rtl`,Cte=`${Br}-horizontal`,wte=`${Br}-vertical`,e8=`${Br}-track`,Ay=`${Br}-handle`,Ste=`${Br}-visible`,kte=`${Br}-cornerless`,m_=`${Br}-transitionless`,h_=`${Br}-interaction`,g_=`${Br}-unusable`,v_=`${Br}-auto-hidden`,x_=`${Br}-wheel`,_te=`${e8}-interactive`,jte=`${Ay}-interactive`,t8={},Jl=()=>t8,Ite=e=>{const t=[];return Ft(ns(e)?e:[e],n=>{const r=no(n);Ft(r,o=>{Xt(t,t8[o]=n[o])})}),t},Pte="__osOptionsValidationPlugin",Ete="__osSizeObserverPlugin",Ty="__osScrollbarsHidingPlugin",Mte="__osClickScrollPlugin";let Vv;const b_=(e,t,n,r)=>{vo(e,t);const o=qp(t),s=fd(t),l=ch(n);return r&&js(t),{x:s.h-o.h+l.h,y:s.w-o.w+l.w}},Ote=e=>{let t=!1;const n=oa(e,QM);try{t=dr(e,tte("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},Rte=(e,t)=>{const n="hidden";dr(e,{overflowX:n,overflowY:n,direction:"rtl"}),qo(e,0);const r=Fv(e),o=Fv(t);qo(e,-999);const s=Fv(t);return{i:r.x===o.x,n:o.x!==s.x}},Dte=(e,t)=>{const n=oa(e,XM),r=bs(e),o=bs(t),s=a_(o,r,!0),l=oa(e,fte),i=bs(e),c=bs(t),p=a_(c,i,!0);return n(),l(),s&&p},Ate=()=>{const{body:e}=document,n=LM(`<div class="${qM}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=Ry(),[l,i]=Fo({o:b_(e,n,r),u:VM},b_.bind(0,e,n,r,!0)),[c]=i(),p=Ote(n),m={x:c.x===0,y:c.y===0},h={elements:{host:null,padding:!p,viewport:_=>p&&_===_.ownerDocument.body&&_,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},g=yn({},dte),x=yn.bind(0,{},g),y=yn.bind(0,{},h),b={k:c,A:m,I:p,L:dr(n,"zIndex")==="-1",B:Rte(n,r),V:Dte(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:y,q:_=>yn(h,_)&&y(),F:x,G:_=>yn(g,_)&&x(),X:yn({},h),U:yn({},g)},C=window.addEventListener,S=My(_=>s(_?"z":"r"),{v:33,g:99});if(Rr(n,"style"),js(n),C("resize",S.bind(0,!1)),!p&&(!m.x||!m.y)){let _;C("resize",()=>{const j=Jl()[Ty];_=_||j&&j.R(),_&&_(b,l,S.bind(0,!0))})}return b},Hr=()=>(Vv||(Vv=Ate()),Vv),$y=(e,t)=>ts(t)?t.apply(0,e):t,Tte=(e,t,n,r)=>{const o=Ca(r)?n:r;return $y(e,o)||t.apply(0,e)},n8=(e,t,n,r)=>{const o=Ca(r)?n:r,s=$y(e,o);return!!s&&(sh(s)?s:t.apply(0,e))},$te=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:l}=Hr(),{nativeScrollbarsOverlaid:i,body:c}=t,p=r??i,m=Ca(o)?c:o,h=(s.x||s.y)&&p,g=e&&(hg(m)?!l:m);return!!h||!!g},Ny=new WeakMap,Nte=(e,t)=>{Ny.set(e,t)},Lte=e=>{Ny.delete(e)},r8=e=>Ny.get(e),y_=(e,t)=>e?t.split(".").reduce((n,r)=>n&&xg(n,r)?n[r]:void 0,e):void 0,xx=(e,t,n)=>r=>[y_(e,r),n||y_(t,r)!==void 0],o8=e=>{let t=e;return[()=>t,n=>{t=yn({},t,n)}]},_p="tabindex",jp=zl.bind(0,""),Wv=e=>{vo(ca(e),Iy(e)),js(e)},zte=e=>{const t=Hr(),{N:n,I:r}=t,o=Jl()[Ty],s=o&&o.T,{elements:l}=n(),{host:i,padding:c,viewport:p,content:m}=l,h=sh(e),g=h?{}:e,{elements:x}=g,{host:y,padding:b,viewport:C,content:S}=x||{},_=h?e:g.target,j=ah(_,"textarea"),E=_.ownerDocument,I=E.documentElement,M=_===E.body,R=E.defaultView,D=Tte.bind(0,[_]),A=n8.bind(0,[_]),O=$y.bind(0,[_]),$=D.bind(0,jp,p),X=A.bind(0,jp,m),z=$(C),V=z===_,Q=V&&M,G=!V&&X(S),F=!V&&sh(z)&&z===G,U=F&&!!O(m),T=U?$():z,B=U?G:X(),re=Q?I:F?T:z,le=j?D(jp,i,y):_,oe=Q?re:le,q=F?B:G,K=E.activeElement,ee=!V&&R.top===R&&K===_,ce={W:_,Z:oe,J:re,K:!V&&A(jp,c,b),tt:q,nt:!V&&!r&&s&&s(t),ot:Q?I:re,st:Q?E:re,et:R,ct:E,rt:j,it:M,lt:h,ut:V,dt:F,ft:(Ye,Ke)=>qee(re,V?Bo:Fa,V?Ke:Ye),_t:(Ye,Ke,ge)=>Ll(re,V?Bo:Fa,V?Ke:Ye,ge)},J=no(ce).reduce((Ye,Ke)=>{const ge=ce[Ke];return Xt(Ye,ge&&!ca(ge)?ge:!1)},[]),ie=Ye=>Ye?ky(J,Ye)>-1:null,{W:de,Z:xe,K:we,J:ve,tt:fe,nt:Oe}=ce,je=[()=>{Rr(xe,Bo),Rr(xe,Bv),Rr(de,Bv),M&&(Rr(I,Bo),Rr(I,Bv))}],$e=j&&ie(xe);let st=j?de:Iy([fe,ve,we,xe,de].find(Ye=>ie(Ye)===!1));const Ve=Q?de:fe||ve;return[ce,()=>{cr(xe,Bo,V?"viewport":"host"),cr(we,vx,""),cr(fe,p_,""),V||cr(ve,Fa,"");const Ye=M&&!V?oa(ca(_),QM):mo;if($e&&(o_(de,xe),Xt(je,()=>{o_(xe,de),js(xe)})),vo(Ve,st),vo(xe,we),vo(we||xe,!V&&ve),vo(ve,fe),Xt(je,()=>{Ye(),Rr(we,vx),Rr(fe,p_),Rr(ve,YM),Rr(ve,ZM),Rr(ve,Fa),ie(fe)&&Wv(fe),ie(ve)&&Wv(ve),ie(we)&&Wv(we)}),r&&!V&&(Ll(ve,Fa,JM,!0),Xt(je,Rr.bind(0,ve,Fa))),Oe&&(Yee(ve,Oe),Xt(je,js.bind(0,Oe))),ee){const Ke=cr(ve,_p);cr(ve,_p,"-1"),ve.focus();const ge=()=>Ke?cr(ve,_p,Ke):Rr(ve,_p),De=Vn(E,"pointerdown keydown",()=>{ge(),De()});Xt(je,[ge,De])}else K&&K.focus&&K.focus();st=0},Ts.bind(0,je)]},Fte=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=Hr(),{ht:l}=r(),{vt:i}=o,c=(n||!s)&&i;return c&&dr(n,{height:l?"":"100%"}),{gt:c,wt:c}}},Bte=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:l,ut:i}=e,[c,p]=Fo({u:ote,o:i_()},i_.bind(0,o,"padding",""));return(m,h,g)=>{let[x,y]=p(g);const{I:b,V:C}=Hr(),{bt:S}=n(),{gt:_,wt:j,yt:E}=m,[I,M]=h("paddingAbsolute");(_||y||!C&&j)&&([x,y]=c(g));const D=!i&&(M||E||y);if(D){const A=!I||!s&&!b,O=x.r+x.l,$=x.t+x.b,X={marginRight:A&&!S?-O:0,marginBottom:A?-$:0,marginLeft:A&&S?-O:0,top:A?-x.t:0,right:A?S?-x.r:"auto":0,left:A?S?"auto":-x.l:0,width:A?`calc(100% + ${O}px)`:""},z={paddingTop:A?x.t:0,paddingRight:A?x.r:0,paddingBottom:A?x.b:0,paddingLeft:A?x.l:0};dr(s||l,X),dr(l,z),r({K:x,St:!A,P:s?z:yn({},X,z)})}return{xt:D}}},{max:bx}=Math,Ba=bx.bind(0,0),s8="visible",C_="hidden",Hte=42,Ip={u:HM,o:{w:0,h:0}},Vte={u:VM,o:{x:C_,y:C_}},Wte=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Ba(e.w-t.w),h:Ba(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},Pp=e=>e.indexOf(s8)===0,Ute=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:l,nt:i,ut:c,_t:p,it:m,et:h}=e,{k:g,V:x,I:y,A:b}=Hr(),C=Jl()[Ty],S=!c&&!y&&(b.x||b.y),_=m&&c,[j,E]=Fo(Ip,ch.bind(0,l)),[I,M]=Fo(Ip,ih.bind(0,l)),[R,D]=Fo(Ip),[A,O]=Fo(Ip),[$]=Fo(Vte),X=(U,T)=>{if(dr(l,{height:""}),T){const{St:B,K:Y}=n(),{$t:re,D:le}=U,oe=ch(o),q=qp(o),K=dr(l,"boxSizing")==="content-box",ee=B||K?Y.b+Y.t:0,ce=!(b.x&&K);dr(l,{height:q.h+oe.h+(re.x&&ce?le.x:0)-ee})}},z=(U,T)=>{const B=!y&&!U?Hte:0,Y=(ie,de,xe)=>{const we=dr(l,ie),fe=(T?T[ie]:we)==="scroll";return[we,fe,fe&&!y?de?B:xe:0,de&&!!B]},[re,le,oe,q]=Y("overflowX",b.x,g.x),[K,ee,ce,J]=Y("overflowY",b.y,g.y);return{Ct:{x:re,y:K},$t:{x:le,y:ee},D:{x:oe,y:ce},M:{x:q,y:J}}},V=(U,T,B,Y)=>{const re=(ee,ce)=>{const J=Pp(ee),ie=ce&&J&&ee.replace(`${s8}-`,"")||"";return[ce&&!J?ee:"",Pp(ie)?"hidden":ie]},[le,oe]=re(B.x,T.x),[q,K]=re(B.y,T.y);return Y.overflowX=oe&&q?oe:le,Y.overflowY=K&&le?K:q,z(U,Y)},Q=(U,T,B,Y)=>{const{D:re,M:le}=U,{x:oe,y:q}=le,{x:K,y:ee}=re,{P:ce}=n(),J=T?"marginLeft":"marginRight",ie=T?"paddingLeft":"paddingRight",de=ce[J],xe=ce.marginBottom,we=ce[ie],ve=ce.paddingBottom;Y.width=`calc(100% + ${ee+-1*de}px)`,Y[J]=-ee+de,Y.marginBottom=-K+xe,B&&(Y[ie]=we+(q?ee:0),Y.paddingBottom=ve+(oe?K:0))},[G,F]=C?C.H(S,x,l,i,n,z,Q):[()=>S,()=>[mo]];return(U,T,B)=>{const{gt:Y,Ot:re,wt:le,xt:oe,vt:q,yt:K}=U,{ht:ee,bt:ce}=n(),[J,ie]=T("showNativeOverlaidScrollbars"),[de,xe]=T("overflow"),we=J&&b.x&&b.y,ve=!c&&!x&&(Y||le||re||ie||q),fe=Pp(de.x),Oe=Pp(de.y),je=fe||Oe;let $e=E(B),st=M(B),Ve=D(B),Ct=O(B),Ye;if(ie&&y&&p(JM,pte,!we),ve&&(Ye=z(we),X(Ye,ee)),Y||oe||le||K||ie){je&&p(gc,hc,!1);const[ke,ze]=F(we,ce,Ye),[Le,Ge]=$e=j(B),[pt,Pn]=st=I(B),At=qp(l);let Tt=pt,mr=At;ke(),(Pn||Ge||ie)&&ze&&!we&&G(ze,pt,Le,ce)&&(mr=qp(l),Tt=ih(l));const Nn={w:Ba(bx(pt.w,Tt.w)+Le.w),h:Ba(bx(pt.h,Tt.h)+Le.h)},Sn={w:Ba((_?h.innerWidth:mr.w+Ba(At.w-pt.w))+Le.w),h:Ba((_?h.innerHeight+Le.h:mr.h+Ba(At.h-pt.h))+Le.h)};Ct=A(Sn),Ve=R(Wte(Nn,Sn),B)}const[Ke,ge]=Ct,[De,ut]=Ve,[yt,ye]=st,[tt,ct]=$e,ft={x:De.w>0,y:De.h>0},Me=fe&&Oe&&(ft.x||ft.y)||fe&&ft.x&&!ft.y||Oe&&ft.y&&!ft.x;if(oe||K||ct||ye||ge||ut||xe||ie||ve){const ke={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},ze=V(we,ft,de,ke),Le=G(ze,yt,tt,ce);c||Q(ze,ce,Le,ke),ve&&X(ze,ee),c?(cr(o,YM,ke.overflowX),cr(o,ZM,ke.overflowY)):dr(l,ke)}Ll(o,Bo,hc,Me),Ll(s,vx,mte,Me),c||Ll(l,Fa,gc,je);const[Ne,Ut]=$(z(we).Ct);return r({Ct:Ne,zt:{x:Ke.w,y:Ke.h},Tt:{x:De.w,y:De.h},Et:ft}),{It:Ut,At:ge,Lt:ut}}},w_=(e,t,n)=>{const r={},o=t||{},s=no(e).concat(no(o));return Ft(s,l=>{const i=e[l],c=o[l];r[l]=!!(n||i||c)}),r},Gte=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:l,A:i,V:c}=Hr(),p=!l&&(i.x||i.y),m=[Fte(e,t),Bte(e,t),Ute(e,t)];return(h,g,x)=>{const y=w_(yn({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},g),{},x),b=p||!c,C=b&&qo(r),S=b&&ra(r);o("",uh,!0);let _=y;return Ft(m,j=>{_=w_(_,j(_,h,!!x)||{},x)}),qo(r,C),ra(r,S),o("",uh),s||(qo(n,0),ra(n,0)),_}},Kte=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},l=i=>{if(n){const c=n.reduce((p,m)=>{if(m){const[h,g]=m,x=g&&h&&(i?i(h):NM(h,e));x&&x.length&&g&&dl(g)&&Xt(p,[x,g.trim()],!0)}return p},[]);Ft(c,p=>Ft(p[0],m=>{const h=p[1],g=r.get(m)||[];if(e.contains(m)){const y=Vn(m,h,b=>{o?(y(),r.delete(m)):t(b)});r.set(m,Xt(g,y))}else Ts(g),r.delete(m)}))}};return n&&(r=new WeakMap,l()),[s,l]},S_=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:l,Dt:i,Mt:c,Rt:p,kt:m}=r||{},h=My(()=>{o&&n(!0)},{v:33,g:99}),[g,x]=Kte(e,h,i),y=s||[],b=l||[],C=y.concat(b),S=(j,E)=>{const I=p||mo,M=m||mo,R=new Set,D=new Set;let A=!1,O=!1;if(Ft(j,$=>{const{attributeName:X,target:z,type:V,oldValue:Q,addedNodes:G,removedNodes:F}=$,U=V==="attributes",T=V==="childList",B=e===z,Y=U&&dl(X)?cr(z,X):0,re=Y!==0&&Q!==Y,le=ky(b,X)>-1&&re;if(t&&(T||!B)){const oe=!U,q=U&&re,K=q&&c&&ah(z,c),ce=(K?!I(z,X,Q,Y):oe||q)&&!M($,!!K,e,r);Ft(G,J=>R.add(J)),Ft(F,J=>R.add(J)),O=O||ce}!t&&B&&re&&!I(z,X,Q,Y)&&(D.add(X),A=A||le)}),R.size>0&&x($=>Zl(R).reduce((X,z)=>(Xt(X,NM($,z)),ah(z,$)?Xt(X,z):X),[])),t)return!E&&O&&n(!1),[!1];if(D.size>0||A){const $=[Zl(D),A];return!E&&n.apply(0,$),$}},_=new nte(j=>S(j));return _.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:C,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(g(),_.disconnect(),o=!1)},()=>{if(o){h.m();const j=_.takeRecords();return!_y(j)&&S(j,!0)}}]},Ep=3333333,Mp=e=>e&&(e.height||e.width),a8=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Jl()[Ete],{B:l}=Hr(),c=LM(`<div class="${Dy}"><div class="${gte}"></div></div>`)[0],p=c.firstChild,m=dd.bind(0,e),[h]=Fo({o:void 0,_:!0,u:(b,C)=>!(!b||!Mp(b)&&Mp(C))}),g=b=>{const C=ns(b)&&b.length>0&&ud(b[0]),S=!C&&Sy(b[0]);let _=!1,j=!1,E=!0;if(C){const[I,,M]=h(b.pop().contentRect),R=Mp(I),D=Mp(M);_=!M||!R,j=!D&&R,E=!_}else S?[,E]=b:j=b===!0;if(r&&E){const I=S?b[0]:dd(c);qo(c,I?l.n?-Ep:l.i?0:Ep:Ep),ra(c,Ep)}_||t({gt:!S,Yt:S?b:void 0,Vt:!!j})},x=[];let y=o?g:!1;return[()=>{Ts(x),js(c)},()=>{if(tc){const b=new tc(g);b.observe(p),Xt(x,()=>{b.disconnect()})}else if(s){const[b,C]=s.O(p,g,o);y=b,Xt(x,C)}if(r){const[b]=Fo({o:void 0},m);Xt(x,Vn(c,"scroll",C=>{const S=b(),[_,j,E]=S;j&&(Ey(p,"ltr rtl"),_?oa(p,"rtl"):oa(p,"ltr"),g([!!_,j,E])),UM(C)}))}y&&(oa(c,hte),Xt(x,Vn(c,"animationstart",y,{C:!!tc}))),(tc||s)&&vo(e,c)}]},qte=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,Xte=(e,t)=>{let n;const r=zl(vte),o=[],[s]=Fo({o:!1}),l=(c,p)=>{if(c){const m=s(qte(c)),[,h]=m;if(h)return!p&&t(m),[m]}},i=(c,p)=>{if(c&&c.length>0)return l(c.pop(),p)};return[()=>{Ts(o),js(r)},()=>{if(s_)n=new s_(c=>i(c),{root:e}),n.observe(r),Xt(o,()=>{n.disconnect()});else{const c=()=>{const h=fd(r);l(h)},[p,m]=a8(r,c);Xt(o,p),m(),c()}vo(e,r)},()=>{if(n)return i(n.takeRecords(),!0)}]},k_=`[${Bo}]`,Qte=`[${Fa}]`,Uv=["tabindex"],__=["wrap","cols","rows"],Gv=["id","class","style","open"],Yte=(e,t,n)=>{let r,o,s;const{Z:l,J:i,tt:c,rt:p,ut:m,ft:h,_t:g}=e,{V:x}=Hr(),[y]=Fo({u:HM,o:{w:0,h:0}},()=>{const V=h(gc,hc),Q=h(Hv,""),G=Q&&qo(i),F=Q&&ra(i);g(gc,hc),g(Hv,""),g("",uh,!0);const U=ih(c),T=ih(i),B=ch(i);return g(gc,hc,V),g(Hv,"",Q),g("",uh),qo(i,G),ra(i,F),{w:T.w+U.w+B.w,h:T.h+U.h+B.h}}),b=p?__:Gv.concat(__),C=My(n,{v:()=>r,g:()=>o,p(V,Q){const[G]=V,[F]=Q;return[no(G).concat(no(F)).reduce((U,T)=>(U[T]=G[T]||F[T],U),{})]}}),S=V=>{Ft(V||Uv,Q=>{if(ky(Uv,Q)>-1){const G=cr(l,Q);dl(G)?cr(i,Q,G):Rr(i,Q)}})},_=(V,Q)=>{const[G,F]=V,U={vt:F};return t({ht:G}),!Q&&n(U),U},j=({gt:V,Yt:Q,Vt:G})=>{const F=!V||G?n:C;let U=!1;if(Q){const[T,B]=Q;U=B,t({bt:T})}F({gt:V,yt:U})},E=(V,Q)=>{const[,G]=y(),F={wt:G};return G&&!Q&&(V?n:C)(F),F},I=(V,Q,G)=>{const F={Ot:Q};return Q?!G&&C(F):m||S(V),F},[M,R,D]=c||!x?Xte(l,_):[mo,mo,mo],[A,O]=m?[mo,mo]:a8(l,j,{Vt:!0,Bt:!0}),[$,X]=S_(l,!1,I,{Pt:Gv,Ht:Gv.concat(Uv)}),z=m&&tc&&new tc(j.bind(0,{gt:!0}));return z&&z.observe(l),S(),[()=>{M(),A(),s&&s[0](),z&&z.disconnect(),$()},()=>{O(),R()},()=>{const V={},Q=X(),G=D(),F=s&&s[1]();return Q&&yn(V,I.apply(0,Xt(Q,!0))),G&&yn(V,_.apply(0,Xt(G,!0))),F&&yn(V,E.apply(0,Xt(F,!0))),V},V=>{const[Q]=V("update.ignoreMutation"),[G,F]=V("update.attributes"),[U,T]=V("update.elementEvents"),[B,Y]=V("update.debounce"),re=T||F,le=oe=>ts(Q)&&Q(oe);if(re&&(s&&(s[1](),s[0]()),s=S_(c||i,!0,E,{Ht:b.concat(G||[]),Dt:U,Mt:k_,kt:(oe,q)=>{const{target:K,attributeName:ee}=oe;return(!q&&ee&&!m?Qee(K,k_,Qte):!1)||!!ec(K,`.${Br}`)||!!le(oe)}})),Y)if(C.m(),ns(B)){const oe=B[0],q=B[1];r=Qa(oe)&&oe,o=Qa(q)&&q}else Qa(B)?(r=B,o=!1):(r=!1,o=!1)}]},j_={x:0,y:0},Zte=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:j_,Tt:j_,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:dd(e.Z)}),Jte=(e,t)=>{const n=xx(t,{}),[r,o,s]=Ry(),[l,i,c]=zte(e),p=o8(Zte(l)),[m,h]=p,g=Gte(l,p),x=(j,E,I)=>{const R=no(j).some(D=>j[D])||!jy(E)||I;return R&&s("u",[j,E,I]),R},[y,b,C,S]=Yte(l,h,j=>x(g(n,j),{},!1)),_=m.bind(0);return _.jt=j=>r("u",j),_.Nt=()=>{const{W:j,J:E}=l,I=qo(j),M=ra(j);b(),i(),qo(E,I),ra(E,M)},_.qt=l,[(j,E)=>{const I=xx(t,j,E);return S(I),x(g(I,C(),E),j,!!E)},_,()=>{o(),y(),c()}]},{round:I_}=Math,ene=e=>{const{width:t,height:n}=bs(e),{w:r,h:o}=fd(e);return{x:I_(t)/r||1,y:I_(n)/o||1}},tne=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:l}=e,{pointers:i}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(i||[]).includes(l)},nne=(e,t)=>Vn(e,"mousedown",Vn.bind(0,t,"click",UM,{C:!0,$:!0}),{$:!0}),P_="pointerup pointerleave pointercancel lostpointercapture",rne=(e,t,n,r,o,s,l)=>{const{B:i}=Hr(),{Ft:c,Gt:p,Xt:m}=r,h=`scroll${l?"Left":"Top"}`,g=`client${l?"X":"Y"}`,x=l?"width":"height",y=l?"left":"top",b=l?"w":"h",C=l?"x":"y",S=(_,j)=>E=>{const{Tt:I}=s(),M=fd(p)[b]-fd(c)[b],D=j*E/M*I[C],O=dd(m)&&l?i.n||i.i?1:-1:1;o[h]=_+D*O};return Vn(p,"pointerdown",_=>{const j=ec(_.target,`.${Ay}`)===c,E=j?c:p;if(Ll(t,Bo,f_,!0),tne(_,e,j)){const I=!j&&_.shiftKey,M=()=>bs(c),R=()=>bs(p),D=(T,B)=>(T||M())[y]-(B||R())[y],A=S(o[h]||0,1/ene(o)[C]),O=_[g],$=M(),X=R(),z=$[x],V=D($,X)+z/2,Q=O-X[y],G=j?0:Q-V,F=T=>{Ts(U),E.releasePointerCapture(T.pointerId)},U=[Ll.bind(0,t,Bo,f_),Vn(n,P_,F),Vn(n,"selectstart",T=>GM(T),{S:!1}),Vn(p,P_,F),Vn(p,"pointermove",T=>{const B=T[g]-O;(j||I)&&A(G+B)})];if(I)A(G);else if(!j){const T=Jl()[Mte];T&&Xt(U,T.O(A,D,G,z,Q))}E.setPointerCapture(_.pointerId)}})},one=(e,t)=>(n,r,o,s,l,i)=>{const{Xt:c}=n,[p,m]=qi(333),h=!!l.scrollBy;let g=!0;return Ts.bind(0,[Vn(c,"pointerenter",()=>{r(h_,!0)}),Vn(c,"pointerleave pointercancel",()=>{r(h_)}),Vn(c,"wheel",x=>{const{deltaX:y,deltaY:b,deltaMode:C}=x;h&&g&&C===0&&ca(c)===s&&l.scrollBy({left:y,top:b,behavior:"smooth"}),g=!1,r(x_,!0),p(()=>{g=!0,r(x_)}),GM(x)},{S:!1,$:!0}),nne(c,o),rne(e,s,o,n,l,t,i),m])},{min:yx,max:E_,abs:sne,round:ane}=Math,l8=(e,t,n,r)=>{if(r){const i=n?"x":"y",{Tt:c,zt:p}=r,m=p[i],h=c[i];return E_(0,yx(1,m/(m+h)))}const o=n?"width":"height",s=bs(e)[o],l=bs(t)[o];return E_(0,yx(1,s/l))},lne=(e,t,n,r,o,s)=>{const{B:l}=Hr(),i=s?"x":"y",c=s?"Left":"Top",{Tt:p}=r,m=ane(p[i]),h=sne(n[`scroll${c}`]),g=s&&o,x=l.i?h:m-h,b=yx(1,(g?x:h)/m),C=l8(e,t,s);return 1/C*(1-C)*b},ine=(e,t,n)=>{const{N:r,L:o}=Hr(),{scrollbars:s}=r(),{slot:l}=s,{ct:i,W:c,Z:p,J:m,lt:h,ot:g,it:x,ut:y}=t,{scrollbars:b}=h?{}:e,{slot:C}=b||{},S=n8([c,p,m],()=>y&&x?c:p,l,C),_=(G,F,U)=>{const T=U?oa:Ey;Ft(G,B=>{T(B.Xt,F)})},j=(G,F)=>{Ft(G,U=>{const[T,B]=F(U);dr(T,B)})},E=(G,F,U)=>{j(G,T=>{const{Ft:B,Gt:Y}=T;return[B,{[U?"width":"height"]:`${(100*l8(B,Y,U,F)).toFixed(3)}%`}]})},I=(G,F,U)=>{const T=U?"X":"Y";j(G,B=>{const{Ft:Y,Gt:re,Xt:le}=B,oe=lne(Y,re,g,F,dd(le),U);return[Y,{transform:oe===oe?`translate${T}(${(100*oe).toFixed(3)}%)`:""}]})},M=[],R=[],D=[],A=(G,F,U)=>{const T=Sy(U),B=T?U:!0,Y=T?!U:!0;B&&_(R,G,F),Y&&_(D,G,F)},O=G=>{E(R,G,!0),E(D,G)},$=G=>{I(R,G,!0),I(D,G)},X=G=>{const F=G?Cte:wte,U=G?R:D,T=_y(U)?m_:"",B=zl(`${Br} ${F} ${T}`),Y=zl(e8),re=zl(Ay),le={Xt:B,Gt:Y,Ft:re};return o||oa(B,xte),vo(B,Y),vo(Y,re),Xt(U,le),Xt(M,[js.bind(0,B),n(le,A,i,p,g,G)]),le},z=X.bind(0,!0),V=X.bind(0,!1),Q=()=>{vo(S,R[0].Xt),vo(S,D[0].Xt),lh(()=>{A(m_)},300)};return z(),V(),[{Ut:O,Wt:$,Zt:A,Jt:{Kt:R,Qt:z,tn:j.bind(0,R)},nn:{Kt:D,Qt:V,tn:j.bind(0,D)}},Q,Ts.bind(0,M)]},cne=(e,t,n,r)=>{let o,s,l,i,c,p=0;const m=o8({}),[h]=m,[g,x]=qi(),[y,b]=qi(),[C,S]=qi(100),[_,j]=qi(100),[E,I]=qi(()=>p),[M,R,D]=ine(e,n.qt,one(t,n)),{Z:A,J:O,ot:$,st:X,ut:z,it:V}=n.qt,{Jt:Q,nn:G,Zt:F,Ut:U,Wt:T}=M,{tn:B}=Q,{tn:Y}=G,re=ee=>{const{Xt:ce}=ee,J=z&&!V&&ca(ce)===O&&ce;return[J,{transform:J?`translate(${qo($)}px, ${ra($)}px)`:""}]},le=(ee,ce)=>{if(I(),ee)F(v_);else{const J=()=>F(v_,!0);p>0&&!ce?E(J):J()}},oe=()=>{i=s,i&&le(!0)},q=[S,I,j,b,x,D,Vn(A,"pointerover",oe,{C:!0}),Vn(A,"pointerenter",oe),Vn(A,"pointerleave",()=>{i=!1,s&&le(!1)}),Vn(A,"pointermove",()=>{o&&g(()=>{S(),le(!0),_(()=>{o&&le(!1)})})}),Vn(X,"scroll",ee=>{y(()=>{T(n()),l&&le(!0),C(()=>{l&&!i&&le(!1)})}),r(ee),z&&B(re),z&&Y(re)})],K=h.bind(0);return K.qt=M,K.Nt=R,[(ee,ce,J)=>{const{At:ie,Lt:de,It:xe,yt:we}=J,{A:ve}=Hr(),fe=xx(t,ee,ce),Oe=n(),{Tt:je,Ct:$e,bt:st}=Oe,[Ve,Ct]=fe("showNativeOverlaidScrollbars"),[Ye,Ke]=fe("scrollbars.theme"),[ge,De]=fe("scrollbars.visibility"),[ut,yt]=fe("scrollbars.autoHide"),[ye]=fe("scrollbars.autoHideDelay"),[tt,ct]=fe("scrollbars.dragScroll"),[ft,Me]=fe("scrollbars.clickScroll"),Ne=ie||de||we,Ut=xe||De,ke=Ve&&ve.x&&ve.y,ze=(Le,Ge)=>{const pt=ge==="visible"||ge==="auto"&&Le==="scroll";return F(Ste,pt,Ge),pt};if(p=ye,Ct&&F(bte,ke),Ke&&(F(c),F(Ye,!0),c=Ye),yt&&(o=ut==="move",s=ut==="leave",l=ut!=="never",le(!l,!0)),ct&&F(jte,tt),Me&&F(_te,ft),Ut){const Le=ze($e.x,!0),Ge=ze($e.y,!1);F(kte,!(Le&&Ge))}Ne&&(U(Oe),T(Oe),F(g_,!je.x,!0),F(g_,!je.y,!1),F(yte,st&&!V))},K,Ts.bind(0,q)]},i8=(e,t,n)=>{ts(e)&&e(t||void 0,n||void 0)},Ua=(e,t,n)=>{const{F:r,N:o,Y:s,j:l}=Hr(),i=Jl(),c=sh(e),p=c?e:e.target,m=r8(p);if(t&&!m){let h=!1;const g=z=>{const V=Jl()[Pte],Q=V&&V.O;return Q?Q(z,!0):z},x=yn({},r(),g(t)),[y,b,C]=Ry(n),[S,_,j]=Jte(e,x),[E,I,M]=cne(e,x,_,z=>C("scroll",[X,z])),R=(z,V)=>S(z,!!V),D=R.bind(0,{},!0),A=s(D),O=l(D),$=z=>{Lte(p),A(),O(),M(),j(),h=!0,C("destroyed",[X,!!z]),b()},X={options(z,V){if(z){const Q=V?r():{},G=KM(x,yn(Q,g(z)));jy(G)||(yn(x,G),R(G))}return yn({},x)},on:y,off:(z,V)=>{z&&V&&b(z,V)},state(){const{zt:z,Tt:V,Ct:Q,Et:G,K:F,St:U,bt:T}=_();return yn({},{overflowEdge:z,overflowAmount:V,overflowStyle:Q,hasOverflow:G,padding:F,paddingAbsolute:U,directionRTL:T,destroyed:h})},elements(){const{W:z,Z:V,K:Q,J:G,tt:F,ot:U,st:T}=_.qt,{Jt:B,nn:Y}=I.qt,re=oe=>{const{Ft:q,Gt:K,Xt:ee}=oe;return{scrollbar:ee,track:K,handle:q}},le=oe=>{const{Kt:q,Qt:K}=oe,ee=re(q[0]);return yn({},ee,{clone:()=>{const ce=re(K());return E({},!0,{}),ce}})};return yn({},{target:z,host:V,padding:Q||G,viewport:G,content:F||G,scrollOffsetElement:U,scrollEventElement:T,scrollbarHorizontal:le(B),scrollbarVertical:le(Y)})},update:z=>R({},z),destroy:$.bind(0)};return _.jt((z,V,Q)=>{E(V,Q,z)}),Nte(p,X),Ft(no(i),z=>i8(i[z],0,X)),$te(_.qt.it,o().cancel,!c&&e.cancel)?($(!0),X):(_.Nt(),I.Nt(),C("initialized",[X]),_.jt((z,V,Q)=>{const{gt:G,yt:F,vt:U,At:T,Lt:B,It:Y,wt:re,Ot:le}=z;C("updated",[X,{updateHints:{sizeChanged:G,directionChanged:F,heightIntrinsicChanged:U,overflowEdgeChanged:T,overflowAmountChanged:B,overflowStyleChanged:Y,contentMutation:re,hostMutation:le},changedOptions:V,force:Q}])}),X.update(!0),X)}return m};Ua.plugin=e=>{Ft(Ite(e),t=>i8(t,Ua))};Ua.valid=e=>{const t=e&&e.elements,n=ts(t)&&t();return px(n)&&!!r8(n.target)};Ua.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:l,U:i,N:c,q:p,F:m,G:h}=Hr();return yn({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:l,staticDefaultOptions:i,getDefaultInitialization:c,setDefaultInitialization:p,getDefaultOptions:m,setDefaultOptions:h})};const une=()=>{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,l=r?n.requestIdleCallback:o,i=r?n.cancelIdleCallback:s,c=()=>{i(e),s(t)};return[(p,m)=>{c(),e=l(r?()=>{c(),t=o(p)}:p,typeof m=="object"?m:{timeout:2233})},c]},Ly=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=d.useMemo(une,[]),l=d.useRef(null),i=d.useRef(r),c=d.useRef(t),p=d.useRef(n);return d.useEffect(()=>{i.current=r},[r]),d.useEffect(()=>{const{current:m}=l;c.current=t,Ua.valid(m)&&m.options(t||{},!0)},[t]),d.useEffect(()=>{const{current:m}=l;p.current=n,Ua.valid(m)&&m.on(n||{},!0)},[n]),d.useEffect(()=>()=>{var m;s(),(m=l.current)==null||m.destroy()},[]),d.useMemo(()=>[m=>{const h=l.current;if(Ua.valid(h))return;const g=i.current,x=c.current||{},y=p.current||{},b=()=>l.current=Ua(m,x,y);g?o(b,g):b()},()=>l.current],[])},dne=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:l,...i}=e,c=n,p=d.useRef(null),m=d.useRef(null),[h,g]=Ly({options:r,events:o,defer:s});return d.useEffect(()=>{const{current:x}=p,{current:y}=m;return x&&y&&h({target:x,elements:{viewport:y,content:y}}),()=>{var b;return(b=g())==null?void 0:b.destroy()}},[h,n]),d.useImperativeHandle(t,()=>({osInstance:g,getElement:()=>p.current}),[]),H.createElement(c,{"data-overlayscrollbars-initialize":"",ref:p,...i},H.createElement("div",{ref:m},l))},yg=d.forwardRef(dne),fne=e=>{const{boardToDelete:t,setBoardToDelete:n}=e,{t:r}=Z(),o=W(_=>_.config.canRestoreDeletedImagesFromBin),{currentData:s,isFetching:l}=MD((t==null?void 0:t.board_id)??eo.skipToken),i=d.useMemo(()=>ae([he],_=>{const j=(s??[]).map(I=>iI(_,I));return{imageUsageSummary:{isInitialImage:Vo(j,I=>I.isInitialImage),isCanvasImage:Vo(j,I=>I.isCanvasImage),isNodesImage:Vo(j,I=>I.isNodesImage),isControlImage:Vo(j,I=>I.isControlImage)}}}),[s]),[c,{isLoading:p}]=OD(),[m,{isLoading:h}]=RD(),{imageUsageSummary:g}=W(i),x=d.useCallback(()=>{t&&(c(t.board_id),n(void 0))},[t,c,n]),y=d.useCallback(()=>{t&&(m(t.board_id),n(void 0))},[t,m,n]),b=d.useCallback(()=>{n(void 0)},[n]),C=d.useRef(null),S=d.useMemo(()=>h||p||l,[h,p,l]);return t?a.jsx(zd,{isOpen:!!t,onClose:b,leastDestructiveRef:C,isCentered:!0,children:a.jsx(Zo,{children:a.jsxs(Fd,{children:[a.jsxs(Yo,{fontSize:"lg",fontWeight:"bold",children:["Delete ",t.board_name]}),a.jsx(Jo,{children:a.jsxs(N,{direction:"column",gap:3,children:[l?a.jsx(Yh,{children:a.jsx(N,{sx:{w:"full",h:32}})}):a.jsx(fM,{imageUsage:g,topMessage:r("boards.topMessage"),bottomMessage:r("boards.bottomMessage")}),a.jsx(be,{children:"Deleted boards cannot be restored."}),a.jsx(be,{children:r(o?"gallery.deleteImageBin":"gallery.deleteImagePermanent")})]})}),a.jsx(ks,{children:a.jsxs(N,{sx:{justifyContent:"space-between",width:"full",gap:2},children:[a.jsx(ot,{ref:C,onClick:b,children:"Cancel"}),a.jsx(ot,{colorScheme:"warning",isLoading:S,onClick:x,children:"Delete Board Only"}),a.jsx(ot,{colorScheme:"error",isLoading:S,onClick:y,children:"Delete Board and Images"})]})})]})})}):null},pne=d.memo(fne),mne=()=>{const{t:e}=Z(),[t,{isLoading:n}]=DD(),r=e("boards.myBoard"),o=d.useCallback(()=>{t(r)},[t,r]);return a.jsx(Be,{icon:a.jsx(Xa,{}),isLoading:n,tooltip:e("boards.addBoard"),"aria-label":e("boards.addBoard"),onClick:o,size:"sm","data-testid":"add-board-button"})},hne=d.memo(mne);var c8=Ph({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"})]})}),Cg=Ph({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),gne=Ph({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"}),vne=Ph({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"})})});const xne=ae([he],({gallery:e})=>{const{boardSearchText:t}=e;return{boardSearchText:t}},Ce),bne=()=>{const e=te(),{boardSearchText:t}=W(xne),n=d.useRef(null),{t:r}=Z(),o=d.useCallback(c=>{e(fw(c))},[e]),s=d.useCallback(()=>{e(fw(""))},[e]),l=d.useCallback(c=>{c.key==="Escape"&&s()},[s]),i=d.useCallback(c=>{o(c.target.value)},[o]);return d.useEffect(()=>{n.current&&n.current.focus()},[]),a.jsxs(h3,{children:[a.jsx($h,{ref:n,placeholder:r("boards.searchBoard"),value:t,onKeyDown:l,onChange:i,"data-testid":"board-search-input"}),t&&t.length&&a.jsx(Lb,{children:a.jsx(Cs,{onClick:s,size:"xs",variant:"ghost","aria-label":r("boards.clearSearch"),opacity:.5,icon:a.jsx(gne,{boxSize:2})})})]})},yne=d.memo(bne);function u8(e){return AD(e)}function Cne(e){return TD(e)}const d8=(e,t)=>{var o,s;if(!e||!(t!=null&&t.data.current))return!1;const{actionType:n}=e,{payloadType:r}=t.data.current;if(e.id===t.data.current.id)return!1;switch(n){case"ADD_FIELD_TO_LINEAR":return r==="NODE_FIELD";case"SET_CURRENT_IMAGE":return r==="IMAGE_DTO";case"SET_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_CONTROL_ADAPTER_IMAGE":return r==="IMAGE_DTO";case"SET_CANVAS_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_NODES_IMAGE":return r==="IMAGE_DTO";case"SET_MULTI_NODES_IMAGE":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BATCH":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:i}=t.data.current.payload,c=i.board_id??"none",p=e.context.boardId;return c!==p}if(r==="IMAGE_DTOS"){const{imageDTOs:i}=t.data.current.payload,c=((o=i[0])==null?void 0:o.board_id)??"none",p=e.context.boardId;return c!==p}return!1}case"REMOVE_FROM_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:i}=t.data.current.payload;return(i.board_id??"none")!=="none"}if(r==="IMAGE_DTOS"){const{imageDTOs:i}=t.data.current.payload;return(((s=i[0])==null?void 0:s.board_id)??"none")!=="none"}return!1}default:return!1}},wne=e=>{const{isOver:t,label:n="Drop"}=e,r=d.useRef(Js()),{colorMode:o}=ha();return a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsxs(N,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[a.jsx(N,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:Ae("base.700","base.900")(o),opacity:.7,borderRadius:"base",alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(N,{sx:{position:"absolute",top:.5,insetInlineStart:.5,insetInlineEnd:.5,bottom:.5,opacity:1,borderWidth:2,borderColor:t?Ae("base.50","base.50")(o):Ae("base.200","base.300")(o),borderRadius:"lg",borderStyle:"dashed",transitionProperty:"common",transitionDuration:"0.1s",alignItems:"center",justifyContent:"center"},children:a.jsx(Ie,{sx:{fontSize:"2xl",fontWeight:600,transform:t?"scale(1.1)":"scale(1)",color:t?Ae("base.50","base.50")(o):Ae("base.200","base.300")(o),transitionProperty:"common",transitionDuration:"0.1s"},children:n})})]})},r.current)},f8=d.memo(wne),Sne=e=>{const{dropLabel:t,data:n,disabled:r}=e,o=d.useRef(Js()),{isOver:s,setNodeRef:l,active:i}=u8({id:o.current,disabled:r,data:n});return a.jsx(Ie,{ref:l,position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",pointerEvents:i?"auto":"none",children:a.jsx(fr,{children:d8(n,i)&&a.jsx(f8,{isOver:s,label:t})})})},zy=d.memo(Sne),kne=({isSelected:e,isHovered:t})=>a.jsx(Ie,{className:"selection-box",sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",opacity:e?1:.7,transitionProperty:"common",transitionDuration:"0.1s",pointerEvents:"none",shadow:e?t?"hoverSelected.light":"selected.light":t?"hoverUnselected.light":void 0,_dark:{shadow:e?t?"hoverSelected.dark":"selected.dark":t?"hoverUnselected.dark":void 0}}}),Fy=d.memo(kne),_ne=()=>{const{t:e}=Z();return a.jsx(N,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(As,{variant:"solid",sx:{bg:"accent.400",_dark:{bg:"accent.500"}},children:e("common.auto")})})},p8=d.memo(_ne);function By(e){const[t,n]=d.useState(!1),[r,o]=d.useState(!1),[s,l]=d.useState(!1),[i,c]=d.useState([0,0]),p=d.useRef(null),m=W(g=>g.ui.globalContextMenuCloseTrigger);d.useEffect(()=>{if(t)setTimeout(()=>{o(!0),setTimeout(()=>{l(!0)})});else{l(!1);const g=setTimeout(()=>{o(t)},1e3);return()=>clearTimeout(g)}},[t]),d.useEffect(()=>{n(!1),l(!1),o(!1)},[m]),_F("contextmenu",g=>{var x;(x=p.current)!=null&&x.contains(g.target)||g.target===p.current?(g.preventDefault(),n(!0),c([g.pageX,g.pageY])):n(!1)});const h=d.useCallback(()=>{var g,x;(x=(g=e.menuProps)==null?void 0:g.onClose)==null||x.call(g),n(!1)},[e.menuProps]);return a.jsxs(a.Fragment,{children:[e.children(p),r&&a.jsx($c,{...e.portalProps,children:a.jsxs(zh,{isOpen:s,gutter:0,...e.menuProps,onClose:h,children:[a.jsx(Fh,{"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:i[0],top:i[1],cursor:"default"},...e.menuButtonProps}),e.renderMenu()]})})]})}const wg=e=>{const{boardName:t}=kd(void 0,{selectFromResult:({data:n})=>{const r=n==null?void 0:n.find(s=>s.board_id===e);return{boardName:(r==null?void 0:r.board_name)||mI("boards.uncategorized")}}});return t},jne=({board:e,setBoardToDelete:t})=>{const n=d.useCallback(()=>{t&&t(e)},[e,t]);return a.jsxs(a.Fragment,{children:[e.image_count>0&&a.jsx(a.Fragment,{}),a.jsx(Kt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Fr,{}),onClick:n,children:"Delete Board"})]})},Ine=d.memo(jne),Pne=()=>a.jsx(a.Fragment,{}),Ene=d.memo(Pne),Mne=({board:e,board_id:t,setBoardToDelete:n,children:r})=>{const{t:o}=Z(),s=te(),l=d.useMemo(()=>ae(he,({gallery:b})=>{const C=b.autoAddBoardId===t,S=b.autoAssignBoardOnClick;return{isAutoAdd:C,autoAssignBoardOnClick:S}},Ce),[t]),{isAutoAdd:i,autoAssignBoardOnClick:c}=W(l),p=wg(t),m=Dt("bulkDownload").isFeatureEnabled,[h]=hI(),g=d.useCallback(()=>{s(wh(t))},[t,s]),x=d.useCallback(async()=>{try{const b=await h({image_names:[],board_id:t}).unwrap();s(lt({title:o("gallery.preparingDownload"),status:"success",...b.response?{description:b.response}:{}}))}catch{s(lt({title:o("gallery.preparingDownloadFailed"),status:"error"}))}},[o,t,h,s]),y=d.useCallback(b=>{b.preventDefault()},[]);return a.jsx(By,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>a.jsx(Gl,{sx:{visibility:"visible !important"},motionProps:bc,onContextMenu:y,children:a.jsxs(ad,{title:p,children:[a.jsx(Kt,{icon:a.jsx(Xa,{}),isDisabled:i||c,onClick:g,children:o("boards.menuItemAutoAdd")}),m&&a.jsx(Kt,{icon:a.jsx(Gc,{}),onClickCapture:x,children:o("boards.downloadBoard")}),!e&&a.jsx(Ene,{}),e&&a.jsx(Ine,{board:e,setBoardToDelete:n})]})}),children:r})},m8=d.memo(Mne),One=({board:e,isSelected:t,setBoardToDelete:n})=>{const r=te(),o=d.useMemo(()=>ae(he,({gallery:A})=>{const O=e.board_id===A.autoAddBoardId,$=A.autoAssignBoardOnClick;return{isSelectedForAutoAdd:O,autoAssignBoardOnClick:$}},Ce),[e.board_id]),{isSelectedForAutoAdd:s,autoAssignBoardOnClick:l}=W(o),[i,c]=d.useState(!1),p=d.useCallback(()=>{c(!0)},[]),m=d.useCallback(()=>{c(!1)},[]),{data:h}=Xx(e.board_id),{data:g}=Qx(e.board_id),x=d.useMemo(()=>{if(!((h==null?void 0:h.total)===void 0||(g==null?void 0:g.total)===void 0))return`${h.total} image${h.total===1?"":"s"}, ${g.total} asset${g.total===1?"":"s"}`},[g,h]),{currentData:y}=wo(e.cover_image_name??eo.skipToken),{board_name:b,board_id:C}=e,[S,_]=d.useState(b),j=d.useCallback(()=>{r(gI({boardId:C})),l&&r(wh(C))},[C,l,r]),[E,{isLoading:I}]=$D(),M=d.useMemo(()=>({id:C,actionType:"ADD_TO_BOARD",context:{boardId:C}}),[C]),R=d.useCallback(async A=>{if(!A.trim()){_(b);return}if(A!==b)try{const{board_name:O}=await E({board_id:C,changes:{board_name:A}}).unwrap();_(O)}catch{_(b)}},[C,b,E]),D=d.useCallback(A=>{_(A)},[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx(N,{onMouseOver:p,onMouseOut:m,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",w:"full",h:"full"},children:a.jsx(m8,{board:e,board_id:C,setBoardToDelete:n,children:A=>a.jsx(Vt,{label:x,openDelay:1e3,hasArrow:!0,children:a.jsxs(N,{ref:A,onClick:j,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[y!=null&&y.thumbnail_url?a.jsx(ga,{src:y==null?void 0:y.thumbnail_url,draggable:!1,sx:{objectFit:"cover",w:"full",h:"full",maxH:"full",borderRadius:"base",borderBottomRadius:"lg"}}):a.jsx(N,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(Tn,{boxSize:12,as:bee,sx:{mt:-6,opacity:.7,color:"base.500",_dark:{color:"base.500"}}})}),s&&a.jsx(p8,{}),a.jsx(Fy,{isSelected:t,isHovered:i}),a.jsx(N,{sx:{position:"absolute",bottom:0,left:0,p:1,justifyContent:"center",alignItems:"center",w:"full",maxW:"full",borderBottomRadius:"base",bg:t?"accent.400":"base.500",color:t?"base.50":"base.100",_dark:{bg:t?"accent.500":"base.600",color:t?"base.50":"base.100"},lineHeight:"short",fontSize:"xs"},children:a.jsxs(Dh,{value:S,isDisabled:I,submitOnBlur:!0,onChange:D,onSubmit:R,sx:{w:"full"},children:[a.jsx(Rh,{sx:{p:0,fontWeight:t?700:500,textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},noOfLines:1}),a.jsx(Oh,{sx:{p:0,_focusVisible:{p:0,textAlign:"center",boxShadow:"none"}}})]})}),a.jsx(zy,{data:M,dropLabel:a.jsx(be,{fontSize:"md",children:"Move"})})]})})})})})},Rne=d.memo(One),Dne=ae(he,({gallery:e})=>{const{autoAddBoardId:t,autoAssignBoardOnClick:n}=e;return{autoAddBoardId:t,autoAssignBoardOnClick:n}},Ce),h8=d.memo(({isSelected:e})=>{const t=te(),{autoAddBoardId:n,autoAssignBoardOnClick:r}=W(Dne),o=wg("none"),s=d.useCallback(()=>{t(gI({boardId:"none"})),r&&t(wh("none"))},[t,r]),[l,i]=d.useState(!1),{data:c}=Xx("none"),{data:p}=Qx("none"),m=d.useMemo(()=>{if(!((c==null?void 0:c.total)===void 0||(p==null?void 0:p.total)===void 0))return`${c.total} image${c.total===1?"":"s"}, ${p.total} asset${p.total===1?"":"s"}`},[p,c]),h=d.useCallback(()=>{i(!0)},[]),g=d.useCallback(()=>{i(!1)},[]),x=d.useMemo(()=>({id:"no_board",actionType:"REMOVE_FROM_BOARD"}),[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx(N,{onMouseOver:h,onMouseOut:g,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"base",w:"full",h:"full"},children:a.jsx(m8,{board_id:"none",children:y=>a.jsx(Vt,{label:m,openDelay:1e3,hasArrow:!0,children:a.jsxs(N,{ref:y,onClick:s,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(N,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(ga,{src:qx,alt:"invoke-ai-logo",sx:{opacity:.4,filter:"grayscale(1)",mt:-6,w:16,h:16,minW:16,minH:16,userSelect:"none"}})}),n==="none"&&a.jsx(p8,{}),a.jsx(N,{sx:{position:"absolute",bottom:0,left:0,p:1,justifyContent:"center",alignItems:"center",w:"full",maxW:"full",borderBottomRadius:"base",bg:e?"accent.400":"base.500",color:e?"base.50":"base.100",_dark:{bg:e?"accent.500":"base.600",color:e?"base.50":"base.100"},lineHeight:"short",fontSize:"xs",fontWeight:e?700:500},children:o}),a.jsx(Fy,{isSelected:e,isHovered:l}),a.jsx(zy,{data:x,dropLabel:a.jsx(be,{fontSize:"md",children:"Move"})})]})})})})})});h8.displayName="HoverableBoard";const Ane=d.memo(h8),Tne=ae([he],({gallery:e})=>{const{selectedBoardId:t,boardSearchText:n}=e;return{selectedBoardId:t,boardSearchText:n}},Ce),$ne=e=>{const{isOpen:t}=e,{selectedBoardId:n,boardSearchText:r}=W(Tne),{data:o}=kd(),s=r?o==null?void 0:o.filter(c=>c.board_name.toLowerCase().includes(r.toLowerCase())):o,[l,i]=d.useState();return a.jsxs(a.Fragment,{children:[a.jsx(Od,{in:t,animateOpacity:!0,children:a.jsxs(N,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[a.jsxs(N,{sx:{gap:2,alignItems:"center"},children:[a.jsx(yne,{}),a.jsx(hne,{})]}),a.jsx(yg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsxs(el,{className:"list-container","data-testid":"boards-list",sx:{gridTemplateColumns:"repeat(auto-fill, minmax(108px, 1fr));",maxH:346},children:[a.jsx(rd,{sx:{p:1.5},"data-testid":"no-board",children:a.jsx(Ane,{isSelected:n==="none"})}),s&&s.map((c,p)=>a.jsx(rd,{sx:{p:1.5},"data-testid":`board-${p}`,children:a.jsx(Rne,{board:c,isSelected:n===c.board_id,setBoardToDelete:i})},c.board_id))]})})]})}),a.jsx(pne,{boardToDelete:l,setBoardToDelete:i})]})},Nne=d.memo($ne),Lne=ae([he],e=>{const{selectedBoardId:t}=e.gallery;return{selectedBoardId:t}},Ce),zne=e=>{const{isOpen:t,onToggle:n}=e,{selectedBoardId:r}=W(Lne),o=wg(r),s=d.useMemo(()=>o.length>20?`${o.substring(0,20)}...`:o,[o]);return a.jsxs(N,{as:Ja,onClick:n,size:"sm",sx:{position:"relative",gap:2,w:"full",justifyContent:"space-between",alignItems:"center",px:2},children:[a.jsx(be,{noOfLines:1,sx:{fontWeight:600,w:"100%",textAlign:"center",color:"base.800",_dark:{color:"base.200"}},children:s}),a.jsx(Cg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]})},Fne=d.memo(zne),Bne=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return a.jsxs(Hd,{isLazy:o,...s,children:[a.jsx(Xh,{children:t}),a.jsxs(Vd,{shadow:"dark-lg",children:[r&&a.jsx(X3,{}),n]})]})},Yd=d.memo(Bne);function Hne(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z"}},{tag:"path",attr:{d:"M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"}}]})(e)}const g8=_e((e,t)=>{const[n,r]=d.useState(!1),{label:o,value:s,min:l=1,max:i=100,step:c=1,onChange:p,tooltipSuffix:m="",withSliderMarks:h=!1,withInput:g=!1,isInteger:x=!1,inputWidth:y=16,withReset:b=!1,hideTooltip:C=!1,isCompact:S=!1,isDisabled:_=!1,sliderMarks:j,handleReset:E,sliderFormControlProps:I,sliderFormLabelProps:M,sliderMarkProps:R,sliderTrackProps:D,sliderThumbProps:A,sliderNumberInputProps:O,sliderNumberInputFieldProps:$,sliderNumberInputStepperProps:X,sliderTooltipProps:z,sliderIAIIconButtonProps:V,...Q}=e,G=te(),{t:F}=Z(),[U,T]=d.useState(String(s));d.useEffect(()=>{T(s)},[s]);const B=d.useMemo(()=>O!=null&&O.min?O.min:l,[l,O==null?void 0:O.min]),Y=d.useMemo(()=>O!=null&&O.max?O.max:i,[i,O==null?void 0:O.max]),re=d.useCallback(J=>{p(J)},[p]),le=d.useCallback(J=>{J.target.value===""&&(J.target.value=String(B));const ie=Bl(x?Math.floor(Number(J.target.value)):Number(U),B,Y),de=Tu(ie,c);p(de),T(de)},[x,U,B,Y,p,c]),oe=d.useCallback(J=>{T(J)},[]),q=d.useCallback(()=>{E&&E()},[E]),K=d.useCallback(J=>{J.target instanceof HTMLDivElement&&J.target.focus()},[]),ee=d.useCallback(J=>{J.shiftKey&&G(Nr(!0))},[G]),ce=d.useCallback(J=>{J.shiftKey||G(Nr(!1))},[G]);return a.jsxs(Zt,{ref:t,onClick:K,sx:S?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},isDisabled:_,...I,children:[o&&a.jsx(In,{sx:g?{mb:-1.5}:{},...M,children:o}),a.jsxs(Bb,{w:"100%",gap:2,alignItems:"center",children:[a.jsxs(Jb,{"aria-label":o,value:s,min:l,max:i,step:c,onChange:re,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),focusThumbOnChange:!1,isDisabled:_,...Q,children:[h&&!j&&a.jsxs(a.Fragment,{children:[a.jsx(Gi,{value:l,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...R,children:l}),a.jsx(Gi,{value:i,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...R,children:i})]}),h&&j&&a.jsx(a.Fragment,{children:j.map((J,ie)=>ie===0?a.jsx(Gi,{value:J,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...R,children:J},J):ie===j.length-1?a.jsx(Gi,{value:J,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...R,children:J},J):a.jsx(Gi,{value:J,sx:{transform:"translateX(-50%)"},...R,children:J},J))}),a.jsx(ty,{...D,children:a.jsx(ny,{})}),a.jsx(Vt,{hasArrow:!0,placement:"top",isOpen:n,label:`${s}${m}`,hidden:C,...z,children:a.jsx(ey,{...A,zIndex:0})})]}),g&&a.jsxs(Vh,{min:B,max:Y,step:c,value:U,onChange:oe,onBlur:le,focusInputOnChange:!1,...O,children:[a.jsx(Uh,{onKeyDown:ee,onKeyUp:ce,minWidth:y,...$}),a.jsxs(Wh,{...X,children:[a.jsx(Kh,{onClick:()=>p(Number(U))}),a.jsx(Gh,{onClick:()=>p(Number(U))})]})]}),b&&a.jsx(Be,{size:"sm","aria-label":F("accessibility.reset"),tooltip:F("accessibility.reset"),icon:a.jsx(Hne,{}),isDisabled:_,onClick:q,...V})]})]})});g8.displayName="IAISlider";const Je=d.memo(g8),v8=d.forwardRef(({label:e,tooltip:t,description:n,disabled:r,...o},s)=>a.jsx(Vt,{label:t,placement:"top",hasArrow:!0,openDelay:500,children:a.jsx(Ie,{ref:s,...o,children:a.jsxs(Ie,{children:[a.jsx(kc,{children:e}),n&&a.jsx(kc,{size:"xs",color:"base.600",children:n})]})})}));v8.displayName="IAIMantineSelectItemWithTooltip";const fl=d.memo(v8),Vne=ae([he],({gallery:e})=>{const{autoAddBoardId:t,autoAssignBoardOnClick:n}=e;return{autoAddBoardId:t,autoAssignBoardOnClick:n}},Ce),Wne=()=>{const e=te(),{t}=Z(),{autoAddBoardId:n,autoAssignBoardOnClick:r}=W(Vne),o=d.useRef(null),{boards:s,hasBoards:l}=kd(void 0,{selectFromResult:({data:c})=>{const p=[{label:"None",value:"none"}];return c==null||c.forEach(({board_id:m,board_name:h})=>{p.push({label:h,value:m})}),{boards:p,hasBoards:p.length>1}}}),i=d.useCallback(c=>{c&&e(wh(c))},[e]);return a.jsx(nn,{label:t("boards.autoAddBoard"),inputRef:o,autoFocus:!0,placeholder:t("boards.selectBoard"),value:n,data:s,nothingFound:t("boards.noMatching"),itemComponent:fl,disabled:!l||r,filter:(c,p)=>{var m;return((m=p.label)==null?void 0:m.toLowerCase().includes(c.toLowerCase().trim()))||p.value.toLowerCase().includes(c.toLowerCase().trim())},onChange:i})},Une=d.memo(Wne),Gne=e=>{const{label:t,...n}=e,{colorMode:r}=ha();return a.jsx(Ad,{colorScheme:"accent",...n,children:a.jsx(be,{sx:{fontSize:"sm",color:Ae("base.800","base.200")(r)},children:t})})},br=d.memo(Gne),Kne=ae([he],e=>{const{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}=e.gallery;return{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}},Ce),qne=()=>{const e=te(),{t}=Z(),{galleryImageMinimumWidth:n,shouldAutoSwitch:r,autoAssignBoardOnClick:o}=W(Kne),s=d.useCallback(c=>{e(pw(c))},[e]),l=d.useCallback(()=>{e(pw(64))},[e]),i=d.useCallback(c=>{e(ND(c.target.checked))},[e]);return a.jsx(Yd,{triggerComponent:a.jsx(Be,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:a.jsx(MM,{})}),children:a.jsxs(N,{direction:"column",gap:2,children:[a.jsx(Je,{value:n,onChange:s,min:45,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:l}),a.jsx(Cn,{label:t("gallery.autoSwitchNewImages"),isChecked:r,onChange:i}),a.jsx(br,{label:t("gallery.autoAssignBoardOnClick"),isChecked:o,onChange:c=>e(LD(c.target.checked))}),a.jsx(Une,{})]})})},Xne=d.memo(qne),Qne=e=>e.image?a.jsx(Yh,{sx:{w:`${e.image.width}px`,h:"auto",objectFit:"contain",aspectRatio:`${e.image.width}/${e.image.height}`}}):a.jsx(N,{sx:{opacity:.7,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(fa,{size:"xl"})}),Yn=e=>{const{icon:t=Yl,boxSize:n=16,sx:r,...o}=e;return a.jsxs(N,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",flexDir:"column",gap:2,userSelect:"none",opacity:.7,color:"base.700",_dark:{color:"base.500"},...r},...o,children:[t&&a.jsx(Tn,{as:t,boxSize:n,opacity:.7}),e.label&&a.jsx(be,{textAlign:"center",children:e.label})]})},Yne=e=>{const{sx:t,...n}=e;return a.jsxs(N,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",flexDir:"column",gap:2,userSelect:"none",opacity:.7,color:"base.700",_dark:{color:"base.500"},...t},...n,children:[a.jsx(fa,{size:"xl"}),e.label&&a.jsx(be,{textAlign:"center",children:e.label})]})},Sg=0,pl=1,Kc=2,x8=4;function b8(e,t){return n=>e(t(n))}function Zne(e,t){return t(e)}function y8(e,t){return n=>e(t,n)}function M_(e,t){return()=>e(t)}function kg(e,t){return t(e),e}function mn(...e){return e}function Jne(e){e()}function O_(e){return()=>e}function ere(...e){return()=>{e.map(Jne)}}function Hy(e){return e!==void 0}function qc(){}function Yt(e,t){return e(pl,t)}function St(e,t){e(Sg,t)}function Vy(e){e(Kc)}function xo(e){return e(x8)}function at(e,t){return Yt(e,y8(t,Sg))}function ua(e,t){const n=e(pl,r=>{n(),t(r)});return n}function $t(){const e=[];return(t,n)=>{switch(t){case Kc:e.splice(0,e.length);return;case pl:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case Sg:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function He(e){let t=e;const n=$t();return(r,o)=>{switch(r){case pl:o(t);break;case Sg:t=o;break;case x8:return t}return n(r,o)}}function tre(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case pl:return s?n===s?void 0:(r(),n=s,t=Yt(e,s),t):(r(),qc);case Kc:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Zr(e){return kg($t(),t=>at(e,t))}function Cr(e,t){return kg(He(t),n=>at(e,n))}function nre(...e){return t=>e.reduceRight(Zne,t)}function Pe(e,...t){const n=nre(...t);return(r,o)=>{switch(r){case pl:return Yt(e,n(o));case Kc:Vy(e);return}}}function C8(e,t){return e===t}function dn(e=C8){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function gt(e){return t=>n=>{e(n)&&t(n)}}function Qe(e){return t=>b8(t,e)}function Xs(e){return t=>()=>t(e)}function ys(e,t){return n=>r=>n(t=e(t,r))}function Mc(e){return t=>n=>{e>0?e--:t(n)}}function Ga(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function R_(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function It(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,l)=>{const i=Math.pow(2,l);Yt(s,c=>{const p=n;n=n|i,t[l]=c,p!==o&&n===o&&r&&(r(),r=null)})}),s=>l=>{const i=()=>s([l].concat(t));n===o?i():r=i}}function D_(...e){return function(t,n){switch(t){case pl:return ere(...e.map(r=>Yt(r,n)));case Kc:return;default:throw new Error(`unrecognized action ${t}`)}}}function ht(e,t=C8){return Pe(e,dn(t))}function Zn(...e){const t=$t(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,l)=>{const i=Math.pow(2,l);Yt(s,c=>{n[l]=c,r=r|i,r===o&&St(t,n)})}),function(s,l){switch(s){case pl:return r===o&&l(n),Yt(t,l);case Kc:return Vy(t);default:throw new Error(`unrecognized action ${s}`)}}}function qt(e,t=[],{singleton:n}={singleton:!0}){return{id:rre(),constructor:e,dependencies:t,singleton:n}}const rre=()=>Symbol();function ore(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:l})=>{if(l&&t.has(r))return t.get(r);const i=o(s.map(c=>n(c)));return l&&t.set(r,i),i};return n(e)}function sre(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const l in t)r.hasOwnProperty(l)||(n[l]=t[l]);return n}const Op=typeof document<"u"?H.useLayoutEffect:H.useEffect;function w8(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),l=Object.keys(t.events||{}),i=H.createContext({});function c(b,C){b.propsReady&&St(b.propsReady,!1);for(const S of r){const _=b[t.required[S]];St(_,C[S])}for(const S of o)if(S in C){const _=b[t.optional[S]];St(_,C[S])}b.propsReady&&St(b.propsReady,!0)}function p(b){return s.reduce((C,S)=>(C[S]=_=>{const j=b[t.methods[S]];St(j,_)},C),{})}function m(b){return l.reduce((C,S)=>(C[S]=tre(b[t.events[S]]),C),{})}return{Component:H.forwardRef((b,C)=>{const{children:S,..._}=b,[j]=H.useState(()=>kg(ore(e),I=>c(I,_))),[E]=H.useState(M_(m,j));return Op(()=>{for(const I of l)I in _&&Yt(E[I],_[I]);return()=>{Object.values(E).map(Vy)}},[_,E,j]),Op(()=>{c(j,_)}),H.useImperativeHandle(C,O_(p(j))),H.createElement(i.Provider,{value:j},n?H.createElement(n,sre([...r,...o,...l],_),S):S)}),usePublisher:b=>H.useCallback(y8(St,H.useContext(i)[b]),[b]),useEmitterValue:b=>{const S=H.useContext(i)[b],[_,j]=H.useState(M_(xo,S));return Op(()=>Yt(S,E=>{E!==_&&j(O_(E))}),[S,_]),_},useEmitter:(b,C)=>{const _=H.useContext(i)[b];Op(()=>Yt(_,C),[C,_])}}}const are=typeof document<"u"?H.useLayoutEffect:H.useEffect,lre=are;var Jr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Jr||{});const ire={0:"debug",1:"log",2:"warn",3:"error"},cre=()=>typeof globalThis>"u"?window:globalThis,ml=qt(()=>{const e=He(3);return{log:He((n,r,o=1)=>{var s;const l=(s=cre().VIRTUOSO_LOG_LEVEL)!=null?s:xo(e);o>=l&&console[ire[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function Wy(e,t=!0){const n=H.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=H.useMemo(()=>new ResizeObserver(s=>{const l=s[0].target;l.offsetParent!==null&&e(l)}),[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 ii(e,t=!0){return Wy(e,t).callbackRef}function ure(e,t,n,r,o,s,l){const i=H.useCallback(c=>{const p=dre(c.children,t,"offsetHeight",o);let m=c.parentElement;for(;!m.dataset.virtuosoScroller;)m=m.parentElement;const h=m.lastElementChild.dataset.viewportType==="window",g=l?l.scrollTop:h?window.pageYOffset||document.documentElement.scrollTop:m.scrollTop,x=l?l.scrollHeight:h?document.documentElement.scrollHeight:m.scrollHeight,y=l?l.offsetHeight:h?window.innerHeight:m.offsetHeight;r({scrollTop:Math.max(g,0),scrollHeight:x,viewportHeight:y}),s==null||s(fre("row-gap",getComputedStyle(c).rowGap,o)),p!==null&&e(p)},[e,t,o,s,l,r]);return Wy(i,n)}function dre(e,t,n,r){const o=e.length;if(o===0)return null;const s=[];for(let l=0;l<o;l++){const i=e.item(l);if(!i||i.dataset.index===void 0)continue;const c=parseInt(i.dataset.index),p=parseFloat(i.dataset.knownSize),m=t(i,n);if(m===0&&r("Zero-sized element, this should not happen",{child:i},Jr.ERROR),m===p)continue;const h=s[s.length-1];s.length===0||h.size!==m||h.endIndex!==c-1?s.push({startIndex:c,endIndex:c,size:m}):s[s.length-1].endIndex++}return s}function fre(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Jr.WARN),t==="normal"?0:parseInt(t??"0",10)}function ol(e,t){return Math.round(e.getBoundingClientRect()[t])}function S8(e,t){return Math.abs(e-t)<1.01}function k8(e,t,n,r=qc,o){const s=H.useRef(null),l=H.useRef(null),i=H.useRef(null),c=H.useCallback(h=>{const g=h.target,x=g===window||g===document,y=x?window.pageYOffset||document.documentElement.scrollTop:g.scrollTop,b=x?document.documentElement.scrollHeight:g.scrollHeight,C=x?window.innerHeight:g.offsetHeight,S=()=>{e({scrollTop:Math.max(y,0),scrollHeight:b,viewportHeight:C})};h.suppressFlushSync?S():zD.flushSync(S),l.current!==null&&(y===l.current||y<=0||y===b-C)&&(l.current=null,t(!0),i.current&&(clearTimeout(i.current),i.current=null))},[e,t]);H.useEffect(()=>{const h=o||s.current;return r(o||s.current),c({target:h,suppressFlushSync:!0}),h.addEventListener("scroll",c,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",c)}},[s,c,n,r,o]);function p(h){const g=s.current;if(!g||"offsetHeight"in g&&g.offsetHeight===0)return;const x=h.behavior==="smooth";let y,b,C;g===window?(b=Math.max(ol(document.documentElement,"height"),document.documentElement.scrollHeight),y=window.innerHeight,C=document.documentElement.scrollTop):(b=g.scrollHeight,y=ol(g,"height"),C=g.scrollTop);const S=b-y;if(h.top=Math.ceil(Math.max(Math.min(S,h.top),0)),S8(y,b)||h.top===C){e({scrollTop:C,scrollHeight:b,viewportHeight:y}),x&&t(!0);return}x?(l.current=h.top,i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,l.current=null,t(!0)},1e3)):l.current=null,g.scrollTo(h)}function m(h){s.current.scrollBy(h)}return{scrollerRef:s,scrollByCallback:m,scrollToCallback:p}}const _r=qt(()=>{const e=$t(),t=$t(),n=He(0),r=$t(),o=He(0),s=$t(),l=$t(),i=He(0),c=He(0),p=He(0),m=He(0),h=$t(),g=$t(),x=He(!1);return at(Pe(e,Qe(({scrollTop:y})=>y)),t),at(Pe(e,Qe(({scrollHeight:y})=>y)),l),at(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:i,fixedHeaderHeight:c,fixedFooterHeight:p,footerHeight:m,scrollHeight:l,smoothScrollTargetReached:r,scrollTo:h,scrollBy:g,statefulScrollTop:o,deviation:n,scrollingInProgress:x}},[],{singleton:!0}),pd={lvl:0};function _8(e,t,n,r=pd,o=pd){return{k:e,v:t,lvl:n,l:r,r:o}}function tn(e){return e===pd}function vc(){return pd}function Cx(e,t){if(tn(e))return pd;const{k:n,l:r,r:o}=e;if(t===n){if(tn(r))return o;if(tn(o))return r;{const[s,l]=j8(r);return Xp(Hn(e,{k:s,v:l,l:I8(r)}))}}else return t<n?Xp(Hn(e,{l:Cx(r,t)})):Xp(Hn(e,{r:Cx(o,t)}))}function md(e,t){if(!tn(e))return t===e.k?e.v:t<e.k?md(e.l,t):md(e.r,t)}function rs(e,t,n="k"){if(tn(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=rs(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return rs(e.l,t,n)}function Xr(e,t,n){return tn(e)?_8(t,n,1):t===e.k?Hn(e,{k:t,v:n}):t<e.k?A_(Hn(e,{l:Xr(e.l,t,n)})):A_(Hn(e,{r:Xr(e.r,t,n)}))}function wx(e,t,n){if(tn(e))return[];const{k:r,v:o,l:s,r:l}=e;let i=[];return r>t&&(i=i.concat(wx(s,t,n))),r>=t&&r<=n&&i.push({k:r,v:o}),r<=n&&(i=i.concat(wx(l,t,n))),i}function Rl(e){return tn(e)?[]:[...Rl(e.l),{k:e.k,v:e.v},...Rl(e.r)]}function j8(e){return tn(e.r)?[e.k,e.v]:j8(e.r)}function I8(e){return tn(e.r)?e.l:Xp(Hn(e,{r:I8(e.r)}))}function Hn(e,t){return _8(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function Kv(e){return tn(e)||e.lvl>e.r.lvl}function A_(e){return Sx(E8(e))}function Xp(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(Kv(t))return E8(Hn(e,{lvl:r-1}));if(!tn(t)&&!tn(t.r))return Hn(t.r,{l:Hn(t,{r:t.r.l}),r:Hn(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(Kv(e))return Sx(Hn(e,{lvl:r-1}));if(!tn(n)&&!tn(n.l)){const o=n.l,s=Kv(o)?n.lvl-1:n.lvl;return Hn(o,{l:Hn(e,{r:o.l,lvl:r-1}),r:Sx(Hn(n,{l:o.r,lvl:s})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function _g(e,t,n){if(tn(e))return[];const r=rs(e,t)[0];return pre(wx(e,r,n))}function P8(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const s=[];for(let l=1;l<n;l++){const{index:i,value:c}=t(e[l]);s.push({start:r,end:i-1,value:o}),r=i,o=c}return s.push({start:r,end:1/0,value:o}),s}function pre(e){return P8(e,({k:t,v:n})=>({index:t,value:n}))}function Sx(e){const{r:t,lvl:n}=e;return!tn(t)&&!tn(t.r)&&t.lvl===n&&t.r.lvl===n?Hn(t,{l:Hn(e,{r:t.l}),lvl:n+1}):e}function E8(e){const{l:t}=e;return!tn(t)&&t.lvl===e.lvl?Hn(t,{r:Hn(e,{l:t.r})}):e}function dh(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const s=Math.floor((r+o)/2),l=e[s],i=n(l,t);if(i===0)return s;if(i===-1){if(o-r<2)return s-1;o=s-1}else{if(o===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function M8(e,t,n){return e[dh(e,t,n)]}function mre(e,t,n,r){const o=dh(e,t,r),s=dh(e,n,r,o);return e.slice(o,s+1)}const Uy=qt(()=>({recalcInProgress:He(!1)}),[],{singleton:!0});function hre(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function T_(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function gre(e,t){let n=tn(e)?0:1/0;for(const r of t){const{size:o,startIndex:s,endIndex:l}=r;if(n=Math.min(n,s),tn(e)){e=Xr(e,0,o);continue}const i=_g(e,s-1,l+1);if(i.some(hre(r)))continue;let c=!1,p=!1;for(const{start:m,end:h,value:g}of i)c?(l>=m||o===g)&&(e=Cx(e,m)):(p=g!==o,c=!0),h>l&&l>=m&&g!==o&&(e=Xr(e,l+1,g));p&&(e=Xr(e,s,o))}return[e,n]}function vre(){return{offsetTree:[],sizeTree:vc(),groupOffsetTree:vc(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function Gy({index:e},t){return t===e?0:t<e?-1:1}function xre({offset:e},t){return t===e?0:t<e?-1:1}function bre(e){return{index:e.index,value:e}}function yre(e,t,n,r=0){return r>0&&(t=Math.max(t,M8(e,r,Gy).offset)),P8(mre(e,t,n,xre),bre)}function kx(e,t,n,r){let o=e,s=0,l=0,i=0,c=0;if(t!==0){c=dh(o,t-1,Gy),i=o[c].offset;const m=rs(n,t-1);s=m[0],l=m[1],o.length&&o[c].size===rs(n,t)[1]&&(c-=1),o=o.slice(0,c+1)}else o=[];for(const{start:p,value:m}of _g(n,t,1/0)){const h=p-s,g=h*l+i+h*r;o.push({offset:g,size:m,index:p}),s=p,i=g,l=m}return{offsetTree:o,lastIndex:s,lastOffset:i,lastSize:l}}function Cre(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Jr.DEBUG);const s=e.sizeTree;let l=s,i=0;if(n.length>0&&tn(s)&&t.length===2){const g=t[0].size,x=t[1].size;l=n.reduce((y,b)=>Xr(Xr(y,b,g),b+1,x),l)}else[l,i]=gre(l,t);if(l===s)return e;const{offsetTree:c,lastIndex:p,lastSize:m,lastOffset:h}=kx(e.offsetTree,i,l,o);return{sizeTree:l,offsetTree:c,lastIndex:p,lastOffset:h,lastSize:m,groupOffsetTree:n.reduce((g,x)=>Xr(g,x,hd(x,c,o)),vc()),groupIndices:n}}function hd(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:s}=M8(t,e,Gy),l=e-o,i=s*l+(l-1)*n+r;return i>0?i+n:i}function wre(e){return typeof e.groupIndex<"u"}function O8(e,t,n){if(wre(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=R8(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function R8(e,t){if(!jg(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function jg(e){return!tn(e.groupOffsetTree)}function Sre(e){return Rl(e).map(({k:t,v:n},r,o)=>{const s=o[r+1],l=s?s.k-1:1/0;return{startIndex:t,endIndex:l,size:n}})}const kre={offsetHeight:"height",offsetWidth:"width"},$s=qt(([{log:e},{recalcInProgress:t}])=>{const n=$t(),r=$t(),o=Cr(r,0),s=$t(),l=$t(),i=He(0),c=He([]),p=He(void 0),m=He(void 0),h=He((I,M)=>ol(I,kre[M])),g=He(void 0),x=He(0),y=vre(),b=Cr(Pe(n,It(c,e,x),ys(Cre,y),dn()),y),C=Cr(Pe(c,dn(),ys((I,M)=>({prev:I.current,current:M}),{prev:[],current:[]}),Qe(({prev:I})=>I)),[]);at(Pe(c,gt(I=>I.length>0),It(b,x),Qe(([I,M,R])=>{const D=I.reduce((A,O,$)=>Xr(A,O,hd(O,M.offsetTree,R)||$),vc());return{...M,groupIndices:I,groupOffsetTree:D}})),b),at(Pe(r,It(b),gt(([I,{lastIndex:M}])=>I<M),Qe(([I,{lastIndex:M,lastSize:R}])=>[{startIndex:I,endIndex:M,size:R}])),n),at(p,m);const S=Cr(Pe(p,Qe(I=>I===void 0)),!0);at(Pe(m,gt(I=>I!==void 0&&tn(xo(b).sizeTree)),Qe(I=>[{startIndex:0,endIndex:0,size:I}])),n);const _=Zr(Pe(n,It(b),ys(({sizes:I},[M,R])=>({changed:R!==I,sizes:R}),{changed:!1,sizes:y}),Qe(I=>I.changed)));Yt(Pe(i,ys((I,M)=>({diff:I.prev-M,prev:M}),{diff:0,prev:0}),Qe(I=>I.diff)),I=>{const{groupIndices:M}=xo(b);if(I>0)St(t,!0),St(s,I+T_(I,M));else if(I<0){const R=xo(C);R.length>0&&(I-=T_(-I,R)),St(l,I)}}),Yt(Pe(i,It(e)),([I,M])=>{I<0&&M("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:i},Jr.ERROR)});const j=Zr(s);at(Pe(s,It(b),Qe(([I,M])=>{const R=M.groupIndices.length>0,D=[],A=M.lastSize;if(R){const O=md(M.sizeTree,0);let $=0,X=0;for(;$<I;){const Q=M.groupIndices[X],G=M.groupIndices.length===X+1?1/0:M.groupIndices[X+1]-Q-1;D.push({startIndex:Q,endIndex:Q,size:O}),D.push({startIndex:Q+1,endIndex:Q+1+G-1,size:A}),X++,$+=G+1}const z=Rl(M.sizeTree);return $!==I&&z.shift(),z.reduce((Q,{k:G,v:F})=>{let U=Q.ranges;return Q.prevSize!==0&&(U=[...Q.ranges,{startIndex:Q.prevIndex,endIndex:G+I-1,size:Q.prevSize}]),{ranges:U,prevIndex:G+I,prevSize:F}},{ranges:D,prevIndex:I,prevSize:0}).ranges}return Rl(M.sizeTree).reduce((O,{k:$,v:X})=>({ranges:[...O.ranges,{startIndex:O.prevIndex,endIndex:$+I-1,size:O.prevSize}],prevIndex:$+I,prevSize:X}),{ranges:[],prevIndex:0,prevSize:A}).ranges})),n);const E=Zr(Pe(l,It(b,x),Qe(([I,{offsetTree:M},R])=>{const D=-I;return hd(D,M,R)})));return at(Pe(l,It(b,x),Qe(([I,M,R])=>{if(M.groupIndices.length>0){if(tn(M.sizeTree))return M;let A=vc();const O=xo(C);let $=0,X=0,z=0;for(;$<-I;){z=O[X];const Q=O[X+1]-z-1;X++,$+=Q+1}if(A=Rl(M.sizeTree).reduce((Q,{k:G,v:F})=>Xr(Q,Math.max(0,G+I),F),A),$!==-I){const Q=md(M.sizeTree,z);A=Xr(A,0,Q);const G=rs(M.sizeTree,-I+1)[1];A=Xr(A,1,G)}return{...M,sizeTree:A,...kx(M.offsetTree,0,A,R)}}else{const A=Rl(M.sizeTree).reduce((O,{k:$,v:X})=>Xr(O,Math.max(0,$+I),X),vc());return{...M,sizeTree:A,...kx(M.offsetTree,0,A,R)}}})),b),{data:g,totalCount:r,sizeRanges:n,groupIndices:c,defaultItemSize:m,fixedItemSize:p,unshiftWith:s,shiftWith:l,shiftWithOffset:E,beforeUnshiftWith:j,firstItemIndex:i,gap:x,sizes:b,listRefresh:_,statefulTotalCount:o,trackItemSizes:S,itemSize:h}},mn(ml,Uy),{singleton:!0}),_re=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function D8(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!_re)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const Zd=qt(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:s,scrollTo:l,smoothScrollTargetReached:i,headerHeight:c,footerHeight:p,fixedHeaderHeight:m,fixedFooterHeight:h},{log:g}])=>{const x=$t(),y=He(0);let b=null,C=null,S=null;function _(){b&&(b(),b=null),S&&(S(),S=null),C&&(clearTimeout(C),C=null),St(o,!1)}return at(Pe(x,It(e,s,t,y,c,p,g),It(r,m,h),Qe(([[j,E,I,M,R,D,A,O],$,X,z])=>{const V=D8(j),{align:Q,behavior:G,offset:F}=V,U=M-1,T=O8(V,E,U);let B=hd(T,E.offsetTree,$)+D;Q==="end"?(B+=X+rs(E.sizeTree,T)[1]-I+z,T===U&&(B+=A)):Q==="center"?B+=(X+rs(E.sizeTree,T)[1]-I+z)/2:B-=R,F&&(B+=F);const Y=re=>{_(),re?(O("retrying to scroll to",{location:j},Jr.DEBUG),St(x,j)):O("list did not change, scroll successful",{},Jr.DEBUG)};if(_(),G==="smooth"){let re=!1;S=Yt(n,le=>{re=re||le}),b=ua(i,()=>{Y(re)})}else b=ua(Pe(n,jre(150)),Y);return C=setTimeout(()=>{_()},1200),St(o,!0),O("scrolling from index to",{index:T,top:B,behavior:G},Jr.DEBUG),{top:B,behavior:G}})),l),{scrollToIndex:x,topListHeight:y}},mn($s,_r,ml),{singleton:!0});function jre(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const gd="up",Ku="down",Ire="none",Pre={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Ere=0,Jd=qt(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const l=He(!1),i=He(!0),c=$t(),p=$t(),m=He(4),h=He(Ere),g=Cr(Pe(D_(Pe(ht(t),Mc(1),Xs(!0)),Pe(ht(t),Mc(1),Xs(!1),R_(100))),dn()),!1),x=Cr(Pe(D_(Pe(s,Xs(!0)),Pe(s,Xs(!1),R_(200))),dn()),!1);at(Pe(Zn(ht(t),ht(h)),Qe(([_,j])=>_<=j),dn()),i),at(Pe(i,Ga(50)),p);const y=Zr(Pe(Zn(e,ht(n),ht(r),ht(o),ht(m)),ys((_,[{scrollTop:j,scrollHeight:E},I,M,R,D])=>{const A=j+I-E>-D,O={viewportHeight:I,scrollTop:j,scrollHeight:E};if(A){let X,z;return j>_.state.scrollTop?(X="SCROLLED_DOWN",z=_.state.scrollTop-j):(X="SIZE_DECREASED",z=_.state.scrollTop-j||_.scrollTopDelta),{atBottom:!0,state:O,atBottomBecause:X,scrollTopDelta:z}}let $;return O.scrollHeight>_.state.scrollHeight?$="SIZE_INCREASED":I<_.state.viewportHeight?$="VIEWPORT_HEIGHT_DECREASING":j<_.state.scrollTop?$="SCROLLING_UPWARDS":$="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:$,state:O}},Pre),dn((_,j)=>_&&_.atBottom===j.atBottom))),b=Cr(Pe(e,ys((_,{scrollTop:j,scrollHeight:E,viewportHeight:I})=>{if(S8(_.scrollHeight,E))return{scrollTop:j,scrollHeight:E,jump:0,changed:!1};{const M=E-(j+I)<1;return _.scrollTop!==j&&M?{scrollHeight:E,scrollTop:j,jump:_.scrollTop-j,changed:!0}:{scrollHeight:E,scrollTop:j,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),gt(_=>_.changed),Qe(_=>_.jump)),0);at(Pe(y,Qe(_=>_.atBottom)),l),at(Pe(l,Ga(50)),c);const C=He(Ku);at(Pe(e,Qe(({scrollTop:_})=>_),dn(),ys((_,j)=>xo(x)?{direction:_.direction,prevScrollTop:j}:{direction:j<_.prevScrollTop?gd:Ku,prevScrollTop:j},{direction:Ku,prevScrollTop:0}),Qe(_=>_.direction)),C),at(Pe(e,Ga(50),Xs(Ire)),C);const S=He(0);return at(Pe(g,gt(_=>!_),Xs(0)),S),at(Pe(t,Ga(100),It(g),gt(([_,j])=>!!j),ys(([_,j],[E])=>[j,E],[0,0]),Qe(([_,j])=>j-_)),S),{isScrolling:g,isAtTop:i,isAtBottom:l,atBottomState:y,atTopStateChange:p,atBottomStateChange:c,scrollDirection:C,atBottomThreshold:m,atTopThreshold:h,scrollVelocity:S,lastJumpDueToItemResize:b}},mn(_r)),hl=qt(([{log:e}])=>{const t=He(!1),n=Zr(Pe(t,gt(r=>r),dn()));return Yt(t,r=>{r&&xo(e)("props updated",{},Jr.DEBUG)}),{propsReady:t,didMount:n}},mn(ml),{singleton:!0});function Ky(e,t){e==0?t():requestAnimationFrame(()=>Ky(e-1,t))}function qy(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const ef=qt(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o},{didMount:s}])=>{const l=He(!0),i=He(0),c=He(!1);return at(Pe(s,It(i),gt(([p,m])=>!!m),Xs(!1)),l),Yt(Pe(Zn(t,s),It(l,e,n,c),gt(([[,p],m,{sizeTree:h},g,x])=>p&&(!tn(h)||Hy(g))&&!m&&!x),It(i)),([,p])=>{St(c,!0),Ky(3,()=>{ua(r,()=>St(l,!0)),St(o,p)})}),{scrolledToInitialItem:l,initialTopMostItemIndex:i}},mn($s,_r,Zd,hl),{singleton:!0});function $_(e){return e?e==="smooth"?"smooth":"auto":!1}const Mre=(e,t)=>typeof e=="function"?$_(e(t)):t&&$_(e),Ore=qt(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:s},{propsReady:l,didMount:i},{log:c},{scrollingInProgress:p}])=>{const m=He(!1),h=$t();let g=null;function x(b){St(o,{index:"LAST",align:"end",behavior:b})}Yt(Pe(Zn(Pe(ht(e),Mc(1)),i),It(ht(m),n,s,p),Qe(([[b,C],S,_,j,E])=>{let I=C&&j,M="auto";return I&&(M=Mre(S,_||E),I=I&&!!M),{totalCount:b,shouldFollow:I,followOutputBehavior:M}}),gt(({shouldFollow:b})=>b)),({totalCount:b,followOutputBehavior:C})=>{g&&(g(),g=null),g=ua(t,()=>{xo(c)("following output to ",{totalCount:b},Jr.DEBUG),x(C),g=null})});function y(b){const C=ua(r,S=>{b&&!S.atBottom&&S.notAtBottomBecause==="SIZE_INCREASED"&&!g&&(xo(c)("scrolling to bottom due to increased size",{},Jr.DEBUG),x("auto"))});setTimeout(C,100)}return Yt(Pe(Zn(ht(m),e,l),gt(([b,,C])=>b&&C),ys(({value:b},[,C])=>({refreshed:b===C,value:C}),{refreshed:!1,value:0}),gt(({refreshed:b})=>b),It(m,e)),([,b])=>{y(b!==!1)}),Yt(h,()=>{y(xo(m)!==!1)}),Yt(Zn(ht(m),r),([b,C])=>{b&&!C.atBottom&&C.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&x("auto")}),{followOutput:m,autoscrollToBottom:h}},mn($s,Jd,Zd,ef,hl,ml,_r));function Rre(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const A8=qt(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const s=$t(),l=$t(),i=Zr(Pe(s,Qe(Rre)));return at(Pe(i,Qe(c=>c.totalCount)),e),at(Pe(i,Qe(c=>c.groupIndices)),t),at(Pe(Zn(r,n,o),gt(([c,p])=>jg(p)),Qe(([c,p,m])=>rs(p.groupOffsetTree,Math.max(c-m,0),"v")[0]),dn(),Qe(c=>[c])),l),{groupCounts:s,topItemsIndexes:l}},mn($s,_r));function vd(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function T8(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const fh="top",ph="bottom",N_="none";function L_(e,t,n){return typeof e=="number"?n===gd&&t===fh||n===Ku&&t===ph?e:0:n===gd?t===fh?e.main:e.reverse:t===ph?e.main:e.reverse}function z_(e,t){return typeof e=="number"?e:e[t]||0}const Xy=qt(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=$t(),l=He(0),i=He(0),c=He(0),p=Cr(Pe(Zn(ht(e),ht(t),ht(r),ht(s,vd),ht(c),ht(l),ht(o),ht(n),ht(i)),Qe(([m,h,g,[x,y],b,C,S,_,j])=>{const E=m-_,I=C+S,M=Math.max(g-E,0);let R=N_;const D=z_(j,fh),A=z_(j,ph);return x-=_,x+=g+S,y+=g+S,y-=_,x>m+I-D&&(R=gd),y<m-M+h+A&&(R=Ku),R!==N_?[Math.max(E-g-L_(b,fh,R)-D,0),E-M-S+h+L_(b,ph,R)+A]:null}),gt(m=>m!=null),dn(vd)),[0,0]);return{listBoundary:s,overscan:c,topListHeight:l,increaseViewportBy:i,visibleRange:p}},mn(_r),{singleton:!0});function Dre(e,t,n){if(jg(t)){const r=R8(e,t);return[{index:rs(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const F_={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function B_(e,t,n){if(e.length===0)return[];if(!jg(t))return e.map(p=>({...p,index:p.index+n,originalIndex:p.index}));const r=e[0].index,o=e[e.length-1].index,s=[],l=_g(t.groupOffsetTree,r,o);let i,c=0;for(const p of e){(!i||i.end<p.index)&&(i=l.shift(),c=t.groupIndices.indexOf(i.start));let m;p.index===i.start?m={type:"group",index:c}:m={index:p.index-(c+1)+n,groupIndex:c},s.push({...m,size:p.size,offset:p.offset,originalIndex:p.index,data:p.data})}return s}function Qp(e,t,n,r,o,s){const{lastSize:l,lastOffset:i,lastIndex:c}=o;let p=0,m=0;if(e.length>0){p=e[0].offset;const b=e[e.length-1];m=b.offset+b.size}const h=n-c,g=i+h*l+(h-1)*r,x=p,y=g-m;return{items:B_(e,o,s),topItems:B_(t,o,s),topListHeight:t.reduce((b,C)=>C.size+b,0),offsetTop:p,offsetBottom:y,top:x,bottom:m,totalCount:n,firstItemIndex:s}}const ci=qt(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},s,{visibleRange:l,listBoundary:i,topListHeight:c},{scrolledToInitialItem:p,initialTopMostItemIndex:m},{topListHeight:h},g,{didMount:x},{recalcInProgress:y}])=>{const b=He([]),C=$t();at(s.topItemsIndexes,b);const S=Cr(Pe(Zn(x,y,ht(l,vd),ht(t),ht(e),ht(m),p,ht(b),ht(r),ht(o),n),gt(([I,M,,R,,,,,,,D])=>{const A=D&&D.length!==R;return I&&!M&&!A}),Qe(([,,[I,M],R,D,A,O,$,X,z,V])=>{const Q=D,{sizeTree:G,offsetTree:F}=Q;if(R===0||I===0&&M===0)return{...F_,totalCount:R};if(tn(G))return Qp(Dre(qy(A,R),Q,V),[],R,z,Q,X);const U=[];if($.length>0){const le=$[0],oe=$[$.length-1];let q=0;for(const K of _g(G,le,oe)){const ee=K.value,ce=Math.max(K.start,le),J=Math.min(K.end,oe);for(let ie=ce;ie<=J;ie++)U.push({index:ie,size:ee,offset:q,data:V&&V[ie]}),q+=ee}}if(!O)return Qp([],U,R,z,Q,X);const T=$.length>0?$[$.length-1]+1:0,B=yre(F,I,M,T);if(B.length===0)return null;const Y=R-1,re=kg([],le=>{for(const oe of B){const q=oe.value;let K=q.offset,ee=oe.start;const ce=q.size;if(q.offset<I){ee+=Math.floor((I-q.offset+z)/(ce+z));const ie=ee-oe.start;K+=ie*ce+ie*z}ee<T&&(K+=(T-ee)*ce,ee=T);const J=Math.min(oe.end,Y);for(let ie=ee;ie<=J&&!(K>=M);ie++)le.push({index:ie,size:ce,offset:K,data:V&&V[ie]}),K+=ce+z}});return Qp(re,U,R,z,Q,X)}),gt(I=>I!==null),dn()),F_);at(Pe(n,gt(Hy),Qe(I=>I==null?void 0:I.length)),t),at(Pe(S,Qe(I=>I.topListHeight)),h),at(h,c),at(Pe(S,Qe(I=>[I.top,I.bottom])),i),at(Pe(S,Qe(I=>I.items)),C);const _=Zr(Pe(S,gt(({items:I})=>I.length>0),It(t,n),gt(([{items:I},M])=>I[I.length-1].originalIndex===M-1),Qe(([,I,M])=>[I-1,M]),dn(vd),Qe(([I])=>I))),j=Zr(Pe(S,Ga(200),gt(({items:I,topItems:M})=>I.length>0&&I[0].originalIndex===M.length),Qe(({items:I})=>I[0].index),dn())),E=Zr(Pe(S,gt(({items:I})=>I.length>0),Qe(({items:I})=>{let M=0,R=I.length-1;for(;I[M].type==="group"&&M<R;)M++;for(;I[R].type==="group"&&R>M;)R--;return{startIndex:I[M].index,endIndex:I[R].index}}),dn(T8)));return{listState:S,topItemsIndexes:b,endReached:_,startReached:j,rangeChanged:E,itemsRendered:C,...g}},mn($s,A8,Xy,ef,Zd,Jd,hl,Uy),{singleton:!0}),Are=qt(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{listState:s},{didMount:l}])=>{const i=He(0);return at(Pe(l,It(i),gt(([,c])=>c!==0),It(o,e,t,r,n),Qe(([[,c],p,m,h,g,x=[]])=>{let y=0;if(m.groupIndices.length>0)for(const _ of m.groupIndices){if(_-y>=c)break;y++}const b=c+y,C=qy(p,b),S=Array.from({length:b}).map((_,j)=>({index:j+C,size:0,offset:0,data:x[j+C]}));return Qp(S,[],b,g,m,h)})),s),{initialItemCount:i}},mn($s,ef,ci,hl),{singleton:!0}),$8=qt(([{scrollVelocity:e}])=>{const t=He(!1),n=$t(),r=He(!1);return at(Pe(e,It(r,t,n),gt(([o,s])=>!!s),Qe(([o,s,l,i])=>{const{exit:c,enter:p}=s;if(l){if(c(o,i))return!1}else if(p(o,i))return!0;return l}),dn()),t),Yt(Pe(Zn(t,e,n),It(r)),([[o,s,l],i])=>o&&i&&i.change&&i.change(s,l)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},mn(Jd),{singleton:!0}),Tre=qt(([{topItemsIndexes:e}])=>{const t=He(0);return at(Pe(t,gt(n=>n>0),Qe(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},mn(ci)),N8=qt(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const s=$t(),l=Cr(Pe(Zn(e,r,t,n,o),Qe(([i,c,p,m,h])=>i+c+p+m+h.offsetBottom+h.bottom)),0);return at(ht(l),s),{totalListHeight:l,totalListHeightChanged:s}},mn(_r,ci),{singleton:!0});function L8(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const $re=L8(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Nre=qt(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:s,scrollDirection:l,lastJumpDueToItemResize:i},{listState:c},{beforeUnshiftWith:p,shiftWithOffset:m,sizes:h,gap:g},{log:x},{recalcInProgress:y}])=>{const b=Zr(Pe(c,It(i),ys(([,S,_,j],[{items:E,totalCount:I,bottom:M,offsetBottom:R},D])=>{const A=M+R;let O=0;return _===I&&S.length>0&&E.length>0&&(E[0].originalIndex===0&&S[0].originalIndex===0||(O=A-j,O!==0&&(O+=D))),[O,E,I,A]},[0,[],0,0]),gt(([S])=>S!==0),It(t,l,r,s,x,y),gt(([,S,_,j,,,E])=>!E&&!j&&S!==0&&_===gd),Qe(([[S],,,,,_])=>(_("Upward scrolling compensation",{amount:S},Jr.DEBUG),S))));function C(S){S>0?(St(e,{top:-S,behavior:"auto"}),St(n,0)):(St(n,0),St(e,{top:-S,behavior:"auto"}))}return Yt(Pe(b,It(n,o)),([S,_,j])=>{j&&$re()?St(n,_-S):C(-S)}),Yt(Pe(Zn(Cr(o,!1),n,y),gt(([S,_,j])=>!S&&!j&&_!==0),Qe(([S,_])=>_),Ga(1)),C),at(Pe(m,Qe(S=>({top:-S}))),e),Yt(Pe(p,It(h,g),Qe(([S,{lastSize:_,groupIndices:j,sizeTree:E},I])=>{function M(R){return R*(_+I)}if(j.length===0)return M(S);{let R=0;const D=md(E,0);let A=0,O=0;for(;A<S;){A++,R+=D;let $=j.length===O+1?1/0:j[O+1]-j[O]-1;A+$>S&&(R-=D,$=S-A+1),A+=$,R+=M($),O++}return R}})),S=>{St(n,S),requestAnimationFrame(()=>{St(e,{top:S}),requestAnimationFrame(()=>{St(n,0),St(y,!1)})})}),{deviation:n}},mn(_r,Jd,ci,$s,ml,Uy)),Lre=qt(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=He(0);return Yt(Pe(e,It(r),gt(([,o])=>o!==0),Qe(([,o])=>({top:o}))),o=>{ua(Pe(n,Mc(1),gt(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{St(t,o)})})}),{initialScrollTop:r}},mn(hl,_r,ci),{singleton:!0}),zre=qt(([{viewportHeight:e},{totalListHeight:t}])=>{const n=He(!1),r=Cr(Pe(Zn(n,e,t),gt(([o])=>o),Qe(([,o,s])=>Math.max(0,o-s)),Ga(0),dn()),0);return{alignToBottom:n,paddingTopAddition:r}},mn(_r,N8),{singleton:!0}),Qy=qt(([{scrollTo:e,scrollContainerState:t}])=>{const n=$t(),r=$t(),o=$t(),s=He(!1),l=He(void 0);return at(Pe(Zn(n,r),Qe(([{viewportHeight:i,scrollTop:c,scrollHeight:p},{offsetTop:m}])=>({scrollTop:Math.max(0,c-m),scrollHeight:p,viewportHeight:i}))),t),at(Pe(e,It(r),Qe(([i,{offsetTop:c}])=>({...i,top:i.top+c}))),o),{useWindowScroll:s,customScrollParent:l,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},mn(_r)),Fre=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:s,...l}})=>e<n?{...l,behavior:o,align:s??"start"}:t>r?{...l,behavior:o,align:s??"end"}:null,Bre=qt(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:i,scrollingInProgress:c},{scrollToIndex:p}])=>{const m=$t();return at(Pe(m,It(e,o,t,s,l,i,r),It(n),Qe(([[h,g,x,y,b,C,S,_],j])=>{const{done:E,behavior:I,align:M,calculateViewLocation:R=Fre,...D}=h,A=O8(h,g,y-1),O=hd(A,g.offsetTree,j)+b+C,$=O+rs(g.sizeTree,A)[1],X=_+C,z=_+x-S,V=R({itemTop:O,itemBottom:$,viewportTop:X,viewportBottom:z,locationParams:{behavior:I,align:M,...D}});return V?E&&ua(Pe(c,gt(Q=>Q===!1),Mc(xo(c)?1:2)),E):E&&E(),V}),gt(h=>h!==null)),p),{scrollIntoView:m}},mn($s,_r,Zd,ci,ml),{singleton:!0}),Hre=qt(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:s,windowScrollContainerState:l,windowViewportRect:i}])=>{const c=$t(),p=He(void 0),m=He(null),h=He(null);return at(l,m),at(i,h),Yt(Pe(c,It(e,n,s,m,h)),([g,x,y,b,C,S])=>{const _=Sre(x.sizeTree);b&&C!==null&&S!==null&&(y=C.scrollTop-S.offsetTop),g({ranges:_,scrollTop:y})}),at(Pe(p,gt(Hy),Qe(Vre)),r),at(Pe(o,It(p),gt(([,g])=>g!==void 0),dn(),Qe(([,g])=>g.ranges)),t),{getState:c,restoreStateFrom:p}},mn($s,_r,ef,hl,Qy));function Vre(e){return{offset:e.scrollTop,index:0,align:"start"}}const Wre=qt(([e,t,n,r,o,s,l,i,c,p])=>({...e,...t,...n,...r,...o,...s,...l,...i,...c,...p}),mn(Xy,Are,hl,$8,N8,Lre,zre,Qy,Bre,ml)),Ure=qt(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:s,data:l,firstItemIndex:i,groupIndices:c,statefulTotalCount:p,gap:m,sizes:h},{initialTopMostItemIndex:g,scrolledToInitialItem:x},y,b,C,{listState:S,topItemsIndexes:_,...j},{scrollToIndex:E},I,{topItemCount:M},{groupCounts:R},D])=>(at(j.rangeChanged,D.scrollSeekRangeChanged),at(Pe(D.windowViewportRect,Qe(A=>A.visibleHeight)),y.viewportHeight),{totalCount:e,data:l,firstItemIndex:i,sizeRanges:t,initialTopMostItemIndex:g,scrolledToInitialItem:x,topItemsIndexes:_,topItemCount:M,groupCounts:R,fixedItemHeight:n,defaultItemHeight:r,gap:m,...C,statefulTotalCount:p,listState:S,scrollToIndex:E,trackItemSizes:o,itemSize:s,groupIndices:c,...j,...D,...y,sizes:h,...b}),mn($s,ef,_r,Hre,Ore,ci,Zd,Nre,Tre,A8,Wre)),qv="-webkit-sticky",H_="sticky",z8=L8(()=>{if(typeof document>"u")return H_;const e=document.createElement("div");return e.style.position=qv,e.style.position===qv?qv:H_});function F8(e,t){const n=H.useRef(null),r=H.useCallback(i=>{if(i===null||!i.offsetParent)return;const c=i.getBoundingClientRect(),p=c.width;let m,h;if(t){const g=t.getBoundingClientRect(),x=c.top-g.top;m=g.height-Math.max(0,x),h=x+t.scrollTop}else m=window.innerHeight-Math.max(0,c.top),h=c.top+window.pageYOffset;n.current={offsetTop:h,visibleHeight:m,visibleWidth:p},e(n.current)},[e,t]),{callbackRef:o,ref:s}=Wy(r),l=H.useCallback(()=>{r(s.current)},[r,s]);return H.useEffect(()=>{if(t){t.addEventListener("scroll",l);const i=new ResizeObserver(l);return i.observe(t),()=>{t.removeEventListener("scroll",l),i.unobserve(t)}}else return window.addEventListener("scroll",l),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[l,t]),o}const B8=H.createContext(void 0),H8=H.createContext(void 0);function V8(e){return e}const Gre=qt(()=>{const e=He(c=>`Item ${c}`),t=He(null),n=He(c=>`Group ${c}`),r=He({}),o=He(V8),s=He("div"),l=He(qc),i=(c,p=null)=>Cr(Pe(r,Qe(m=>m[c]),dn()),p);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:s,scrollerRef:l,FooterComponent:i("Footer"),HeaderComponent:i("Header"),TopItemListComponent:i("TopItemList"),ListComponent:i("List","div"),ItemComponent:i("Item","div"),GroupComponent:i("Group","div"),ScrollerComponent:i("Scroller","div"),EmptyPlaceholder:i("EmptyPlaceholder"),ScrollSeekPlaceholder:i("ScrollSeekPlaceholder")}}),Kre=qt(([e,t])=>({...e,...t}),mn(Ure,Gre)),qre=({height:e})=>H.createElement("div",{style:{height:e}}),Xre={position:z8(),zIndex:1,overflowAnchor:"none"},Qre={overflowAnchor:"none"},V_=H.memo(function({showTopList:t=!1}){const n=Rt("listState"),r=bo("sizeRanges"),o=Rt("useWindowScroll"),s=Rt("customScrollParent"),l=bo("windowScrollContainerState"),i=bo("scrollContainerState"),c=s||o?l:i,p=Rt("itemContent"),m=Rt("context"),h=Rt("groupContent"),g=Rt("trackItemSizes"),x=Rt("itemSize"),y=Rt("log"),b=bo("gap"),{callbackRef:C}=ure(r,x,g,t?qc:c,y,b,s),[S,_]=H.useState(0);Yy("deviation",V=>{S!==V&&_(V)});const j=Rt("EmptyPlaceholder"),E=Rt("ScrollSeekPlaceholder")||qre,I=Rt("ListComponent"),M=Rt("ItemComponent"),R=Rt("GroupComponent"),D=Rt("computeItemKey"),A=Rt("isSeeking"),O=Rt("groupIndices").length>0,$=Rt("paddingTopAddition"),X=Rt("scrolledToInitialItem"),z=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop+$,paddingBottom:n.offsetBottom,marginTop:S,...X?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&j?H.createElement(j,Ar(j,m)):H.createElement(I,{...Ar(I,m),ref:C,style:z,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(V=>{const Q=V.originalIndex,G=D(Q+n.firstItemIndex,V.data,m);return A?H.createElement(E,{...Ar(E,m),key:G,index:V.index,height:V.size,type:V.type||"item",...V.type==="group"?{}:{groupIndex:V.groupIndex}}):V.type==="group"?H.createElement(R,{...Ar(R,m),key:G,"data-index":Q,"data-known-size":V.size,"data-item-index":V.index,style:Xre},h(V.index,m)):H.createElement(M,{...Ar(M,m),key:G,"data-index":Q,"data-known-size":V.size,"data-item-index":V.index,"data-item-group-index":V.groupIndex,item:V.data,style:Qre},O?p(V.index,V.groupIndex,V.data,m):p(V.index,V.data,m))}))}),Yre={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Ig={width:"100%",height:"100%",position:"absolute",top:0},Zre={width:"100%",position:z8(),top:0,zIndex:1};function Ar(e,t){if(typeof e!="string")return{context:t}}const Jre=H.memo(function(){const t=Rt("HeaderComponent"),n=bo("headerHeight"),r=Rt("headerFooterTag"),o=ii(l=>n(ol(l,"height"))),s=Rt("context");return t?H.createElement(r,{ref:o},H.createElement(t,Ar(t,s))):null}),eoe=H.memo(function(){const t=Rt("FooterComponent"),n=bo("footerHeight"),r=Rt("headerFooterTag"),o=ii(l=>n(ol(l,"height"))),s=Rt("context");return t?H.createElement(r,{ref:o},H.createElement(t,Ar(t,s))):null});function W8({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:l,...i}){const c=e("scrollContainerState"),p=n("ScrollerComponent"),m=e("smoothScrollTargetReached"),h=n("scrollerRef"),g=n("context"),{scrollerRef:x,scrollByCallback:y,scrollToCallback:b}=k8(c,m,p,h);return t("scrollTo",b),t("scrollBy",y),H.createElement(p,{ref:x,style:{...Yre,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...i,...Ar(p,g)},l)})}function U8({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:l,...i}){const c=e("windowScrollContainerState"),p=n("ScrollerComponent"),m=e("smoothScrollTargetReached"),h=n("totalListHeight"),g=n("deviation"),x=n("customScrollParent"),y=n("context"),{scrollerRef:b,scrollByCallback:C,scrollToCallback:S}=k8(c,m,p,qc,x);return lre(()=>(b.current=x||window,()=>{b.current=null}),[b,x]),t("windowScrollTo",S),t("scrollBy",C),H.createElement(p,{style:{position:"relative",...s,...h!==0?{height:h+g}:{}},"data-virtuoso-scroller":!0,...i,...Ar(p,y)},l)})}const toe=({children:e})=>{const t=H.useContext(B8),n=bo("viewportHeight"),r=bo("fixedItemHeight"),o=ii(b8(n,s=>ol(s,"height")));return H.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),H.createElement("div",{style:Ig,ref:o,"data-viewport-type":"element"},e)},noe=({children:e})=>{const t=H.useContext(B8),n=bo("windowViewportRect"),r=bo("fixedItemHeight"),o=Rt("customScrollParent"),s=F8(n,o);return H.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),H.createElement("div",{ref:s,style:Ig,"data-viewport-type":"window"},e)},roe=({children:e})=>{const t=Rt("TopItemListComponent"),n=Rt("headerHeight"),r={...Zre,marginTop:`${n}px`},o=Rt("context");return H.createElement(t||"div",{style:r,context:o},e)},ooe=H.memo(function(t){const n=Rt("useWindowScroll"),r=Rt("topItemsIndexes").length>0,o=Rt("customScrollParent"),s=o||n?loe:aoe,l=o||n?noe:toe;return H.createElement(s,{...t},r&&H.createElement(roe,null,H.createElement(V_,{showTopList:!0})),H.createElement(l,null,H.createElement(Jre,null),H.createElement(V_,null),H.createElement(eoe,null)))}),{Component:soe,usePublisher:bo,useEmitterValue:Rt,useEmitter:Yy}=w8(Kre,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ooe),aoe=W8({usePublisher:bo,useEmitterValue:Rt,useEmitter:Yy}),loe=U8({usePublisher:bo,useEmitterValue:Rt,useEmitter:Yy}),ioe=soe,W_={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},coe={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:U_,ceil:G_,floor:mh,min:Xv,max:qu}=Math;function uoe(e){return{...coe,items:e}}function K_(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const s=n===null?null:n[o+e];return{index:o+e,data:s}})}function doe(e,t){return e&&e.column===t.column&&e.row===t.row}function Rp(e,t){return e&&e.width===t.width&&e.height===t.height}const foe=qt(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:l,smoothScrollTargetReached:i,scrollContainerState:c,footerHeight:p,headerHeight:m},h,g,{propsReady:x,didMount:y},{windowViewportRect:b,useWindowScroll:C,customScrollParent:S,windowScrollContainerState:_,windowScrollTo:j},E])=>{const I=He(0),M=He(0),R=He(W_),D=He({height:0,width:0}),A=He({height:0,width:0}),O=$t(),$=$t(),X=He(0),z=He(null),V=He({row:0,column:0}),Q=$t(),G=$t(),F=He(!1),U=He(0),T=He(!0),B=He(!1);Yt(Pe(y,It(U),gt(([K,ee])=>!!ee)),()=>{St(T,!1),St(M,0)}),Yt(Pe(Zn(y,T,A,D,U,B),gt(([K,ee,ce,J,,ie])=>K&&!ee&&ce.height!==0&&J.height!==0&&!ie)),([,,,,K])=>{St(B,!0),Ky(1,()=>{St(O,K)}),ua(Pe(r),()=>{St(n,[0,0]),St(T,!0)})}),at(Pe(G,gt(K=>K!=null&&K.scrollTop>0),Xs(0)),M),Yt(Pe(y,It(G),gt(([,K])=>K!=null)),([,K])=>{K&&(St(D,K.viewport),St(A,K==null?void 0:K.item),St(V,K.gap),K.scrollTop>0&&(St(F,!0),ua(Pe(r,Mc(1)),ee=>{St(F,!1)}),St(l,{top:K.scrollTop})))}),at(Pe(D,Qe(({height:K})=>K)),o),at(Pe(Zn(ht(D,Rp),ht(A,Rp),ht(V,(K,ee)=>K&&K.column===ee.column&&K.row===ee.row),ht(r)),Qe(([K,ee,ce,J])=>({viewport:K,item:ee,gap:ce,scrollTop:J}))),Q),at(Pe(Zn(ht(I),t,ht(V,doe),ht(A,Rp),ht(D,Rp),ht(z),ht(M),ht(F),ht(T),ht(U)),gt(([,,,,,,,K])=>!K),Qe(([K,[ee,ce],J,ie,de,xe,we,,ve,fe])=>{const{row:Oe,column:je}=J,{height:$e,width:st}=ie,{width:Ve}=de;if(we===0&&(K===0||Ve===0))return W_;if(st===0){const ct=qy(fe,K),ft=ct===0?Math.max(we-1,0):ct;return uoe(K_(ct,ft,xe))}const Ct=G8(Ve,st,je);let Ye,Ke;ve?ee===0&&ce===0&&we>0?(Ye=0,Ke=we-1):(Ye=Ct*mh((ee+Oe)/($e+Oe)),Ke=Ct*G_((ce+Oe)/($e+Oe))-1,Ke=Xv(K-1,qu(Ke,Ct-1)),Ye=Xv(Ke,qu(0,Ye))):(Ye=0,Ke=-1);const ge=K_(Ye,Ke,xe),{top:De,bottom:ut}=q_(de,J,ie,ge),yt=G_(K/Ct),tt=yt*$e+(yt-1)*Oe-ut;return{items:ge,offsetTop:De,offsetBottom:tt,top:De,bottom:ut,itemHeight:$e,itemWidth:st}})),R),at(Pe(z,gt(K=>K!==null),Qe(K=>K.length)),I),at(Pe(Zn(D,A,R,V),gt(([K,ee,{items:ce}])=>ce.length>0&&ee.height!==0&&K.height!==0),Qe(([K,ee,{items:ce},J])=>{const{top:ie,bottom:de}=q_(K,J,ee,ce);return[ie,de]}),dn(vd)),n);const Y=He(!1);at(Pe(r,It(Y),Qe(([K,ee])=>ee||K!==0)),Y);const re=Zr(Pe(ht(R),gt(({items:K})=>K.length>0),It(I,Y),gt(([{items:K},ee,ce])=>ce&&K[K.length-1].index===ee-1),Qe(([,K])=>K-1),dn())),le=Zr(Pe(ht(R),gt(({items:K})=>K.length>0&&K[0].index===0),Xs(0),dn())),oe=Zr(Pe(ht(R),It(F),gt(([{items:K},ee])=>K.length>0&&!ee),Qe(([{items:K}])=>({startIndex:K[0].index,endIndex:K[K.length-1].index})),dn(T8),Ga(0)));at(oe,g.scrollSeekRangeChanged),at(Pe(O,It(D,A,I,V),Qe(([K,ee,ce,J,ie])=>{const de=D8(K),{align:xe,behavior:we,offset:ve}=de;let fe=de.index;fe==="LAST"&&(fe=J-1),fe=qu(0,fe,Xv(J-1,fe));let Oe=_x(ee,ie,ce,fe);return xe==="end"?Oe=U_(Oe-ee.height+ce.height):xe==="center"&&(Oe=U_(Oe-ee.height/2+ce.height/2)),ve&&(Oe+=ve),{top:Oe,behavior:we}})),l);const q=Cr(Pe(R,Qe(K=>K.offsetBottom+K.bottom)),0);return at(Pe(b,Qe(K=>({width:K.visibleWidth,height:K.visibleHeight}))),D),{data:z,totalCount:I,viewportDimensions:D,itemDimensions:A,scrollTop:r,scrollHeight:$,overscan:e,scrollBy:s,scrollTo:l,scrollToIndex:O,smoothScrollTargetReached:i,windowViewportRect:b,windowScrollTo:j,useWindowScroll:C,customScrollParent:S,windowScrollContainerState:_,deviation:X,scrollContainerState:c,footerHeight:p,headerHeight:m,initialItemCount:M,gap:V,restoreStateFrom:G,...g,initialTopMostItemIndex:U,gridState:R,totalListHeight:q,...h,startReached:le,endReached:re,rangeChanged:oe,stateChanged:Q,propsReady:x,stateRestoreInProgress:F,...E}},mn(Xy,_r,Jd,$8,hl,Qy,ml));function q_(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=_x(e,t,n,r[0].index),l=_x(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:l}}function _x(e,t,n,r){const o=G8(e.width,n.width,t.column),s=mh(r/o),l=s*n.height+qu(0,s-1)*t.row;return l>0?l+t.row:l}function G8(e,t,n){return qu(1,mh((e+n)/(mh(t)+n)))}const poe=qt(()=>{const e=He(p=>`Item ${p}`),t=He({}),n=He(null),r=He("virtuoso-grid-item"),o=He("virtuoso-grid-list"),s=He(V8),l=He("div"),i=He(qc),c=(p,m=null)=>Cr(Pe(t,Qe(h=>h[p]),dn()),m);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:l,scrollerRef:i,FooterComponent:c("Footer"),HeaderComponent:c("Header"),ListComponent:c("List","div"),ItemComponent:c("Item","div"),ScrollerComponent:c("Scroller","div"),ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),moe=qt(([e,t])=>({...e,...t}),mn(foe,poe)),hoe=H.memo(function(){const t=bn("gridState"),n=bn("listClassName"),r=bn("itemClassName"),o=bn("itemContent"),s=bn("computeItemKey"),l=bn("isSeeking"),i=Xo("scrollHeight"),c=bn("ItemComponent"),p=bn("ListComponent"),m=bn("ScrollSeekPlaceholder"),h=bn("context"),g=Xo("itemDimensions"),x=Xo("gap"),y=bn("log"),b=bn("stateRestoreInProgress"),C=ii(S=>{const _=S.parentElement.parentElement.scrollHeight;i(_);const j=S.firstChild;if(j){const{width:E,height:I}=j.getBoundingClientRect();g({width:E,height:I})}x({row:X_("row-gap",getComputedStyle(S).rowGap,y),column:X_("column-gap",getComputedStyle(S).columnGap,y)})});return b?null:H.createElement(p,{ref:C,className:n,...Ar(p,h),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(S=>{const _=s(S.index,S.data,h);return l?H.createElement(m,{key:_,...Ar(m,h),index:S.index,height:t.itemHeight,width:t.itemWidth}):H.createElement(c,{...Ar(c,h),className:r,"data-index":S.index,key:_},o(S.index,S.data,h))}))}),goe=H.memo(function(){const t=bn("HeaderComponent"),n=Xo("headerHeight"),r=bn("headerFooterTag"),o=ii(l=>n(ol(l,"height"))),s=bn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Ar(t,s))):null}),voe=H.memo(function(){const t=bn("FooterComponent"),n=Xo("footerHeight"),r=bn("headerFooterTag"),o=ii(l=>n(ol(l,"height"))),s=bn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Ar(t,s))):null}),xoe=({children:e})=>{const t=H.useContext(H8),n=Xo("itemDimensions"),r=Xo("viewportDimensions"),o=ii(s=>{r(s.getBoundingClientRect())});return H.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),H.createElement("div",{style:Ig,ref:o},e)},boe=({children:e})=>{const t=H.useContext(H8),n=Xo("windowViewportRect"),r=Xo("itemDimensions"),o=bn("customScrollParent"),s=F8(n,o);return H.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),H.createElement("div",{ref:s,style:Ig},e)},yoe=H.memo(function({...t}){const n=bn("useWindowScroll"),r=bn("customScrollParent"),o=r||n?Soe:woe,s=r||n?boe:xoe;return H.createElement(o,{...t},H.createElement(s,null,H.createElement(goe,null),H.createElement(hoe,null),H.createElement(voe,null)))}),{Component:Coe,usePublisher:Xo,useEmitterValue:bn,useEmitter:K8}=w8(moe,{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",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},yoe),woe=W8({usePublisher:Xo,useEmitterValue:bn,useEmitter:K8}),Soe=U8({usePublisher:Xo,useEmitterValue:bn,useEmitter:K8});function X_(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Jr.WARN),t==="normal"?0:parseInt(t??"0",10)}const koe=Coe,_oe=e=>{const t=W(s=>s.gallery.galleryView),{data:n}=Xx(e),{data:r}=Qx(e),o=d.useMemo(()=>t==="images"?n==null?void 0:n.total:r==null?void 0:r.total,[t,r,n]);return{totalImages:n,totalAssets:r,currentViewTotal:o}},joe=({imageDTO:e})=>a.jsx(N,{sx:{pointerEvents:"none",flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,p:2,alignItems:"flex-start",gap:2},children:a.jsxs(As,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]})}),Ioe=d.memo(joe),Zy=({postUploadAction:e,isDisabled:t})=>{const n=W(c=>c.gallery.autoAddBoardId),[r]=lI(),o=d.useCallback(c=>{const p=c[0];p&&r({file:p,image_category:"user",is_intermediate:!1,postUploadAction:e??{type:"TOAST"},board_id:n==="none"?void 0:n})},[n,e,r]),{getRootProps:s,getInputProps:l,open:i}=sy({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:o,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:s,getUploadInputProps:l,openUploader:i}},Poe=ae(he,({generation:e})=>e.model,Ce),Pg=()=>{const e=te(),t=si(),{t:n}=Z(),r=W(Poe),o=d.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),s=d.useCallback(T=>{t({title:n("toast.parameterNotSet"),description:T,status:"warning",duration:2500,isClosable:!0})},[n,t]),l=d.useCallback(()=>{t({title:n("toast.parametersSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),i=d.useCallback(T=>{t({title:n("toast.parametersNotSet"),status:"warning",description:T,duration:2500,isClosable:!0})},[n,t]),c=d.useCallback((T,B,Y,re)=>{if(Qf(T)||Yf(B)||Su(Y)||tv(re)){Qf(T)&&e(Bu(T)),Yf(B)&&e(Hu(B)),Su(Y)&&e(Vu(Y)),Su(re)&&e(Wu(re)),o();return}s()},[e,o,s]),p=d.useCallback(T=>{if(!Qf(T)){s();return}e(Bu(T)),o()},[e,o,s]),m=d.useCallback(T=>{if(!Yf(T)){s();return}e(Hu(T)),o()},[e,o,s]),h=d.useCallback(T=>{if(!Su(T)){s();return}e(Vu(T)),o()},[e,o,s]),g=d.useCallback(T=>{if(!tv(T)){s();return}e(Wu(T)),o()},[e,o,s]),x=d.useCallback(T=>{if(!mw(T)){s();return}e(Jp(T)),o()},[e,o,s]),y=d.useCallback(T=>{if(!nv(T)){s();return}e(em(T)),o()},[e,o,s]),b=d.useCallback(T=>{if(!hw(T)){s();return}e(p1(T)),o()},[e,o,s]),C=d.useCallback(T=>{if(!rv(T)){s();return}e(m1(T)),o()},[e,o,s]),S=d.useCallback(T=>{if(!ov(T)){s();return}e(tm(T)),o()},[e,o,s]),_=d.useCallback(T=>{if(!gw(T)){s();return}e(Hl(T)),o()},[e,o,s]),j=d.useCallback(T=>{if(!vw(T)){s();return}e(Vl(T)),o()},[e,o,s]),E=d.useCallback(T=>{if(!xw(T)){s();return}e(nm(T)),o()},[e,o,s]),{data:I}=_d(void 0),M=d.useCallback(T=>{if(!vI(T.lora))return{lora:null,error:"Invalid LoRA model"};const{base_model:B,model_name:Y}=T.lora,re=I?FD.getSelectors().selectById(I,`${B}/lora/${Y}`):void 0;return re?(re==null?void 0:re.base_model)===(r==null?void 0:r.base_model)?{lora:re,error:null}:{lora:null,error:"LoRA incompatible with currently-selected model"}:{lora:null,error:"LoRA model is not installed"}},[I,r==null?void 0:r.base_model]),R=d.useCallback(T=>{const B=M(T);if(!B.lora){s(B.error);return}e(bw({...B.lora,weight:T.weight})),o()},[M,e,o,s]),{data:D}=Yx(void 0),A=d.useCallback(T=>{if(!rm(T.control_model))return{controlnet:null,error:"Invalid ControlNet model"};const{image:B,control_model:Y,control_weight:re,begin_step_percent:le,end_step_percent:oe,control_mode:q,resize_mode:K}=T,ee=D?xI.getSelectors().selectById(D,`${Y.base_model}/controlnet/${Y.model_name}`):void 0;if(!ee)return{controlnet:null,error:"ControlNet model is not installed"};if(!((ee==null?void 0:ee.base_model)===(r==null?void 0:r.base_model)))return{controlnet:null,error:"ControlNet incompatible with currently-selected model"};const J="none",ie=Sr.none.default;return{controlnet:{type:"controlnet",isEnabled:!0,model:ee,weight:typeof re=="number"?re:ku.weight,beginStepPct:le||ku.beginStepPct,endStepPct:oe||ku.endStepPct,controlMode:q||ku.controlMode,resizeMode:K||ku.resizeMode,controlImage:(B==null?void 0:B.image_name)||null,processedControlImage:(B==null?void 0:B.image_name)||null,processorType:J,processorNode:ie,shouldAutoConfig:!0,id:Js()},error:null}},[D,r==null?void 0:r.base_model]),O=d.useCallback(T=>{const B=A(T);if(!B.controlnet){s(B.error);return}e(Mi(B.controlnet)),o()},[A,e,o,s]),{data:$}=Zx(void 0),X=d.useCallback(T=>{if(!rm(T.t2i_adapter_model))return{controlnet:null,error:"Invalid ControlNet model"};const{image:B,t2i_adapter_model:Y,weight:re,begin_step_percent:le,end_step_percent:oe,resize_mode:q}=T,K=$?bI.getSelectors().selectById($,`${Y.base_model}/t2i_adapter/${Y.model_name}`):void 0;if(!K)return{controlnet:null,error:"ControlNet model is not installed"};if(!((K==null?void 0:K.base_model)===(r==null?void 0:r.base_model)))return{t2iAdapter:null,error:"ControlNet incompatible with currently-selected model"};const ce="none",J=Sr.none.default;return{t2iAdapter:{type:"t2i_adapter",isEnabled:!0,model:K,weight:typeof re=="number"?re:Zf.weight,beginStepPct:le||Zf.beginStepPct,endStepPct:oe||Zf.endStepPct,resizeMode:q||Zf.resizeMode,controlImage:(B==null?void 0:B.image_name)||null,processedControlImage:(B==null?void 0:B.image_name)||null,processorType:ce,processorNode:J,shouldAutoConfig:!0,id:Js()},error:null}},[r==null?void 0:r.base_model,$]),z=d.useCallback(T=>{const B=X(T);if(!B.t2iAdapter){s(B.error);return}e(Mi(B.t2iAdapter)),o()},[X,e,o,s]),{data:V}=Jx(void 0),Q=d.useCallback(T=>{if(!BD(T==null?void 0:T.ip_adapter_model))return{ipAdapter:null,error:"Invalid IP Adapter model"};const{image:B,ip_adapter_model:Y,weight:re,begin_step_percent:le,end_step_percent:oe}=T,q=V?yI.getSelectors().selectById(V,`${Y.base_model}/ip_adapter/${Y.model_name}`):void 0;return q?(q==null?void 0:q.base_model)===(r==null?void 0:r.base_model)?{ipAdapter:{id:Js(),type:"ip_adapter",isEnabled:!0,controlImage:(B==null?void 0:B.image_name)??null,model:q,weight:re??sv.weight,beginStepPct:le??sv.beginStepPct,endStepPct:oe??sv.endStepPct},error:null}:{ipAdapter:null,error:"IP Adapter incompatible with currently-selected model"}:{ipAdapter:null,error:"IP Adapter model is not installed"}},[V,r==null?void 0:r.base_model]),G=d.useCallback(T=>{const B=Q(T);if(!B.ipAdapter){s(B.error);return}e(Mi(B.ipAdapter)),o()},[Q,e,o,s]),F=d.useCallback(T=>{e(Sh(T))},[e]),U=d.useCallback(T=>{if(!T){i();return}const{cfg_scale:B,height:Y,model:re,positive_prompt:le,negative_prompt:oe,scheduler:q,seed:K,steps:ee,width:ce,strength:J,positive_style_prompt:ie,negative_style_prompt:de,refiner_model:xe,refiner_cfg_scale:we,refiner_steps:ve,refiner_scheduler:fe,refiner_positive_aesthetic_score:Oe,refiner_negative_aesthetic_score:je,refiner_start:$e,loras:st,controlnets:Ve,ipAdapters:Ct,t2iAdapters:Ye}=T;nv(B)&&e(em(B)),hw(re)&&e(p1(re)),Qf(le)&&e(Bu(le)),Yf(oe)&&e(Hu(oe)),rv(q)&&e(m1(q)),mw(K)&&e(Jp(K)),ov(ee)&&e(tm(ee)),gw(ce)&&e(Hl(ce)),vw(Y)&&e(Vl(Y)),xw(J)&&e(nm(J)),Su(ie)&&e(Vu(ie)),tv(de)&&e(Wu(de)),HD(xe)&&e(CI(xe)),ov(ve)&&e(h1(ve)),nv(we)&&e(g1(we)),rv(fe)&&e(wI(fe)),VD(Oe)&&e(v1(Oe)),WD(je)&&e(x1(je)),UD($e)&&e(b1($e)),e(GD()),st==null||st.forEach(Ke=>{const ge=M(Ke);ge.lora&&e(bw({...ge.lora,weight:Ke.weight}))}),e(uI()),Ve==null||Ve.forEach(Ke=>{const ge=A(Ke);ge.controlnet&&e(Mi(ge.controlnet))}),Ct==null||Ct.forEach(Ke=>{const ge=Q(Ke);ge.ipAdapter&&e(Mi(ge.ipAdapter))}),Ye==null||Ye.forEach(Ke=>{const ge=X(Ke);ge.t2iAdapter&&e(Mi(ge.t2iAdapter))}),l()},[e,l,i,M,A,Q,X]);return{recallBothPrompts:c,recallPositivePrompt:p,recallNegativePrompt:m,recallSDXLPositiveStylePrompt:h,recallSDXLNegativeStylePrompt:g,recallSeed:x,recallCfgScale:y,recallModel:b,recallScheduler:C,recallSteps:S,recallWidth:_,recallHeight:j,recallStrength:E,recallLoRA:R,recallControlNet:O,recallIPAdapter:G,recallT2IAdapter:z,recallAllParameters:U,sendToImageToImage:F}},q8=()=>{const e=si(),{t}=Z(),n=d.useMemo(()=>!!navigator.clipboard&&!!window.ClipboardItem,[]),r=d.useCallback(async o=>{n||e({title:t("toast.problemCopyingImage"),description:"Your browser doesn't support the Clipboard API.",status:"error",duration:2500,isClosable:!0});try{KD((async()=>{const l=await fetch(o);if(!l.ok)throw new Error("Problem retrieving image data");return await l.blob()})()),e({title:t("toast.imageCopied"),status:"success",duration:2500,isClosable:!0})}catch(s){e({title:t("toast.problemCopyingImage"),description:String(s),status:"error",duration:2500,isClosable:!0})}},[n,t,e]);return{isClipboardAPIAvailable:n,copyImageToClipboard:r}};function Eoe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"}}]})(e)}function Moe(e){return Te({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 256L28.5 28c2-16 15.6-28 31.8-28H228.9c15 0 27.1 12.1 27.1 27.1c0 3.2-.6 6.5-1.7 9.5L208 160H347.3c20.2 0 36.7 16.4 36.7 36.7c0 7.4-2.2 14.6-6.4 20.7l-192.2 281c-5.9 8.6-15.6 13.7-25.9 13.7h-2.9c-15.7 0-28.5-12.8-28.5-28.5c0-2.3 .3-4.6 .9-6.9L176 288H32c-17.7 0-32-14.3-32-32z"}}]})(e)}function Ooe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"}}]})(e)}function Jy(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.4 157.9c35.3-8.3 61.6-40 61.6-77.9c0-44.2-35.8-80-80-80c-43.4 0-78.7 34.5-80 77.5L136.2 151.1C121.7 136.8 101.9 128 80 128c-44.2 0-80 35.8-80 80s35.8 80 80 80c12.2 0 23.8-2.7 34.1-7.6L259.7 407.8c-2.4 7.6-3.7 15.8-3.7 24.2c0 44.2 35.8 80 80 80s80-35.8 80-80c0-27.7-14-52.1-35.4-66.4l37.8-207.7zM156.3 232.2c2.2-6.9 3.5-14.2 3.7-21.7l183.8-73.5c3.6 3.5 7.4 6.7 11.6 9.5L317.6 354.1c-5.5 1.3-10.8 3.1-15.8 5.5L156.3 232.2z"}}]})(e)}function Roe(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"}}]})(e)}function Doe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24H280c13.3 0 24-10.7 24-24s-10.7-24-24-24H136z"}}]})(e)}function Aoe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM184 296c0 13.3 10.7 24 24 24s24-10.7 24-24V232h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H232V120c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"}}]})(e)}function Toe(e){return Te({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 $oe(e){return Te({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 Noe(e){return Te({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 e2(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}}]})(e)}function t2(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}]})(e)}function X8(e){return Te({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 n2=e=>e.config;eb("gallery/requestedBoardImagesDeletion");const Loe=eb("gallery/sentImageToCanvas"),Q8=eb("gallery/sentImageToImg2Img"),zoe=e=>{const{imageDTO:t}=e,n=te(),{t:r}=Z(),o=si(),s=Dt("unifiedCanvas").isFeatureEnabled,{shouldFetchMetadataFromApi:l}=W(n2),i=og(tb),{metadata:c,workflow:p,isLoading:m}=nb({image:t,shouldFetchMetadataFromApi:l},{selectFromResult:z=>{var V,Q;return{isLoading:z.isFetching,metadata:(V=z==null?void 0:z.currentData)==null?void 0:V.metadata,workflow:(Q=z==null?void 0:z.currentData)==null?void 0:Q.workflow}}}),[h]=rb(),[g]=ob(),{isClipboardAPIAvailable:x,copyImageToClipboard:y}=q8(),b=d.useCallback(()=>{t&&n(kh([t]))},[n,t]),{recallBothPrompts:C,recallSeed:S,recallAllParameters:_}=Pg(),j=d.useCallback(()=>{C(c==null?void 0:c.positive_prompt,c==null?void 0:c.negative_prompt,c==null?void 0:c.positive_style_prompt,c==null?void 0:c.negative_style_prompt)},[c==null?void 0:c.negative_prompt,c==null?void 0:c.positive_prompt,c==null?void 0:c.positive_style_prompt,c==null?void 0:c.negative_style_prompt,C]),E=d.useCallback(()=>{S(c==null?void 0:c.seed)},[c==null?void 0:c.seed,S]),I=d.useCallback(()=>{p&&n(sb(p))},[n,p]),M=d.useCallback(()=>{n(Q8()),n(Sh(t))},[n,t]),R=d.useCallback(()=>{n(Loe()),qr.flushSync(()=>{n(Qs("unifiedCanvas"))}),n(SI(t)),o({title:r("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},[n,t,r,o]),D=d.useCallback(()=>{_(c)},[c,_]),A=d.useCallback(()=>{n(kI([t])),n(Kx(!0))},[n,t]),O=d.useCallback(()=>{y(t.image_url)},[y,t.image_url]),$=d.useCallback(()=>{t&&h({imageDTOs:[t]})},[h,t]),X=d.useCallback(()=>{t&&g({imageDTOs:[t]})},[g,t]);return a.jsxs(a.Fragment,{children:[a.jsx(Kt,{as:"a",href:t.image_url,target:"_blank",icon:a.jsx(wy,{}),children:r("common.openInNewTab")}),x&&a.jsx(Kt,{icon:a.jsx(Uc,{}),onClickCapture:O,children:r("parameters.copyImage")}),a.jsx(Kt,{as:"a",download:!0,href:t.image_url,target:"_blank",icon:a.jsx(Gc,{}),w:"100%",children:r("parameters.downloadImage")}),a.jsx(Kt,{icon:m?a.jsx(Dp,{}):a.jsx(Jy,{}),onClickCapture:I,isDisabled:m||!p,children:r("nodes.loadWorkflow")}),a.jsx(Kt,{icon:m?a.jsx(Dp,{}):a.jsx(jM,{}),onClickCapture:j,isDisabled:m||(c==null?void 0:c.positive_prompt)===void 0&&(c==null?void 0:c.negative_prompt)===void 0,children:r("parameters.usePrompt")}),a.jsx(Kt,{icon:m?a.jsx(Dp,{}):a.jsx(IM,{}),onClickCapture:E,isDisabled:m||(c==null?void 0:c.seed)===void 0,children:r("parameters.useSeed")}),a.jsx(Kt,{icon:m?a.jsx(Dp,{}):a.jsx(gM,{}),onClickCapture:D,isDisabled:m||!c,children:r("parameters.useAll")}),a.jsx(Kt,{icon:a.jsx(Jk,{}),onClickCapture:M,id:"send-to-img2img",children:r("parameters.sendToImg2Img")}),s&&a.jsx(Kt,{icon:a.jsx(Jk,{}),onClickCapture:R,id:"send-to-canvas",children:r("parameters.sendToUnifiedCanvas")}),a.jsx(Kt,{icon:a.jsx(CM,{}),onClickCapture:A,children:"Change Board"}),t.starred?a.jsx(Kt,{icon:i?i.off.icon:a.jsx(t2,{}),onClickCapture:X,children:i?i.off.text:"Unstar Image"}):a.jsx(Kt,{icon:i?i.on.icon:a.jsx(e2,{}),onClickCapture:$,children:i?i.on.text:"Star Image"}),a.jsx(Kt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Fr,{}),onClickCapture:b,children:r("gallery.deleteImage")})]})},Y8=d.memo(zoe),Dp=()=>a.jsx(N,{w:"14px",alignItems:"center",justifyContent:"center",children:a.jsx(fa,{size:"xs"})}),Foe=()=>{const{t:e}=Z(),t=te(),n=W(b=>b.gallery.selection),r=og(tb),o=Dt("bulkDownload").isFeatureEnabled,[s]=rb(),[l]=ob(),[i]=hI(),c=d.useCallback(()=>{t(kI(n)),t(Kx(!0))},[t,n]),p=d.useCallback(()=>{t(kh(n))},[t,n]),m=d.useCallback(()=>{s({imageDTOs:n})},[s,n]),h=d.useCallback(()=>{l({imageDTOs:n})},[l,n]),g=d.useCallback(async()=>{try{const b=await i({image_names:n.map(C=>C.image_name)}).unwrap();t(lt({title:e("gallery.preparingDownload"),status:"success",...b.response?{description:b.response}:{}}))}catch{t(lt({title:e("gallery.preparingDownloadFailed"),status:"error"}))}},[e,n,i,t]),x=d.useMemo(()=>n.every(b=>b.starred),[n]),y=d.useMemo(()=>n.every(b=>!b.starred),[n]);return a.jsxs(a.Fragment,{children:[x&&a.jsx(Kt,{icon:r?r.on.icon:a.jsx(e2,{}),onClickCapture:h,children:r?r.off.text:"Unstar All"}),(y||!x&&!y)&&a.jsx(Kt,{icon:r?r.on.icon:a.jsx(t2,{}),onClickCapture:m,children:r?r.on.text:"Star All"}),o&&a.jsx(Kt,{icon:a.jsx(Gc,{}),onClickCapture:g,children:e("gallery.downloadSelection")}),a.jsx(Kt,{icon:a.jsx(CM,{}),onClickCapture:c,children:"Change Board"}),a.jsx(Kt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Fr,{}),onClickCapture:p,children:"Delete Selection"})]})},Boe=d.memo(Foe),Hoe=ae([he],({gallery:e})=>({selectionCount:e.selection.length}),Ce),Voe=({imageDTO:e,children:t})=>{const{selectionCount:n}=W(Hoe),r=d.useCallback(o=>{o.preventDefault()},[]);return a.jsx(By,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>e?n>1?a.jsx(Gl,{sx:{visibility:"visible !important"},motionProps:bc,onContextMenu:r,children:a.jsx(Boe,{})}):a.jsx(Gl,{sx:{visibility:"visible !important"},motionProps:bc,onContextMenu:r,children:a.jsx(Y8,{imageDTO:e})}):null,children:t})},Woe=d.memo(Voe),Uoe=e=>{const{data:t,disabled:n,...r}=e,o=d.useRef(Js()),{attributes:s,listeners:l,setNodeRef:i}=Cne({id:o.current,disabled:n,data:t});return a.jsx(Ie,{ref:i,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,...s,...l,...r})},Goe=d.memo(Uoe),Koe=a.jsx(Tn,{as:mg,sx:{boxSize:16}}),qoe=a.jsx(Yn,{icon:Yl}),Xoe=e=>{const{imageDTO:t,onError:n,onClick:r,withMetadataOverlay:o=!1,isDropDisabled:s=!1,isDragDisabled:l=!1,isUploadDisabled:i=!1,minSize:c=24,postUploadAction:p,imageSx:m,fitContainer:h=!1,droppableData:g,draggableData:x,dropLabel:y,isSelected:b=!1,thumbnail:C=!1,noContentFallback:S=qoe,uploadElement:_=Koe,useThumbailFallback:j,withHoverOverlay:E=!1,children:I,onMouseOver:M,onMouseOut:R,dataTestId:D}=e,{colorMode:A}=ha(),[O,$]=d.useState(!1),X=d.useCallback(F=>{M&&M(F),$(!0)},[M]),z=d.useCallback(F=>{R&&R(F),$(!1)},[R]),{getUploadButtonProps:V,getUploadInputProps:Q}=Zy({postUploadAction:p,isDisabled:i}),G=i?{}:{cursor:"pointer",bg:Ae("base.200","base.700")(A),_hover:{bg:Ae("base.300","base.650")(A),color:Ae("base.500","base.300")(A)}};return a.jsx(Woe,{imageDTO:t,children:F=>a.jsxs(N,{ref:F,onMouseOver:X,onMouseOut:z,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative",minW:c||void 0,minH:c||void 0,userSelect:"none",cursor:l||!t?"default":"pointer"},children:[t&&a.jsxs(N,{sx:{w:"full",h:"full",position:h?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[a.jsx(ga,{src:C?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallbackSrc:j?t.thumbnail_url:void 0,fallback:j?void 0:a.jsx(Qne,{image:t}),onError:n,draggable:!1,sx:{w:t.width,objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",...m},"data-testid":D}),o&&a.jsx(Ioe,{imageDTO:t}),a.jsx(Fy,{isSelected:b,isHovered:E?O:!1})]}),!t&&!i&&a.jsx(a.Fragment,{children:a.jsxs(N,{sx:{minH:c,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:Ae("base.500","base.500")(A),...G},...V(),children:[a.jsx("input",{...Q()}),_]})}),!t&&i&&S,t&&!l&&a.jsx(Goe,{data:x,disabled:l||!t,onClick:r}),I,!s&&a.jsx(zy,{data:g,disabled:s,dropLabel:y})]})})},sl=d.memo(Xoe),Qoe=()=>a.jsx(Yh,{sx:{position:"relative",height:"full",width:"full","::before":{content:"''",display:"block",pt:"100%"}},children:a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,height:"full",width:"full"}})}),Yoe=d.memo(Qoe),Zoe=ae([he,ab],({gallery:e},t)=>{const n=e.selection;return{queryArgs:t,selection:n}},Ce),Joe=e=>{const t=te(),{queryArgs:n,selection:r}=W(Zoe),{imageDTOs:o}=_I(n,{selectFromResult:p=>({imageDTOs:p.data?qD.selectAll(p.data):[]})}),s=Dt("multiselect").isFeatureEnabled,l=d.useCallback(p=>{var m;if(e){if(!s){t(_u([e]));return}if(p.shiftKey){const h=e.image_name,g=(m=r[r.length-1])==null?void 0:m.image_name,x=o.findIndex(b=>b.image_name===g),y=o.findIndex(b=>b.image_name===h);if(x>-1&&y>-1){const b=Math.min(x,y),C=Math.max(x,y),S=o.slice(b,C+1);t(_u(r.concat(S)))}}else p.ctrlKey||p.metaKey?r.some(h=>h.image_name===e.image_name)&&r.length>1?t(_u(r.filter(h=>h.image_name!==e.image_name))):t(_u(r.concat(e))):t(_u([e]))}},[t,e,o,r,s]),i=d.useMemo(()=>e?r.some(p=>p.image_name===e.image_name):!1,[e,r]),c=d.useMemo(()=>r.length,[r.length]);return{selection:r,selectionCount:c,isSelected:i,handleClick:l}},ese=e=>{const{onClick:t,tooltip:n,icon:r,styleOverrides:o}=e,s=aa("drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-600))","drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-800))");return a.jsx(Be,{onClick:t,"aria-label":n,tooltip:n,icon:r,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:s},...o},"data-testid":n})},xc=d.memo(ese),tse=e=>{const t=te(),{imageName:n}=e,{currentData:r}=wo(n),o=W(M=>M.hotkeys.shift),{t:s}=Z(),{handleClick:l,isSelected:i,selection:c,selectionCount:p}=Joe(r),m=og(tb),h=d.useCallback(M=>{M.stopPropagation(),r&&t(kh([r]))},[t,r]),g=d.useMemo(()=>{if(p>1)return{id:"gallery-image",payloadType:"IMAGE_DTOS",payload:{imageDTOs:c}};if(r)return{id:"gallery-image",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r,c,p]),[x]=rb(),[y]=ob(),b=d.useCallback(()=>{r&&(r.starred&&y({imageDTOs:[r]}),r.starred||x({imageDTOs:[r]}))},[x,y,r]),[C,S]=d.useState(!1),_=d.useCallback(()=>{S(!0)},[]),j=d.useCallback(()=>{S(!1)},[]),E=d.useMemo(()=>{if(r!=null&&r.starred)return m?m.on.icon:a.jsx(t2,{size:"20"});if(!(r!=null&&r.starred)&&C)return m?m.off.icon:a.jsx(e2,{size:"20"})},[r==null?void 0:r.starred,C,m]),I=d.useMemo(()=>r!=null&&r.starred?m?m.off.text:"Unstar":r!=null&&r.starred?"":m?m.on.text:"Star",[r==null?void 0:r.starred,m]);return r?a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none"},"data-testid":`image-${r.image_name}`,children:a.jsx(N,{userSelect:"none",sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1"},children:a.jsx(sl,{onClick:l,imageDTO:r,draggableData:g,isSelected:i,minSize:0,imageSx:{w:"full",h:"full"},isDropDisabled:!0,isUploadDisabled:!0,thumbnail:!0,withHoverOverlay:!0,onMouseOver:_,onMouseOut:j,children:a.jsxs(a.Fragment,{children:[a.jsx(xc,{onClick:b,icon:E,tooltip:I}),C&&o&&a.jsx(xc,{onClick:h,icon:a.jsx(Fr,{}),tooltip:s("gallery.deleteImage"),styleOverrides:{bottom:2,top:"auto"}})]})})})}):a.jsx(Yoe,{})},nse=d.memo(tse),rse=_e((e,t)=>a.jsx(Ie,{className:"item-container",ref:t,p:1.5,"data-testid":"image-item-container",children:e.children})),ose=d.memo(rse),sse=_e((e,t)=>{const n=W(r=>r.gallery.galleryImageMinimumWidth);return a.jsx(el,{...e,className:"list-container",ref:t,sx:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr));`},"data-testid":"image-list-container",children:e.children})}),ase=d.memo(sse),lse={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},ise=()=>{const{t:e}=Z(),t=d.useRef(null),[n,r]=d.useState(null),[o,s]=Ly(lse),l=W(C=>C.gallery.selectedBoardId),{currentViewTotal:i}=_oe(l),c=W(ab),{currentData:p,isFetching:m,isSuccess:h,isError:g}=_I(c),[x]=jI(),y=d.useMemo(()=>!p||!i?!1:p.ids.length<i,[p,i]),b=d.useCallback(()=>{y&&x({...c,offset:(p==null?void 0:p.ids.length)??0,limit:II})},[y,x,c,p==null?void 0:p.ids.length]);return d.useEffect(()=>{const{current:C}=t;return n&&C&&o({target:C,elements:{viewport:n}}),()=>{var S;return(S=s())==null?void 0:S.destroy()}},[n,o,s]),p?h&&(p==null?void 0:p.ids.length)===0?a.jsx(N,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Yn,{label:e("gallery.noImagesInGallery"),icon:Yl})}):h&&p?a.jsxs(a.Fragment,{children:[a.jsx(Ie,{ref:t,"data-overlayscrollbars":"",h:"100%",children:a.jsx(koe,{style:{height:"100%"},data:p.ids,endReached:b,components:{Item:ose,List:ase},scrollerRef:r,itemContent:(C,S)=>a.jsx(nse,{imageName:S},S)})}),a.jsx(ot,{onClick:b,isDisabled:!y,isLoading:m,loadingText:e("gallery.loading"),flexShrink:0,children:`Load More (${p.ids.length} of ${i})`})]}):g?a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsx(Yn,{label:e("gallery.unableToLoad"),icon:QJ})}):null:a.jsx(N,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Yn,{label:e("gallery.loading"),icon:Yl})})},cse=d.memo(ise),use=ae([he],e=>{const{galleryView:t}=e.gallery;return{galleryView:t}},Ce),dse=()=>{const{t:e}=Z(),t=d.useRef(null),n=d.useRef(null),{galleryView:r}=W(use),o=te(),{isOpen:s,onToggle:l}=Lr({defaultIsOpen:!0}),i=d.useCallback(()=>{o(yw("images"))},[o]),c=d.useCallback(()=>{o(yw("assets"))},[o]);return a.jsxs(C3,{layerStyle:"first",sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base",p:2},children:[a.jsxs(Ie,{sx:{w:"full"},children:[a.jsxs(N,{ref:t,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[a.jsx(Fne,{isOpen:s,onToggle:l}),a.jsx(Xne,{})]}),a.jsx(Ie,{children:a.jsx(Nne,{isOpen:s})})]}),a.jsxs(N,{ref:n,direction:"column",gap:2,h:"full",w:"full",children:[a.jsx(N,{sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:a.jsx(ri,{index:r==="images"?0:1,variant:"unstyled",size:"sm",sx:{w:"full"},children:a.jsx(oi,{children:a.jsxs(Ht,{isAttached:!0,sx:{w:"full"},children:[a.jsx(yr,{as:ot,size:"sm",isChecked:r==="images",onClick:i,sx:{w:"full"},leftIcon:a.jsx(oee,{}),"data-testid":"images-tab",children:e("gallery.images")}),a.jsx(yr,{as:ot,size:"sm",isChecked:r==="assets",onClick:c,sx:{w:"full"},leftIcon:a.jsx(gee,{}),"data-testid":"assets-tab",children:e("gallery.assets")})]})})})}),a.jsx(cse,{})]})]})},fse=d.memo(dse),pse=()=>{const e=W(p=>p.system.isConnected),{data:t}=va(),[n,{isLoading:r}]=lb(),o=te(),{t:s}=Z(),l=d.useMemo(()=>t==null?void 0:t.queue.item_id,[t==null?void 0:t.queue.item_id]),i=d.useCallback(async()=>{if(l)try{await n(l).unwrap(),o(lt({title:s("queue.cancelSucceeded"),status:"success"}))}catch{o(lt({title:s("queue.cancelFailed"),status:"error"}))}},[l,o,s,n]),c=d.useMemo(()=>!e||xb(l),[e,l]);return{cancelQueueItem:i,isLoading:r,currentQueueItemId:l,isDisabled:c}},mse=({label:e,tooltip:t,icon:n,onClick:r,isDisabled:o,colorScheme:s,asIconButton:l,isLoading:i,loadingText:c,sx:p})=>l?a.jsx(Be,{"aria-label":e,tooltip:t,icon:n,onClick:r,isDisabled:o,colorScheme:s,isLoading:i,sx:p,"data-testid":e}):a.jsx(ot,{"aria-label":e,tooltip:t,leftIcon:n,onClick:r,isDisabled:o,colorScheme:s,isLoading:i,loadingText:c??e,flexGrow:1,sx:p,"data-testid":e,children:e}),ui=d.memo(mse),hse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{cancelQueueItem:r,isLoading:o,isDisabled:s}=pse();return a.jsx(ui,{isDisabled:s,isLoading:o,asIconButton:e,label:n("queue.cancel"),tooltip:n("queue.cancelTooltip"),icon:a.jsx(Ec,{}),onClick:r,colorScheme:"error",sx:t})},Z8=d.memo(hse),gse=()=>{const{t:e}=Z(),t=te(),{data:n}=va(),r=W(c=>c.system.isConnected),[o,{isLoading:s}]=PI({fixedCacheKey:"clearQueue"}),l=d.useCallback(async()=>{if(n!=null&&n.queue.total)try{await o().unwrap(),t(lt({title:e("queue.clearSucceeded"),status:"success"})),t(ib(void 0)),t(cb(void 0))}catch{t(lt({title:e("queue.clearFailed"),status:"error"}))}},[n==null?void 0:n.queue.total,o,t,e]),i=d.useMemo(()=>!r||!(n!=null&&n.queue.total),[r,n==null?void 0:n.queue.total]);return{clearQueue:l,isLoading:s,queueStatus:n,isDisabled:i}},vse=_e((e,t)=>{const{t:n}=Z(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:l,children:i,title:c,triggerComponent:p}=e,{isOpen:m,onOpen:h,onClose:g}=Lr(),x=d.useRef(null),y=()=>{o(),g()},b=()=>{l&&l(),g()};return a.jsxs(a.Fragment,{children:[d.cloneElement(p,{onClick:h,ref:t}),a.jsx(zd,{isOpen:m,leastDestructiveRef:x,onClose:g,isCentered:!0,children:a.jsx(Zo,{children:a.jsxs(Fd,{children:[a.jsx(Yo,{fontSize:"lg",fontWeight:"bold",children:c}),a.jsx(Jo,{children:i}),a.jsxs(ks,{children:[a.jsx(ot,{ref:x,onClick:b,children:s}),a.jsx(ot,{colorScheme:"error",onClick:y,ml:3,children:r})]})]})})})]})}),Eg=d.memo(vse),xse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{clearQueue:r,isLoading:o,isDisabled:s}=gse();return a.jsxs(Eg,{title:n("queue.clearTooltip"),acceptCallback:r,acceptButtonText:n("queue.clear"),triggerComponent:a.jsx(ui,{isDisabled:s,isLoading:o,asIconButton:e,label:n("queue.clear"),tooltip:n("queue.clearTooltip"),icon:a.jsx(Fr,{}),colorScheme:"error",sx:t}),children:[a.jsx(be,{children:n("queue.clearQueueAlertDialog")}),a.jsx("br",{}),a.jsx(be,{children:n("queue.clearQueueAlertDialog2")})]})},r2=d.memo(xse),bse=()=>{const e=te(),{t}=Z(),n=W(p=>p.system.isConnected),{data:r}=va(),[o,{isLoading:s}]=EI({fixedCacheKey:"pauseProcessor"}),l=d.useMemo(()=>!!(r!=null&&r.processor.is_started),[r==null?void 0:r.processor.is_started]),i=d.useCallback(async()=>{if(l)try{await o().unwrap(),e(lt({title:t("queue.pauseSucceeded"),status:"success"}))}catch{e(lt({title:t("queue.pauseFailed"),status:"error"}))}},[l,o,e,t]),c=d.useMemo(()=>!n||!l,[n,l]);return{pauseProcessor:i,isLoading:s,isStarted:l,isDisabled:c}},yse=({asIconButton:e})=>{const{t}=Z(),{pauseProcessor:n,isLoading:r,isDisabled:o}=bse();return a.jsx(ui,{asIconButton:e,label:t("queue.pause"),tooltip:t("queue.pauseTooltip"),isDisabled:o,isLoading:r,icon:a.jsx(uee,{}),onClick:n,colorScheme:"gold"})},J8=d.memo(yse),Cse=ae([he,er],({controlAdapters:e,generation:t,system:n,nodes:r,dynamicPrompts:o},s)=>{const{initialImage:l,model:i}=t,{isConnected:c}=n,p=[];return c||p.push(bt.t("parameters.invoke.systemDisconnected")),s==="img2img"&&!l&&p.push(bt.t("parameters.invoke.noInitialImageSelected")),s==="nodes"?r.shouldValidateGraph&&(r.nodes.length||p.push(bt.t("parameters.invoke.noNodesInGraph")),r.nodes.forEach(m=>{if(!Mn(m))return;const h=r.nodeTemplates[m.data.type];if(!h){p.push(bt.t("parameters.invoke.missingNodeTemplate"));return}const g=XD([m],r.edges);Un(m.data.inputs,x=>{const y=h.inputs[x.name],b=g.some(C=>C.target===m.id&&C.targetHandle===x.name);if(!y){p.push(bt.t("parameters.invoke.missingFieldTemplate"));return}if(y.required&&x.value===void 0&&!b){p.push(bt.t("parameters.invoke.missingInputForField",{nodeLabel:m.data.label||h.title,fieldLabel:x.label||y.title}));return}})})):(o.prompts.length===0&&p.push(bt.t("parameters.invoke.noPrompts")),i||p.push(bt.t("parameters.invoke.noModelSelected")),QD(e).forEach((m,h)=>{m.isEnabled&&(m.model?m.model.base_model!==(i==null?void 0:i.base_model)&&p.push(bt.t("parameters.invoke.incompatibleBaseModelForControlAdapter",{number:h+1})):p.push(bt.t("parameters.invoke.noModelForControlAdapter",{number:h+1})),(!m.controlImage||Nc(m)&&!m.processedControlImage&&m.processorType!=="none")&&p.push(bt.t("parameters.invoke.noControlImageForControlAdapter",{number:h+1})))})),{isReady:!p.length,reasons:p}},Ce),o2=()=>{const{isReady:e,reasons:t}=W(Cse);return{isReady:e,reasons:t}},eO=()=>{const e=te(),t=W(er),{isReady:n}=o2(),[r,{isLoading:o}]=_h({fixedCacheKey:"enqueueBatch"}),s=d.useMemo(()=>!n,[n]);return{queueBack:d.useCallback(()=>{s||(e(ub()),e(MI({tabName:t,prepend:!1})))},[e,s,t]),isLoading:o,isDisabled:s}},wse=ae([he],({gallery:e})=>{const{autoAddBoardId:t}=e;return{autoAddBoardId:t}},Ce),Sse=({prepend:e=!1})=>{const{t}=Z(),{isReady:n,reasons:r}=o2(),{autoAddBoardId:o}=W(wse),s=wg(o),[l,{isLoading:i}]=_h({fixedCacheKey:"enqueueBatch"}),c=d.useMemo(()=>t(i?"queue.enqueueing":n?e?"queue.queueFront":"queue.queueBack":"queue.notReady"),[i,n,e,t]);return a.jsxs(N,{flexDir:"column",gap:1,children:[a.jsx(be,{fontWeight:600,children:c}),r.length>0&&a.jsx(Td,{children:r.map((p,m)=>a.jsx(go,{children:a.jsx(be,{fontWeight:400,children:p})},`${p}.${m}`))}),a.jsx(nO,{}),a.jsxs(be,{fontWeight:400,fontStyle:"oblique 10deg",children:[t("parameters.invoke.addingImagesTo")," ",a.jsx(be,{as:"span",fontWeight:600,children:s||t("boards.uncategorized")})]})]})},tO=d.memo(Sse),nO=d.memo(()=>a.jsx(Jn,{opacity:.2,borderColor:"base.50",_dark:{borderColor:"base.900"}}));nO.displayName="StyledDivider";const kse=()=>a.jsx(Ie,{pos:"relative",w:4,h:4,children:a.jsx(ga,{src:qx,alt:"invoke-ai-logo",pos:"absolute",top:-.5,insetInlineStart:-.5,w:5,h:5,minW:5,minH:5,filter:"saturate(0)"})}),_se=d.memo(kse),jse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{queueBack:r,isLoading:o,isDisabled:s}=eO();return a.jsx(ui,{asIconButton:e,colorScheme:"accent",label:n("parameters.invoke.invoke"),isDisabled:s,isLoading:o,onClick:r,tooltip:a.jsx(tO,{}),sx:t,icon:e?a.jsx(_se,{}):void 0})},rO=d.memo(jse),oO=()=>{const e=te(),t=W(er),{isReady:n}=o2(),[r,{isLoading:o}]=_h({fixedCacheKey:"enqueueBatch"}),s=Dt("prependQueue").isFeatureEnabled,l=d.useMemo(()=>!n||!s,[n,s]);return{queueFront:d.useCallback(()=>{l||(e(ub()),e(MI({tabName:t,prepend:!0})))},[e,l,t]),isLoading:o,isDisabled:l}},Ise=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{queueFront:r,isLoading:o,isDisabled:s}=oO();return a.jsx(ui,{asIconButton:e,colorScheme:"base",label:n("queue.queueFront"),isDisabled:s,isLoading:o,onClick:r,tooltip:a.jsx(tO,{prepend:!0}),icon:a.jsx(Moe,{}),sx:t})},Pse=d.memo(Ise),Ese=()=>{const e=te(),t=W(p=>p.system.isConnected),{data:n}=va(),{t:r}=Z(),[o,{isLoading:s}]=OI({fixedCacheKey:"resumeProcessor"}),l=d.useMemo(()=>!!(n!=null&&n.processor.is_started),[n==null?void 0:n.processor.is_started]),i=d.useCallback(async()=>{if(!l)try{await o().unwrap(),e(lt({title:r("queue.resumeSucceeded"),status:"success"}))}catch{e(lt({title:r("queue.resumeFailed"),status:"error"}))}},[l,o,e,r]),c=d.useMemo(()=>!t||l,[t,l]);return{resumeProcessor:i,isLoading:s,isStarted:l,isDisabled:c}},Mse=({asIconButton:e})=>{const{t}=Z(),{resumeProcessor:n,isLoading:r,isDisabled:o}=Ese();return a.jsx(ui,{asIconButton:e,label:t("queue.resume"),tooltip:t("queue.resumeTooltip"),isDisabled:o,isLoading:r,icon:a.jsx(dee,{}),onClick:n,colorScheme:"green"})},sO=d.memo(Mse),Ose=ae(he,({system:e})=>{var t;return{isConnected:e.isConnected,hasSteps:!!e.denoiseProgress,value:(((t=e.denoiseProgress)==null?void 0:t.percentage)??0)*100}},Ce),Rse=()=>{const{t:e}=Z(),{data:t}=va(),{hasSteps:n,value:r,isConnected:o}=W(Ose);return a.jsx(eP,{value:r,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:o&&!!(t!=null&&t.queue.in_progress)&&!n,h:"full",w:"full",borderRadius:2,colorScheme:"accent"})},Dse=d.memo(Rse),Ase=()=>{const e=Dt("pauseQueue").isFeatureEnabled,t=Dt("resumeQueue").isFeatureEnabled,n=Dt("prependQueue").isFeatureEnabled;return a.jsxs(N,{layerStyle:"first",sx:{w:"full",position:"relative",borderRadius:"base",p:2,gap:2,flexDir:"column"},children:[a.jsxs(N,{gap:2,w:"full",children:[a.jsxs(Ht,{isAttached:!0,flexGrow:2,children:[a.jsx(rO,{}),n?a.jsx(Pse,{asIconButton:!0}):a.jsx(a.Fragment,{}),a.jsx(Z8,{asIconButton:!0})]}),a.jsxs(Ht,{isAttached:!0,children:[t?a.jsx(sO,{asIconButton:!0}):a.jsx(a.Fragment,{}),e?a.jsx(J8,{asIconButton:!0}):a.jsx(a.Fragment,{})]}),a.jsx(r2,{asIconButton:!0})]}),a.jsx(N,{h:3,w:"full",children:a.jsx(Dse,{})}),a.jsx(lO,{})]})},aO=d.memo(Ase),lO=d.memo(()=>{const{t:e}=Z(),t=te(),{hasItems:n,pending:r}=va(void 0,{selectFromResult:({data:s})=>{if(!s)return{hasItems:!1,pending:0};const{pending:l,in_progress:i}=s.queue;return{hasItems:l+i>0,pending:l}}}),o=d.useCallback(()=>{t(Qs("queue"))},[t]);return a.jsxs(N,{justifyContent:"space-between",alignItems:"center",pe:1,"data-testid":"queue-count",children:[a.jsx(ba,{}),a.jsx(Ja,{onClick:o,size:"sm",variant:"link",fontWeight:400,opacity:.7,fontStyle:"oblique 10deg",children:n?e("queue.queuedCount",{pending:r}):e("queue.queueEmpty")})]})});lO.displayName="QueueCounts";const{createElement:Oc,createContext:Tse,forwardRef:iO,useCallback:Ks,useContext:cO,useEffect:sa,useImperativeHandle:uO,useLayoutEffect:$se,useMemo:Nse,useRef:Kr,useState:Xu}=Gx,Q_=Gx["useId".toString()],Qu=$se,Lse=typeof Q_=="function"?Q_:()=>null;let zse=0;function s2(e=null){const t=Lse(),n=Kr(e||t||null);return n.current===null&&(n.current=""+zse++),n.current}const Mg=Tse(null);Mg.displayName="PanelGroupContext";function dO({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:l=null,maxSize:i=null,minSize:c,onCollapse:p=null,onResize:m=null,order:h=null,style:g={},tagName:x="div"}){const y=cO(Mg);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const b=s2(l),{collapsePanel:C,expandPanel:S,getPanelSize:_,getPanelStyle:j,registerPanel:E,resizePanel:I,units:M,unregisterPanel:R}=y;c==null&&(M==="percentages"?c=10:c=0);const D=Kr({onCollapse:p,onResize:m});sa(()=>{D.current.onCollapse=p,D.current.onResize=m});const A=j(b,o),O=Kr({size:Y_(A)}),$=Kr({callbacksRef:D,collapsedSize:n,collapsible:r,defaultSize:o,id:b,idWasAutoGenerated:l==null,maxSize:i,minSize:c,order:h});return Qu(()=>{O.current.size=Y_(A),$.current.callbacksRef=D,$.current.collapsedSize=n,$.current.collapsible=r,$.current.defaultSize=o,$.current.id=b,$.current.idWasAutoGenerated=l==null,$.current.maxSize=i,$.current.minSize=c,$.current.order=h}),Qu(()=>(E(b,$),()=>{R(b)}),[h,b,E,R]),uO(s,()=>({collapse:()=>C(b),expand:()=>S(b),getCollapsed(){return O.current.size===0},getId(){return b},getSize(X){return _(b,X)},resize:(X,z)=>I(b,X,z)}),[C,S,_,b,I]),Oc(x,{children:e,className:t,"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-id":b,"data-panel-size":parseFloat(""+A.flexGrow).toFixed(1),id:`data-panel-id-${b}`,style:{...A,...g}})}const Ya=iO((e,t)=>Oc(dO,{...e,forwardedRef:t}));dO.displayName="Panel";Ya.displayName="forwardRef(Panel)";function Y_(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const ei=10;function Lu(e,t,n,r,o,s,l,i){const{id:c,panels:p,units:m}=t,h=m==="pixels"?Ha(c):NaN,{sizes:g}=i||{},x=g||s,y=Dr(p),b=x.concat();let C=0;{const j=o<0?r:n,E=y.findIndex(D=>D.current.id===j),I=y[E],M=x[E],R=jx(m,h,I,M,M+Math.abs(o),e);if(M===R)return x;R===0&&M>0&&l.set(j,M),o=o<0?M-R:R-M}let S=o<0?n:r,_=y.findIndex(j=>j.current.id===S);for(;;){const j=y[_],E=x[_],I=Math.abs(o)-Math.abs(C),M=jx(m,h,j,E,E-I,e);if(E!==M&&(M===0&&E>0&&l.set(j.current.id,E),C+=E-M,b[_]=M,C.toPrecision(ei).localeCompare(Math.abs(o).toPrecision(ei),void 0,{numeric:!0})>=0))break;if(o<0){if(--_<0)break}else if(++_>=y.length)break}return C===0?x:(S=o<0?r:n,_=y.findIndex(j=>j.current.id===S),b[_]=x[_]+C,b)}function Bi(e,t,n){t.forEach((r,o)=>{const s=e[o];if(!s)return;const{callbacksRef:l,collapsedSize:i,collapsible:c,id:p}=s.current,m=n[p];if(m!==r){n[p]=r;const{onCollapse:h,onResize:g}=l.current;g&&g(r,m),c&&h&&((m==null||m===i)&&r!==i?h(!1):m!==i&&r===i&&h(!0))}})}function Fse({groupId:e,panels:t,units:n}){const r=n==="pixels"?Ha(e):NaN,o=Dr(t),s=Array(o.length);let l=0,i=100;for(let c=0;c<o.length;c++){const p=o[c],{defaultSize:m}=p.current;m!=null&&(l++,s[c]=n==="pixels"?m/r*100:m,i-=s[c])}for(let c=0;c<o.length;c++){const p=o[c];let{defaultSize:m,id:h,maxSize:g,minSize:x}=p.current;if(m!=null)continue;n==="pixels"&&(x=x/r*100,g!=null&&(g=g/r*100));const y=o.length-l,b=Math.min(g??100,Math.max(x,i/y));s[c]=b,l++,i-=b}if(i!==0)for(let c=0;c<o.length;c++){const p=o[c];let{maxSize:m,minSize:h}=p.current;n==="pixels"&&(h=h/r*100,m!=null&&(m=m/r*100));const g=Math.min(m??100,Math.max(h,s[c]+i));if(g!==s[c]&&(i-=g-s[c],s[c]=g,Math.abs(i).toFixed(3)==="0.000"))break}return Math.abs(i).toFixed(3),s}function Qv(e,t){if(t.length<2)return[null,null];const n=t.findIndex(l=>l.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 Ha(e){const t=xd(e);if(t==null)return NaN;const n=t.getAttribute("data-panel-group-direction"),r=a2(e);return n==="horizontal"?t.offsetWidth-r.reduce((o,s)=>o+s.offsetWidth,0):t.offsetHeight-r.reduce((o,s)=>o+s.offsetHeight,0)}function fO(e,t,n){if(e.size===1)return"100";const o=Dr(e).findIndex(l=>l.current.id===t),s=n[o];return s==null?"0":s.toPrecision(ei)}function Bse(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function xd(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function Og(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Hse(e){return pO().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function pO(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function a2(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function l2(e,t,n){var c,p,m,h;const r=Og(t),o=a2(e),s=r?o.indexOf(r):-1,l=((p=(c=n[s])==null?void 0:c.current)==null?void 0:p.id)??null,i=((h=(m=n[s+1])==null?void 0:m.current)==null?void 0:h.id)??null;return[l,i]}function Dr(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 jx(e,t,n,r,o,s=null){var m;let{collapsedSize:l,collapsible:i,maxSize:c,minSize:p}=n.current;if(e==="pixels"&&(l=l/t*100,c!=null&&(c=c/t*100),p=p/t*100),i){if(r>l){if(o<=p/2+l)return l}else if(!((m=s==null?void 0:s.type)==null?void 0:m.startsWith("key"))&&o<p)return l}return Math.min(c??100,Math.max(p,o))}function Vse(e,t){const{collapsible:n,defaultSize:r,maxSize:o,minSize:s}=t.current;(s<0||e==="percentages"&&s>100)&&(t.current.minSize=0),o!=null&&(o<0||e==="percentages"&&o>100)&&(t.current.maxSize=null),r!==null&&(r<0||e==="percentages"&&r>100?t.current.defaultSize=null:r<s&&!n?t.current.defaultSize=s:o!=null&&r>o&&(t.current.defaultSize=o))}function Yv({groupId:e,panels:t,nextSizes:n,prevSizes:r,units:o}){n=[...n];const s=Dr(t),l=o==="pixels"?Ha(e):NaN;let i=0;for(let c=0;c<s.length;c++){const p=s[c],m=r[c],h=n[c],g=jx(o,l,p,m,h);h!=g&&(i+=h-g,n[c]=g)}if(i.toFixed(3)!=="0.000")for(let c=0;c<s.length;c++){const p=s[c];let{maxSize:m,minSize:h}=p.current;o==="pixels"&&(h=h/l*100,m!=null&&(m=m/l*100));const g=Math.min(m??100,Math.max(h,n[c]+i));if(g!==n[c]&&(i-=g-n[c],n[c]=g,Math.abs(i).toFixed(3)==="0.000"))break}return i.toFixed(3),n}function mO(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function Wse({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){sa(()=>{const{direction:l,panels:i}=e.current,c=xd(t);mO(c!=null,`No group found for id "${t}"`);const{height:p,width:m}=c.getBoundingClientRect(),g=a2(t).map(x=>{const y=x.getAttribute("data-panel-resize-handle-id"),b=Dr(i),[C,S]=l2(t,y,b);if(C==null||S==null)return()=>{};let _=0,j=100,E=0,I=0;b.forEach($=>{const{id:X,maxSize:z,minSize:V}=$.current;X===C?(_=V,j=z??100):(E+=V,I+=z??100)});const M=Math.min(j,100-E),R=Math.max(_,(b.length-1)*100-I),D=fO(i,C,o);x.setAttribute("aria-valuemax",""+Math.round(M)),x.setAttribute("aria-valuemin",""+Math.round(R)),x.setAttribute("aria-valuenow",""+Math.round(parseInt(D)));const A=$=>{if(!$.defaultPrevented)switch($.key){case"Enter":{$.preventDefault();const X=b.findIndex(z=>z.current.id===C);if(X>=0){const z=b[X],V=o[X];if(V!=null){let Q=0;V.toPrecision(ei)<=z.current.minSize.toPrecision(ei)?Q=l==="horizontal"?m:p:Q=-(l==="horizontal"?m:p);const G=Lu($,e.current,C,S,Q,o,s.current,null);o!==G&&r(G)}}break}}};x.addEventListener("keydown",A);const O=Bse(C);return O!=null&&x.setAttribute("aria-controls",O.id),()=>{x.removeAttribute("aria-valuemax"),x.removeAttribute("aria-valuemin"),x.removeAttribute("aria-valuenow"),x.removeEventListener("keydown",A),O!=null&&x.removeAttribute("aria-controls")}});return()=>{g.forEach(x=>x())}},[e,t,n,s,r,o])}function Use({disabled:e,handleId:t,resizeHandler:n}){sa(()=>{if(e||n==null)return;const r=Og(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 l=pO(),i=Hse(t);mO(i!==null);const c=s.shiftKey?i>0?i-1:l.length-1:i+1<l.length?i+1:0;l[c].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function Zv(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 hO(e,t,n,r=0,o=null){const s=n==="horizontal";let l=0;if(Ix(e))l=s?e.clientX:e.clientY;else if(Px(e)){const m=e.touches[0];l=s?m.screenX:m.screenY}else return 0;const i=Og(t),c=o||i.getBoundingClientRect(),p=s?c.left:c.top;return l-p-r}function Gse(e,t,n,r,o,s,l){const{dragOffset:i=0,dragHandleRect:c,sizes:p}=l||{},m=p||s;if(Kse(e)){const h=o==="horizontal",x=xd(t).getBoundingClientRect(),y=h?x.width:x.height,b=e.shiftKey?10:100,C=y/b;let S=0;switch(e.key){case"ArrowDown":S=h?0:C;break;case"ArrowLeft":S=h?-C:0;break;case"ArrowRight":S=h?C:0;break;case"ArrowUp":S=h?0:-C;break;case"End":S=y;break;case"Home":S=-y;break}const[_,j]=l2(t,n,r),E=S<0?_:j,I=r.findIndex(R=>R.current.id===E),M=r[I];if(M.current.collapsible){const R=m[I];(R===0||R.toPrecision(ei)===M.current.minSize.toPrecision(ei))&&(S=S<0?-M.current.minSize*y:M.current.minSize*y)}return S}else return hO(e,n,o,i,c)}function Kse(e){return e.type==="keydown"}function Ix(e){return e.type.startsWith("mouse")}function Px(e){return e.type.startsWith("touch")}let Ex=null,Dl=null;function gO(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 qse(){Dl!==null&&(document.head.removeChild(Dl),Ex=null,Dl=null)}function Jv(e){if(Ex===e)return;Ex=e;const t=gO(e);Dl===null&&(Dl=document.createElement("style"),document.head.appendChild(Dl)),Dl.innerHTML=`*{cursor: ${t}!important;}`}function Xse(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function vO(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 xO(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 Qse(e,t,n){const r=xO(e,n);if(r){const o=vO(t);return r[o]??null}return null}function Yse(e,t,n,r){const o=vO(t),s=xO(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(l){console.error(l)}}const e1={};function Z_(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 zu={getItem:e=>(Z_(zu),zu.getItem(e)),setItem:(e,t)=>{Z_(zu),zu.setItem(e,t)}};function bO({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:l=null,onLayout:i,storage:c=zu,style:p={},tagName:m="div",units:h="percentages"}){const g=s2(l),[x,y]=Xu(null),[b,C]=Xu(new Map),S=Kr(null);Kr({didLogDefaultSizeWarning:!1,didLogIdAndOrderWarning:!1,didLogInvalidLayoutWarning:!1,prevPanelIds:[]});const _=Kr({onLayout:i});sa(()=>{_.current.onLayout=i});const j=Kr({}),[E,I]=Xu([]),M=Kr(new Map),R=Kr(0),D=Kr({direction:r,id:g,panels:b,sizes:E,units:h});uO(s,()=>({getId:()=>g,getLayout:T=>{const{sizes:B,units:Y}=D.current;if((T??Y)==="pixels"){const le=Ha(g);return B.map(oe=>oe/100*le)}else return B},setLayout:(T,B)=>{const{id:Y,panels:re,sizes:le,units:oe}=D.current;if((B||oe)==="pixels"){const ce=Ha(Y);T=T.map(J=>J/ce*100)}const q=j.current,K=Dr(re),ee=Yv({groupId:Y,panels:re,nextSizes:T,prevSizes:le,units:oe});Zv(le,ee)||(I(ee),Bi(K,ee,q))}}),[g]),Qu(()=>{D.current.direction=r,D.current.id=g,D.current.panels=b,D.current.sizes=E,D.current.units=h}),Wse({committedValuesRef:D,groupId:g,panels:b,setSizes:I,sizes:E,panelSizeBeforeCollapse:M}),sa(()=>{const{onLayout:T}=_.current,{panels:B,sizes:Y}=D.current;if(Y.length>0){T&&T(Y);const re=j.current,le=Dr(B);Bi(le,Y,re)}},[E]),Qu(()=>{const{id:T,sizes:B,units:Y}=D.current;if(B.length===b.size)return;let re=null;if(e){const le=Dr(b);re=Qse(e,le,c)}if(re!=null){const le=Yv({groupId:T,panels:b,nextSizes:re,prevSizes:re,units:Y});I(le)}else{const le=Fse({groupId:T,panels:b,units:Y});I(le)}},[e,b,c]),sa(()=>{if(e){if(E.length===0||E.length!==b.size)return;const T=Dr(b);e1[e]||(e1[e]=Xse(Yse,100)),e1[e](e,T,E,c)}},[e,b,E,c]),Qu(()=>{if(h==="pixels"){const T=new ResizeObserver(()=>{const{panels:B,sizes:Y}=D.current,re=Yv({groupId:g,panels:B,nextSizes:Y,prevSizes:Y,units:h});Zv(Y,re)||I(re)});return T.observe(xd(g)),()=>{T.disconnect()}}},[g,h]);const A=Ks((T,B)=>{const{panels:Y,units:re}=D.current,oe=Dr(Y).findIndex(ee=>ee.current.id===T),q=E[oe];if((B??re)==="pixels"){const ee=Ha(g);return q/100*ee}else return q},[g,E]),O=Ks((T,B)=>{const{panels:Y}=D.current;return Y.size===0?{flexBasis:0,flexGrow:B??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:fO(Y,T,E),flexShrink:1,overflow:"hidden",pointerEvents:o&&x!==null?"none":void 0}},[x,o,E]),$=Ks((T,B)=>{const{units:Y}=D.current;Vse(Y,B),C(re=>{if(re.has(T))return re;const le=new Map(re);return le.set(T,B),le})},[]),X=Ks(T=>Y=>{Y.preventDefault();const{direction:re,panels:le,sizes:oe}=D.current,q=Dr(le),[K,ee]=l2(g,T,q);if(K==null||ee==null)return;let ce=Gse(Y,g,T,q,re,oe,S.current);if(ce===0)return;const ie=xd(g).getBoundingClientRect(),de=re==="horizontal";document.dir==="rtl"&&de&&(ce=-ce);const xe=de?ie.width:ie.height,we=ce/xe*100,ve=Lu(Y,D.current,K,ee,we,oe,M.current,S.current),fe=!Zv(oe,ve);if((Ix(Y)||Px(Y))&&R.current!=we&&Jv(fe?de?"horizontal":"vertical":de?ce<0?"horizontal-min":"horizontal-max":ce<0?"vertical-min":"vertical-max"),fe){const Oe=j.current;I(ve),Bi(q,ve,Oe)}R.current=we},[g]),z=Ks(T=>{C(B=>{if(!B.has(T))return B;const Y=new Map(B);return Y.delete(T),Y})},[]),V=Ks(T=>{const{panels:B,sizes:Y}=D.current,re=B.get(T);if(re==null)return;const{collapsedSize:le,collapsible:oe}=re.current;if(!oe)return;const q=Dr(B),K=q.indexOf(re);if(K<0)return;const ee=Y[K];if(ee===le)return;M.current.set(T,ee);const[ce,J]=Qv(T,q);if(ce==null||J==null)return;const de=K===q.length-1?ee:le-ee,xe=Lu(null,D.current,ce,J,de,Y,M.current,null);if(Y!==xe){const we=j.current;I(xe),Bi(q,xe,we)}},[]),Q=Ks(T=>{const{panels:B,sizes:Y}=D.current,re=B.get(T);if(re==null)return;const{collapsedSize:le,minSize:oe}=re.current,q=M.current.get(T)||oe;if(!q)return;const K=Dr(B),ee=K.indexOf(re);if(ee<0||Y[ee]!==le)return;const[J,ie]=Qv(T,K);if(J==null||ie==null)return;const xe=ee===K.length-1?le-q:q,we=Lu(null,D.current,J,ie,xe,Y,M.current,null);if(Y!==we){const ve=j.current;I(we),Bi(K,we,ve)}},[]),G=Ks((T,B,Y)=>{const{id:re,panels:le,sizes:oe,units:q}=D.current;if((Y||q)==="pixels"){const st=Ha(re);B=B/st*100}const K=le.get(T);if(K==null)return;let{collapsedSize:ee,collapsible:ce,maxSize:J,minSize:ie}=K.current;if(q==="pixels"){const st=Ha(re);ie=ie/st*100,J!=null&&(J=J/st*100)}const de=Dr(le),xe=de.indexOf(K);if(xe<0)return;const we=oe[xe];if(we===B)return;ce&&B===ee||(B=Math.min(J??100,Math.max(ie,B)));const[ve,fe]=Qv(T,de);if(ve==null||fe==null)return;const je=xe===de.length-1?we-B:B-we,$e=Lu(null,D.current,ve,fe,je,oe,M.current,null);if(oe!==$e){const st=j.current;I($e),Bi(de,$e,st)}},[]),F=Nse(()=>({activeHandleId:x,collapsePanel:V,direction:r,expandPanel:Q,getPanelSize:A,getPanelStyle:O,groupId:g,registerPanel:$,registerResizeHandle:X,resizePanel:G,startDragging:(T,B)=>{if(y(T),Ix(B)||Px(B)){const Y=Og(T);S.current={dragHandleRect:Y.getBoundingClientRect(),dragOffset:hO(B,T,r),sizes:D.current.sizes}}},stopDragging:()=>{qse(),y(null),S.current=null},units:h,unregisterPanel:z}),[x,V,r,Q,A,O,g,$,X,G,h,z]),U={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Oc(Mg.Provider,{children:Oc(m,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g,"data-panel-group-units":h,style:{...U,...p}}),value:F})}const Rg=iO((e,t)=>Oc(bO,{...e,forwardedRef:t}));bO.displayName="PanelGroup";Rg.displayName="forwardRef(PanelGroup)";function Mx({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:l="div"}){const i=Kr(null),c=Kr({onDragging:o});sa(()=>{c.current.onDragging=o});const p=cO(Mg);if(p===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:m,direction:h,groupId:g,registerResizeHandle:x,startDragging:y,stopDragging:b}=p,C=s2(r),S=m===C,[_,j]=Xu(!1),[E,I]=Xu(null),M=Ks(()=>{i.current.blur(),b();const{onDragging:A}=c.current;A&&A(!1)},[b]);sa(()=>{if(n)I(null);else{const D=x(C);I(()=>D)}},[n,C,x]),sa(()=>{if(n||E==null||!S)return;const D=X=>{E(X)},A=X=>{E(X)},$=i.current.ownerDocument;return $.body.addEventListener("contextmenu",M),$.body.addEventListener("mousemove",D),$.body.addEventListener("touchmove",D),$.body.addEventListener("mouseleave",A),window.addEventListener("mouseup",M),window.addEventListener("touchend",M),()=>{$.body.removeEventListener("contextmenu",M),$.body.removeEventListener("mousemove",D),$.body.removeEventListener("touchmove",D),$.body.removeEventListener("mouseleave",A),window.removeEventListener("mouseup",M),window.removeEventListener("touchend",M)}},[h,n,S,E,M]),Use({disabled:n,handleId:C,resizeHandler:E});const R={cursor:gO(h),touchAction:"none",userSelect:"none"};return Oc(l,{children:e,className:t,"data-resize-handle-active":S?"pointer":_?"keyboard":void 0,"data-panel-group-direction":h,"data-panel-group-id":g,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":C,onBlur:()=>j(!1),onFocus:()=>j(!0),onMouseDown:D=>{y(C,D.nativeEvent);const{onDragging:A}=c.current;A&&A(!0)},onMouseUp:M,onTouchCancel:M,onTouchEnd:M,onTouchStart:D=>{y(C,D.nativeEvent);const{onDragging:A}=c.current;A&&A(!0)},ref:i,role:"separator",style:{...R,...s},tabIndex:0})}Mx.displayName="PanelResizeHandle";const Zse=e=>{const{direction:t="horizontal",collapsedDirection:n,isCollapsed:r=!1,...o}=e,s=aa("base.100","base.850"),l=aa("base.300","base.700");return t==="horizontal"?a.jsx(Mx,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx(N,{className:"resize-handle-horizontal",sx:{w:n?2.5:4,h:"full",justifyContent:n?n==="left"?"flex-start":"flex-end":"center",alignItems:"center",div:{bg:s},_hover:{div:{bg:l}}},...o,children:a.jsx(Ie,{sx:{w:1,h:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})}):a.jsx(Mx,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx(N,{className:"resize-handle-vertical",sx:{w:"full",h:n?2.5:4,alignItems:n?n==="top"?"flex-start":"flex-end":"center",justifyContent:"center",div:{bg:s},_hover:{div:{bg:l}}},...o,children:a.jsx(Ie,{sx:{h:1,w:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})})},hh=d.memo(Zse),i2=()=>{const e=te(),t=W(o=>o.ui.panels),n=d.useCallback(o=>t[o]??"",[t]),r=d.useCallback((o,s)=>{e(YD({name:o,value:s}))},[e]);return{getItem:n,setItem:r}};const Jse=e=>{const{label:t,data:n,fileName:r,withDownload:o=!0,withCopy:s=!0}=e,l=d.useMemo(()=>ZD(n)?n:JSON.stringify(n,null,2),[n]),i=d.useCallback(()=>{navigator.clipboard.writeText(l)},[l]),c=d.useCallback(()=>{const m=new Blob([l]),h=document.createElement("a");h.href=URL.createObjectURL(m),h.download=`${r||t}.json`,document.body.appendChild(h),h.click(),h.remove()},[l,t,r]),{t:p}=Z();return a.jsxs(N,{layerStyle:"second",sx:{borderRadius:"base",flexGrow:1,w:"full",h:"full",position:"relative"},children:[a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"auto",p:4,fontSize:"sm"},children:a.jsx(yg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsx("pre",{children:l})})}),a.jsxs(N,{sx:{position:"absolute",top:0,insetInlineEnd:0,p:2},children:[o&&a.jsx(Vt,{label:`${p("gallery.download")} ${t} JSON`,children:a.jsx(Cs,{"aria-label":`${p("gallery.download")} ${t} JSON`,icon:a.jsx(Gc,{}),variant:"ghost",opacity:.7,onClick:c})}),s&&a.jsx(Vt,{label:`${p("gallery.copy")} ${t} JSON`,children:a.jsx(Cs,{"aria-label":`${p("gallery.copy")} ${t} JSON`,icon:a.jsx(Uc,{}),variant:"ghost",opacity:.7,onClick:i})})]})]})},Za=d.memo(Jse),eae=ae(he,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(r=>r.id===t);return{data:n==null?void 0:n.data}},Ce),tae=()=>{const{data:e}=W(eae);return e?a.jsx(Za,{data:e,label:"Node Data"}):a.jsx(Yn,{label:"No node selected",icon:null})},nae=d.memo(tae),rae=({children:e,maxHeight:t})=>a.jsx(N,{sx:{w:"full",h:"full",maxHeight:t,position:"relative"},children:a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx(yg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:e})})}),Xc=d.memo(rae),oae=({output:e})=>{const{image:t}=e,{data:n}=wo(t.image_name);return a.jsx(sl,{imageDTO:n})},sae=d.memo(oae),aae=ae(he,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(s=>s.id===t),r=n?e.nodeTemplates[n.data.type]:void 0,o=e.nodeExecutionStates[t??"__UNKNOWN_NODE__"];return{node:n,template:r,nes:o}},Ce),lae=()=>{const{node:e,template:t,nes:n}=W(aae),{t:r}=Z();return!e||!n||!Mn(e)?a.jsx(Yn,{label:r("nodes.noNodeSelected"),icon:null}):n.outputs.length===0?a.jsx(Yn,{label:r("nodes.noOutputRecorded"),icon:null}):a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Xc,{children:a.jsx(N,{sx:{position:"relative",flexDir:"column",alignItems:"flex-start",p:1,gap:2,h:"full",w:"full"},children:(t==null?void 0:t.outputType)==="image_output"?n.outputs.map((o,s)=>a.jsx(sae,{output:o},cae(o,s))):a.jsx(Za,{data:n.outputs,label:r("nodes.nodeOutputs")})})})})},iae=d.memo(lae),cae=(e,t)=>`${e.type}-${t}`,uae=ae(he,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(o=>o.id===t);return{template:n?e.nodeTemplates[n.data.type]:void 0}},Ce),dae=()=>{const{template:e}=W(uae),{t}=Z();return e?a.jsx(Za,{data:e,label:t("nodes.nodeTemplate")}):a.jsx(Yn,{label:t("nodes.noNodeSelected"),icon:null})},fae=d.memo(dae),pae=()=>a.jsx(N,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(ri,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(oi,{children:[a.jsx(yr,{children:"Outputs"}),a.jsx(yr,{children:"Data"}),a.jsx(yr,{children:"Template"})]}),a.jsxs(Hc,{children:[a.jsx(Qr,{children:a.jsx(iae,{})}),a.jsx(Qr,{children:a.jsx(nae,{})}),a.jsx(Qr,{children:a.jsx(fae,{})})]})]})}),mae=d.memo(pae),c2=e=>{e.stopPropagation()},hae={display:"flex",flexDirection:"row",alignItems:"center",gap:10},gae=e=>{const{label:t="",labelPos:n="top",isDisabled:r=!1,isInvalid:o,formControlProps:s,...l}=e,i=te(),c=d.useCallback(m=>{m.shiftKey&&i(Nr(!0))},[i]),p=d.useCallback(m=>{m.shiftKey||i(Nr(!1))},[i]);return a.jsxs(Zt,{isInvalid:o,isDisabled:r,...s,style:n==="side"?hae:void 0,children:[t!==""&&a.jsx(In,{children:t}),a.jsx($h,{...l,onPaste:c2,onKeyDown:c,onKeyUp:p})]})},ho=d.memo(gae),vae=_e((e,t)=>{const n=te(),r=d.useCallback(s=>{s.shiftKey&&n(Nr(!0))},[n]),o=d.useCallback(s=>{s.shiftKey||n(Nr(!1))},[n]);return a.jsx(wP,{ref:t,onPaste:c2,onKeyDown:r,onKeyUp:o,...e})}),da=d.memo(vae),xae=ae(he,({nodes:e})=>{const{author:t,name:n,description:r,tags:o,version:s,contact:l,notes:i}=e.workflow;return{name:n,author:t,description:r,tags:o,version:s,contact:l,notes:i}},Ce),bae=()=>{const{author:e,name:t,description:n,tags:r,version:o,contact:s,notes:l}=W(xae),i=te(),c=d.useCallback(C=>{i(JD(C.target.value))},[i]),p=d.useCallback(C=>{i(eA(C.target.value))},[i]),m=d.useCallback(C=>{i(tA(C.target.value))},[i]),h=d.useCallback(C=>{i(nA(C.target.value))},[i]),g=d.useCallback(C=>{i(rA(C.target.value))},[i]),x=d.useCallback(C=>{i(oA(C.target.value))},[i]),y=d.useCallback(C=>{i(sA(C.target.value))},[i]),{t:b}=Z();return a.jsx(Xc,{children:a.jsxs(N,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:[a.jsxs(N,{sx:{gap:2,w:"full"},children:[a.jsx(ho,{label:b("nodes.workflowName"),value:t,onChange:c}),a.jsx(ho,{label:b("nodes.workflowVersion"),value:o,onChange:h})]}),a.jsxs(N,{sx:{gap:2,w:"full"},children:[a.jsx(ho,{label:b("nodes.workflowAuthor"),value:e,onChange:p}),a.jsx(ho,{label:b("nodes.workflowContact"),value:s,onChange:m})]}),a.jsx(ho,{label:b("nodes.workflowTags"),value:r,onChange:x}),a.jsxs(Zt,{as:N,sx:{flexDir:"column"},children:[a.jsx(In,{children:b("nodes.workflowDescription")}),a.jsx(da,{onChange:g,value:n,fontSize:"sm",sx:{resize:"none"}})]}),a.jsxs(Zt,{as:N,sx:{flexDir:"column",h:"full"},children:[a.jsx(In,{children:b("nodes.workflowNotes")}),a.jsx(da,{onChange:y,value:l,fontSize:"sm",sx:{h:"full",resize:"none"}})]})]})})},yae=d.memo(bae);function Cae(e,t,n){var r=this,o=d.useRef(null),s=d.useRef(0),l=d.useRef(null),i=d.useRef([]),c=d.useRef(),p=d.useRef(),m=d.useRef(e),h=d.useRef(!0);d.useEffect(function(){m.current=e},[e]);var g=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var x=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,b="maxWait"in n,C=b?Math.max(+n.maxWait||0,t):null;d.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var S=d.useMemo(function(){var _=function(D){var A=i.current,O=c.current;return i.current=c.current=null,s.current=D,p.current=m.current.apply(O,A)},j=function(D,A){g&&cancelAnimationFrame(l.current),l.current=g?requestAnimationFrame(D):setTimeout(D,A)},E=function(D){if(!h.current)return!1;var A=D-o.current;return!o.current||A>=t||A<0||b&&D-s.current>=C},I=function(D){return l.current=null,y&&i.current?_(D):(i.current=c.current=null,p.current)},M=function D(){var A=Date.now();if(E(A))return I(A);if(h.current){var O=t-(A-o.current),$=b?Math.min(O,C-(A-s.current)):O;j(D,$)}},R=function(){var D=Date.now(),A=E(D);if(i.current=[].slice.call(arguments),c.current=r,o.current=D,A){if(!l.current&&h.current)return s.current=o.current,j(M,t),x?_(o.current):p.current;if(b)return j(M,t),_(o.current)}return l.current||j(M,t),p.current};return R.cancel=function(){l.current&&(g?cancelAnimationFrame(l.current):clearTimeout(l.current)),s.current=0,i.current=o.current=c.current=l.current=null},R.isPending=function(){return!!l.current},R.flush=function(){return l.current?I(Date.now()):p.current},R},[x,b,t,C,y,g]);return S}function wae(e,t){return e===t}function J_(e){return typeof e=="function"?function(){return e}:e}function Sae(e,t,n){var r,o,s=n&&n.equalityFn||wae,l=(r=d.useState(J_(e)),o=r[1],[r[0],d.useCallback(function(h){return o(J_(h))},[])]),i=l[0],c=l[1],p=Cae(d.useCallback(function(h){return c(h)},[c]),t,n),m=d.useRef(e);return s(m.current,e)||(p(e),m.current=e),[i,p]}const yO=()=>{const e=W(r=>r.nodes),[t]=Sae(e,300);return d.useMemo(()=>aA(t),[t])},kae=()=>{const e=yO(),{t}=Z();return a.jsx(N,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:a.jsx(Za,{data:e,label:t("nodes.workflow")})})},_ae=d.memo(kae),jae=({isSelected:e,isHovered:t})=>{const n=d.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.light";if(e)return"nodeSelected.light";if(t)return"nodeHovered.light"},[t,e]),r=d.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.dark";if(e)return"nodeSelected.dark";if(t)return"nodeHovered.dark"},[t,e]);return a.jsx(Ie,{className:"selection-box",sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",opacity:e||t?1:.5,transitionProperty:"common",transitionDuration:"0.1s",pointerEvents:"none",shadow:n,_dark:{shadow:r}}})},CO=d.memo(jae),wO=e=>{const t=te(),n=d.useMemo(()=>ae(he,({nodes:l})=>l.mouseOverNode===e,Ce),[e]),r=W(n),o=d.useCallback(()=>{!r&&t(Cw(e))},[t,e,r]),s=d.useCallback(()=>{r&&t(Cw(null))},[t,r]);return{isMouseOverNode:r,handleMouseOver:o,handleMouseOut:s}},SO=(e,t)=>{const n=d.useMemo(()=>ae(he,({nodes:o})=>{var l;const s=o.nodes.find(i=>i.id===e);if(Mn(s))return(l=s==null?void 0:s.data.inputs[t])==null?void 0:l.label},Ce),[t,e]);return W(n)},kO=(e,t,n)=>{const r=d.useMemo(()=>ae(he,({nodes:s})=>{var c;const l=s.nodes.find(p=>p.id===e);if(!Mn(l))return;const i=s.nodeTemplates[(l==null?void 0:l.data.type)??""];return(c=i==null?void 0:i[db[n]][t])==null?void 0:c.title},Ce),[t,n,e]);return W(r)},_O=(e,t)=>{const n=d.useMemo(()=>ae(he,({nodes:o})=>{const s=o.nodes.find(l=>l.id===e);if(Mn(s))return s==null?void 0:s.data.inputs[t]},Ce),[t,e]);return W(n)},Dg=(e,t,n)=>{const r=d.useMemo(()=>ae(he,({nodes:s})=>{const l=s.nodes.find(c=>c.id===e);if(!Mn(l))return;const i=s.nodeTemplates[(l==null?void 0:l.data.type)??""];return i==null?void 0:i[db[n]][t]},Ce),[t,n,e]);return W(r)},Iae=({nodeId:e,fieldName:t,kind:n})=>{const r=_O(e,t),o=Dg(e,t,n),s=lA(o),{t:l}=Z(),i=d.useMemo(()=>iA(r)?r.label&&(o!=null&&o.title)?`${r.label} (${o.title})`:r.label&&!o?r.label:!r.label&&o?o.title:l("nodes.unknownField"):(o==null?void 0:o.title)||l("nodes.unknownField"),[r,o,l]);return a.jsxs(N,{sx:{flexDir:"column"},children:[a.jsx(be,{sx:{fontWeight:600},children:i}),o&&a.jsx(be,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:o.description}),o&&a.jsxs(be,{children:["Type: ",jd[o.type].title]}),s&&a.jsxs(be,{children:["Input: ",cA(o.input)]})]})},u2=d.memo(Iae),Pae=_e((e,t)=>{const{nodeId:n,fieldName:r,kind:o,isMissingInput:s=!1,withTooltip:l=!1}=e,i=SO(n,r),c=kO(n,r,o),{t:p}=Z(),m=te(),[h,g]=d.useState(i||c||p("nodes.unknownField")),x=d.useCallback(async b=>{b&&(b===i||b===c)||(g(b||c||p("nodes.unknownField")),m(uA({nodeId:n,fieldName:r,label:b})))},[i,c,m,n,r,p]),y=d.useCallback(b=>{g(b)},[]);return d.useEffect(()=>{g(i||c||p("nodes.unknownField"))},[i,c,p]),a.jsx(Vt,{label:l?a.jsx(u2,{nodeId:n,fieldName:r,kind:"input"}):void 0,openDelay:jh,placement:"top",hasArrow:!0,children:a.jsx(N,{ref:t,sx:{position:"relative",overflow:"hidden",alignItems:"center",justifyContent:"flex-start",gap:1,h:"full"},children:a.jsxs(Dh,{value:h,onChange:y,onSubmit:x,as:N,sx:{position:"relative",alignItems:"center",h:"full"},children:[a.jsx(Rh,{sx:{p:0,fontWeight:s?600:400,textAlign:"left",_hover:{fontWeight:"600 !important"}},noOfLines:1}),a.jsx(Oh,{className:"nodrag",sx:{p:0,w:"full",fontWeight:600,color:"base.900",_dark:{color:"base.100"},_focusVisible:{p:0,textAlign:"left",boxShadow:"none"}}}),a.jsx(IO,{})]})})})}),jO=d.memo(Pae),IO=d.memo(()=>{const{isEditing:e,getEditButtonProps:t}=P5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&(o(r),r.preventDefault())},[t]);return e?null:a.jsx(N,{onClick:n,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,cursor:"text"})});IO.displayName="EditableControls";const Eae=e=>{const{nodeId:t,field:n}=e,r=te(),o=d.useCallback(s=>{r(dA({nodeId:t,fieldName:n.name,value:s.target.checked}))},[r,n.name,t]);return a.jsx(ry,{className:"nodrag",onChange:o,isChecked:n.value})},Mae=d.memo(Eae);function Ag(){return(Ag=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 PO(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 Ox(e){var t=d.useRef(e),n=d.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Rc=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Yu=function(e){return"touches"in e},Rx=function(e){return e&&e.ownerDocument.defaultView||self},ej=function(e,t,n){var r=e.getBoundingClientRect(),o=Yu(t)?function(s,l){for(var i=0;i<s.length;i++)if(s[i].identifier===l)return s[i];return s[0]}(t.touches,n):t;return{left:Rc((o.pageX-(r.left+Rx(e).pageXOffset))/r.width),top:Rc((o.pageY-(r.top+Rx(e).pageYOffset))/r.height)}},tj=function(e){!Yu(e)&&e.preventDefault()},d2=H.memo(function(e){var t=e.onMove,n=e.onKey,r=PO(e,["onMove","onKey"]),o=d.useRef(null),s=Ox(t),l=Ox(n),i=d.useRef(null),c=d.useRef(!1),p=d.useMemo(function(){var x=function(C){tj(C),(Yu(C)?C.touches.length>0:C.buttons>0)&&o.current?s(ej(o.current,C,i.current)):b(!1)},y=function(){return b(!1)};function b(C){var S=c.current,_=Rx(o.current),j=C?_.addEventListener:_.removeEventListener;j(S?"touchmove":"mousemove",x),j(S?"touchend":"mouseup",y)}return[function(C){var S=C.nativeEvent,_=o.current;if(_&&(tj(S),!function(E,I){return I&&!Yu(E)}(S,c.current)&&_)){if(Yu(S)){c.current=!0;var j=S.changedTouches||[];j.length&&(i.current=j[0].identifier)}_.focus(),s(ej(_,S,i.current)),b(!0)}},function(C){var S=C.which||C.keyCode;S<37||S>40||(C.preventDefault(),l({left:S===39?.05:S===37?-.05:0,top:S===40?.05:S===38?-.05:0}))},b]},[l,s]),m=p[0],h=p[1],g=p[2];return d.useEffect(function(){return g},[g]),H.createElement("div",Ag({},r,{onTouchStart:m,onMouseDown:m,className:"react-colorful__interactive",ref:o,onKeyDown:h,tabIndex:0,role:"slider"}))}),Tg=function(e){return e.filter(Boolean).join(" ")},f2=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=Tg(["react-colorful__pointer",e.className]);return H.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},H.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},wr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},EO=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:wr(e.h),s:wr(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:wr(o/2),a:wr(r,2)}},Dx=function(e){var t=EO(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},t1=function(e){var t=EO(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},Oae=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),l=r*(1-n),i=r*(1-(t-s)*n),c=r*(1-(1-t+s)*n),p=s%6;return{r:wr(255*[r,i,l,l,c,r][p]),g:wr(255*[c,r,r,i,l,l][p]),b:wr(255*[l,l,c,r,r,i][p]),a:wr(o,2)}},Rae=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),l=s-Math.min(t,n,r),i=l?s===t?(n-r)/l:s===n?2+(r-t)/l:4+(t-n)/l:0;return{h:wr(60*(i<0?i+6:i)),s:wr(s?l/s*100:0),v:wr(s/255*100),a:o}},Dae=H.memo(function(e){var t=e.hue,n=e.onChange,r=Tg(["react-colorful__hue",e.className]);return H.createElement("div",{className:r},H.createElement(d2,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Rc(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":wr(t),"aria-valuemax":"360","aria-valuemin":"0"},H.createElement(f2,{className:"react-colorful__hue-pointer",left:t/360,color:Dx({h:t,s:100,v:100,a:1})})))}),Aae=H.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Dx({h:t.h,s:100,v:100,a:1})};return H.createElement("div",{className:"react-colorful__saturation",style:r},H.createElement(d2,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Rc(t.s+100*o.left,0,100),v:Rc(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+wr(t.s)+"%, Brightness "+wr(t.v)+"%"},H.createElement(f2,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Dx(t)})))}),MO=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Tae(e,t,n){var r=Ox(n),o=d.useState(function(){return e.toHsva(t)}),s=o[0],l=o[1],i=d.useRef({color:t,hsva:s});d.useEffect(function(){if(!e.equal(t,i.current.color)){var p=e.toHsva(t);i.current={hsva:p,color:t},l(p)}},[t,e]),d.useEffect(function(){var p;MO(s,i.current.hsva)||e.equal(p=e.fromHsva(s),i.current.color)||(i.current={hsva:s,color:p},r(p))},[s,e,r]);var c=d.useCallback(function(p){l(function(m){return Object.assign({},m,p)})},[]);return[s,c]}var $ae=typeof window<"u"?d.useLayoutEffect:d.useEffect,Nae=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},nj=new Map,Lae=function(e){$ae(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!nj.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}`,nj.set(t,n);var r=Nae();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},zae=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+t1(Object.assign({},n,{a:0}))+", "+t1(Object.assign({},n,{a:1}))+")"},s=Tg(["react-colorful__alpha",t]),l=wr(100*n.a);return H.createElement("div",{className:s},H.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),H.createElement(d2,{onMove:function(i){r({a:i.left})},onKey:function(i){r({a:Rc(n.a+i.left)})},"aria-label":"Alpha","aria-valuetext":l+"%","aria-valuenow":l,"aria-valuemin":"0","aria-valuemax":"100"},H.createElement(f2,{className:"react-colorful__alpha-pointer",left:n.a,color:t1(n)})))},Fae=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,l=PO(e,["className","colorModel","color","onChange"]),i=d.useRef(null);Lae(i);var c=Tae(n,o,s),p=c[0],m=c[1],h=Tg(["react-colorful",t]);return H.createElement("div",Ag({},l,{ref:i,className:h}),H.createElement(Aae,{hsva:p,onChange:m}),H.createElement(Dae,{hue:p.h,onChange:m}),H.createElement(zae,{hsva:p,onChange:m,className:"react-colorful__last-control"}))},Bae={defaultColor:{r:0,g:0,b:0,a:1},toHsva:Rae,fromHsva:Oae,equal:MO},OO=function(e){return H.createElement(Fae,Ag({},e,{colorModel:Bae}))};const Hae=e=>{const{nodeId:t,field:n}=e,r=te(),o=d.useCallback(s=>{r(fA({nodeId:t,fieldName:n.name,value:s}))},[r,n.name,t]);return a.jsx(OO,{className:"nodrag",color:n.value,onChange:o})},Vae=d.memo(Hae),RO=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=pA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({controlNetModelId:e,errors:s.error.format()},"Failed to parse ControlNet model id");return}return s.data},Wae=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Yx(),l=d.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]),i=d.useMemo(()=>{if(!s)return[];const p=[];return Un(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:pn[m.base_model]})}),p},[s]),c=d.useCallback(p=>{if(!p)return;const m=RO(p);m&&o(mA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(On,{className:"nowheel nodrag",tooltip:l==null?void 0:l.description,value:(l==null?void 0:l.id)??null,placeholder:"Pick one",error:!l,data:i,onChange:c,sx:{width:"100%"}})},Uae=d.memo(Wae),Gae=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),s=d.useCallback(l=>{o(hA({nodeId:t,fieldName:n.name,value:l.target.value}))},[o,n.name,t]);return a.jsx(rP,{className:"nowheel nodrag",onChange:s,value:n.value,children:r.options.map(l=>a.jsx("option",{value:l,children:r.ui_choice_labels?r.ui_choice_labels[l]:l},l))})},Kae=d.memo(Gae),qae=e=>{var p;const{nodeId:t,field:n}=e,r=te(),{currentData:o}=wo(((p=n.value)==null?void 0:p.image_name)??eo.skipToken),s=d.useCallback(()=>{r(gA({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),l=d.useMemo(()=>{if(o)return{id:`node-${t}-${n.name}`,payloadType:"IMAGE_DTO",payload:{imageDTO:o}}},[n.name,o,t]),i=d.useMemo(()=>({id:`node-${t}-${n.name}`,actionType:"SET_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}}),[n.name,t]),c=d.useMemo(()=>({type:"SET_NODES_IMAGE",nodeId:t,fieldName:n.name}),[t,n.name]);return a.jsx(N,{className:"nodrag",sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(sl,{imageDTO:o,droppableData:i,draggableData:l,postUploadAction:c,useThumbailFallback:!0,uploadElement:a.jsx(DO,{}),dropLabel:a.jsx(AO,{}),minSize:8,children:a.jsx(xc,{onClick:s,icon:o?a.jsx(pg,{}):void 0,tooltip:"Reset Image"})})})},Xae=d.memo(qae),DO=d.memo(()=>a.jsx(be,{fontSize:16,fontWeight:600,children:"Drop or Upload"}));DO.displayName="UploadElement";const AO=d.memo(()=>a.jsx(be,{fontSize:16,fontWeight:600,children:"Drop"}));AO.displayName="DropLabel";const Qae=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=vA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({loraModelId:e,errors:s.error.format()},"Failed to parse LoRA model id");return}return s.data},Yae=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=_d(),{t:l}=Z(),i=d.useMemo(()=>{if(!s)return[];const m=[];return Un(s.entities,(h,g)=>{h&&m.push({value:g,label:h.model_name,group:pn[h.base_model]})}),m.sort((h,g)=>h.disabled&&!g.disabled?1:-1)},[s]),c=d.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]),p=d.useCallback(m=>{if(!m)return;const h=Qae(m);h&&o(xA({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return(s==null?void 0:s.ids.length)===0?a.jsx(N,{sx:{justifyContent:"center",p:2},children:a.jsx(be,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(nn,{className:"nowheel nodrag",value:(c==null?void 0:c.id)??null,placeholder:i.length>0?l("models.selectLoRA"):l("models.noLoRAsAvailable"),data:i,nothingFound:l("models.noMatchingLoRAs"),itemComponent:fl,disabled:i.length===0,filter:(m,h)=>{var g;return((g=h.label)==null?void 0:g.toLowerCase().includes(m.toLowerCase().trim()))||h.value.toLowerCase().includes(m.toLowerCase().trim())},error:!c,onChange:p,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},Zae=d.memo(Yae),$g=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=bA.safeParse({base_model:n,model_name:o,model_type:r});if(!s.success){t.error({mainModelId:e,errors:s.error.format()},"Failed to parse main model id");return}return s.data};function Qc(e){const{iconMode:t=!1,...n}=e,r=te(),{t:o}=Z(),[s,{isLoading:l}]=yA(),i=()=>{s().unwrap().then(c=>{r(lt(Qt({title:`${o("modelManager.modelsSynced")}`,status:"success"})))}).catch(c=>{c&&r(lt(Qt({title:`${o("modelManager.modelSyncFailed")}`,status:"error"})))})};return t?a.jsx(Be,{icon:a.jsx(EM,{}),tooltip:o("modelManager.syncModels"),"aria-label":o("modelManager.syncModels"),isLoading:l,onClick:i,size:"sm",...n}):a.jsx(ot,{isLoading:l,onClick:i,minW:"max-content",...n,children:"Sync Models"})}const Jae=e=>{var y,b;const{nodeId:t,field:n}=e,r=te(),o=Dt("syncModels").isFeatureEnabled,{t:s}=Z(),{data:l,isLoading:i}=Zu(ww),{data:c,isLoading:p}=Qo(ww),m=d.useMemo(()=>i||p,[i,p]),h=d.useMemo(()=>{if(!c)return[];const C=[];return Un(c.entities,(S,_)=>{S&&C.push({value:_,label:S.model_name,group:pn[S.base_model]})}),l&&Un(l.entities,(S,_)=>{S&&C.push({value:_,label:S.model_name,group:pn[S.base_model]})}),C},[c,l]),g=d.useMemo(()=>{var C,S,_,j;return((c==null?void 0:c.entities[`${(C=n.value)==null?void 0:C.base_model}/main/${(S=n.value)==null?void 0:S.model_name}`])||(l==null?void 0:l.entities[`${(_=n.value)==null?void 0:_.base_model}/onnx/${(j=n.value)==null?void 0:j.model_name}`]))??null},[(y=n.value)==null?void 0:y.base_model,(b=n.value)==null?void 0:b.model_name,c==null?void 0:c.entities,l==null?void 0:l.entities]),x=d.useCallback(C=>{if(!C)return;const S=$g(C);S&&r(RI({nodeId:t,fieldName:n.name,value:S}))},[r,n.name,t]);return a.jsxs(N,{sx:{w:"full",alignItems:"center",gap:2},children:[m?a.jsx(be,{variant:"subtext",children:"Loading..."}):a.jsx(nn,{className:"nowheel nodrag",tooltip:g==null?void 0:g.description,value:g==null?void 0:g.id,placeholder:h.length>0?s("models.selectModel"):s("models.noModelsAvailable"),data:h,error:!g,disabled:h.length===0,onChange:x,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),o&&a.jsx(Qc,{className:"nodrag",iconMode:!0})]})},ele=d.memo(Jae),gh=/^-?(0\.)?\.?$/,TO=_e((e,t)=>{const{label:n,isDisabled:r=!1,showStepper:o=!0,isInvalid:s,value:l,onChange:i,min:c,max:p,isInteger:m=!0,formControlProps:h,formLabelProps:g,numberInputFieldProps:x,numberInputStepperProps:y,tooltipProps:b,...C}=e,S=te(),[_,j]=d.useState(String(l));d.useEffect(()=>{!_.match(gh)&&l!==Number(_)&&j(String(l))},[l,_]);const E=D=>{j(D),D.match(gh)||i(m?Math.floor(Number(D)):Number(D))},I=D=>{const A=Bl(m?Math.floor(Number(D.target.value)):Number(D.target.value),c,p);j(String(A)),i(A)},M=d.useCallback(D=>{D.shiftKey&&S(Nr(!0))},[S]),R=d.useCallback(D=>{D.shiftKey||S(Nr(!1))},[S]);return a.jsx(Vt,{...b,children:a.jsxs(Zt,{ref:t,isDisabled:r,isInvalid:s,...h,children:[n&&a.jsx(In,{...g,children:n}),a.jsxs(Vh,{value:_,min:c,max:p,keepWithinRange:!0,clampValueOnBlur:!1,onChange:E,onBlur:I,...C,onPaste:c2,children:[a.jsx(Uh,{...x,onKeyDown:M,onKeyUp:R}),o&&a.jsxs(Wh,{children:[a.jsx(Kh,{...y}),a.jsx(Gh,{...y})]})]})]})})});TO.displayName="IAINumberInput";const Yc=d.memo(TO),tle=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),[s,l]=d.useState(String(n.value)),i=d.useMemo(()=>r.type==="integer",[r.type]),c=p=>{l(p),p.match(gh)||o(CA({nodeId:t,fieldName:n.name,value:i?Math.floor(Number(p)):Number(p)}))};return d.useEffect(()=>{!s.match(gh)&&n.value!==Number(s)&&l(String(n.value))},[n.value,s]),a.jsxs(Vh,{onChange:c,value:s,step:i?1:.1,precision:i?0:3,children:[a.jsx(Uh,{className:"nodrag"}),a.jsxs(Wh,{children:[a.jsx(Kh,{}),a.jsx(Gh,{})]})]})},nle=d.memo(tle),rle=e=>{var h,g;const{nodeId:t,field:n}=e,r=te(),{t:o}=Z(),s=Dt("syncModels").isFeatureEnabled,{data:l,isLoading:i}=Qo(fb),c=d.useMemo(()=>{if(!l)return[];const x=[];return Un(l.entities,(y,b)=>{y&&x.push({value:b,label:y.model_name,group:pn[y.base_model]})}),x},[l]),p=d.useMemo(()=>{var x,y;return(l==null?void 0:l.entities[`${(x=n.value)==null?void 0:x.base_model}/main/${(y=n.value)==null?void 0:y.model_name}`])??null},[(h=n.value)==null?void 0:h.base_model,(g=n.value)==null?void 0:g.model_name,l==null?void 0:l.entities]),m=d.useCallback(x=>{if(!x)return;const y=$g(x);y&&r(wA({nodeId:t,fieldName:n.name,value:y}))},[r,n.name,t]);return i?a.jsx(nn,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs(N,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{className:"nowheel nodrag",tooltip:p==null?void 0:p.description,value:p==null?void 0:p.id,placeholder:c.length>0?o("models.selectModel"):o("models.noModelsAvailable"),data:c,error:!p,disabled:c.length===0,onChange:m,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Qc,{className:"nodrag",iconMode:!0})]})},ole=d.memo(rle),sle=e=>{var g,x;const{nodeId:t,field:n}=e,r=te(),{t:o}=Z(),s=Dt("syncModels").isFeatureEnabled,{data:l}=Zu(Sw),{data:i,isLoading:c}=Qo(Sw),p=d.useMemo(()=>{if(!i)return[];const y=[];return Un(i.entities,(b,C)=>{!b||b.base_model!=="sdxl"||y.push({value:C,label:b.model_name,group:pn[b.base_model]})}),l&&Un(l.entities,(b,C)=>{!b||b.base_model!=="sdxl"||y.push({value:C,label:b.model_name,group:pn[b.base_model]})}),y},[i,l]),m=d.useMemo(()=>{var y,b,C,S;return((i==null?void 0:i.entities[`${(y=n.value)==null?void 0:y.base_model}/main/${(b=n.value)==null?void 0:b.model_name}`])||(l==null?void 0:l.entities[`${(C=n.value)==null?void 0:C.base_model}/onnx/${(S=n.value)==null?void 0:S.model_name}`]))??null},[(g=n.value)==null?void 0:g.base_model,(x=n.value)==null?void 0:x.model_name,i==null?void 0:i.entities,l==null?void 0:l.entities]),h=d.useCallback(y=>{if(!y)return;const b=$g(y);b&&r(RI({nodeId:t,fieldName:n.name,value:b}))},[r,n.name,t]);return c?a.jsx(nn,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs(N,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{className:"nowheel nodrag",tooltip:m==null?void 0:m.description,value:m==null?void 0:m.id,placeholder:p.length>0?o("models.selectModel"):o("models.noModelsAvailable"),data:p,error:!m,disabled:p.length===0,onChange:h,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Qc,{className:"nodrag",iconMode:!0})]})},ale=d.memo(sle),lle=ae([he],({ui:e})=>{const{favoriteSchedulers:t}=e;return{data:kr(Ch,(r,o)=>({value:o,label:r,group:t.includes(o)?"Favorites":void 0})).sort((r,o)=>r.label.localeCompare(o.label))}},Ce),ile=e=>{const{nodeId:t,field:n}=e,r=te(),{data:o}=W(lle),s=d.useCallback(l=>{l&&r(SA({nodeId:t,fieldName:n.name,value:l}))},[r,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",value:n.value,data:o,onChange:s})},cle=d.memo(ile),ule=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),s=d.useCallback(l=>{o(kA({nodeId:t,fieldName:n.name,value:l.target.value}))},[o,n.name,t]);return r.ui_component==="textarea"?a.jsx(da,{className:"nodrag",onChange:s,value:n.value,rows:5,resize:"none"}):a.jsx(ho,{onChange:s,value:n.value})},dle=d.memo(ule),$O=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=_A.safeParse({base_model:n,model_name:o});if(!s.success){t.error({vaeModelId:e,errors:s.error.format()},"Failed to parse VAE model id");return}return s.data},fle=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=DI(),l=d.useMemo(()=>{if(!s)return[];const p=[{value:"default",label:"Default",group:"Default"}];return Un(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:pn[m.base_model]})}),p.sort((m,h)=>m.disabled&&!h.disabled?1:-1)},[s]),i=d.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]),c=d.useCallback(p=>{if(!p)return;const m=$O(p);m&&o(jA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",itemComponent:fl,tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??"default",placeholder:"Default",data:l,onChange:c,disabled:l.length===0,error:!i,clearable:!0,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},ple=d.memo(fle),mle=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=IA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({ipAdapterModelId:e,errors:s.error.format()},"Failed to parse IP-Adapter model id");return}return s.data},hle=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Jx(),l=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/ip_adapter/${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]),i=d.useMemo(()=>{if(!s)return[];const p=[];return Un(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:pn[m.base_model]})}),p},[s]),c=d.useCallback(p=>{if(!p)return;const m=mle(p);m&&o(PA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(On,{className:"nowheel nodrag",tooltip:l==null?void 0:l.description,value:(l==null?void 0:l.id)??null,placeholder:"Pick one",error:!l,data:i,onChange:c,sx:{width:"100%"}})},gle=d.memo(hle),vle=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=EA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({t2iAdapterModelId:e,errors:s.error.format()},"Failed to parse T2I-Adapter model id");return}return s.data},xle=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Zx(),l=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/t2i_adapter/${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]),i=d.useMemo(()=>{if(!s)return[];const p=[];return Un(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:pn[m.base_model]})}),p},[s]),c=d.useCallback(p=>{if(!p)return;const m=vle(p);m&&o(MA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(On,{className:"nowheel nodrag",tooltip:l==null?void 0:l.description,value:(l==null?void 0:l.id)??null,placeholder:"Pick one",error:!l,data:i,onChange:c,sx:{width:"100%"}})},ble=d.memo(xle),yle=e=>{var i;const{nodeId:t,field:n}=e,r=te(),{data:o,hasBoards:s}=kd(void 0,{selectFromResult:({data:c})=>{const p=[{label:"None",value:"none"}];return c==null||c.forEach(({board_id:m,board_name:h})=>{p.push({label:h,value:m})}),{data:p,hasBoards:p.length>1}}}),l=d.useCallback(c=>{r(OA({nodeId:t,fieldName:n.name,value:c&&c!=="none"?{board_id:c}:void 0}))},[r,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",value:((i=n.value)==null?void 0:i.board_id)??"none",data:o,onChange:l,disabled:!s})},Cle=d.memo(yle),wle=({nodeId:e,fieldName:t})=>{const n=_O(e,t),r=Dg(e,t,"input");return(r==null?void 0:r.fieldKind)==="output"?a.jsxs(Ie,{p:2,children:["Output field in input: ",n==null?void 0:n.type]}):(n==null?void 0:n.type)==="string"&&(r==null?void 0:r.type)==="string"||(n==null?void 0:n.type)==="StringPolymorphic"&&(r==null?void 0:r.type)==="StringPolymorphic"?a.jsx(dle,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="boolean"&&(r==null?void 0:r.type)==="boolean"||(n==null?void 0:n.type)==="BooleanPolymorphic"&&(r==null?void 0:r.type)==="BooleanPolymorphic"?a.jsx(Mae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="integer"&&(r==null?void 0:r.type)==="integer"||(n==null?void 0:n.type)==="float"&&(r==null?void 0:r.type)==="float"||(n==null?void 0:n.type)==="FloatPolymorphic"&&(r==null?void 0:r.type)==="FloatPolymorphic"||(n==null?void 0:n.type)==="IntegerPolymorphic"&&(r==null?void 0:r.type)==="IntegerPolymorphic"?a.jsx(nle,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="enum"&&(r==null?void 0:r.type)==="enum"?a.jsx(Kae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ImageField"&&(r==null?void 0:r.type)==="ImageField"||(n==null?void 0:n.type)==="ImagePolymorphic"&&(r==null?void 0:r.type)==="ImagePolymorphic"?a.jsx(Xae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="BoardField"&&(r==null?void 0:r.type)==="BoardField"?a.jsx(Cle,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="MainModelField"&&(r==null?void 0:r.type)==="MainModelField"?a.jsx(ele,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLRefinerModelField"&&(r==null?void 0:r.type)==="SDXLRefinerModelField"?a.jsx(ole,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="VaeModelField"&&(r==null?void 0:r.type)==="VaeModelField"?a.jsx(ple,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="LoRAModelField"&&(r==null?void 0:r.type)==="LoRAModelField"?a.jsx(Zae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ControlNetModelField"&&(r==null?void 0:r.type)==="ControlNetModelField"?a.jsx(Uae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="IPAdapterModelField"&&(r==null?void 0:r.type)==="IPAdapterModelField"?a.jsx(gle,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="T2IAdapterModelField"&&(r==null?void 0:r.type)==="T2IAdapterModelField"?a.jsx(ble,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ColorField"&&(r==null?void 0:r.type)==="ColorField"?a.jsx(Vae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLMainModelField"&&(r==null?void 0:r.type)==="SDXLMainModelField"?a.jsx(ale,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="Scheduler"&&(r==null?void 0:r.type)==="Scheduler"?a.jsx(cle,{nodeId:e,field:n,fieldTemplate:r}):n&&r?null:a.jsx(Ie,{p:1,children:a.jsxs(be,{sx:{fontSize:"sm",fontWeight:600,color:"error.400",_dark:{color:"error.300"}},children:["Unknown field type: ",n==null?void 0:n.type]})})},NO=d.memo(wle),Sle=({nodeId:e,fieldName:t})=>{const n=te(),{isMouseOverNode:r,handleMouseOut:o,handleMouseOver:s}=wO(e),{t:l}=Z(),i=d.useCallback(()=>{n(AI({nodeId:e,fieldName:t}))},[n,t,e]);return a.jsxs(N,{onMouseEnter:s,onMouseLeave:o,layerStyle:"second",sx:{position:"relative",borderRadius:"base",w:"full",p:2},children:[a.jsxs(Zt,{as:N,sx:{flexDir:"column",gap:1,flexShrink:1},children:[a.jsxs(In,{sx:{display:"flex",alignItems:"center",mb:0},children:[a.jsx(jO,{nodeId:e,fieldName:t,kind:"input"}),a.jsx(ba,{}),a.jsx(Vt,{label:a.jsx(u2,{nodeId:e,fieldName:t,kind:"input"}),openDelay:jh,placement:"top",hasArrow:!0,children:a.jsx(N,{h:"full",alignItems:"center",children:a.jsx(Tn,{as:wM})})}),a.jsx(Be,{"aria-label":l("nodes.removeLinearView"),tooltip:l("nodes.removeLinearView"),variant:"ghost",size:"sm",onClick:i,icon:a.jsx(Fr,{})})]}),a.jsx(NO,{nodeId:e,fieldName:t})]}),a.jsx(CO,{isSelected:!1,isHovered:r})]})},kle=d.memo(Sle),_le=ae(he,({nodes:e})=>({fields:e.workflow.exposedFields}),Ce),jle=()=>{const{fields:e}=W(_le),{t}=Z();return a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Xc,{children:a.jsx(N,{sx:{position:"relative",flexDir:"column",alignItems:"flex-start",p:1,gap:2,h:"full",w:"full"},children:e.length?e.map(({nodeId:n,fieldName:r})=>a.jsx(kle,{nodeId:n,fieldName:r},`${n}.${r}`)):a.jsx(Yn,{label:t("nodes.noFieldsLinearview"),icon:null})})})})},Ile=d.memo(jle),Ple=()=>a.jsx(N,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(ri,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(oi,{children:[a.jsx(yr,{children:"Linear"}),a.jsx(yr,{children:"Details"}),a.jsx(yr,{children:"JSON"})]}),a.jsxs(Hc,{children:[a.jsx(Qr,{children:a.jsx(Ile,{})}),a.jsx(Qr,{children:a.jsx(yae,{})}),a.jsx(Qr,{children:a.jsx(_ae,{})})]})]})}),Ele=d.memo(Ple),Mle={paramNegativeConditioning:{placement:"right"},controlNet:{href:"https://support.invoke.ai/support/solutions/articles/151000105880"},lora:{href:"https://support.invoke.ai/support/solutions/articles/151000159072"},compositingCoherenceMode:{href:"https://support.invoke.ai/support/solutions/articles/151000158838"},infillMethod:{href:"https://support.invoke.ai/support/solutions/articles/151000158841"},scaleBeforeProcessing:{href:"https://support.invoke.ai/support/solutions/articles/151000158841"},paramIterations:{href:"https://support.invoke.ai/support/solutions/articles/151000159073"},paramPositiveConditioning:{href:"https://support.invoke.ai/support/solutions/articles/151000096606-tips-on-crafting-prompts",placement:"right"},paramScheduler:{placement:"right",href:"https://support.invoke.ai/support/solutions/articles/151000159073"},paramModel:{placement:"right",href:"https://support.invoke.ai/support/solutions/articles/151000096601-what-is-a-model-which-should-i-use-"},paramRatio:{gutter:16},controlNetControlMode:{placement:"right"},controlNetResizeMode:{placement:"right"},paramVAE:{placement:"right"},paramVAEPrecision:{placement:"right"}},Ole=1e3,Rle=[{name:"preventOverflow",options:{padding:10}}],LO=_e(({feature:e,children:t,wrapperProps:n,...r},o)=>{const{t:s}=Z(),l=W(g=>g.system.shouldEnableInformationalPopovers),i=d.useMemo(()=>Mle[e],[e]),c=d.useMemo(()=>RA(DA(i,["image","href","buttonLabel"]),r),[i,r]),p=d.useMemo(()=>s(`popovers.${e}.heading`),[e,s]),m=d.useMemo(()=>s(`popovers.${e}.paragraphs`,{returnObjects:!0})??[],[e,s]),h=d.useCallback(()=>{i!=null&&i.href&&window.open(i.href)},[i==null?void 0:i.href]);return l?a.jsxs(Hd,{isLazy:!0,closeOnBlur:!1,trigger:"hover",variant:"informational",openDelay:Ole,modifiers:Rle,placement:"top",...c,children:[a.jsx(Xh,{children:a.jsx(Ie,{ref:o,w:"full",...n,children:t})}),a.jsx($c,{children:a.jsxs(Vd,{w:96,children:[a.jsx(Q3,{}),a.jsx(Qh,{children:a.jsxs(N,{sx:{gap:2,flexDirection:"column",alignItems:"flex-start"},children:[p&&a.jsxs(a.Fragment,{children:[a.jsx(ur,{size:"sm",children:p}),a.jsx(Jn,{})]}),(i==null?void 0:i.image)&&a.jsxs(a.Fragment,{children:[a.jsx(ga,{sx:{objectFit:"contain",maxW:"60%",maxH:"60%",backgroundColor:"white"},src:i.image,alt:"Optional Image"}),a.jsx(Jn,{})]}),m.map(g=>a.jsx(be,{children:g},g)),(i==null?void 0:i.href)&&a.jsxs(a.Fragment,{children:[a.jsx(Jn,{}),a.jsx(Ja,{pt:1,onClick:h,leftIcon:a.jsx(wy,{}),alignSelf:"flex-end",variant:"link",children:s("common.learnMore")??p})]})]})})]})})]}):a.jsx(Ie,{ref:o,w:"full",...n,children:t})});LO.displayName="IAIInformationalPopover";const Ot=d.memo(LO),Dle=ae([he],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:l}=e.config.sd.iterations,{iterations:i}=e.generation,{shouldUseSliders:c}=e.ui,p=e.hotkeys.shift?s:l;return{iterations:i,initial:t,min:n,sliderMax:r,inputMax:o,step:p,shouldUseSliders:c}},Ce),Ale=({asSlider:e})=>{const{iterations:t,initial:n,min:r,sliderMax:o,inputMax:s,step:l,shouldUseSliders:i}=W(Dle),c=te(),{t:p}=Z(),m=d.useCallback(g=>{c(kw(g))},[c]),h=d.useCallback(()=>{c(kw(n))},[c,n]);return e||i?a.jsx(Ot,{feature:"paramIterations",children:a.jsx(Je,{label:p("parameters.iterations"),step:l,min:r,max:o,onChange:m,handleReset:h,value:t,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s}})}):a.jsx(Ot,{feature:"paramIterations",children:a.jsx(Yc,{label:p("parameters.iterations"),step:l,min:r,max:s,onChange:m,value:t,numberInputFieldProps:{textAlign:"center"}})})},os=d.memo(Ale),Tle=()=>{const[e,t]=d.useState(!1),[n,r]=d.useState(!1),o=d.useRef(null),s=i2(),l=d.useCallback(()=>{o.current&&o.current.setLayout([50,50])},[]);return a.jsxs(N,{sx:{flexDir:"column",gap:2,height:"100%",width:"100%"},children:[a.jsx(aO,{}),a.jsx(N,{layerStyle:"first",sx:{w:"full",position:"relative",borderRadius:"base",p:2,pb:3,gap:2,flexDir:"column"},children:a.jsx(os,{asSlider:!0})}),a.jsxs(Rg,{ref:o,id:"workflow-panel-group",autoSaveId:"workflow-panel-group",direction:"vertical",style:{height:"100%",width:"100%"},storage:s,children:[a.jsx(Ya,{id:"workflow",collapsible:!0,onCollapse:t,minSize:25,children:a.jsx(Ele,{})}),a.jsx(hh,{direction:"vertical",onDoubleClick:l,collapsedDirection:e?"top":n?"bottom":void 0}),a.jsx(Ya,{id:"inspector",collapsible:!0,onCollapse:r,minSize:25,children:a.jsx(mae,{})})]})]})},$le=d.memo(Tle),rj=(e,t)=>{const n=d.useRef(null),[r,o]=d.useState(()=>{var p;return!!((p=n.current)!=null&&p.getCollapsed())}),s=d.useCallback(()=>{var p;(p=n.current)!=null&&p.getCollapsed()?qr.flushSync(()=>{var m;(m=n.current)==null||m.expand()}):qr.flushSync(()=>{var m;(m=n.current)==null||m.collapse()})},[]),l=d.useCallback(()=>{qr.flushSync(()=>{var p;(p=n.current)==null||p.expand()})},[]),i=d.useCallback(()=>{qr.flushSync(()=>{var p;(p=n.current)==null||p.collapse()})},[]),c=d.useCallback(()=>{qr.flushSync(()=>{var p;(p=n.current)==null||p.resize(e,t)})},[e,t]);return{ref:n,minSize:e,isCollapsed:r,setIsCollapsed:o,reset:c,toggle:s,expand:l,collapse:i}},Nle=({isGalleryCollapsed:e,galleryPanelRef:t})=>{const{t:n}=Z(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx($c,{children:a.jsx(N,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineEnd:"1.63rem",children:a.jsx(Be,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":n("accessibility.showGalleryPanel"),onClick:r,icon:a.jsx(Noe,{}),sx:{p:0,px:3,h:48,borderEndRadius:0}})})}):null},Lle=d.memo(Nle),Ap={borderStartRadius:0,flexGrow:1},zle=({isSidePanelCollapsed:e,sidePanelRef:t})=>{const{t:n}=Z(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx($c,{children:a.jsxs(N,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"5.13rem",direction:"column",gap:2,h:48,children:[a.jsxs(Ht,{isAttached:!0,orientation:"vertical",flexGrow:3,children:[a.jsx(Be,{tooltip:n("parameters.showOptionsPanel"),"aria-label":n("parameters.showOptionsPanel"),onClick:r,sx:Ap,icon:a.jsx(PM,{})}),a.jsx(rO,{asIconButton:!0,sx:Ap}),a.jsx(Z8,{asIconButton:!0,sx:Ap})]}),a.jsx(r2,{asIconButton:!0,sx:Ap})]})}):null},Fle=d.memo(zle),Ble=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:l}=Lr({defaultIsOpen:o}),{colorMode:i}=ha();return a.jsxs(Ie,{children:[a.jsxs(N,{onClick:l,sx:{alignItems:"center",p:2,px:4,gap:2,borderTopRadius:"base",borderBottomRadius:s?0:"base",bg:Ae("base.250","base.750")(i),color:Ae("base.900","base.100")(i),_hover:{bg:Ae("base.300","base.700")(i)},fontSize:"sm",fontWeight:600,cursor:"pointer",transitionProperty:"common",transitionDuration:"normal",userSelect:"none"},"data-testid":`${t} collapsible`,children:[t,a.jsx(fr,{children:n&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(be,{sx:{color:"accent.500",_dark:{color:"accent.300"}},children:n})},"statusText")}),a.jsx(ba,{}),a.jsx(Cg,{sx:{w:"1rem",h:"1rem",transform:s?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(Od,{in:s,animateOpacity:!0,style:{overflow:"unset"},children:a.jsx(Ie,{sx:{p:4,pb:4,borderBottomRadius:"base",bg:"base.150",_dark:{bg:"base.800"}},children:r})})]})},Vr=d.memo(Ble),Hle=ae(he,e=>{const{maxPrompts:t,combinatorial:n}=e.dynamicPrompts,{min:r,sliderMax:o,inputMax:s}=e.config.sd.dynamicPrompts.maxPrompts;return{maxPrompts:t,min:r,sliderMax:o,inputMax:s,isDisabled:!n}},Ce),Vle=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=W(Hle),s=te(),{t:l}=Z(),i=d.useCallback(p=>{s(AA(p))},[s]),c=d.useCallback(()=>{s(TA())},[s]);return a.jsx(Ot,{feature:"dynamicPromptsMaxPrompts",children:a.jsx(Je,{label:l("dynamicPrompts.maxPrompts"),isDisabled:o,min:t,max:n,value:e,onChange:i,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:c})})},Wle=d.memo(Vle),Ule=ae(he,e=>{const{isLoading:t,isError:n,prompts:r,parsingError:o}=e.dynamicPrompts;return{prompts:r,parsingError:o,isError:n,isLoading:t}},Ce),Gle={"&::marker":{color:"base.500",_dark:{color:"base.500"}}},Kle=()=>{const{prompts:e,parsingError:t,isLoading:n,isError:r}=W(Ule);return r?a.jsx(Ot,{feature:"dynamicPrompts",children:a.jsx(N,{w:"full",h:"full",layerStyle:"second",alignItems:"center",justifyContent:"center",p:8,children:a.jsx(Yn,{icon:Ooe,label:"Problem generating prompts"})})}):a.jsx(Ot,{feature:"dynamicPrompts",children:a.jsxs(Zt,{isInvalid:!!t,children:[a.jsxs(In,{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",children:["Prompts Preview (",e.length,")",t&&` - ${t}`]}),a.jsxs(N,{h:64,pos:"relative",layerStyle:"third",borderRadius:"base",p:2,children:[a.jsx(Xc,{children:a.jsx(x3,{stylePosition:"inside",ms:0,children:e.map((o,s)=>a.jsx(go,{fontSize:"sm",sx:Gle,children:a.jsx(be,{as:"span",children:o})},`${o}.${s}`))})}),n&&a.jsx(N,{pos:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,layerStyle:"second",opacity:.7,alignItems:"center",justifyContent:"center",children:a.jsx(fa,{})})]})]})})},qle=d.memo(Kle),zO=d.forwardRef(({label:e,description:t,...n},r)=>a.jsx(Ie,{ref:r,...n,children:a.jsxs(Ie,{children:[a.jsx(be,{fontWeight:600,children:e}),t&&a.jsx(be,{size:"xs",variant:"subtext",children:t})]})}));zO.displayName="IAIMantineSelectItemWithDescription";const Xle=d.memo(zO),Qle=()=>{const e=te(),{t}=Z(),n=W(s=>s.dynamicPrompts.seedBehaviour),r=d.useMemo(()=>[{value:"PER_ITERATION",label:t("dynamicPrompts.seedBehaviour.perIterationLabel"),description:t("dynamicPrompts.seedBehaviour.perIterationDesc")},{value:"PER_PROMPT",label:t("dynamicPrompts.seedBehaviour.perPromptLabel"),description:t("dynamicPrompts.seedBehaviour.perPromptDesc")}],[t]),o=d.useCallback(s=>{s&&e($A(s))},[e]);return a.jsx(Ot,{feature:"dynamicPromptsSeedBehaviour",children:a.jsx(On,{label:t("dynamicPrompts.seedBehaviour.label"),value:n,data:r,itemComponent:Xle,onChange:o})})},Yle=d.memo(Qle),Zle=()=>{const{t:e}=Z(),t=d.useMemo(()=>ae(he,({dynamicPrompts:o})=>{const s=o.prompts.length;return s===1?e("dynamicPrompts.promptsWithCount_one",{count:s}):e("dynamicPrompts.promptsWithCount_other",{count:s})}),[e]),n=W(t);return Dt("dynamicPrompting").isFeatureEnabled?a.jsx(Vr,{label:e("dynamicPrompts.dynamicPrompts"),activeLabel:n,children:a.jsxs(N,{sx:{gap:2,flexDir:"column"},children:[a.jsx(qle,{}),a.jsx(Yle,{}),a.jsx(Wle,{})]})}):null},Zc=d.memo(Zle),Jle=e=>{const t=te(),{lora:n}=e,r=d.useCallback(l=>{t(NA({id:n.id,weight:l}))},[t,n.id]),o=d.useCallback(()=>{t(LA(n.id))},[t,n.id]),s=d.useCallback(()=>{t(zA(n.id))},[t,n.id]);return a.jsx(Ot,{feature:"lora",children:a.jsxs(N,{sx:{gap:2.5,alignItems:"flex-end"},children:[a.jsx(Je,{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],sliderNumberInputProps:{min:-50,max:50}}),a.jsx(Be,{size:"sm",onClick:s,tooltip:"Remove LoRA","aria-label":"Remove LoRA",icon:a.jsx(Fr,{}),colorScheme:"error"})]})})},eie=d.memo(Jle),tie=ae(he,({lora:e})=>({lorasArray:kr(e.loras)}),Ce),nie=()=>{const{lorasArray:e}=W(tie);return a.jsx(a.Fragment,{children:e.map((t,n)=>a.jsxs(N,{sx:{flexDirection:"column",gap:2},children:[n>0&&a.jsx(Jn,{pt:1}),a.jsx(eie,{lora:t})]},t.model_name))})},rie=d.memo(nie),oie=ae(he,({lora:e})=>({loras:e.loras}),Ce),sie=()=>{const e=te(),{loras:t}=W(oie),{data:n}=_d(),r=W(l=>l.generation.model),o=d.useMemo(()=>{if(!n)return[];const l=[];return Un(n.entities,(i,c)=>{if(!i||c in t)return;const p=(r==null?void 0:r.base_model)!==i.base_model;l.push({value:c,label:i.model_name,disabled:p,group:pn[i.base_model],tooltip:p?`Incompatible base model: ${i.base_model}`:void 0})}),l.sort((i,c)=>i.label&&!c.label?1:-1),l.sort((i,c)=>i.disabled&&!c.disabled?1:-1)},[t,n,r==null?void 0:r.base_model]),s=d.useCallback(l=>{if(!l)return;const i=n==null?void 0:n.entities[l];i&&e(FA(i))},[e,n==null?void 0:n.entities]);return(n==null?void 0:n.ids.length)===0?a.jsx(N,{sx:{justifyContent:"center",p:2},children:a.jsx(be,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(nn,{placeholder:o.length===0?"All LoRAs added":"Add LoRA",value:null,data:o,nothingFound:"No matching LoRAs",itemComponent:fl,disabled:o.length===0,filter:(l,i)=>{var c;return((c=i.label)==null?void 0:c.toLowerCase().includes(l.toLowerCase().trim()))||i.value.toLowerCase().includes(l.toLowerCase().trim())},onChange:s,"data-testid":"add-lora"})},aie=d.memo(sie),lie=ae(he,e=>{const t=TI(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},Ce),iie=()=>{const{t:e}=Z(),{activeLabel:t}=W(lie);return Dt("lora").isFeatureEnabled?a.jsx(Vr,{label:e("modelManager.loraModels"),activeLabel:t,children:a.jsxs(N,{sx:{flexDir:"column",gap:2},children:[a.jsx(aie,{}),a.jsx(rie,{})]})}):null},Jc=d.memo(iie),cie=()=>{const e=te(),t=W(o=>o.generation.shouldUseCpuNoise),{t:n}=Z(),r=d.useCallback(o=>{e(BA(o.target.checked))},[e]);return a.jsx(Ot,{feature:"noiseUseCPU",children:a.jsx(Cn,{label:n("parameters.useCpuNoise"),isChecked:t,onChange:r})})},ss=e=>e.generation,uie=ae(ss,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},Ce),die=()=>{const{t:e}=Z(),{seamlessXAxis:t}=W(uie),n=te(),r=d.useCallback(o=>{n(HA(o.target.checked))},[n]);return a.jsx(Cn,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},fie=d.memo(die),pie=ae(ss,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},Ce),mie=()=>{const{t:e}=Z(),{seamlessYAxis:t}=W(pie),n=te(),r=d.useCallback(o=>{n(VA(o.target.checked))},[n]);return a.jsx(Cn,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},hie=d.memo(mie),gie=()=>{const{t:e}=Z();return Dt("seamless").isFeatureEnabled?a.jsxs(Zt,{children:[a.jsx(In,{children:e("parameters.seamlessTiling")})," ",a.jsxs(N,{sx:{gap:5},children:[a.jsx(Ie,{flexGrow:1,children:a.jsx(fie,{})}),a.jsx(Ie,{flexGrow:1,children:a.jsx(hie,{})})]})]}):null},vie=d.memo(gie);function xie(){const e=W(c=>c.generation.clipSkip),{model:t}=W(c=>c.generation),n=te(),{t:r}=Z(),o=d.useCallback(c=>{n(_w(c))},[n]),s=d.useCallback(()=>{n(_w(0))},[n]),l=d.useMemo(()=>t?Jf[t.base_model].maxClip:Jf["sd-1"].maxClip,[t]),i=d.useMemo(()=>t?Jf[t.base_model].markers:Jf["sd-1"].markers,[t]);return(t==null?void 0:t.base_model)==="sdxl"?null:a.jsx(Ot,{feature:"clipSkip",placement:"top",children:a.jsx(Je,{label:r("parameters.clipSkip"),"aria-label":r("parameters.clipSkip"),min:0,max:l,step:1,value:e,onChange:o,withSliderMarks:!0,sliderMarks:i,withInput:!0,withReset:!0,handleReset:s})})}const bie=ae(he,e=>{const{clipSkip:t,model:n,seamlessXAxis:r,seamlessYAxis:o,shouldUseCpuNoise:s}=e.generation;return{clipSkip:t,model:n,seamlessXAxis:r,seamlessYAxis:o,shouldUseCpuNoise:s}},Ce);function eu(){const{clipSkip:e,model:t,seamlessXAxis:n,seamlessYAxis:r,shouldUseCpuNoise:o}=W(bie),{t:s}=Z(),l=d.useMemo(()=>{const i=[];return o?i.push(s("parameters.cpuNoise")):i.push(s("parameters.gpuNoise")),e>0&&t&&t.base_model!=="sdxl"&&i.push(s("parameters.clipSkipWithLayerCount",{layerCount:e})),n&&r?i.push(s("parameters.seamlessX&Y")):n?i.push(s("parameters.seamlessX")):r&&i.push(s("parameters.seamlessY")),i.join(", ")},[e,t,n,r,o,s]);return a.jsx(Vr,{label:s("common.advanced"),activeLabel:l,children:a.jsxs(N,{sx:{flexDir:"column",gap:2},children:[a.jsx(vie,{}),a.jsx(Jn,{}),t&&(t==null?void 0:t.base_model)!=="sdxl"&&a.jsxs(a.Fragment,{children:[a.jsx(xie,{}),a.jsx(Jn,{pt:2})]}),a.jsx(cie,{})]})})}const wa=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{var o;return((o=_o(r,e))==null?void 0:o.isEnabled)??!1},Ce),[e]);return W(t)},yie=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{var o;return(o=_o(r,e))==null?void 0:o.model},Ce),[e]);return W(t)},FO=e=>{const{data:t}=Yx(),n=d.useMemo(()=>t?xI.getSelectors().selectAll(t):[],[t]),{data:r}=Zx(),o=d.useMemo(()=>r?bI.getSelectors().selectAll(r):[],[r]),{data:s}=Jx(),l=d.useMemo(()=>s?yI.getSelectors().selectAll(s):[],[s]);return e==="controlnet"?n:e==="t2i_adapter"?o:e==="ip_adapter"?l:[]},BO=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{var o;return(o=_o(r,e))==null?void 0:o.type},Ce),[e]);return W(t)},Cie=ae(he,({generation:e})=>{const{model:t}=e;return{mainModel:t}},Ce),wie=({id:e})=>{const t=wa(e),n=BO(e),r=yie(e),o=te(),{mainModel:s}=W(Cie),{t:l}=Z(),i=FO(n),c=d.useMemo(()=>{if(!i)return[];const h=[];return i.forEach(g=>{if(!g)return;const x=(g==null?void 0:g.base_model)!==(s==null?void 0:s.base_model);h.push({value:g.id,label:g.model_name,group:pn[g.base_model],disabled:x,tooltip:x?`${l("controlnet.incompatibleBaseModel")} ${g.base_model}`:void 0})}),h.sort((g,x)=>g.disabled?1:x.disabled?-1:g.label.localeCompare(x.label)),h},[s==null?void 0:s.base_model,i,l]),p=d.useMemo(()=>i.find(h=>(h==null?void 0:h.id)===`${r==null?void 0:r.base_model}/${n}/${r==null?void 0:r.model_name}`),[n,r==null?void 0:r.base_model,r==null?void 0:r.model_name,i]),m=d.useCallback(h=>{if(!h)return;const g=RO(h);g&&o(WA({id:e,model:g}))},[o,e]);return a.jsx(nn,{itemComponent:fl,data:c,error:!p||(s==null?void 0:s.base_model)!==p.base_model,placeholder:l("controlnet.selectModel"),value:(p==null?void 0:p.id)??null,onChange:m,disabled:!t,tooltip:p==null?void 0:p.description})},Sie=d.memo(wie),kie=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{var o;return(o=_o(r,e))==null?void 0:o.weight},Ce),[e]);return W(t)},_ie=({id:e})=>{const t=wa(e),n=kie(e),r=te(),{t:o}=Z(),s=d.useCallback(l=>{r(UA({id:e,weight:l}))},[r,e]);return xb(n)?null:a.jsx(Ot,{feature:"controlNetWeight",children:a.jsx(Je,{isDisabled:!t,label:o("controlnet.weight"),value:n,onChange:s,min:0,max:2,step:.01,withSliderMarks:!0,sliderMarks:[0,1,2]})})},jie=d.memo(_ie),Iie=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{var o;return(o=_o(r,e))==null?void 0:o.controlImage},Ce),[e]);return W(t)},Pie=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{const o=_o(r,e);return o&&Nc(o)?o.processedControlImage:void 0},Ce),[e]);return W(t)},Eie=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{const o=_o(r,e);return o&&Nc(o)?o.processorType:void 0},Ce),[e]);return W(t)},Mie=ae(he,({controlAdapters:e,gallery:t})=>{const{pendingControlImages:n}=e,{autoAddBoardId:r}=t;return{pendingControlImages:n,autoAddBoardId:r}},Ce),Oie=({isSmall:e,id:t})=>{const n=Iie(t),r=Pie(t),o=Eie(t),s=te(),{t:l}=Z(),{pendingControlImages:i,autoAddBoardId:c}=W(Mie),p=W(er),[m,h]=d.useState(!1),{currentData:g}=wo(n??eo.skipToken),{currentData:x}=wo(r??eo.skipToken),[y]=GA(),[b]=KA(),[C]=qA(),S=d.useCallback(()=>{s(XA({id:t,controlImage:null}))},[t,s]),_=d.useCallback(async()=>{x&&(await y({imageDTO:x,is_intermediate:!1}).unwrap(),c!=="none"?b({imageDTO:x,board_id:c}):C({imageDTO:x}))},[x,y,c,b,C]),j=d.useCallback(()=>{g&&(p==="unifiedCanvas"?s(Wo({width:g.width,height:g.height})):(s(Hl(g.width)),s(Vl(g.height))))},[g,p,s]),E=d.useCallback(()=>{h(!0)},[]),I=d.useCallback(()=>{h(!1)},[]),M=d.useMemo(()=>{if(g)return{id:t,payloadType:"IMAGE_DTO",payload:{imageDTO:g}}},[g,t]),R=d.useMemo(()=>({id:t,actionType:"SET_CONTROL_ADAPTER_IMAGE",context:{id:t}}),[t]),D=d.useMemo(()=>({type:"SET_CONTROL_ADAPTER_IMAGE",id:t}),[t]),A=g&&x&&!m&&!i.includes(t)&&o!=="none";return a.jsxs(N,{onMouseEnter:E,onMouseLeave:I,sx:{position:"relative",w:"full",h:e?28:366,alignItems:"center",justifyContent:"center"},children:[a.jsx(sl,{draggableData:M,droppableData:R,imageDTO:g,isDropDisabled:A,postUploadAction:D}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:A?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:a.jsx(sl,{draggableData:M,droppableData:R,imageDTO:x,isUploadDisabled:!0})}),a.jsxs(a.Fragment,{children:[a.jsx(xc,{onClick:S,icon:g?a.jsx(pg,{}):void 0,tooltip:l("controlnet.resetControlImage")}),a.jsx(xc,{onClick:_,icon:g?a.jsx(fg,{size:16}):void 0,tooltip:l("controlnet.saveControlImage"),styleOverrides:{marginTop:6}}),a.jsx(xc,{onClick:j,icon:g?a.jsx(mee,{size:16}):void 0,tooltip:l("controlnet.setControlImageDimensions"),styleOverrides:{marginTop:12}})]}),i.includes(t)&&a.jsx(N,{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(fa,{size:"xl",sx:{color:"base.100",_dark:{color:"base.400"}}})})]})},oj=d.memo(Oie),Io=()=>{const e=te();return d.useCallback((n,r)=>{e(QA({id:n,params:r}))},[e])};function Po(e){return a.jsx(N,{sx:{flexDirection:"column",gap:2,pb:2},children:e.children})}const sj=Sr.canny_image_processor.default,Rie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{low_threshold:o,high_threshold:s}=n,l=Io(),{t:i}=Z(),c=d.useCallback(g=>{l(t,{low_threshold:g})},[t,l]),p=d.useCallback(()=>{l(t,{low_threshold:sj.low_threshold})},[t,l]),m=d.useCallback(g=>{l(t,{high_threshold:g})},[t,l]),h=d.useCallback(()=>{l(t,{high_threshold:sj.high_threshold})},[t,l]);return a.jsxs(Po,{children:[a.jsx(Je,{isDisabled:!r,label:i("controlnet.lowThreshold"),value:o,onChange:c,handleReset:p,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),a.jsx(Je,{isDisabled:!r,label:i("controlnet.highThreshold"),value:s,onChange:m,handleReset:h,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},Die=d.memo(Rie),Aie=Sr.color_map_image_processor.default,Tie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{color_map_tile_size:o}=n,s=Io(),{t:l}=Z(),i=d.useCallback(p=>{s(t,{color_map_tile_size:p})},[t,s]),c=d.useCallback(()=>{s(t,{color_map_tile_size:Aie.color_map_tile_size})},[t,s]);return a.jsx(Po,{children:a.jsx(Je,{isDisabled:!r,label:l("controlnet.colorMapTileSize"),value:o,onChange:i,handleReset:c,withReset:!0,min:1,max:256,step:1,withInput:!0,withSliderMarks:!0,sliderNumberInputProps:{max:4096}})})},$ie=d.memo(Tie),Ou=Sr.content_shuffle_image_processor.default,Nie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,w:l,h:i,f:c}=n,p=Io(),{t:m}=Z(),h=d.useCallback(I=>{p(t,{detect_resolution:I})},[t,p]),g=d.useCallback(()=>{p(t,{detect_resolution:Ou.detect_resolution})},[t,p]),x=d.useCallback(I=>{p(t,{image_resolution:I})},[t,p]),y=d.useCallback(()=>{p(t,{image_resolution:Ou.image_resolution})},[t,p]),b=d.useCallback(I=>{p(t,{w:I})},[t,p]),C=d.useCallback(()=>{p(t,{w:Ou.w})},[t,p]),S=d.useCallback(I=>{p(t,{h:I})},[t,p]),_=d.useCallback(()=>{p(t,{h:Ou.h})},[t,p]),j=d.useCallback(I=>{p(t,{f:I})},[t,p]),E=d.useCallback(()=>{p(t,{f:Ou.f})},[t,p]);return a.jsxs(Po,{children:[a.jsx(Je,{label:m("controlnet.detectResolution"),value:s,onChange:h,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:m("controlnet.imageResolution"),value:o,onChange:x,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:m("controlnet.w"),value:l,onChange:b,handleReset:C,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:m("controlnet.h"),value:i,onChange:S,handleReset:_,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:m("controlnet.f"),value:c,onChange:j,handleReset:E,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Lie=d.memo(Nie),aj=Sr.hed_image_processor.default,zie=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o},isEnabled:s}=e,l=Io(),{t:i}=Z(),c=d.useCallback(x=>{l(t,{detect_resolution:x})},[t,l]),p=d.useCallback(x=>{l(t,{image_resolution:x})},[t,l]),m=d.useCallback(x=>{l(t,{scribble:x.target.checked})},[t,l]),h=d.useCallback(()=>{l(t,{detect_resolution:aj.detect_resolution})},[t,l]),g=d.useCallback(()=>{l(t,{image_resolution:aj.image_resolution})},[t,l]);return a.jsxs(Po,{children:[a.jsx(Je,{label:i("controlnet.detectResolution"),value:n,onChange:c,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),a.jsx(Je,{label:i("controlnet.imageResolution"),value:r,onChange:p,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),a.jsx(Cn,{label:i("controlnet.scribble"),isChecked:o,onChange:m,isDisabled:!s})]})},Fie=d.memo(zie),lj=Sr.lineart_anime_image_processor.default,Bie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,l=Io(),{t:i}=Z(),c=d.useCallback(g=>{l(t,{detect_resolution:g})},[t,l]),p=d.useCallback(g=>{l(t,{image_resolution:g})},[t,l]),m=d.useCallback(()=>{l(t,{detect_resolution:lj.detect_resolution})},[t,l]),h=d.useCallback(()=>{l(t,{image_resolution:lj.image_resolution})},[t,l]);return a.jsxs(Po,{children:[a.jsx(Je,{label:i("controlnet.detectResolution"),value:s,onChange:c,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:i("controlnet.imageResolution"),value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Hie=d.memo(Bie),ij=Sr.lineart_image_processor.default,Vie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,coarse:l}=n,i=Io(),{t:c}=Z(),p=d.useCallback(y=>{i(t,{detect_resolution:y})},[t,i]),m=d.useCallback(y=>{i(t,{image_resolution:y})},[t,i]),h=d.useCallback(()=>{i(t,{detect_resolution:ij.detect_resolution})},[t,i]),g=d.useCallback(()=>{i(t,{image_resolution:ij.image_resolution})},[t,i]),x=d.useCallback(y=>{i(t,{coarse:y.target.checked})},[t,i]);return a.jsxs(Po,{children:[a.jsx(Je,{label:c("controlnet.detectResolution"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:c("controlnet.imageResolution"),value:o,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Cn,{label:c("controlnet.coarse"),isChecked:l,onChange:x,isDisabled:!r})]})},Wie=d.memo(Vie),cj=Sr.mediapipe_face_processor.default,Uie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{max_faces:o,min_confidence:s}=n,l=Io(),{t:i}=Z(),c=d.useCallback(g=>{l(t,{max_faces:g})},[t,l]),p=d.useCallback(g=>{l(t,{min_confidence:g})},[t,l]),m=d.useCallback(()=>{l(t,{max_faces:cj.max_faces})},[t,l]),h=d.useCallback(()=>{l(t,{min_confidence:cj.min_confidence})},[t,l]);return a.jsxs(Po,{children:[a.jsx(Je,{label:i("controlnet.maxFaces"),value:o,onChange:c,handleReset:m,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:i("controlnet.minConfidence"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Gie=d.memo(Uie),uj=Sr.midas_depth_image_processor.default,Kie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{a_mult:o,bg_th:s}=n,l=Io(),{t:i}=Z(),c=d.useCallback(g=>{l(t,{a_mult:g})},[t,l]),p=d.useCallback(g=>{l(t,{bg_th:g})},[t,l]),m=d.useCallback(()=>{l(t,{a_mult:uj.a_mult})},[t,l]),h=d.useCallback(()=>{l(t,{bg_th:uj.bg_th})},[t,l]);return a.jsxs(Po,{children:[a.jsx(Je,{label:i("controlnet.amult"),value:o,onChange:c,handleReset:m,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:i("controlnet.bgth"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},qie=d.memo(Kie),Tp=Sr.mlsd_image_processor.default,Xie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,thr_d:l,thr_v:i}=n,c=Io(),{t:p}=Z(),m=d.useCallback(_=>{c(t,{detect_resolution:_})},[t,c]),h=d.useCallback(_=>{c(t,{image_resolution:_})},[t,c]),g=d.useCallback(_=>{c(t,{thr_d:_})},[t,c]),x=d.useCallback(_=>{c(t,{thr_v:_})},[t,c]),y=d.useCallback(()=>{c(t,{detect_resolution:Tp.detect_resolution})},[t,c]),b=d.useCallback(()=>{c(t,{image_resolution:Tp.image_resolution})},[t,c]),C=d.useCallback(()=>{c(t,{thr_d:Tp.thr_d})},[t,c]),S=d.useCallback(()=>{c(t,{thr_v:Tp.thr_v})},[t,c]);return a.jsxs(Po,{children:[a.jsx(Je,{label:p("controlnet.detectResolution"),value:s,onChange:m,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:p("controlnet.imageResolution"),value:o,onChange:h,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:p("controlnet.w"),value:l,onChange:g,handleReset:C,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:p("controlnet.h"),value:i,onChange:x,handleReset:S,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Qie=d.memo(Xie),dj=Sr.normalbae_image_processor.default,Yie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,l=Io(),{t:i}=Z(),c=d.useCallback(g=>{l(t,{detect_resolution:g})},[t,l]),p=d.useCallback(g=>{l(t,{image_resolution:g})},[t,l]),m=d.useCallback(()=>{l(t,{detect_resolution:dj.detect_resolution})},[t,l]),h=d.useCallback(()=>{l(t,{image_resolution:dj.image_resolution})},[t,l]);return a.jsxs(Po,{children:[a.jsx(Je,{label:i("controlnet.detectResolution"),value:s,onChange:c,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:i("controlnet.imageResolution"),value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Zie=d.memo(Yie),fj=Sr.openpose_image_processor.default,Jie=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,hand_and_face:l}=n,i=Io(),{t:c}=Z(),p=d.useCallback(y=>{i(t,{detect_resolution:y})},[t,i]),m=d.useCallback(y=>{i(t,{image_resolution:y})},[t,i]),h=d.useCallback(()=>{i(t,{detect_resolution:fj.detect_resolution})},[t,i]),g=d.useCallback(()=>{i(t,{image_resolution:fj.image_resolution})},[t,i]),x=d.useCallback(y=>{i(t,{hand_and_face:y.target.checked})},[t,i]);return a.jsxs(Po,{children:[a.jsx(Je,{label:c("controlnet.detectResolution"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:c("controlnet.imageResolution"),value:o,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Cn,{label:c("controlnet.handAndFace"),isChecked:l,onChange:x,isDisabled:!r})]})},ece=d.memo(Jie),pj=Sr.pidi_image_processor.default,tce=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,scribble:l,safe:i}=n,c=Io(),{t:p}=Z(),m=d.useCallback(C=>{c(t,{detect_resolution:C})},[t,c]),h=d.useCallback(C=>{c(t,{image_resolution:C})},[t,c]),g=d.useCallback(()=>{c(t,{detect_resolution:pj.detect_resolution})},[t,c]),x=d.useCallback(()=>{c(t,{image_resolution:pj.image_resolution})},[t,c]),y=d.useCallback(C=>{c(t,{scribble:C.target.checked})},[t,c]),b=d.useCallback(C=>{c(t,{safe:C.target.checked})},[t,c]);return a.jsxs(Po,{children:[a.jsx(Je,{label:p("controlnet.detectResolution"),value:s,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Je,{label:p("controlnet.imageResolution"),value:o,onChange:h,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(Cn,{label:p("controlnet.scribble"),isChecked:l,onChange:y}),a.jsx(Cn,{label:p("controlnet.safe"),isChecked:i,onChange:b,isDisabled:!r})]})},nce=d.memo(tce),rce=e=>null,oce=d.memo(rce),HO=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{const o=_o(r,e);return o&&Nc(o)?o.processorNode:void 0},Ce),[e]);return W(t)},sce=({id:e})=>{const t=wa(e),n=HO(e);return n?n.type==="canny_image_processor"?a.jsx(Die,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="color_map_image_processor"?a.jsx($ie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="hed_image_processor"?a.jsx(Fie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="lineart_image_processor"?a.jsx(Wie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="content_shuffle_image_processor"?a.jsx(Lie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="lineart_anime_image_processor"?a.jsx(Hie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="mediapipe_face_processor"?a.jsx(Gie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="midas_depth_image_processor"?a.jsx(qie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="mlsd_image_processor"?a.jsx(Qie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="normalbae_image_processor"?a.jsx(Zie,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="openpose_image_processor"?a.jsx(ece,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="pidi_image_processor"?a.jsx(nce,{controlNetId:e,processorNode:n,isEnabled:t}):n.type==="zoe_depth_image_processor"?a.jsx(oce,{controlNetId:e,processorNode:n,isEnabled:t}):null:null},ace=d.memo(sce),lce=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{const o=_o(r,e);if(o&&Nc(o))return o.shouldAutoConfig},Ce),[e]);return W(t)},ice=({id:e})=>{const t=wa(e),n=lce(e),r=te(),{t:o}=Z(),s=d.useCallback(()=>{r(YA({id:e}))},[e,r]);return xb(n)?null:a.jsx(Cn,{label:o("controlnet.autoConfigure"),"aria-label":o("controlnet.autoConfigure"),isChecked:n,onChange:s,isDisabled:!t})},cce=d.memo(ice),uce=e=>{const{id:t}=e,n=te(),{t:r}=Z(),o=d.useCallback(()=>{n(ZA({id:t}))},[t,n]),s=d.useCallback(()=>{n(JA({id:t}))},[t,n]);return a.jsxs(N,{sx:{gap:2},children:[a.jsx(Be,{size:"sm",icon:a.jsx(Yl,{}),tooltip:r("controlnet.importImageFromCanvas"),"aria-label":r("controlnet.importImageFromCanvas"),onClick:o}),a.jsx(Be,{size:"sm",icon:a.jsx(_M,{}),tooltip:r("controlnet.importMaskFromCanvas"),"aria-label":r("controlnet.importMaskFromCanvas"),onClick:s})]})},dce=d.memo(uce),fce=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{const o=_o(r,e);return o?{beginStepPct:o.beginStepPct,endStepPct:o.endStepPct}:void 0},Ce),[e]);return W(t)},mj=e=>`${Math.round(e*100)}%`,pce=({id:e})=>{const t=wa(e),n=fce(e),r=te(),{t:o}=Z(),s=d.useCallback(l=>{r(eT({id:e,beginStepPct:l[0]})),r(tT({id:e,endStepPct:l[1]}))},[r,e]);return n?a.jsx(Ot,{feature:"controlNetBeginEnd",children:a.jsxs(Zt,{isDisabled:!t,children:[a.jsx(In,{children:o("controlnet.beginEndStepPercent")}),a.jsx(Bb,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(fP,{"aria-label":["Begin Step %","End Step %!"],value:[n.beginStepPct,n.endStepPct],onChange:s,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!t,children:[a.jsx(pP,{children:a.jsx(mP,{})}),a.jsx(Vt,{label:mj(n.beginStepPct),placement:"top",hasArrow:!0,children:a.jsx(q1,{index:0})}),a.jsx(Vt,{label:mj(n.endStepPct),placement:"top",hasArrow:!0,children:a.jsx(q1,{index:1})}),a.jsx(Wp,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(Wp,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(Wp,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})}):null},mce=d.memo(pce),hce=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{const o=_o(r,e);if(o&&nT(o))return o.controlMode},Ce),[e]);return W(t)};function gce({id:e}){const t=wa(e),n=hce(e),r=te(),{t:o}=Z(),s=[{label:o("controlnet.balanced"),value:"balanced"},{label:o("controlnet.prompt"),value:"more_prompt"},{label:o("controlnet.control"),value:"more_control"},{label:o("controlnet.megaControl"),value:"unbalanced"}],l=d.useCallback(i=>{r(rT({id:e,controlMode:i}))},[e,r]);return n?a.jsx(Ot,{feature:"controlNetControlMode",children:a.jsx(On,{disabled:!t,label:o("controlnet.controlMode"),data:s,value:n,onChange:l})}):null}const vce=ae(n2,e=>kr(Sr,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)),Ce),xce=({id:e})=>{const t=wa(e),n=HO(e),r=te(),o=W(vce),{t:s}=Z(),l=d.useCallback(i=>{r(oT({id:e,processorType:i}))},[e,r]);return n?a.jsx(nn,{label:s("controlnet.processor"),value:n.type??"canny_image_processor",data:o,onChange:l,disabled:!t}):null},bce=d.memo(xce),yce=e=>{const t=d.useMemo(()=>ae(he,({controlAdapters:r})=>{const o=_o(r,e);if(o&&Nc(o))return o.resizeMode},Ce),[e]);return W(t)};function Cce({id:e}){const t=wa(e),n=yce(e),r=te(),{t:o}=Z(),s=[{label:o("controlnet.resize"),value:"just_resize"},{label:o("controlnet.crop"),value:"crop_resize"},{label:o("controlnet.fill"),value:"fill_resize"}],l=d.useCallback(i=>{r(sT({id:e,resizeMode:i}))},[e,r]);return n?a.jsx(Ot,{feature:"controlNetResizeMode",children:a.jsx(On,{disabled:!t,label:o("controlnet.resizeMode"),data:s,value:n,onChange:l})}):null}const wce=e=>{const{id:t,number:n}=e,r=BO(t),o=te(),{t:s}=Z(),l=W(er),i=wa(t),[c,p]=kee(!1),m=d.useCallback(()=>{o(aT({id:t}))},[t,o]),h=d.useCallback(()=>{o(lT(t))},[t,o]),g=d.useCallback(x=>{o(iT({id:t,isEnabled:x.target.checked}))},[t,o]);return r?a.jsxs(N,{sx:{flexDir:"column",gap:3,p:2,borderRadius:"base",position:"relative",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsx(N,{sx:{gap:2,alignItems:"center",justifyContent:"space-between"},children:a.jsx(Cn,{label:s(`controlnet.${r}`,{number:n}),"aria-label":s("controlnet.toggleControlNet"),isChecked:i,onChange:g,formControlProps:{w:"full"},formLabelProps:{fontWeight:600}})}),a.jsxs(N,{sx:{gap:2,alignItems:"center"},children:[a.jsx(Ie,{sx:{w:"full",minW:0,transitionProperty:"common",transitionDuration:"0.1s"},children:a.jsx(Sie,{id:t})}),l==="unifiedCanvas"&&a.jsx(dce,{id:t}),a.jsx(Be,{size:"sm",tooltip:s("controlnet.duplicate"),"aria-label":s("controlnet.duplicate"),onClick:h,icon:a.jsx(Uc,{})}),a.jsx(Be,{size:"sm",tooltip:s("controlnet.delete"),"aria-label":s("controlnet.delete"),colorScheme:"error",onClick:m,icon:a.jsx(Fr,{})}),a.jsx(Be,{size:"sm",tooltip:s(c?"controlnet.hideAdvanced":"controlnet.showAdvanced"),"aria-label":s(c?"controlnet.hideAdvanced":"controlnet.showAdvanced"),onClick:p,variant:"ghost",sx:{_hover:{bg:"none"}},icon:a.jsx(Cg,{sx:{boxSize:4,color:"base.700",transform:c?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal",_dark:{color:"base.300"}}})})]}),a.jsxs(N,{sx:{w:"full",flexDirection:"column",gap:3},children:[a.jsxs(N,{sx:{gap:4,w:"full",alignItems:"center"},children:[a.jsxs(N,{sx:{flexDir:"column",gap:3,h:28,w:"full",paddingInlineStart:1,paddingInlineEnd:c?1:0,pb:2,justifyContent:"space-between"},children:[a.jsx(jie,{id:t}),a.jsx(mce,{id:t})]}),!c&&a.jsx(N,{sx:{alignItems:"center",justifyContent:"center",h:28,w:28,aspectRatio:"1/1"},children:a.jsx(oj,{id:t,isSmall:!0})})]}),a.jsxs(N,{sx:{gap:2},children:[a.jsx(gce,{id:t}),a.jsx(Cce,{id:t})]}),a.jsx(bce,{id:t})]}),c&&a.jsxs(a.Fragment,{children:[a.jsx(oj,{id:t}),a.jsx(cce,{id:t}),a.jsx(ace,{id:t})]})]}):null},Sce=d.memo(wce),n1=e=>{const t=W(i=>{var c;return(c=i.generation.model)==null?void 0:c.base_model}),n=te(),r=FO(e),o=d.useMemo(()=>{const i=r.filter(c=>t?c.base_model===t:!0)[0];return i||r[0]},[t,r]),s=d.useMemo(()=>!o,[o]);return[d.useCallback(()=>{s||n(cT({type:e,overrides:{model:o}}))},[n,o,s,e]),s]},kce=ae([he],({controlAdapters:e})=>{const t=[];let n=!1;const r=uT(e).filter(m=>m.isEnabled).length,o=dT(e).length;r>0&&t.push(`${r} IP`),r>o&&(n=!0);const s=fT(e).filter(m=>m.isEnabled).length,l=pT(e).length;s>0&&t.push(`${s} ControlNet`),s>l&&(n=!0);const i=mT(e).filter(m=>m.isEnabled).length,c=hT(e).length;return i>0&&t.push(`${i} T2I`),i>c&&(n=!0),{controlAdapterIds:gT(e).map(String),activeLabel:t.join(", "),isError:n}},Ce),_ce=()=>{const{t:e}=Z(),{controlAdapterIds:t,activeLabel:n}=W(kce),r=Dt("controlNet").isFeatureDisabled,[o,s]=n1("controlnet"),[l,i]=n1("ip_adapter"),[c,p]=n1("t2i_adapter");return r?null:a.jsx(Vr,{label:e("controlnet.controlAdapter",{count:t.length}),activeLabel:n,children:a.jsxs(N,{sx:{flexDir:"column",gap:2},children:[a.jsxs(Ht,{size:"sm",w:"full",justifyContent:"space-between",children:[a.jsx(ot,{tooltip:e("controlnet.addControlNet"),leftIcon:a.jsx(Xa,{}),onClick:o,"data-testid":"add controlnet",flexGrow:1,isDisabled:s,children:e("common.controlNet")}),a.jsx(ot,{tooltip:e("controlnet.addIPAdapter"),leftIcon:a.jsx(Xa,{}),onClick:l,"data-testid":"add ip adapter",flexGrow:1,isDisabled:i,children:e("common.ipAdapter")}),a.jsx(ot,{tooltip:e("controlnet.addT2IAdapter"),leftIcon:a.jsx(Xa,{}),onClick:c,"data-testid":"add t2i adapter",flexGrow:1,isDisabled:p,children:e("common.t2iAdapter")})]}),t.map((m,h)=>a.jsxs(d.Fragment,{children:[a.jsx(Jn,{}),a.jsx(Sce,{id:m,number:h+1})]},m))]})})},tu=d.memo(_ce),jce=e=>{const{onClick:t}=e,{t:n}=Z();return a.jsx(Be,{size:"sm","aria-label":n("embedding.addEmbedding"),tooltip:n("embedding.addEmbedding"),icon:a.jsx(xM,{}),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})},Ng=d.memo(jce),Ice="28rem",Pce=e=>{const{onSelect:t,isOpen:n,onClose:r,children:o}=e,{data:s}=vT(),l=d.useRef(null),{t:i}=Z(),c=W(h=>h.generation.model),p=d.useMemo(()=>{if(!s)return[];const h=[];return Un(s.entities,(g,x)=>{if(!g)return;const y=(c==null?void 0:c.base_model)!==g.base_model;h.push({value:g.model_name,label:g.model_name,group:pn[g.base_model],disabled:y,tooltip:y?`${i("embedding.incompatibleModel")} ${g.base_model}`:void 0})}),h.sort((g,x)=>{var y;return g.label&&x.label?(y=g.label)!=null&&y.localeCompare(x.label)?-1:1:-1}),h.sort((g,x)=>g.disabled&&!x.disabled?1:-1)},[s,c==null?void 0:c.base_model,i]),m=d.useCallback(h=>{h&&t(h)},[t]);return a.jsxs(Hd,{initialFocusRef:l,isOpen:n,onClose:r,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(Xh,{children:o}),a.jsx(Vd,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Qh,{sx:{p:0,w:`calc(${Ice} - 2rem )`},children:p.length===0?a.jsx(N,{sx:{justifyContent:"center",p:2,fontSize:"sm",color:"base.500",_dark:{color:"base.700"}},children:a.jsx(be,{children:"No Embeddings Loaded"})}):a.jsx(nn,{inputRef:l,autoFocus:!0,placeholder:i("embedding.addEmbedding"),value:null,data:p,nothingFound:i("embedding.noMatchingEmbedding"),itemComponent:fl,disabled:p.length===0,onDropdownClose:r,filter:(h,g)=>{var x;return((x=g.label)==null?void 0:x.toLowerCase().includes(h.toLowerCase().trim()))||g.value.toLowerCase().includes(h.toLowerCase().trim())},onChange:m})})})]})},Lg=d.memo(Pce),Ece=()=>{const e=W(h=>h.generation.negativePrompt),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),s=te(),{t:l}=Z(),i=d.useCallback(h=>{s(Hu(h.target.value))},[s]),c=d.useCallback(h=>{h.key==="<"&&o()},[o]),p=d.useCallback(h=>{if(!t.current)return;const g=t.current.selectionStart;if(g===void 0)return;let x=e.slice(0,g);x[x.length-1]!=="<"&&(x+="<"),x+=`${h}>`;const y=x.length;x+=e.slice(g),qr.flushSync(()=>{s(Hu(x))}),t.current.selectionEnd=y,r()},[s,r,e]),m=Dt("embedding").isFeatureEnabled;return a.jsxs(Zt,{children:[a.jsx(Lg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(Ot,{feature:"paramNegativeConditioning",placement:"right",children:a.jsx(da,{id:"negativePrompt",name:"negativePrompt",ref:t,value:e,placeholder:l("parameters.negativePromptPlaceholder"),onChange:i,resize:"vertical",fontSize:"sm",minH:16,...m&&{onKeyDown:c}})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Ng,{onClick:o})})]})},VO=d.memo(Ece),Mce=ae([he],({generation:e})=>({prompt:e.positivePrompt}),{memoizeOptions:{resultEqualityCheck:Bt}}),Oce=()=>{const e=te(),{prompt:t}=W(Mce),n=d.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Lr(),{t:l}=Z(),i=d.useCallback(h=>{e(Bu(h.target.value))},[e]);nt("alt+a",()=>{var h;(h=n.current)==null||h.focus()},[]);const c=d.useCallback(h=>{if(!n.current)return;const g=n.current.selectionStart;if(g===void 0)return;let x=t.slice(0,g);x[x.length-1]!=="<"&&(x+="<"),x+=`${h}>`;const y=x.length;x+=t.slice(g),qr.flushSync(()=>{e(Bu(x))}),n.current.selectionStart=y,n.current.selectionEnd=y,o()},[e,o,t]),p=Dt("embedding").isFeatureEnabled,m=d.useCallback(h=>{p&&h.key==="<"&&s()},[s,p]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(Zt,{children:a.jsx(Lg,{isOpen:r,onClose:o,onSelect:c,children:a.jsx(Ot,{feature:"paramPositiveConditioning",placement:"right",children:a.jsx(da,{id:"prompt",name:"prompt",ref:n,value:t,placeholder:l("parameters.positivePromptPlaceholder"),onChange:i,onKeyDown:m,resize:"vertical",minH:32})})})}),!r&&p&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Ng,{onClick:s})})]})},WO=d.memo(Oce);function Rce(){const e=W(o=>o.sdxl.shouldConcatSDXLStylePrompt),t=te(),{t:n}=Z(),r=()=>{t(xT(!e))};return a.jsx(Be,{"aria-label":n("sdxl.concatPromptStyle"),tooltip:n("sdxl.concatPromptStyle"),variant:"outline",isChecked:e,onClick:r,icon:a.jsx(SM,{}),size:"xs",sx:{position:"absolute",insetInlineEnd:1,top:6,border:"none",color:e?"accent.500":"base.500",_hover:{bg:"none"}}})}const hj={position:"absolute",bg:"none",w:"full",minH:2,borderRadius:0,borderLeft:"none",borderRight:"none",zIndex:2,maskImage:"radial-gradient(circle at center, black, black 65%, black 30%, black 15%, transparent)"};function UO(){return a.jsxs(N,{children:[a.jsx(Ie,{as:jn.div,initial:{scaleX:0,borderWidth:0,display:"none"},animate:{display:["block","block","block","none"],scaleX:[0,.25,.5,1],borderWidth:[0,3,3,0],transition:{duration:.37,times:[0,.25,.5,1]}},sx:{top:"1px",borderTop:"none",borderColor:"base.400",...hj,_dark:{borderColor:"accent.500"}}}),a.jsx(Ie,{as:jn.div,initial:{opacity:0,scale:0},animate:{opacity:[0,1,1,1],scale:[0,.75,1.5,1],transition:{duration:.42,times:[0,.25,.5,1]}},exit:{opacity:0,scale:0},sx:{zIndex:3,position:"absolute",left:"48%",top:"3px",p:1,borderRadius:4,bg:"accent.400",color:"base.50",_dark:{bg:"accent.500"}},children:a.jsx(SM,{size:12})}),a.jsx(Ie,{as:jn.div,initial:{scaleX:0,borderWidth:0,display:"none"},animate:{display:["block","block","block","none"],scaleX:[0,.25,.5,1],borderWidth:[0,3,3,0],transition:{duration:.37,times:[0,.25,.5,1]}},sx:{top:"17px",borderBottom:"none",borderColor:"base.400",...hj,_dark:{borderColor:"accent.500"}}})]})}const Dce=ae([he],({sdxl:e})=>{const{negativeStylePrompt:t,shouldConcatSDXLStylePrompt:n}=e;return{prompt:t,shouldConcatSDXLStylePrompt:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),Ace=()=>{const e=te(),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),{t:s}=Z(),{prompt:l,shouldConcatSDXLStylePrompt:i}=W(Dce),c=d.useCallback(g=>{e(Wu(g.target.value))},[e]),p=d.useCallback(g=>{if(!t.current)return;const x=t.current.selectionStart;if(x===void 0)return;let y=l.slice(0,x);y[y.length-1]!=="<"&&(y+="<"),y+=`${g}>`;const b=y.length;y+=l.slice(x),qr.flushSync(()=>{e(Wu(y))}),t.current.selectionStart=b,t.current.selectionEnd=b,r()},[e,r,l]),m=Dt("embedding").isFeatureEnabled,h=d.useCallback(g=>{m&&g.key==="<"&&o()},[o,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(fr,{children:i&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(UO,{})})}),a.jsx(Zt,{children:a.jsx(Lg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(da,{id:"prompt",name:"prompt",ref:t,value:l,placeholder:s("sdxl.negStylePrompt"),onChange:c,onKeyDown:h,resize:"vertical",fontSize:"sm",minH:16})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Ng,{onClick:o})})]})},Tce=d.memo(Ace),$ce=ae([he],({sdxl:e})=>{const{positiveStylePrompt:t,shouldConcatSDXLStylePrompt:n}=e;return{prompt:t,shouldConcatSDXLStylePrompt:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),Nce=()=>{const e=te(),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),{t:s}=Z(),{prompt:l,shouldConcatSDXLStylePrompt:i}=W($ce),c=d.useCallback(g=>{e(Vu(g.target.value))},[e]),p=d.useCallback(g=>{if(!t.current)return;const x=t.current.selectionStart;if(x===void 0)return;let y=l.slice(0,x);y[y.length-1]!=="<"&&(y+="<"),y+=`${g}>`;const b=y.length;y+=l.slice(x),qr.flushSync(()=>{e(Vu(y))}),t.current.selectionStart=b,t.current.selectionEnd=b,r()},[e,r,l]),m=Dt("embedding").isFeatureEnabled,h=d.useCallback(g=>{m&&g.key==="<"&&o()},[o,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(fr,{children:i&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(UO,{})})}),a.jsx(Zt,{children:a.jsx(Lg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(da,{id:"prompt",name:"prompt",ref:t,value:l,placeholder:s("sdxl.posStylePrompt"),onChange:c,onKeyDown:h,resize:"vertical",minH:16})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Ng,{onClick:o})})]})},Lce=d.memo(Nce);function p2(){return a.jsxs(N,{sx:{flexDirection:"column",gap:2},children:[a.jsx(WO,{}),a.jsx(Rce,{}),a.jsx(Lce,{}),a.jsx(VO,{}),a.jsx(Tce,{})]})}const di=()=>{const{isRefinerAvailable:e}=Qo(fb,{selectFromResult:({data:t})=>({isRefinerAvailable:t?t.ids.length>0:!1})});return e},zce=ae([he],({sdxl:e,ui:t,hotkeys:n})=>{const{refinerCFGScale:r}=e,{shouldUseSliders:o}=t,{shift:s}=n;return{refinerCFGScale:r,shouldUseSliders:o,shift:s}},Ce),Fce=()=>{const{refinerCFGScale:e,shouldUseSliders:t,shift:n}=W(zce),r=di(),o=te(),{t:s}=Z(),l=d.useCallback(c=>o(g1(c)),[o]),i=d.useCallback(()=>o(g1(7)),[o]);return t?a.jsx(Je,{label:s("sdxl.cfgScale"),step:n?.1:.5,min:1,max:20,onChange:l,handleReset:i,value:e,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!r}):a.jsx(Yc,{label:s("sdxl.cfgScale"),step:.5,min:1,max:200,onChange:l,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"},isDisabled:!r})},Bce=d.memo(Fce),Hce=e=>{const t=ll("models"),[n,r,o]=e.split("/"),s=bT.safeParse({base_model:n,model_name:o,model_type:r});if(!s.success){t.error({mainModelId:e,errors:s.error.format()},"Failed to parse main model id");return}return s.data},Vce=ae(he,e=>({model:e.sdxl.refinerModel}),Ce),Wce=()=>{const e=te(),t=Dt("syncModels").isFeatureEnabled,{model:n}=W(Vce),{t:r}=Z(),{data:o,isLoading:s}=Qo(fb),l=d.useMemo(()=>{if(!o)return[];const p=[];return Un(o.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:pn[m.base_model]})}),p},[o]),i=d.useMemo(()=>(o==null?void 0:o.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])??null,[o==null?void 0:o.entities,n]),c=d.useCallback(p=>{if(!p)return;const m=Hce(p);m&&e(CI(m))},[e]);return s?a.jsx(nn,{label:r("sdxl.refinermodel"),placeholder:r("sdxl.loading"),disabled:!0,data:[]}):a.jsxs(N,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{tooltip:i==null?void 0:i.description,label:r("sdxl.refinermodel"),value:i==null?void 0:i.id,placeholder:l.length>0?r("sdxl.selectAModel"):r("sdxl.noModelsAvailable"),data:l,error:l.length===0,disabled:l.length===0,onChange:c,w:"100%"}),t&&a.jsx(Ie,{mt:7,children:a.jsx(Qc,{iconMode:!0})})]})},Uce=d.memo(Wce),Gce=ae([he],({sdxl:e,hotkeys:t})=>{const{refinerNegativeAestheticScore:n}=e,{shift:r}=t;return{refinerNegativeAestheticScore:n,shift:r}},Ce),Kce=()=>{const{refinerNegativeAestheticScore:e,shift:t}=W(Gce),n=di(),r=te(),{t:o}=Z(),s=d.useCallback(i=>r(x1(i)),[r]),l=d.useCallback(()=>r(x1(2.5)),[r]);return a.jsx(Je,{label:o("sdxl.negAestheticScore"),step:t?.1:.5,min:1,max:10,onChange:s,handleReset:l,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},qce=d.memo(Kce),Xce=ae([he],({sdxl:e,hotkeys:t})=>{const{refinerPositiveAestheticScore:n}=e,{shift:r}=t;return{refinerPositiveAestheticScore:n,shift:r}},Ce),Qce=()=>{const{refinerPositiveAestheticScore:e,shift:t}=W(Xce),n=di(),r=te(),{t:o}=Z(),s=d.useCallback(i=>r(v1(i)),[r]),l=d.useCallback(()=>r(v1(6)),[r]);return a.jsx(Je,{label:o("sdxl.posAestheticScore"),step:t?.1:.5,min:1,max:10,onChange:s,handleReset:l,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Yce=d.memo(Qce),Zce=ae(he,({ui:e,sdxl:t})=>{const{refinerScheduler:n}=t,{favoriteSchedulers:r}=e,o=kr(Ch,(s,l)=>({value:l,label:s,group:r.includes(l)?"Favorites":void 0})).sort((s,l)=>s.label.localeCompare(l.label));return{refinerScheduler:n,data:o}},Ce),Jce=()=>{const e=te(),{t}=Z(),{refinerScheduler:n,data:r}=W(Zce),o=di(),s=d.useCallback(l=>{l&&e(wI(l))},[e]);return a.jsx(nn,{w:"100%",label:t("sdxl.scheduler"),value:n,data:r,onChange:s,disabled:!o})},eue=d.memo(Jce),tue=ae([he],({sdxl:e})=>{const{refinerStart:t}=e;return{refinerStart:t}},Ce),nue=()=>{const{refinerStart:e}=W(tue),t=te(),n=di(),r=d.useCallback(l=>t(b1(l)),[t]),{t:o}=Z(),s=d.useCallback(()=>t(b1(.8)),[t]);return a.jsx(Je,{label:o("sdxl.refinerStart"),step:.01,min:0,max:1,onChange:r,handleReset:s,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},rue=d.memo(nue),oue=ae([he],({sdxl:e,ui:t})=>{const{refinerSteps:n}=e,{shouldUseSliders:r}=t;return{refinerSteps:n,shouldUseSliders:r}},Ce),sue=()=>{const{refinerSteps:e,shouldUseSliders:t}=W(oue),n=di(),r=te(),{t:o}=Z(),s=d.useCallback(i=>{r(h1(i))},[r]),l=d.useCallback(()=>{r(h1(20))},[r]);return t?a.jsx(Je,{label:o("sdxl.steps"),min:1,max:100,step:1,onChange:s,handleReset:l,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:500},isDisabled:!n}):a.jsx(Yc,{label:o("sdxl.steps"),min:1,max:500,step:1,onChange:s,value:e,numberInputFieldProps:{textAlign:"center"},isDisabled:!n})},aue=d.memo(sue);function lue(){const e=W(s=>s.sdxl.shouldUseSDXLRefiner),t=di(),n=te(),{t:r}=Z(),o=s=>{n(yT(s.target.checked))};return a.jsx(Cn,{label:r("sdxl.useRefiner"),isChecked:e,onChange:o,isDisabled:!t})}const iue=ae(he,e=>{const{shouldUseSDXLRefiner:t}=e.sdxl,{shouldUseSliders:n}=e.ui;return{activeLabel:t?"Enabled":void 0,shouldUseSliders:n}},Ce),cue=()=>{const{activeLabel:e,shouldUseSliders:t}=W(iue),{t:n}=Z();return a.jsx(Vr,{label:n("sdxl.refiner"),activeLabel:e,children:a.jsxs(N,{sx:{gap:2,flexDir:"column"},children:[a.jsx(lue,{}),a.jsx(Uce,{}),a.jsxs(N,{gap:2,flexDirection:t?"column":"row",children:[a.jsx(aue,{}),a.jsx(Bce,{})]}),a.jsx(eue,{}),a.jsx(Yce,{}),a.jsx(qce,{}),a.jsx(rue,{})]})})},m2=d.memo(cue),uue=ae([he],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:l,inputMax:i}=t.sd.guidance,{cfgScale:c}=e,{shouldUseSliders:p}=n,{shift:m}=r;return{cfgScale:c,initial:o,min:s,sliderMax:l,inputMax:i,shouldUseSliders:p,shift:m}},Ce),due=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:l}=W(uue),i=te(),{t:c}=Z(),p=d.useCallback(h=>i(em(h)),[i]),m=d.useCallback(()=>i(em(t)),[i,t]);return s?a.jsx(Ot,{feature:"paramCFGScale",children:a.jsx(Je,{label:c("parameters.cfgScale"),step:l?.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(Ot,{feature:"paramCFGScale",children:a.jsx(Yc,{label:c("parameters.cfgScale"),step:.5,min:n,max:o,onChange:p,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})})},Is=d.memo(due),fue=ae(he,e=>({model:e.generation.model}),Ce),pue=()=>{const e=te(),{t}=Z(),{model:n}=W(fue),r=Dt("syncModels").isFeatureEnabled,{data:o,isLoading:s}=Qo(jw),{data:l,isLoading:i}=Zu(jw),c=W(er),p=d.useMemo(()=>{if(!o)return[];const g=[];return Un(o.entities,(x,y)=>{x&&g.push({value:y,label:x.model_name,group:pn[x.base_model]})}),Un(l==null?void 0:l.entities,(x,y)=>{!x||c==="unifiedCanvas"||c==="img2img"||g.push({value:y,label:x.model_name,group:pn[x.base_model]})}),g},[o,l,c]),m=d.useMemo(()=>((o==null?void 0:o.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])||(l==null?void 0:l.entities[`${n==null?void 0:n.base_model}/onnx/${n==null?void 0:n.model_name}`]))??null,[o==null?void 0:o.entities,n,l==null?void 0:l.entities]),h=d.useCallback(g=>{if(!g)return;const x=$g(g);x&&e(p1(x))},[e]);return s||i?a.jsx(nn,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs(N,{w:"100%",alignItems:"center",gap:3,children:[a.jsx(Ot,{feature:"paramModel",children:a.jsx(nn,{tooltip:m==null?void 0:m.description,label:t("modelManager.model"),value:m==null?void 0:m.id,placeholder:p.length>0?"Select a model":"No models available",data:p,error:p.length===0,disabled:p.length===0,onChange:h,w:"100%"})}),r&&a.jsx(Ie,{mt:6,children:a.jsx(Qc,{iconMode:!0})})]})},mue=d.memo(pue),hue=ae(he,({generation:e})=>{const{model:t,vae:n}=e;return{model:t,vae:n}},Ce),gue=()=>{const e=te(),{t}=Z(),{model:n,vae:r}=W(hue),{data:o}=DI(),s=d.useMemo(()=>{if(!o)return[];const c=[{value:"default",label:"Default",group:"Default"}];return Un(o.entities,(p,m)=>{if(!p)return;const h=(n==null?void 0:n.base_model)!==p.base_model;c.push({value:m,label:p.model_name,group:pn[p.base_model],disabled:h,tooltip:h?`Incompatible base model: ${p.base_model}`:void 0})}),c.sort((p,m)=>p.disabled&&!m.disabled?1:-1)},[o,n==null?void 0:n.base_model]),l=d.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]),i=d.useCallback(c=>{if(!c||c==="default"){e(Iw(null));return}const p=$O(c);p&&e(Iw(p))},[e]);return a.jsx(Ot,{feature:"paramVAE",children:a.jsx(nn,{itemComponent:fl,tooltip:l==null?void 0:l.description,label:t("modelManager.vae"),value:(l==null?void 0:l.id)??"default",placeholder:"Default",data:s,onChange:i,disabled:s.length===0,clearable:!0})})},vue=d.memo(gue),xue=ae([$I,ss],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=kr(Ch,(s,l)=>({value:l,label:s,group:r.includes(l)?"Favorites":void 0})).sort((s,l)=>s.label.localeCompare(l.label));return{scheduler:n,data:o}},Ce),bue=()=>{const e=te(),{t}=Z(),{scheduler:n,data:r}=W(xue),o=d.useCallback(s=>{s&&e(m1(s))},[e]);return a.jsx(Ot,{feature:"paramScheduler",children:a.jsx(nn,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})})},yue=d.memo(bue),Cue=ae(he,({generation:e})=>{const{vaePrecision:t}=e;return{vaePrecision:t}},Ce),wue=["fp16","fp32"],Sue=()=>{const{t:e}=Z(),t=te(),{vaePrecision:n}=W(Cue),r=d.useCallback(o=>{o&&t(CT(o))},[t]);return a.jsx(Ot,{feature:"paramVAEPrecision",children:a.jsx(On,{label:e("modelManager.vaePrecision"),value:n,data:wue,onChange:r})})},kue=d.memo(Sue),_ue=()=>{const e=Dt("vae").isFeatureEnabled;return a.jsxs(N,{gap:3,w:"full",flexWrap:e?"wrap":"nowrap",children:[a.jsx(Ie,{w:"full",children:a.jsx(mue,{})}),a.jsx(Ie,{w:"full",children:a.jsx(yue,{})}),e&&a.jsxs(N,{w:"full",gap:3,children:[a.jsx(vue,{}),a.jsx(kue,{})]})]})},Ps=d.memo(_ue),GO=[{name:bt.t("parameters.aspectRatioFree"),value:null},{name:"2:3",value:2/3},{name:"16:9",value:16/9},{name:"1:1",value:1/1}],KO=GO.map(e=>e.value);function qO(){const e=W(o=>o.generation.aspectRatio),t=te(),n=W(o=>o.generation.shouldFitToWidthHeight),r=W(er);return a.jsx(Ht,{isAttached:!0,children:GO.map(o=>a.jsx(ot,{size:"sm",isChecked:e===o.value,isDisabled:r==="img2img"?!n:!1,onClick:()=>{t(zo(o.value)),t(Ju(!1))},children:o.name},o.name))})}const jue=ae([he],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:l,coarseStep:i}=n.sd.height,{model:c,height:p}=e,{aspectRatio:m}=e,h=t.shift?l:i;return{model:c,height:p,min:r,sliderMax:o,inputMax:s,step:h,aspectRatio:m}},Ce),Iue=e=>{const{model:t,height:n,min:r,sliderMax:o,inputMax:s,step:l,aspectRatio:i}=W(jue),c=te(),{t:p}=Z(),m=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,h=d.useCallback(x=>{if(c(Vl(x)),i){const y=Wn(x*i,8);c(Hl(y))}},[c,i]),g=d.useCallback(()=>{if(c(Vl(m)),i){const x=Wn(m*i,8);c(Hl(x))}},[c,m,i]);return a.jsx(Je,{label:p("parameters.height"),value:n,min:r,step:l,max:o,onChange:h,handleReset:g,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},Pue=d.memo(Iue),Eue=ae([he],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:l,coarseStep:i}=n.sd.width,{model:c,width:p,aspectRatio:m}=e,h=t.shift?l:i;return{model:c,width:p,min:r,sliderMax:o,inputMax:s,step:h,aspectRatio:m}},Ce),Mue=e=>{const{model:t,width:n,min:r,sliderMax:o,inputMax:s,step:l,aspectRatio:i}=W(Eue),c=te(),{t:p}=Z(),m=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,h=d.useCallback(x=>{if(c(Hl(x)),i){const y=Wn(x/i,8);c(Vl(y))}},[c,i]),g=d.useCallback(()=>{if(c(Hl(m)),i){const x=Wn(m/i,8);c(Vl(x))}},[c,m,i]);return a.jsx(Je,{label:p("parameters.width"),value:n,min:r,step:l,max:o,onChange:h,handleReset:g,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},Oue=d.memo(Mue),Rue=ae([ss,er],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}=e;return{activeTabName:t,shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}},Ce);function Dc(){const{t:e}=Z(),t=te(),{activeTabName:n,shouldFitToWidthHeight:r,shouldLockAspectRatio:o,width:s,height:l}=W(Rue),i=d.useCallback(()=>{o?(t(Ju(!1)),KO.includes(s/l)?t(zo(s/l)):t(zo(null))):(t(Ju(!0)),t(zo(s/l)))},[o,s,l,t]),c=d.useCallback(()=>{t(wT()),t(zo(null)),o&&t(zo(l/s))},[t,o,s,l]);return a.jsxs(N,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsx(Ot,{feature:"paramRatio",children:a.jsxs(Zt,{as:N,flexDir:"row",alignItems:"center",gap:2,children:[a.jsx(In,{children:e("parameters.aspectRatio")}),a.jsx(ba,{}),a.jsx(qO,{}),a.jsx(Be,{tooltip:e("ui.swapSizes"),"aria-label":e("ui.swapSizes"),size:"sm",icon:a.jsx(X8,{}),fontSize:20,isDisabled:n==="img2img"?!r:!1,onClick:c}),a.jsx(Be,{tooltip:e("ui.lockRatio"),"aria-label":e("ui.lockRatio"),size:"sm",icon:a.jsx(kM,{}),isChecked:o,isDisabled:n==="img2img"?!r:!1,onClick:i})]})}),a.jsx(N,{gap:2,alignItems:"center",children:a.jsxs(N,{gap:2,flexDirection:"column",width:"full",children:[a.jsx(Oue,{isDisabled:n==="img2img"?!r:!1}),a.jsx(Pue,{isDisabled:n==="img2img"?!r:!1})]})})]})}const Due=ae([he],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:l,inputMax:i,fineStep:c,coarseStep:p}=t.sd.steps,{steps:m}=e,{shouldUseSliders:h}=n,g=r.shift?c:p;return{steps:m,initial:o,min:s,sliderMax:l,inputMax:i,step:g,shouldUseSliders:h}},Ce),Aue=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:l}=W(Due),i=te(),{t:c}=Z(),p=d.useCallback(g=>{i(tm(g))},[i]),m=d.useCallback(()=>{i(tm(t))},[i,t]),h=d.useCallback(()=>{i(ub())},[i]);return l?a.jsx(Ot,{feature:"paramSteps",children:a.jsx(Je,{label:c("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(Ot,{feature:"paramSteps",children:a.jsx(Yc,{label:c("parameters.steps"),min:n,max:o,step:s,onChange:p,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:h})})},Es=d.memo(Aue);function XO(){const e=te(),t=W(o=>o.generation.shouldFitToWidthHeight),n=o=>e(ST(o.target.checked)),{t:r}=Z();return a.jsx(Cn,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function Tue(){const e=W(l=>l.generation.seed),t=W(l=>l.generation.shouldRandomizeSeed),n=W(l=>l.generation.shouldGenerateVariations),{t:r}=Z(),o=te(),s=l=>o(Jp(l));return a.jsx(Yc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:NI,max:LI,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e})}const $ue=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function Nue(){const e=te(),t=W(o=>o.generation.shouldRandomizeSeed),{t:n}=Z(),r=()=>e(Jp($ue(NI,LI)));return a.jsx(Be,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:a.jsx(fee,{})})}const Lue=()=>{const e=te(),{t}=Z(),n=W(o=>o.generation.shouldRandomizeSeed),r=o=>e(kT(o.target.checked));return a.jsx(Cn,{label:t("common.random"),isChecked:n,onChange:r})},zue=d.memo(Lue),Fue=()=>a.jsx(Ot,{feature:"paramSeed",children:a.jsxs(N,{sx:{gap:3,alignItems:"flex-end"},children:[a.jsx(Tue,{}),a.jsx(Nue,{}),a.jsx(zue,{})]})}),Ms=d.memo(Fue),QO=_e((e,t)=>a.jsxs(N,{ref:t,sx:{flexDir:"column",gap:2,bg:"base.100",px:4,pt:2,pb:4,borderRadius:"base",_dark:{bg:"base.750"}},children:[a.jsx(be,{fontSize:"sm",fontWeight:"bold",sx:{color:"base.600",_dark:{color:"base.300"}},children:e.label}),e.children]}));QO.displayName="SubSettingsWrapper";const Ac=d.memo(QO),Bue=ae([he],({sdxl:e})=>{const{sdxlImg2ImgDenoisingStrength:t}=e;return{sdxlImg2ImgDenoisingStrength:t}},Ce),Hue=()=>{const{sdxlImg2ImgDenoisingStrength:e}=W(Bue),t=te(),{t:n}=Z(),r=d.useCallback(s=>t(Pw(s)),[t]),o=d.useCallback(()=>{t(Pw(.7))},[t]);return a.jsx(Ot,{feature:"paramDenoisingStrength",children:a.jsx(Ac,{children:a.jsx(Je,{label:n("sdxl.denoisingStrength"),step:.01,min:0,max:1,onChange:r,handleReset:o,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0})})})},YO=d.memo(Hue),Vue=ae([$I,ss],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),Wue=()=>{const{t:e}=Z(),{shouldUseSliders:t,activeLabel:n}=W(Vue);return a.jsx(Vr,{label:e("parameters.general"),activeLabel:n,defaultIsOpen:!0,children:a.jsxs(N,{sx:{flexDirection:"column",gap:3},children:[t?a.jsxs(a.Fragment,{children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Dc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(N,{gap:3,children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{})]}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Dc,{})]}),a.jsx(YO,{}),a.jsx(XO,{})]})})},Uue=d.memo(Wue),Gue=()=>a.jsxs(a.Fragment,{children:[a.jsx(p2,{}),a.jsx(Uue,{}),a.jsx(m2,{}),a.jsx(tu,{}),a.jsx(Jc,{}),a.jsx(Zc,{}),a.jsx(eu,{})]}),Kue=d.memo(Gue),h2=()=>{const{t:e}=Z(),t=W(l=>l.generation.shouldRandomizeSeed),n=W(l=>l.generation.iterations),r=d.useMemo(()=>n===1?e("parameters.iterationsWithCount_one",{count:1}):e("parameters.iterationsWithCount_other",{count:n}),[n,e]),o=d.useMemo(()=>e(t?"parameters.randomSeed":"parameters.manualSeed"),[t,e]);return{iterationsAndSeedLabel:d.useMemo(()=>[r,o].join(", "),[r,o]),iterationsLabel:r,seedLabel:o}},que=()=>{const{t:e}=Z(),t=W(r=>r.ui.shouldUseSliders),{iterationsAndSeedLabel:n}=h2();return a.jsx(Vr,{label:e("parameters.general"),activeLabel:n,defaultIsOpen:!0,children:a.jsx(N,{sx:{flexDirection:"column",gap:3},children:t?a.jsxs(a.Fragment,{children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Dc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(N,{gap:3,children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{})]}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Dc,{})]})})})},ZO=d.memo(que),Xue=()=>a.jsxs(a.Fragment,{children:[a.jsx(p2,{}),a.jsx(ZO,{}),a.jsx(m2,{}),a.jsx(tu,{}),a.jsx(Jc,{}),a.jsx(Zc,{}),a.jsx(eu,{})]}),Que=d.memo(Xue),Yue=[{label:"Unmasked",value:"unmasked"},{label:"Mask",value:"mask"},{label:"Mask Edge",value:"edge"}],Zue=()=>{const e=te(),t=W(o=>o.generation.canvasCoherenceMode),{t:n}=Z(),r=o=>{o&&e(_T(o))};return a.jsx(Ot,{feature:"compositingCoherenceMode",children:a.jsx(On,{label:n("parameters.coherenceMode"),data:Yue,value:t,onChange:r})})},Jue=d.memo(Zue),ede=()=>{const e=te(),t=W(r=>r.generation.canvasCoherenceSteps),{t:n}=Z();return a.jsx(Ot,{feature:"compositingCoherenceSteps",children:a.jsx(Je,{label:n("parameters.coherenceSteps"),min:1,max:100,step:1,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(Ew(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Ew(20))}})})},tde=d.memo(ede),nde=()=>{const e=te(),t=W(r=>r.generation.canvasCoherenceStrength),{t:n}=Z();return a.jsx(Ot,{feature:"compositingStrength",children:a.jsx(Je,{label:n("parameters.coherenceStrength"),min:0,max:1,step:.01,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(Mw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Mw(.3))}})})},rde=d.memo(nde);function ode(){const e=te(),t=W(r=>r.generation.maskBlur),{t:n}=Z();return a.jsx(Ot,{feature:"compositingBlur",children:a.jsx(Je,{label:n("parameters.maskBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(Ow(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Ow(16))}})})}const sde=[{label:"Box Blur",value:"box"},{label:"Gaussian Blur",value:"gaussian"}];function ade(){const e=W(o=>o.generation.maskBlurMethod),t=te(),{t:n}=Z(),r=o=>{o&&t(jT(o))};return a.jsx(Ot,{feature:"compositingBlurMethod",children:a.jsx(On,{value:e,onChange:r,label:n("parameters.maskBlurMethod"),data:sde})})}const lde=()=>{const{t:e}=Z();return a.jsx(Vr,{label:e("parameters.compositingSettingsHeader"),children:a.jsxs(N,{sx:{flexDirection:"column",gap:2},children:[a.jsxs(Ac,{label:e("parameters.coherencePassHeader"),children:[a.jsx(Jue,{}),a.jsx(tde,{}),a.jsx(rde,{})]}),a.jsx(Jn,{}),a.jsxs(Ac,{label:e("parameters.maskAdjustmentsHeader"),children:[a.jsx(ode,{}),a.jsx(ade,{})]})]})})},JO=d.memo(lde),ide=ae([he],({generation:e})=>{const{infillMethod:t}=e;return{infillMethod:t}},Ce),cde=()=>{const e=te(),{infillMethod:t}=W(ide),{data:n,isLoading:r}=fI(),o=n==null?void 0:n.infill_methods,{t:s}=Z(),l=d.useCallback(i=>{e(IT(i))},[e]);return a.jsx(Ot,{feature:"infillMethod",children:a.jsx(On,{disabled:(o==null?void 0:o.length)===0,placeholder:r?"Loading...":void 0,label:s("parameters.infillMethod"),value:t,data:o??[],onChange:l})})},ude=d.memo(cde),dde=ae([ss],e=>{const{infillPatchmatchDownscaleSize:t,infillMethod:n}=e;return{infillPatchmatchDownscaleSize:t,infillMethod:n}},Ce),fde=()=>{const e=te(),{infillPatchmatchDownscaleSize:t,infillMethod:n}=W(dde),{t:r}=Z(),o=d.useCallback(l=>{e(Rw(l))},[e]),s=d.useCallback(()=>{e(Rw(2))},[e]);return a.jsx(Je,{isDisabled:n!=="patchmatch",label:r("parameters.patchmatchDownScaleSize"),min:1,max:10,value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},pde=d.memo(fde),mde=ae([ss],e=>{const{infillTileSize:t,infillMethod:n}=e;return{infillTileSize:t,infillMethod:n}},Ce),hde=()=>{const e=te(),{infillTileSize:t,infillMethod:n}=W(mde),{t:r}=Z(),o=d.useCallback(l=>{e(Dw(l))},[e]),s=d.useCallback(()=>{e(Dw(32))},[e]);return a.jsx(Je,{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})},gde=d.memo(hde),vde=ae([ss],e=>{const{infillMethod:t}=e;return{infillMethod:t}},Ce);function xde(){const{infillMethod:e}=W(vde);return a.jsxs(N,{children:[e==="tile"&&a.jsx(gde,{}),e==="patchmatch"&&a.jsx(pde,{})]})}const wn=e=>e.canvas,Eo=ae([he],({canvas:e})=>e.batchIds.length>0||e.layerState.stagingArea.images.length>0),bde=ae([wn],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},Ce),yde=()=>{const e=te(),{boundingBoxScale:t}=W(bde),{t:n}=Z(),r=o=>{e(ET(o))};return a.jsx(Ot,{feature:"scaleBeforeProcessing",children:a.jsx(nn,{label:n("parameters.scaleBeforeProcessing"),data:PT,value:t,onChange:r})})},Cde=d.memo(yde),wde=ae([ss,wn],(e,t)=>{const{scaledBoundingBoxDimensions:n,boundingBoxScaleMethod:r}=t,{model:o,aspectRatio:s}=e;return{model:o,scaledBoundingBoxDimensions:n,isManual:r==="manual",aspectRatio:s}},Ce),Sde=()=>{const e=te(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=W(wde),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:l}=Z(),i=p=>{let m=r.width;const h=Math.floor(p);o&&(m=Wn(h*o,64)),e(om({width:m,height:h}))},c=()=>{let p=r.width;const m=Math.floor(s);o&&(p=Wn(m*o,64)),e(om({width:p,height:m}))};return a.jsx(Je,{isDisabled:!n,label:l("parameters.scaledHeight"),min:64,max:1536,step:64,value:r.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:c})},kde=d.memo(Sde),_de=ae([wn,ss],(e,t)=>{const{boundingBoxScaleMethod:n,scaledBoundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,scaledBoundingBoxDimensions:r,aspectRatio:s,isManual:n==="manual"}},Ce),jde=()=>{const e=te(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=W(_de),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:l}=Z(),i=p=>{const m=Math.floor(p);let h=r.height;o&&(h=Wn(m/o,64)),e(om({width:m,height:h}))},c=()=>{const p=Math.floor(s);let m=r.height;o&&(m=Wn(p/o,64)),e(om({width:p,height:m}))};return a.jsx(Je,{isDisabled:!n,label:l("parameters.scaledWidth"),min:64,max:1536,step:64,value:r.width,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:c})},Ide=d.memo(jde),Pde=()=>{const{t:e}=Z();return a.jsx(Vr,{label:e("parameters.infillScalingHeader"),children:a.jsxs(N,{sx:{gap:2,flexDirection:"column"},children:[a.jsxs(Ac,{children:[a.jsx(ude,{}),a.jsx(xde,{})]}),a.jsx(Jn,{}),a.jsxs(Ac,{children:[a.jsx(Cde,{}),a.jsx(Ide,{}),a.jsx(kde,{})]})]})})},e7=d.memo(Pde),Ede=ae([he,Eo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Ce),Mde=()=>{const e=te(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=W(Ede),{t:s}=Z(),l=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,i=p=>{if(e(Wo({...n,height:Math.floor(p)})),o){const m=Wn(p*o,64);e(Wo({width:m,height:Math.floor(p)}))}},c=()=>{if(e(Wo({...n,height:Math.floor(l)})),o){const p=Wn(l*o,64);e(Wo({width:p,height:Math.floor(l)}))}};return a.jsx(Je,{label:s("parameters.boundingBoxHeight"),min:64,max:1536,step:64,value:n.height,onChange:i,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:c})},Ode=d.memo(Mde),Rde=ae([he,Eo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Ce),Dde=()=>{const e=te(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=W(Rde),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:l}=Z(),i=p=>{if(e(Wo({...n,width:Math.floor(p)})),o){const m=Wn(p/o,64);e(Wo({width:Math.floor(p),height:m}))}},c=()=>{if(e(Wo({...n,width:Math.floor(s)})),o){const p=Wn(s/o,64);e(Wo({width:Math.floor(s),height:p}))}};return a.jsx(Je,{label:l("parameters.boundingBoxWidth"),min:64,max:1536,step:64,value:n.width,onChange:i,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:c})},Ade=d.memo(Dde),Tde=ae([ss,wn],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r}=e,{boundingBoxDimensions:o}=t;return{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,boundingBoxDimensions:o}});function vh(){const e=te(),{t}=Z(),{shouldLockAspectRatio:n,boundingBoxDimensions:r}=W(Tde),o=d.useCallback(()=>{n?(e(Ju(!1)),KO.includes(r.width/r.height)?e(zo(r.width/r.height)):e(zo(null))):(e(Ju(!0)),e(zo(r.width/r.height)))},[n,r,e]),s=d.useCallback(()=>{e(MT()),e(zo(null)),n&&e(zo(r.height/r.width))},[e,n,r]);return a.jsxs(N,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.100",_dark:{bg:"base.750"}},children:[a.jsx(Ot,{feature:"paramRatio",children:a.jsxs(Zt,{as:N,flexDir:"row",alignItems:"center",gap:2,children:[a.jsx(In,{children:t("parameters.aspectRatio")}),a.jsx(ba,{}),a.jsx(qO,{}),a.jsx(Be,{tooltip:t("ui.swapSizes"),"aria-label":t("ui.swapSizes"),size:"sm",icon:a.jsx(X8,{}),fontSize:20,onClick:s}),a.jsx(Be,{tooltip:t("ui.lockRatio"),"aria-label":t("ui.lockRatio"),size:"sm",icon:a.jsx(kM,{}),isChecked:n,onClick:o})]})}),a.jsx(Ade,{}),a.jsx(Ode,{})]})}const $de=ae(he,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),Nde=()=>{const{t:e}=Z(),{shouldUseSliders:t,activeLabel:n}=W($de);return a.jsx(Vr,{label:e("parameters.general"),activeLabel:n,defaultIsOpen:!0,children:a.jsxs(N,{sx:{flexDirection:"column",gap:3},children:[t?a.jsxs(a.Fragment,{children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(vh,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(N,{gap:3,children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{})]}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(vh,{})]}),a.jsx(YO,{})]})})},Lde=d.memo(Nde);function zde(){return a.jsxs(a.Fragment,{children:[a.jsx(p2,{}),a.jsx(Lde,{}),a.jsx(m2,{}),a.jsx(tu,{}),a.jsx(Jc,{}),a.jsx(Zc,{}),a.jsx(e7,{}),a.jsx(JO,{}),a.jsx(eu,{})]})}function g2(){return a.jsxs(N,{sx:{flexDirection:"column",gap:2},children:[a.jsx(WO,{}),a.jsx(VO,{})]})}function Fde(){const e=W(o=>o.generation.horizontalSymmetrySteps),t=W(o=>o.generation.steps),n=te(),{t:r}=Z();return a.jsx(Je,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(Aw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(Aw(0))})}function Bde(){const e=W(o=>o.generation.verticalSymmetrySteps),t=W(o=>o.generation.steps),n=te(),{t:r}=Z();return a.jsx(Je,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(Tw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(Tw(0))})}function Hde(){const e=W(n=>n.generation.shouldUseSymmetry),t=te();return a.jsx(Cn,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(OT(n.target.checked))})}const Vde=ae(he,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),Ce),Wde=()=>{const{t:e}=Z(),{activeLabel:t}=W(Vde);return Dt("symmetry").isFeatureEnabled?a.jsx(Vr,{label:e("parameters.symmetry"),activeLabel:t,children:a.jsxs(N,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(Hde,{}),a.jsx(Fde,{}),a.jsx(Bde,{})]})}):null},v2=d.memo(Wde),Ude=ae([he],({generation:e,hotkeys:t,config:n})=>{const{initial:r,min:o,sliderMax:s,inputMax:l,fineStep:i,coarseStep:c}=n.sd.img2imgStrength,{img2imgStrength:p}=e,m=t.shift?i:c;return{img2imgStrength:p,initial:r,min:o,sliderMax:s,inputMax:l,step:m}},Ce),Gde=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=W(Ude),l=te(),{t:i}=Z(),c=d.useCallback(m=>l(nm(m)),[l]),p=d.useCallback(()=>{l(nm(t))},[l,t]);return a.jsx(Ot,{feature:"paramDenoisingStrength",children:a.jsx(Ac,{children:a.jsx(Je,{label:`${i("parameters.denoisingStrength")}`,step:s,min:n,max:r,onChange:c,handleReset:p,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,sliderNumberInputProps:{max:o}})})})},t7=d.memo(Gde),Kde=()=>{const{t:e}=Z(),t=W(r=>r.ui.shouldUseSliders),{iterationsAndSeedLabel:n}=h2();return a.jsx(Vr,{label:e("parameters.general"),activeLabel:n,defaultIsOpen:!0,children:a.jsxs(N,{sx:{flexDirection:"column",gap:3},children:[t?a.jsxs(a.Fragment,{children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Dc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(N,{gap:3,children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{})]}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(Dc,{})]}),a.jsx(t7,{}),a.jsx(XO,{})]})})},qde=d.memo(Kde),Xde=()=>a.jsxs(a.Fragment,{children:[a.jsx(g2,{}),a.jsx(qde,{}),a.jsx(tu,{}),a.jsx(Jc,{}),a.jsx(Zc,{}),a.jsx(v2,{}),a.jsx(eu,{})]}),Qde=d.memo(Xde),Yde=ae([he],({generation:e,hotkeys:t,config:n})=>{const{initial:r,min:o,sliderMax:s,inputMax:l,fineStep:i,coarseStep:c}=n.sd.hrfStrength,{hrfStrength:p,hrfEnabled:m}=e,h=t.shift?i:c;return{hrfStrength:p,initial:r,min:o,sliderMax:s,inputMax:l,step:h,hrfEnabled:m}},Ce),Zde=()=>{const{hrfStrength:e,initial:t,min:n,sliderMax:r,step:o,hrfEnabled:s}=W(Yde),l=te(),i=d.useCallback(()=>{l($w(t))},[l,t]),c=d.useCallback(p=>{l($w(p))},[l]);return a.jsx(Je,{label:"Denoising Strength","aria-label":"High Resolution Denoising Strength",min:n,max:r,step:o,value:e,onChange:c,withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:i,isDisabled:!s})},Jde=d.memo(Zde);function efe(){const e=te(),t=W(r=>r.generation.hrfEnabled),n=d.useCallback(r=>e(RT(r.target.checked)),[e]);return a.jsx(Cn,{label:"Enable High Resolution Fix",isChecked:t,onChange:n})}function tfe(e){return Math.floor((e-1)/8)*8}const nfe=ae([he],({generation:e,hotkeys:t,config:n})=>{const{min:r,fineStep:o,coarseStep:s}=n.sd.width,{model:l,width:i,hrfWidth:c,aspectRatio:p,hrfEnabled:m}=e,h=t.shift?o:s;return{model:l,width:i,hrfWidth:c,min:r,step:h,aspectRatio:p,hrfEnabled:m}},Ce),rfe=e=>{const{width:t,hrfWidth:n,min:r,step:o,aspectRatio:s,hrfEnabled:l}=W(nfe),i=te(),c=Math.max(tfe(t),r),p=d.useCallback(h=>{if(i(sm(h)),s){const g=Wn(h/s,8);i(am(g))}},[i,s]),m=d.useCallback(()=>{if(i(sm(c)),s){const h=Wn(c/s,8);i(am(h))}},[i,c,s]);return a.jsx(Je,{label:"Initial Width",value:n,min:r,step:o,max:c,onChange:p,handleReset:m,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:c},isDisabled:!l,...e})},ofe=d.memo(rfe);function sfe(e){return Math.floor((e-1)/8)*8}const afe=ae([he],({generation:e,hotkeys:t,config:n})=>{const{min:r,fineStep:o,coarseStep:s}=n.sd.height,{model:l,height:i,hrfHeight:c,aspectRatio:p,hrfEnabled:m}=e,h=t.shift?o:s;return{model:l,height:i,hrfHeight:c,min:r,step:h,aspectRatio:p,hrfEnabled:m}},Ce),lfe=e=>{const{height:t,hrfHeight:n,min:r,step:o,aspectRatio:s,hrfEnabled:l}=W(afe),i=te(),c=Math.max(sfe(t),r),p=d.useCallback(h=>{if(i(am(h)),s){const g=Wn(h*s,8);i(sm(g))}},[i,s]),m=d.useCallback(()=>{if(i(am(c)),s){const h=Wn(c*s,8);i(sm(h))}},[i,c,s]);return a.jsx(Je,{label:"Initial Height",value:n,min:r,step:o,max:c,onChange:p,handleReset:m,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:c},isDisabled:!l,...e})},ife=d.memo(lfe),cfe=ae(he,e=>{const{hrfEnabled:t}=e.generation;return{hrfEnabled:t}},Ce);function ufe(){const e=Dt("hrf").isFeatureEnabled,{hrfEnabled:t}=W(cfe),n=d.useMemo(()=>t?"On":"Off",[t]);return e?a.jsx(Vr,{label:"High Resolution Fix",activeLabel:n,children:a.jsxs(N,{sx:{flexDir:"column",gap:2},children:[a.jsx(efe,{}),t&&a.jsxs(N,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.100",_dark:{bg:"base.750"}},children:[a.jsx(ofe,{}),a.jsx(ife,{})]}),t&&a.jsx(Jde,{})]})}):null}const dfe=()=>a.jsxs(a.Fragment,{children:[a.jsx(g2,{}),a.jsx(ZO,{}),a.jsx(tu,{}),a.jsx(Jc,{}),a.jsx(Zc,{}),a.jsx(v2,{}),a.jsx(ufe,{}),a.jsx(eu,{})]}),ffe=d.memo(dfe),pfe=()=>{const{t:e}=Z(),t=W(r=>r.ui.shouldUseSliders),{iterationsAndSeedLabel:n}=h2();return a.jsx(Vr,{label:e("parameters.general"),activeLabel:n,defaultIsOpen:!0,children:a.jsxs(N,{sx:{flexDirection:"column",gap:3},children:[t?a.jsxs(a.Fragment,{children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(vh,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(N,{gap:3,children:[a.jsx(os,{}),a.jsx(Es,{}),a.jsx(Is,{})]}),a.jsx(Ps,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ms,{})}),a.jsx(vh,{})]}),a.jsx(t7,{})]})})},mfe=d.memo(pfe),hfe=()=>a.jsxs(a.Fragment,{children:[a.jsx(g2,{}),a.jsx(mfe,{}),a.jsx(tu,{}),a.jsx(Jc,{}),a.jsx(Zc,{}),a.jsx(v2,{}),a.jsx(e7,{}),a.jsx(JO,{}),a.jsx(eu,{})]}),gfe=d.memo(hfe),vfe=()=>{const e=W(er),t=W(n=>n.generation.model);return e==="txt2img"?a.jsx(Yp,{children:t&&t.base_model==="sdxl"?a.jsx(Que,{}):a.jsx(ffe,{})}):e==="img2img"?a.jsx(Yp,{children:t&&t.base_model==="sdxl"?a.jsx(Kue,{}):a.jsx(Qde,{})}):e==="unifiedCanvas"?a.jsx(Yp,{children:t&&t.base_model==="sdxl"?a.jsx(zde,{}):a.jsx(gfe,{})}):null},xfe=d.memo(vfe),Yp=d.memo(e=>a.jsxs(N,{sx:{w:"full",h:"full",flexDir:"column",gap:2},children:[a.jsx(aO,{}),a.jsx(N,{layerStyle:"first",sx:{w:"full",h:"full",position:"relative",borderRadius:"base",p:2},children:a.jsx(N,{sx:{w:"full",h:"full",position:"relative"},children:a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx(yg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:800,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:a.jsx(N,{sx:{gap:2,flexDirection:"column",h:"full",w:"full"},children:e.children})})})})})]}));Yp.displayName="ParametersPanelWrapper";const bfe=ae([he],e=>{const{initialImage:t}=e.generation;return{initialImage:t,isResetButtonDisabled:!t}},Ce),yfe=()=>{const{initialImage:e}=W(bfe),{currentData:t}=wo((e==null?void 0:e.imageName)??eo.skipToken),n=d.useMemo(()=>{if(t)return{id:"initial-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t]),r=d.useMemo(()=>({id:"initial-image",actionType:"SET_INITIAL_IMAGE"}),[]);return a.jsx(sl,{imageDTO:t,droppableData:r,draggableData:n,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Initial Image",noContentFallback:a.jsx(Yn,{label:"No initial image selected"}),dataTestId:"initial-image"})},Cfe=d.memo(yfe),wfe=ae([he],e=>{const{initialImage:t}=e.generation;return{isResetButtonDisabled:!t}},Ce),Sfe={type:"SET_INITIAL_IMAGE"},kfe=()=>{const{isResetButtonDisabled:e}=W(wfe),t=te(),{getUploadButtonProps:n,getUploadInputProps:r}=Zy({postUploadAction:Sfe}),o=d.useCallback(()=>{t(DT())},[t]);return a.jsxs(N,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",p:2,gap:4},children:[a.jsxs(N,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(be,{sx:{ps:2,fontWeight:600,userSelect:"none",color:"base.700",_dark:{color:"base.200"}},children:"Initial Image"}),a.jsx(ba,{}),a.jsx(Be,{tooltip:"Upload Initial Image","aria-label":"Upload Initial Image",icon:a.jsx(mg,{}),...n()}),a.jsx(Be,{tooltip:"Reset Initial Image","aria-label":"Reset Initial Image",icon:a.jsx(pg,{}),onClick:o,isDisabled:e})]}),a.jsx(Cfe,{}),a.jsx("input",{...r()})]})},_fe=d.memo(kfe),jfe=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=Z(),o=W(s=>s.system.isConnected);return a.jsx(Be,{onClick:t,icon:a.jsx(Fr,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})},n7=()=>{const[e,{isLoading:t}]=_h({fixedCacheKey:"enqueueBatch"}),[n,{isLoading:r}]=AT({fixedCacheKey:"enqueueGraph"}),[o,{isLoading:s}]=OI({fixedCacheKey:"resumeProcessor"}),[l,{isLoading:i}]=EI({fixedCacheKey:"pauseProcessor"}),[c,{isLoading:p}]=lb({fixedCacheKey:"cancelQueueItem"}),[m,{isLoading:h}]=PI({fixedCacheKey:"clearQueue"}),[g,{isLoading:x}]=zI({fixedCacheKey:"pruneQueue"});return t||r||s||i||p||h||x},Ife=[{label:"RealESRGAN x2 Plus",value:"RealESRGAN_x2plus.pth",tooltip:"Attempts to retain sharpness, low smoothing",group:"x2 Upscalers"},{label:"RealESRGAN x4 Plus",value:"RealESRGAN_x4plus.pth",tooltip:"Best for photos and highly detailed images, medium smoothing",group:"x4 Upscalers"},{label:"RealESRGAN x4 Plus (anime 6B)",value:"RealESRGAN_x4plus_anime_6B.pth",tooltip:"Best for anime/manga, high smoothing",group:"x4 Upscalers"},{label:"ESRGAN SRx4",value:"ESRGAN_SRx4_DF2KOST_official-ff704c30.pth",tooltip:"Retains sharpness, low smoothing",group:"x4 Upscalers"}];function Pfe(){const e=W(r=>r.postprocessing.esrganModelName),t=te(),n=r=>t(TT(r));return a.jsx(On,{label:"ESRGAN Model",value:e,itemComponent:fl,onChange:n,data:Ife})}const Efe=e=>{const{imageDTO:t}=e,n=te(),r=n7(),{t:o}=Z(),{isOpen:s,onOpen:l,onClose:i}=Lr(),{isAllowedToUpscale:c,detail:p}=$T(t),m=d.useCallback(()=>{i(),!(!t||!c)&&n(FI({imageDTO:t}))},[n,t,c,i]);return a.jsx(Yd,{isOpen:s,onClose:i,triggerComponent:a.jsx(Be,{tooltip:o("parameters.upscale"),onClick:l,icon:a.jsx(yM,{}),"aria-label":o("parameters.upscale")}),children:a.jsxs(N,{sx:{flexDirection:"column",gap:4},children:[a.jsx(Pfe,{}),a.jsx(ot,{tooltip:p,size:"sm",isDisabled:!t||r||!c,onClick:m,children:o("parameters.upscaleImage")})]})})},Mfe=d.memo(Efe),Ofe=ae([he,er],({gallery:e,system:t,ui:n,config:r},o)=>{const{isConnected:s,shouldConfirmOnDelete:l,denoiseProgress:i}=t,{shouldShowImageDetails:c,shouldHidePreview:p,shouldShowProgressInViewer:m}=n,{shouldFetchMetadataFromApi:h}=r,g=e.selection[e.selection.length-1];return{shouldConfirmOnDelete:l,isConnected:s,shouldDisableToolbarButtons:!!(i!=null&&i.progress_image)||!g,shouldShowImageDetails:c,activeTabName:o,shouldHidePreview:p,shouldShowProgressInViewer:m,lastSelectedImage:g,shouldFetchMetadataFromApi:h}},{memoizeOptions:{resultEqualityCheck:Bt}}),Rfe=()=>{const e=te(),{isConnected:t,shouldDisableToolbarButtons:n,shouldShowImageDetails:r,lastSelectedImage:o,shouldShowProgressInViewer:s,shouldFetchMetadataFromApi:l}=W(Ofe),i=Dt("upscaling").isFeatureEnabled,c=n7(),p=si(),{t:m}=Z(),{recallBothPrompts:h,recallSeed:g,recallAllParameters:x}=Pg(),{currentData:y}=wo((o==null?void 0:o.image_name)??eo.skipToken),b=d.useMemo(()=>o?{image:o,shouldFetchMetadataFromApi:l}:eo.skipToken,[o,l]),{metadata:C,workflow:S,isLoading:_}=nb(b,{selectFromResult:X=>{var z,V;return{isLoading:X.isFetching,metadata:(z=X==null?void 0:X.currentData)==null?void 0:z.metadata,workflow:(V=X==null?void 0:X.currentData)==null?void 0:V.workflow}}}),j=d.useCallback(()=>{S&&e(sb(S))},[e,S]),E=d.useCallback(()=>{x(C)},[C,x]);nt("a",E,[C]);const I=d.useCallback(()=>{g(C==null?void 0:C.seed)},[C==null?void 0:C.seed,g]);nt("s",I,[y]);const M=d.useCallback(()=>{h(C==null?void 0:C.positive_prompt,C==null?void 0:C.negative_prompt,C==null?void 0:C.positive_style_prompt,C==null?void 0:C.negative_style_prompt)},[C==null?void 0:C.negative_prompt,C==null?void 0:C.positive_prompt,C==null?void 0:C.positive_style_prompt,C==null?void 0:C.negative_style_prompt,h]);nt("p",M,[y]),nt("w",j,[S]);const R=d.useCallback(()=>{e(Q8()),e(Sh(y))},[e,y]);nt("shift+i",R,[y]);const D=d.useCallback(()=>{y&&e(FI({imageDTO:y}))},[e,y]),A=d.useCallback(()=>{y&&e(kh([y]))},[e,y]);nt("Shift+U",()=>{D()},{enabled:()=>!!(i&&!n&&t)},[i,y,n,t]);const O=d.useCallback(()=>e(NT(!r)),[e,r]);nt("i",()=>{y?O():p({title:m("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[y,r,p]),nt("delete",()=>{A()},[e,y]);const $=d.useCallback(()=>{e(pI(!s))},[e,s]);return a.jsx(a.Fragment,{children:a.jsxs(N,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(Ht,{isAttached:!0,isDisabled:n,children:a.jsxs(zh,{isLazy:!0,children:[a.jsx(Fh,{as:Be,"aria-label":m("parameters.imageActions"),tooltip:m("parameters.imageActions"),isDisabled:!y,icon:a.jsx(Roe,{})}),a.jsx(Gl,{motionProps:bc,children:y&&a.jsx(Y8,{imageDTO:y})})]})}),a.jsxs(Ht,{isAttached:!0,isDisabled:n,children:[a.jsx(Be,{isLoading:_,icon:a.jsx(Jy,{}),tooltip:`${m("nodes.loadWorkflow")} (W)`,"aria-label":`${m("nodes.loadWorkflow")} (W)`,isDisabled:!S,onClick:j}),a.jsx(Be,{isLoading:_,icon:a.jsx(jM,{}),tooltip:`${m("parameters.usePrompt")} (P)`,"aria-label":`${m("parameters.usePrompt")} (P)`,isDisabled:!(C!=null&&C.positive_prompt),onClick:M}),a.jsx(Be,{isLoading:_,icon:a.jsx(IM,{}),tooltip:`${m("parameters.useSeed")} (S)`,"aria-label":`${m("parameters.useSeed")} (S)`,isDisabled:(C==null?void 0:C.seed)===null||(C==null?void 0:C.seed)===void 0,onClick:I}),a.jsx(Be,{isLoading:_,icon:a.jsx(gM,{}),tooltip:`${m("parameters.useAll")} (A)`,"aria-label":`${m("parameters.useAll")} (A)`,isDisabled:!C,onClick:E})]}),i&&a.jsx(Ht,{isAttached:!0,isDisabled:c,children:i&&a.jsx(Mfe,{imageDTO:y})}),a.jsx(Ht,{isAttached:!0,children:a.jsx(Be,{icon:a.jsx(xM,{}),tooltip:`${m("parameters.info")} (I)`,"aria-label":`${m("parameters.info")} (I)`,isChecked:r,onClick:O})}),a.jsx(Ht,{isAttached:!0,children:a.jsx(Be,{"aria-label":m("settings.displayInProgress"),tooltip:m("settings.displayInProgress"),icon:a.jsx(ree,{}),isChecked:s,onClick:$})}),a.jsx(Ht,{isAttached:!0,children:a.jsx(jfe,{onClick:A})})]})})},Dfe=d.memo(Rfe),Afe=ae([he,ab],(e,t)=>{var _,j;const{data:n,status:r}=LT.endpoints.listImages.select(t)(e),{data:o}=e.gallery.galleryView==="images"?Nw.endpoints.getBoardImagesTotal.select(t.board_id??"none")(e):Nw.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(e),s=e.gallery.selection[e.gallery.selection.length-1],l=r==="pending";if(!n||!s||(o==null?void 0:o.total)===0)return{isFetching:l,queryArgs:t,isOnFirstImage:!0,isOnLastImage:!0};const i={...t,offset:n.ids.length,limit:II},c=zT.getSelectors(),p=c.selectAll(n),m=p.findIndex(E=>E.image_name===s.image_name),h=Bl(m+1,0,p.length-1),g=Bl(m-1,0,p.length-1),x=(_=p[h])==null?void 0:_.image_name,y=(j=p[g])==null?void 0:j.image_name,b=x?c.selectById(n,x):void 0,C=y?c.selectById(n,y):void 0,S=p.length;return{loadedImagesCount:p.length,currentImageIndex:m,areMoreImagesAvailable:((o==null?void 0:o.total)??0)>S,isFetching:r==="pending",nextImage:b,prevImage:C,queryArgs:i}},{memoizeOptions:{resultEqualityCheck:Bt}}),r7=()=>{const e=te(),{nextImage:t,prevImage:n,areMoreImagesAvailable:r,isFetching:o,queryArgs:s,loadedImagesCount:l,currentImageIndex:i}=W(Afe),c=d.useCallback(()=>{n&&e(Lw(n))},[e,n]),p=d.useCallback(()=>{t&&e(Lw(t))},[e,t]),[m]=jI(),h=d.useCallback(()=>{m(s)},[m,s]);return{handlePrevImage:c,handleNextImage:p,isOnFirstImage:i===0,isOnLastImage:i!==void 0&&i===l-1,nextImage:t,prevImage:n,areMoreImagesAvailable:r,handleLoadMoreImages:h,isFetching:o}};function Tfe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const $fe=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:l}=Z();return t?a.jsxs(N,{gap:2,children:[n&&a.jsx(Vt,{label:`Recall ${e}`,children:a.jsx(Cs,{"aria-label":l("accessibility.useThisParameter"),icon:a.jsx(Tfe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&a.jsx(Vt,{label:`Copy ${e}`,children:a.jsx(Cs,{"aria-label":`Copy ${e}`,icon:a.jsx(Uc,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),a.jsxs(N,{direction:o?"column":"row",children:[a.jsxs(be,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?a.jsxs(Nh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",a.jsx(c8,{mx:"2px"})]}):a.jsx(be,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},ir=d.memo($fe),Nfe=e=>{const{metadata:t}=e,{t:n}=Z(),{recallPositivePrompt:r,recallNegativePrompt:o,recallSeed:s,recallCfgScale:l,recallModel:i,recallScheduler:c,recallSteps:p,recallWidth:m,recallHeight:h,recallStrength:g,recallLoRA:x,recallControlNet:y,recallIPAdapter:b,recallT2IAdapter:C}=Pg(),S=d.useCallback(()=>{r(t==null?void 0:t.positive_prompt)},[t==null?void 0:t.positive_prompt,r]),_=d.useCallback(()=>{o(t==null?void 0:t.negative_prompt)},[t==null?void 0:t.negative_prompt,o]),j=d.useCallback(()=>{s(t==null?void 0:t.seed)},[t==null?void 0:t.seed,s]),E=d.useCallback(()=>{i(t==null?void 0:t.model)},[t==null?void 0:t.model,i]),I=d.useCallback(()=>{m(t==null?void 0:t.width)},[t==null?void 0:t.width,m]),M=d.useCallback(()=>{h(t==null?void 0:t.height)},[t==null?void 0:t.height,h]),R=d.useCallback(()=>{c(t==null?void 0:t.scheduler)},[t==null?void 0:t.scheduler,c]),D=d.useCallback(()=>{p(t==null?void 0:t.steps)},[t==null?void 0:t.steps,p]),A=d.useCallback(()=>{l(t==null?void 0:t.cfg_scale)},[t==null?void 0:t.cfg_scale,l]),O=d.useCallback(()=>{g(t==null?void 0:t.strength)},[t==null?void 0:t.strength,g]),$=d.useCallback(U=>{x(U)},[x]),X=d.useCallback(U=>{y(U)},[y]),z=d.useCallback(U=>{b(U)},[b]),V=d.useCallback(U=>{C(U)},[C]),Q=d.useMemo(()=>t!=null&&t.controlnets?t.controlnets.filter(U=>rm(U.control_model)):[],[t==null?void 0:t.controlnets]),G=d.useMemo(()=>t!=null&&t.ipAdapters?t.ipAdapters.filter(U=>rm(U.ip_adapter_model)):[],[t==null?void 0:t.ipAdapters]),F=d.useMemo(()=>t!=null&&t.t2iAdapters?t.t2iAdapters.filter(U=>FT(U.t2i_adapter_model)):[],[t==null?void 0:t.t2iAdapters]);return!t||Object.keys(t).length===0?null:a.jsxs(a.Fragment,{children:[t.created_by&&a.jsx(ir,{label:n("metadata.createdBy"),value:t.created_by}),t.generation_mode&&a.jsx(ir,{label:n("metadata.generationMode"),value:t.generation_mode}),t.positive_prompt&&a.jsx(ir,{label:n("metadata.positivePrompt"),labelPosition:"top",value:t.positive_prompt,onClick:S}),t.negative_prompt&&a.jsx(ir,{label:n("metadata.negativePrompt"),labelPosition:"top",value:t.negative_prompt,onClick:_}),t.seed!==void 0&&t.seed!==null&&a.jsx(ir,{label:n("metadata.seed"),value:t.seed,onClick:j}),t.model!==void 0&&t.model!==null&&t.model.model_name&&a.jsx(ir,{label:n("metadata.model"),value:t.model.model_name,onClick:E}),t.width&&a.jsx(ir,{label:n("metadata.width"),value:t.width,onClick:I}),t.height&&a.jsx(ir,{label:n("metadata.height"),value:t.height,onClick:M}),t.scheduler&&a.jsx(ir,{label:n("metadata.scheduler"),value:t.scheduler,onClick:R}),t.steps&&a.jsx(ir,{label:n("metadata.steps"),value:t.steps,onClick:D}),t.cfg_scale!==void 0&&t.cfg_scale!==null&&a.jsx(ir,{label:n("metadata.cfgScale"),value:t.cfg_scale,onClick:A}),t.strength&&a.jsx(ir,{label:n("metadata.strength"),value:t.strength,onClick:O}),t.loras&&t.loras.map((U,T)=>{if(vI(U.lora))return a.jsx(ir,{label:"LoRA",value:`${U.lora.model_name} - ${U.weight}`,onClick:()=>$(U)},T)}),Q.map((U,T)=>{var B;return a.jsx(ir,{label:"ControlNet",value:`${(B=U.control_model)==null?void 0:B.model_name} - ${U.control_weight}`,onClick:()=>X(U)},T)}),G.map((U,T)=>{var B;return a.jsx(ir,{label:"IP Adapter",value:`${(B=U.ip_adapter_model)==null?void 0:B.model_name} - ${U.weight}`,onClick:()=>z(U)},T)}),F.map((U,T)=>{var B;return a.jsx(ir,{label:"T2I Adapter",value:`${(B=U.t2i_adapter_model)==null?void 0:B.model_name} - ${U.weight}`,onClick:()=>V(U)},T)})]})},Lfe=d.memo(Nfe),zfe=({image:e})=>{const{t}=Z(),{shouldFetchMetadataFromApi:n}=W(n2),{metadata:r,workflow:o}=nb({image:e,shouldFetchMetadataFromApi:n},{selectFromResult:s=>{var l,i;return{metadata:(l=s==null?void 0:s.currentData)==null?void 0:l.metadata,workflow:(i=s==null?void 0:s.currentData)==null?void 0:i.workflow}}});return a.jsxs(N,{layerStyle:"first",sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",borderRadius:"base",position:"absolute",overflow:"hidden"},children:[a.jsxs(N,{gap:2,children:[a.jsx(be,{fontWeight:"semibold",children:"File:"}),a.jsxs(Nh,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,a.jsx(c8,{mx:"2px"})]})]}),a.jsxs(ri,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(oi,{children:[a.jsx(yr,{children:t("metadata.recallParameters")}),a.jsx(yr,{children:t("metadata.metadata")}),a.jsx(yr,{children:t("metadata.imageDetails")}),a.jsx(yr,{children:t("metadata.workflow")})]}),a.jsxs(Hc,{children:[a.jsx(Qr,{children:r?a.jsx(Xc,{children:a.jsx(Lfe,{metadata:r})}):a.jsx(Yn,{label:t("metadata.noRecallParameters")})}),a.jsx(Qr,{children:r?a.jsx(Za,{data:r,label:t("metadata.metadata")}):a.jsx(Yn,{label:t("metadata.noMetaData")})}),a.jsx(Qr,{children:e?a.jsx(Za,{data:e,label:t("metadata.imageDetails")}):a.jsx(Yn,{label:t("metadata.noImageDetails")})}),a.jsx(Qr,{children:o?a.jsx(Za,{data:o,label:t("metadata.workflow")}):a.jsx(Yn,{label:t("nodes.noWorkflow")})})]})]})]})},Ffe=d.memo(zfe),r1={color:"base.100",pointerEvents:"auto"},Bfe=()=>{const{t:e}=Z(),{handlePrevImage:t,handleNextImage:n,isOnFirstImage:r,isOnLastImage:o,handleLoadMoreImages:s,areMoreImagesAvailable:l,isFetching:i}=r7();return a.jsxs(Ie,{sx:{position:"relative",height:"100%",width:"100%"},children:[a.jsx(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineStart:0},children:!r&&a.jsx(Cs,{"aria-label":e("accessibility.previousImage"),icon:a.jsx(LJ,{size:64}),variant:"unstyled",onClick:t,boxSize:16,sx:r1})}),a.jsxs(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineEnd:0},children:[!o&&a.jsx(Cs,{"aria-label":e("accessibility.nextImage"),icon:a.jsx(zJ,{size:64}),variant:"unstyled",onClick:n,boxSize:16,sx:r1}),o&&l&&!i&&a.jsx(Cs,{"aria-label":e("accessibility.loadMore"),icon:a.jsx(NJ,{size:64}),variant:"unstyled",onClick:s,boxSize:16,sx:r1}),o&&l&&i&&a.jsx(N,{sx:{w:16,h:16,alignItems:"center",justifyContent:"center"},children:a.jsx(fa,{opacity:.5,size:"xl"})})]})]})},o7=d.memo(Bfe),Hfe=ae([he,BT],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{denoiseProgress:l,shouldAntialiasProgressImage:i}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n==null?void 0:n.image_name,denoiseProgress:l,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:i}},{memoizeOptions:{resultEqualityCheck:Bt}}),Vfe=()=>{const{shouldShowImageDetails:e,imageName:t,denoiseProgress:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=W(Hfe),{handlePrevImage:s,handleNextImage:l,isOnLastImage:i,handleLoadMoreImages:c,areMoreImagesAvailable:p,isFetching:m}=r7();nt("left",()=>{s()},[s]),nt("right",()=>{if(i&&p&&!m){c();return}i||l()},[i,p,c,m,l]);const{currentData:h}=wo(t??eo.skipToken),g=d.useMemo(()=>{if(h)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:h}}},[h]),x=d.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]),[y,b]=d.useState(!1),C=d.useRef(0),{t:S}=Z(),_=d.useCallback(()=>{b(!0),window.clearTimeout(C.current)},[]),j=d.useCallback(()=>{C.current=window.setTimeout(()=>{b(!1)},500)},[]);return a.jsxs(N,{onMouseOver:_,onMouseOut:j,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n!=null&&n.progress_image&&r?a.jsx(ga,{src:n.progress_image.dataURL,width:n.progress_image.width,height:n.progress_image.height,draggable:!1,"data-testid":"progress-image",sx:{objectFit:"contain",maxWidth:"full",maxHeight:"full",height:"auto",position:"absolute",borderRadius:"base",imageRendering:o?"auto":"pixelated"}}):a.jsx(sl,{imageDTO:h,droppableData:x,draggableData:g,isUploadDisabled:!0,fitContainer:!0,useThumbailFallback:!0,dropLabel:S("gallery.setCurrentImage"),noContentFallback:a.jsx(Yn,{icon:Yl,label:"No image selected"}),dataTestId:"image-preview"}),e&&h&&a.jsx(Ie,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base"},children:a.jsx(Ffe,{image:h})}),a.jsx(fr,{children:!e&&h&&y&&a.jsx(jn.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(o7,{})},"nextPrevButtons")})]})},Wfe=d.memo(Vfe),Ufe=()=>a.jsxs(N,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[a.jsx(Dfe,{}),a.jsx(Wfe,{})]}),Gfe=d.memo(Ufe),Kfe=()=>a.jsx(Ie,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:2,borderRadius:"base"},children:a.jsx(N,{sx:{width:"100%",height:"100%"},children:a.jsx(Gfe,{})})}),s7=d.memo(Kfe),qfe=()=>{const e=d.useRef(null),t=d.useCallback(()=>{e.current&&e.current.setLayout([50,50])},[]),n=i2();return a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsxs(Rg,{ref:e,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},storage:n,units:"percentages",children:[a.jsx(Ya,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:a.jsx(_fe,{})}),a.jsx(hh,{onDoubleClick:t}),a.jsx(Ya,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,children:a.jsx(s7,{})})]})})},Xfe=d.memo(qfe);var Qfe=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 l=s[o];if(!e(t[l],n[l]))return!1}return!0}return t!==t&&n!==n};const gj=wd(Qfe);function Ax(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 Yfe=Object.defineProperty,vj=Object.getOwnPropertySymbols,Zfe=Object.prototype.hasOwnProperty,Jfe=Object.prototype.propertyIsEnumerable,xj=(e,t,n)=>t in e?Yfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,epe=(e,t)=>{for(var n in t||(t={}))Zfe.call(t,n)&&xj(e,n,t[n]);if(vj)for(var n of vj(t))Jfe.call(t,n)&&xj(e,n,t[n]);return e};function a7(e,t){if(t===null||typeof t!="object")return{};const n=epe({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const tpe="__MANTINE_FORM_INDEX__";function bj(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${tpe}`)):!1:!1}function yj(e,t,n){typeof n.value=="object"&&(n.value=nc(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function nc(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(l){o.add(nc(l))})):s==="[object Map]"?(o=new Map,e.forEach(function(l,i){o.set(nc(i),nc(l))})):s==="[object Date]"?o=new Date(+e):s==="[object RegExp]"?o=new RegExp(e.source,e.flags):s==="[object DataView]"?o=new e.constructor(nc(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++)yj(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]||yj(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function l7(e){return typeof e!="string"?[]:e.split(".")}function zg(e,t,n){const r=l7(e);if(r.length===0)return n;const o=nc(n);if(r.length===1)return o[r[0]]=t,o;let s=o[r[0]];for(let l=1;l<r.length-1;l+=1){if(s===void 0)return o;s=s[r[l]]}return s[r[r.length-1]]=t,o}function Ys(e,t){const n=l7(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 Cj(e){const t=Ax(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function Tx(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,s)=>{const l=e[s],i=`${n===""?"":`${n}.`}${s}`,c=Ys(i,t);let p=!1;return typeof l=="function"&&(o[i]=l(c,t,i)),typeof l=="object"&&Array.isArray(c)&&(p=!0,c.forEach((m,h)=>Tx(l,t,`${i}.${h}`,o))),typeof l=="object"&&typeof c=="object"&&c!==null&&(p||Tx(l,t,i,o)),o},r)}function $x(e,t){return Cj(typeof e=="function"?e(t):Tx(e,t))}function $p(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=$x(t,n),o=Object.keys(r.errors).find(s=>e.split(".").every((l,i)=>l===s.split(".")[i]));return{hasError:!!o,error:o?r.errors[o]:null}}function npe(e,{from:t,to:n},r){const o=Ys(e,r);if(!Array.isArray(o))return r;const s=[...o],l=o[t];return s.splice(t,1),s.splice(n,0,l),zg(e,s,r)}var rpe=Object.defineProperty,wj=Object.getOwnPropertySymbols,ope=Object.prototype.hasOwnProperty,spe=Object.prototype.propertyIsEnumerable,Sj=(e,t,n)=>t in e?rpe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ape=(e,t)=>{for(var n in t||(t={}))ope.call(t,n)&&Sj(e,n,t[n]);if(wj)for(var n of wj(t))spe.call(t,n)&&Sj(e,n,t[n]);return e};function lpe(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,l=ape({},r);return Object.keys(r).every(i=>{let c,p;if(i.startsWith(o)&&(c=i,p=i.replace(o,s)),i.startsWith(s)&&(c=i.replace(s,o),p=i),c&&p){const m=l[c],h=l[p];return h===void 0?delete l[c]:l[c]=h,m===void 0?delete l[p]:l[p]=m,!1}return!0}),l}function ipe(e,t,n){const r=Ys(e,n);return Array.isArray(r)?zg(e,r.filter((o,s)=>s!==t),n):n}var cpe=Object.defineProperty,kj=Object.getOwnPropertySymbols,upe=Object.prototype.hasOwnProperty,dpe=Object.prototype.propertyIsEnumerable,_j=(e,t,n)=>t in e?cpe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fpe=(e,t)=>{for(var n in t||(t={}))upe.call(t,n)&&_j(e,n,t[n]);if(kj)for(var n of kj(t))dpe.call(t,n)&&_j(e,n,t[n]);return e};function jj(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function Ij(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=a7(`${o}.${t}`,s));const l=fpe({},s),i=new Set;return Object.entries(s).filter(([c])=>{if(!c.startsWith(`${o}.`))return!1;const p=jj(c,o);return Number.isNaN(p)?!1:p>=t}).forEach(([c,p])=>{const m=jj(c,o),h=c.replace(`${o}.${m}`,`${o}.${m+r}`);l[h]=p,i.add(h),i.has(c)||delete l[c]}),l}function ppe(e,t,n,r){const o=Ys(e,r);if(!Array.isArray(o))return r;const s=[...o];return s.splice(typeof n=="number"?n:s.length,0,t),zg(e,s,r)}function Pj(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 mpe(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 hpe=Object.defineProperty,gpe=Object.defineProperties,vpe=Object.getOwnPropertyDescriptors,Ej=Object.getOwnPropertySymbols,xpe=Object.prototype.hasOwnProperty,bpe=Object.prototype.propertyIsEnumerable,Mj=(e,t,n)=>t in e?hpe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,La=(e,t)=>{for(var n in t||(t={}))xpe.call(t,n)&&Mj(e,n,t[n]);if(Ej)for(var n of Ej(t))bpe.call(t,n)&&Mj(e,n,t[n]);return e},o1=(e,t)=>gpe(e,vpe(t));function fi({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:s=!1,validateInputOnBlur:l=!1,transformValues:i=p=>p,validate:c}={}){const[p,m]=d.useState(r),[h,g]=d.useState(n),[x,y]=d.useState(e),[b,C]=d.useState(Ax(t)),S=d.useRef(e),_=q=>{S.current=q},j=d.useCallback(()=>m({}),[]),E=q=>{const K=q?La(La({},x),q):x;_(K),g({})},I=d.useCallback(q=>C(K=>Ax(typeof q=="function"?q(K):q)),[]),M=d.useCallback(()=>C({}),[]),R=d.useCallback(()=>{y(e),M(),_(e),g({}),j()},[]),D=d.useCallback((q,K)=>I(ee=>o1(La({},ee),{[q]:K})),[]),A=d.useCallback(q=>I(K=>{if(typeof q!="string")return K;const ee=La({},K);return delete ee[q],ee}),[]),O=d.useCallback(q=>g(K=>{if(typeof q!="string")return K;const ee=a7(q,K);return delete ee[q],ee}),[]),$=d.useCallback((q,K)=>{const ee=bj(q,s);O(q),m(ce=>o1(La({},ce),{[q]:!0})),y(ce=>{const J=zg(q,K,ce);if(ee){const ie=$p(q,c,J);ie.hasError?D(q,ie.error):A(q)}return J}),!ee&&o&&D(q,null)},[]),X=d.useCallback(q=>{y(K=>{const ee=typeof q=="function"?q(K):q;return La(La({},K),ee)}),o&&M()},[]),z=d.useCallback((q,K)=>{O(q),y(ee=>npe(q,K,ee)),C(ee=>lpe(q,K,ee))},[]),V=d.useCallback((q,K)=>{O(q),y(ee=>ipe(q,K,ee)),C(ee=>Ij(q,K,ee,-1))},[]),Q=d.useCallback((q,K,ee)=>{O(q),y(ce=>ppe(q,K,ee,ce)),C(ce=>Ij(q,ee,ce,1))},[]),G=d.useCallback(()=>{const q=$x(c,x);return C(q.errors),q},[x,c]),F=d.useCallback(q=>{const K=$p(q,c,x);return K.hasError?D(q,K.error):A(q),K},[x,c]),U=(q,{type:K="input",withError:ee=!0,withFocus:ce=!0}={})=>{const ie={onChange:mpe(de=>$(q,de))};return ee&&(ie.error=b[q]),K==="checkbox"?ie.checked=Ys(q,x):ie.value=Ys(q,x),ce&&(ie.onFocus=()=>m(de=>o1(La({},de),{[q]:!0})),ie.onBlur=()=>{if(bj(q,l)){const de=$p(q,c,x);de.hasError?D(q,de.error):A(q)}}),ie},T=(q,K)=>ee=>{ee==null||ee.preventDefault();const ce=G();ce.hasErrors?K==null||K(ce.errors,x,ee):q==null||q(i(x),ee)},B=q=>i(q||x),Y=d.useCallback(q=>{q.preventDefault(),R()},[]),re=q=>{if(q){const ee=Ys(q,h);if(typeof ee=="boolean")return ee;const ce=Ys(q,x),J=Ys(q,S.current);return!gj(ce,J)}return Object.keys(h).length>0?Pj(h):!gj(x,S.current)},le=d.useCallback(q=>Pj(p,q),[p]),oe=d.useCallback(q=>q?!$p(q,c,x).hasError:!$x(c,x).hasErrors,[x,c]);return{values:x,errors:b,setValues:X,setErrors:I,setFieldValue:$,setFieldError:D,clearFieldError:A,clearErrors:M,reset:R,validate:G,validateField:F,reorderListItem:z,removeListItem:V,insertListItem:Q,getInputProps:U,onSubmit:T,onReset:Y,isDirty:re,isTouched:le,setTouched:m,setDirty:g,resetTouched:j,resetDirty:E,isValid:oe,getTransformedValues:B}}function _n(e){const{...t}=e,{base50:n,base100:r,base200:o,base300:s,base800:l,base700:i,base900:c,accent500:p,accent300:m}=qd(),{colorMode:h}=ha();return a.jsx(aM,{styles:()=>({input:{color:Ae(c,r)(h),backgroundColor:Ae(n,c)(h),borderColor:Ae(o,l)(h),borderWidth:2,outline:"none",":focus":{borderColor:Ae(m,p)(h)}},label:{color:Ae(i,s)(h),fontWeight:"normal",marginBottom:4}}),...t})}const ype=[{value:"sd-1",label:pn["sd-1"]},{value:"sd-2",label:pn["sd-2"]},{value:"sdxl",label:pn.sdxl},{value:"sdxl-refiner",label:pn["sdxl-refiner"]}];function tf(e){const{...t}=e,{t:n}=Z();return a.jsx(On,{label:n("modelManager.baseModel"),data:ype,...t})}function i7(e){const{data:t}=BI(),{...n}=e;return a.jsx(On,{label:"Config File",placeholder:"Select A Config File",data:t||[],...n})}const Cpe=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function Fg(e){const{...t}=e,{t:n}=Z();return a.jsx(On,{label:n("modelManager.variant"),data:Cpe,...t})}function xh(e,t=!0){let n;t?n=new RegExp("[^\\\\/]+(?=\\.)"):n=new RegExp("[^\\\\/]+(?=[\\\\/]?$)");const r=e.match(n);return r?r[0]:""}function c7(e){const{t}=Z(),n=te(),{model_path:r}=e,o=fi({initialValues:{model_name:r?xh(r):"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"checkpoint",error:void 0,vae:"",variant:"normal",config:"configs\\stable-diffusion\\v1-inference.yaml"}}),[s]=HI(),[l,i]=d.useState(!1),c=p=>{s({body:p}).unwrap().then(m=>{n(lt(Qt({title:t("modelManager.modelAdded",{modelName:p.model_name}),status:"success"}))),o.reset(),r&&n(Id(null))}).catch(m=>{m&&n(lt(Qt({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(p=>c(p)),style:{width:"100%"},children:a.jsxs(N,{flexDirection:"column",gap:2,children:[a.jsx(_n,{label:t("modelManager.model"),required:!0,...o.getInputProps("model_name")}),a.jsx(tf,{label:t("modelManager.baseModel"),...o.getInputProps("base_model")}),a.jsx(_n,{label:t("modelManager.modelLocation"),required:!0,...o.getInputProps("path"),onBlur:p=>{if(o.values.model_name===""){const m=xh(p.currentTarget.value);m&&o.setFieldValue("model_name",m)}}}),a.jsx(_n,{label:t("modelManager.description"),...o.getInputProps("description")}),a.jsx(_n,{label:t("modelManager.vaeLocation"),...o.getInputProps("vae")}),a.jsx(Fg,{label:t("modelManager.variant"),...o.getInputProps("variant")}),a.jsxs(N,{flexDirection:"column",width:"100%",gap:2,children:[l?a.jsx(_n,{required:!0,label:t("modelManager.customConfigFileLocation"),...o.getInputProps("config")}):a.jsx(i7,{required:!0,width:"100%",...o.getInputProps("config")}),a.jsx(br,{isChecked:l,onChange:()=>i(!l),label:t("modelManager.useCustomConfig")}),a.jsx(ot,{mt:2,type:"submit",children:t("modelManager.addModel")})]})]})})}function u7(e){const{t}=Z(),n=te(),{model_path:r}=e,[o]=HI(),s=fi({initialValues:{model_name:r?xh(r,!1):"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"diffusers",error:void 0,vae:"",variant:"normal"}}),l=i=>{o({body:i}).unwrap().then(c=>{n(lt(Qt({title:t("modelManager.modelAdded",{modelName:i.model_name}),status:"success"}))),s.reset(),r&&n(Id(null))}).catch(c=>{c&&n(lt(Qt({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:s.onSubmit(i=>l(i)),style:{width:"100%"},children:a.jsxs(N,{flexDirection:"column",gap:2,children:[a.jsx(_n,{required:!0,label:t("modelManager.model"),...s.getInputProps("model_name")}),a.jsx(tf,{label:t("modelManager.baseModel"),...s.getInputProps("base_model")}),a.jsx(_n,{required:!0,label:t("modelManager.modelLocation"),placeholder:t("modelManager.modelLocationValidationMsg"),...s.getInputProps("path"),onBlur:i=>{if(s.values.model_name===""){const c=xh(i.currentTarget.value,!1);c&&s.setFieldValue("model_name",c)}}}),a.jsx(_n,{label:t("modelManager.description"),...s.getInputProps("description")}),a.jsx(_n,{label:t("modelManager.vaeLocation"),...s.getInputProps("vae")}),a.jsx(Fg,{label:t("modelManager.variant"),...s.getInputProps("variant")}),a.jsx(ot,{mt:2,type:"submit",children:t("modelManager.addModel")})]})})}const d7=[{label:"Diffusers",value:"diffusers"},{label:"Checkpoint / Safetensors",value:"checkpoint"}];function wpe(){const[e,t]=d.useState("diffusers"),{t:n}=Z();return a.jsxs(N,{flexDirection:"column",gap:4,width:"100%",children:[a.jsx(On,{label:n("modelManager.modelType"),value:e,data:d7,onChange:r=>{r&&t(r)}}),a.jsxs(N,{sx:{p:4,borderRadius:4,bg:"base.300",_dark:{bg:"base.850"}},children:[e==="diffusers"&&a.jsx(u7,{}),e==="checkpoint"&&a.jsx(c7,{})]})]})}const Spe=[{label:"None",value:"none"},{label:"v_prediction",value:"v_prediction"},{label:"epsilon",value:"epsilon"},{label:"sample",value:"sample"}];function kpe(){const e=te(),{t}=Z(),[n,{isLoading:r}]=VI(),o=fi({initialValues:{location:"",prediction_type:void 0}}),s=l=>{const i={location:l.location,prediction_type:l.prediction_type==="none"?void 0:l.prediction_type};n({body:i}).unwrap().then(c=>{e(lt(Qt({title:t("toast.modelAddedSimple"),status:"success"}))),o.reset()}).catch(c=>{c&&e(lt(Qt({title:`${c.data.detail} `,status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(l=>s(l)),style:{width:"100%"},children:a.jsxs(N,{flexDirection:"column",width:"100%",gap:4,children:[a.jsx(_n,{label:t("modelManager.modelLocation"),placeholder:t("modelManager.simpleModelDesc"),w:"100%",...o.getInputProps("location")}),a.jsx(On,{label:t("modelManager.predictionType"),data:Spe,defaultValue:"none",...o.getInputProps("prediction_type")}),a.jsx(ot,{type:"submit",isLoading:r,children:t("modelManager.addModel")})]})})}function _pe(){const[e,t]=d.useState("simple");return a.jsxs(N,{flexDirection:"column",width:"100%",overflow:"scroll",maxHeight:window.innerHeight-250,gap:4,children:[a.jsxs(Ht,{isAttached:!0,children:[a.jsx(ot,{size:"sm",isChecked:e=="simple",onClick:()=>t("simple"),children:"Simple"}),a.jsx(ot,{size:"sm",isChecked:e=="advanced",onClick:()=>t("advanced"),children:"Advanced"})]}),a.jsxs(N,{sx:{p:4,borderRadius:4,background:"base.200",_dark:{background:"base.800"}},children:[e==="simple"&&a.jsx(kpe,{}),e==="advanced"&&a.jsx(wpe,{})]})]})}function jpe(e){const{...t}=e;return a.jsx(J6,{w:"100%",...t,children:e.children})}function Ipe(){const e=W(b=>b.modelmanager.searchFolder),[t,n]=d.useState(""),{data:r}=Qo(Ol),{foundModels:o,alreadyInstalled:s,filteredModels:l}=WI({search_path:e||""},{selectFromResult:({data:b})=>{const C=iN(r==null?void 0:r.entities),S=kr(C,"path"),_=rN(b,S),j=pN(b,S);return{foundModels:b,alreadyInstalled:Oj(j,t),filteredModels:Oj(_,t)}}}),[i,{isLoading:c}]=VI(),p=te(),{t:m}=Z(),h=d.useCallback(b=>{const C=b.currentTarget.id.split("\\").splice(-1)[0];i({body:{location:b.currentTarget.id}}).unwrap().then(S=>{p(lt(Qt({title:`Added Model: ${C}`,status:"success"})))}).catch(S=>{S&&p(lt(Qt({title:m("toast.modelAddFailed"),status:"error"})))})},[p,i,m]),g=d.useCallback(b=>{n(b.target.value)},[]),x=({models:b,showActions:C=!0})=>b.map(S=>a.jsxs(N,{sx:{p:4,gap:4,alignItems:"center",borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(N,{w:"100%",sx:{flexDirection:"column",minW:"25%"},children:[a.jsx(be,{sx:{fontWeight:600},children:S.split("\\").slice(-1)[0]}),a.jsx(be,{sx:{fontSize:"sm",color:"base.600",_dark:{color:"base.400"}},children:S})]}),C?a.jsxs(N,{gap:2,children:[a.jsx(ot,{id:S,onClick:h,isLoading:c,children:m("modelManager.quickAdd")}),a.jsx(ot,{onClick:()=>p(Id(S)),isLoading:c,children:m("modelManager.advanced")})]}):a.jsx(be,{sx:{fontWeight:600,p:2,borderRadius:4,color:"accent.50",bg:"accent.400",_dark:{color:"accent.100",bg:"accent.600"}},children:"Installed"})]},S));return(()=>e?!o||o.length===0?a.jsx(N,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",height:96,userSelect:"none",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(be,{variant:"subtext",children:m("modelManager.noModels")})}):a.jsxs(N,{sx:{flexDirection:"column",gap:2,w:"100%",minW:"50%"},children:[a.jsx(ho,{onChange:g,label:m("modelManager.search"),labelPos:"side"}),a.jsxs(N,{p:2,gap:2,children:[a.jsxs(be,{sx:{fontWeight:600},children:["Models Found: ",o.length]}),a.jsxs(be,{sx:{fontWeight:600,color:"accent.500",_dark:{color:"accent.200"}},children:["Not Installed: ",l.length]})]}),a.jsx(jpe,{offsetScrollbars:!0,children:a.jsxs(N,{gap:2,flexDirection:"column",children:[x({models:l}),x({models:s,showActions:!1})]})})]}):null)()}const Oj=(e,t)=>{const n=[];return Un(e,r=>{if(!r)return null;r.includes(t)&&n.push(r)}),n};function Ppe(){const e=W(i=>i.modelmanager.advancedAddScanModel),{t}=Z(),[n,r]=d.useState("diffusers"),[o,s]=d.useState(!0);d.useEffect(()=>{e&&[".ckpt",".safetensors",".pth",".pt"].some(i=>e.endsWith(i))?r("checkpoint"):r("diffusers")},[e,r,o]);const l=te();return e?a.jsxs(Ie,{as:jn.div,initial:{x:-100,opacity:0},animate:{x:0,opacity:1,transition:{duration:.2}},sx:{display:"flex",flexDirection:"column",minWidth:"40%",maxHeight:window.innerHeight-300,overflow:"scroll",p:4,gap:4,borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(N,{justifyContent:"space-between",alignItems:"center",children:[a.jsx(be,{size:"xl",fontWeight:600,children:o||n==="checkpoint"?"Add Checkpoint Model":"Add Diffusers Model"}),a.jsx(Be,{icon:a.jsx(Ec,{}),"aria-label":t("modelManager.closeAdvanced"),onClick:()=>l(Id(null)),size:"sm"})]}),a.jsx(On,{label:t("modelManager.modelType"),value:n,data:d7,onChange:i=>{i&&(r(i),s(i==="checkpoint"))}}),o?a.jsx(c7,{model_path:e},e):a.jsx(u7,{model_path:e},e)]}):null}function Epe(){const e=te(),{t}=Z(),n=W(i=>i.modelmanager.searchFolder),{refetch:r}=WI({search_path:n||""}),o=fi({initialValues:{folder:""}}),s=d.useCallback(i=>{e(zw(i.folder))},[e]),l=()=>{r()};return a.jsx("form",{onSubmit:o.onSubmit(i=>s(i)),style:{width:"100%"},children:a.jsxs(N,{sx:{w:"100%",gap:2,borderRadius:4,alignItems:"center"},children:[a.jsxs(N,{w:"100%",alignItems:"center",gap:4,minH:12,children:[a.jsx(be,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",minW:"max-content",_dark:{color:"base.300"}},children:"Folder"}),n?a.jsx(N,{sx:{w:"100%",p:2,px:4,bg:"base.300",borderRadius:4,fontSize:"sm",fontWeight:"bold",_dark:{bg:"base.700"}},children:n}):a.jsx(ho,{w:"100%",size:"md",...o.getInputProps("folder")})]}),a.jsxs(N,{gap:2,children:[n?a.jsx(Be,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:a.jsx(EM,{}),onClick:l,fontSize:18,size:"sm"}):a.jsx(Be,{"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),icon:a.jsx(hee,{}),fontSize:18,size:"sm",type:"submit"}),a.jsx(Be,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:a.jsx(Fr,{}),size:"sm",onClick:()=>{e(zw(null)),e(Id(null))},isDisabled:!n,colorScheme:"red"})]})]})})}const Mpe=d.memo(Epe);function Ope(){return a.jsxs(N,{flexDirection:"column",w:"100%",gap:4,children:[a.jsx(Mpe,{}),a.jsxs(N,{gap:4,children:[a.jsx(N,{sx:{maxHeight:window.innerHeight-300,overflow:"scroll",gap:4,w:"100%"},children:a.jsx(Ipe,{})}),a.jsx(Ppe,{})]})]})}function Rpe(){const[e,t]=d.useState("add"),{t:n}=Z();return a.jsxs(N,{flexDirection:"column",gap:4,children:[a.jsxs(Ht,{isAttached:!0,children:[a.jsx(ot,{onClick:()=>t("add"),isChecked:e=="add",size:"sm",width:"100%",children:n("modelManager.addModel")}),a.jsx(ot,{onClick:()=>t("scan"),isChecked:e=="scan",size:"sm",width:"100%",children:n("modelManager.scanForModels")})]}),e=="add"&&a.jsx(_pe,{}),e=="scan"&&a.jsx(Ope,{})]})}const Dpe=[{label:"Stable Diffusion 1",value:"sd-1"},{label:"Stable Diffusion 2",value:"sd-2"}];function Ape(){var F,U;const{t:e}=Z(),t=te(),{data:n}=Qo(Ol),[r,{isLoading:o}]=HT(),[s,l]=d.useState("sd-1"),i=Zw(n==null?void 0:n.entities,(T,B)=>(T==null?void 0:T.model_format)==="diffusers"&&(T==null?void 0:T.base_model)==="sd-1"),c=Zw(n==null?void 0:n.entities,(T,B)=>(T==null?void 0:T.model_format)==="diffusers"&&(T==null?void 0:T.base_model)==="sd-2"),p=d.useMemo(()=>({"sd-1":i,"sd-2":c}),[i,c]),[m,h]=d.useState(((F=Object.keys(p[s]))==null?void 0:F[0])??null),[g,x]=d.useState(((U=Object.keys(p[s]))==null?void 0:U[1])??null),[y,b]=d.useState(null),[C,S]=d.useState(""),[_,j]=d.useState(.5),[E,I]=d.useState("weighted_sum"),[M,R]=d.useState("root"),[D,A]=d.useState(""),[O,$]=d.useState(!1),X=Object.keys(p[s]).filter(T=>T!==g&&T!==y),z=Object.keys(p[s]).filter(T=>T!==m&&T!==y),V=Object.keys(p[s]).filter(T=>T!==m&&T!==g),Q=T=>{l(T),h(null),x(null)},G=()=>{const T=[];let B=[m,g,y];B=B.filter(re=>re!==null),B.forEach(re=>{var oe;const le=(oe=re==null?void 0:re.split("/"))==null?void 0:oe[2];le&&T.push(le)});const Y={model_names:T,merged_model_name:C!==""?C:T.join("-"),alpha:_,interp:E,force:O,merge_dest_directory:M==="root"?void 0:D};r({base_model:s,body:Y}).unwrap().then(re=>{t(lt(Qt({title:e("modelManager.modelsMerged"),status:"success"})))}).catch(re=>{re&&t(lt(Qt({title:e("modelManager.modelsMergeFailed"),status:"error"})))})};return a.jsxs(N,{flexDirection:"column",rowGap:4,children:[a.jsxs(N,{sx:{flexDirection:"column",rowGap:1},children:[a.jsx(be,{children:e("modelManager.modelMergeHeaderHelp1")}),a.jsx(be,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),a.jsxs(N,{columnGap:4,children:[a.jsx(On,{label:"Model Type",w:"100%",data:Dpe,value:s,onChange:Q}),a.jsx(nn,{label:e("modelManager.modelOne"),w:"100%",value:m,placeholder:e("modelManager.selectModel"),data:X,onChange:T=>h(T)}),a.jsx(nn,{label:e("modelManager.modelTwo"),w:"100%",placeholder:e("modelManager.selectModel"),value:g,data:z,onChange:T=>x(T)}),a.jsx(nn,{label:e("modelManager.modelThree"),data:V,w:"100%",placeholder:e("modelManager.selectModel"),clearable:!0,onChange:T=>{T?(b(T),I("weighted_sum")):(b(null),I("add_difference"))}})]}),a.jsx(ho,{label:e("modelManager.mergedModelName"),value:C,onChange:T=>S(T.target.value)}),a.jsxs(N,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(Je,{label:e("modelManager.alpha"),min:.01,max:.99,step:.01,value:_,onChange:T=>j(T),withInput:!0,withReset:!0,handleReset:()=>j(.5),withSliderMarks:!0}),a.jsx(be,{variant:"subtext",fontSize:"sm",children:e("modelManager.modelMergeAlphaHelp")})]}),a.jsxs(N,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(be,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),a.jsx(gm,{value:E,onChange:T=>I(T),children:a.jsx(N,{columnGap:4,children:y===null?a.jsxs(a.Fragment,{children:[a.jsx(qs,{value:"weighted_sum",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.weightedSum")})}),a.jsx(qs,{value:"sigmoid",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.sigmoid")})}),a.jsx(qs,{value:"inv_sigmoid",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):a.jsx(qs,{value:"add_difference",children:a.jsx(Vt,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:a.jsx(be,{fontSize:"sm",children:e("modelManager.addDifference")})})})})})]}),a.jsxs(N,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.900"}},children:[a.jsxs(N,{columnGap:4,children:[a.jsx(be,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:e("modelManager.mergedModelSaveLocation")}),a.jsx(gm,{value:M,onChange:T=>R(T),children:a.jsxs(N,{columnGap:4,children:[a.jsx(qs,{value:"root",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.invokeAIFolder")})}),a.jsx(qs,{value:"custom",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.custom")})})]})})]}),M==="custom"&&a.jsx(ho,{label:e("modelManager.mergedModelCustomSaveLocation"),value:D,onChange:T=>A(T.target.value)})]}),a.jsx(br,{label:e("modelManager.ignoreMismatch"),isChecked:O,onChange:T=>$(T.target.checked),fontWeight:"500"}),a.jsx(ot,{onClick:G,isLoading:o,isDisabled:m===null||g===null,children:e("modelManager.merge")})]})}function Tpe(e){const{model:t}=e,n=te(),{t:r}=Z(),[o,{isLoading:s}]=VT(),[l,i]=d.useState("InvokeAIRoot"),[c,p]=d.useState("");d.useEffect(()=>{i("InvokeAIRoot")},[t]);const m=()=>{i("InvokeAIRoot")},h=()=>{const g={base_model:t.base_model,model_name:t.model_name,convert_dest_directory:l==="Custom"?c:void 0};if(l==="Custom"&&c===""){n(lt(Qt({title:r("modelManager.noCustomLocationProvided"),status:"error"})));return}n(lt(Qt({title:`${r("modelManager.convertingModelBegin")}: ${t.model_name}`,status:"info"}))),o(g).unwrap().then(()=>{n(lt(Qt({title:`${r("modelManager.modelConverted")}: ${t.model_name}`,status:"success"})))}).catch(()=>{n(lt(Qt({title:`${r("modelManager.modelConversionFailed")}: ${t.model_name}`,status:"error"})))})};return a.jsxs(Eg,{title:`${r("modelManager.convert")} ${t.model_name}`,acceptCallback:h,cancelCallback:m,acceptButtonText:`${r("modelManager.convert")}`,triggerComponent:a.jsxs(ot,{size:"sm","aria-label":r("modelManager.convertToDiffusers"),className:" modal-close-btn",isLoading:s,children:["🧨 ",r("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[a.jsxs(N,{flexDirection:"column",rowGap:4,children:[a.jsx(be,{children:r("modelManager.convertToDiffusersHelpText1")}),a.jsxs(Td,{children:[a.jsx(go,{children:r("modelManager.convertToDiffusersHelpText2")}),a.jsx(go,{children:r("modelManager.convertToDiffusersHelpText3")}),a.jsx(go,{children:r("modelManager.convertToDiffusersHelpText4")}),a.jsx(go,{children:r("modelManager.convertToDiffusersHelpText5")})]}),a.jsx(be,{children:r("modelManager.convertToDiffusersHelpText6")})]}),a.jsxs(N,{flexDir:"column",gap:2,children:[a.jsxs(N,{marginTop:4,flexDir:"column",gap:2,children:[a.jsx(be,{fontWeight:"600",children:r("modelManager.convertToDiffusersSaveLocation")}),a.jsx(gm,{value:l,onChange:g=>i(g),children:a.jsxs(N,{gap:4,children:[a.jsx(qs,{value:"InvokeAIRoot",children:a.jsx(Vt,{label:"Save converted model in the InvokeAI root folder",children:r("modelManager.invokeRoot")})}),a.jsx(qs,{value:"Custom",children:a.jsx(Vt,{label:"Save converted model in a custom folder",children:r("modelManager.custom")})})]})})]}),l==="Custom"&&a.jsxs(N,{flexDirection:"column",rowGap:2,children:[a.jsx(be,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:r("modelManager.customSaveLocation")}),a.jsx(ho,{value:c,onChange:g=>{p(g.target.value)},width:"full"})]})]})]})}function $pe(e){const{model:t}=e,[n,{isLoading:r}]=UI(),{data:o}=BI(),[s,l]=d.useState(!1);d.useEffect(()=>{o!=null&&o.includes(t.config)||l(!0)},[o,t.config]);const i=te(),{t:c}=Z(),p=fi({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"main",path:t.path?t.path:"",description:t.description?t.description:"",model_format:"checkpoint",vae:t.vae?t.vae:"",config:t.config?t.config:"",variant:t.variant},validate:{path:h=>h.trim().length===0?"Must provide a path":null}}),m=d.useCallback(h=>{const g={base_model:t.base_model,model_name:t.model_name,body:h};n(g).unwrap().then(x=>{p.setValues(x),i(lt(Qt({title:c("modelManager.modelUpdated"),status:"success"})))}).catch(x=>{p.reset(),i(lt(Qt({title:c("modelManager.modelUpdateFailed"),status:"error"})))})},[p,i,t.base_model,t.model_name,c,n]);return a.jsxs(N,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(N,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs(N,{flexDirection:"column",children:[a.jsx(be,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(be,{fontSize:"sm",color:"base.400",children:[pn[t.base_model]," Model"]})]}),[""].includes(t.base_model)?a.jsx(As,{sx:{p:2,borderRadius:4,bg:"error.200",_dark:{bg:"error.400"}},children:"Conversion Not Supported"}):a.jsx(Tpe,{model:t})]}),a.jsx(Jn,{}),a.jsx(N,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",children:a.jsx("form",{onSubmit:p.onSubmit(h=>m(h)),children:a.jsxs(N,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:c("modelManager.name"),...p.getInputProps("model_name")}),a.jsx(_n,{label:c("modelManager.description"),...p.getInputProps("description")}),a.jsx(tf,{required:!0,...p.getInputProps("base_model")}),a.jsx(Fg,{required:!0,...p.getInputProps("variant")}),a.jsx(_n,{required:!0,label:c("modelManager.modelLocation"),...p.getInputProps("path")}),a.jsx(_n,{label:c("modelManager.vaeLocation"),...p.getInputProps("vae")}),a.jsxs(N,{flexDirection:"column",gap:2,children:[s?a.jsx(_n,{required:!0,label:c("modelManager.config"),...p.getInputProps("config")}):a.jsx(i7,{required:!0,...p.getInputProps("config")}),a.jsx(br,{isChecked:s,onChange:()=>l(!s),label:"Use Custom Config"})]}),a.jsx(ot,{type:"submit",isLoading:r,children:c("modelManager.updateModel")})]})})})]})}function Npe(e){const{model:t}=e,[n,{isLoading:r}]=UI(),o=te(),{t:s}=Z(),l=fi({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"main",path:t.path?t.path:"",description:t.description?t.description:"",model_format:"diffusers",vae:t.vae?t.vae:"",variant:t.variant},validate:{path:c=>c.trim().length===0?"Must provide a path":null}}),i=d.useCallback(c=>{const p={base_model:t.base_model,model_name:t.model_name,body:c};n(p).unwrap().then(m=>{l.setValues(m),o(lt(Qt({title:s("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{l.reset(),o(lt(Qt({title:s("modelManager.modelUpdateFailed"),status:"error"})))})},[l,o,t.base_model,t.model_name,s,n]);return a.jsxs(N,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(N,{flexDirection:"column",children:[a.jsx(be,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(be,{fontSize:"sm",color:"base.400",children:[pn[t.base_model]," Model"]})]}),a.jsx(Jn,{}),a.jsx("form",{onSubmit:l.onSubmit(c=>i(c)),children:a.jsxs(N,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:s("modelManager.name"),...l.getInputProps("model_name")}),a.jsx(_n,{label:s("modelManager.description"),...l.getInputProps("description")}),a.jsx(tf,{required:!0,...l.getInputProps("base_model")}),a.jsx(Fg,{required:!0,...l.getInputProps("variant")}),a.jsx(_n,{required:!0,label:s("modelManager.modelLocation"),...l.getInputProps("path")}),a.jsx(_n,{label:s("modelManager.vaeLocation"),...l.getInputProps("vae")}),a.jsx(ot,{type:"submit",isLoading:r,children:s("modelManager.updateModel")})]})})]})}function Lpe(e){const{model:t}=e,[n,{isLoading:r}]=WT(),o=te(),{t:s}=Z(),l=fi({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"lora",path:t.path?t.path:"",description:t.description?t.description:"",model_format:t.model_format},validate:{path:c=>c.trim().length===0?"Must provide a path":null}}),i=d.useCallback(c=>{const p={base_model:t.base_model,model_name:t.model_name,body:c};n(p).unwrap().then(m=>{l.setValues(m),o(lt(Qt({title:s("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{l.reset(),o(lt(Qt({title:s("modelManager.modelUpdateFailed"),status:"error"})))})},[o,l,t.base_model,t.model_name,s,n]);return a.jsxs(N,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(N,{flexDirection:"column",children:[a.jsx(be,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(be,{fontSize:"sm",color:"base.400",children:[pn[t.base_model]," Model ⋅"," ",UT[t.model_format]," format"]})]}),a.jsx(Jn,{}),a.jsx("form",{onSubmit:l.onSubmit(c=>i(c)),children:a.jsxs(N,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:s("modelManager.name"),...l.getInputProps("model_name")}),a.jsx(_n,{label:s("modelManager.description"),...l.getInputProps("description")}),a.jsx(tf,{...l.getInputProps("base_model")}),a.jsx(_n,{label:s("modelManager.modelLocation"),...l.getInputProps("path")}),a.jsx(ot,{type:"submit",isLoading:r,children:s("modelManager.updateModel")})]})})]})}function zpe(e){const{t}=Z(),n=te(),[r]=GT(),[o]=KT(),{model:s,isSelected:l,setSelectedModelId:i}=e,c=d.useCallback(()=>{i(s.id)},[s.id,i]),p=d.useCallback(()=>{const m={main:r,lora:o,onnx:r}[s.model_type];m(s).unwrap().then(h=>{n(lt(Qt({title:`${t("modelManager.modelDeleted")}: ${s.model_name}`,status:"success"})))}).catch(h=>{h&&n(lt(Qt({title:`${t("modelManager.modelDeleteFailed")}: ${s.model_name}`,status:"error"})))}),i(void 0)},[r,o,s,i,n,t]);return a.jsxs(N,{sx:{gap:2,alignItems:"center",w:"full"},children:[a.jsx(N,{as:ot,isChecked:l,sx:{justifyContent:"start",p:2,borderRadius:"base",w:"full",alignItems:"center",bg:l?"accent.400":"base.100",color:l?"base.50":"base.800",_hover:{bg:l?"accent.500":"base.300",color:l?"base.50":"base.800"},_dark:{color:l?"base.50":"base.100",bg:l?"accent.600":"base.850",_hover:{color:l?"base.50":"base.100",bg:l?"accent.550":"base.700"}}},onClick:c,children:a.jsxs(N,{gap:4,alignItems:"center",children:[a.jsx(As,{minWidth:14,p:.5,fontSize:"sm",variant:"solid",children:qT[s.base_model]}),a.jsx(Vt,{label:s.description,hasArrow:!0,placement:"bottom",children:a.jsx(be,{sx:{fontWeight:500},children:s.model_name})})]})}),a.jsx(Eg,{title:t("modelManager.deleteModel"),acceptCallback:p,acceptButtonText:t("modelManager.delete"),triggerComponent:a.jsx(Be,{icon:a.jsx(vne,{}),"aria-label":t("modelManager.deleteConfig"),colorScheme:"error"}),children:a.jsxs(N,{rowGap:4,flexDirection:"column",children:[a.jsx("p",{style:{fontWeight:"bold"},children:t("modelManager.deleteMsg1")}),a.jsx("p",{children:t("modelManager.deleteMsg2")})]})})]})}const Fpe=e=>{const{selectedModelId:t,setSelectedModelId:n}=e,{t:r}=Z(),[o,s]=d.useState(""),[l,i]=d.useState("all"),{filteredDiffusersModels:c,isLoadingDiffusersModels:p}=Qo(Ol,{selectFromResult:({data:j,isLoading:E})=>({filteredDiffusersModels:Ru(j,"main","diffusers",o),isLoadingDiffusersModels:E})}),{filteredCheckpointModels:m,isLoadingCheckpointModels:h}=Qo(Ol,{selectFromResult:({data:j,isLoading:E})=>({filteredCheckpointModels:Ru(j,"main","checkpoint",o),isLoadingCheckpointModels:E})}),{filteredLoraModels:g,isLoadingLoraModels:x}=_d(void 0,{selectFromResult:({data:j,isLoading:E})=>({filteredLoraModels:Ru(j,"lora",void 0,o),isLoadingLoraModels:E})}),{filteredOnnxModels:y,isLoadingOnnxModels:b}=Zu(Ol,{selectFromResult:({data:j,isLoading:E})=>({filteredOnnxModels:Ru(j,"onnx","onnx",o),isLoadingOnnxModels:E})}),{filteredOliveModels:C,isLoadingOliveModels:S}=Zu(Ol,{selectFromResult:({data:j,isLoading:E})=>({filteredOliveModels:Ru(j,"onnx","olive",o),isLoadingOliveModels:E})}),_=d.useCallback(j=>{s(j.target.value)},[]);return a.jsx(N,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:a.jsxs(N,{flexDirection:"column",gap:4,paddingInlineEnd:4,children:[a.jsxs(Ht,{isAttached:!0,children:[a.jsx(ot,{onClick:()=>i("all"),isChecked:l==="all",size:"sm",children:r("modelManager.allModels")}),a.jsx(ot,{size:"sm",onClick:()=>i("diffusers"),isChecked:l==="diffusers",children:r("modelManager.diffusersModels")}),a.jsx(ot,{size:"sm",onClick:()=>i("checkpoint"),isChecked:l==="checkpoint",children:r("modelManager.checkpointModels")}),a.jsx(ot,{size:"sm",onClick:()=>i("onnx"),isChecked:l==="onnx",children:r("modelManager.onnxModels")}),a.jsx(ot,{size:"sm",onClick:()=>i("olive"),isChecked:l==="olive",children:r("modelManager.oliveModels")}),a.jsx(ot,{size:"sm",onClick:()=>i("lora"),isChecked:l==="lora",children:r("modelManager.loraModels")})]}),a.jsx(ho,{onChange:_,label:r("modelManager.search"),labelPos:"side"}),a.jsxs(N,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-280,overflow:"scroll",children:[p&&a.jsx(Qi,{loadingMessage:"Loading Diffusers..."}),["all","diffusers"].includes(l)&&!p&&c.length>0&&a.jsx(Xi,{title:"Diffusers",modelList:c,selected:{selectedModelId:t,setSelectedModelId:n}},"diffusers"),h&&a.jsx(Qi,{loadingMessage:"Loading Checkpoints..."}),["all","checkpoint"].includes(l)&&!h&&m.length>0&&a.jsx(Xi,{title:"Checkpoints",modelList:m,selected:{selectedModelId:t,setSelectedModelId:n}},"checkpoints"),x&&a.jsx(Qi,{loadingMessage:"Loading LoRAs..."}),["all","lora"].includes(l)&&!x&&g.length>0&&a.jsx(Xi,{title:"LoRAs",modelList:g,selected:{selectedModelId:t,setSelectedModelId:n}},"loras"),S&&a.jsx(Qi,{loadingMessage:"Loading Olives..."}),["all","olive"].includes(l)&&!S&&C.length>0&&a.jsx(Xi,{title:"Olives",modelList:C,selected:{selectedModelId:t,setSelectedModelId:n}},"olive"),b&&a.jsx(Qi,{loadingMessage:"Loading ONNX..."}),["all","onnx"].includes(l)&&!b&&y.length>0&&a.jsx(Xi,{title:"ONNX",modelList:y,selected:{selectedModelId:t,setSelectedModelId:n}},"onnx")]})]})})},Bpe=d.memo(Fpe),Ru=(e,t,n,r)=>{const o=[];return Un(e==null?void 0:e.entities,s=>{if(!s)return;const l=s.model_name.toLowerCase().includes(r.toLowerCase()),i=n===void 0||s.model_format===n,c=s.model_type===t;l&&i&&c&&o.push(s)}),o},x2=d.memo(e=>a.jsx(N,{flexDirection:"column",gap:4,borderRadius:4,p:4,sx:{bg:"base.200",_dark:{bg:"base.800"}},children:e.children}));x2.displayName="StyledModelContainer";const Xi=d.memo(e=>{const{title:t,modelList:n,selected:r}=e;return a.jsx(x2,{children:a.jsxs(N,{sx:{gap:2,flexDir:"column"},children:[a.jsx(be,{variant:"subtext",fontSize:"sm",children:t}),n.map(o=>a.jsx(zpe,{model:o,isSelected:r.selectedModelId===o.id,setSelectedModelId:r.setSelectedModelId},o.id))]})})});Xi.displayName="ModelListWrapper";const Qi=d.memo(({loadingMessage:e})=>a.jsx(x2,{children:a.jsxs(N,{justifyContent:"center",alignItems:"center",flexDirection:"column",p:4,gap:8,children:[a.jsx(fa,{}),a.jsx(be,{variant:"subtext",children:e||"Fetching..."})]})}));Qi.displayName="FetchingModelsLoader";function Hpe(){const[e,t]=d.useState(),{mainModel:n}=Qo(Ol,{selectFromResult:({data:s})=>({mainModel:e?s==null?void 0:s.entities[e]:void 0})}),{loraModel:r}=_d(void 0,{selectFromResult:({data:s})=>({loraModel:e?s==null?void 0:s.entities[e]:void 0})}),o=n||r;return a.jsxs(N,{sx:{gap:8,w:"full",h:"full"},children:[a.jsx(Bpe,{selectedModelId:e,setSelectedModelId:t}),a.jsx(Vpe,{model:o})]})}const Vpe=e=>{const{model:t}=e;return(t==null?void 0:t.model_format)==="checkpoint"?a.jsx($pe,{model:t},t.id):(t==null?void 0:t.model_format)==="diffusers"?a.jsx(Npe,{model:t},t.id):(t==null?void 0:t.model_type)==="lora"?a.jsx(Lpe,{model:t},t.id):a.jsx(N,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",maxH:96,userSelect:"none"},children:a.jsx(be,{variant:"subtext",children:"No Model Selected"})})};function Wpe(){const{t:e}=Z();return a.jsxs(N,{sx:{w:"full",p:4,borderRadius:4,gap:4,justifyContent:"space-between",alignItems:"center",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(N,{sx:{flexDirection:"column",gap:2},children:[a.jsx(be,{sx:{fontWeight:600},children:e("modelManager.syncModels")}),a.jsx(be,{fontSize:"sm",sx:{_dark:{color:"base.400"}},children:e("modelManager.syncModelsDesc")})]}),a.jsx(Qc,{})]})}function Upe(){return a.jsx(N,{children:a.jsx(Wpe,{})})}const Rj=[{id:"modelManager",label:bt.t("modelManager.modelManager"),content:a.jsx(Hpe,{})},{id:"importModels",label:bt.t("modelManager.importModels"),content:a.jsx(Rpe,{})},{id:"mergeModels",label:bt.t("modelManager.mergeModels"),content:a.jsx(Ape,{})},{id:"settings",label:bt.t("modelManager.settings"),content:a.jsx(Upe,{})}],Gpe=()=>a.jsxs(ri,{isLazy:!0,variant:"line",layerStyle:"first",sx:{w:"full",h:"full",p:4,gap:4,borderRadius:"base"},children:[a.jsx(oi,{children:Rj.map(e=>a.jsx(yr,{sx:{borderTopRadius:"base"},children:e.label},e.id))}),a.jsx(Hc,{sx:{w:"full",h:"full"},children:Rj.map(e=>a.jsx(Qr,{sx:{w:"full",h:"full"},children:e.content},e.id))})]}),Kpe=d.memo(Gpe),qpe={enum:"",BoardField:void 0,boolean:!1,BooleanCollection:[],BooleanPolymorphic:!1,ClipField:void 0,Collection:[],CollectionItem:void 0,ColorCollection:[],ColorField:void 0,ColorPolymorphic:void 0,ConditioningCollection:[],ConditioningField:void 0,ConditioningPolymorphic:void 0,ControlCollection:[],ControlField:void 0,ControlNetModelField:void 0,ControlPolymorphic:void 0,DenoiseMaskField:void 0,float:0,FloatCollection:[],FloatPolymorphic:0,ImageCollection:[],ImageField:void 0,ImagePolymorphic:void 0,integer:0,IntegerCollection:[],IntegerPolymorphic:0,IPAdapterCollection:[],IPAdapterField:void 0,IPAdapterModelField:void 0,IPAdapterPolymorphic:void 0,LatentsCollection:[],LatentsField:void 0,LatentsPolymorphic:void 0,LoRAModelField:void 0,MainModelField:void 0,ONNXModelField:void 0,Scheduler:"euler",SDXLMainModelField:void 0,SDXLRefinerModelField:void 0,string:"",StringCollection:[],StringPolymorphic:"",T2IAdapterCollection:[],T2IAdapterField:void 0,T2IAdapterModelField:void 0,T2IAdapterPolymorphic:void 0,UNetField:void 0,VaeField:void 0,VaeModelField:void 0},Xpe=(e,t)=>{const n={id:e,name:t.name,type:t.type,label:"",fieldKind:"input"};return n.value=t.default??qpe[t.type],n},Qpe=ae([e=>e.nodes],e=>e.nodeTemplates),s1={dragHandle:`.${ti}`},Ype=()=>{const e=W(Qpe),t=pb();return d.useCallback(n=>{var x;const r=Js();let o=window.innerWidth/2,s=window.innerHeight/2;const l=(x=document.querySelector("#workflow-editor"))==null?void 0:x.getBoundingClientRect();l&&(o=l.width/2-y1/2,s=l.height/2-y1/2);const{x:i,y:c}=t.project({x:o,y:s});if(n==="current_image")return{...s1,id:r,type:"current_image",position:{x:i,y:c},data:{id:r,type:"current_image",isOpen:!0,label:"Current Image"}};if(n==="notes")return{...s1,id:r,type:"notes",position:{x:i,y:c},data:{id:r,isOpen:!0,label:"Notes",notes:"",type:"notes"}};const p=e[n];if(p===void 0){console.error(`Unable to find template ${n}.`);return}const m=Fw(p.inputs,(y,b,C)=>{const S=Js(),_=Xpe(S,b);return y[C]=_,y},{}),h=Fw(p.outputs,(y,b,C)=>{const _={id:Js(),name:C,type:b.type,fieldKind:"output"};return y[C]=_,y},{});return{...s1,id:r,type:"invocation",position:{x:i,y:c},data:{id:r,type:n,version:p.version,label:"",notes:"",isOpen:!0,embedWorkflow:!1,isIntermediate:n!=="save_image",inputs:m,outputs:h,useCache:p.useCache}}},[e,t])},f7=d.forwardRef(({label:e,description:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs("div",{children:[a.jsx(be,{fontWeight:600,children:e}),a.jsx(be,{size:"xs",sx:{color:"base.600",_dark:{color:"base.500"}},children:t})]})}));f7.displayName="AddNodePopoverSelectItem";const Zpe=(e,t)=>{const n=new RegExp(e.trim().replace(/[-[\]{}()*+!<=:?./\\^$|#,]/g,"").split(" ").join(".*"),"gi");return n.test(t.label)||n.test(t.description)||t.tags.some(r=>n.test(r))},Jpe=()=>{const e=te(),t=Ype(),n=si(),{t:r}=Z(),o=W(C=>C.nodes.currentConnectionFieldType),s=W(C=>{var S;return(S=C.nodes.connectionStartParams)==null?void 0:S.handleType}),l=ae([he],({nodes:C})=>{const S=o?sN(C.nodeTemplates,j=>{const E=s=="source"?j.inputs:j.outputs;return Vo(E,I=>{const M=s=="source"?o:I.type,R=s=="target"?o:I.type;return mb(M,R)})}):kr(C.nodeTemplates),_=kr(S,j=>({label:j.title,value:j.type,description:j.description,tags:j.tags}));return o===null&&(_.push({label:r("nodes.currentImage"),value:"current_image",description:r("nodes.currentImageDescription"),tags:["progress"]}),_.push({label:r("nodes.notes"),value:"notes",description:r("nodes.notesDescription"),tags:["notes"]})),_.sort((j,E)=>j.label.localeCompare(E.label)),{data:_,t:r}},Ce),{data:i}=W(l),c=W(C=>C.nodes.isAddNodePopoverOpen),p=d.useRef(null),m=d.useCallback(C=>{const S=t(C);if(!S){const _=r("nodes.unknownNode",{nodeType:C});n({status:"error",title:_});return}e(XT(S))},[e,t,n,r]),h=d.useCallback(C=>{C&&m(C)},[m]),g=d.useCallback(()=>{e(QT())},[e]),x=d.useCallback(()=>{e(GI())},[e]),y=d.useCallback(C=>{C.preventDefault(),x(),setTimeout(()=>{var S;(S=p.current)==null||S.focus()},0)},[x]),b=d.useCallback(()=>{g()},[g]);return nt(["shift+a","space"],y),nt(["escape"],b),a.jsxs(Hd,{initialFocusRef:p,isOpen:c,onClose:g,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(q3,{children:a.jsx(N,{sx:{position:"absolute",top:"15%",insetInlineStart:"50%",pointerEvents:"none"}})}),a.jsx(Vd,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Qh,{sx:{p:0},children:a.jsx(nn,{inputRef:p,selectOnBlur:!1,placeholder:r("nodes.nodeSearch"),value:null,data:i,maxDropdownHeight:400,nothingFound:r("nodes.noMatchingNodes"),itemComponent:f7,filter:Zpe,onChange:h,hoverOnSearchChange:!0,onDropdownClose:g,sx:{width:"32rem",input:{padding:"0.5rem"}}})})})]})},eme=d.memo(Jpe),tme=()=>{const e=pb(),t=W(r=>r.nodes.shouldValidateGraph);return d.useCallback(({source:r,sourceHandle:o,target:s,targetHandle:l})=>{var x,y;const i=e.getEdges(),c=e.getNodes();if(!(r&&o&&s&&l))return!1;const p=e.getNode(r),m=e.getNode(s);if(!(p&&m&&p.data&&m.data))return!1;const h=(x=p.data.outputs[o])==null?void 0:x.type,g=(y=m.data.inputs[l])==null?void 0:y.type;return!h||!g||r===s?!1:t?i.find(b=>{b.target===s&&b.targetHandle===l&&b.source===r&&b.sourceHandle})||i.find(b=>b.target===s&&b.targetHandle===l)&&g!=="CollectionItem"||!mb(h,g)?!1:KI(r,s,c,i):!0},[e,t])},bd=e=>`var(--invokeai-colors-${e.split(".").join("-")})`,nme=ae(he,({nodes:e})=>{const{shouldAnimateEdges:t,currentConnectionFieldType:n,shouldColorEdges:r}=e,o=bd(n&&r?jd[n].color:"base.500");let s="react-flow__custom_connection-path";return t&&(s=s.concat(" animated")),{stroke:o,className:s}}),rme=({fromX:e,fromY:t,fromPosition:n,toX:r,toY:o,toPosition:s})=>{const{stroke:l,className:i}=W(nme),c={sourceX:e,sourceY:t,sourcePosition:n,targetX:r,targetY:o,targetPosition:s},[p]=hb(c);return a.jsx("g",{children:a.jsx("path",{fill:"none",stroke:l,strokeWidth:2,className:i,d:p,style:{opacity:.8}})})},ome=d.memo(rme),p7=(e,t,n,r,o)=>ae(he,({nodes:s})=>{var g,x;const l=s.nodes.find(y=>y.id===e),i=s.nodes.find(y=>y.id===n),c=Mn(l)&&Mn(i),p=(l==null?void 0:l.selected)||(i==null?void 0:i.selected)||o,m=c?(x=(g=l==null?void 0:l.data)==null?void 0:g.outputs[t||""])==null?void 0:x.type:void 0,h=m&&s.shouldColorEdges?bd(jd[m].color):bd("base.500");return{isSelected:p,shouldAnimate:s.shouldAnimateEdges&&p,stroke:h}},Ce),sme=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:l,data:i,selected:c,source:p,target:m,sourceHandleId:h,targetHandleId:g})=>{const x=d.useMemo(()=>p7(p,h,m,g,c),[c,p,h,m,g]),{isSelected:y,shouldAnimate:b}=W(x),[C,S,_]=hb({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s}),{base500:j}=qd();return a.jsxs(a.Fragment,{children:[a.jsx(qI,{path:C,markerEnd:l,style:{strokeWidth:y?3:2,stroke:j,opacity:y?.8:.5,animation:b?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:b?5:"none"}}),(i==null?void 0:i.count)&&i.count>1&&a.jsx(YT,{children:a.jsx(N,{sx:{position:"absolute",transform:`translate(-50%, -50%) translate(${S}px,${_}px)`},className:"nodrag nopan",children:a.jsx(As,{variant:"solid",sx:{bg:"base.500",opacity:y?.8:.5,boxShadow:"base"},children:i.count})})})]})},ame=d.memo(sme),lme=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:l,selected:i,source:c,target:p,sourceHandleId:m,targetHandleId:h})=>{const g=d.useMemo(()=>p7(c,m,p,h,i),[c,m,p,h,i]),{isSelected:x,shouldAnimate:y,stroke:b}=W(g),[C]=hb({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s});return a.jsx(qI,{path:C,markerEnd:l,style:{strokeWidth:x?3:2,stroke:b,opacity:x?.8:.5,animation:y?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:y?5:"none"}})},ime=d.memo(lme),cme=e=>{const{nodeId:t,width:n,children:r,selected:o}=e,{isMouseOverNode:s,handleMouseOut:l,handleMouseOver:i}=wO(t),c=d.useMemo(()=>ae(he,({nodes:_})=>{var j;return((j=_.nodeExecutionStates[t])==null?void 0:j.status)===Zs.IN_PROGRESS}),[t]),p=W(c),[m,h,g,x]=Ho("shadows",["nodeInProgress.light","nodeInProgress.dark","shadows.xl","shadows.base"]),y=te(),b=aa(m,h),C=W(_=>_.nodes.nodeOpacity),S=d.useCallback(_=>{!_.ctrlKey&&!_.altKey&&!_.metaKey&&!_.shiftKey&&y(ZT(t)),y(XI())},[y,t]);return a.jsxs(Ie,{onClick:S,onMouseEnter:i,onMouseLeave:l,className:ti,sx:{h:"full",position:"relative",borderRadius:"base",w:n??y1,transitionProperty:"common",transitionDuration:"0.1s",cursor:"grab",opacity:C},children:[a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",pointerEvents:"none",shadow:`${g}, ${x}, ${x}`,zIndex:-1}}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"md",pointerEvents:"none",transitionProperty:"common",transitionDuration:"0.1s",opacity:.7,shadow:p?b:void 0,zIndex:-1}}),r,a.jsx(CO,{isSelected:o,isHovered:s})]})},Bg=d.memo(cme),ume=ae(he,({system:e,gallery:t})=>{var r;return{imageDTO:t.selection[t.selection.length-1],progressImage:(r=e.denoiseProgress)==null?void 0:r.progress_image}}),dme=e=>{const{progressImage:t,imageDTO:n}=JT(ume);return t?a.jsx(a1,{nodeProps:e,children:a.jsx(ga,{src:t.dataURL,sx:{w:"full",h:"full",objectFit:"contain",borderRadius:"base"}})}):n?a.jsx(a1,{nodeProps:e,children:a.jsx(sl,{imageDTO:n,isDragDisabled:!0,useThumbailFallback:!0})}):a.jsx(a1,{nodeProps:e,children:a.jsx(Yn,{})})},fme=d.memo(dme),a1=e=>{const[t,n]=d.useState(!1),r=()=>{n(!0)},o=()=>{n(!1)};return a.jsx(Bg,{nodeId:e.nodeProps.id,selected:e.nodeProps.selected,width:384,children:a.jsxs(N,{onMouseEnter:r,onMouseLeave:o,className:ti,sx:{position:"relative",flexDirection:"column"},children:[a.jsx(N,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",alignItems:"center",justifyContent:"center",h:8},children:a.jsx(be,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",_dark:{color:"base.200"}},children:"Current Image"})}),a.jsxs(N,{layerStyle:"nodeBody",sx:{w:"full",h:"full",borderBottomRadius:"base",p:2},children:[e.children,t&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},style:{position:"absolute",top:40,left:-2,right:-2,bottom:0,pointerEvents:"none"},children:a.jsx(o7,{})},"nextPrevButtons")]})]})})},pme=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{const o=r.nodes.find(l=>l.id===e);if(!Mn(o))return[];const s=r.nodeTemplates[o.data.type];return s?kr(s.inputs).filter(l=>(["any","direct"].includes(l.input)||gb.includes(l.type))&&QI.includes(l.type)).filter(l=>!l.ui_hidden).sort((l,i)=>(l.ui_order??0)-(i.ui_order??0)).map(l=>l.name).filter(l=>l!=="is_intermediate"):[]},Ce),[e]);return W(t)},mme=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{const o=r.nodes.find(l=>l.id===e);if(!Mn(o))return[];const s=r.nodeTemplates[o.data.type];return s?kr(s.inputs).filter(l=>l.input==="connection"&&!gb.includes(l.type)||!QI.includes(l.type)).filter(l=>!l.ui_hidden).sort((l,i)=>(l.ui_order??0)-(i.ui_order??0)).map(l=>l.name).filter(l=>l!=="is_intermediate"):[]},Ce),[e]);return W(t)},hme=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{const o=r.nodes.find(l=>l.id===e);if(!Mn(o))return[];const s=r.nodeTemplates[o.data.type];return s?kr(s.outputs).filter(l=>!l.ui_hidden).sort((l,i)=>(l.ui_order??0)-(i.ui_order??0)).map(l=>l.name).filter(l=>l!=="is_intermediate"):[]},Ce),[e]);return W(t)},gme=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Mn(o)?o.data.embedWorkflow:!1},Ce),[e]);return W(t)},Hg=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Mn(o)?Vo(o.data.outputs,s=>e9.includes(s.type)&&o.data.type!=="image"):!1},Ce),[e]);return W(t)},vme=({nodeId:e})=>{const t=te(),n=Hg(e),r=gme(e),o=d.useCallback(s=>{t(t9({nodeId:e,embedWorkflow:s.target.checked}))},[t,e]);return n?a.jsxs(Zt,{as:N,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(In,{sx:{fontSize:"xs",mb:"1px"},children:"Workflow"}),a.jsx(Ad,{className:"nopan",size:"sm",onChange:o,isChecked:r})]}):null},xme=d.memo(vme),bme=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Mn(o)?o.data.isIntermediate:!1},Ce),[e]);return W(t)},yme=({nodeId:e})=>{const t=te(),n=Hg(e),r=bme(e),o=d.useCallback(s=>{t(n9({nodeId:e,isIntermediate:!s.target.checked}))},[t,e]);return n?a.jsxs(Zt,{as:N,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(In,{sx:{fontSize:"xs",mb:"1px"},children:"Save to Gallery"}),a.jsx(Ad,{className:"nopan",size:"sm",onChange:o,isChecked:!r})]}):null},Cme=d.memo(yme),wme=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Mn(o)?o.data.useCache:!1},Ce),[e]);return W(t)},Sme=({nodeId:e})=>{const t=te(),n=wme(e),r=d.useCallback(o=>{t(r9({nodeId:e,useCache:o.target.checked}))},[t,e]);return a.jsxs(Zt,{as:N,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(In,{sx:{fontSize:"xs",mb:"1px"},children:"Use Cache"}),a.jsx(Ad,{className:"nopan",size:"sm",onChange:r,isChecked:n})]})},kme=d.memo(Sme),_me=({nodeId:e})=>{const t=Hg(e),n=Dt("invocationCache").isFeatureEnabled;return a.jsxs(N,{className:ti,layerStyle:"nodeFooter",sx:{w:"full",borderBottomRadius:"base",px:2,py:0,h:6,justifyContent:"space-between"},children:[n&&a.jsx(kme,{nodeId:e}),t&&a.jsx(xme,{nodeId:e}),t&&a.jsx(Cme,{nodeId:e})]})},jme=d.memo(_me),Ime=({nodeId:e,isOpen:t})=>{const n=te(),r=o9(),o=d.useCallback(()=>{n(s9({nodeId:e,isOpen:!t})),r(e)},[n,t,e,r]);return a.jsx(Be,{className:"nodrag",onClick:o,"aria-label":"Minimize",sx:{minW:8,w:8,h:8,color:"base.500",_dark:{color:"base.500"},_hover:{color:"base.700",_dark:{color:"base.300"}}},variant:"link",icon:a.jsx(Cg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})})},b2=d.memo(Ime),m7=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Mn(o)?o.data.label:!1},Ce),[e]);return W(t)},h7=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{const o=r.nodes.find(l=>l.id===e);if(!Mn(o))return!1;const s=o?r.nodeTemplates[o.data.type]:void 0;return s==null?void 0:s.title},Ce),[e]);return W(t)},Pme=({nodeId:e,title:t})=>{const n=te(),r=m7(e),o=h7(e),{t:s}=Z(),[l,i]=d.useState(""),c=d.useCallback(async m=>{n(a9({nodeId:e,label:m})),i(r||t||o||s("nodes.problemSettingTitle"))},[n,e,t,o,r,s]),p=d.useCallback(m=>{i(m)},[]);return d.useEffect(()=>{i(r||t||o||s("nodes.problemSettingTitle"))},[r,o,t,s]),a.jsx(N,{sx:{overflow:"hidden",w:"full",h:"full",alignItems:"center",justifyContent:"center",cursor:"text"},children:a.jsxs(Dh,{as:N,value:l,onChange:p,onSubmit:c,sx:{alignItems:"center",position:"relative",w:"full",h:"full"},children:[a.jsx(Rh,{fontSize:"sm",sx:{p:0,w:"full"},noOfLines:1}),a.jsx(Oh,{className:"nodrag",fontSize:"sm",sx:{p:0,fontWeight:700,_focusVisible:{p:0,boxShadow:"none"}}}),a.jsx(Eme,{})]})})},g7=d.memo(Pme);function Eme(){const{isEditing:e,getEditButtonProps:t}=P5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&o(r)},[t]);return e?null:a.jsx(Ie,{className:ti,onDoubleClick:n,sx:{position:"absolute",w:"full",h:"full",top:0,cursor:"grab"}})}const y2=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return o==null?void 0:o.data},Ce),[e]);return W(t)},Mme=({nodeId:e})=>{const t=y2(e),{base400:n,base600:r}=qd(),o=aa(n,r),s=d.useMemo(()=>({borderWidth:0,borderRadius:"3px",width:"1rem",height:"1rem",backgroundColor:o,zIndex:-1}),[o]);return lm(t)?a.jsxs(a.Fragment,{children:[a.jsx($u,{type:"target",id:`${t.id}-collapsed-target`,isConnectable:!1,position:Yi.Left,style:{...s,left:"-0.5rem"}}),kr(t.inputs,l=>a.jsx($u,{type:"target",id:l.name,isConnectable:!1,position:Yi.Left,style:{visibility:"hidden"}},`${t.id}-${l.name}-collapsed-input-handle`)),a.jsx($u,{type:"source",id:`${t.id}-collapsed-source`,isConnectable:!1,position:Yi.Right,style:{...s,right:"-0.5rem"}}),kr(t.outputs,l=>a.jsx($u,{type:"source",id:l.name,isConnectable:!1,position:Yi.Right,style:{visibility:"hidden"}},`${t.id}-${l.name}-collapsed-output-handle`))]}):null},Ome=d.memo(Mme),Rme=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{const o=r.nodes.find(l=>l.id===e);return r.nodeTemplates[(o==null?void 0:o.data.type)??""]},Ce),[e]);return W(t)},Dme=({nodeId:e})=>{const t=te(),n=y2(e),{t:r}=Z(),o=d.useCallback(s=>{t(l9({nodeId:e,notes:s.target.value}))},[t,e]);return lm(n)?a.jsxs(Zt,{children:[a.jsx(In,{children:r("nodes.notes")}),a.jsx(da,{value:n==null?void 0:n.notes,onChange:o,rows:10})]}):null},Ame=d.memo(Dme),Tme=e=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>{var l;const o=r.nodes.find(i=>i.id===e);if(!Mn(o))return!1;const s=r.nodeTemplates[(o==null?void 0:o.data.type)??""];return!(s!=null&&s.version)||!((l=o.data)!=null&&l.version)?!1:nI(s.version,o.data.version)===0},Ce),[e]);return W(t)},$me=({nodeId:e})=>{const{isOpen:t,onOpen:n,onClose:r}=Lr(),o=m7(e),s=h7(e),l=Tme(e),{t:i}=Z();return a.jsxs(a.Fragment,{children:[a.jsx(Vt,{label:a.jsx(v7,{nodeId:e}),placement:"top",shouldWrapChildren:!0,children:a.jsx(N,{className:"nodrag",onClick:n,sx:{alignItems:"center",justifyContent:"center",w:8,h:8,cursor:"pointer"},children:a.jsx(Tn,{as:wM,sx:{boxSize:4,w:8,color:l?"base.400":"error.400"}})})}),a.jsxs(ql,{isOpen:t,onClose:r,isCentered:!0,children:[a.jsx(Zo,{}),a.jsxs(Xl,{children:[a.jsx(Yo,{children:o||s||i("nodes.unknownNode")}),a.jsx(Bd,{}),a.jsx(Jo,{children:a.jsx(Ame,{nodeId:e})}),a.jsx(ks,{})]})]})]})},Nme=d.memo($me),v7=d.memo(({nodeId:e})=>{const t=y2(e),n=Rme(e),{t:r}=Z(),o=d.useMemo(()=>t!=null&&t.label&&(n!=null&&n.title)?`${t.label} (${n.title})`:t!=null&&t.label&&!n?t.label:!(t!=null&&t.label)&&n?n.title:r("nodes.unknownNode"),[t,n,r]),s=d.useMemo(()=>!lm(t)||!n?null:t.version?n.version?Jw(t.version,n.version,"<")?a.jsxs(be,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateNode"),")"]}):Jw(t.version,n.version,">")?a.jsxs(be,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateApp"),")"]}):a.jsxs(be,{as:"span",children:[r("nodes.version")," ",t.version]}):a.jsxs(be,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.unknownTemplate"),")"]}):a.jsx(be,{as:"span",sx:{color:"error.500"},children:r("nodes.versionUnknown")}),[t,n,r]);return lm(t)?a.jsxs(N,{sx:{flexDir:"column"},children:[a.jsx(be,{as:"span",sx:{fontWeight:600},children:o}),a.jsx(be,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:n==null?void 0:n.description}),s,(t==null?void 0:t.notes)&&a.jsx(be,{children:t.notes})]}):a.jsx(be,{sx:{fontWeight:600},children:r("nodes.unknownNode")})});v7.displayName="TooltipContent";const l1=3,Dj={circle:{transitionProperty:"none",transitionDuration:"0s"},".chakra-progress__track":{stroke:"transparent"}},Lme=({nodeId:e})=>{const t=d.useMemo(()=>ae(he,({nodes:r})=>r.nodeExecutionStates[e]),[e]),n=W(t);return n?a.jsx(Vt,{label:a.jsx(x7,{nodeExecutionState:n}),placement:"top",children:a.jsx(N,{className:ti,sx:{w:5,h:"full",alignItems:"center",justifyContent:"flex-end"},children:a.jsx(b7,{nodeExecutionState:n})})}):null},zme=d.memo(Lme),x7=d.memo(({nodeExecutionState:e})=>{const{status:t,progress:n,progressImage:r}=e,{t:o}=Z();return t===Zs.PENDING?a.jsx(be,{children:"Pending"}):t===Zs.IN_PROGRESS?r?a.jsxs(N,{sx:{pos:"relative",pt:1.5,pb:.5},children:[a.jsx(ga,{src:r.dataURL,sx:{w:32,h:32,borderRadius:"base",objectFit:"contain"}}),n!==null&&a.jsxs(As,{variant:"solid",sx:{pos:"absolute",top:2.5,insetInlineEnd:1},children:[Math.round(n*100),"%"]})]}):n!==null?a.jsxs(be,{children:[o("nodes.executionStateInProgress")," (",Math.round(n*100),"%)"]}):a.jsx(be,{children:o("nodes.executionStateInProgress")}):t===Zs.COMPLETED?a.jsx(be,{children:o("nodes.executionStateCompleted")}):t===Zs.FAILED?a.jsx(be,{children:o("nodes.executionStateError")}):null});x7.displayName="TooltipLabel";const b7=d.memo(e=>{const{progress:t,status:n}=e.nodeExecutionState;return n===Zs.PENDING?a.jsx(Tn,{as:qJ,sx:{boxSize:l1,color:"base.600",_dark:{color:"base.300"}}}):n===Zs.IN_PROGRESS?t===null?a.jsx(U1,{isIndeterminate:!0,size:"14px",color:"base.500",thickness:14,sx:Dj}):a.jsx(U1,{value:Math.round(t*100),size:"14px",color:"base.500",thickness:14,sx:Dj}):n===Zs.COMPLETED?a.jsx(Tn,{as:vM,sx:{boxSize:l1,color:"ok.600",_dark:{color:"ok.300"}}}):n===Zs.FAILED?a.jsx(Tn,{as:YJ,sx:{boxSize:l1,color:"error.600",_dark:{color:"error.300"}}}):null});b7.displayName="StatusIcon";const Fme=({nodeId:e,isOpen:t})=>a.jsxs(N,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",justifyContent:"space-between",h:8,textAlign:"center",fontWeight:500,color:"base.700",_dark:{color:"base.200"}},children:[a.jsx(b2,{nodeId:e,isOpen:t}),a.jsx(g7,{nodeId:e}),a.jsxs(N,{alignItems:"center",children:[a.jsx(zme,{nodeId:e}),a.jsx(Nme,{nodeId:e})]}),!t&&a.jsx(Ome,{nodeId:e})]}),Bme=d.memo(Fme),Hme=(e,t,n,r)=>ae(he,o=>{if(!r)return bt.t("nodes.noFieldType");const{currentConnectionFieldType:s,connectionStartParams:l,nodes:i,edges:c}=o.nodes;if(!l||!s)return bt.t("nodes.noConnectionInProgress");const{handleType:p,nodeId:m,handleId:h}=l;if(!p||!m||!h)return bt.t("nodes.noConnectionData");const g=n==="target"?r:s,x=n==="source"?r:s;if(e===m)return bt.t("nodes.cannotConnectToSelf");if(n===p)return n==="source"?bt.t("nodes.cannotConnectOutputToOutput"):bt.t("nodes.cannotConnectInputToInput");const y=n==="target"?e:m,b=n==="target"?t:h,C=n==="source"?e:m,S=n==="source"?t:h;return c.find(j=>{j.target===y&&j.targetHandle===b&&j.source===C&&j.sourceHandle})?bt.t("nodes.cannotDuplicateConnection"):c.find(j=>j.target===y&&j.targetHandle===b)&&g!=="CollectionItem"?bt.t("nodes.inputMayOnlyHaveOneConnection"):mb(x,g)?KI(p==="source"?m:e,p==="source"?e:m,i,c)?null:bt.t("nodes.connectionWouldCreateCycle"):bt.t("nodes.fieldTypesMustMatch")}),Vme=(e,t,n)=>{const r=d.useMemo(()=>ae(he,({nodes:s})=>{var i;const l=s.nodes.find(c=>c.id===e);if(Mn(l))return(i=l==null?void 0:l.data[db[n]][t])==null?void 0:i.type},Ce),[t,n,e]);return W(r)},Wme=ae(he,({nodes:e})=>e.currentConnectionFieldType!==null&&e.connectionStartParams!==null),y7=({nodeId:e,fieldName:t,kind:n})=>{const r=Vme(e,t,n),o=d.useMemo(()=>ae(he,({nodes:g})=>!!g.edges.filter(x=>(n==="input"?x.target:x.source)===e&&(n==="input"?x.targetHandle:x.sourceHandle)===t).length),[t,n,e]),s=d.useMemo(()=>Hme(e,t,n==="input"?"target":"source",r),[e,t,n,r]),l=d.useMemo(()=>ae(he,({nodes:g})=>{var x,y,b;return((x=g.connectionStartParams)==null?void 0:x.nodeId)===e&&((y=g.connectionStartParams)==null?void 0:y.handleId)===t&&((b=g.connectionStartParams)==null?void 0:b.handleType)==={input:"target",output:"source"}[n]}),[t,n,e]),i=W(o),c=W(Wme),p=W(l),m=W(s),h=d.useMemo(()=>!!(c&&m&&!p),[m,c,p]);return{isConnected:i,isConnectionInProgress:c,isConnectionStartField:p,connectionError:m,shouldDim:h}},Ume=(e,t)=>{const n=d.useMemo(()=>ae(he,({nodes:o})=>{var l;const s=o.nodes.find(i=>i.id===e);if(Mn(s))return((l=s==null?void 0:s.data.inputs[t])==null?void 0:l.value)!==void 0},Ce),[t,e]);return W(n)},Gme=(e,t)=>{const n=d.useMemo(()=>ae(he,({nodes:o})=>{const s=o.nodes.find(c=>c.id===e);if(!Mn(s))return;const l=o.nodeTemplates[(s==null?void 0:s.data.type)??""],i=l==null?void 0:l.inputs[t];return i==null?void 0:i.input},Ce),[t,e]);return W(n)},Kme=({nodeId:e,fieldName:t,kind:n,children:r})=>{const o=te(),s=SO(e,t),l=kO(e,t,n),i=Gme(e,t),{t:c}=Z(),p=d.useCallback(C=>{C.preventDefault()},[]),m=d.useMemo(()=>ae(he,({nodes:C})=>({isExposed:!!C.workflow.exposedFields.find(_=>_.nodeId===e&&_.fieldName===t)}),Ce),[t,e]),h=d.useMemo(()=>["any","direct"].includes(i??"__UNKNOWN_INPUT__"),[i]),{isExposed:g}=W(m),x=d.useCallback(()=>{o(i9({nodeId:e,fieldName:t}))},[o,t,e]),y=d.useCallback(()=>{o(AI({nodeId:e,fieldName:t}))},[o,t,e]),b=d.useMemo(()=>{const C=[];return h&&!g&&C.push(a.jsx(Kt,{icon:a.jsx(Xa,{}),onClick:x,children:"Add to Linear View"},`${e}.${t}.expose-field`)),h&&g&&C.push(a.jsx(Kt,{icon:a.jsx(iee,{}),onClick:y,children:"Remove from Linear View"},`${e}.${t}.unexpose-field`)),C},[t,x,y,g,h,e]);return a.jsx(By,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>b.length?a.jsx(Gl,{sx:{visibility:"visible !important"},motionProps:bc,onContextMenu:p,children:a.jsx(ad,{title:s||l||c("nodes.unknownField"),children:b})}):null,children:r})},qme=d.memo(Kme),Xme=e=>{const{fieldTemplate:t,handleType:n,isConnectionInProgress:r,isConnectionStartField:o,connectionError:s}=e,{name:l,type:i}=t,{color:c,title:p}=jd[i],m=d.useMemo(()=>{const g=c9.includes(i),x=gb.includes(i),y=u9.includes(i),b=bd(c),C={backgroundColor:g||x?"var(--invokeai-colors-base-900)":b,position:"absolute",width:"1rem",height:"1rem",borderWidth:g||x?4:0,borderStyle:"solid",borderColor:b,borderRadius:y?4:"100%",zIndex:1};return n==="target"?C.insetInlineStart="-1rem":C.insetInlineEnd="-1rem",r&&!o&&s&&(C.filter="opacity(0.4) grayscale(0.7)"),r&&s?o?C.cursor="grab":C.cursor="not-allowed":C.cursor="crosshair",C},[s,n,r,o,i,c]),h=d.useMemo(()=>r&&o?p:r&&s?s??p:p,[s,r,o,p]);return a.jsx(Vt,{label:h,placement:n==="target"?"start":"end",hasArrow:!0,openDelay:jh,children:a.jsx($u,{type:n,id:l,position:n==="target"?Yi.Left:Yi.Right,style:m})})},C7=d.memo(Xme),Qme=({nodeId:e,fieldName:t})=>{const n=Dg(e,t,"input"),r=Ume(e,t),{isConnected:o,isConnectionInProgress:s,isConnectionStartField:l,connectionError:i,shouldDim:c}=y7({nodeId:e,fieldName:t,kind:"input"}),p=d.useMemo(()=>{if((n==null?void 0:n.fieldKind)!=="input"||!n.required)return!1;if(!o&&n.input==="connection"||!r&&!o&&n.input==="any")return!0},[n,o,r]);return(n==null?void 0:n.fieldKind)!=="input"?a.jsx(Nx,{shouldDim:c,children:a.jsxs(Zt,{sx:{color:"error.400",textAlign:"left",fontSize:"sm"},children:["Unknown input: ",t]})}):a.jsxs(Nx,{shouldDim:c,children:[a.jsxs(Zt,{isInvalid:p,isDisabled:o,sx:{alignItems:"stretch",justifyContent:"space-between",ps:n.input==="direct"?0:2,gap:2,h:"full",w:"full"},children:[a.jsx(qme,{nodeId:e,fieldName:t,kind:"input",children:m=>a.jsx(In,{sx:{display:"flex",alignItems:"center",h:"full",mb:0,px:1,gap:2},children:a.jsx(jO,{ref:m,nodeId:e,fieldName:t,kind:"input",isMissingInput:p,withTooltip:!0})})}),a.jsx(Ie,{children:a.jsx(NO,{nodeId:e,fieldName:t})})]}),n.input!=="direct"&&a.jsx(C7,{fieldTemplate:n,handleType:"target",isConnectionInProgress:s,isConnectionStartField:l,connectionError:i})]})},Aj=d.memo(Qme),Nx=d.memo(({shouldDim:e,children:t})=>a.jsx(N,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",w:"full",h:"full"},children:t}));Nx.displayName="InputFieldWrapper";const Yme=({nodeId:e,fieldName:t})=>{const n=Dg(e,t,"output"),{isConnected:r,isConnectionInProgress:o,isConnectionStartField:s,connectionError:l,shouldDim:i}=y7({nodeId:e,fieldName:t,kind:"output"});return(n==null?void 0:n.fieldKind)!=="output"?a.jsx(Lx,{shouldDim:i,children:a.jsxs(Zt,{sx:{color:"error.400",textAlign:"right",fontSize:"sm"},children:["Unknown output: ",t]})}):a.jsxs(Lx,{shouldDim:i,children:[a.jsx(Vt,{label:a.jsx(u2,{nodeId:e,fieldName:t,kind:"output"}),openDelay:jh,placement:"top",shouldWrapChildren:!0,hasArrow:!0,children:a.jsx(Zt,{isDisabled:r,pe:2,children:a.jsx(In,{sx:{mb:0,fontWeight:500},children:n==null?void 0:n.title})})}),a.jsx(C7,{fieldTemplate:n,handleType:"source",isConnectionInProgress:o,isConnectionStartField:s,connectionError:l})]})},Zme=d.memo(Yme),Lx=d.memo(({shouldDim:e,children:t})=>a.jsx(N,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",justifyContent:"flex-end"},children:t}));Lx.displayName="OutputFieldWrapper";const Jme=e=>{const t=Hg(e),n=Dt("invocationCache").isFeatureEnabled;return d.useMemo(()=>t||n,[t,n])},ehe=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>{const s=mme(e),l=pme(e),i=Jme(e),c=hme(e);return a.jsxs(Bg,{nodeId:e,selected:o,children:[a.jsx(Bme,{nodeId:e,isOpen:t,label:n,selected:o,type:r}),t&&a.jsxs(a.Fragment,{children:[a.jsx(N,{layerStyle:"nodeBody",sx:{flexDirection:"column",w:"full",h:"full",py:2,gap:1,borderBottomRadius:i?0:"base"},children:a.jsxs(N,{sx:{flexDir:"column",px:2,w:"full",h:"full"},children:[a.jsxs(el,{gridTemplateColumns:"1fr auto",gridAutoRows:"1fr",children:[s.map((p,m)=>a.jsx(rd,{gridColumnStart:1,gridRowStart:m+1,children:a.jsx(Aj,{nodeId:e,fieldName:p})},`${e}.${p}.input-field`)),c.map((p,m)=>a.jsx(rd,{gridColumnStart:2,gridRowStart:m+1,children:a.jsx(Zme,{nodeId:e,fieldName:p})},`${e}.${p}.output-field`))]}),l.map(p=>a.jsx(Aj,{nodeId:e,fieldName:p},`${e}.${p}.input-field`))]})}),i&&a.jsx(jme,{nodeId:e})]})]})},the=d.memo(ehe),nhe=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>a.jsxs(Bg,{nodeId:e,selected:o,children:[a.jsxs(N,{className:ti,layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",h:8,fontWeight:600,fontSize:"sm"},children:[a.jsx(b2,{nodeId:e,isOpen:t}),a.jsx(be,{sx:{w:"full",textAlign:"center",pe:8,color:"error.500",_dark:{color:"error.300"}},children:n?`${n} (${r})`:r})]}),t&&a.jsx(N,{layerStyle:"nodeBody",sx:{userSelect:"auto",flexDirection:"column",w:"full",h:"full",p:4,gap:1,borderBottomRadius:"base",fontSize:"sm"},children:a.jsxs(Ie,{children:[a.jsx(be,{as:"span",children:"Unknown node type: "}),a.jsx(be,{as:"span",fontWeight:600,children:r})]})})]}),rhe=d.memo(nhe),ohe=e=>{const{data:t,selected:n}=e,{id:r,type:o,isOpen:s,label:l}=t,i=d.useMemo(()=>ae(he,({nodes:p})=>!!p.nodeTemplates[o]),[o]);return W(i)?a.jsx(the,{nodeId:r,isOpen:s,label:l,type:o,selected:n}):a.jsx(rhe,{nodeId:r,isOpen:s,label:l,type:o,selected:n})},she=d.memo(ohe),ahe=e=>{const{id:t,data:n,selected:r}=e,{notes:o,isOpen:s}=n,l=te(),i=d.useCallback(c=>{l(d9({nodeId:t,value:c.target.value}))},[l,t]);return a.jsxs(Bg,{nodeId:t,selected:r,children:[a.jsxs(N,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:s?0:"base",alignItems:"center",justifyContent:"space-between",h:8},children:[a.jsx(b2,{nodeId:t,isOpen:s}),a.jsx(g7,{nodeId:t,title:"Notes"}),a.jsx(Ie,{minW:8})]}),s&&a.jsx(a.Fragment,{children:a.jsx(N,{layerStyle:"nodeBody",className:"nopan",sx:{cursor:"auto",flexDirection:"column",borderBottomRadius:"base",w:"full",h:"full",p:2,gap:1},children:a.jsx(N,{className:"nopan",sx:{flexDir:"column",w:"full",h:"full"},children:a.jsx(da,{value:o,onChange:i,rows:8,resize:"none",sx:{fontSize:"xs"}})})})})]})},lhe=d.memo(ahe),ihe=["Delete","Backspace"],che={collapsed:ame,default:ime},uhe={invocation:she,current_image:fme,notes:lhe},dhe={hideAttribution:!0},fhe=ae(he,({nodes:e})=>{const{shouldSnapToGrid:t,selectionMode:n}=e;return{shouldSnapToGrid:t,selectionMode:n}},Ce),phe=()=>{const e=te(),t=W(O=>O.nodes.nodes),n=W(O=>O.nodes.edges),r=W(O=>O.nodes.viewport),{shouldSnapToGrid:o,selectionMode:s}=W(fhe),l=d.useRef(null),i=d.useRef(),c=tme(),[p]=Ho("radii",["base"]),m=d.useCallback(O=>{e(f9(O))},[e]),h=d.useCallback(O=>{e(p9(O))},[e]),g=d.useCallback((O,$)=>{e(m9($))},[e]),x=d.useCallback(O=>{e(Bw(O))},[e]),y=d.useCallback(()=>{e(h9({cursorPosition:i.current}))},[e]),b=d.useCallback(O=>{e(g9(O))},[e]),C=d.useCallback(O=>{e(v9(O))},[e]),S=d.useCallback(({nodes:O,edges:$})=>{e(x9(O?O.map(X=>X.id):[])),e(b9($?$.map(X=>X.id):[]))},[e]),_=d.useCallback((O,$)=>{e(y9($))},[e]),j=d.useCallback(()=>{e(XI())},[e]),E=d.useCallback(O=>{Hw.set(O),O.fitView()},[]),I=d.useCallback(O=>{var X,z;const $=(X=l.current)==null?void 0:X.getBoundingClientRect();if($){const V=(z=Hw.get())==null?void 0:z.project({x:O.clientX-$.left,y:O.clientY-$.top});i.current=V}},[]),M=d.useRef(),R=d.useCallback((O,$,X)=>{M.current=O,e(C9($.id)),e(w9())},[e]),D=d.useCallback((O,$)=>{e(Bw($))},[e]),A=d.useCallback((O,$,X)=>{var z,V;!("touches"in O)&&((z=M.current)==null?void 0:z.clientX)===O.clientX&&((V=M.current)==null?void 0:V.clientY)===O.clientY&&e(S9($)),M.current=void 0},[e]);return nt(["Ctrl+c","Meta+c"],O=>{O.preventDefault(),e(k9())}),nt(["Ctrl+a","Meta+a"],O=>{O.preventDefault(),e(_9())}),nt(["Ctrl+v","Meta+v"],O=>{O.preventDefault(),e(j9({cursorPosition:i.current}))}),a.jsx(I9,{id:"workflow-editor",ref:l,defaultViewport:r,nodeTypes:uhe,edgeTypes:che,nodes:t,edges:n,onInit:E,onMouseMove:I,onNodesChange:m,onEdgesChange:h,onEdgesDelete:b,onEdgeUpdate:D,onEdgeUpdateStart:R,onEdgeUpdateEnd:A,onNodesDelete:C,onConnectStart:g,onConnect:x,onConnectEnd:y,onMoveEnd:_,connectionLineComponent:ome,onSelectionChange:S,isValidConnection:c,minZoom:.1,snapToGrid:o,snapGrid:[25,25],connectionRadius:30,proOptions:dhe,style:{borderRadius:p},onPaneClick:j,deleteKeyCode:ihe,selectionMode:s,children:a.jsx(DN,{})})},mhe=()=>{const e=te(),{t}=Z(),n=d.useCallback(()=>{e(GI())},[e]);return a.jsx(N,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:2},children:a.jsx(Be,{tooltip:t("nodes.addNodeToolTip"),"aria-label":t("nodes.addNode"),icon:a.jsx(Xa,{}),onClick:n})})},hhe=d.memo(mhe),ghe=()=>{const e=te(),t=SP("nodes"),{t:n}=Z();return d.useCallback(o=>{if(!o)return;const s=new FileReader;s.onload=async()=>{const l=s.result;try{const i=JSON.parse(String(l)),c=P9.safeParse(i);if(!c.success){const{message:p}=E9(c.error,{prefix:n("nodes.workflowValidation")});t.error({error:M9(c.error)},p),e(lt(Qt({title:n("nodes.unableToValidateWorkflow"),status:"error",duration:5e3}))),s.abort();return}e(sb(c.data)),s.abort()}catch{e(lt(Qt({title:n("nodes.unableToLoadWorkflow"),status:"error"})))}},s.readAsText(o)},[e,t,n])},vhe=d.memo(e=>e.error.issues[0]?a.jsx(be,{children:Vw(e.error.issues[0],{prefix:null}).toString()}):a.jsx(Td,{children:e.error.issues.map((t,n)=>a.jsx(go,{children:a.jsx(be,{children:Vw(t,{prefix:null}).toString()})},n))}));vhe.displayName="WorkflowValidationErrorContent";const xhe=()=>{const{t:e}=Z(),t=d.useRef(null),n=ghe();return a.jsx(WE,{resetRef:t,accept:"application/json",onChange:n,children:r=>a.jsx(Be,{icon:a.jsx(mg,{}),tooltip:e("nodes.loadWorkflow"),"aria-label":e("nodes.loadWorkflow"),...r})})},bhe=d.memo(xhe),yhe=()=>{const{t:e}=Z(),t=te(),{isOpen:n,onOpen:r,onClose:o}=Lr(),s=d.useRef(null),l=W(c=>c.nodes.nodes.length),i=d.useCallback(()=>{t(O9()),t(lt(Qt({title:e("toast.nodesCleared"),status:"success"}))),o()},[t,e,o]);return a.jsxs(a.Fragment,{children:[a.jsx(Be,{icon:a.jsx(Fr,{}),tooltip:e("nodes.resetWorkflow"),"aria-label":e("nodes.resetWorkflow"),onClick:r,isDisabled:!l,colorScheme:"error"}),a.jsxs(zd,{isOpen:n,onClose:o,leastDestructiveRef:s,isCentered:!0,children:[a.jsx(Zo,{}),a.jsxs(Fd,{children:[a.jsx(Yo,{fontSize:"lg",fontWeight:"bold",children:e("nodes.resetWorkflow")}),a.jsx(Jo,{py:4,children:a.jsxs(N,{flexDir:"column",gap:2,children:[a.jsx(be,{children:e("nodes.resetWorkflowDesc")}),a.jsx(be,{variant:"subtext",children:e("nodes.resetWorkflowDesc2")})]})}),a.jsxs(ks,{children:[a.jsx(Ja,{ref:s,onClick:o,children:e("common.cancel")}),a.jsx(Ja,{colorScheme:"error",ml:3,onClick:i,children:e("common.accept")})]})]})]})]})},Che=d.memo(yhe),whe=()=>{const{t:e}=Z(),t=yO(),n=d.useCallback(()=>{const r=new Blob([JSON.stringify(t,null,2)]),o=document.createElement("a");o.href=URL.createObjectURL(r),o.download=`${t.name||"My Workflow"}.json`,document.body.appendChild(o),o.click(),o.remove()},[t]);return a.jsx(Be,{icon:a.jsx(Gc,{}),tooltip:e("nodes.downloadWorkflow"),"aria-label":e("nodes.downloadWorkflow"),onClick:n})},She=d.memo(whe),khe=()=>a.jsxs(N,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:"50%",transform:"translate(-50%)"},children:[a.jsx(She,{}),a.jsx(bhe,{}),a.jsx(Che,{})]}),_he=d.memo(khe),jhe=()=>a.jsx(N,{sx:{gap:2,flexDir:"column"},children:kr(jd,({title:e,description:t,color:n},r)=>a.jsx(Vt,{label:t,children:a.jsx(As,{sx:{userSelect:"none",color:parseInt(n.split(".")[1]??"0",10)<500?"base.800":"base.50",bg:n},textAlign:"center",children:e})},r))}),Ihe=d.memo(jhe),Phe=()=>{const{t:e}=Z(),t=te(),n=d.useCallback(()=>{t(R9())},[t]);return a.jsx(ot,{leftIcon:a.jsx(xee,{}),tooltip:e("nodes.reloadNodeTemplates"),"aria-label":e("nodes.reloadNodeTemplates"),onClick:n,children:e("nodes.reloadNodeTemplates")})},Ehe=d.memo(Phe),Du={fontWeight:600},Mhe=ae(he,({nodes:e})=>{const{shouldAnimateEdges:t,shouldValidateGraph:n,shouldSnapToGrid:r,shouldColorEdges:o,selectionMode:s}=e;return{shouldAnimateEdges:t,shouldValidateGraph:n,shouldSnapToGrid:r,shouldColorEdges:o,selectionModeIsChecked:s===D9.Full}},Ce),Ohe=_e((e,t)=>{const{isOpen:n,onOpen:r,onClose:o}=Lr(),s=te(),{shouldAnimateEdges:l,shouldValidateGraph:i,shouldSnapToGrid:c,shouldColorEdges:p,selectionModeIsChecked:m}=W(Mhe),h=d.useCallback(S=>{s(A9(S.target.checked))},[s]),g=d.useCallback(S=>{s(T9(S.target.checked))},[s]),x=d.useCallback(S=>{s($9(S.target.checked))},[s]),y=d.useCallback(S=>{s(N9(S.target.checked))},[s]),b=d.useCallback(S=>{s(L9(S.target.checked))},[s]),{t:C}=Z();return a.jsxs(a.Fragment,{children:[a.jsx(Be,{ref:t,"aria-label":C("nodes.workflowSettings"),tooltip:C("nodes.workflowSettings"),icon:a.jsx(bM,{}),onClick:r}),a.jsxs(ql,{isOpen:n,onClose:o,size:"2xl",isCentered:!0,children:[a.jsx(Zo,{}),a.jsxs(Xl,{children:[a.jsx(Yo,{children:C("nodes.workflowSettings")}),a.jsx(Bd,{}),a.jsx(Jo,{children:a.jsxs(N,{sx:{flexDirection:"column",gap:4,py:4},children:[a.jsx(ur,{size:"sm",children:"General"}),a.jsx(Cn,{formLabelProps:Du,onChange:g,isChecked:l,label:C("nodes.animatedEdges"),helperText:C("nodes.animatedEdgesHelp")}),a.jsx(Jn,{}),a.jsx(Cn,{formLabelProps:Du,isChecked:c,onChange:x,label:C("nodes.snapToGrid"),helperText:C("nodes.snapToGridHelp")}),a.jsx(Jn,{}),a.jsx(Cn,{formLabelProps:Du,isChecked:p,onChange:y,label:C("nodes.colorCodeEdges"),helperText:C("nodes.colorCodeEdgesHelp")}),a.jsx(Cn,{formLabelProps:Du,isChecked:m,onChange:b,label:C("nodes.fullyContainNodes"),helperText:C("nodes.fullyContainNodesHelp")}),a.jsx(ur,{size:"sm",pt:4,children:"Advanced"}),a.jsx(Cn,{formLabelProps:Du,isChecked:i,onChange:h,label:C("nodes.validateConnections"),helperText:C("nodes.validateConnectionsHelp")}),a.jsx(Ehe,{})]})})]})]})]})}),Rhe=d.memo(Ohe),Dhe=()=>{const e=W(t=>t.nodes.shouldShowFieldTypeLegend);return a.jsxs(N,{sx:{gap:2,position:"absolute",top:2,insetInlineEnd:2},children:[a.jsx(Rhe,{}),e&&a.jsx(Ihe,{})]})},Ahe=d.memo(Dhe);function The(){const e=te(),t=W(o=>o.nodes.nodeOpacity),{t:n}=Z(),r=d.useCallback(o=>{e(z9(o))},[e]);return a.jsx(N,{alignItems:"center",children:a.jsxs(Jb,{"aria-label":n("nodes.nodeOpacity"),value:t,min:.5,max:1,step:.01,onChange:r,orientation:"vertical",defaultValue:30,h:"calc(100% - 0.5rem)",children:[a.jsx(ty,{children:a.jsx(ny,{})}),a.jsx(ey,{})]})})}const $he=()=>{const{t:e}=Z(),{zoomIn:t,zoomOut:n,fitView:r}=pb(),o=te(),s=W(m=>m.nodes.shouldShowMinimapPanel),l=d.useCallback(()=>{t()},[t]),i=d.useCallback(()=>{n()},[n]),c=d.useCallback(()=>{r()},[r]),p=d.useCallback(()=>{o(F9(!s))},[s,o]);return a.jsxs(Ht,{isAttached:!0,orientation:"vertical",children:[a.jsx(Be,{tooltip:e("nodes.zoomInNodes"),"aria-label":e("nodes.zoomInNodes"),onClick:l,icon:a.jsx(Aoe,{})}),a.jsx(Be,{tooltip:e("nodes.zoomOutNodes"),"aria-label":e("nodes.zoomOutNodes"),onClick:i,icon:a.jsx(Doe,{})}),a.jsx(Be,{tooltip:e("nodes.fitViewportNodes"),"aria-label":e("nodes.fitViewportNodes"),onClick:c,icon:a.jsx(yM,{})}),a.jsx(Be,{tooltip:e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),"aria-label":e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),isChecked:s,onClick:p,icon:a.jsx(lee,{})})]})},Nhe=d.memo($he),Lhe=()=>a.jsxs(N,{sx:{gap:2,position:"absolute",bottom:2,insetInlineStart:2},children:[a.jsx(Nhe,{}),a.jsx(The,{})]}),zhe=d.memo(Lhe),Fhe=Se(IN),Bhe=()=>{const e=W(r=>r.nodes.shouldShowMinimapPanel),t=aa("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-600)"),n=aa("var(--invokeai-colors-blackAlpha-300)","var(--invokeai-colors-blackAlpha-600)");return a.jsx(N,{sx:{gap:2,position:"absolute",bottom:2,insetInlineEnd:2},children:e&&a.jsx(Fhe,{pannable:!0,zoomable:!0,nodeBorderRadius:15,sx:{m:"0 !important",backgroundColor:"base.200 !important",borderRadius:"base",_dark:{backgroundColor:"base.500 !important"},svg:{borderRadius:"inherit"}},nodeColor:t,maskColor:n})})},Hhe=d.memo(Bhe),Vhe=()=>{const e=W(n=>n.nodes.isReady),{t}=Z();return a.jsxs(N,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center"},children:[a.jsx(fr,{children:e&&a.jsxs(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.2}},style:{position:"relative",width:"100%",height:"100%"},children:[a.jsx(phe,{}),a.jsx(eme,{}),a.jsx(hhe,{}),a.jsx(_he,{}),a.jsx(Ahe,{}),a.jsx(zhe,{}),a.jsx(Hhe,{})]})}),a.jsx(fr,{children:!e&&a.jsx(jn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.2}},style:{position:"absolute",width:"100%",height:"100%"},children:a.jsx(N,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:a.jsx(Yn,{label:t("nodes.loadingNodes"),icon:Toe})})})})]})},Whe=d.memo(Vhe),Uhe=()=>a.jsx(B9,{children:a.jsx(Whe,{})}),Ghe=d.memo(Uhe),Khe=()=>{const{t:e}=Z(),t=te(),{data:n}=Pd(),r=W(c=>c.system.isConnected),[o,{isLoading:s}]=H9({fixedCacheKey:"clearInvocationCache"}),l=d.useMemo(()=>!(n!=null&&n.size)||!r,[n==null?void 0:n.size,r]);return{clearInvocationCache:d.useCallback(async()=>{if(!l)try{await o().unwrap(),t(lt({title:e("invocationCache.clearSucceeded"),status:"success"}))}catch{t(lt({title:e("invocationCache.clearFailed"),status:"error"}))}},[l,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:l}},qhe=()=>{const{t:e}=Z(),{clearInvocationCache:t,isDisabled:n,isLoading:r}=Khe();return a.jsx(ot,{isDisabled:n,isLoading:r,onClick:t,children:e("invocationCache.clear")})},Xhe=d.memo(qhe),Qhe=()=>{const{t:e}=Z(),t=te(),{data:n}=Pd(),r=W(c=>c.system.isConnected),[o,{isLoading:s}]=V9({fixedCacheKey:"disableInvocationCache"}),l=d.useMemo(()=>!(n!=null&&n.enabled)||!r||(n==null?void 0:n.max_size)===0,[n==null?void 0:n.enabled,n==null?void 0:n.max_size,r]);return{disableInvocationCache:d.useCallback(async()=>{if(!l)try{await o().unwrap(),t(lt({title:e("invocationCache.disableSucceeded"),status:"success"}))}catch{t(lt({title:e("invocationCache.disableFailed"),status:"error"}))}},[l,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:l}},Yhe=()=>{const{t:e}=Z(),t=te(),{data:n}=Pd(),r=W(c=>c.system.isConnected),[o,{isLoading:s}]=W9({fixedCacheKey:"enableInvocationCache"}),l=d.useMemo(()=>(n==null?void 0:n.enabled)||!r||(n==null?void 0:n.max_size)===0,[n==null?void 0:n.enabled,n==null?void 0:n.max_size,r]);return{enableInvocationCache:d.useCallback(async()=>{if(!l)try{await o().unwrap(),t(lt({title:e("invocationCache.enableSucceeded"),status:"success"}))}catch{t(lt({title:e("invocationCache.enableFailed"),status:"error"}))}},[l,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:l}},Zhe=()=>{const{t:e}=Z(),{data:t}=Pd(),{enableInvocationCache:n,isDisabled:r,isLoading:o}=Yhe(),{disableInvocationCache:s,isDisabled:l,isLoading:i}=Qhe();return t!=null&&t.enabled?a.jsx(ot,{isDisabled:l,isLoading:i,onClick:s,children:e("invocationCache.disable")}):a.jsx(ot,{isDisabled:r,isLoading:o,onClick:n,children:e("invocationCache.enable")})},Jhe=d.memo(Zhe),ege=({children:e,...t})=>a.jsx(vP,{alignItems:"center",justifyContent:"center",w:"full",h:"full",layerStyle:"second",borderRadius:"base",py:2,px:3,gap:6,flexWrap:"nowrap",...t,children:e}),w7=d.memo(ege),tge={'&[aria-disabled="true"]':{color:"base.400",_dark:{color:"base.500"}}},nge=({label:e,value:t,isDisabled:n=!1,...r})=>a.jsxs(gP,{flexGrow:1,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","aria-disabled":n,sx:tge,...r,children:[a.jsx(xP,{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",children:e}),a.jsx(bP,{children:t})]}),gs=d.memo(nge),rge=()=>{const{t:e}=Z(),{data:t}=Pd(void 0);return a.jsxs(w7,{children:[a.jsx(gs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.cacheSize"),value:(t==null?void 0:t.size)??0}),a.jsx(gs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.hits"),value:(t==null?void 0:t.hits)??0}),a.jsx(gs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.misses"),value:(t==null?void 0:t.misses)??0}),a.jsx(gs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.maxCacheSize"),value:(t==null?void 0:t.max_size)??0}),a.jsxs(Ht,{w:24,orientation:"vertical",size:"xs",children:[a.jsx(Xhe,{}),a.jsx(Jhe,{})]})]})},oge=d.memo(rge),S7=e=>{const t=W(i=>i.system.isConnected),[n,{isLoading:r}]=lb(),o=te(),{t:s}=Z();return{cancelQueueItem:d.useCallback(async()=>{try{await n(e).unwrap(),o(lt({title:s("queue.cancelSucceeded"),status:"success"}))}catch{o(lt({title:s("queue.cancelFailed"),status:"error"}))}},[o,e,s,n]),isLoading:r,isDisabled:!t}},k7=(e,t)=>Number(((Date.parse(t)-Date.parse(e))/1e3).toFixed(2)),Tj={pending:{colorScheme:"cyan",translationKey:"queue.pending"},in_progress:{colorScheme:"yellow",translationKey:"queue.in_progress"},completed:{colorScheme:"green",translationKey:"queue.completed"},failed:{colorScheme:"red",translationKey:"queue.failed"},canceled:{colorScheme:"orange",translationKey:"queue.canceled"}},sge=({status:e})=>{const{t}=Z();return a.jsx(As,{colorScheme:Tj[e].colorScheme,children:t(Tj[e].translationKey)})},age=d.memo(sge),lge=e=>{const t=W(c=>c.system.isConnected),{isCanceled:n}=U9({batch_id:e},{selectFromResult:({data:c})=>c?{isCanceled:(c==null?void 0:c.in_progress)===0&&(c==null?void 0:c.pending)===0}:{isCanceled:!0}}),[r,{isLoading:o}]=G9({fixedCacheKey:"cancelByBatchIds"}),s=te(),{t:l}=Z();return{cancelBatch:d.useCallback(async()=>{if(!n)try{await r({batch_ids:[e]}).unwrap(),s(lt({title:l("queue.cancelBatchSucceeded"),status:"success"}))}catch{s(lt({title:l("queue.cancelBatchFailed"),status:"error"}))}},[e,s,n,l,r]),isLoading:o,isCanceled:n,isDisabled:!t}},ige=({queueItemDTO:e})=>{const{session_id:t,batch_id:n,item_id:r}=e,{t:o}=Z(),{cancelBatch:s,isLoading:l,isCanceled:i}=lge(n),{cancelQueueItem:c,isLoading:p}=S7(r),{data:m}=K9(r),h=d.useMemo(()=>{if(!m)return o("common.loading");if(!m.completed_at||!m.started_at)return o(`queue.${m.status}`);const g=k7(m.started_at,m.completed_at);return m.status==="completed"?`${o("queue.completedIn")} ${g}${g===1?"":"s"}`:`${g}s`},[m,o]);return a.jsxs(N,{layerStyle:"third",flexDir:"column",p:2,pt:0,borderRadius:"base",gap:2,children:[a.jsxs(N,{layerStyle:"second",p:2,gap:2,justifyContent:"space-between",alignItems:"center",borderRadius:"base",h:20,children:[a.jsx(Np,{label:o("queue.status"),data:h}),a.jsx(Np,{label:o("queue.item"),data:r}),a.jsx(Np,{label:o("queue.batch"),data:n}),a.jsx(Np,{label:o("queue.session"),data:t}),a.jsxs(Ht,{size:"xs",orientation:"vertical",children:[a.jsx(ot,{onClick:c,isLoading:p,isDisabled:m?["canceled","completed","failed"].includes(m.status):!0,"aria-label":o("queue.cancelItem"),icon:a.jsx(Ec,{}),colorScheme:"error",children:o("queue.cancelItem")}),a.jsx(ot,{onClick:s,isLoading:l,isDisabled:i,"aria-label":o("queue.cancelBatch"),icon:a.jsx(Ec,{}),colorScheme:"error",children:o("queue.cancelBatch")})]})]}),(m==null?void 0:m.error)&&a.jsxs(N,{layerStyle:"second",p:3,gap:1,justifyContent:"space-between",alignItems:"flex-start",borderRadius:"base",flexDir:"column",children:[a.jsx(ur,{size:"sm",color:"error.500",_dark:{color:"error.400"},children:"Error"}),a.jsx("pre",{children:m.error})]}),a.jsx(N,{layerStyle:"second",h:512,w:"full",borderRadius:"base",alignItems:"center",justifyContent:"center",children:m?a.jsx(Xc,{children:a.jsx(Za,{label:"Queue Item",data:m})}):a.jsx(fa,{opacity:.5})})]})},cge=d.memo(ige),Np=({label:e,data:t})=>a.jsxs(N,{flexDir:"column",justifyContent:"flex-start",p:1,gap:1,overflow:"hidden",h:"full",w:"full",children:[a.jsx(ur,{size:"md",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:e}),a.jsx(be,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:t})]}),xs={number:"3rem",statusBadge:"5.7rem",statusDot:2,time:"4rem",batchId:"5rem",fieldValues:"auto",actions:"auto"},$j={bg:"base.300",_dark:{bg:"base.750"}},uge={_hover:$j,"&[aria-selected='true']":$j},dge=({index:e,item:t,context:n})=>{const{t:r}=Z(),o=d.useCallback(()=>{n.toggleQueueItem(t.item_id)},[n,t.item_id]),{cancelQueueItem:s,isLoading:l}=S7(t.item_id),i=d.useCallback(h=>{h.stopPropagation(),s()},[s]),c=d.useMemo(()=>n.openQueueItems.includes(t.item_id),[n.openQueueItems,t.item_id]),p=d.useMemo(()=>!t.completed_at||!t.started_at?void 0:`${k7(t.started_at,t.completed_at)}s`,[t]),m=d.useMemo(()=>["canceled","completed","failed"].includes(t.status),[t.status]);return a.jsxs(N,{flexDir:"column","aria-selected":c,fontSize:"sm",borderRadius:"base",justifyContent:"center",sx:uge,"data-testid":"queue-item",children:[a.jsxs(N,{minH:9,alignItems:"center",gap:4,p:1.5,cursor:"pointer",onClick:o,children:[a.jsx(N,{w:xs.number,justifyContent:"flex-end",alignItems:"center",flexShrink:0,children:a.jsx(be,{variant:"subtext",children:e+1})}),a.jsx(N,{w:xs.statusBadge,alignItems:"center",flexShrink:0,children:a.jsx(age,{status:t.status})}),a.jsx(N,{w:xs.time,alignItems:"center",flexShrink:0,children:p||"-"}),a.jsx(N,{w:xs.batchId,flexShrink:0,children:a.jsx(be,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",alignItems:"center",children:t.batch_id})}),a.jsx(N,{alignItems:"center",overflow:"hidden",flexGrow:1,children:t.field_values&&a.jsx(N,{gap:2,w:"full",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",children:t.field_values.filter(h=>h.node_path!=="metadata_accumulator").map(({node_path:h,field_name:g,value:x})=>a.jsxs(be,{as:"span",children:[a.jsxs(be,{as:"span",fontWeight:600,children:[h,".",g]}),": ",x]},`${t.item_id}.${h}.${g}.${x}`))})}),a.jsx(N,{alignItems:"center",w:xs.actions,pe:3,children:a.jsx(Ht,{size:"xs",variant:"ghost",children:a.jsx(Be,{onClick:i,isDisabled:m,isLoading:l,"aria-label":r("queue.cancelItem"),icon:a.jsx(Ec,{})})})})]}),a.jsx(Od,{in:c,transition:{enter:{duration:.1},exit:{duration:.1}},unmountOnExit:!0,children:a.jsx(cge,{queueItemDTO:t})})]})},fge=d.memo(dge),pge=d.memo(_e((e,t)=>a.jsx(N,{...e,ref:t,flexDirection:"column",gap:.5,children:e.children}))),mge=d.memo(pge),hge=()=>a.jsxs(N,{alignItems:"center",gap:4,p:1,pb:2,textTransform:"uppercase",fontWeight:700,fontSize:"xs",letterSpacing:1,children:[a.jsx(N,{w:xs.number,justifyContent:"flex-end",alignItems:"center",children:a.jsx(be,{variant:"subtext",children:"#"})}),a.jsx(N,{ps:.5,w:xs.statusBadge,alignItems:"center",children:a.jsx(be,{variant:"subtext",children:"status"})}),a.jsx(N,{ps:.5,w:xs.time,alignItems:"center",children:a.jsx(be,{variant:"subtext",children:"time"})}),a.jsx(N,{ps:.5,w:xs.batchId,alignItems:"center",children:a.jsx(be,{variant:"subtext",children:"batch"})}),a.jsx(N,{ps:.5,w:xs.fieldValues,alignItems:"center",children:a.jsx(be,{variant:"subtext",children:"batch field values"})})]}),gge=d.memo(hge),vge={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},xge=ae(he,({queue:e})=>{const{listCursor:t,listPriority:n}=e;return{listCursor:t,listPriority:n}},Ce),bge=(e,t)=>t.item_id,yge={List:mge},Cge=(e,t,n)=>a.jsx(fge,{index:e,item:t,context:n}),wge=()=>{const{listCursor:e,listPriority:t}=W(xge),n=te(),r=d.useRef(null),[o,s]=d.useState(null),[l,i]=Ly(vge),{t:c}=Z();d.useEffect(()=>{const{current:S}=r;return o&&S&&l({target:S,elements:{viewport:o}}),()=>{var _;return(_=i())==null?void 0:_.destroy()}},[o,l,i]);const{data:p,isLoading:m}=q9({cursor:e,priority:t}),h=d.useMemo(()=>p?X9.getSelectors().selectAll(p):[],[p]),g=d.useCallback(()=>{if(!(p!=null&&p.has_more))return;const S=h[h.length-1];S&&(n(ib(S.item_id)),n(cb(S.priority)))},[n,p==null?void 0:p.has_more,h]),[x,y]=d.useState([]),b=d.useCallback(S=>{y(_=>_.includes(S)?_.filter(j=>j!==S):[..._,S])},[]),C=d.useMemo(()=>({openQueueItems:x,toggleQueueItem:b}),[x,b]);return m?a.jsx(Yne,{}):h.length?a.jsxs(N,{w:"full",h:"full",flexDir:"column",children:[a.jsx(gge,{}),a.jsx(N,{ref:r,w:"full",h:"full",alignItems:"center",justifyContent:"center",children:a.jsx(ioe,{data:h,endReached:g,scrollerRef:s,itemContent:Cge,computeItemKey:bge,components:yge,context:C})})]}):a.jsx(N,{w:"full",h:"full",alignItems:"center",justifyContent:"center",children:a.jsx(ur,{color:"base.400",_dark:{color:"base.500"},children:c("queue.queueEmpty")})})},Sge=d.memo(wge),kge=()=>{const{data:e}=va(),{t}=Z();return a.jsxs(w7,{"data-testid":"queue-status",children:[a.jsx(gs,{label:t("queue.in_progress"),value:(e==null?void 0:e.queue.in_progress)??0}),a.jsx(gs,{label:t("queue.pending"),value:(e==null?void 0:e.queue.pending)??0}),a.jsx(gs,{label:t("queue.completed"),value:(e==null?void 0:e.queue.completed)??0}),a.jsx(gs,{label:t("queue.failed"),value:(e==null?void 0:e.queue.failed)??0}),a.jsx(gs,{label:t("queue.canceled"),value:(e==null?void 0:e.queue.canceled)??0}),a.jsx(gs,{label:t("queue.total"),value:(e==null?void 0:e.queue.total)??0})]})},_ge=d.memo(kge);function jge(e){return Te({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828l.645-1.937zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.734 1.734 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.734 1.734 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.734 1.734 0 0 0 3.407 2.31l.387-1.162zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L10.863.1z"}}]})(e)}const Ige=()=>{const e=te(),{t}=Z(),n=W(c=>c.system.isConnected),[r,{isLoading:o}]=zI({fixedCacheKey:"pruneQueue"}),{finishedCount:s}=va(void 0,{selectFromResult:({data:c})=>c?{finishedCount:c.queue.completed+c.queue.canceled+c.queue.failed}:{finishedCount:0}}),l=d.useCallback(async()=>{if(s)try{const c=await r().unwrap();e(lt({title:t("queue.pruneSucceeded",{item_count:c.deleted}),status:"success"})),e(ib(void 0)),e(cb(void 0))}catch{e(lt({title:t("queue.pruneFailed"),status:"error"}))}},[s,r,e,t]),i=d.useMemo(()=>!n||!s,[s,n]);return{pruneQueue:l,isLoading:o,finishedCount:s,isDisabled:i}},Pge=({asIconButton:e})=>{const{t}=Z(),{pruneQueue:n,isLoading:r,finishedCount:o,isDisabled:s}=Ige();return a.jsx(ui,{isDisabled:s,isLoading:r,asIconButton:e,label:t("queue.prune"),tooltip:t("queue.pruneTooltip",{item_count:o}),icon:a.jsx(jge,{}),onClick:n,colorScheme:"blue"})},Ege=d.memo(Pge),Mge=()=>{const e=Dt("pauseQueue").isFeatureEnabled,t=Dt("resumeQueue").isFeatureEnabled;return a.jsxs(N,{layerStyle:"second",borderRadius:"base",p:2,gap:2,children:[e||t?a.jsxs(Ht,{w:28,orientation:"vertical",isAttached:!0,size:"sm",children:[t?a.jsx(sO,{}):a.jsx(a.Fragment,{}),e?a.jsx(J8,{}):a.jsx(a.Fragment,{})]}):a.jsx(a.Fragment,{}),a.jsxs(Ht,{w:28,orientation:"vertical",isAttached:!0,size:"sm",children:[a.jsx(Ege,{}),a.jsx(r2,{})]})]})},Oge=d.memo(Mge),Rge=()=>{const e=Dt("invocationCache").isFeatureEnabled;return a.jsxs(N,{layerStyle:"first",borderRadius:"base",w:"full",h:"full",p:2,flexDir:"column",gap:2,children:[a.jsxs(N,{gap:2,w:"full",children:[a.jsx(Oge,{}),a.jsx(_ge,{}),e&&a.jsx(oge,{})]}),a.jsx(Ie,{layerStyle:"second",p:2,borderRadius:"base",w:"full",h:"full",children:a.jsx(Sge,{})})]})},Dge=d.memo(Rge),Age=()=>a.jsx(Dge,{}),Tge=d.memo(Age),$ge=()=>a.jsx(s7,{}),Nge=d.memo($ge);var zx={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=Ww;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=Ww;e.exports=r.Konva})(zx,zx.exports);var Lge=zx.exports;const yd=wd(Lge);var _7={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 zge=function(t){var n={},r=d,o=Lp,s=Object.assign;function l(u){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+u,v=1;v<arguments.length;v++)f+="&args[]="+encodeURIComponent(arguments[v]);return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,c=Symbol.for("react.element"),p=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),y=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),I=Symbol.iterator;function M(u){return u===null||typeof u!="object"?null:(u=I&&u[I]||u["@@iterator"],typeof u=="function"?u:null)}function R(u){if(u==null)return null;if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case m:return"Fragment";case p:return"Portal";case g:return"Profiler";case h:return"StrictMode";case C:return"Suspense";case S:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case y:return(u.displayName||"Context")+".Consumer";case x:return(u._context.displayName||"Context")+".Provider";case b:var f=u.render;return u=u.displayName,u||(u=f.displayName||f.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case _:return f=u.displayName||null,f!==null?f:R(u.type)||"Memo";case j:f=u._payload,u=u._init;try{return R(u(f))}catch{}}return null}function D(u){var f=u.type;switch(u.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return u=f.render,u=u.displayName||u.name||"",f.displayName||(u!==""?"ForwardRef("+u+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return R(f);case 8:return f===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 f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function A(u){var f=u,v=u;if(u.alternate)for(;f.return;)f=f.return;else{u=f;do f=u,f.flags&4098&&(v=f.return),u=f.return;while(u)}return f.tag===3?v:null}function O(u){if(A(u)!==u)throw Error(l(188))}function $(u){var f=u.alternate;if(!f){if(f=A(u),f===null)throw Error(l(188));return f!==u?null:u}for(var v=u,w=f;;){var k=v.return;if(k===null)break;var P=k.alternate;if(P===null){if(w=k.return,w!==null){v=w;continue}break}if(k.child===P.child){for(P=k.child;P;){if(P===v)return O(k),u;if(P===w)return O(k),f;P=P.sibling}throw Error(l(188))}if(v.return!==w.return)v=k,w=P;else{for(var L=!1,ne=k.child;ne;){if(ne===v){L=!0,v=k,w=P;break}if(ne===w){L=!0,w=k,v=P;break}ne=ne.sibling}if(!L){for(ne=P.child;ne;){if(ne===v){L=!0,v=P,w=k;break}if(ne===w){L=!0,w=P,v=k;break}ne=ne.sibling}if(!L)throw Error(l(189))}}if(v.alternate!==w)throw Error(l(190))}if(v.tag!==3)throw Error(l(188));return v.stateNode.current===v?u:f}function X(u){return u=$(u),u!==null?z(u):null}function z(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){var f=z(u);if(f!==null)return f;u=u.sibling}return null}function V(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){if(u.tag!==4){var f=V(u);if(f!==null)return f}u=u.sibling}return null}var Q=Array.isArray,G=t.getPublicInstance,F=t.getRootHostContext,U=t.getChildHostContext,T=t.prepareForCommit,B=t.resetAfterCommit,Y=t.createInstance,re=t.appendInitialChild,le=t.finalizeInitialChildren,oe=t.prepareUpdate,q=t.shouldSetTextContent,K=t.createTextInstance,ee=t.scheduleTimeout,ce=t.cancelTimeout,J=t.noTimeout,ie=t.isPrimaryRenderer,de=t.supportsMutation,xe=t.supportsPersistence,we=t.supportsHydration,ve=t.getInstanceFromNode,fe=t.preparePortalMount,Oe=t.getCurrentEventPriority,je=t.detachDeletedInstance,$e=t.supportsMicrotasks,st=t.scheduleMicrotask,Ve=t.supportsTestSelectors,Ct=t.findFiberRoot,Ye=t.getBoundingRect,Ke=t.getTextContent,ge=t.isHiddenSubtree,De=t.matchAccessibilityRole,ut=t.setFocusIfFocusable,yt=t.setupIntersectionObserver,ye=t.appendChild,tt=t.appendChildToContainer,ct=t.commitTextUpdate,ft=t.commitMount,Me=t.commitUpdate,Ne=t.insertBefore,Ut=t.insertInContainerBefore,ke=t.removeChild,ze=t.removeChildFromContainer,Le=t.resetTextContent,Ge=t.hideInstance,pt=t.hideTextInstance,Pn=t.unhideInstance,At=t.unhideTextInstance,Tt=t.clearContainer,mr=t.cloneInstance,Nn=t.createContainerChildSet,Sn=t.appendChildToContainerChildSet,hn=t.finalizeContainerChildren,an=t.replaceContainerChildren,jr=t.cloneHiddenInstance,Mo=t.cloneHiddenTextInstance,hr=t.canHydrateInstance,gr=t.canHydrateTextInstance,Ns=t.canHydrateSuspenseInstance,Ls=t.isSuspenseInstancePending,Sa=t.isSuspenseInstanceFallback,ka=t.getSuspenseInstanceFallbackErrorDetails,mi=t.registerSuspenseInstanceRetry,_a=t.getNextHydratableSibling,hi=t.getFirstHydratableChild,Ze=t.getFirstHydratableChildWithinContainer,Gt=t.getFirstHydratableChildWithinSuspenseInstance,Ln=t.hydrateInstance,kt=t.hydrateTextInstance,ja=t.hydrateSuspenseInstance,Wr=t.getNextHydratableInstanceAfterSuspenseInstance,nf=t.commitHydratedContainer,Wg=t.commitHydratedSuspenseInstance,Ug=t.clearSuspenseBoundary,zn=t.clearSuspenseBoundaryFromContainer,zs=t.shouldDeleteUnhydratedTailInstances,rf=t.didNotMatchHydratedContainerTextInstance,gi=t.didNotMatchHydratedTextInstance,nu;function vl(u){if(nu===void 0)try{throw Error()}catch(v){var f=v.stack.trim().match(/\n( *(at )?)/);nu=f&&f[1]||""}return`
|
||
`+nu+u}var ru=!1;function ou(u,f){if(!u||ru)return"";ru=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(Ee){var w=Ee}Reflect.construct(u,[],f)}else{try{f.call()}catch(Ee){w=Ee}u.call(f.prototype)}else{try{throw Error()}catch(Ee){w=Ee}u()}}catch(Ee){if(Ee&&w&&typeof Ee.stack=="string"){for(var k=Ee.stack.split(`
|
||
`),P=w.stack.split(`
|
||
`),L=k.length-1,ne=P.length-1;1<=L&&0<=ne&&k[L]!==P[ne];)ne--;for(;1<=L&&0<=ne;L--,ne--)if(k[L]!==P[ne]){if(L!==1||ne!==1)do if(L--,ne--,0>ne||k[L]!==P[ne]){var pe=`
|
||
`+k[L].replace(" at new "," at ");return u.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",u.displayName)),pe}while(1<=L&&0<=ne);break}}}finally{ru=!1,Error.prepareStackTrace=v}return(u=u?u.displayName||u.name:"")?vl(u):""}var Gg=Object.prototype.hasOwnProperty,Ia=[],rt=-1;function Et(u){return{current:u}}function _t(u){0>rt||(u.current=Ia[rt],Ia[rt]=null,rt--)}function Mt(u,f){rt++,Ia[rt]=u.current,u.current=f}var rr={},rn=Et(rr),Dn=Et(!1),vr=rr;function vi(u,f){var v=u.type.contextTypes;if(!v)return rr;var w=u.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===f)return w.__reactInternalMemoizedMaskedChildContext;var k={},P;for(P in v)k[P]=f[P];return w&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=f,u.__reactInternalMemoizedMaskedChildContext=k),k}function Ir(u){return u=u.childContextTypes,u!=null}function of(){_t(Dn),_t(rn)}function k2(u,f,v){if(rn.current!==rr)throw Error(l(168));Mt(rn,f),Mt(Dn,v)}function _2(u,f,v){var w=u.stateNode;if(f=f.childContextTypes,typeof w.getChildContext!="function")return v;w=w.getChildContext();for(var k in w)if(!(k in f))throw Error(l(108,D(u)||"Unknown",k));return s({},v,w)}function sf(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||rr,vr=rn.current,Mt(rn,u),Mt(Dn,Dn.current),!0}function j2(u,f,v){var w=u.stateNode;if(!w)throw Error(l(169));v?(u=_2(u,f,vr),w.__reactInternalMemoizedMergedChildContext=u,_t(Dn),_t(rn),Mt(rn,u)):_t(Dn),Mt(Dn,v)}var Oo=Math.clz32?Math.clz32:F7,L7=Math.log,z7=Math.LN2;function F7(u){return u>>>=0,u===0?32:31-(L7(u)/z7|0)|0}var af=64,lf=4194304;function su(u){switch(u&-u){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 u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function cf(u,f){var v=u.pendingLanes;if(v===0)return 0;var w=0,k=u.suspendedLanes,P=u.pingedLanes,L=v&268435455;if(L!==0){var ne=L&~k;ne!==0?w=su(ne):(P&=L,P!==0&&(w=su(P)))}else L=v&~k,L!==0?w=su(L):P!==0&&(w=su(P));if(w===0)return 0;if(f!==0&&f!==w&&!(f&k)&&(k=w&-w,P=f&-f,k>=P||k===16&&(P&4194240)!==0))return f;if(w&4&&(w|=v&16),f=u.entangledLanes,f!==0)for(u=u.entanglements,f&=w;0<f;)v=31-Oo(f),k=1<<v,w|=u[v],f&=~k;return w}function B7(u,f){switch(u){case 1:case 2:case 4:return f+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 f+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 H7(u,f){for(var v=u.suspendedLanes,w=u.pingedLanes,k=u.expirationTimes,P=u.pendingLanes;0<P;){var L=31-Oo(P),ne=1<<L,pe=k[L];pe===-1?(!(ne&v)||ne&w)&&(k[L]=B7(ne,f)):pe<=f&&(u.expiredLanes|=ne),P&=~ne}}function Kg(u){return u=u.pendingLanes&-1073741825,u!==0?u:u&1073741824?1073741824:0}function I2(){var u=af;return af<<=1,!(af&4194240)&&(af=64),u}function qg(u){for(var f=[],v=0;31>v;v++)f.push(u);return f}function au(u,f,v){u.pendingLanes|=f,f!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,f=31-Oo(f),u[f]=v}function V7(u,f){var v=u.pendingLanes&~f;u.pendingLanes=f,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=f,u.mutableReadLanes&=f,u.entangledLanes&=f,f=u.entanglements;var w=u.eventTimes;for(u=u.expirationTimes;0<v;){var k=31-Oo(v),P=1<<k;f[k]=0,w[k]=-1,u[k]=-1,v&=~P}}function Xg(u,f){var v=u.entangledLanes|=f;for(u=u.entanglements;v;){var w=31-Oo(v),k=1<<w;k&f|u[w]&f&&(u[w]|=f),v&=~k}}var Nt=0;function P2(u){return u&=-u,1<u?4<u?u&268435455?16:536870912:4:1}var Qg=o.unstable_scheduleCallback,E2=o.unstable_cancelCallback,W7=o.unstable_shouldYield,U7=o.unstable_requestPaint,Kn=o.unstable_now,Yg=o.unstable_ImmediatePriority,G7=o.unstable_UserBlockingPriority,Zg=o.unstable_NormalPriority,K7=o.unstable_IdlePriority,uf=null,as=null;function q7(u){if(as&&typeof as.onCommitFiberRoot=="function")try{as.onCommitFiberRoot(uf,u,void 0,(u.current.flags&128)===128)}catch{}}function X7(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var Ro=typeof Object.is=="function"?Object.is:X7,Fs=null,df=!1,Jg=!1;function M2(u){Fs===null?Fs=[u]:Fs.push(u)}function Q7(u){df=!0,M2(u)}function ls(){if(!Jg&&Fs!==null){Jg=!0;var u=0,f=Nt;try{var v=Fs;for(Nt=1;u<v.length;u++){var w=v[u];do w=w(!0);while(w!==null)}Fs=null,df=!1}catch(k){throw Fs!==null&&(Fs=Fs.slice(u+1)),Qg(Yg,ls),k}finally{Nt=f,Jg=!1}}return null}var xi=[],bi=0,ff=null,pf=0,ro=[],oo=0,xl=null,Bs=1,Hs="";function bl(u,f){xi[bi++]=pf,xi[bi++]=ff,ff=u,pf=f}function O2(u,f,v){ro[oo++]=Bs,ro[oo++]=Hs,ro[oo++]=xl,xl=u;var w=Bs;u=Hs;var k=32-Oo(w)-1;w&=~(1<<k),v+=1;var P=32-Oo(f)+k;if(30<P){var L=k-k%5;P=(w&(1<<L)-1).toString(32),w>>=L,k-=L,Bs=1<<32-Oo(f)+k|v<<k|w,Hs=P+u}else Bs=1<<P|v<<k|w,Hs=u}function e0(u){u.return!==null&&(bl(u,1),O2(u,1,0))}function t0(u){for(;u===ff;)ff=xi[--bi],xi[bi]=null,pf=xi[--bi],xi[bi]=null;for(;u===xl;)xl=ro[--oo],ro[oo]=null,Hs=ro[--oo],ro[oo]=null,Bs=ro[--oo],ro[oo]=null}var Ur=null,so=null,ln=!1,lu=!1,Do=null;function R2(u,f){var v=uo(5,null,null,0);v.elementType="DELETED",v.stateNode=f,v.return=u,f=u.deletions,f===null?(u.deletions=[v],u.flags|=16):f.push(v)}function D2(u,f){switch(u.tag){case 5:return f=hr(f,u.type,u.pendingProps),f!==null?(u.stateNode=f,Ur=u,so=hi(f),!0):!1;case 6:return f=gr(f,u.pendingProps),f!==null?(u.stateNode=f,Ur=u,so=null,!0):!1;case 13:if(f=Ns(f),f!==null){var v=xl!==null?{id:Bs,overflow:Hs}:null;return u.memoizedState={dehydrated:f,treeContext:v,retryLane:1073741824},v=uo(18,null,null,0),v.stateNode=f,v.return=u,u.child=v,Ur=u,so=null,!0}return!1;default:return!1}}function n0(u){return(u.mode&1)!==0&&(u.flags&128)===0}function r0(u){if(ln){var f=so;if(f){var v=f;if(!D2(u,f)){if(n0(u))throw Error(l(418));f=_a(v);var w=Ur;f&&D2(u,f)?R2(w,v):(u.flags=u.flags&-4097|2,ln=!1,Ur=u)}}else{if(n0(u))throw Error(l(418));u.flags=u.flags&-4097|2,ln=!1,Ur=u}}}function A2(u){for(u=u.return;u!==null&&u.tag!==5&&u.tag!==3&&u.tag!==13;)u=u.return;Ur=u}function mf(u){if(!we||u!==Ur)return!1;if(!ln)return A2(u),ln=!0,!1;if(u.tag!==3&&(u.tag!==5||zs(u.type)&&!q(u.type,u.memoizedProps))){var f=so;if(f){if(n0(u))throw T2(),Error(l(418));for(;f;)R2(u,f),f=_a(f)}}if(A2(u),u.tag===13){if(!we)throw Error(l(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(l(317));so=Wr(u)}else so=Ur?_a(u.stateNode):null;return!0}function T2(){for(var u=so;u;)u=_a(u)}function yi(){we&&(so=Ur=null,lu=ln=!1)}function o0(u){Do===null?Do=[u]:Do.push(u)}var Y7=i.ReactCurrentBatchConfig;function hf(u,f){if(Ro(u,f))return!0;if(typeof u!="object"||u===null||typeof f!="object"||f===null)return!1;var v=Object.keys(u),w=Object.keys(f);if(v.length!==w.length)return!1;for(w=0;w<v.length;w++){var k=v[w];if(!Gg.call(f,k)||!Ro(u[k],f[k]))return!1}return!0}function Z7(u){switch(u.tag){case 5:return vl(u.type);case 16:return vl("Lazy");case 13:return vl("Suspense");case 19:return vl("SuspenseList");case 0:case 2:case 15:return u=ou(u.type,!1),u;case 11:return u=ou(u.type.render,!1),u;case 1:return u=ou(u.type,!0),u;default:return""}}function Ao(u,f){if(u&&u.defaultProps){f=s({},f),u=u.defaultProps;for(var v in u)f[v]===void 0&&(f[v]=u[v]);return f}return f}var gf=Et(null),vf=null,Ci=null,s0=null;function a0(){s0=Ci=vf=null}function $2(u,f,v){ie?(Mt(gf,f._currentValue),f._currentValue=v):(Mt(gf,f._currentValue2),f._currentValue2=v)}function l0(u){var f=gf.current;_t(gf),ie?u._currentValue=f:u._currentValue2=f}function i0(u,f,v){for(;u!==null;){var w=u.alternate;if((u.childLanes&f)!==f?(u.childLanes|=f,w!==null&&(w.childLanes|=f)):w!==null&&(w.childLanes&f)!==f&&(w.childLanes|=f),u===v)break;u=u.return}}function wi(u,f){vf=u,s0=Ci=null,u=u.dependencies,u!==null&&u.firstContext!==null&&(u.lanes&f&&(Pr=!0),u.firstContext=null)}function ao(u){var f=ie?u._currentValue:u._currentValue2;if(s0!==u)if(u={context:u,memoizedValue:f,next:null},Ci===null){if(vf===null)throw Error(l(308));Ci=u,vf.dependencies={lanes:0,firstContext:u}}else Ci=Ci.next=u;return f}var yl=null;function c0(u){yl===null?yl=[u]:yl.push(u)}function N2(u,f,v,w){var k=f.interleaved;return k===null?(v.next=v,c0(f)):(v.next=k.next,k.next=v),f.interleaved=v,is(u,w)}function is(u,f){u.lanes|=f;var v=u.alternate;for(v!==null&&(v.lanes|=f),v=u,u=u.return;u!==null;)u.childLanes|=f,v=u.alternate,v!==null&&(v.childLanes|=f),v=u,u=u.return;return v.tag===3?v.stateNode:null}var Pa=!1;function u0(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function L2(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,effects:u.effects})}function Vs(u,f){return{eventTime:u,lane:f,tag:0,payload:null,callback:null,next:null}}function Ea(u,f,v){var w=u.updateQueue;if(w===null)return null;if(w=w.shared,jt&2){var k=w.pending;return k===null?f.next=f:(f.next=k.next,k.next=f),w.pending=f,is(u,v)}return k=w.interleaved,k===null?(f.next=f,c0(w)):(f.next=k.next,k.next=f),w.interleaved=f,is(u,v)}function xf(u,f,v){if(f=f.updateQueue,f!==null&&(f=f.shared,(v&4194240)!==0)){var w=f.lanes;w&=u.pendingLanes,v|=w,f.lanes=v,Xg(u,v)}}function z2(u,f){var v=u.updateQueue,w=u.alternate;if(w!==null&&(w=w.updateQueue,v===w)){var k=null,P=null;if(v=v.firstBaseUpdate,v!==null){do{var L={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};P===null?k=P=L:P=P.next=L,v=v.next}while(v!==null);P===null?k=P=f:P=P.next=f}else k=P=f;v={baseState:w.baseState,firstBaseUpdate:k,lastBaseUpdate:P,shared:w.shared,effects:w.effects},u.updateQueue=v;return}u=v.lastBaseUpdate,u===null?v.firstBaseUpdate=f:u.next=f,v.lastBaseUpdate=f}function bf(u,f,v,w){var k=u.updateQueue;Pa=!1;var P=k.firstBaseUpdate,L=k.lastBaseUpdate,ne=k.shared.pending;if(ne!==null){k.shared.pending=null;var pe=ne,Ee=pe.next;pe.next=null,L===null?P=Ee:L.next=Ee,L=pe;var Xe=u.alternate;Xe!==null&&(Xe=Xe.updateQueue,ne=Xe.lastBaseUpdate,ne!==L&&(ne===null?Xe.firstBaseUpdate=Ee:ne.next=Ee,Xe.lastBaseUpdate=pe))}if(P!==null){var vt=k.baseState;L=0,Xe=Ee=pe=null,ne=P;do{var We=ne.lane,sn=ne.eventTime;if((w&We)===We){Xe!==null&&(Xe=Xe.next={eventTime:sn,lane:0,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null});e:{var Jt=u,Or=ne;switch(We=f,sn=v,Or.tag){case 1:if(Jt=Or.payload,typeof Jt=="function"){vt=Jt.call(sn,vt,We);break e}vt=Jt;break e;case 3:Jt.flags=Jt.flags&-65537|128;case 0:if(Jt=Or.payload,We=typeof Jt=="function"?Jt.call(sn,vt,We):Jt,We==null)break e;vt=s({},vt,We);break e;case 2:Pa=!0}}ne.callback!==null&&ne.lane!==0&&(u.flags|=64,We=k.effects,We===null?k.effects=[ne]:We.push(ne))}else sn={eventTime:sn,lane:We,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null},Xe===null?(Ee=Xe=sn,pe=vt):Xe=Xe.next=sn,L|=We;if(ne=ne.next,ne===null){if(ne=k.shared.pending,ne===null)break;We=ne,ne=We.next,We.next=null,k.lastBaseUpdate=We,k.shared.pending=null}}while(1);if(Xe===null&&(pe=vt),k.baseState=pe,k.firstBaseUpdate=Ee,k.lastBaseUpdate=Xe,f=k.shared.interleaved,f!==null){k=f;do L|=k.lane,k=k.next;while(k!==f)}else P===null&&(k.shared.lanes=0);wl|=L,u.lanes=L,u.memoizedState=vt}}function F2(u,f,v){if(u=f.effects,f.effects=null,u!==null)for(f=0;f<u.length;f++){var w=u[f],k=w.callback;if(k!==null){if(w.callback=null,w=v,typeof k!="function")throw Error(l(191,k));k.call(w)}}}var B2=new r.Component().refs;function d0(u,f,v,w){f=u.memoizedState,v=v(w,f),v=v==null?f:s({},f,v),u.memoizedState=v,u.lanes===0&&(u.updateQueue.baseState=v)}var yf={isMounted:function(u){return(u=u._reactInternals)?A(u)===u:!1},enqueueSetState:function(u,f,v){u=u._reactInternals;var w=lr(),k=Ra(u),P=Vs(w,k);P.payload=f,v!=null&&(P.callback=v),f=Ea(u,P,k),f!==null&&(co(f,u,k,w),xf(f,u,k))},enqueueReplaceState:function(u,f,v){u=u._reactInternals;var w=lr(),k=Ra(u),P=Vs(w,k);P.tag=1,P.payload=f,v!=null&&(P.callback=v),f=Ea(u,P,k),f!==null&&(co(f,u,k,w),xf(f,u,k))},enqueueForceUpdate:function(u,f){u=u._reactInternals;var v=lr(),w=Ra(u),k=Vs(v,w);k.tag=2,f!=null&&(k.callback=f),f=Ea(u,k,w),f!==null&&(co(f,u,w,v),xf(f,u,w))}};function H2(u,f,v,w,k,P,L){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(w,P,L):f.prototype&&f.prototype.isPureReactComponent?!hf(v,w)||!hf(k,P):!0}function V2(u,f,v){var w=!1,k=rr,P=f.contextType;return typeof P=="object"&&P!==null?P=ao(P):(k=Ir(f)?vr:rn.current,w=f.contextTypes,P=(w=w!=null)?vi(u,k):rr),f=new f(v,P),u.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=yf,u.stateNode=f,f._reactInternals=u,w&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=k,u.__reactInternalMemoizedMaskedChildContext=P),f}function W2(u,f,v,w){u=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(v,w),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(v,w),f.state!==u&&yf.enqueueReplaceState(f,f.state,null)}function f0(u,f,v,w){var k=u.stateNode;k.props=v,k.state=u.memoizedState,k.refs=B2,u0(u);var P=f.contextType;typeof P=="object"&&P!==null?k.context=ao(P):(P=Ir(f)?vr:rn.current,k.context=vi(u,P)),k.state=u.memoizedState,P=f.getDerivedStateFromProps,typeof P=="function"&&(d0(u,f,P,v),k.state=u.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(f=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),f!==k.state&&yf.enqueueReplaceState(k,k.state,null),bf(u,v,k,w),k.state=u.memoizedState),typeof k.componentDidMount=="function"&&(u.flags|=4194308)}function iu(u,f,v){if(u=v.ref,u!==null&&typeof u!="function"&&typeof u!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(l(309));var w=v.stateNode}if(!w)throw Error(l(147,u));var k=w,P=""+u;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===P?f.ref:(f=function(L){var ne=k.refs;ne===B2&&(ne=k.refs={}),L===null?delete ne[P]:ne[P]=L},f._stringRef=P,f)}if(typeof u!="string")throw Error(l(284));if(!v._owner)throw Error(l(290,u))}return u}function Cf(u,f){throw u=Object.prototype.toString.call(f),Error(l(31,u==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":u))}function U2(u){var f=u._init;return f(u._payload)}function G2(u){function f(ue,se){if(u){var me=ue.deletions;me===null?(ue.deletions=[se],ue.flags|=16):me.push(se)}}function v(ue,se){if(!u)return null;for(;se!==null;)f(ue,se),se=se.sibling;return null}function w(ue,se){for(ue=new Map;se!==null;)se.key!==null?ue.set(se.key,se):ue.set(se.index,se),se=se.sibling;return ue}function k(ue,se){return ue=Aa(ue,se),ue.index=0,ue.sibling=null,ue}function P(ue,se,me){return ue.index=me,u?(me=ue.alternate,me!==null?(me=me.index,me<se?(ue.flags|=2,se):me):(ue.flags|=2,se)):(ue.flags|=1048576,se)}function L(ue){return u&&ue.alternate===null&&(ue.flags|=2),ue}function ne(ue,se,me,Ue){return se===null||se.tag!==6?(se=J0(me,ue.mode,Ue),se.return=ue,se):(se=k(se,me),se.return=ue,se)}function pe(ue,se,me,Ue){var it=me.type;return it===m?Xe(ue,se,me.props.children,Ue,me.key):se!==null&&(se.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===j&&U2(it)===se.type)?(Ue=k(se,me.props),Ue.ref=iu(ue,se,me),Ue.return=ue,Ue):(Ue=Kf(me.type,me.key,me.props,null,ue.mode,Ue),Ue.ref=iu(ue,se,me),Ue.return=ue,Ue)}function Ee(ue,se,me,Ue){return se===null||se.tag!==4||se.stateNode.containerInfo!==me.containerInfo||se.stateNode.implementation!==me.implementation?(se=ev(me,ue.mode,Ue),se.return=ue,se):(se=k(se,me.children||[]),se.return=ue,se)}function Xe(ue,se,me,Ue,it){return se===null||se.tag!==7?(se=jl(me,ue.mode,Ue,it),se.return=ue,se):(se=k(se,me),se.return=ue,se)}function vt(ue,se,me){if(typeof se=="string"&&se!==""||typeof se=="number")return se=J0(""+se,ue.mode,me),se.return=ue,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case c:return me=Kf(se.type,se.key,se.props,null,ue.mode,me),me.ref=iu(ue,null,se),me.return=ue,me;case p:return se=ev(se,ue.mode,me),se.return=ue,se;case j:var Ue=se._init;return vt(ue,Ue(se._payload),me)}if(Q(se)||M(se))return se=jl(se,ue.mode,me,null),se.return=ue,se;Cf(ue,se)}return null}function We(ue,se,me,Ue){var it=se!==null?se.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return it!==null?null:ne(ue,se,""+me,Ue);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case c:return me.key===it?pe(ue,se,me,Ue):null;case p:return me.key===it?Ee(ue,se,me,Ue):null;case j:return it=me._init,We(ue,se,it(me._payload),Ue)}if(Q(me)||M(me))return it!==null?null:Xe(ue,se,me,Ue,null);Cf(ue,me)}return null}function sn(ue,se,me,Ue,it){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number")return ue=ue.get(me)||null,ne(se,ue,""+Ue,it);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case c:return ue=ue.get(Ue.key===null?me:Ue.key)||null,pe(se,ue,Ue,it);case p:return ue=ue.get(Ue.key===null?me:Ue.key)||null,Ee(se,ue,Ue,it);case j:var wt=Ue._init;return sn(ue,se,me,wt(Ue._payload),it)}if(Q(Ue)||M(Ue))return ue=ue.get(me)||null,Xe(se,ue,Ue,it,null);Cf(se,Ue)}return null}function Jt(ue,se,me,Ue){for(var it=null,wt=null,xt=se,Lt=se=0,Qn=null;xt!==null&&Lt<me.length;Lt++){xt.index>Lt?(Qn=xt,xt=null):Qn=xt.sibling;var zt=We(ue,xt,me[Lt],Ue);if(zt===null){xt===null&&(xt=Qn);break}u&&xt&&zt.alternate===null&&f(ue,xt),se=P(zt,se,Lt),wt===null?it=zt:wt.sibling=zt,wt=zt,xt=Qn}if(Lt===me.length)return v(ue,xt),ln&&bl(ue,Lt),it;if(xt===null){for(;Lt<me.length;Lt++)xt=vt(ue,me[Lt],Ue),xt!==null&&(se=P(xt,se,Lt),wt===null?it=xt:wt.sibling=xt,wt=xt);return ln&&bl(ue,Lt),it}for(xt=w(ue,xt);Lt<me.length;Lt++)Qn=sn(xt,ue,Lt,me[Lt],Ue),Qn!==null&&(u&&Qn.alternate!==null&&xt.delete(Qn.key===null?Lt:Qn.key),se=P(Qn,se,Lt),wt===null?it=Qn:wt.sibling=Qn,wt=Qn);return u&&xt.forEach(function(Ta){return f(ue,Ta)}),ln&&bl(ue,Lt),it}function Or(ue,se,me,Ue){var it=M(me);if(typeof it!="function")throw Error(l(150));if(me=it.call(me),me==null)throw Error(l(151));for(var wt=it=null,xt=se,Lt=se=0,Qn=null,zt=me.next();xt!==null&&!zt.done;Lt++,zt=me.next()){xt.index>Lt?(Qn=xt,xt=null):Qn=xt.sibling;var Ta=We(ue,xt,zt.value,Ue);if(Ta===null){xt===null&&(xt=Qn);break}u&&xt&&Ta.alternate===null&&f(ue,xt),se=P(Ta,se,Lt),wt===null?it=Ta:wt.sibling=Ta,wt=Ta,xt=Qn}if(zt.done)return v(ue,xt),ln&&bl(ue,Lt),it;if(xt===null){for(;!zt.done;Lt++,zt=me.next())zt=vt(ue,zt.value,Ue),zt!==null&&(se=P(zt,se,Lt),wt===null?it=zt:wt.sibling=zt,wt=zt);return ln&&bl(ue,Lt),it}for(xt=w(ue,xt);!zt.done;Lt++,zt=me.next())zt=sn(xt,ue,Lt,zt.value,Ue),zt!==null&&(u&&zt.alternate!==null&&xt.delete(zt.key===null?Lt:zt.key),se=P(zt,se,Lt),wt===null?it=zt:wt.sibling=zt,wt=zt);return u&&xt.forEach(function(PR){return f(ue,PR)}),ln&&bl(ue,Lt),it}function Gs(ue,se,me,Ue){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 c:e:{for(var it=me.key,wt=se;wt!==null;){if(wt.key===it){if(it=me.type,it===m){if(wt.tag===7){v(ue,wt.sibling),se=k(wt,me.props.children),se.return=ue,ue=se;break e}}else if(wt.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===j&&U2(it)===wt.type){v(ue,wt.sibling),se=k(wt,me.props),se.ref=iu(ue,wt,me),se.return=ue,ue=se;break e}v(ue,wt);break}else f(ue,wt);wt=wt.sibling}me.type===m?(se=jl(me.props.children,ue.mode,Ue,me.key),se.return=ue,ue=se):(Ue=Kf(me.type,me.key,me.props,null,ue.mode,Ue),Ue.ref=iu(ue,se,me),Ue.return=ue,ue=Ue)}return L(ue);case p:e:{for(wt=me.key;se!==null;){if(se.key===wt)if(se.tag===4&&se.stateNode.containerInfo===me.containerInfo&&se.stateNode.implementation===me.implementation){v(ue,se.sibling),se=k(se,me.children||[]),se.return=ue,ue=se;break e}else{v(ue,se);break}else f(ue,se);se=se.sibling}se=ev(me,ue.mode,Ue),se.return=ue,ue=se}return L(ue);case j:return wt=me._init,Gs(ue,se,wt(me._payload),Ue)}if(Q(me))return Jt(ue,se,me,Ue);if(M(me))return Or(ue,se,me,Ue);Cf(ue,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,se!==null&&se.tag===6?(v(ue,se.sibling),se=k(se,me),se.return=ue,ue=se):(v(ue,se),se=J0(me,ue.mode,Ue),se.return=ue,ue=se),L(ue)):v(ue,se)}return Gs}var Si=G2(!0),K2=G2(!1),cu={},lo=Et(cu),uu=Et(cu),ki=Et(cu);function cs(u){if(u===cu)throw Error(l(174));return u}function p0(u,f){Mt(ki,f),Mt(uu,u),Mt(lo,cu),u=F(f),_t(lo),Mt(lo,u)}function _i(){_t(lo),_t(uu),_t(ki)}function q2(u){var f=cs(ki.current),v=cs(lo.current);f=U(v,u.type,f),v!==f&&(Mt(uu,u),Mt(lo,f))}function m0(u){uu.current===u&&(_t(lo),_t(uu))}var gn=Et(0);function wf(u){for(var f=u;f!==null;){if(f.tag===13){var v=f.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||Ls(v)||Sa(v)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var h0=[];function g0(){for(var u=0;u<h0.length;u++){var f=h0[u];ie?f._workInProgressVersionPrimary=null:f._workInProgressVersionSecondary=null}h0.length=0}var Sf=i.ReactCurrentDispatcher,v0=i.ReactCurrentBatchConfig,Cl=0,vn=null,Fn=null,qn=null,kf=!1,du=!1,fu=0,J7=0;function or(){throw Error(l(321))}function x0(u,f){if(f===null)return!1;for(var v=0;v<f.length&&v<u.length;v++)if(!Ro(u[v],f[v]))return!1;return!0}function b0(u,f,v,w,k,P){if(Cl=P,vn=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Sf.current=u===null||u.memoizedState===null?rR:oR,u=v(w,k),du){P=0;do{if(du=!1,fu=0,25<=P)throw Error(l(301));P+=1,qn=Fn=null,f.updateQueue=null,Sf.current=sR,u=v(w,k)}while(du)}if(Sf.current=If,f=Fn!==null&&Fn.next!==null,Cl=0,qn=Fn=vn=null,kf=!1,f)throw Error(l(300));return u}function y0(){var u=fu!==0;return fu=0,u}function us(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qn===null?vn.memoizedState=qn=u:qn=qn.next=u,qn}function io(){if(Fn===null){var u=vn.alternate;u=u!==null?u.memoizedState:null}else u=Fn.next;var f=qn===null?vn.memoizedState:qn.next;if(f!==null)qn=f,Fn=u;else{if(u===null)throw Error(l(310));Fn=u,u={memoizedState:Fn.memoizedState,baseState:Fn.baseState,baseQueue:Fn.baseQueue,queue:Fn.queue,next:null},qn===null?vn.memoizedState=qn=u:qn=qn.next=u}return qn}function pu(u,f){return typeof f=="function"?f(u):f}function C0(u){var f=io(),v=f.queue;if(v===null)throw Error(l(311));v.lastRenderedReducer=u;var w=Fn,k=w.baseQueue,P=v.pending;if(P!==null){if(k!==null){var L=k.next;k.next=P.next,P.next=L}w.baseQueue=k=P,v.pending=null}if(k!==null){P=k.next,w=w.baseState;var ne=L=null,pe=null,Ee=P;do{var Xe=Ee.lane;if((Cl&Xe)===Xe)pe!==null&&(pe=pe.next={lane:0,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null}),w=Ee.hasEagerState?Ee.eagerState:u(w,Ee.action);else{var vt={lane:Xe,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null};pe===null?(ne=pe=vt,L=w):pe=pe.next=vt,vn.lanes|=Xe,wl|=Xe}Ee=Ee.next}while(Ee!==null&&Ee!==P);pe===null?L=w:pe.next=ne,Ro(w,f.memoizedState)||(Pr=!0),f.memoizedState=w,f.baseState=L,f.baseQueue=pe,v.lastRenderedState=w}if(u=v.interleaved,u!==null){k=u;do P=k.lane,vn.lanes|=P,wl|=P,k=k.next;while(k!==u)}else k===null&&(v.lanes=0);return[f.memoizedState,v.dispatch]}function w0(u){var f=io(),v=f.queue;if(v===null)throw Error(l(311));v.lastRenderedReducer=u;var w=v.dispatch,k=v.pending,P=f.memoizedState;if(k!==null){v.pending=null;var L=k=k.next;do P=u(P,L.action),L=L.next;while(L!==k);Ro(P,f.memoizedState)||(Pr=!0),f.memoizedState=P,f.baseQueue===null&&(f.baseState=P),v.lastRenderedState=P}return[P,w]}function X2(){}function Q2(u,f){var v=vn,w=io(),k=f(),P=!Ro(w.memoizedState,k);if(P&&(w.memoizedState=k,Pr=!0),w=w.queue,S0(J2.bind(null,v,w,u),[u]),w.getSnapshot!==f||P||qn!==null&&qn.memoizedState.tag&1){if(v.flags|=2048,mu(9,Z2.bind(null,v,w,k,f),void 0,null),Xn===null)throw Error(l(349));Cl&30||Y2(v,f,k)}return k}function Y2(u,f,v){u.flags|=16384,u={getSnapshot:f,value:v},f=vn.updateQueue,f===null?(f={lastEffect:null,stores:null},vn.updateQueue=f,f.stores=[u]):(v=f.stores,v===null?f.stores=[u]:v.push(u))}function Z2(u,f,v,w){f.value=v,f.getSnapshot=w,eC(f)&&tC(u)}function J2(u,f,v){return v(function(){eC(f)&&tC(u)})}function eC(u){var f=u.getSnapshot;u=u.value;try{var v=f();return!Ro(u,v)}catch{return!0}}function tC(u){var f=is(u,1);f!==null&&co(f,u,1,-1)}function nC(u){var f=us();return typeof u=="function"&&(u=u()),f.memoizedState=f.baseState=u,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:pu,lastRenderedState:u},f.queue=u,u=u.dispatch=nR.bind(null,vn,u),[f.memoizedState,u]}function mu(u,f,v,w){return u={tag:u,create:f,destroy:v,deps:w,next:null},f=vn.updateQueue,f===null?(f={lastEffect:null,stores:null},vn.updateQueue=f,f.lastEffect=u.next=u):(v=f.lastEffect,v===null?f.lastEffect=u.next=u:(w=v.next,v.next=u,u.next=w,f.lastEffect=u)),u}function rC(){return io().memoizedState}function _f(u,f,v,w){var k=us();vn.flags|=u,k.memoizedState=mu(1|f,v,void 0,w===void 0?null:w)}function jf(u,f,v,w){var k=io();w=w===void 0?null:w;var P=void 0;if(Fn!==null){var L=Fn.memoizedState;if(P=L.destroy,w!==null&&x0(w,L.deps)){k.memoizedState=mu(f,v,P,w);return}}vn.flags|=u,k.memoizedState=mu(1|f,v,P,w)}function oC(u,f){return _f(8390656,8,u,f)}function S0(u,f){return jf(2048,8,u,f)}function sC(u,f){return jf(4,2,u,f)}function aC(u,f){return jf(4,4,u,f)}function lC(u,f){if(typeof f=="function")return u=u(),f(u),function(){f(null)};if(f!=null)return u=u(),f.current=u,function(){f.current=null}}function iC(u,f,v){return v=v!=null?v.concat([u]):null,jf(4,4,lC.bind(null,f,u),v)}function k0(){}function cC(u,f){var v=io();f=f===void 0?null:f;var w=v.memoizedState;return w!==null&&f!==null&&x0(f,w[1])?w[0]:(v.memoizedState=[u,f],u)}function uC(u,f){var v=io();f=f===void 0?null:f;var w=v.memoizedState;return w!==null&&f!==null&&x0(f,w[1])?w[0]:(u=u(),v.memoizedState=[u,f],u)}function dC(u,f,v){return Cl&21?(Ro(v,f)||(v=I2(),vn.lanes|=v,wl|=v,u.baseState=!0),f):(u.baseState&&(u.baseState=!1,Pr=!0),u.memoizedState=v)}function eR(u,f){var v=Nt;Nt=v!==0&&4>v?v:4,u(!0);var w=v0.transition;v0.transition={};try{u(!1),f()}finally{Nt=v,v0.transition=w}}function fC(){return io().memoizedState}function tR(u,f,v){var w=Ra(u);if(v={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null},pC(u))mC(f,v);else if(v=N2(u,f,v,w),v!==null){var k=lr();co(v,u,w,k),hC(v,f,w)}}function nR(u,f,v){var w=Ra(u),k={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null};if(pC(u))mC(f,k);else{var P=u.alternate;if(u.lanes===0&&(P===null||P.lanes===0)&&(P=f.lastRenderedReducer,P!==null))try{var L=f.lastRenderedState,ne=P(L,v);if(k.hasEagerState=!0,k.eagerState=ne,Ro(ne,L)){var pe=f.interleaved;pe===null?(k.next=k,c0(f)):(k.next=pe.next,pe.next=k),f.interleaved=k;return}}catch{}finally{}v=N2(u,f,k,w),v!==null&&(k=lr(),co(v,u,w,k),hC(v,f,w))}}function pC(u){var f=u.alternate;return u===vn||f!==null&&f===vn}function mC(u,f){du=kf=!0;var v=u.pending;v===null?f.next=f:(f.next=v.next,v.next=f),u.pending=f}function hC(u,f,v){if(v&4194240){var w=f.lanes;w&=u.pendingLanes,v|=w,f.lanes=v,Xg(u,v)}}var If={readContext:ao,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useInsertionEffect:or,useLayoutEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useMutableSource:or,useSyncExternalStore:or,useId:or,unstable_isNewReconciler:!1},rR={readContext:ao,useCallback:function(u,f){return us().memoizedState=[u,f===void 0?null:f],u},useContext:ao,useEffect:oC,useImperativeHandle:function(u,f,v){return v=v!=null?v.concat([u]):null,_f(4194308,4,lC.bind(null,f,u),v)},useLayoutEffect:function(u,f){return _f(4194308,4,u,f)},useInsertionEffect:function(u,f){return _f(4,2,u,f)},useMemo:function(u,f){var v=us();return f=f===void 0?null:f,u=u(),v.memoizedState=[u,f],u},useReducer:function(u,f,v){var w=us();return f=v!==void 0?v(f):f,w.memoizedState=w.baseState=f,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:f},w.queue=u,u=u.dispatch=tR.bind(null,vn,u),[w.memoizedState,u]},useRef:function(u){var f=us();return u={current:u},f.memoizedState=u},useState:nC,useDebugValue:k0,useDeferredValue:function(u){return us().memoizedState=u},useTransition:function(){var u=nC(!1),f=u[0];return u=eR.bind(null,u[1]),us().memoizedState=u,[f,u]},useMutableSource:function(){},useSyncExternalStore:function(u,f,v){var w=vn,k=us();if(ln){if(v===void 0)throw Error(l(407));v=v()}else{if(v=f(),Xn===null)throw Error(l(349));Cl&30||Y2(w,f,v)}k.memoizedState=v;var P={value:v,getSnapshot:f};return k.queue=P,oC(J2.bind(null,w,P,u),[u]),w.flags|=2048,mu(9,Z2.bind(null,w,P,v,f),void 0,null),v},useId:function(){var u=us(),f=Xn.identifierPrefix;if(ln){var v=Hs,w=Bs;v=(w&~(1<<32-Oo(w)-1)).toString(32)+v,f=":"+f+"R"+v,v=fu++,0<v&&(f+="H"+v.toString(32)),f+=":"}else v=J7++,f=":"+f+"r"+v.toString(32)+":";return u.memoizedState=f},unstable_isNewReconciler:!1},oR={readContext:ao,useCallback:cC,useContext:ao,useEffect:S0,useImperativeHandle:iC,useInsertionEffect:sC,useLayoutEffect:aC,useMemo:uC,useReducer:C0,useRef:rC,useState:function(){return C0(pu)},useDebugValue:k0,useDeferredValue:function(u){var f=io();return dC(f,Fn.memoizedState,u)},useTransition:function(){var u=C0(pu)[0],f=io().memoizedState;return[u,f]},useMutableSource:X2,useSyncExternalStore:Q2,useId:fC,unstable_isNewReconciler:!1},sR={readContext:ao,useCallback:cC,useContext:ao,useEffect:S0,useImperativeHandle:iC,useInsertionEffect:sC,useLayoutEffect:aC,useMemo:uC,useReducer:w0,useRef:rC,useState:function(){return w0(pu)},useDebugValue:k0,useDeferredValue:function(u){var f=io();return Fn===null?f.memoizedState=u:dC(f,Fn.memoizedState,u)},useTransition:function(){var u=w0(pu)[0],f=io().memoizedState;return[u,f]},useMutableSource:X2,useSyncExternalStore:Q2,useId:fC,unstable_isNewReconciler:!1};function ji(u,f){try{var v="",w=f;do v+=Z7(w),w=w.return;while(w);var k=v}catch(P){k=`
|
||
Error generating stack: `+P.message+`
|
||
`+P.stack}return{value:u,source:f,stack:k,digest:null}}function _0(u,f,v){return{value:u,source:null,stack:v??null,digest:f??null}}function j0(u,f){try{console.error(f.value)}catch(v){setTimeout(function(){throw v})}}var aR=typeof WeakMap=="function"?WeakMap:Map;function gC(u,f,v){v=Vs(-1,v),v.tag=3,v.payload={element:null};var w=f.value;return v.callback=function(){Bf||(Bf=!0,G0=w),j0(u,f)},v}function vC(u,f,v){v=Vs(-1,v),v.tag=3;var w=u.type.getDerivedStateFromError;if(typeof w=="function"){var k=f.value;v.payload=function(){return w(k)},v.callback=function(){j0(u,f)}}var P=u.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(v.callback=function(){j0(u,f),typeof w!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var L=f.stack;this.componentDidCatch(f.value,{componentStack:L!==null?L:""})}),v}function xC(u,f,v){var w=u.pingCache;if(w===null){w=u.pingCache=new aR;var k=new Set;w.set(f,k)}else k=w.get(f),k===void 0&&(k=new Set,w.set(f,k));k.has(v)||(k.add(v),u=yR.bind(null,u,f,v),f.then(u,u))}function bC(u){do{var f;if((f=u.tag===13)&&(f=u.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return u;u=u.return}while(u!==null);return null}function yC(u,f,v,w,k){return u.mode&1?(u.flags|=65536,u.lanes=k,u):(u===f?u.flags|=65536:(u.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(f=Vs(-1,1),f.tag=2,Ea(v,f,1))),v.lanes|=1),u)}var lR=i.ReactCurrentOwner,Pr=!1;function xr(u,f,v,w){f.child=u===null?K2(f,null,v,w):Si(f,u.child,v,w)}function CC(u,f,v,w,k){v=v.render;var P=f.ref;return wi(f,k),w=b0(u,f,v,w,P,k),v=y0(),u!==null&&!Pr?(f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~k,Ws(u,f,k)):(ln&&v&&e0(f),f.flags|=1,xr(u,f,w,k),f.child)}function wC(u,f,v,w,k){if(u===null){var P=v.type;return typeof P=="function"&&!Z0(P)&&P.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(f.tag=15,f.type=P,SC(u,f,P,w,k)):(u=Kf(v.type,null,w,f,f.mode,k),u.ref=f.ref,u.return=f,f.child=u)}if(P=u.child,!(u.lanes&k)){var L=P.memoizedProps;if(v=v.compare,v=v!==null?v:hf,v(L,w)&&u.ref===f.ref)return Ws(u,f,k)}return f.flags|=1,u=Aa(P,w),u.ref=f.ref,u.return=f,f.child=u}function SC(u,f,v,w,k){if(u!==null){var P=u.memoizedProps;if(hf(P,w)&&u.ref===f.ref)if(Pr=!1,f.pendingProps=w=P,(u.lanes&k)!==0)u.flags&131072&&(Pr=!0);else return f.lanes=u.lanes,Ws(u,f,k)}return I0(u,f,v,w,k)}function kC(u,f,v){var w=f.pendingProps,k=w.children,P=u!==null?u.memoizedState:null;if(w.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mt(Pi,Gr),Gr|=v;else{if(!(v&1073741824))return u=P!==null?P.baseLanes|v:v,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:u,cachePool:null,transitions:null},f.updateQueue=null,Mt(Pi,Gr),Gr|=u,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=P!==null?P.baseLanes:v,Mt(Pi,Gr),Gr|=w}else P!==null?(w=P.baseLanes|v,f.memoizedState=null):w=v,Mt(Pi,Gr),Gr|=w;return xr(u,f,k,v),f.child}function _C(u,f){var v=f.ref;(u===null&&v!==null||u!==null&&u.ref!==v)&&(f.flags|=512,f.flags|=2097152)}function I0(u,f,v,w,k){var P=Ir(v)?vr:rn.current;return P=vi(f,P),wi(f,k),v=b0(u,f,v,w,P,k),w=y0(),u!==null&&!Pr?(f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~k,Ws(u,f,k)):(ln&&w&&e0(f),f.flags|=1,xr(u,f,v,k),f.child)}function jC(u,f,v,w,k){if(Ir(v)){var P=!0;sf(f)}else P=!1;if(wi(f,k),f.stateNode===null)Ef(u,f),V2(f,v,w),f0(f,v,w,k),w=!0;else if(u===null){var L=f.stateNode,ne=f.memoizedProps;L.props=ne;var pe=L.context,Ee=v.contextType;typeof Ee=="object"&&Ee!==null?Ee=ao(Ee):(Ee=Ir(v)?vr:rn.current,Ee=vi(f,Ee));var Xe=v.getDerivedStateFromProps,vt=typeof Xe=="function"||typeof L.getSnapshotBeforeUpdate=="function";vt||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(ne!==w||pe!==Ee)&&W2(f,L,w,Ee),Pa=!1;var We=f.memoizedState;L.state=We,bf(f,w,L,k),pe=f.memoizedState,ne!==w||We!==pe||Dn.current||Pa?(typeof Xe=="function"&&(d0(f,v,Xe,w),pe=f.memoizedState),(ne=Pa||H2(f,v,ne,w,We,pe,Ee))?(vt||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(f.flags|=4194308)):(typeof L.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=w,f.memoizedState=pe),L.props=w,L.state=pe,L.context=Ee,w=ne):(typeof L.componentDidMount=="function"&&(f.flags|=4194308),w=!1)}else{L=f.stateNode,L2(u,f),ne=f.memoizedProps,Ee=f.type===f.elementType?ne:Ao(f.type,ne),L.props=Ee,vt=f.pendingProps,We=L.context,pe=v.contextType,typeof pe=="object"&&pe!==null?pe=ao(pe):(pe=Ir(v)?vr:rn.current,pe=vi(f,pe));var sn=v.getDerivedStateFromProps;(Xe=typeof sn=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(ne!==vt||We!==pe)&&W2(f,L,w,pe),Pa=!1,We=f.memoizedState,L.state=We,bf(f,w,L,k);var Jt=f.memoizedState;ne!==vt||We!==Jt||Dn.current||Pa?(typeof sn=="function"&&(d0(f,v,sn,w),Jt=f.memoizedState),(Ee=Pa||H2(f,v,Ee,w,We,Jt,pe)||!1)?(Xe||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(w,Jt,pe),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(w,Jt,pe)),typeof L.componentDidUpdate=="function"&&(f.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof L.componentDidUpdate!="function"||ne===u.memoizedProps&&We===u.memoizedState||(f.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||ne===u.memoizedProps&&We===u.memoizedState||(f.flags|=1024),f.memoizedProps=w,f.memoizedState=Jt),L.props=w,L.state=Jt,L.context=pe,w=Ee):(typeof L.componentDidUpdate!="function"||ne===u.memoizedProps&&We===u.memoizedState||(f.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||ne===u.memoizedProps&&We===u.memoizedState||(f.flags|=1024),w=!1)}return P0(u,f,v,w,P,k)}function P0(u,f,v,w,k,P){_C(u,f);var L=(f.flags&128)!==0;if(!w&&!L)return k&&j2(f,v,!1),Ws(u,f,P);w=f.stateNode,lR.current=f;var ne=L&&typeof v.getDerivedStateFromError!="function"?null:w.render();return f.flags|=1,u!==null&&L?(f.child=Si(f,u.child,null,P),f.child=Si(f,null,ne,P)):xr(u,f,ne,P),f.memoizedState=w.state,k&&j2(f,v,!0),f.child}function IC(u){var f=u.stateNode;f.pendingContext?k2(u,f.pendingContext,f.pendingContext!==f.context):f.context&&k2(u,f.context,!1),p0(u,f.containerInfo)}function PC(u,f,v,w,k){return yi(),o0(k),f.flags|=256,xr(u,f,v,w),f.child}var E0={dehydrated:null,treeContext:null,retryLane:0};function M0(u){return{baseLanes:u,cachePool:null,transitions:null}}function EC(u,f,v){var w=f.pendingProps,k=gn.current,P=!1,L=(f.flags&128)!==0,ne;if((ne=L)||(ne=u!==null&&u.memoizedState===null?!1:(k&2)!==0),ne?(P=!0,f.flags&=-129):(u===null||u.memoizedState!==null)&&(k|=1),Mt(gn,k&1),u===null)return r0(f),u=f.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?(f.mode&1?Sa(u)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(L=w.children,u=w.fallback,P?(w=f.mode,P=f.child,L={mode:"hidden",children:L},!(w&1)&&P!==null?(P.childLanes=0,P.pendingProps=L):P=qf(L,w,0,null),u=jl(u,w,v,null),P.return=f,u.return=f,P.sibling=u,f.child=P,f.child.memoizedState=M0(v),f.memoizedState=E0,u):O0(f,L));if(k=u.memoizedState,k!==null&&(ne=k.dehydrated,ne!==null))return iR(u,f,L,w,ne,k,v);if(P){P=w.fallback,L=f.mode,k=u.child,ne=k.sibling;var pe={mode:"hidden",children:w.children};return!(L&1)&&f.child!==k?(w=f.child,w.childLanes=0,w.pendingProps=pe,f.deletions=null):(w=Aa(k,pe),w.subtreeFlags=k.subtreeFlags&14680064),ne!==null?P=Aa(ne,P):(P=jl(P,L,v,null),P.flags|=2),P.return=f,w.return=f,w.sibling=P,f.child=w,w=P,P=f.child,L=u.child.memoizedState,L=L===null?M0(v):{baseLanes:L.baseLanes|v,cachePool:null,transitions:L.transitions},P.memoizedState=L,P.childLanes=u.childLanes&~v,f.memoizedState=E0,w}return P=u.child,u=P.sibling,w=Aa(P,{mode:"visible",children:w.children}),!(f.mode&1)&&(w.lanes=v),w.return=f,w.sibling=null,u!==null&&(v=f.deletions,v===null?(f.deletions=[u],f.flags|=16):v.push(u)),f.child=w,f.memoizedState=null,w}function O0(u,f){return f=qf({mode:"visible",children:f},u.mode,0,null),f.return=u,u.child=f}function Pf(u,f,v,w){return w!==null&&o0(w),Si(f,u.child,null,v),u=O0(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function iR(u,f,v,w,k,P,L){if(v)return f.flags&256?(f.flags&=-257,w=_0(Error(l(422))),Pf(u,f,L,w)):f.memoizedState!==null?(f.child=u.child,f.flags|=128,null):(P=w.fallback,k=f.mode,w=qf({mode:"visible",children:w.children},k,0,null),P=jl(P,k,L,null),P.flags|=2,w.return=f,P.return=f,w.sibling=P,f.child=w,f.mode&1&&Si(f,u.child,null,L),f.child.memoizedState=M0(L),f.memoizedState=E0,P);if(!(f.mode&1))return Pf(u,f,L,null);if(Sa(k))return w=ka(k).digest,P=Error(l(419)),w=_0(P,w,void 0),Pf(u,f,L,w);if(v=(L&u.childLanes)!==0,Pr||v){if(w=Xn,w!==null){switch(L&-L){case 4:k=2;break;case 16:k=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:k=32;break;case 536870912:k=268435456;break;default:k=0}k=k&(w.suspendedLanes|L)?0:k,k!==0&&k!==P.retryLane&&(P.retryLane=k,is(u,k),co(w,u,k,-1))}return Y0(),w=_0(Error(l(421))),Pf(u,f,L,w)}return Ls(k)?(f.flags|=128,f.child=u.child,f=CR.bind(null,u),mi(k,f),null):(u=P.treeContext,we&&(so=Gt(k),Ur=f,ln=!0,Do=null,lu=!1,u!==null&&(ro[oo++]=Bs,ro[oo++]=Hs,ro[oo++]=xl,Bs=u.id,Hs=u.overflow,xl=f)),f=O0(f,w.children),f.flags|=4096,f)}function MC(u,f,v){u.lanes|=f;var w=u.alternate;w!==null&&(w.lanes|=f),i0(u.return,f,v)}function R0(u,f,v,w,k){var P=u.memoizedState;P===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:w,tail:v,tailMode:k}:(P.isBackwards=f,P.rendering=null,P.renderingStartTime=0,P.last=w,P.tail=v,P.tailMode=k)}function OC(u,f,v){var w=f.pendingProps,k=w.revealOrder,P=w.tail;if(xr(u,f,w.children,v),w=gn.current,w&2)w=w&1|2,f.flags|=128;else{if(u!==null&&u.flags&128)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&MC(u,v,f);else if(u.tag===19)MC(u,v,f);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===f)break e;for(;u.sibling===null;){if(u.return===null||u.return===f)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}w&=1}if(Mt(gn,w),!(f.mode&1))f.memoizedState=null;else switch(k){case"forwards":for(v=f.child,k=null;v!==null;)u=v.alternate,u!==null&&wf(u)===null&&(k=v),v=v.sibling;v=k,v===null?(k=f.child,f.child=null):(k=v.sibling,v.sibling=null),R0(f,!1,k,v,P);break;case"backwards":for(v=null,k=f.child,f.child=null;k!==null;){if(u=k.alternate,u!==null&&wf(u)===null){f.child=k;break}u=k.sibling,k.sibling=v,v=k,k=u}R0(f,!0,v,null,P);break;case"together":R0(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Ef(u,f){!(f.mode&1)&&u!==null&&(u.alternate=null,f.alternate=null,f.flags|=2)}function Ws(u,f,v){if(u!==null&&(f.dependencies=u.dependencies),wl|=f.lanes,!(v&f.childLanes))return null;if(u!==null&&f.child!==u.child)throw Error(l(153));if(f.child!==null){for(u=f.child,v=Aa(u,u.pendingProps),f.child=v,v.return=f;u.sibling!==null;)u=u.sibling,v=v.sibling=Aa(u,u.pendingProps),v.return=f;v.sibling=null}return f.child}function cR(u,f,v){switch(f.tag){case 3:IC(f),yi();break;case 5:q2(f);break;case 1:Ir(f.type)&&sf(f);break;case 4:p0(f,f.stateNode.containerInfo);break;case 10:$2(f,f.type._context,f.memoizedProps.value);break;case 13:var w=f.memoizedState;if(w!==null)return w.dehydrated!==null?(Mt(gn,gn.current&1),f.flags|=128,null):v&f.child.childLanes?EC(u,f,v):(Mt(gn,gn.current&1),u=Ws(u,f,v),u!==null?u.sibling:null);Mt(gn,gn.current&1);break;case 19:if(w=(v&f.childLanes)!==0,u.flags&128){if(w)return OC(u,f,v);f.flags|=128}var k=f.memoizedState;if(k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),Mt(gn,gn.current),w)break;return null;case 22:case 23:return f.lanes=0,kC(u,f,v)}return Ws(u,f,v)}function ds(u){u.flags|=4}function RC(u,f){if(u!==null&&u.child===f.child)return!0;if(f.flags&16)return!1;for(u=f.child;u!==null;){if(u.flags&12854||u.subtreeFlags&12854)return!1;u=u.sibling}return!0}var hu,gu,Mf,Of;if(de)hu=function(u,f){for(var v=f.child;v!==null;){if(v.tag===5||v.tag===6)re(u,v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===f)break;for(;v.sibling===null;){if(v.return===null||v.return===f)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},gu=function(){},Mf=function(u,f,v,w,k){if(u=u.memoizedProps,u!==w){var P=f.stateNode,L=cs(lo.current);v=oe(P,v,u,w,k,L),(f.updateQueue=v)&&ds(f)}},Of=function(u,f,v,w){v!==w&&ds(f)};else if(xe){hu=function(u,f,v,w){for(var k=f.child;k!==null;){if(k.tag===5){var P=k.stateNode;v&&w&&(P=jr(P,k.type,k.memoizedProps,k)),re(u,P)}else if(k.tag===6)P=k.stateNode,v&&w&&(P=Mo(P,k.memoizedProps,k)),re(u,P);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)P=k.child,P!==null&&(P.return=k),hu(u,k,!0,!0);else if(k.child!==null){k.child.return=k,k=k.child;continue}}if(k===f)break;for(;k.sibling===null;){if(k.return===null||k.return===f)return;k=k.return}k.sibling.return=k.return,k=k.sibling}};var DC=function(u,f,v,w){for(var k=f.child;k!==null;){if(k.tag===5){var P=k.stateNode;v&&w&&(P=jr(P,k.type,k.memoizedProps,k)),Sn(u,P)}else if(k.tag===6)P=k.stateNode,v&&w&&(P=Mo(P,k.memoizedProps,k)),Sn(u,P);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)P=k.child,P!==null&&(P.return=k),DC(u,k,!0,!0);else if(k.child!==null){k.child.return=k,k=k.child;continue}}if(k===f)break;for(;k.sibling===null;){if(k.return===null||k.return===f)return;k=k.return}k.sibling.return=k.return,k=k.sibling}};gu=function(u,f){var v=f.stateNode;if(!RC(u,f)){u=v.containerInfo;var w=Nn(u);DC(w,f,!1,!1),v.pendingChildren=w,ds(f),hn(u,w)}},Mf=function(u,f,v,w,k){var P=u.stateNode,L=u.memoizedProps;if((u=RC(u,f))&&L===w)f.stateNode=P;else{var ne=f.stateNode,pe=cs(lo.current),Ee=null;L!==w&&(Ee=oe(ne,v,L,w,k,pe)),u&&Ee===null?f.stateNode=P:(P=mr(P,Ee,v,L,w,f,u,ne),le(P,v,w,k,pe)&&ds(f),f.stateNode=P,u?ds(f):hu(P,f,!1,!1))}},Of=function(u,f,v,w){v!==w?(u=cs(ki.current),v=cs(lo.current),f.stateNode=K(w,u,v,f),ds(f)):f.stateNode=u.stateNode}}else gu=function(){},Mf=function(){},Of=function(){};function vu(u,f){if(!ln)switch(u.tailMode){case"hidden":f=u.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?u.tail=null:v.sibling=null;break;case"collapsed":v=u.tail;for(var w=null;v!==null;)v.alternate!==null&&(w=v),v=v.sibling;w===null?f||u.tail===null?u.tail=null:u.tail.sibling=null:w.sibling=null}}function sr(u){var f=u.alternate!==null&&u.alternate.child===u.child,v=0,w=0;if(f)for(var k=u.child;k!==null;)v|=k.lanes|k.childLanes,w|=k.subtreeFlags&14680064,w|=k.flags&14680064,k.return=u,k=k.sibling;else for(k=u.child;k!==null;)v|=k.lanes|k.childLanes,w|=k.subtreeFlags,w|=k.flags,k.return=u,k=k.sibling;return u.subtreeFlags|=w,u.childLanes=v,f}function uR(u,f,v){var w=f.pendingProps;switch(t0(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sr(f),null;case 1:return Ir(f.type)&&of(),sr(f),null;case 3:return v=f.stateNode,_i(),_t(Dn),_t(rn),g0(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(u===null||u.child===null)&&(mf(f)?ds(f):u===null||u.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,Do!==null&&(X0(Do),Do=null))),gu(u,f),sr(f),null;case 5:m0(f),v=cs(ki.current);var k=f.type;if(u!==null&&f.stateNode!=null)Mf(u,f,k,w,v),u.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!w){if(f.stateNode===null)throw Error(l(166));return sr(f),null}if(u=cs(lo.current),mf(f)){if(!we)throw Error(l(175));u=Ln(f.stateNode,f.type,f.memoizedProps,v,u,f,!lu),f.updateQueue=u,u!==null&&ds(f)}else{var P=Y(k,w,v,u,f);hu(P,f,!1,!1),f.stateNode=P,le(P,k,w,v,u)&&ds(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return sr(f),null;case 6:if(u&&f.stateNode!=null)Of(u,f,u.memoizedProps,w);else{if(typeof w!="string"&&f.stateNode===null)throw Error(l(166));if(u=cs(ki.current),v=cs(lo.current),mf(f)){if(!we)throw Error(l(176));if(u=f.stateNode,v=f.memoizedProps,(w=kt(u,v,f,!lu))&&(k=Ur,k!==null))switch(k.tag){case 3:rf(k.stateNode.containerInfo,u,v,(k.mode&1)!==0);break;case 5:gi(k.type,k.memoizedProps,k.stateNode,u,v,(k.mode&1)!==0)}w&&ds(f)}else f.stateNode=K(w,u,v,f)}return sr(f),null;case 13:if(_t(gn),w=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(ln&&so!==null&&f.mode&1&&!(f.flags&128))T2(),yi(),f.flags|=98560,k=!1;else if(k=mf(f),w!==null&&w.dehydrated!==null){if(u===null){if(!k)throw Error(l(318));if(!we)throw Error(l(344));if(k=f.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(l(317));ja(k,f)}else yi(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;sr(f),k=!1}else Do!==null&&(X0(Do),Do=null),k=!0;if(!k)return f.flags&65536?f:null}return f.flags&128?(f.lanes=v,f):(v=w!==null,v!==(u!==null&&u.memoizedState!==null)&&v&&(f.child.flags|=8192,f.mode&1&&(u===null||gn.current&1?Bn===0&&(Bn=3):Y0())),f.updateQueue!==null&&(f.flags|=4),sr(f),null);case 4:return _i(),gu(u,f),u===null&&fe(f.stateNode.containerInfo),sr(f),null;case 10:return l0(f.type._context),sr(f),null;case 17:return Ir(f.type)&&of(),sr(f),null;case 19:if(_t(gn),k=f.memoizedState,k===null)return sr(f),null;if(w=(f.flags&128)!==0,P=k.rendering,P===null)if(w)vu(k,!1);else{if(Bn!==0||u!==null&&u.flags&128)for(u=f.child;u!==null;){if(P=wf(u),P!==null){for(f.flags|=128,vu(k,!1),u=P.updateQueue,u!==null&&(f.updateQueue=u,f.flags|=4),f.subtreeFlags=0,u=v,v=f.child;v!==null;)w=v,k=u,w.flags&=14680066,P=w.alternate,P===null?(w.childLanes=0,w.lanes=k,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=P.childLanes,w.lanes=P.lanes,w.child=P.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=P.memoizedProps,w.memoizedState=P.memoizedState,w.updateQueue=P.updateQueue,w.type=P.type,k=P.dependencies,w.dependencies=k===null?null:{lanes:k.lanes,firstContext:k.firstContext}),v=v.sibling;return Mt(gn,gn.current&1|2),f.child}u=u.sibling}k.tail!==null&&Kn()>U0&&(f.flags|=128,w=!0,vu(k,!1),f.lanes=4194304)}else{if(!w)if(u=wf(P),u!==null){if(f.flags|=128,w=!0,u=u.updateQueue,u!==null&&(f.updateQueue=u,f.flags|=4),vu(k,!0),k.tail===null&&k.tailMode==="hidden"&&!P.alternate&&!ln)return sr(f),null}else 2*Kn()-k.renderingStartTime>U0&&v!==1073741824&&(f.flags|=128,w=!0,vu(k,!1),f.lanes=4194304);k.isBackwards?(P.sibling=f.child,f.child=P):(u=k.last,u!==null?u.sibling=P:f.child=P,k.last=P)}return k.tail!==null?(f=k.tail,k.rendering=f,k.tail=f.sibling,k.renderingStartTime=Kn(),f.sibling=null,u=gn.current,Mt(gn,w?u&1|2:u&1),f):(sr(f),null);case 22:case 23:return Q0(),v=f.memoizedState!==null,u!==null&&u.memoizedState!==null!==v&&(f.flags|=8192),v&&f.mode&1?Gr&1073741824&&(sr(f),de&&f.subtreeFlags&6&&(f.flags|=8192)):sr(f),null;case 24:return null;case 25:return null}throw Error(l(156,f.tag))}function dR(u,f){switch(t0(f),f.tag){case 1:return Ir(f.type)&&of(),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return _i(),_t(Dn),_t(rn),g0(),u=f.flags,u&65536&&!(u&128)?(f.flags=u&-65537|128,f):null;case 5:return m0(f),null;case 13:if(_t(gn),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(l(340));yi()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return _t(gn),null;case 4:return _i(),null;case 10:return l0(f.type._context),null;case 22:case 23:return Q0(),null;case 24:return null;default:return null}}var Rf=!1,ar=!1,fR=typeof WeakSet=="function"?WeakSet:Set,qe=null;function Ii(u,f){var v=u.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(w){cn(u,f,w)}else v.current=null}function D0(u,f,v){try{v()}catch(w){cn(u,f,w)}}var AC=!1;function pR(u,f){for(T(u.containerInfo),qe=f;qe!==null;)if(u=qe,f=u.child,(u.subtreeFlags&1028)!==0&&f!==null)f.return=u,qe=f;else for(;qe!==null;){u=qe;try{var v=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,k=v.memoizedState,P=u.stateNode,L=P.getSnapshotBeforeUpdate(u.elementType===u.type?w:Ao(u.type,w),k);P.__reactInternalSnapshotBeforeUpdate=L}break;case 3:de&&Tt(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(ne){cn(u,u.return,ne)}if(f=u.sibling,f!==null){f.return=u.return,qe=f;break}qe=u.return}return v=AC,AC=!1,v}function xu(u,f,v){var w=f.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var k=w=w.next;do{if((k.tag&u)===u){var P=k.destroy;k.destroy=void 0,P!==void 0&&D0(f,v,P)}k=k.next}while(k!==w)}}function Df(u,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var v=f=f.next;do{if((v.tag&u)===u){var w=v.create;v.destroy=w()}v=v.next}while(v!==f)}}function A0(u){var f=u.ref;if(f!==null){var v=u.stateNode;switch(u.tag){case 5:u=G(v);break;default:u=v}typeof f=="function"?f(u):f.current=u}}function TC(u){var f=u.alternate;f!==null&&(u.alternate=null,TC(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&je(f)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function $C(u){return u.tag===5||u.tag===3||u.tag===4}function NC(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||$C(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function T0(u,f,v){var w=u.tag;if(w===5||w===6)u=u.stateNode,f?Ut(v,u,f):tt(v,u);else if(w!==4&&(u=u.child,u!==null))for(T0(u,f,v),u=u.sibling;u!==null;)T0(u,f,v),u=u.sibling}function $0(u,f,v){var w=u.tag;if(w===5||w===6)u=u.stateNode,f?Ne(v,u,f):ye(v,u);else if(w!==4&&(u=u.child,u!==null))for($0(u,f,v),u=u.sibling;u!==null;)$0(u,f,v),u=u.sibling}var tr=null,To=!1;function fs(u,f,v){for(v=v.child;v!==null;)N0(u,f,v),v=v.sibling}function N0(u,f,v){if(as&&typeof as.onCommitFiberUnmount=="function")try{as.onCommitFiberUnmount(uf,v)}catch{}switch(v.tag){case 5:ar||Ii(v,f);case 6:if(de){var w=tr,k=To;tr=null,fs(u,f,v),tr=w,To=k,tr!==null&&(To?ze(tr,v.stateNode):ke(tr,v.stateNode))}else fs(u,f,v);break;case 18:de&&tr!==null&&(To?zn(tr,v.stateNode):Ug(tr,v.stateNode));break;case 4:de?(w=tr,k=To,tr=v.stateNode.containerInfo,To=!0,fs(u,f,v),tr=w,To=k):(xe&&(w=v.stateNode.containerInfo,k=Nn(w),an(w,k)),fs(u,f,v));break;case 0:case 11:case 14:case 15:if(!ar&&(w=v.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){k=w=w.next;do{var P=k,L=P.destroy;P=P.tag,L!==void 0&&(P&2||P&4)&&D0(v,f,L),k=k.next}while(k!==w)}fs(u,f,v);break;case 1:if(!ar&&(Ii(v,f),w=v.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=v.memoizedProps,w.state=v.memoizedState,w.componentWillUnmount()}catch(ne){cn(v,f,ne)}fs(u,f,v);break;case 21:fs(u,f,v);break;case 22:v.mode&1?(ar=(w=ar)||v.memoizedState!==null,fs(u,f,v),ar=w):fs(u,f,v);break;default:fs(u,f,v)}}function LC(u){var f=u.updateQueue;if(f!==null){u.updateQueue=null;var v=u.stateNode;v===null&&(v=u.stateNode=new fR),f.forEach(function(w){var k=wR.bind(null,u,w);v.has(w)||(v.add(w),w.then(k,k))})}}function $o(u,f){var v=f.deletions;if(v!==null)for(var w=0;w<v.length;w++){var k=v[w];try{var P=u,L=f;if(de){var ne=L;e:for(;ne!==null;){switch(ne.tag){case 5:tr=ne.stateNode,To=!1;break e;case 3:tr=ne.stateNode.containerInfo,To=!0;break e;case 4:tr=ne.stateNode.containerInfo,To=!0;break e}ne=ne.return}if(tr===null)throw Error(l(160));N0(P,L,k),tr=null,To=!1}else N0(P,L,k);var pe=k.alternate;pe!==null&&(pe.return=null),k.return=null}catch(Ee){cn(k,f,Ee)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)zC(f,u),f=f.sibling}function zC(u,f){var v=u.alternate,w=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:if($o(f,u),ps(u),w&4){try{xu(3,u,u.return),Df(3,u)}catch(We){cn(u,u.return,We)}try{xu(5,u,u.return)}catch(We){cn(u,u.return,We)}}break;case 1:$o(f,u),ps(u),w&512&&v!==null&&Ii(v,v.return);break;case 5:if($o(f,u),ps(u),w&512&&v!==null&&Ii(v,v.return),de){if(u.flags&32){var k=u.stateNode;try{Le(k)}catch(We){cn(u,u.return,We)}}if(w&4&&(k=u.stateNode,k!=null)){var P=u.memoizedProps;if(v=v!==null?v.memoizedProps:P,w=u.type,f=u.updateQueue,u.updateQueue=null,f!==null)try{Me(k,f,w,v,P,u)}catch(We){cn(u,u.return,We)}}}break;case 6:if($o(f,u),ps(u),w&4&&de){if(u.stateNode===null)throw Error(l(162));k=u.stateNode,P=u.memoizedProps,v=v!==null?v.memoizedProps:P;try{ct(k,v,P)}catch(We){cn(u,u.return,We)}}break;case 3:if($o(f,u),ps(u),w&4){if(de&&we&&v!==null&&v.memoizedState.isDehydrated)try{nf(f.containerInfo)}catch(We){cn(u,u.return,We)}if(xe){k=f.containerInfo,P=f.pendingChildren;try{an(k,P)}catch(We){cn(u,u.return,We)}}}break;case 4:if($o(f,u),ps(u),w&4&&xe){P=u.stateNode,k=P.containerInfo,P=P.pendingChildren;try{an(k,P)}catch(We){cn(u,u.return,We)}}break;case 13:$o(f,u),ps(u),k=u.child,k.flags&8192&&(P=k.memoizedState!==null,k.stateNode.isHidden=P,!P||k.alternate!==null&&k.alternate.memoizedState!==null||(W0=Kn())),w&4&&LC(u);break;case 22:var L=v!==null&&v.memoizedState!==null;if(u.mode&1?(ar=(v=ar)||L,$o(f,u),ar=v):$o(f,u),ps(u),w&8192){if(v=u.memoizedState!==null,(u.stateNode.isHidden=v)&&!L&&u.mode&1)for(qe=u,w=u.child;w!==null;){for(f=qe=w;qe!==null;){L=qe;var ne=L.child;switch(L.tag){case 0:case 11:case 14:case 15:xu(4,L,L.return);break;case 1:Ii(L,L.return);var pe=L.stateNode;if(typeof pe.componentWillUnmount=="function"){var Ee=L,Xe=L.return;try{var vt=Ee;pe.props=vt.memoizedProps,pe.state=vt.memoizedState,pe.componentWillUnmount()}catch(We){cn(Ee,Xe,We)}}break;case 5:Ii(L,L.return);break;case 22:if(L.memoizedState!==null){HC(f);continue}}ne!==null?(ne.return=L,qe=ne):HC(f)}w=w.sibling}if(de){e:if(w=null,de)for(f=u;;){if(f.tag===5){if(w===null){w=f;try{k=f.stateNode,v?Ge(k):Pn(f.stateNode,f.memoizedProps)}catch(We){cn(u,u.return,We)}}}else if(f.tag===6){if(w===null)try{P=f.stateNode,v?pt(P):At(P,f.memoizedProps)}catch(We){cn(u,u.return,We)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===u)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break e;for(;f.sibling===null;){if(f.return===null||f.return===u)break e;w===f&&(w=null),f=f.return}w===f&&(w=null),f.sibling.return=f.return,f=f.sibling}}}break;case 19:$o(f,u),ps(u),w&4&&LC(u);break;case 21:break;default:$o(f,u),ps(u)}}function ps(u){var f=u.flags;if(f&2){try{if(de){e:{for(var v=u.return;v!==null;){if($C(v)){var w=v;break e}v=v.return}throw Error(l(160))}switch(w.tag){case 5:var k=w.stateNode;w.flags&32&&(Le(k),w.flags&=-33);var P=NC(u);$0(u,P,k);break;case 3:case 4:var L=w.stateNode.containerInfo,ne=NC(u);T0(u,ne,L);break;default:throw Error(l(161))}}}catch(pe){cn(u,u.return,pe)}u.flags&=-3}f&4096&&(u.flags&=-4097)}function mR(u,f,v){qe=u,FC(u)}function FC(u,f,v){for(var w=(u.mode&1)!==0;qe!==null;){var k=qe,P=k.child;if(k.tag===22&&w){var L=k.memoizedState!==null||Rf;if(!L){var ne=k.alternate,pe=ne!==null&&ne.memoizedState!==null||ar;ne=Rf;var Ee=ar;if(Rf=L,(ar=pe)&&!Ee)for(qe=k;qe!==null;)L=qe,pe=L.child,L.tag===22&&L.memoizedState!==null?VC(k):pe!==null?(pe.return=L,qe=pe):VC(k);for(;P!==null;)qe=P,FC(P),P=P.sibling;qe=k,Rf=ne,ar=Ee}BC(u)}else k.subtreeFlags&8772&&P!==null?(P.return=k,qe=P):BC(u)}}function BC(u){for(;qe!==null;){var f=qe;if(f.flags&8772){var v=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:ar||Df(5,f);break;case 1:var w=f.stateNode;if(f.flags&4&&!ar)if(v===null)w.componentDidMount();else{var k=f.elementType===f.type?v.memoizedProps:Ao(f.type,v.memoizedProps);w.componentDidUpdate(k,v.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var P=f.updateQueue;P!==null&&F2(f,P,w);break;case 3:var L=f.updateQueue;if(L!==null){if(v=null,f.child!==null)switch(f.child.tag){case 5:v=G(f.child.stateNode);break;case 1:v=f.child.stateNode}F2(f,L,v)}break;case 5:var ne=f.stateNode;v===null&&f.flags&4&&ft(ne,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(we&&f.memoizedState===null){var pe=f.alternate;if(pe!==null){var Ee=pe.memoizedState;if(Ee!==null){var Xe=Ee.dehydrated;Xe!==null&&Wg(Xe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}ar||f.flags&512&&A0(f)}catch(vt){cn(f,f.return,vt)}}if(f===u){qe=null;break}if(v=f.sibling,v!==null){v.return=f.return,qe=v;break}qe=f.return}}function HC(u){for(;qe!==null;){var f=qe;if(f===u){qe=null;break}var v=f.sibling;if(v!==null){v.return=f.return,qe=v;break}qe=f.return}}function VC(u){for(;qe!==null;){var f=qe;try{switch(f.tag){case 0:case 11:case 15:var v=f.return;try{Df(4,f)}catch(pe){cn(f,v,pe)}break;case 1:var w=f.stateNode;if(typeof w.componentDidMount=="function"){var k=f.return;try{w.componentDidMount()}catch(pe){cn(f,k,pe)}}var P=f.return;try{A0(f)}catch(pe){cn(f,P,pe)}break;case 5:var L=f.return;try{A0(f)}catch(pe){cn(f,L,pe)}}}catch(pe){cn(f,f.return,pe)}if(f===u){qe=null;break}var ne=f.sibling;if(ne!==null){ne.return=f.return,qe=ne;break}qe=f.return}}var Af=0,Tf=1,$f=2,Nf=3,Lf=4;if(typeof Symbol=="function"&&Symbol.for){var bu=Symbol.for;Af=bu("selector.component"),Tf=bu("selector.has_pseudo_class"),$f=bu("selector.role"),Nf=bu("selector.test_id"),Lf=bu("selector.text")}function L0(u){var f=ve(u);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(l(364));return f}if(u=Ct(u),u===null)throw Error(l(362));return u.stateNode.current}function z0(u,f){switch(f.$$typeof){case Af:if(u.type===f.value)return!0;break;case Tf:e:{f=f.value,u=[u,0];for(var v=0;v<u.length;){var w=u[v++],k=u[v++],P=f[k];if(w.tag!==5||!ge(w)){for(;P!=null&&z0(w,P);)k++,P=f[k];if(k===f.length){f=!0;break e}else for(w=w.child;w!==null;)u.push(w,k),w=w.sibling}}f=!1}return f;case $f:if(u.tag===5&&De(u.stateNode,f.value))return!0;break;case Lf:if((u.tag===5||u.tag===6)&&(u=Ke(u),u!==null&&0<=u.indexOf(f.value)))return!0;break;case Nf:if(u.tag===5&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(l(365))}return!1}function F0(u){switch(u.$$typeof){case Af:return"<"+(R(u.value)||"Unknown")+">";case Tf:return":has("+(F0(u)||"")+")";case $f:return'[role="'+u.value+'"]';case Lf:return'"'+u.value+'"';case Nf:return'[data-testname="'+u.value+'"]';default:throw Error(l(365))}}function WC(u,f){var v=[];u=[u,0];for(var w=0;w<u.length;){var k=u[w++],P=u[w++],L=f[P];if(k.tag!==5||!ge(k)){for(;L!=null&&z0(k,L);)P++,L=f[P];if(P===f.length)v.push(k);else for(k=k.child;k!==null;)u.push(k,P),k=k.sibling}}return v}function B0(u,f){if(!Ve)throw Error(l(363));u=L0(u),u=WC(u,f),f=[],u=Array.from(u);for(var v=0;v<u.length;){var w=u[v++];if(w.tag===5)ge(w)||f.push(w.stateNode);else for(w=w.child;w!==null;)u.push(w),w=w.sibling}return f}var hR=Math.ceil,zf=i.ReactCurrentDispatcher,H0=i.ReactCurrentOwner,En=i.ReactCurrentBatchConfig,jt=0,Xn=null,An=null,nr=0,Gr=0,Pi=Et(0),Bn=0,yu=null,wl=0,Ff=0,V0=0,Cu=null,Er=null,W0=0,U0=1/0,Us=null;function Ei(){U0=Kn()+500}var Bf=!1,G0=null,Ma=null,Hf=!1,Oa=null,Vf=0,wu=0,K0=null,Wf=-1,Uf=0;function lr(){return jt&6?Kn():Wf!==-1?Wf:Wf=Kn()}function Ra(u){return u.mode&1?jt&2&&nr!==0?nr&-nr:Y7.transition!==null?(Uf===0&&(Uf=I2()),Uf):(u=Nt,u!==0?u:Oe()):1}function co(u,f,v,w){if(50<wu)throw wu=0,K0=null,Error(l(185));au(u,v,w),(!(jt&2)||u!==Xn)&&(u===Xn&&(!(jt&2)&&(Ff|=v),Bn===4&&Da(u,nr)),Mr(u,w),v===1&&jt===0&&!(f.mode&1)&&(Ei(),df&&ls()))}function Mr(u,f){var v=u.callbackNode;H7(u,f);var w=cf(u,u===Xn?nr:0);if(w===0)v!==null&&E2(v),u.callbackNode=null,u.callbackPriority=0;else if(f=w&-w,u.callbackPriority!==f){if(v!=null&&E2(v),f===1)u.tag===0?Q7(GC.bind(null,u)):M2(GC.bind(null,u)),$e?st(function(){!(jt&6)&&ls()}):Qg(Yg,ls),v=null;else{switch(P2(w)){case 1:v=Yg;break;case 4:v=G7;break;case 16:v=Zg;break;case 536870912:v=K7;break;default:v=Zg}v=tw(v,UC.bind(null,u))}u.callbackPriority=f,u.callbackNode=v}}function UC(u,f){if(Wf=-1,Uf=0,jt&6)throw Error(l(327));var v=u.callbackNode;if(_l()&&u.callbackNode!==v)return null;var w=cf(u,u===Xn?nr:0);if(w===0)return null;if(w&30||w&u.expiredLanes||f)f=Gf(u,w);else{f=w;var k=jt;jt|=2;var P=XC();(Xn!==u||nr!==f)&&(Us=null,Ei(),Sl(u,f));do try{xR();break}catch(ne){qC(u,ne)}while(1);a0(),zf.current=P,jt=k,An!==null?f=0:(Xn=null,nr=0,f=Bn)}if(f!==0){if(f===2&&(k=Kg(u),k!==0&&(w=k,f=q0(u,k))),f===1)throw v=yu,Sl(u,0),Da(u,w),Mr(u,Kn()),v;if(f===6)Da(u,w);else{if(k=u.current.alternate,!(w&30)&&!gR(k)&&(f=Gf(u,w),f===2&&(P=Kg(u),P!==0&&(w=P,f=q0(u,P))),f===1))throw v=yu,Sl(u,0),Da(u,w),Mr(u,Kn()),v;switch(u.finishedWork=k,u.finishedLanes=w,f){case 0:case 1:throw Error(l(345));case 2:kl(u,Er,Us);break;case 3:if(Da(u,w),(w&130023424)===w&&(f=W0+500-Kn(),10<f)){if(cf(u,0)!==0)break;if(k=u.suspendedLanes,(k&w)!==w){lr(),u.pingedLanes|=u.suspendedLanes&k;break}u.timeoutHandle=ee(kl.bind(null,u,Er,Us),f);break}kl(u,Er,Us);break;case 4:if(Da(u,w),(w&4194240)===w)break;for(f=u.eventTimes,k=-1;0<w;){var L=31-Oo(w);P=1<<L,L=f[L],L>k&&(k=L),w&=~P}if(w=k,w=Kn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*hR(w/1960))-w,10<w){u.timeoutHandle=ee(kl.bind(null,u,Er,Us),w);break}kl(u,Er,Us);break;case 5:kl(u,Er,Us);break;default:throw Error(l(329))}}}return Mr(u,Kn()),u.callbackNode===v?UC.bind(null,u):null}function q0(u,f){var v=Cu;return u.current.memoizedState.isDehydrated&&(Sl(u,f).flags|=256),u=Gf(u,f),u!==2&&(f=Er,Er=v,f!==null&&X0(f)),u}function X0(u){Er===null?Er=u:Er.push.apply(Er,u)}function gR(u){for(var f=u;;){if(f.flags&16384){var v=f.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var w=0;w<v.length;w++){var k=v[w],P=k.getSnapshot;k=k.value;try{if(!Ro(P(),k))return!1}catch{return!1}}}if(v=f.child,f.subtreeFlags&16384&&v!==null)v.return=f,f=v;else{if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Da(u,f){for(f&=~V0,f&=~Ff,u.suspendedLanes|=f,u.pingedLanes&=~f,u=u.expirationTimes;0<f;){var v=31-Oo(f),w=1<<v;u[v]=-1,f&=~w}}function GC(u){if(jt&6)throw Error(l(327));_l();var f=cf(u,0);if(!(f&1))return Mr(u,Kn()),null;var v=Gf(u,f);if(u.tag!==0&&v===2){var w=Kg(u);w!==0&&(f=w,v=q0(u,w))}if(v===1)throw v=yu,Sl(u,0),Da(u,f),Mr(u,Kn()),v;if(v===6)throw Error(l(345));return u.finishedWork=u.current.alternate,u.finishedLanes=f,kl(u,Er,Us),Mr(u,Kn()),null}function KC(u){Oa!==null&&Oa.tag===0&&!(jt&6)&&_l();var f=jt;jt|=1;var v=En.transition,w=Nt;try{if(En.transition=null,Nt=1,u)return u()}finally{Nt=w,En.transition=v,jt=f,!(jt&6)&&ls()}}function Q0(){Gr=Pi.current,_t(Pi)}function Sl(u,f){u.finishedWork=null,u.finishedLanes=0;var v=u.timeoutHandle;if(v!==J&&(u.timeoutHandle=J,ce(v)),An!==null)for(v=An.return;v!==null;){var w=v;switch(t0(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&of();break;case 3:_i(),_t(Dn),_t(rn),g0();break;case 5:m0(w);break;case 4:_i();break;case 13:_t(gn);break;case 19:_t(gn);break;case 10:l0(w.type._context);break;case 22:case 23:Q0()}v=v.return}if(Xn=u,An=u=Aa(u.current,null),nr=Gr=f,Bn=0,yu=null,V0=Ff=wl=0,Er=Cu=null,yl!==null){for(f=0;f<yl.length;f++)if(v=yl[f],w=v.interleaved,w!==null){v.interleaved=null;var k=w.next,P=v.pending;if(P!==null){var L=P.next;P.next=k,w.next=L}v.pending=w}yl=null}return u}function qC(u,f){do{var v=An;try{if(a0(),Sf.current=If,kf){for(var w=vn.memoizedState;w!==null;){var k=w.queue;k!==null&&(k.pending=null),w=w.next}kf=!1}if(Cl=0,qn=Fn=vn=null,du=!1,fu=0,H0.current=null,v===null||v.return===null){Bn=1,yu=f,An=null;break}e:{var P=u,L=v.return,ne=v,pe=f;if(f=nr,ne.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Ee=pe,Xe=ne,vt=Xe.tag;if(!(Xe.mode&1)&&(vt===0||vt===11||vt===15)){var We=Xe.alternate;We?(Xe.updateQueue=We.updateQueue,Xe.memoizedState=We.memoizedState,Xe.lanes=We.lanes):(Xe.updateQueue=null,Xe.memoizedState=null)}var sn=bC(L);if(sn!==null){sn.flags&=-257,yC(sn,L,ne,P,f),sn.mode&1&&xC(P,Ee,f),f=sn,pe=Ee;var Jt=f.updateQueue;if(Jt===null){var Or=new Set;Or.add(pe),f.updateQueue=Or}else Jt.add(pe);break e}else{if(!(f&1)){xC(P,Ee,f),Y0();break e}pe=Error(l(426))}}else if(ln&&ne.mode&1){var Gs=bC(L);if(Gs!==null){!(Gs.flags&65536)&&(Gs.flags|=256),yC(Gs,L,ne,P,f),o0(ji(pe,ne));break e}}P=pe=ji(pe,ne),Bn!==4&&(Bn=2),Cu===null?Cu=[P]:Cu.push(P),P=L;do{switch(P.tag){case 3:P.flags|=65536,f&=-f,P.lanes|=f;var ue=gC(P,pe,f);z2(P,ue);break e;case 1:ne=pe;var se=P.type,me=P.stateNode;if(!(P.flags&128)&&(typeof se.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(Ma===null||!Ma.has(me)))){P.flags|=65536,f&=-f,P.lanes|=f;var Ue=vC(P,ne,f);z2(P,Ue);break e}}P=P.return}while(P!==null)}YC(v)}catch(it){f=it,An===v&&v!==null&&(An=v=v.return);continue}break}while(1)}function XC(){var u=zf.current;return zf.current=If,u===null?If:u}function Y0(){(Bn===0||Bn===3||Bn===2)&&(Bn=4),Xn===null||!(wl&268435455)&&!(Ff&268435455)||Da(Xn,nr)}function Gf(u,f){var v=jt;jt|=2;var w=XC();(Xn!==u||nr!==f)&&(Us=null,Sl(u,f));do try{vR();break}catch(k){qC(u,k)}while(1);if(a0(),jt=v,zf.current=w,An!==null)throw Error(l(261));return Xn=null,nr=0,Bn}function vR(){for(;An!==null;)QC(An)}function xR(){for(;An!==null&&!W7();)QC(An)}function QC(u){var f=ew(u.alternate,u,Gr);u.memoizedProps=u.pendingProps,f===null?YC(u):An=f,H0.current=null}function YC(u){var f=u;do{var v=f.alternate;if(u=f.return,f.flags&32768){if(v=dR(v,f),v!==null){v.flags&=32767,An=v;return}if(u!==null)u.flags|=32768,u.subtreeFlags=0,u.deletions=null;else{Bn=6,An=null;return}}else if(v=uR(v,f,Gr),v!==null){An=v;return}if(f=f.sibling,f!==null){An=f;return}An=f=u}while(f!==null);Bn===0&&(Bn=5)}function kl(u,f,v){var w=Nt,k=En.transition;try{En.transition=null,Nt=1,bR(u,f,v,w)}finally{En.transition=k,Nt=w}return null}function bR(u,f,v,w){do _l();while(Oa!==null);if(jt&6)throw Error(l(327));v=u.finishedWork;var k=u.finishedLanes;if(v===null)return null;if(u.finishedWork=null,u.finishedLanes=0,v===u.current)throw Error(l(177));u.callbackNode=null,u.callbackPriority=0;var P=v.lanes|v.childLanes;if(V7(u,P),u===Xn&&(An=Xn=null,nr=0),!(v.subtreeFlags&2064)&&!(v.flags&2064)||Hf||(Hf=!0,tw(Zg,function(){return _l(),null})),P=(v.flags&15990)!==0,v.subtreeFlags&15990||P){P=En.transition,En.transition=null;var L=Nt;Nt=1;var ne=jt;jt|=4,H0.current=null,pR(u,v),zC(v,u),B(u.containerInfo),u.current=v,mR(v),U7(),jt=ne,Nt=L,En.transition=P}else u.current=v;if(Hf&&(Hf=!1,Oa=u,Vf=k),P=u.pendingLanes,P===0&&(Ma=null),q7(v.stateNode),Mr(u,Kn()),f!==null)for(w=u.onRecoverableError,v=0;v<f.length;v++)k=f[v],w(k.value,{componentStack:k.stack,digest:k.digest});if(Bf)throw Bf=!1,u=G0,G0=null,u;return Vf&1&&u.tag!==0&&_l(),P=u.pendingLanes,P&1?u===K0?wu++:(wu=0,K0=u):wu=0,ls(),null}function _l(){if(Oa!==null){var u=P2(Vf),f=En.transition,v=Nt;try{if(En.transition=null,Nt=16>u?16:u,Oa===null)var w=!1;else{if(u=Oa,Oa=null,Vf=0,jt&6)throw Error(l(331));var k=jt;for(jt|=4,qe=u.current;qe!==null;){var P=qe,L=P.child;if(qe.flags&16){var ne=P.deletions;if(ne!==null){for(var pe=0;pe<ne.length;pe++){var Ee=ne[pe];for(qe=Ee;qe!==null;){var Xe=qe;switch(Xe.tag){case 0:case 11:case 15:xu(8,Xe,P)}var vt=Xe.child;if(vt!==null)vt.return=Xe,qe=vt;else for(;qe!==null;){Xe=qe;var We=Xe.sibling,sn=Xe.return;if(TC(Xe),Xe===Ee){qe=null;break}if(We!==null){We.return=sn,qe=We;break}qe=sn}}}var Jt=P.alternate;if(Jt!==null){var Or=Jt.child;if(Or!==null){Jt.child=null;do{var Gs=Or.sibling;Or.sibling=null,Or=Gs}while(Or!==null)}}qe=P}}if(P.subtreeFlags&2064&&L!==null)L.return=P,qe=L;else e:for(;qe!==null;){if(P=qe,P.flags&2048)switch(P.tag){case 0:case 11:case 15:xu(9,P,P.return)}var ue=P.sibling;if(ue!==null){ue.return=P.return,qe=ue;break e}qe=P.return}}var se=u.current;for(qe=se;qe!==null;){L=qe;var me=L.child;if(L.subtreeFlags&2064&&me!==null)me.return=L,qe=me;else e:for(L=se;qe!==null;){if(ne=qe,ne.flags&2048)try{switch(ne.tag){case 0:case 11:case 15:Df(9,ne)}}catch(it){cn(ne,ne.return,it)}if(ne===L){qe=null;break e}var Ue=ne.sibling;if(Ue!==null){Ue.return=ne.return,qe=Ue;break e}qe=ne.return}}if(jt=k,ls(),as&&typeof as.onPostCommitFiberRoot=="function")try{as.onPostCommitFiberRoot(uf,u)}catch{}w=!0}return w}finally{Nt=v,En.transition=f}}return!1}function ZC(u,f,v){f=ji(v,f),f=gC(u,f,1),u=Ea(u,f,1),f=lr(),u!==null&&(au(u,1,f),Mr(u,f))}function cn(u,f,v){if(u.tag===3)ZC(u,u,v);else for(;f!==null;){if(f.tag===3){ZC(f,u,v);break}else if(f.tag===1){var w=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(Ma===null||!Ma.has(w))){u=ji(v,u),u=vC(f,u,1),f=Ea(f,u,1),u=lr(),f!==null&&(au(f,1,u),Mr(f,u));break}}f=f.return}}function yR(u,f,v){var w=u.pingCache;w!==null&&w.delete(f),f=lr(),u.pingedLanes|=u.suspendedLanes&v,Xn===u&&(nr&v)===v&&(Bn===4||Bn===3&&(nr&130023424)===nr&&500>Kn()-W0?Sl(u,0):V0|=v),Mr(u,f)}function JC(u,f){f===0&&(u.mode&1?(f=lf,lf<<=1,!(lf&130023424)&&(lf=4194304)):f=1);var v=lr();u=is(u,f),u!==null&&(au(u,f,v),Mr(u,v))}function CR(u){var f=u.memoizedState,v=0;f!==null&&(v=f.retryLane),JC(u,v)}function wR(u,f){var v=0;switch(u.tag){case 13:var w=u.stateNode,k=u.memoizedState;k!==null&&(v=k.retryLane);break;case 19:w=u.stateNode;break;default:throw Error(l(314))}w!==null&&w.delete(f),JC(u,v)}var ew;ew=function(u,f,v){if(u!==null)if(u.memoizedProps!==f.pendingProps||Dn.current)Pr=!0;else{if(!(u.lanes&v)&&!(f.flags&128))return Pr=!1,cR(u,f,v);Pr=!!(u.flags&131072)}else Pr=!1,ln&&f.flags&1048576&&O2(f,pf,f.index);switch(f.lanes=0,f.tag){case 2:var w=f.type;Ef(u,f),u=f.pendingProps;var k=vi(f,rn.current);wi(f,v),k=b0(null,f,w,u,k,v);var P=y0();return f.flags|=1,typeof k=="object"&&k!==null&&typeof k.render=="function"&&k.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Ir(w)?(P=!0,sf(f)):P=!1,f.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,u0(f),k.updater=yf,f.stateNode=k,k._reactInternals=f,f0(f,w,u,v),f=P0(null,f,w,!0,P,v)):(f.tag=0,ln&&P&&e0(f),xr(null,f,k,v),f=f.child),f;case 16:w=f.elementType;e:{switch(Ef(u,f),u=f.pendingProps,k=w._init,w=k(w._payload),f.type=w,k=f.tag=kR(w),u=Ao(w,u),k){case 0:f=I0(null,f,w,u,v);break e;case 1:f=jC(null,f,w,u,v);break e;case 11:f=CC(null,f,w,u,v);break e;case 14:f=wC(null,f,w,Ao(w.type,u),v);break e}throw Error(l(306,w,""))}return f;case 0:return w=f.type,k=f.pendingProps,k=f.elementType===w?k:Ao(w,k),I0(u,f,w,k,v);case 1:return w=f.type,k=f.pendingProps,k=f.elementType===w?k:Ao(w,k),jC(u,f,w,k,v);case 3:e:{if(IC(f),u===null)throw Error(l(387));w=f.pendingProps,P=f.memoizedState,k=P.element,L2(u,f),bf(f,w,null,v);var L=f.memoizedState;if(w=L.element,we&&P.isDehydrated)if(P={element:w,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},f.updateQueue.baseState=P,f.memoizedState=P,f.flags&256){k=ji(Error(l(423)),f),f=PC(u,f,w,v,k);break e}else if(w!==k){k=ji(Error(l(424)),f),f=PC(u,f,w,v,k);break e}else for(we&&(so=Ze(f.stateNode.containerInfo),Ur=f,ln=!0,Do=null,lu=!1),v=K2(f,null,w,v),f.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(yi(),w===k){f=Ws(u,f,v);break e}xr(u,f,w,v)}f=f.child}return f;case 5:return q2(f),u===null&&r0(f),w=f.type,k=f.pendingProps,P=u!==null?u.memoizedProps:null,L=k.children,q(w,k)?L=null:P!==null&&q(w,P)&&(f.flags|=32),_C(u,f),xr(u,f,L,v),f.child;case 6:return u===null&&r0(f),null;case 13:return EC(u,f,v);case 4:return p0(f,f.stateNode.containerInfo),w=f.pendingProps,u===null?f.child=Si(f,null,w,v):xr(u,f,w,v),f.child;case 11:return w=f.type,k=f.pendingProps,k=f.elementType===w?k:Ao(w,k),CC(u,f,w,k,v);case 7:return xr(u,f,f.pendingProps,v),f.child;case 8:return xr(u,f,f.pendingProps.children,v),f.child;case 12:return xr(u,f,f.pendingProps.children,v),f.child;case 10:e:{if(w=f.type._context,k=f.pendingProps,P=f.memoizedProps,L=k.value,$2(f,w,L),P!==null)if(Ro(P.value,L)){if(P.children===k.children&&!Dn.current){f=Ws(u,f,v);break e}}else for(P=f.child,P!==null&&(P.return=f);P!==null;){var ne=P.dependencies;if(ne!==null){L=P.child;for(var pe=ne.firstContext;pe!==null;){if(pe.context===w){if(P.tag===1){pe=Vs(-1,v&-v),pe.tag=2;var Ee=P.updateQueue;if(Ee!==null){Ee=Ee.shared;var Xe=Ee.pending;Xe===null?pe.next=pe:(pe.next=Xe.next,Xe.next=pe),Ee.pending=pe}}P.lanes|=v,pe=P.alternate,pe!==null&&(pe.lanes|=v),i0(P.return,v,f),ne.lanes|=v;break}pe=pe.next}}else if(P.tag===10)L=P.type===f.type?null:P.child;else if(P.tag===18){if(L=P.return,L===null)throw Error(l(341));L.lanes|=v,ne=L.alternate,ne!==null&&(ne.lanes|=v),i0(L,v,f),L=P.sibling}else L=P.child;if(L!==null)L.return=P;else for(L=P;L!==null;){if(L===f){L=null;break}if(P=L.sibling,P!==null){P.return=L.return,L=P;break}L=L.return}P=L}xr(u,f,k.children,v),f=f.child}return f;case 9:return k=f.type,w=f.pendingProps.children,wi(f,v),k=ao(k),w=w(k),f.flags|=1,xr(u,f,w,v),f.child;case 14:return w=f.type,k=Ao(w,f.pendingProps),k=Ao(w.type,k),wC(u,f,w,k,v);case 15:return SC(u,f,f.type,f.pendingProps,v);case 17:return w=f.type,k=f.pendingProps,k=f.elementType===w?k:Ao(w,k),Ef(u,f),f.tag=1,Ir(w)?(u=!0,sf(f)):u=!1,wi(f,v),V2(f,w,k),f0(f,w,k,v),P0(null,f,w,!0,u,v);case 19:return OC(u,f,v);case 22:return kC(u,f,v)}throw Error(l(156,f.tag))};function tw(u,f){return Qg(u,f)}function SR(u,f,v,w){this.tag=u,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function uo(u,f,v,w){return new SR(u,f,v,w)}function Z0(u){return u=u.prototype,!(!u||!u.isReactComponent)}function kR(u){if(typeof u=="function")return Z0(u)?1:0;if(u!=null){if(u=u.$$typeof,u===b)return 11;if(u===_)return 14}return 2}function Aa(u,f){var v=u.alternate;return v===null?(v=uo(u.tag,f,u.key,u.mode),v.elementType=u.elementType,v.type=u.type,v.stateNode=u.stateNode,v.alternate=u,u.alternate=v):(v.pendingProps=f,v.type=u.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=u.flags&14680064,v.childLanes=u.childLanes,v.lanes=u.lanes,v.child=u.child,v.memoizedProps=u.memoizedProps,v.memoizedState=u.memoizedState,v.updateQueue=u.updateQueue,f=u.dependencies,v.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},v.sibling=u.sibling,v.index=u.index,v.ref=u.ref,v}function Kf(u,f,v,w,k,P){var L=2;if(w=u,typeof u=="function")Z0(u)&&(L=1);else if(typeof u=="string")L=5;else e:switch(u){case m:return jl(v.children,k,P,f);case h:L=8,k|=8;break;case g:return u=uo(12,v,f,k|2),u.elementType=g,u.lanes=P,u;case C:return u=uo(13,v,f,k),u.elementType=C,u.lanes=P,u;case S:return u=uo(19,v,f,k),u.elementType=S,u.lanes=P,u;case E:return qf(v,k,P,f);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case x:L=10;break e;case y:L=9;break e;case b:L=11;break e;case _:L=14;break e;case j:L=16,w=null;break e}throw Error(l(130,u==null?u:typeof u,""))}return f=uo(L,v,f,k),f.elementType=u,f.type=w,f.lanes=P,f}function jl(u,f,v,w){return u=uo(7,u,w,f),u.lanes=v,u}function qf(u,f,v,w){return u=uo(22,u,w,f),u.elementType=E,u.lanes=v,u.stateNode={isHidden:!1},u}function J0(u,f,v){return u=uo(6,u,null,f),u.lanes=v,u}function ev(u,f,v){return f=uo(4,u.children!==null?u.children:[],u.key,f),f.lanes=v,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}function _R(u,f,v,w,k){this.tag=f,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=J,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qg(0),this.expirationTimes=qg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qg(0),this.identifierPrefix=w,this.onRecoverableError=k,we&&(this.mutableSourceEagerHydrationData=null)}function nw(u,f,v,w,k,P,L,ne,pe){return u=new _R(u,f,v,ne,pe),f===1?(f=1,P===!0&&(f|=8)):f=0,P=uo(3,null,null,f),u.current=P,P.stateNode=u,P.memoizedState={element:w,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},u0(P),u}function rw(u){if(!u)return rr;u=u._reactInternals;e:{if(A(u)!==u||u.tag!==1)throw Error(l(170));var f=u;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Ir(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(l(171))}if(u.tag===1){var v=u.type;if(Ir(v))return _2(u,v,f)}return f}function ow(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(l(188)):(u=Object.keys(u).join(","),Error(l(268,u)));return u=X(f),u===null?null:u.stateNode}function sw(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var v=u.retryLane;u.retryLane=v!==0&&v<f?v:f}}function Xf(u,f){sw(u,f),(u=u.alternate)&&sw(u,f)}function jR(u){return u=X(u),u===null?null:u.stateNode}function IR(){return null}return n.attemptContinuousHydration=function(u){if(u.tag===13){var f=is(u,134217728);if(f!==null){var v=lr();co(f,u,134217728,v)}Xf(u,134217728)}},n.attemptDiscreteHydration=function(u){if(u.tag===13){var f=is(u,1);if(f!==null){var v=lr();co(f,u,1,v)}Xf(u,1)}},n.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var f=Ra(u),v=is(u,f);if(v!==null){var w=lr();co(v,u,f,w)}Xf(u,f)}},n.attemptSynchronousHydration=function(u){switch(u.tag){case 3:var f=u.stateNode;if(f.current.memoizedState.isDehydrated){var v=su(f.pendingLanes);v!==0&&(Xg(f,v|1),Mr(f,Kn()),!(jt&6)&&(Ei(),ls()))}break;case 13:KC(function(){var w=is(u,1);if(w!==null){var k=lr();co(w,u,1,k)}}),Xf(u,1)}},n.batchedUpdates=function(u,f){var v=jt;jt|=1;try{return u(f)}finally{jt=v,jt===0&&(Ei(),df&&ls())}},n.createComponentSelector=function(u){return{$$typeof:Af,value:u}},n.createContainer=function(u,f,v,w,k,P,L){return nw(u,f,!1,null,v,w,k,P,L)},n.createHasPseudoClassSelector=function(u){return{$$typeof:Tf,value:u}},n.createHydrationContainer=function(u,f,v,w,k,P,L,ne,pe){return u=nw(v,w,!0,u,k,P,L,ne,pe),u.context=rw(null),v=u.current,w=lr(),k=Ra(v),P=Vs(w,k),P.callback=f??null,Ea(v,P,k),u.current.lanes=k,au(u,k,w),Mr(u,w),u},n.createPortal=function(u,f,v){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:w==null?null:""+w,children:u,containerInfo:f,implementation:v}},n.createRoleSelector=function(u){return{$$typeof:$f,value:u}},n.createTestNameSelector=function(u){return{$$typeof:Nf,value:u}},n.createTextSelector=function(u){return{$$typeof:Lf,value:u}},n.deferredUpdates=function(u){var f=Nt,v=En.transition;try{return En.transition=null,Nt=16,u()}finally{Nt=f,En.transition=v}},n.discreteUpdates=function(u,f,v,w,k){var P=Nt,L=En.transition;try{return En.transition=null,Nt=1,u(f,v,w,k)}finally{Nt=P,En.transition=L,jt===0&&Ei()}},n.findAllNodes=B0,n.findBoundingRects=function(u,f){if(!Ve)throw Error(l(363));f=B0(u,f),u=[];for(var v=0;v<f.length;v++)u.push(Ye(f[v]));for(f=u.length-1;0<f;f--){v=u[f];for(var w=v.x,k=w+v.width,P=v.y,L=P+v.height,ne=f-1;0<=ne;ne--)if(f!==ne){var pe=u[ne],Ee=pe.x,Xe=Ee+pe.width,vt=pe.y,We=vt+pe.height;if(w>=Ee&&P>=vt&&k<=Xe&&L<=We){u.splice(f,1);break}else if(w!==Ee||v.width!==pe.width||We<P||vt>L){if(!(P!==vt||v.height!==pe.height||Xe<w||Ee>k)){Ee>w&&(pe.width+=Ee-w,pe.x=w),Xe<k&&(pe.width=k-Ee),u.splice(f,1);break}}else{vt>P&&(pe.height+=vt-P,pe.y=P),We<L&&(pe.height=L-vt),u.splice(f,1);break}}}return u},n.findHostInstance=ow,n.findHostInstanceWithNoPortals=function(u){return u=$(u),u=u!==null?V(u):null,u===null?null:u.stateNode},n.findHostInstanceWithWarning=function(u){return ow(u)},n.flushControlled=function(u){var f=jt;jt|=1;var v=En.transition,w=Nt;try{En.transition=null,Nt=1,u()}finally{Nt=w,En.transition=v,jt=f,jt===0&&(Ei(),ls())}},n.flushPassiveEffects=_l,n.flushSync=KC,n.focusWithin=function(u,f){if(!Ve)throw Error(l(363));for(u=L0(u),f=WC(u,f),f=Array.from(f),u=0;u<f.length;){var v=f[u++];if(!ge(v)){if(v.tag===5&&ut(v.stateNode))return!0;for(v=v.child;v!==null;)f.push(v),v=v.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Nt},n.getFindAllNodesFailureDescription=function(u,f){if(!Ve)throw Error(l(363));var v=0,w=[];u=[L0(u),0];for(var k=0;k<u.length;){var P=u[k++],L=u[k++],ne=f[L];if((P.tag!==5||!ge(P))&&(z0(P,ne)&&(w.push(F0(ne)),L++,L>v&&(v=L)),L<f.length))for(P=P.child;P!==null;)u.push(P,L),P=P.sibling}if(v<f.length){for(u=[];v<f.length;v++)u.push(F0(f[v]));return`findAllNodes was able to match part of the selector:
|
||
`+(w.join(" > ")+`
|
||
|
||
No matching component was found for:
|
||
`)+u.join(" > ")}return null},n.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return G(u.child.stateNode);default:return u.child.stateNode}},n.injectIntoDevTools=function(u){if(u={bundleType:u.bundleType,version:u.version,rendererPackageName:u.rendererPackageName,rendererConfig:u.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:i.ReactCurrentDispatcher,findHostInstanceByFiber:jR,findFiberByHostInstance:u.findFiberByHostInstance||IR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)u=!0;else{try{uf=f.inject(u),as=f}catch{}u=!!f.checkDCE}}return u},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(u,f,v,w){if(!Ve)throw Error(l(363));u=B0(u,f);var k=yt(u,v,w).disconnect;return{disconnect:function(){k()}}},n.registerMutableSourceForHydration=function(u,f){var v=f._getVersion;v=v(f._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[f,v]:u.mutableSourceEagerHydrationData.push(f,v)},n.runWithPriority=function(u,f){var v=Nt;try{return Nt=u,f()}finally{Nt=v}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(u,f,v,w){var k=f.current,P=lr(),L=Ra(k);return v=rw(v),f.context===null?f.context=v:f.pendingContext=v,f=Vs(P,L),f.payload={element:u},w=w===void 0?null:w,w!==null&&(f.callback=w),u=Ea(k,f,L),u!==null&&(co(u,k,L,P),xf(u,k,L)),L},n};_7.exports=zge;var Fge=_7.exports;const Bge=wd(Fge);var j7={exports:{}},pi={};/**
|
||
* @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.
|
||
*/pi.ConcurrentRoot=1;pi.ContinuousEventPriority=4;pi.DefaultEventPriority=16;pi.DiscreteEventPriority=1;pi.IdleEventPriority=536870912;pi.LegacyRoot=0;j7.exports=pi;var I7=j7.exports;const Nj={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let Lj=!1,zj=!1;const C2=".react-konva-event",Hge=`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
|
||
`,Vge=`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
|
||
`,Wge={};function Vg(e,t,n=Wge){if(!Lj&&"zIndex"in t&&(console.warn(Vge),Lj=!0),!zj&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(Hge),zj=!0)}for(var s in n)if(!Nj[s]){var l=s.slice(0,2)==="on",i=n[s]!==t[s];if(l&&i){var c=s.substr(2).toLowerCase();c.substr(0,7)==="content"&&(c="content"+c.substr(7,1).toUpperCase()+c.substr(8)),e.off(c,n[s])}var p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var m=t._useStrictMode,h={},g=!1;const x={};for(var s in t)if(!Nj[s]){var l=s.slice(0,2)==="on",y=n[s]!==t[s];if(l&&y){var c=s.substr(2).toLowerCase();c.substr(0,7)==="content"&&(c="content"+c.substr(7,1).toUpperCase()+c.substr(8)),t[s]&&(x[c]=t[s])}!l&&(t[s]!==n[s]||m&&t[s]!==e.getAttr(s))&&(g=!0,h[s]=t[s])}g&&(e.setAttrs(h),gl(e));for(var c in x)e.on(c+C2,x[c])}function gl(e){if(!Q9.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const P7={},Uge={};yd.Node.prototype._applyProps=Vg;function Gge(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),gl(e)}function Kge(e,t,n){let r=yd[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=yd.Group);const o={},s={};for(var l in t){var i=l.slice(0,2)==="on";i?s[l]=t[l]:o[l]=t[l]}const c=new r(o);return Vg(c,s),c}function qge(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Xge(e,t,n){return!1}function Qge(e){return e}function Yge(){return null}function Zge(){return null}function Jge(e,t,n,r){return Uge}function e0e(){}function t0e(e){}function n0e(e,t){return!1}function r0e(){return P7}function o0e(){return P7}const s0e=setTimeout,a0e=clearTimeout,l0e=-1;function i0e(e,t){return!1}const c0e=!1,u0e=!0,d0e=!0;function f0e(e,t){t.parent===e?t.moveToTop():e.add(t),gl(e)}function p0e(e,t){t.parent===e?t.moveToTop():e.add(t),gl(e)}function E7(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),gl(e)}function m0e(e,t,n){E7(e,t,n)}function h0e(e,t){t.destroy(),t.off(C2),gl(e)}function g0e(e,t){t.destroy(),t.off(C2),gl(e)}function v0e(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function x0e(e,t,n){}function b0e(e,t,n,r,o){Vg(e,o,r)}function y0e(e){e.hide(),gl(e)}function C0e(e){}function w0e(e,t){(t.visible==null||t.visible)&&e.show()}function S0e(e,t){}function k0e(e){}function _0e(){}const j0e=()=>I7.DefaultEventPriority,I0e=Object.freeze(Object.defineProperty({__proto__:null,appendChild:f0e,appendChildToContainer:p0e,appendInitialChild:Gge,cancelTimeout:a0e,clearContainer:k0e,commitMount:x0e,commitTextUpdate:v0e,commitUpdate:b0e,createInstance:Kge,createTextInstance:qge,detachDeletedInstance:_0e,finalizeInitialChildren:Xge,getChildHostContext:o0e,getCurrentEventPriority:j0e,getPublicInstance:Qge,getRootHostContext:r0e,hideInstance:y0e,hideTextInstance:C0e,idlePriority:Lp.unstable_IdlePriority,insertBefore:E7,insertInContainerBefore:m0e,isPrimaryRenderer:c0e,noTimeout:l0e,now:Lp.unstable_now,prepareForCommit:Yge,preparePortalMount:Zge,prepareUpdate:Jge,removeChild:h0e,removeChildFromContainer:g0e,resetAfterCommit:e0e,resetTextContent:t0e,run:Lp.unstable_runWithPriority,scheduleTimeout:s0e,shouldDeprioritizeSubtree:n0e,shouldSetTextContent:i0e,supportsMutation:d0e,unhideInstance:w0e,unhideTextInstance:S0e,warnsIfNotActing:u0e},Symbol.toStringTag,{value:"Module"}));var P0e=Object.defineProperty,E0e=Object.defineProperties,M0e=Object.getOwnPropertyDescriptors,Fj=Object.getOwnPropertySymbols,O0e=Object.prototype.hasOwnProperty,R0e=Object.prototype.propertyIsEnumerable,Bj=(e,t,n)=>t in e?P0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hj=(e,t)=>{for(var n in t||(t={}))O0e.call(t,n)&&Bj(e,n,t[n]);if(Fj)for(var n of Fj(t))R0e.call(t,n)&&Bj(e,n,t[n]);return e},D0e=(e,t)=>E0e(e,M0e(t));function M7(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=M7(r,t,n);if(o)return o;r=t?null:r.sibling}}function O7(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const w2=O7(d.createContext(null));class R7 extends d.Component{render(){return d.createElement(w2.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:Vj,ReactCurrentDispatcher:Wj}=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A0e(){const e=d.useContext(w2);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=d.useId();return d.useMemo(()=>{for(const r of[Vj==null?void 0:Vj.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=M7(r,!1,s=>{let l=s.memoizedState;for(;l;){if(l.memoizedState===t)return!0;l=l.next}});if(o)return o}},[e,t])}function T0e(){var e,t;const n=A0e(),[r]=d.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==w2&&!r.has(s)&&r.set(s,(t=Wj==null?void 0:Wj.current)==null?void 0:t.readContext(O7(s))),o=o.return}return r}function $0e(){const e=T0e();return d.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>d.createElement(t,null,d.createElement(n.Provider,D0e(Hj({},r),{value:e.get(n)}))),t=>d.createElement(R7,Hj({},t))),[e])}function N0e(e){const t=H.useRef({});return H.useLayoutEffect(()=>{t.current=e}),H.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const L0e=e=>{const t=H.useRef(),n=H.useRef(),r=H.useRef(),o=N0e(e),s=$0e(),l=i=>{const{forwardedRef:c}=e;c&&(typeof c=="function"?c(i):c.current=i)};return H.useLayoutEffect(()=>(n.current=new yd.Stage({width:e.width,height:e.height,container:t.current}),l(n.current),r.current=Fu.createContainer(n.current,I7.LegacyRoot,!1,null),Fu.updateContainer(H.createElement(s,{},e.children),r.current),()=>{yd.isBrowser&&(l(null),Fu.updateContainer(null,r.current,null),n.current.destroy())}),[]),H.useLayoutEffect(()=>{l(n.current),Vg(n.current,e,o),Fu.updateContainer(H.createElement(s,{},e.children),r.current,null)}),H.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})},Au="Layer",Os="Group",Rs="Rect",Il="Circle",bh="Line",D7="Image",z0e="Text",F0e="Transformer",Fu=Bge(I0e);Fu.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:H.version,rendererPackageName:"react-konva"});const B0e=H.forwardRef((e,t)=>H.createElement(R7,{},H.createElement(L0e,{...e,forwardedRef:t}))),H0e=ae([wn,Eo],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),V0e=()=>{const e=te(),{tool:t,isStaging:n,isMovingBoundingBox:r}=W(H0e);return{handleDragStart:d.useCallback(()=>{(t==="move"||n)&&!r&&e(im(!0))},[e,r,n,t]),handleDragMove:d.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(YI(s))},[e,r,n,t]),handleDragEnd:d.useCallback(()=>{(t==="move"||n)&&!r&&e(im(!1))},[e,r,n,t])}},W0e=ae([wn,er,Eo],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:l,isMaskEnabled:i,shouldSnapToGrid:c}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:l,isStaging:n,isMaskEnabled:i,shouldSnapToGrid:c}},{memoizeOptions:{resultEqualityCheck:Bt}}),U0e=()=>{const e=te(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:l}=W(W0e),i=d.useRef(null),c=ZI(),p=()=>e(JI());nt(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const m=()=>e(vb(!s));nt(["h"],()=>{m()},{enabled:()=>!o,preventDefault:!0},[s]),nt(["n"],()=>{e(cm(!l))},{enabled:!0,preventDefault:!0},[l]),nt("esc",()=>{e(Y9())},{enabled:()=>!0,preventDefault:!0}),nt("shift+h",()=>{e(Z9(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),nt(["space"],h=>{h.repeat||(c==null||c.container().focus(),r!=="move"&&(i.current=r,e(sc("move"))),r==="move"&&i.current&&i.current!=="move"&&(e(sc(i.current)),i.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,i])},S2=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}},A7=()=>{const e=te(),t=C1(),n=ZI();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=J9.pixelRatio,[s,l,i,c]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;c&&s&&l&&i&&e(e$({r:s,g:l,b:i,a:c}))},commitColorUnderCursor:()=>{e(t$())}}},G0e=ae([er,wn,Eo],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),K0e=e=>{const t=te(),{tool:n,isStaging:r}=W(G0e),{commitColorUnderCursor:o}=A7();return d.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(im(!0));return}if(n==="colorPicker"){o();return}const l=S2(e.current);l&&(s.evt.preventDefault(),t(e5(!0)),t(n$([l.x,l.y])))},[e,n,r,t,o])},q0e=ae([er,wn,Eo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),X0e=(e,t,n)=>{const r=te(),{isDrawing:o,tool:s,isStaging:l}=W(q0e),{updateColorUnderCursor:i}=A7();return d.useCallback(()=>{if(!e.current)return;const c=S2(e.current);if(c){if(r(r$(c)),n.current=c,s==="colorPicker"){i();return}!o||s==="move"||l||(t.current=!0,r(t5([c.x,c.y])))}},[t,r,o,l,n,e,s,i])},Q0e=()=>{const e=te();return d.useCallback(()=>{e(o$())},[e])},Y0e=ae([er,wn,Eo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),Z0e=(e,t)=>{const n=te(),{tool:r,isDrawing:o,isStaging:s}=W(Y0e);return d.useCallback(()=>{if(r==="move"||s){n(im(!1));return}if(!t.current&&o&&e.current){const l=S2(e.current);if(!l)return;n(t5([l.x,l.y]))}else t.current=!1;n(e5(!1))},[t,n,o,s,e,r])},J0e=ae([wn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),eve=e=>{const t=te(),{isMoveStageKeyHeld:n,stageScale:r}=W(J0e);return d.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const l={x:(s.x-e.current.x())/r,y:(s.y-e.current.y())/r};let i=o.evt.deltaY;o.evt.ctrlKey&&(i=-i);const c=Bl(r*l$**i,a$,s$),p={x:s.x-l.x*c,y:s.y-l.y*c};t(i$(c)),t(YI(p))},[e,n,r,t])},tve=ae(wn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:l,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:Bt}}),nve=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=W(tve);return a.jsxs(Os,{children:[a.jsx(Rs,{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(Rs,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},rve=d.memo(nve),ove=ae([wn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),sve=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=W(ove),{colorMode:r}=ha(),[o,s]=d.useState([]),[l,i]=Ho("colors",["base.800","base.200"]),c=d.useCallback(p=>p/e,[e]);return d.useLayoutEffect(()=>{const{width:p,height:m}=n,{x:h,y:g}=t,x={x1:0,y1:0,x2:p,y2:m,offset:{x:c(h),y:c(g)}},y={x:Math.ceil(c(h)/64)*64,y:Math.ceil(c(g)/64)*64},b={x1:-y.x,y1:-y.y,x2:c(p)-y.x+64,y2:c(m)-y.y+64},S={x1:Math.min(x.x1,b.x1),y1:Math.min(x.y1,b.y1),x2:Math.max(x.x2,b.x2),y2:Math.max(x.y2,b.y2)},_=S.x2-S.x1,j=S.y2-S.y1,E=Math.round(_/64)+1,I=Math.round(j/64)+1,M=Uw(0,E).map(D=>a.jsx(bh,{x:S.x1+D*64,y:S.y1,points:[0,0,0,j],stroke:r==="dark"?l:i,strokeWidth:1},`x_${D}`)),R=Uw(0,I).map(D=>a.jsx(bh,{x:S.x1,y:S.y1+D*64,points:[0,0,_,0],stroke:r==="dark"?l:i,strokeWidth:1},`y_${D}`));s(M.concat(R))},[e,t,n,c,r,l,i]),a.jsx(Os,{children:o})},ave=d.memo(sve),lve=ae([he],({system:e,canvas:t})=>{const{denoiseProgress:n}=e,{boundingBox:r}=t.layerState.stagingArea,{batchIds:o}=t;return{boundingBox:r,progressImage:n&&o.includes(n.batch_id)?n.progress_image:void 0}},{memoizeOptions:{resultEqualityCheck:Bt}}),ive=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=W(lve),[o,s]=d.useState(null);return d.useEffect(()=>{if(!n)return;const l=new Image;l.onload=()=>{s(l)},l.src=n.dataURL},[n]),n&&r&&o?a.jsx(D7,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},cve=d.memo(ive),Fl=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},uve=ae(wn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Fl(t)}}),Uj=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),dve=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=W(uve),[l,i]=d.useState(null),[c,p]=d.useState(0),m=d.useRef(null),h=d.useCallback(()=>{p(c+1),setTimeout(h,500)},[c]);return d.useEffect(()=>{if(l)return;const g=new Image;g.onload=()=>{i(g)},g.src=Uj(n)},[l,n]),d.useEffect(()=>{l&&(l.src=Uj(n))},[l,n]),d.useEffect(()=>{const g=setInterval(()=>p(x=>(x+1)%5),50);return()=>clearInterval(g)},[]),!l||!Oi(r.x)||!Oi(r.y)||!Oi(s)||!Oi(o.width)||!Oi(o.height)?null:a.jsx(Rs,{ref:m,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:l,fillPatternOffsetY:Oi(c)?c:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},fve=d.memo(dve),pve=ae([wn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Bt}}),mve=e=>{const{...t}=e,{objects:n}=W(pve);return a.jsx(Os,{listening:!1,...t,children:n.filter(c$).map((r,o)=>a.jsx(bh,{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))})},hve=d.memo(mve);var Pl=d,gve=function(t,n,r){const o=Pl.useRef("loading"),s=Pl.useRef(),[l,i]=Pl.useState(0),c=Pl.useRef(),p=Pl.useRef(),m=Pl.useRef();return(c.current!==t||p.current!==n||m.current!==r)&&(o.current="loading",s.current=void 0,c.current=t,p.current=n,m.current=r),Pl.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function g(){o.current="loaded",s.current=h,i(Math.random())}function x(){o.current="failed",s.current=void 0,i(Math.random())}return h.addEventListener("load",g),h.addEventListener("error",x),n&&(h.crossOrigin=n),r&&(h.referrerPolicy=r),h.src=t,function(){h.removeEventListener("load",g),h.removeEventListener("error",x)}},[t,n,r]),[s.current,o.current]};const vve=wd(gve),xve=({canvasImage:e})=>{const[t,n,r,o]=Ho("colors",["base.400","base.500","base.700","base.900"]),s=aa(t,n),l=aa(r,o),{t:i}=Z();return a.jsxs(Os,{children:[a.jsx(Rs,{x:e.x,y:e.y,width:e.width,height:e.height,fill:s}),a.jsx(z0e,{x:e.x,y:e.y,width:e.width,height:e.height,align:"center",verticalAlign:"middle",fontFamily:'"Inter Variable", sans-serif',fontSize:e.width/16,fontStyle:"600",text:i("common.imageFailedToLoad"),fill:l})]})},bve=d.memo(xve),yve=e=>{const{x:t,y:n,imageName:r}=e.canvasImage,{currentData:o,isError:s}=wo(r??eo.skipToken),[l,i]=vve((o==null?void 0:o.image_url)??"",u$.get()?"use-credentials":"anonymous");return s||i==="failed"?a.jsx(bve,{canvasImage:e.canvasImage}):a.jsx(D7,{x:t,y:n,image:l,listening:!1})},T7=d.memo(yve),Cve=ae([wn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Bt}}),wve=()=>{const{objects:e}=W(Cve);return e?a.jsx(Os,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(d$(t))return a.jsx(T7,{canvasImage:t},n);if(f$(t)){const r=a.jsx(bh,{points:t.points,stroke:t.color?Fl(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(Os,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(p$(t))return a.jsx(Rs,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Fl(t.color)},n);if(m$(t))return a.jsx(Rs,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Sve=d.memo(wve),kve=ae([wn],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:o,boundingBoxDimensions:s}=e,{selectedImageIndex:l,images:i,boundingBox:c}=t.stagingArea;return{currentStagingAreaImage:i.length>0&&l!==void 0?i[l]:void 0,isOnFirstImage:l===0,isOnLastImage:l===i.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:(c==null?void 0:c.x)??o.x,y:(c==null?void 0:c.y)??o.y,width:(c==null?void 0:c.width)??s.width,height:(c==null?void 0:c.height)??s.height}},{memoizeOptions:{resultEqualityCheck:Bt}}),_ve=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:l,width:i,height:c}=W(kve);return a.jsxs(Os,{...t,children:[r&&n&&a.jsx(T7,{canvasImage:n}),o&&a.jsxs(Os,{children:[a.jsx(Rs,{x:s,y:l,width:i,height:c,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(Rs,{x:s,y:l,width:i,height:c,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},jve=d.memo(_ve),Ive=ae([wn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:o}=e;return{currentIndex:n,total:t.length,currentStagingAreaImage:t.length>0?t[n]:void 0,shouldShowStagingImage:o,shouldShowStagingOutline:r}},Ce),Pve=()=>{const e=te(),{currentStagingAreaImage:t,shouldShowStagingImage:n,currentIndex:r,total:o}=W(Ive),{t:s}=Z(),l=d.useCallback(()=>{e(Gw(!0))},[e]),i=d.useCallback(()=>{e(Gw(!1))},[e]),c=d.useCallback(()=>e(h$()),[e]),p=d.useCallback(()=>e(g$()),[e]),m=d.useCallback(()=>e(v$()),[e]);nt(["left"],c,{enabled:()=>!0,preventDefault:!0}),nt(["right"],p,{enabled:()=>!0,preventDefault:!0}),nt(["enter"],()=>m,{enabled:()=>!0,preventDefault:!0});const{data:h}=wo((t==null?void 0:t.imageName)??eo.skipToken),g=d.useCallback(()=>{e(x$(!n))},[e,n]),x=d.useCallback(()=>{h&&e(b$({imageDTO:h}))},[e,h]),y=d.useCallback(()=>{e(y$())},[e]);return t?a.jsxs(N,{pos:"absolute",bottom:4,gap:2,w:"100%",align:"center",justify:"center",onMouseEnter:l,onMouseLeave:i,children:[a.jsxs(Ht,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(Be,{tooltip:`${s("unifiedCanvas.previous")} (Left)`,"aria-label":`${s("unifiedCanvas.previous")} (Left)`,icon:a.jsx(FJ,{}),onClick:c,colorScheme:"accent",isDisabled:!n}),a.jsx(ot,{colorScheme:"base",pointerEvents:"none",isDisabled:!n,minW:20,children:`${r+1}/${o}`}),a.jsx(Be,{tooltip:`${s("unifiedCanvas.next")} (Right)`,"aria-label":`${s("unifiedCanvas.next")} (Right)`,icon:a.jsx(BJ,{}),onClick:p,colorScheme:"accent",isDisabled:!n})]}),a.jsxs(Ht,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(Be,{tooltip:`${s("unifiedCanvas.accept")} (Enter)`,"aria-label":`${s("unifiedCanvas.accept")} (Enter)`,icon:a.jsx(vM,{}),onClick:m,colorScheme:"accent"}),a.jsx(Be,{tooltip:s(n?"unifiedCanvas.showResultsOn":"unifiedCanvas.showResultsOff"),"aria-label":s(n?"unifiedCanvas.showResultsOn":"unifiedCanvas.showResultsOff"),"data-alert":!n,icon:n?a.jsx(eee,{}):a.jsx(JJ,{}),onClick:g,colorScheme:"accent"}),a.jsx(Be,{tooltip:s("unifiedCanvas.saveToGallery"),"aria-label":s("unifiedCanvas.saveToGallery"),isDisabled:!h||!h.is_intermediate,icon:a.jsx(fg,{}),onClick:x,colorScheme:"accent"}),a.jsx(Be,{tooltip:s("unifiedCanvas.discardAll"),"aria-label":s("unifiedCanvas.discardAll"),icon:a.jsx(Ec,{}),onClick:y,colorScheme:"error",fontSize:20})]})]}):null},Eve=d.memo(Pve),Mve=()=>{const e=W(i=>i.canvas.layerState),t=W(i=>i.canvas.boundingBoxCoordinates),n=W(i=>i.canvas.boundingBoxDimensions),r=W(i=>i.canvas.isMaskEnabled),o=W(i=>i.canvas.shouldPreserveMaskedArea),[s,l]=d.useState();return d.useEffect(()=>{l(void 0)},[e,t,n,r,o]),jee(async()=>{const i=await C$(e,t,n,r,o);if(!i)return;const{baseImageData:c,maskImageData:p}=i,m=w$(c,p);l(m)},1e3,[e,t,n,r,o]),s},Ove={txt2img:"Text to Image",img2img:"Image to Image",inpaint:"Inpaint",outpaint:"Inpaint"},Rve=()=>{const e=Mve();return a.jsxs(Ie,{children:["Mode: ",e?Ove[e]:"..."]})},Dve=d.memo(Rve),rc=e=>Math.round(e*100)/100,Ave=ae([wn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${rc(n)}, ${rc(r)})`}},{memoizeOptions:{resultEqualityCheck:Bt}});function Tve(){const{cursorCoordinatesString:e}=W(Ave),{t}=Z();return a.jsx(Ie,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Fx="var(--invokeai-colors-warning-500)",$ve=ae([wn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:l},scaledBoundingBoxDimensions:{width:i,height:c},boundingBoxCoordinates:{x:p,y:m},stageScale:h,shouldShowCanvasDebugInfo:g,layer:x,boundingBoxScaleMethod:y,shouldPreserveMaskedArea:b}=e;let C="inherit";return(y==="none"&&(s<512||l<512)||y==="manual"&&i*c<512*512)&&(C=Fx),{activeLayerColor:x==="mask"?Fx:"inherit",layer:x,boundingBoxColor:C,boundingBoxCoordinatesString:`(${rc(p)}, ${rc(m)})`,boundingBoxDimensionsString:`${s}×${l}`,scaledBoundingBoxDimensionsString:`${i}×${c}`,canvasCoordinatesString:`${rc(r)}×${rc(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:g,shouldShowBoundingBox:y!=="auto",shouldShowScaledBoundingBox:y!=="none",shouldPreserveMaskedArea:b}},{memoizeOptions:{resultEqualityCheck:Bt}}),Nve=()=>{const{activeLayerColor:e,layer:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:l,canvasCoordinatesString:i,canvasDimensionsString:c,canvasScaleString:p,shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:h,shouldPreserveMaskedArea:g}=W($ve),{t:x}=Z();return a.jsxs(N,{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(Dve,{}),a.jsx(Ie,{style:{color:e},children:`${x("unifiedCanvas.activeLayer")}: ${x(`unifiedCanvas.${t}`)}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasScale")}: ${p}%`}),g&&a.jsxs(Ie,{style:{color:Fx},children:[x("unifiedCanvas.preserveMaskedArea"),": ",x("common.on")]}),h&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.boundingBox")}: ${o}`}),l&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.scaledBoundingBox")}: ${s}`}),m&&a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:`${x("unifiedCanvas.boundingBoxPosition")}: ${r}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasDimensions")}: ${c}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasPosition")}: ${i}`}),a.jsx(Tve,{})]})]})},Lve=d.memo(Nve),zve=ae([he],({canvas:e,generation:t})=>{const{boundingBoxCoordinates:n,boundingBoxDimensions:r,stageScale:o,isDrawing:s,isTransformingBoundingBox:l,isMovingBoundingBox:i,tool:c,shouldSnapToGrid:p}=e,{aspectRatio:m}=t;return{boundingBoxCoordinates:n,boundingBoxDimensions:r,isDrawing:s,isMovingBoundingBox:i,isTransformingBoundingBox:l,stageScale:o,shouldSnapToGrid:p,tool:c,hitStrokeWidth:20/o,aspectRatio:m}},{memoizeOptions:{resultEqualityCheck:Bt}}),Fve=e=>{const{...t}=e,n=te(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:l,isTransformingBoundingBox:i,stageScale:c,shouldSnapToGrid:p,tool:m,hitStrokeWidth:h,aspectRatio:g}=W(zve),x=d.useRef(null),y=d.useRef(null),[b,C]=d.useState(!1);d.useEffect(()=>{var z;!x.current||!y.current||(x.current.nodes([y.current]),(z=x.current.getLayer())==null||z.batchDraw())},[]);const S=64*c;nt("N",()=>{n(cm(!p))});const _=d.useCallback(z=>{if(!p){n(av({x:Math.floor(z.target.x()),y:Math.floor(z.target.y())}));return}const V=z.target.x(),Q=z.target.y(),G=Wn(V,64),F=Wn(Q,64);z.target.x(G),z.target.y(F),n(av({x:G,y:F}))},[n,p]),j=d.useCallback(()=>{if(!y.current)return;const z=y.current,V=z.scaleX(),Q=z.scaleY(),G=Math.round(z.width()*V),F=Math.round(z.height()*Q),U=Math.round(z.x()),T=Math.round(z.y());if(g){const B=Wn(G/g,64);n(Wo({width:G,height:B}))}else n(Wo({width:G,height:F}));n(av({x:p?Tu(U,64):U,y:p?Tu(T,64):T})),z.scaleX(1),z.scaleY(1)},[n,p,g]),E=d.useCallback((z,V,Q)=>{const G=z.x%S,F=z.y%S;return{x:Tu(V.x,S)+G,y:Tu(V.y,S)+F}},[S]),I=d.useCallback(()=>{n(lv(!0))},[n]),M=d.useCallback(()=>{n(lv(!1)),n(iv(!1)),n(ep(!1)),C(!1)},[n]),R=d.useCallback(()=>{n(iv(!0))},[n]),D=d.useCallback(()=>{n(lv(!1)),n(iv(!1)),n(ep(!1)),C(!1)},[n]),A=d.useCallback(()=>{C(!0)},[]),O=d.useCallback(()=>{!i&&!l&&C(!1)},[l,i]),$=d.useCallback(()=>{n(ep(!0))},[n]),X=d.useCallback(()=>{n(ep(!1))},[n]);return a.jsxs(Os,{...t,children:[a.jsx(Rs,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:$,onMouseOver:$,onMouseLeave:X,onMouseOut:X}),a.jsx(Rs,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:h,listening:!s&&m==="move",onDragStart:R,onDragEnd:D,onDragMove:_,onMouseDown:R,onMouseOut:O,onMouseOver:A,onMouseEnter:A,onMouseUp:D,onTransform:j,onTransformEnd:M,ref:y,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/c,width:o.width,x:r.x,y:r.y}),a.jsx(F0e,{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:R,onDragEnd:D,onMouseDown:I,onMouseUp:M,onTransformEnd:M,ref:x,rotateEnabled:!1})]})},Bve=d.memo(Fve),Hve=ae(wn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:l,layer:i,shouldShowBrush:c,isMovingBoundingBox:p,isTransformingBoundingBox:m,stageScale:h,stageDimensions:g,boundingBoxCoordinates:x,boundingBoxDimensions:y,shouldRestrictStrokesToBox:b}=e,C=b?{clipX:x.x,clipY:x.y,clipWidth:y.width,clipHeight:y.height}:{};return{cursorPosition:t,brushX:t?t.x:g.width/2,brushY:t?t.y:g.height/2,radius:n/2,colorPickerOuterRadius:Kw/h,colorPickerInnerRadius:(Kw-w1+1)/h,maskColorString:Fl({...o,a:.5}),brushColorString:Fl(s),colorPickerColorString:Fl(r),tool:l,layer:i,shouldShowBrush:c,shouldDrawBrushPreview:!(p||m||!t)&&c,strokeWidth:1.5/h,dotRadius:1.5/h,clip:C}},{memoizeOptions:{resultEqualityCheck:Bt}}),Vve=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:l,layer:i,shouldDrawBrushPreview:c,dotRadius:p,strokeWidth:m,brushColorString:h,colorPickerColorString:g,colorPickerInnerRadius:x,colorPickerOuterRadius:y,clip:b}=W(Hve);return c?a.jsxs(Os,{listening:!1,...b,...t,children:[l==="colorPicker"?a.jsxs(a.Fragment,{children:[a.jsx(Il,{x:n,y:r,radius:y,stroke:h,strokeWidth:w1,strokeScaleEnabled:!1}),a.jsx(Il,{x:n,y:r,radius:x,stroke:g,strokeWidth:w1,strokeScaleEnabled:!1})]}):a.jsxs(a.Fragment,{children:[a.jsx(Il,{x:n,y:r,radius:o,fill:i==="mask"?s:h,globalCompositeOperation:l==="eraser"?"destination-out":"source-out"}),a.jsx(Il,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:m*2,strokeEnabled:!0,listening:!1}),a.jsx(Il,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:m,strokeEnabled:!0,listening:!1})]}),a.jsx(Il,{x:n,y:r,radius:p*2,fill:"rgba(255,255,255,0.4)",listening:!1}),a.jsx(Il,{x:n,y:r,radius:p,fill:"rgba(0,0,0,1)",listening:!1})]}):null},Wve=d.memo(Vve),Uve=ae([wn,Eo],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:l,isMovingBoundingBox:i,stageDimensions:c,stageCoordinates:p,tool:m,isMovingStage:h,shouldShowIntermediates:g,shouldShowGrid:x,shouldRestrictStrokesToBox:y,shouldAntialias:b}=e;let C="none";return m==="move"||t?h?C="grabbing":C="grab":s?C=void 0:y&&!l&&(C="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||i,shouldShowBoundingBox:o,shouldShowGrid:x,stageCoordinates:p,stageCursor:C,stageDimensions:c,stageScale:r,tool:m,isStaging:t,shouldShowIntermediates:g,shouldAntialias:b}},Ce),Gve=Se(B0e,{shouldForwardProp:e=>!["sx"].includes(e)}),Kve=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:l,stageScale:i,tool:c,isStaging:p,shouldShowIntermediates:m,shouldAntialias:h}=W(Uve);U0e();const g=te(),x=d.useRef(null),y=d.useRef(null),b=d.useRef(null),C=d.useCallback(z=>{S$(z),y.current=z},[]),S=d.useCallback(z=>{k$(z),b.current=z},[]),_=d.useRef({x:0,y:0}),j=d.useRef(!1),E=eve(y),I=K0e(y),M=Z0e(y,j),R=X0e(y,j,_),D=Q0e(),{handleDragStart:A,handleDragMove:O,handleDragEnd:$}=V0e(),X=d.useCallback(z=>z.evt.preventDefault(),[]);return d.useEffect(()=>{if(!x.current)return;const z=new ResizeObserver(G=>{for(const F of G)if(F.contentBoxSize){const{width:U,height:T}=F.contentRect;g(qw({width:U,height:T}))}});z.observe(x.current);const{width:V,height:Q}=x.current.getBoundingClientRect();return g(qw({width:V,height:Q})),()=>{z.disconnect()}},[g]),a.jsxs(N,{id:"canvas-container",ref:x,sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:[a.jsx(Ie,{sx:{position:"absolute"},children:a.jsxs(Gve,{tabIndex:-1,ref:C,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:l.width,height:l.height,scale:{x:i,y:i},onTouchStart:I,onTouchMove:R,onTouchEnd:M,onMouseDown:I,onMouseLeave:D,onMouseMove:R,onMouseUp:M,onDragStart:A,onDragMove:O,onDragEnd:$,onContextMenu:X,onWheel:E,draggable:(c==="move"||p)&&!t,children:[a.jsx(Au,{id:"grid",visible:r,children:a.jsx(ave,{})}),a.jsx(Au,{id:"base",ref:S,listening:!1,imageSmoothingEnabled:h,children:a.jsx(Sve,{})}),a.jsxs(Au,{id:"mask",visible:e&&!p,listening:!1,children:[a.jsx(hve,{visible:!0,listening:!1}),a.jsx(fve,{listening:!1})]}),a.jsx(Au,{children:a.jsx(rve,{})}),a.jsxs(Au,{id:"preview",imageSmoothingEnabled:h,children:[!p&&a.jsx(Wve,{visible:c!=="move",listening:!1}),a.jsx(jve,{visible:p}),m&&a.jsx(cve,{}),a.jsx(Bve,{visible:n&&!p})]})]})}),a.jsx(Lve,{}),a.jsx(Eve,{})]})},qve=d.memo(Kve);function Xve(e,t,n=250){const[r,o]=d.useState(0);return d.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 i1={width:6,height:6,borderColor:"base.100"},Qve={".react-colorful__hue-pointer":i1,".react-colorful__saturation-pointer":i1,".react-colorful__alpha-pointer":i1},Yve=e=>a.jsx(Ie,{sx:Qve,children:a.jsx(OO,{...e})}),$7=d.memo(Yve),Zve=ae([wn,Eo],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Fl(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Bt}}),Jve=()=>{const e=te(),{t}=Z(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:l}=W(Zve);nt(["q"],()=>{i()},{enabled:()=>!l,preventDefault:!0},[n]),nt(["shift+c"],()=>{c()},{enabled:()=>!l,preventDefault:!0},[]),nt(["h"],()=>{p()},{enabled:()=>!l,preventDefault:!0},[o]);const i=()=>{e(n5(n==="mask"?"base":"mask"))},c=()=>e(JI()),p=()=>e(vb(!o)),m=async()=>{e(I$())};return a.jsx(Yd,{triggerComponent:a.jsx(Ht,{children:a.jsx(Be,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:a.jsx(_M,{}),isChecked:n==="mask",isDisabled:l})}),children:a.jsxs(N,{direction:"column",gap:2,children:[a.jsx(br,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:p}),a.jsx(br,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:h=>e(_$(h.target.checked))}),a.jsx(Ie,{sx:{paddingTop:2,paddingBottom:2},children:a.jsx($7,{color:r,onChange:h=>e(j$(h))})}),a.jsx(ot,{size:"sm",leftIcon:a.jsx(fg,{}),onClick:m,children:"Save Mask"}),a.jsxs(ot,{size:"sm",leftIcon:a.jsx(Fr,{}),onClick:c,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},e1e=d.memo(Jve),t1e=ae([he,er],({canvas:e},t)=>{const{futureLayerStates:n}=e;return{canRedo:n.length>0,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Bt}});function n1e(){const e=te(),{canRedo:t,activeTabName:n}=W(t1e),{t:r}=Z(),o=()=>{e(P$())};return nt(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),a.jsx(Be,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:a.jsx(pee,{}),onClick:o,isDisabled:!t})}const r1e=()=>{const e=W(Eo),t=te(),{t:n}=Z();return a.jsxs(Eg,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(E$()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:a.jsx(ot,{size:"sm",leftIcon:a.jsx(Fr,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),a.jsx("br",{}),a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},o1e=d.memo(r1e),s1e=ae([wn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:l,shouldSnapToGrid:i,shouldRestrictStrokesToBox:c,shouldAntialias:p}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:l,shouldSnapToGrid:i,shouldRestrictStrokesToBox:c,shouldAntialias:p}},{memoizeOptions:{resultEqualityCheck:Bt}}),a1e=()=>{const e=te(),{t}=Z(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:l,shouldShowIntermediates:i,shouldSnapToGrid:c,shouldRestrictStrokesToBox:p,shouldAntialias:m}=W(s1e);nt(["n"],()=>{e(cm(!c))},{enabled:!0,preventDefault:!0},[c]);const h=g=>e(cm(g.target.checked));return a.jsx(Yd,{isLazy:!1,triggerComponent:a.jsx(Be,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(MM,{})}),children:a.jsxs(N,{direction:"column",gap:2,children:[a.jsx(br,{label:t("unifiedCanvas.showIntermediates"),isChecked:i,onChange:g=>e(M$(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.showGrid"),isChecked:l,onChange:g=>e(O$(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.snapToGrid"),isChecked:c,onChange:h}),a.jsx(br,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:g=>e(R$(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:g=>e(D$(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:g=>e(A$(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:g=>e(T$(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:g=>e($$(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.antialiasing"),isChecked:m,onChange:g=>e(N$(g.target.checked))}),a.jsx(o1e,{})]})})},l1e=d.memo(a1e),i1e=ae([he,Eo],({canvas:e},t)=>{const{tool:n,brushColor:r,brushSize:o}=e;return{tool:n,isStaging:t,brushColor:r,brushSize:o}},{memoizeOptions:{resultEqualityCheck:Bt}}),c1e=()=>{const e=te(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=W(i1e),{t:s}=Z();nt(["b"],()=>{l()},{enabled:()=>!o,preventDefault:!0},[]),nt(["e"],()=>{i()},{enabled:()=>!o,preventDefault:!0},[t]),nt(["c"],()=>{c()},{enabled:()=>!o,preventDefault:!0},[t]),nt(["shift+f"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),nt(["delete","backspace"],()=>{m()},{enabled:()=>!o,preventDefault:!0}),nt(["BracketLeft"],()=>{r-5<=5?e(tp(Math.max(r-1,1))):e(tp(Math.max(r-5,1)))},{enabled:()=>!o,preventDefault:!0},[r]),nt(["BracketRight"],()=>{e(tp(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),nt(["Shift+BracketLeft"],()=>{e(cv({...n,a:Bl(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),nt(["Shift+BracketRight"],()=>{e(cv({...n,a:Bl(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const l=()=>e(sc("brush")),i=()=>e(sc("eraser")),c=()=>e(sc("colorPicker")),p=()=>e(L$()),m=()=>e(z$());return a.jsxs(Ht,{isAttached:!0,children:[a.jsx(Be,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:a.jsx(cee,{}),isChecked:t==="brush"&&!o,onClick:l,isDisabled:o}),a.jsx(Be,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:a.jsx(XJ,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:i}),a.jsx(Be,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(tee,{}),isDisabled:o,onClick:p}),a.jsx(Be,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(Xa,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:m}),a.jsx(Be,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(ZJ,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:c}),a.jsx(Yd,{triggerComponent:a.jsx(Be,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:a.jsx(PM,{})}),children:a.jsxs(N,{minWidth:60,direction:"column",gap:4,width:"100%",children:[a.jsx(N,{gap:4,justifyContent:"space-between",children:a.jsx(Je,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:h=>e(tp(h)),sliderNumberInputProps:{max:500}})}),a.jsx(Ie,{sx:{width:"100%",paddingTop:2,paddingBottom:2},children:a.jsx($7,{color:n,onChange:h=>e(cv(h))})})]})})]})},u1e=d.memo(c1e),d1e=ae([he,er],({canvas:e},t)=>{const{pastLayerStates:n}=e;return{canUndo:n.length>0,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Bt}});function f1e(){const e=te(),{t}=Z(),{canUndo:n,activeTabName:r}=W(d1e),o=()=>{e(F$())};return nt(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),a.jsx(Be,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:a.jsx(pg,{}),onClick:o,isDisabled:!n})}const p1e=ae([he,Eo],({canvas:e},t)=>{const{tool:n,shouldCropToBoundingBoxOnSave:r,layer:o,isMaskEnabled:s}=e;return{isStaging:t,isMaskEnabled:s,tool:n,layer:o,shouldCropToBoundingBoxOnSave:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),m1e=()=>{const e=te(),{isStaging:t,isMaskEnabled:n,layer:r,tool:o}=W(p1e),s=C1(),{t:l}=Z(),{isClipboardAPIAvailable:i}=q8(),{getUploadButtonProps:c,getUploadInputProps:p}=Zy({postUploadAction:{type:"SET_CANVAS_INITIAL_IMAGE"}});nt(["v"],()=>{m()},{enabled:()=>!t,preventDefault:!0},[]),nt(["r"],()=>{g()},{enabled:()=>!0,preventDefault:!0},[s]),nt(["shift+m"],()=>{y()},{enabled:()=>!t,preventDefault:!0},[s]),nt(["shift+s"],()=>{b()},{enabled:()=>!t,preventDefault:!0},[s]),nt(["meta+c","ctrl+c"],()=>{C()},{enabled:()=>!t&&i,preventDefault:!0},[s,i]),nt(["shift+d"],()=>{S()},{enabled:()=>!t,preventDefault:!0},[s]);const m=()=>e(sc("move")),h=Xve(()=>g(!1),()=>g(!0)),g=(j=!1)=>{const E=C1();if(!E)return;const I=E.getClientRect({skipTransform:!0});e(H$({contentRect:I,shouldScaleTo1:j}))},x=()=>{e(dI())},y=()=>{e(V$())},b=()=>{e(W$())},C=()=>{i&&e(U$())},S=()=>{e(G$())},_=j=>{const E=j;e(n5(E)),E==="mask"&&!n&&e(vb(!0))};return a.jsxs(N,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[a.jsx(Ie,{w:24,children:a.jsx(On,{tooltip:`${l("unifiedCanvas.layer")} (Q)`,value:r,data:B$,onChange:_,disabled:t})}),a.jsx(e1e,{}),a.jsx(u1e,{}),a.jsxs(Ht,{isAttached:!0,children:[a.jsx(Be,{"aria-label":`${l("unifiedCanvas.move")} (V)`,tooltip:`${l("unifiedCanvas.move")} (V)`,icon:a.jsx(HJ,{}),isChecked:o==="move"||t,onClick:m}),a.jsx(Be,{"aria-label":`${l("unifiedCanvas.resetView")} (R)`,tooltip:`${l("unifiedCanvas.resetView")} (R)`,icon:a.jsx(GJ,{}),onClick:h})]}),a.jsxs(Ht,{isAttached:!0,children:[a.jsx(Be,{"aria-label":`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(aee,{}),onClick:y,isDisabled:t}),a.jsx(Be,{"aria-label":`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(fg,{}),onClick:b,isDisabled:t}),i&&a.jsx(Be,{"aria-label":`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(Uc,{}),onClick:C,isDisabled:t}),a.jsx(Be,{"aria-label":`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(Gc,{}),onClick:S,isDisabled:t})]}),a.jsxs(Ht,{isAttached:!0,children:[a.jsx(f1e,{}),a.jsx(n1e,{})]}),a.jsxs(Ht,{isAttached:!0,children:[a.jsx(Be,{"aria-label":`${l("common.upload")}`,tooltip:`${l("common.upload")}`,icon:a.jsx(mg,{}),isDisabled:t,...c()}),a.jsx("input",{...p()}),a.jsx(Be,{"aria-label":`${l("unifiedCanvas.clearCanvas")}`,tooltip:`${l("unifiedCanvas.clearCanvas")}`,icon:a.jsx(Fr,{}),onClick:x,colorScheme:"error",isDisabled:t})]}),a.jsx(Ht,{isAttached:!0,children:a.jsx(l1e,{})})]})},h1e=d.memo(m1e),Gj={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},g1e=()=>{const{isOver:e,setNodeRef:t,active:n}=u8({id:"unifiedCanvas",data:Gj});return a.jsxs(N,{layerStyle:"first",ref:t,tabIndex:-1,sx:{flexDirection:"column",alignItems:"center",gap:4,p:2,borderRadius:"base",w:"full",h:"full"},children:[a.jsx(h1e,{}),a.jsx(qve,{}),d8(Gj,n)&&a.jsx(f8,{isOver:e,label:"Set Canvas Initial Image"})]})},v1e=d.memo(g1e),x1e=()=>a.jsx(v1e,{}),b1e=d.memo(x1e),y1e=[{id:"txt2img",translationKey:"common.txt2img",icon:a.jsx(Tn,{as:nee,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Nge,{})},{id:"img2img",translationKey:"common.img2img",icon:a.jsx(Tn,{as:Yl,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Xfe,{})},{id:"unifiedCanvas",translationKey:"common.unifiedCanvas",icon:a.jsx(Tn,{as:$oe,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(b1e,{})},{id:"nodes",translationKey:"common.nodes",icon:a.jsx(Tn,{as:Jy,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Ghe,{})},{id:"modelManager",translationKey:"modelManager.modelManager",icon:a.jsx(Tn,{as:KJ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Kpe,{})},{id:"queue",translationKey:"queue.queue",icon:a.jsx(Tn,{as:vee,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Tge,{})}],C1e=ae([he],({config:e})=>{const{disabledTabs:t}=e;return y1e.filter(r=>!t.includes(r.id))},{memoizeOptions:{resultEqualityCheck:Bt}}),w1e=448,S1e=448,k1e=360,_1e=["modelManager","queue"],j1e=["modelManager","queue"],I1e=()=>{const e=W(K$),t=W(er),n=W(C1e),{t:r}=Z(),o=te(),s=d.useCallback(O=>{O.target instanceof HTMLElement&&O.target.blur()},[]),l=d.useMemo(()=>n.map(O=>a.jsx(Vt,{hasArrow:!0,label:String(r(O.translationKey)),placement:"end",children:a.jsxs(yr,{onClick:s,children:[a.jsx(b5,{children:String(r(O.translationKey))}),O.icon]})},O.id)),[n,r,s]),i=d.useMemo(()=>n.map(O=>a.jsx(Qr,{children:O.content},O.id)),[n]),c=d.useCallback(O=>{const $=n[O];$&&o(Qs($.id))},[o,n]),{minSize:p,isCollapsed:m,setIsCollapsed:h,ref:g,reset:x,expand:y,collapse:b,toggle:C}=rj(w1e,"pixels"),{ref:S,minSize:_,isCollapsed:j,setIsCollapsed:E,reset:I,expand:M,collapse:R,toggle:D}=rj(k1e,"pixels");nt("f",()=>{j||m?(M(),y()):(b(),R())},[o,j,m]),nt(["t","o"],()=>{C()},[o]),nt("g",()=>{D()},[o]);const A=i2();return a.jsxs(ri,{variant:"appTabs",defaultIndex:e,index:e,onChange:c,sx:{flexGrow:1,gap:4},isLazy:!0,children:[a.jsxs(oi,{sx:{pt:2,gap:4,flexDir:"column"},children:[l,a.jsx(ba,{})]}),a.jsxs(Rg,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},storage:A,units:"pixels",children:[!j1e.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(Ya,{order:0,id:"side",ref:g,defaultSize:p,minSize:p,onCollapse:h,collapsible:!0,children:t==="nodes"?a.jsx($le,{}):a.jsx(xfe,{})}),a.jsx(hh,{onDoubleClick:x,collapsedDirection:m?"left":void 0}),a.jsx(Fle,{isSidePanelCollapsed:m,sidePanelRef:g})]}),a.jsx(Ya,{id:"main",order:1,minSize:S1e,children:a.jsx(Hc,{style:{height:"100%",width:"100%"},children:i})}),!_1e.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(hh,{onDoubleClick:I,collapsedDirection:j?"right":void 0}),a.jsx(Ya,{id:"gallery",ref:S,order:2,defaultSize:_,minSize:_,onCollapse:E,collapsible:!0,children:a.jsx(fse,{})}),a.jsx(Lle,{isGalleryCollapsed:j,galleryPanelRef:S})]})]})]})},P1e=d.memo(I1e),E1e=d.createContext(null),c1={didCatch:!1,error:null};class M1e extends d.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=c1}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:s,reason:"imperative-api"}),this.setState(c1)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&O1e(t.resetKeys,o)){var s,l;(s=(l=this.props).onReset)===null||s===void 0||s.call(l,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(c1)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:s,error:l}=this.state;let i=t;if(s){const c={error:l,resetErrorBoundary:this.resetErrorBoundary};if(d.isValidElement(o))i=o;else if(typeof n=="function")i=n(c);else if(r)i=d.createElement(r,c);else throw l}return d.createElement(E1e.Provider,{value:{didCatch:s,error:l,resetErrorBoundary:this.resetErrorBoundary}},i)}}function O1e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function R1e(e={}){let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");const n=new URL(`${t}/issues/new`),r=["body","title","labels","template","milestone","assignee","projects"];for(const o of r){let s=e[o];if(s!==void 0){if(o==="labels"||o==="projects"){if(!Array.isArray(s))throw new TypeError(`The \`${o}\` option should be an array`);s=s.join(",")}n.searchParams.set(o,s)}}return n.toString()}const D1e=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(Boolean).map(e=>[e.name,e]),A1e=new Map(D1e),T1e=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],Bx=new WeakSet,$1e=e=>{Bx.add(e);const t=e.toJSON();return Bx.delete(e),t},N1e=e=>A1e.get(e)??Error,N7=({from:e,seen:t,to:n,forceEnumerable:r,maxDepth:o,depth:s,useToJSON:l,serialize:i})=>{if(!n)if(Array.isArray(e))n=[];else if(!i&&Kj(e)){const p=N1e(e.name);n=new p}else n={};if(t.push(e),s>=o)return n;if(l&&typeof e.toJSON=="function"&&!Bx.has(e))return $1e(e);const c=p=>N7({from:p,seen:[...t],forceEnumerable:r,maxDepth:o,depth:s,useToJSON:l,serialize:i});for(const[p,m]of Object.entries(e)){if(typeof Buffer=="function"&&Buffer.isBuffer(m)){n[p]="[object Buffer]";continue}if(m!==null&&typeof m=="object"&&typeof m.pipe=="function"){n[p]="[object Stream]";continue}if(typeof m!="function"){if(!m||typeof m!="object"){n[p]=m;continue}if(!t.includes(e[p])){s++,n[p]=c(e[p]);continue}n[p]="[Circular]"}}for(const{property:p,enumerable:m}of T1e)typeof e[p]<"u"&&e[p]!==null&&Object.defineProperty(n,p,{value:Kj(e[p])?c(e[p]):e[p],enumerable:r?!0:m,configurable:!0,writable:!0});return n};function L1e(e,t={}){const{maxDepth:n=Number.POSITIVE_INFINITY,useToJSON:r=!0}=t;return typeof e=="object"&&e!==null?N7({from:e,seen:[],forceEnumerable:!0,maxDepth:n,depth:0,useToJSON:r,serialize:!0}):typeof e=="function"?`[Function: ${e.name??"anonymous"}]`:e}function Kj(e){return!!e&&typeof e=="object"&&"name"in e&&"message"in e&&"stack"in e}const z1e=({error:e,resetErrorBoundary:t})=>{const n=d5(),r=d.useCallback(()=>{const s=JSON.stringify(L1e(e),null,2);navigator.clipboard.writeText(`\`\`\`
|
||
${s}
|
||
\`\`\``),n({title:"Error Copied"})},[e,n]),o=d.useMemo(()=>R1e({user:"invoke-ai",repo:"InvokeAI",template:"BUG_REPORT.yml",title:`[bug]: ${e.name}: ${e.message}`}),[e.message,e.name]);return a.jsx(N,{layerStyle:"body",sx:{w:"100vw",h:"100vh",alignItems:"center",justifyContent:"center",p:4},children:a.jsxs(N,{layerStyle:"first",sx:{flexDir:"column",borderRadius:"base",justifyContent:"center",gap:8,p:16},children:[a.jsx(ur,{children:"Something went wrong"}),a.jsx(N,{layerStyle:"second",sx:{px:8,py:4,borderRadius:"base",gap:4,justifyContent:"space-between",alignItems:"center"},children:a.jsxs(be,{sx:{fontWeight:600,color:"error.500",_dark:{color:"error.400"}},children:[e.name,": ",e.message]})}),a.jsxs(N,{sx:{gap:4},children:[a.jsx(ot,{leftIcon:a.jsx(Eoe,{}),onClick:t,children:"Reset UI"}),a.jsx(ot,{leftIcon:a.jsx(Uc,{}),onClick:r,children:"Copy Error"}),a.jsx(Nh,{href:o,isExternal:!0,children:a.jsx(ot,{leftIcon:a.jsx(wy,{}),children:"Create Issue"})})]})]})})},F1e=d.memo(z1e),B1e=ae([he],({hotkeys:e})=>{const{shift:t,ctrl:n,meta:r}=e;return{shift:t,ctrl:n,meta:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),H1e=()=>{const e=te(),{shift:t,ctrl:n,meta:r}=W(B1e),{queueBack:o,isDisabled:s,isLoading:l}=eO();nt(["ctrl+enter","meta+enter"],o,{enabled:()=>!s&&!l,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,s,l]);const{queueFront:i,isDisabled:c,isLoading:p}=oO();return nt(["ctrl+shift+enter","meta+shift+enter"],i,{enabled:()=>!c&&!p,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,c,p]),nt("*",()=>{Gp("shift")?!t&&e(Nr(!0)):t&&e(Nr(!1)),Gp("ctrl")?!n&&e(Xw(!0)):n&&e(Xw(!1)),Gp("meta")?!r&&e(Qw(!0)):r&&e(Qw(!1))},{keyup:!0,keydown:!0},[t,n,r]),nt("1",()=>{e(Qs("txt2img"))}),nt("2",()=>{e(Qs("img2img"))}),nt("3",()=>{e(Qs("unifiedCanvas"))}),nt("4",()=>{e(Qs("nodes"))}),nt("5",()=>{e(Qs("modelManager"))}),null},V1e=d.memo(H1e),W1e=e=>{const t=te(),{recallAllParameters:n}=Pg(),r=si(),{currentData:o}=wo((e==null?void 0:e.imageName)??eo.skipToken),{currentData:s}=q$((e==null?void 0:e.imageName)??eo.skipToken),l=d.useCallback(()=>{o&&(t(SI(o)),t(Qs("unifiedCanvas")),r({title:mI("toast.sentToUnifiedCanvas"),status:"info",duration:2500,isClosable:!0}))},[t,r,o]),i=d.useCallback(()=>{o&&t(Sh(o))},[t,o]),c=d.useCallback(()=>{s&&n(s.metadata)},[s]);return d.useEffect(()=>{e&&e.action==="sendToCanvas"&&l()},[e,l]),d.useEffect(()=>{e&&e.action==="sendToImg2Img"&&i()},[e,i]),d.useEffect(()=>{e&&e.action==="useAllParameters"&&c()},[e,c]),{handleSendToCanvas:l,handleSendToImg2Img:i,handleUseAllMetadata:c}},U1e=e=>(W1e(e.selectedImage),null),G1e=d.memo(U1e),K1e={},q1e=({config:e=K1e,selectedImage:t})=>{const n=W(DM),r=SP("system"),o=te(),s=d.useCallback(()=>(localStorage.clear(),location.reload(),!1),[]);d.useEffect(()=>{bt.changeLanguage(n)},[n]),d.useEffect(()=>{TI(e)&&(r.info({config:e},"Received config"),o(X$(e)))},[o,e,r]),d.useEffect(()=>{o(Q$())},[o]);const l=og(Y$);return a.jsxs(M1e,{onReset:s,FallbackComponent:F1e,children:[a.jsx(el,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:a.jsx(gG,{children:a.jsxs(el,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[l||a.jsx(Uee,{}),a.jsx(N,{sx:{gap:4,w:"full",h:"full"},children:a.jsx(P1e,{})})]})})}),a.jsx(RJ,{}),a.jsx(PJ,{}),a.jsx(sU,{}),a.jsx(V1e,{}),a.jsx(G1e,{selectedImage:t})]})},exe=d.memo(q1e);export{exe as default};
|