mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
170 lines
906 KiB
JavaScript
170 lines
906 KiB
JavaScript
var V0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Se=(e,t,n)=>(V0(e,t,"read from private field"),n?n.call(e):t.get(e)),en=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},eo=(e,t,n,r)=>(V0(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var vu=(e,t,n,r)=>({set _(o){eo(e,t,o,n)},get _(){return Se(e,t,r)}}),os=(e,t,n)=>(V0(e,t,"access private method"),n);import{a as gd,b as Cj,S as wj,c as Sj,d as kj,e as Jv,f as _j,i as e1,g as u7,k as d7,h as RC,j as jj,t as f7,l as p7,m as h7,n as m7,o as g7,p as v7,q as x7,r as W0,s as b7,u as d,v as a,w as Dx,x as Bp,y as y7,z as C7,A as w7,B as S7,P as k7,C as Rx,D as _7,E as j7,F as P7,G as I7,H as Pj,I as Pe,J as E7,K as _e,L as et,M as Fe,N as vd,O as nr,Q as vn,R as Hn,T as Yt,U as Ki,V as Qa,W as at,X as co,Y as Yl,Z as aa,_ as cm,$ as Ax,a0 as Dc,a1 as rn,a2 as M7,a3 as H,a4 as AC,a5 as O7,a6 as Ij,a7 as t1,a8 as xd,a9 as D7,aa as Ej,ab as Mj,ac as ds,ad as R7,ae as ie,af as we,ag as _t,ah as F,ai as A7,aj as NC,ak as N7,al as T7,am as $7,an as qi,ao as ee,ap as L7,aq as Tt,ar as Ft,as as Ie,at as $,au as so,av as be,aw as wn,ax as Oj,ay as z7,az as F7,aA as B7,aB as H7,aC as Lr,aD as Nx,aE as ia,aF as Ir,aG as um,aH as V7,aI as W7,aJ as TC,aK as Tx,aL as ye,aM as Ro,aN as U7,aO as Dj,aP as Rj,aQ as $C,aR as G7,aS as K7,aT as q7,aU as Xi,aV as Aj,aW as vt,aX as X7,aY as Y7,aZ as Q7,a_ as Nj,a$ as rr,b0 as dm,b1 as Z7,b2 as LC,b3 as Tj,b4 as J7,b5 as eD,b6 as tD,b7 as nD,b8 as rD,b9 as oD,ba as sD,bb as aD,bc as $j,bd as iD,be as lD,bf as cD,bg as uD,bh as dD,bi as Fr,bj as fD,bk as pD,bl as hD,bm as zC,bn as mD,bo as gD,bp as Fa,bq as fm,br as Lj,bs as zj,bt as po,bu as Fj,bv as vD,bw as Ri,bx as Eu,by as FC,bz as xD,bA as bD,bB as yD,bC as Hf,bD as Vf,bE as xu,bF as U0,bG as $u,bH as Lu,bI as zu,bJ as Fu,bK as BC,bL as Hp,bM as G0,bN as Vp,bO as HC,bP as n1,bQ as K0,bR as r1,bS as q0,bT as Wp,bU as VC,bV as Ai,bW as WC,bX as Ni,bY as UC,bZ as Up,b_ as pm,b$ as CD,c0 as Bj,c1 as o1,c2 as s1,c3 as Hj,c4 as wD,c5 as a1,c6 as SD,c7 as i1,c8 as kD,c9 as l1,ca as $x,cb as Lx,cc as zx,cd as Fx,ce as Bx,cf as hm,cg as Hx,ch as Ra,ci as Vj,cj as Wj,ck as Vx,cl as Uj,cm as _D,cn as bu,co as Ti,cp as Gj,cq as Kj,cr as GC,cs as jD,ct as PD,cu as ID,cv as Cn,cw as ED,cx as Tn,cy as bd,cz as mm,cA as MD,cB as OD,cC as DD,cD as RD,cE as AD,cF as ND,cG as TD,cH as $D,cI as LD,cJ as zD,cK as KC,cL as Wx,cM as FD,cN as BD,cO as yd,cP as HD,cQ as VD,cR as gm,cS as WD,cT as UD,cU as GD,cV as Ux,cW as KD,cX as dn,cY as qD,cZ as XD,c_ as YD,c$ as vm,d0 as QD,d1 as ZD,d2 as JD,d3 as Xu,d4 as qC,d5 as Bo,d6 as qj,d7 as eR,d8 as Gx,d9 as tR,da as XC,db as nR,dc as rR,dd as oR,de as Xj,df as sR,dg as aR,dh as iR,di as lR,dj as Yj,dk as cR,dl as uR,dm as dR,dn as fR,dp as pR,dq as hR,dr as mR,ds as gR,dt as Qj,du as Zj,dv as vR,dw as xR,dx as bR,dy as yR,dz as CR,dA as Ao,dB as wR,dC as go,dD as SR,dE as kR,dF as _R,dG as jR,dH as PR,dI as IR,dJ as ER,dK as MR,dL as OR,dM as DR,dN as RR,dO as AR,dP as NR,dQ as TR,dR as $R,dS as LR,dT as YC,dU as zR,dV as QC,dW as FR,dX as BR,dY as HR,dZ as VR,d_ as WR,d$ as UR,e0 as ZC,e1 as JC,e2 as ew,e3 as Kx,e4 as GR,e5 as Mo,e6 as Yu,e7 as fr,e8 as KR,e9 as qR,ea as Jj,eb as e5,ec as XR,ed as tw,ee as YR,ef as nw,eg as rw,eh as ow,ei as QR,ej as ZR,ek as sw,el as aw,em as JR,en as eA,eo as Gp,ep as tA,eq as iw,er as Wf,es as lw,et as cw,eu as nA,ev as rA,ew as oA,ex as t5,ey as sA,ez as aA,eA as uw,eB as iA,eC as dw,eD as lA,eE as n5,eF as r5,eG as Cd,eH as o5,eI as Ci,eJ as s5,eK as fw,eL as cA,eM as uA,eN as a5,eO as dA,eP as fA,eQ as pA,eR as hA,eS as mA,eT as qx,eU as c1,eV as pw,eW as Yi,eX as gA,eY as vA,eZ as i5,e_ as Us,e$ as Gs,f0 as l5,f1 as c5,f2 as Xx,f3 as u5,f4 as xA,f5 as Ks,f6 as bA,f7 as d5,f8 as yA,f9 as CA,fa as wA,fb as SA,fc as kA,fd as _A,fe as jA,ff as Kp,fg as Mu,fh as Vl,fi as PA,fj as IA,fk as EA,fl as MA,fm as OA,fn as DA,fo as RA,fp as AA,fq as NA,fr as TA,fs as $A,ft as LA,fu as zA,fv as FA,fw as BA,fx as HA,fy as VA,fz as WA,fA as UA,fB as GA,fC as hw,fD as KA,fE as qA,fF as XA,fG as YA,fH as QA,fI as ZA,fJ as JA,fK as e9,fL as t9,fM as n9,fN as r9,fO as o9,fP as s9,fQ as a9,fR as mw,fS as Ip,fT as i9,fU as qp,fV as f5,fW as Xp,fX as l9,fY as c9,fZ as Ql,f_ as p5,f$ as h5,g0 as Yx,g1 as u9,g2 as d9,g3 as f9,g4 as u1,g5 as m5,g6 as p9,g7 as h9,g8 as g5,g9 as m9,ga as g9,gb as v9,gc as x9,gd as b9,ge as Sl,gf as y9,gg as C9,gh as w9,gi as S9,gj as k9,gk as _9,gl as gw,gm as j9,gn as P9,go as I9,gp as E9,gq as M9,gr as O9,gs as D9,gt as R9,gu as X0,gv as Y0,gw as Q0,gx as Uf,gy as vw,gz as d1,gA as xw,gB as A9,gC as N9,gD as T9,gE as $9,gF as v5,gG as L9,gH as z9,gI as F9,gJ as B9,gK as H9,gL as V9,gM as W9,gN as U9,gO as G9,gP as K9,gQ as q9,gR as Gf,gS as Z0,gT as X9,gU as Y9,gV as Q9,gW as Z9,gX as J9,gY as eN,gZ as tN,g_ as nN,g$ as rN,h0 as oN,h1 as sN,h2 as aN,h3 as iN,h4 as lN,h5 as bw,h6 as yw,h7 as cN,h8 as uN,h9 as dN}from"./index-cd3a0781.js";import{I as An,u as fN,c as pN,a as $t,b as nn,d as la,P as wd,C as hN,e as J,f as x5,g as ca,h as mN,r as Oe,i as gN,j as Cw,k as ut,l as Sn,m as gc}from"./menu-5f867375.js";var vN=200;function xN(e,t,n,r){var o=-1,s=Sj,i=!0,l=e.length,u=[],p=t.length;if(!l)return u;n&&(t=gd(t,Cj(n))),r?(s=kj,i=!1):t.length>=vN&&(s=Jv,i=!1,t=new wj(t));e:for(;++o<l;){var h=e[o],m=n==null?h:n(h);if(h=r||h!==0?h:0,i&&m===m){for(var v=p;v--;)if(t[v]===m)continue e;u.push(h)}else s(t,m,r)||u.push(h)}return u}var bN=_j(function(e,t){return e1(e)?xN(e,u7(t,1,e1,!0)):[]});const yN=bN;function CN(e,t){return gd(t,function(n){return e[n]})}function wN(e){return e==null?[]:CN(e,d7(e))}var SN=Math.min;function kN(e,t,n){for(var r=n?kj:Sj,o=e[0].length,s=e.length,i=s,l=Array(s),u=1/0,p=[];i--;){var h=e[i];i&&t&&(h=gd(h,Cj(t))),u=SN(h.length,u),l[i]=!n&&(t||o>=120&&h.length>=120)?new wj(i&&h):void 0}h=e[0];var m=-1,v=l[0];e:for(;++m<o&&p.length<u;){var x=h[m],y=t?t(x):x;if(x=n||x!==0?x:0,!(v?Jv(v,y):r(p,y,n))){for(i=s;--i;){var b=l[i];if(!(b?Jv(b,y):r(e[i],y,n)))continue e}v&&v.push(y),p.push(x)}}return p}function _N(e){return e1(e)?e:[]}var jN=_j(function(e){var t=gd(e,_N);return t.length&&t[0]===e[0]?kN(t):[]});const PN=jN;function IN(e,t,n,r){if(!RC(e))return e;t=jj(t,e);for(var o=-1,s=t.length,i=s-1,l=e;l!=null&&++o<s;){var u=f7(t[o]),p=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(o!=i){var h=l[u];p=r?r(h,u,l):void 0,p===void 0&&(p=RC(h)?h:p7(t[o+1])?[]:{})}h7(l,u,p),l=l[u]}return e}function EN(e,t,n){for(var r=-1,o=t.length,s={};++r<o;){var i=t[r],l=m7(e,i);n(l,i)&&IN(s,jj(i,e),l)}return s}function ww(e,t){if(e==null)return{};var n=gd(g7(e),function(r){return[r]});return t=v7(t),EN(e,n,function(r,o){return t(r,o[0])})}var MN=Math.ceil,ON=Math.max;function DN(e,t,n,r){for(var o=-1,s=ON(MN((t-e)/(n||1)),0),i=Array(s);s--;)i[r?s:++o]=e,e+=n;return i}function RN(e){return function(t,n,r){return r&&typeof r!="number"&&x7(t,n,r)&&(n=r=void 0),t=W0(t),n===void 0?(n=t,t=0):n=W0(n),r=r===void 0?t<n?1:-1:W0(r),DN(t,n,r,e)}}var AN=RN();const Sw=AN;function kw(e){return e&&e.length?b7(e):[]}function NN(e,t,n){let r=new Set([...t,void 0]);return e.listen((o,s)=>{r.has(s)&&n(o,s)})}function TN(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}const b5=({id:e,x:t,y:n,width:r,height:o,style:s,color:i,strokeColor:l,strokeWidth:u,className:p,borderRadius:h,shapeRendering:m,onClick:v,selected:x})=>{const{background:y,backgroundColor:b}=s||{},w=i||y||b;return a.jsx("rect",{className:Dx(["react-flow__minimap-node",{selected:x},p]),x:t,y:n,rx:h,ry:h,width:r,height:o,fill:w,stroke:l,strokeWidth:u,shapeRendering:m,onClick:v?k=>v(k,e):void 0})};b5.displayName="MiniMapNode";var $N=d.memo(b5);const LN=e=>e.nodeOrigin,zN=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),J0=e=>e instanceof Function?e:()=>e;function FN({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=$N,onClick:i}){const l=Bp(zN,Rx),u=Bp(LN),p=J0(t),h=J0(e),m=J0(n),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(x=>{const{x:y,y:b}=y7(x,u).positionAbsolute;return a.jsx(s,{x:y,y:b,width:x.width,height:x.height,style:x.style,selected:x.selected,className:m(x),color:p(x),borderRadius:r,strokeColor:h(x),strokeWidth:o,shapeRendering:v,onClick:i,id:x.id},x.id)})})}var BN=d.memo(FN);const HN=200,VN=150,WN=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?P7(I7(t,e.nodeOrigin),n):n,rfId:e.rfId}},UN="react-flow__minimap-desc";function y5({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:i=2,nodeComponent:l,maskColor:u="rgb(240, 240, 240, 0.6)",maskStrokeColor:p="none",maskStrokeWidth:h=1,position:m="bottom-right",onClick:v,onNodeClick:x,pannable:y=!1,zoomable:b=!1,ariaLabel:w="React Flow mini map",inversePan:k=!1,zoomStep:_=10,offsetScale:j=5}){const I=C7(),M=d.useRef(null),{boundingRect:E,viewBB:O,rfId:D}=Bp(WN,Rx),A=(e==null?void 0:e.width)??HN,R=(e==null?void 0:e.height)??VN,T=E.width/A,X=E.height/R,B=Math.max(T,X),U=B*A,Y=B*R,V=j*B,L=E.x-(U-E.width)/2-V,q=E.y-(Y-E.height)/2-V,z=U+V*2,K=Y+V*2,re=`${UN}-${D}`,Q=d.useRef(0);Q.current=B,d.useEffect(()=>{if(M.current){const W=w7(M.current),G=oe=>{const{transform:pe,d3Selection:fe,d3Zoom:ge}=I.getState();if(oe.sourceEvent.type!=="wheel"||!fe||!ge)return;const Ce=-oe.sourceEvent.deltaY*(oe.sourceEvent.deltaMode===1?.05:oe.sourceEvent.deltaMode?1:.002)*_,me=pe[2]*Math.pow(2,Ce);ge.scaleTo(fe,me)},te=oe=>{const{transform:pe,d3Selection:fe,d3Zoom:ge,translateExtent:Ce,width:me,height:de}=I.getState();if(oe.sourceEvent.type!=="mousemove"||!fe||!ge)return;const De=Q.current*Math.max(1,pe[2])*(k?-1:1),je={x:pe[0]-oe.sourceEvent.movementX*De,y:pe[1]-oe.sourceEvent.movementY*De},Be=[[0,0],[me,de]],rt=_7.translate(je.x,je.y).scale(pe[2]),Ue=ge.constrain()(rt,Be,Ce);ge.transform(fe,Ue)},ae=S7().on("zoom",y?te:null).on("zoom.wheel",b?G:null);return W.call(ae),()=>{W.on("zoom",null)}}},[y,b,k,_]);const le=v?W=>{const G=j7(W);v(W,{x:G[0],y:G[1]})}:void 0,se=x?(W,G)=>{const te=I.getState().nodeInternals.get(G);x(W,te)}:void 0;return a.jsx(k7,{position:m,style:e,className:Dx(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:A,height:R,viewBox:`${L} ${q} ${z} ${K}`,role:"img","aria-labelledby":re,ref:M,onClick:le,children:[w&&a.jsx("title",{id:re,children:w}),a.jsx(BN,{onClick:se,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${L-V},${q-V}h${z+V*2}v${K+V*2}h${-z-V*2}z
|
||
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fill:u,fillRule:"evenodd",stroke:p,strokeWidth:h,pointerEvents:"none"})]})})}y5.displayName="MiniMap";var GN=d.memo(y5),To;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(To||(To={}));function KN({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 qN({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const XN={[To.Dots]:"#91919a",[To.Lines]:"#eee",[To.Cross]:"#e2e2e2"},YN={[To.Dots]:1,[To.Lines]:1,[To.Cross]:6},QN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function C5({id:e,variant:t=To.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:l,className:u}){const p=d.useRef(null),{transform:h,patternId:m}=Bp(QN,Rx),v=i||XN[t],x=r||YN[t],y=t===To.Dots,b=t===To.Cross,w=Array.isArray(n)?n:[n,n],k=[w[0]*h[2]||1,w[1]*h[2]||1],_=x*h[2],j=b?[_,_]:k,I=y?[_/s,_/s]:[j[0]/s,j[1]/s];return a.jsxs("svg",{className:Dx(["react-flow__background",u]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background",children:[a.jsx("pattern",{id:m+e,x:h[0]%k[0],y:h[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${I[0]},-${I[1]})`,children:y?a.jsx(qN,{color:v,radius:_/s}):a.jsx(KN,{dimensions:j,color:v,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`})]})}C5.displayName="Background";var ZN=d.memo(C5);const _w=(e,t,n)=>{JN(n);const r=Pj(e,t);return w5[n].includes(r)},w5={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},jw=Object.keys(w5),JN=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(jw.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${jw.join("|")}`)};function eT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var tT=eT();const S5=1/60*1e3,nT=typeof performance<"u"?()=>performance.now():()=>Date.now(),k5=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(nT()),S5);function rT(e){let t=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,l={schedule:(u,p=!1,h=!1)=>{const m=h&&o,v=m?t:n;return p&&i.add(u),v.indexOf(u)===-1&&(v.push(u),m&&o&&(r=t.length)),u},cancel:u=>{const p=n.indexOf(u);p!==-1&&n.splice(p,1),i.delete(u)},process:u=>{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 h=t[p];h(u),i.has(h)&&(l.schedule(h),e())}o=!1,s&&(s=!1,l.process(u))}};return l}const oT=40;let f1=!0,Qu=!1,p1=!1;const Zl={delta:0,timestamp:0},Sd=["read","update","preRender","render","postRender"],xm=Sd.reduce((e,t)=>(e[t]=rT(()=>Qu=!0),e),{}),sT=Sd.reduce((e,t)=>{const n=xm[t];return e[t]=(r,o=!1,s=!1)=>(Qu||lT(),n.schedule(r,o,s)),e},{}),aT=Sd.reduce((e,t)=>(e[t]=xm[t].cancel,e),{});Sd.reduce((e,t)=>(e[t]=()=>xm[t].process(Zl),e),{});const iT=e=>xm[e].process(Zl),_5=e=>{Qu=!1,Zl.delta=f1?S5:Math.max(Math.min(e-Zl.timestamp,oT),1),Zl.timestamp=e,p1=!0,Sd.forEach(iT),p1=!1,Qu&&(f1=!1,k5(_5))},lT=()=>{Qu=!0,f1=!0,p1||k5(_5)},Pw=()=>Zl;function kd(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=d.Children.toArray(e.path),i=Pe((l,u)=>a.jsx(An,{ref:u,viewBox:t,...o,...l,children:s.length?s:a.jsx("path",{fill:"currentColor",d:n})}));return i.displayName=r,i}function j5(e){const{theme:t}=E7(),n=fN();return d.useMemo(()=>pN(t.direction,{...n,...e}),[e,t.direction,n])}var cT=Object.defineProperty,uT=(e,t,n)=>t in e?cT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hn=(e,t,n)=>(uT(e,typeof t!="symbol"?t+"":t,n),n);function Iw(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 dT=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function Ew(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function Mw(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var h1=typeof window<"u"?d.useLayoutEffect:d.useEffect,Yp=e=>e,fT=class{constructor(){hn(this,"descendants",new Map),hn(this,"register",e=>{if(e!=null)return dT(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),hn(this,"unregister",e=>{this.descendants.delete(e);const t=Iw(Array.from(this.descendants.keys()));this.assignIndex(t)}),hn(this,"destroy",()=>{this.descendants.clear()}),hn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),hn(this,"count",()=>this.descendants.size),hn(this,"enabledCount",()=>this.enabledValues().length),hn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),hn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),hn(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),hn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),hn(this,"first",()=>this.item(0)),hn(this,"firstEnabled",()=>this.enabledItem(0)),hn(this,"last",()=>this.item(this.descendants.size-1)),hn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),hn(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),hn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),hn(this,"next",(e,t=!0)=>{const n=Ew(e,this.count(),t);return this.item(n)}),hn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Ew(r,this.enabledCount(),t);return this.enabledItem(o)}),hn(this,"prev",(e,t=!0)=>{const n=Mw(e,this.count()-1,t);return this.item(n)}),hn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Mw(r,this.enabledCount()-1,t);return this.enabledItem(o)}),hn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=Iw(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 pT(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 Ct(...e){return t=>{e.forEach(n=>{pT(n,t)})}}function hT(...e){return d.useMemo(()=>Ct(...e),e)}function mT(){const e=d.useRef(new fT);return h1(()=>()=>e.current.destroy()),e.current}var[gT,P5]=$t({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function vT(e){const t=P5(),[n,r]=d.useState(-1),o=d.useRef(null);h1(()=>()=>{o.current&&t.unregister(o.current)},[]),h1(()=>{if(!o.current)return;const i=Number(o.current.dataset.index);n!=i&&!Number.isNaN(i)&&r(i)});const s=Yp(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:Ct(s,o)}}function Qx(){return[Yp(gT),()=>Yp(P5()),()=>mT(),o=>vT(o)]}var[xT,bm]=$t({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[bT,Zx]=$t({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[yT,r0e,CT,wT]=Qx(),Al=Pe(function(t,n){const{getButtonProps:r}=Zx(),o=r(t,n),i={display:"flex",alignItems:"center",width:"100%",outline:0,...bm().button};return a.jsx(_e.button,{...o,className:et("chakra-accordion__button",t.className),__css:i})});Al.displayName="AccordionButton";function Rc(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(v,x)=>v!==x}=e,s=nn(r),i=nn(o),[l,u]=d.useState(n),p=t!==void 0,h=p?t:l,m=nn(v=>{const y=typeof v=="function"?v(h):v;i(h,y)&&(p||u(y),s(y))},[p,s,h,i]);return[h,m]}function ST(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...i}=e;jT(e),PT(e);const l=CT(),[u,p]=d.useState(-1);d.useEffect(()=>()=>{p(-1)},[]);const[h,m]=Rc({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:h,setIndex:m,htmlProps:i,getAccordionItemProps:x=>{let y=!1;return x!==null&&(y=Array.isArray(h)?h.includes(x):h===x),{isOpen:y,onChange:w=>{if(x!==null)if(o&&Array.isArray(h)){const k=w?h.concat(x):h.filter(_=>_!==x);m(k)}else w?m(x):s&&m(-1)}}},focusedIndex:u,setFocusedIndex:p,descendants:l}}var[kT,Jx]=$t({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function _T(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:i}=Jx(),l=d.useRef(null),u=d.useId(),p=r??u,h=`accordion-button-${p}`,m=`accordion-panel-${p}`;IT(e);const{register:v,index:x,descendants:y}=wT({disabled:t&&!n}),{isOpen:b,onChange:w}=s(x===-1?null:x);ET({isOpen:b,isDisabled:t});const k=()=>{w==null||w(!0)},_=()=>{w==null||w(!1)},j=d.useCallback(()=>{w==null||w(!b),i(x)},[x,i,b,w]),I=d.useCallback(D=>{const R={ArrowDown:()=>{const T=y.nextEnabled(x);T==null||T.node.focus()},ArrowUp:()=>{const T=y.prevEnabled(x);T==null||T.node.focus()},Home:()=>{const T=y.firstEnabled();T==null||T.node.focus()},End:()=>{const T=y.lastEnabled();T==null||T.node.focus()}}[D.key];R&&(D.preventDefault(),R(D))},[y,x]),M=d.useCallback(()=>{i(x)},[i,x]),E=d.useCallback(function(A={},R=null){return{...A,type:"button",ref:Ct(v,l,R),id:h,disabled:!!t,"aria-expanded":!!b,"aria-controls":m,onClick:Fe(A.onClick,j),onFocus:Fe(A.onFocus,M),onKeyDown:Fe(A.onKeyDown,I)}},[h,t,b,j,M,I,m,v]),O=d.useCallback(function(A={},R=null){return{...A,ref:R,role:"region",id:m,"aria-labelledby":h,hidden:!b}},[h,b,m]);return{isOpen:b,isDisabled:t,isFocusable:n,onOpen:k,onClose:_,getButtonProps:E,getPanelProps:O,htmlProps:o}}function jT(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;vd({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function PT(e){vd({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 IT(e){vd({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 ET(e){vd({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Nl(e){const{isOpen:t,isDisabled:n}=Zx(),{reduceMotion:r}=Jx(),o=et("chakra-accordion__icon",e.className),s=bm(),i={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return a.jsx(An,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:i,...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Nl.displayName="AccordionIcon";var Tl=Pe(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...i}=_T(t),u={...bm().container,overflowAnchor:"none"},p=d.useMemo(()=>i,[i]);return a.jsx(bT,{value:p,children:a.jsx(_e.div,{ref:n,...s,className:et("chakra-accordion__item",o),__css:u,children:typeof r=="function"?r({isExpanded:!!i.isOpen,isDisabled:!!i.isDisabled}):r})})});Tl.displayName="AccordionItem";var Wl={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},ki={enter:{duration:.2,ease:Wl.easeOut},exit:{duration:.1,ease:Wl.easeIn}},Xs={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})},MT=e=>e!=null&&parseInt(e.toString(),10)>0,Ow={exit:{height:{duration:.2,ease:Wl.ease},opacity:{duration:.3,ease:Wl.ease}},enter:{height:{duration:.3,ease:Wl.ease},opacity:{duration:.4,ease:Wl.ease}}},OT={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:MT(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:Xs.exit(Ow.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:Xs.enter(Ow.enter,o)}}},ym=d.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:i="auto",style:l,className:u,transition:p,transitionEnd:h,...m}=e,[v,x]=d.useState(!1);d.useEffect(()=>{const _=setTimeout(()=>{x(!0)});return()=>clearTimeout(_)},[]),vd({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:i,animateOpacity:o,transition:v?p:{enter:{duration:0}},transitionEnd:{enter:h==null?void 0:h.enter,exit:r?h==null?void 0:h.exit:{...h==null?void 0:h.exit,display:y?"block":"none"}}},w=r?n:!0,k=n||r?"enter":"exit";return a.jsx(nr,{initial:!1,custom:b,children:w&&a.jsx(vn.div,{ref:t,...m,className:et("chakra-collapse",u),style:{overflow:"hidden",display:"block",...l},custom:b,variants:OT,initial:r?"exit":!1,animate:k,exit:"exit"})})});ym.displayName="Collapse";var DT={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Xs.enter(ki.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:Xs.exit(ki.exit,n),transitionEnd:t==null?void 0:t.exit}}},I5={initial:"exit",animate:"enter",exit:"exit",variants:DT},RT=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:i,transitionEnd:l,delay:u,...p}=t,h=o||r?"enter":"exit",m=r?o&&r:!0,v={transition:i,transitionEnd:l,delay:u};return a.jsx(nr,{custom:v,children:m&&a.jsx(vn.div,{ref:n,className:et("chakra-fade",s),custom:v,...I5,animate:h,...p})})});RT.displayName="Fade";var AT={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:Xs.exit(ki.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:Xs.enter(ki.enter,n),transitionEnd:e==null?void 0:e.enter}}},E5={initial:"exit",animate:"enter",exit:"exit",variants:AT},NT=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:i=.95,className:l,transition:u,transitionEnd:p,delay:h,...m}=t,v=r?o&&r:!0,x=o||r?"enter":"exit",y={initialScale:i,reverse:s,transition:u,transitionEnd:p,delay:h};return a.jsx(nr,{custom:y,children:v&&a.jsx(vn.div,{ref:n,className:et("chakra-offset-slide",l),...E5,animate:x,custom:y,...m})})});NT.displayName="ScaleFade";var TT={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:Xs.exit(ki.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:Xs.enter(ki.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var i;const l={x:t,y:e};return{opacity:0,transition:(i=n==null?void 0:n.exit)!=null?i:Xs.exit(ki.exit,s),...o?{...l,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...l,...r==null?void 0:r.exit}}}}},m1={initial:"initial",animate:"enter",exit:"exit",variants:TT},$T=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:i,offsetX:l=0,offsetY:u=8,transition:p,transitionEnd:h,delay:m,...v}=t,x=r?o&&r:!0,y=o||r?"enter":"exit",b={offsetX:l,offsetY:u,reverse:s,transition:p,transitionEnd:h,delay:m};return a.jsx(nr,{custom:b,children:x&&a.jsx(vn.div,{ref:n,className:et("chakra-offset-slide",i),custom:b,...m1,animate:y,...v})})});$T.displayName="SlideFade";var $l=Pe(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:i}=Jx(),{getPanelProps:l,isOpen:u}=Zx(),p=l(s,n),h=et("chakra-accordion__panel",r),m=bm();i||delete p.hidden;const v=a.jsx(_e.div,{...p,__css:m.panel,className:h});return i?v:a.jsx(ym,{in:u,...o,children:v})});$l.displayName="AccordionPanel";var M5=Pe(function({children:t,reduceMotion:n,...r},o){const s=Hn("Accordion",r),i=Yt(r),{htmlProps:l,descendants:u,...p}=ST(i),h=d.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return a.jsx(yT,{value:u,children:a.jsx(kT,{value:h,children:a.jsx(xT,{value:s,children:a.jsx(_e.div,{ref:o,...l,className:et("chakra-accordion",r.className),__css:s.root,children:t})})})})});M5.displayName="Accordion";function _d(e){return d.Children.toArray(e).filter(t=>d.isValidElement(t))}var[LT,zT]=$t({strict:!1,name:"ButtonGroupContext"}),FT={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}}},BT={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},mn=Pe(function(t,n){const{size:r,colorScheme:o,variant:s,className:i,spacing:l="0.5rem",isAttached:u,isDisabled:p,orientation:h="horizontal",...m}=t,v=et("chakra-button__group",i),x=d.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let y={display:"inline-flex",...u?FT[h]:BT[h](l)};const b=h==="vertical";return a.jsx(LT,{value:x,children:a.jsx(_e.div,{ref:n,role:"group",__css:y,className:v,"data-attached":u?"":void 0,"data-orientation":h,flexDir:b?"column":void 0,...m})})});mn.displayName="ButtonGroup";function HT(e){const[t,n]=d.useState(!e);return{ref:d.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function g1(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(_e.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}g1.displayName="ButtonIcon";function Qp(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=a.jsx(Ki,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:i,...l}=e,u=et("chakra-button__spinner",s),p=n==="start"?"marginEnd":"marginStart",h=d.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[p]:t?r:0,fontSize:"1em",lineHeight:"normal",...i}),[i,t,p,r]);return a.jsx(_e.div,{className:u,...l,__css:h,children:o})}Qp.displayName="ButtonSpinner";var vc=Pe((e,t)=>{const n=zT(),r=Qa("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:i,children:l,leftIcon:u,rightIcon:p,loadingText:h,iconSpacing:m="0.5rem",type:v,spinner:x,spinnerPlacement:y="start",className:b,as:w,...k}=Yt(e),_=d.useMemo(()=>{const E={...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:E}}},[r,n]),{ref:j,type:I}=HT(w),M={rightIcon:p,leftIcon:u,iconSpacing:m,children:l};return a.jsxs(_e.button,{ref:hT(t,j),as:w,type:v??I,"data-active":at(i),"data-loading":at(s),__css:_,className:et("chakra-button",b),...k,disabled:o||s,children:[s&&y==="start"&&a.jsx(Qp,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:m,children:x}),s?h||a.jsx(_e.span,{opacity:0,children:a.jsx(Dw,{...M})}):a.jsx(Dw,{...M}),s&&y==="end"&&a.jsx(Qp,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:m,children:x})]})});vc.displayName="Button";function Dw(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return a.jsxs(a.Fragment,{children:[t&&a.jsx(g1,{marginEnd:o,children:t}),r,n&&a.jsx(g1,{marginStart:o,children:n})]})}var ps=Pe((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...i}=e,l=n||r,u=d.isValidElement(l)?d.cloneElement(l,{"aria-hidden":!0,focusable:!1}):null;return a.jsx(vc,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...i,children:u})});ps.displayName="IconButton";var[o0e,VT]=$t({name:"CheckboxGroupContext",strict:!1});function WT(e){const[t,n]=d.useState(e),[r,o]=d.useState(!1);return e!==t&&(o(!0),n(e)),r}function UT(e){return a.jsx(_e.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 GT(e){return a.jsx(_e.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 KT(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?GT:UT;return n||t?a.jsx(_e.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(o,{...r})}):null}var[qT,O5]=$t({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[XT,jd]=$t({strict:!1,name:"FormControlContext"});function YT(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...i}=e,l=d.useId(),u=t||`field-${l}`,p=`${u}-label`,h=`${u}-feedback`,m=`${u}-helptext`,[v,x]=d.useState(!1),[y,b]=d.useState(!1),[w,k]=d.useState(!1),_=d.useCallback((O={},D=null)=>({id:m,...O,ref:Ct(D,A=>{A&&b(!0)})}),[m]),j=d.useCallback((O={},D=null)=>({...O,ref:D,"data-focus":at(w),"data-disabled":at(o),"data-invalid":at(r),"data-readonly":at(s),id:O.id!==void 0?O.id:p,htmlFor:O.htmlFor!==void 0?O.htmlFor:u}),[u,o,w,r,s,p]),I=d.useCallback((O={},D=null)=>({id:h,...O,ref:Ct(D,A=>{A&&x(!0)}),"aria-live":"polite"}),[h]),M=d.useCallback((O={},D=null)=>({...O,...i,ref:D,role:"group"}),[i]),E=d.useCallback((O={},D=null)=>({...O,ref:D,role:"presentation","aria-hidden":!0,children:O.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!w,onFocus:()=>k(!0),onBlur:()=>k(!1),hasFeedbackText:v,setHasFeedbackText:x,hasHelpText:y,setHasHelpText:b,id:u,labelId:p,feedbackId:h,helpTextId:m,htmlProps:i,getHelpTextProps:_,getErrorMessageProps:I,getRootProps:M,getLabelProps:j,getRequiredIndicatorProps:E}}var fn=Pe(function(t,n){const r=Hn("Form",t),o=Yt(t),{getRootProps:s,htmlProps:i,...l}=YT(o),u=et("chakra-form-control",t.className);return a.jsx(XT,{value:l,children:a.jsx(qT,{value:r,children:a.jsx(_e.div,{...s({},n),className:u,__css:r.container})})})});fn.displayName="FormControl";var D5=Pe(function(t,n){const r=jd(),o=O5(),s=et("chakra-form__helper-text",t.className);return a.jsx(_e.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});D5.displayName="FormHelperText";var Gn=Pe(function(t,n){var r;const o=Qa("FormLabel",t),s=Yt(t),{className:i,children:l,requiredIndicator:u=a.jsx(R5,{}),optionalIndicator:p=null,...h}=s,m=jd(),v=(r=m==null?void 0:m.getLabelProps(h,n))!=null?r:{ref:n,...h};return a.jsxs(_e.label,{...v,className:et("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[l,m!=null&&m.isRequired?u:p]})});Gn.displayName="FormLabel";var R5=Pe(function(t,n){const r=jd(),o=O5();if(!(r!=null&&r.isRequired))return null;const s=et("chakra-form__required-indicator",t.className);return a.jsx(_e.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});R5.displayName="RequiredIndicator";function eb(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=tb(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":co(n),"aria-required":co(o),"aria-readonly":co(r)}}function tb(e){var t,n,r;const o=jd(),{id:s,disabled:i,readOnly:l,required:u,isRequired:p,isInvalid:h,isReadOnly:m,isDisabled:v,onFocus:x,onBlur:y,...b}=e,w=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&w.push(o.feedbackId),o!=null&&o.hasHelpText&&w.push(o.helpTextId),{...b,"aria-describedby":w.join(" ")||void 0,id:s??(o==null?void 0:o.id),isDisabled:(t=i??v)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=l??m)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=u??p)!=null?r:o==null?void 0:o.isRequired,isInvalid:h??(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 nb={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},A5=_e("span",{baseStyle:nb});A5.displayName="VisuallyHidden";var QT=_e("input",{baseStyle:nb});QT.displayName="VisuallyHiddenInput";const ZT=()=>typeof document<"u";let Rw=!1,Pd=null,$i=!1,v1=!1;const x1=new Set;function rb(e,t){x1.forEach(n=>n(e,t))}const JT=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function e$(e){return!(e.metaKey||!JT&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Aw(e){$i=!0,e$(e)&&(Pd="keyboard",rb("keyboard",e))}function kl(e){if(Pd="pointer",e.type==="mousedown"||e.type==="pointerdown"){$i=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;rb("pointer",e)}}function t$(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function n$(e){t$(e)&&($i=!0,Pd="virtual")}function r$(e){e.target===window||e.target===document||(!$i&&!v1&&(Pd="virtual",rb("virtual",e)),$i=!1,v1=!1)}function o$(){$i=!1,v1=!0}function Nw(){return Pd!=="pointer"}function s$(){if(!ZT()||Rw)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){$i=!0,e.apply(this,n)},document.addEventListener("keydown",Aw,!0),document.addEventListener("keyup",Aw,!0),document.addEventListener("click",n$,!0),window.addEventListener("focus",r$,!0),window.addEventListener("blur",o$,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",kl,!0),document.addEventListener("pointermove",kl,!0),document.addEventListener("pointerup",kl,!0)):(document.addEventListener("mousedown",kl,!0),document.addEventListener("mousemove",kl,!0),document.addEventListener("mouseup",kl,!0)),Rw=!0}function N5(e){s$(),e(Nw());const t=()=>e(Nw());return x1.add(t),()=>{x1.delete(t)}}function a$(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function T5(e={}){const t=tb(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:i,onBlur:l,onFocus:u,"aria-describedby":p}=t,{defaultChecked:h,isChecked:m,isFocusable:v,onChange:x,isIndeterminate:y,name:b,value:w,tabIndex:k=void 0,"aria-label":_,"aria-labelledby":j,"aria-invalid":I,...M}=e,E=a$(M,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),O=nn(x),D=nn(l),A=nn(u),[R,T]=d.useState(!1),[X,B]=d.useState(!1),[U,Y]=d.useState(!1),[V,L]=d.useState(!1);d.useEffect(()=>N5(T),[]);const q=d.useRef(null),[z,K]=d.useState(!0),[re,Q]=d.useState(!!h),le=m!==void 0,se=le?m:re,W=d.useCallback(de=>{if(r||n){de.preventDefault();return}le||Q(se?de.target.checked:y?!0:de.target.checked),O==null||O(de)},[r,n,se,le,y,O]);Yl(()=>{q.current&&(q.current.indeterminate=!!y)},[y]),la(()=>{n&&B(!1)},[n,B]),Yl(()=>{const de=q.current;if(!(de!=null&&de.form))return;const De=()=>{Q(!!h)};return de.form.addEventListener("reset",De),()=>{var je;return(je=de.form)==null?void 0:je.removeEventListener("reset",De)}},[]);const G=n&&!v,te=d.useCallback(de=>{de.key===" "&&L(!0)},[L]),ae=d.useCallback(de=>{de.key===" "&&L(!1)},[L]);Yl(()=>{if(!q.current)return;q.current.checked!==se&&Q(q.current.checked)},[q.current]);const oe=d.useCallback((de={},De=null)=>{const je=Be=>{X&&Be.preventDefault(),L(!0)};return{...de,ref:De,"data-active":at(V),"data-hover":at(U),"data-checked":at(se),"data-focus":at(X),"data-focus-visible":at(X&&R),"data-indeterminate":at(y),"data-disabled":at(n),"data-invalid":at(s),"data-readonly":at(r),"aria-hidden":!0,onMouseDown:Fe(de.onMouseDown,je),onMouseUp:Fe(de.onMouseUp,()=>L(!1)),onMouseEnter:Fe(de.onMouseEnter,()=>Y(!0)),onMouseLeave:Fe(de.onMouseLeave,()=>Y(!1))}},[V,se,n,X,R,U,y,s,r]),pe=d.useCallback((de={},De=null)=>({...de,ref:De,"data-active":at(V),"data-hover":at(U),"data-checked":at(se),"data-focus":at(X),"data-focus-visible":at(X&&R),"data-indeterminate":at(y),"data-disabled":at(n),"data-invalid":at(s),"data-readonly":at(r)}),[V,se,n,X,R,U,y,s,r]),fe=d.useCallback((de={},De=null)=>({...E,...de,ref:Ct(De,je=>{je&&K(je.tagName==="LABEL")}),onClick:Fe(de.onClick,()=>{var je;z||((je=q.current)==null||je.click(),requestAnimationFrame(()=>{var Be;(Be=q.current)==null||Be.focus({preventScroll:!0})}))}),"data-disabled":at(n),"data-checked":at(se),"data-invalid":at(s)}),[E,n,se,s,z]),ge=d.useCallback((de={},De=null)=>({...de,ref:Ct(q,De),type:"checkbox",name:b,value:w,id:i,tabIndex:k,onChange:Fe(de.onChange,W),onBlur:Fe(de.onBlur,D,()=>B(!1)),onFocus:Fe(de.onFocus,A,()=>B(!0)),onKeyDown:Fe(de.onKeyDown,te),onKeyUp:Fe(de.onKeyUp,ae),required:o,checked:se,disabled:G,readOnly:r,"aria-label":_,"aria-labelledby":j,"aria-invalid":I?!!I:s,"aria-describedby":p,"aria-disabled":n,style:nb}),[b,w,i,W,D,A,te,ae,o,se,G,r,_,j,I,s,p,n,k]),Ce=d.useCallback((de={},De=null)=>({...de,ref:De,onMouseDown:Fe(de.onMouseDown,i$),"data-disabled":at(n),"data-checked":at(se),"data-invalid":at(s)}),[se,n,s]);return{state:{isInvalid:s,isFocused:X,isChecked:se,isActive:V,isHovered:U,isIndeterminate:y,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:fe,getCheckboxProps:oe,getIndicatorProps:pe,getInputProps:ge,getLabelProps:Ce,htmlProps:E}}function i$(e){e.preventDefault(),e.stopPropagation()}var l$={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},c$={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},u$=aa({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),d$=aa({from:{opacity:0},to:{opacity:1}}),f$=aa({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Cm=Pe(function(t,n){const r=VT(),o={...r,...t},s=Hn("Checkbox",o),i=Yt(t),{spacing:l="0.5rem",className:u,children:p,iconColor:h,iconSize:m,icon:v=a.jsx(KT,{}),isChecked:x,isDisabled:y=r==null?void 0:r.isDisabled,onChange:b,inputProps:w,...k}=i;let _=x;r!=null&&r.value&&i.value&&(_=r.value.includes(i.value));let j=b;r!=null&&r.onChange&&i.value&&(j=cm(r.onChange,b));const{state:I,getInputProps:M,getCheckboxProps:E,getLabelProps:O,getRootProps:D}=T5({...k,isDisabled:y,isChecked:_,onChange:j}),A=WT(I.isChecked),R=d.useMemo(()=>({animation:A?I.isIndeterminate?`${d$} 20ms linear, ${f$} 200ms linear`:`${u$} 200ms linear`:void 0,fontSize:m,color:h,...s.icon}),[h,m,A,I.isIndeterminate,s.icon]),T=d.cloneElement(v,{__css:R,isIndeterminate:I.isIndeterminate,isChecked:I.isChecked});return a.jsxs(_e.label,{__css:{...c$,...s.container},className:et("chakra-checkbox",u),...D(),children:[a.jsx("input",{className:"chakra-checkbox__input",...M(w,n)}),a.jsx(_e.span,{__css:{...l$,...s.control},className:"chakra-checkbox__control",...E(),children:T}),p&&a.jsx(_e.span,{className:"chakra-checkbox__label",...O(),__css:{marginStart:l,...s.label},children:p})]})});Cm.displayName="Checkbox";function p$(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function ob(e,t){let n=p$(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function b1(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 Zp(e,t,n){return(e-t)*100/(n-t)}function $5(e,t,n){return(n-t)*e+t}function y1(e,t,n){const r=Math.round((e-t)/n)*n+t,o=b1(n);return ob(r,o)}function Jl(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 h$(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:i=Number.MIN_SAFE_INTEGER,max:l=Number.MAX_SAFE_INTEGER,keepWithinRange:u=!0}=e,p=nn(t),[h,m]=d.useState(()=>{var R;return r==null?"":(R=ev(r,s,n))!=null?R:""}),v=typeof o<"u",x=v?o:h,y=L5(Ea(x),s),b=n??y,w=d.useCallback(R=>{R!==x&&(v||m(R.toString()),p==null||p(R.toString(),Ea(R)))},[p,v,x]),k=d.useCallback(R=>{let T=R;return u&&(T=Jl(T,i,l)),ob(T,b)},[b,u,l,i]),_=d.useCallback((R=s)=>{let T;x===""?T=Ea(R):T=Ea(x)+R,T=k(T),w(T)},[k,s,w,x]),j=d.useCallback((R=s)=>{let T;x===""?T=Ea(-R):T=Ea(x)-R,T=k(T),w(T)},[k,s,w,x]),I=d.useCallback(()=>{var R;let T;r==null?T="":T=(R=ev(r,s,n))!=null?R:i,w(T)},[r,n,s,w,i]),M=d.useCallback(R=>{var T;const X=(T=ev(R,s,b))!=null?T:i;w(X)},[b,s,w,i]),E=Ea(x);return{isOutOfRange:E>l||E<i,isAtMax:E===l,isAtMin:E===i,precision:b,value:x,valueAsNumber:E,update:w,reset:I,increment:_,decrement:j,clamp:k,cast:M,setValue:m}}function Ea(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function L5(e,t){return Math.max(b1(t),b1(e))}function ev(e,t,n){const r=Ea(e);if(Number.isNaN(r))return;const o=L5(r,t);return ob(r,n??o)}var[m$,z5]=$t({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[g$,sb]=$t({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),F5={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},wm=Pe(function(t,n){const{getInputProps:r}=sb(),o=z5(),s=r(t,n),i=et("chakra-editable__input",t.className);return a.jsx(_e.input,{...s,__css:{outline:0,...F5,...o.input},className:i})});wm.displayName="EditableInput";var Sm=Pe(function(t,n){const{getPreviewProps:r}=sb(),o=z5(),s=r(t,n),i=et("chakra-editable__preview",t.className);return a.jsx(_e.span,{...s,__css:{cursor:"text",display:"inline-block",...F5,...o.preview},className:i})});Sm.displayName="EditablePreview";function _i(e,t,n,r){const o=nn(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 v$(e){return"current"in e}var B5=()=>typeof window<"u";function x$(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var b$=e=>B5()&&e.test(navigator.vendor),y$=e=>B5()&&e.test(x$()),C$=()=>y$(/mac|iphone|ipad|ipod/i),w$=()=>C$()&&b$(/apple/i);function H5(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,i;return(i=(s=t.current)==null?void 0:s.ownerDocument)!=null?i:document};_i(o,"pointerdown",s=>{if(!w$()||!r)return;const i=s.target,u=(n??[t]).some(p=>{const h=v$(p)?p.current:p;return(h==null?void 0:h.contains(i))||h===i});o().activeElement!==i&&u&&(s.preventDefault(),i.focus())})}function Tw(e,t){return e?e===t||e.contains(t):!1}function S$(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:i,defaultValue:l,startWithEditView:u,isPreviewFocusable:p=!0,submitOnBlur:h=!0,selectAllOnFocus:m=!0,placeholder:v,onEdit:x,finalFocusRef:y,...b}=e,w=nn(x),k=!!(u&&!i),[_,j]=d.useState(k),[I,M]=Rc({defaultValue:l||"",value:s,onChange:t}),[E,O]=d.useState(I),D=d.useRef(null),A=d.useRef(null),R=d.useRef(null),T=d.useRef(null),X=d.useRef(null);H5({ref:D,enabled:_,elements:[T,X]});const B=!_&&!i;Yl(()=>{var oe,pe;_&&((oe=D.current)==null||oe.focus(),m&&((pe=D.current)==null||pe.select()))},[]),la(()=>{var oe,pe,fe,ge;if(!_){y?(oe=y.current)==null||oe.focus():(pe=R.current)==null||pe.focus();return}(fe=D.current)==null||fe.focus(),m&&((ge=D.current)==null||ge.select()),w==null||w()},[_,w,m]);const U=d.useCallback(()=>{B&&j(!0)},[B]),Y=d.useCallback(()=>{O(I)},[I]),V=d.useCallback(()=>{j(!1),M(E),n==null||n(E),o==null||o(E)},[n,o,M,E]),L=d.useCallback(()=>{j(!1),O(I),r==null||r(I),o==null||o(E)},[I,r,o,E]);d.useEffect(()=>{if(_)return;const oe=D.current;(oe==null?void 0:oe.ownerDocument.activeElement)===oe&&(oe==null||oe.blur())},[_]);const q=d.useCallback(oe=>{M(oe.currentTarget.value)},[M]),z=d.useCallback(oe=>{const pe=oe.key,ge={Escape:V,Enter:Ce=>{!Ce.shiftKey&&!Ce.metaKey&&L()}}[pe];ge&&(oe.preventDefault(),ge(oe))},[V,L]),K=d.useCallback(oe=>{const pe=oe.key,ge={Escape:V}[pe];ge&&(oe.preventDefault(),ge(oe))},[V]),re=I.length===0,Q=d.useCallback(oe=>{var pe;if(!_)return;const fe=oe.currentTarget.ownerDocument,ge=(pe=oe.relatedTarget)!=null?pe:fe.activeElement,Ce=Tw(T.current,ge),me=Tw(X.current,ge);!Ce&&!me&&(h?L():V())},[h,L,V,_]),le=d.useCallback((oe={},pe=null)=>{const fe=B&&p?0:void 0;return{...oe,ref:Ct(pe,A),children:re?v:I,hidden:_,"aria-disabled":co(i),tabIndex:fe,onFocus:Fe(oe.onFocus,U,Y)}},[i,_,B,p,re,U,Y,v,I]),se=d.useCallback((oe={},pe=null)=>({...oe,hidden:!_,placeholder:v,ref:Ct(pe,D),disabled:i,"aria-disabled":co(i),value:I,onBlur:Fe(oe.onBlur,Q),onChange:Fe(oe.onChange,q),onKeyDown:Fe(oe.onKeyDown,z),onFocus:Fe(oe.onFocus,Y)}),[i,_,Q,q,z,Y,v,I]),W=d.useCallback((oe={},pe=null)=>({...oe,hidden:!_,placeholder:v,ref:Ct(pe,D),disabled:i,"aria-disabled":co(i),value:I,onBlur:Fe(oe.onBlur,Q),onChange:Fe(oe.onChange,q),onKeyDown:Fe(oe.onKeyDown,K),onFocus:Fe(oe.onFocus,Y)}),[i,_,Q,q,K,Y,v,I]),G=d.useCallback((oe={},pe=null)=>({"aria-label":"Edit",...oe,type:"button",onClick:Fe(oe.onClick,U),ref:Ct(pe,R),disabled:i}),[U,i]),te=d.useCallback((oe={},pe=null)=>({...oe,"aria-label":"Submit",ref:Ct(X,pe),type:"button",onClick:Fe(oe.onClick,L),disabled:i}),[L,i]),ae=d.useCallback((oe={},pe=null)=>({"aria-label":"Cancel",id:"cancel",...oe,ref:Ct(T,pe),type:"button",onClick:Fe(oe.onClick,V),disabled:i}),[V,i]);return{isEditing:_,isDisabled:i,isValueEmpty:re,value:I,onEdit:U,onCancel:V,onSubmit:L,getPreviewProps:le,getInputProps:se,getTextareaProps:W,getEditButtonProps:G,getSubmitButtonProps:te,getCancelButtonProps:ae,htmlProps:b}}var km=Pe(function(t,n){const r=Hn("Editable",t),o=Yt(t),{htmlProps:s,...i}=S$(o),{isEditing:l,onSubmit:u,onCancel:p,onEdit:h}=i,m=et("chakra-editable",t.className),v=Ax(t.children,{isEditing:l,onSubmit:u,onCancel:p,onEdit:h});return a.jsx(g$,{value:i,children:a.jsx(m$,{value:r,children:a.jsx(_e.div,{ref:n,...s,className:m,children:v})})})});km.displayName="Editable";function V5(){const{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}=sb();return{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}}var W5={exports:{}},k$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",_$=k$,j$=_$;function U5(){}function G5(){}G5.resetWarningCache=U5;var P$=function(){function e(r,o,s,i,l,u){if(u!==j$){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:G5,resetWarningCache:U5};return n.PropTypes=n,n};W5.exports=P$();var I$=W5.exports;const Ht=Dc(I$);var C1="data-focus-lock",K5="data-focus-lock-disabled",E$="data-no-focus-lock",M$="data-autofocus-inside",O$="data-no-autofocus";function D$(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function R$(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 q5(e,t){return R$(t||null,function(n){return e.forEach(function(r){return D$(r,n)})})}var tv={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},us=function(){return us=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},us.apply(this,arguments)};function X5(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 Ac(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function l(h){try{p(r.next(h))}catch(m){i(m)}}function u(h){try{p(r.throw(h))}catch(m){i(m)}}function p(h){h.done?s(h.value):o(h.value).then(l,u)}p((r=r.apply(e,t||[])).next())})}function Nc(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(p){return function(h){return u([p,h])}}function u(p){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,p[0]&&(n=0)),n;)try{if(r=1,o&&(s=p[0]&2?o.return:p[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,p[1])).done)return s;switch(o=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){n.label=p[1];break}if(p[0]===6&&n.label<s[1]){n.label=s[1],s=p;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(p);break}s[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(h){p=[6,h],o=0}finally{r=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function $w(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(l){i={error:l}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function w1(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 Y5(e){return e}function Q5(e,t){t===void 0&&(t=Y5);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var u=function(){var h=i;i=[],h.forEach(s)},p=function(){return Promise.resolve().then(u)};p(),n={push:function(h){i.push(h),p()},filter:function(h){return i=i.filter(h),n}}}};return o}function ab(e,t){return t===void 0&&(t=Y5),Q5(e,t)}function Z5(e){e===void 0&&(e={});var t=Q5(null);return t.options=us({async:!0,ssr:!1},e),t}var J5=function(e){var t=e.sideCar,n=X5(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,us({},n))};J5.isSideCarExport=!0;function A$(e,t){return e.useMedium(t),J5}var e3=ab({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),t3=ab(),N$=ab(),T$=Z5({async:!0}),$$=[],ib=d.forwardRef(function(t,n){var r,o=d.useState(),s=o[0],i=o[1],l=d.useRef(),u=d.useRef(!1),p=d.useRef(null),h=t.children,m=t.disabled,v=t.noFocusGuards,x=t.persistentFocus,y=t.crossFrame,b=t.autoFocus;t.allowTextSelection;var w=t.group,k=t.className,_=t.whiteList,j=t.hasPositiveIndices,I=t.shards,M=I===void 0?$$:I,E=t.as,O=E===void 0?"div":E,D=t.lockProps,A=D===void 0?{}:D,R=t.sideCar,T=t.returnFocus,X=t.focusOptions,B=t.onActivation,U=t.onDeactivation,Y=d.useState({}),V=Y[0],L=d.useCallback(function(){p.current=p.current||document&&document.activeElement,l.current&&B&&B(l.current),u.current=!0},[B]),q=d.useCallback(function(){u.current=!1,U&&U(l.current)},[U]);d.useEffect(function(){m||(p.current=null)},[]);var z=d.useCallback(function(te){var ae=p.current;if(ae&&ae.focus){var oe=typeof T=="function"?T(ae):T;if(oe){var pe=typeof oe=="object"?oe:void 0;p.current=null,te?Promise.resolve().then(function(){return ae.focus(pe)}):ae.focus(pe)}}},[T]),K=d.useCallback(function(te){u.current&&e3.useMedium(te)},[]),re=t3.useMedium,Q=d.useCallback(function(te){l.current!==te&&(l.current=te,i(te))},[]),le=rn((r={},r[K5]=m&&"disabled",r[C1]=w,r),A),se=v!==!0,W=se&&v!=="tail",G=q5([n,Q]);return d.createElement(d.Fragment,null,se&&[d.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:m?-1:0,style:tv}),j?d.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:m?-1:1,style:tv}):null],!m&&d.createElement(R,{id:V,sideCar:T$,observed:s,disabled:m,persistentFocus:x,crossFrame:y,autoFocus:b,whiteList:_,shards:M,onActivation:L,onDeactivation:q,returnFocus:z,focusOptions:X}),d.createElement(O,rn({ref:G},le,{className:k,onBlur:re,onFocus:K}),h),W&&d.createElement("div",{"data-focus-guard":!0,tabIndex:m?-1:0,style:tv}))});ib.propTypes={};ib.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 n3=ib;function S1(e,t){return S1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},S1(e,t)}function L$(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,S1(e,t)}function z$(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],i;function l(){i=e(s.map(function(p){return p.props})),t(i)}var u=function(p){L$(h,p);function h(){return p.apply(this,arguments)||this}h.peek=function(){return i};var m=h.prototype;return m.componentDidMount=function(){s.push(this),l()},m.componentDidUpdate=function(){l()},m.componentWillUnmount=function(){var x=s.indexOf(this);s.splice(x,1),l()},m.render=function(){return H.createElement(o,this.props)},h}(d.PureComponent);return M7(u,"displayName","SideEffect("+n(o)+")"),u}}var _s=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},Jp=function(e){return Array.isArray(e)?e:[e]},r3=function(e){return Array.isArray(e)?e[0]:e},F$=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"},o3=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},s3=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},B$=function(e,t){return!e||s3(e)||!F$(e)&&t(o3(e))},a3=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=B$(t,a3.bind(void 0,e));return e.set(t,r),r},H$=function(e,t){return e&&!s3(e)?U$(e)?t(o3(e)):!1:!0},i3=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=H$(t,i3.bind(void 0,e));return e.set(t,r),r},l3=function(e){return e.dataset},V$=function(e){return e.tagName==="BUTTON"},c3=function(e){return e.tagName==="INPUT"},u3=function(e){return c3(e)&&e.type==="radio"},W$=function(e){return!((c3(e)||V$(e))&&(e.type==="hidden"||e.disabled))},U$=function(e){var t=e.getAttribute(O$);return![!0,"true",""].includes(t)},lb=function(e){var t;return!!(e&&(!((t=l3(e))===null||t===void 0)&&t.focusGuard))},eh=function(e){return!lb(e)},G$=function(e){return!!e},K$=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},d3=function(e,t,n){return _s(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(K$)},q$=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],cb=q$.join(","),X$="".concat(cb,", [data-focus-guard]"),f3=function(e,t){return _s((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?X$:cb)?[r]:[],f3(r))},[])},Y$=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?_m([e.contentDocument.body],t):[e]},_m=function(e,t){return e.reduce(function(n,r){var o,s=f3(r,t),i=(o=[]).concat.apply(o,s.map(function(l){return Y$(l,t)}));return n.concat(i,r.parentNode?_s(r.parentNode.querySelectorAll(cb)).filter(function(l){return l===r}):[])},[])},Q$=function(e){var t=e.querySelectorAll("[".concat(M$,"]"));return _s(t).map(function(n){return _m([n])}).reduce(function(n,r){return n.concat(r)},[])},ub=function(e,t){return _s(e).filter(function(n){return a3(t,n)}).filter(function(n){return W$(n)})},Lw=function(e,t){return t===void 0&&(t=new Map),_s(e).filter(function(n){return i3(t,n)})},k1=function(e,t,n){return d3(ub(_m(e,n),t),!0,n)},zw=function(e,t){return d3(ub(_m(e),t),!1)},Z$=function(e,t){return ub(Q$(e),t)},ec=function(e,t){return e.shadowRoot?ec(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:_s(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?ec(o,t):!1}return ec(n,t)})},J$=function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var o=r+1;o<n;o+=1){var s=e[r].compareDocumentPosition(e[o]);(s&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(s&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(i,l){return!t.has(l)})},p3=function(e){return e.parentNode?p3(e.parentNode):e},db=function(e){var t=Jp(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(C1);return n.push.apply(n,o?J$(_s(p3(r).querySelectorAll("[".concat(C1,'="').concat(o,'"]:not([').concat(K5,'="disabled"])')))):[r]),n},[])},eL=function(e){try{return e()}catch{return}},Zu=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Zu(t.shadowRoot):t instanceof HTMLIFrameElement&&eL(function(){return t.contentWindow.document})?Zu(t.contentWindow.document):t}},tL=function(e,t){return e===t},nL=function(e,t){return!!_s(e.querySelectorAll("iframe")).some(function(n){return tL(n,t)})},h3=function(e,t){return t===void 0&&(t=Zu(r3(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:db(e).some(function(n){return ec(n,t)||nL(n,t)})},rL=function(e){e===void 0&&(e=document);var t=Zu(e);return t?_s(e.querySelectorAll("[".concat(E$,"]"))).some(function(n){return ec(n,t)}):!1},oL=function(e,t){return t.filter(u3).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},fb=function(e,t){return u3(e)&&e.name?oL(e,t):e},sL=function(e){var t=new Set;return e.forEach(function(n){return t.add(fb(n,e))}),e.filter(function(n){return t.has(n)})},Fw=function(e){return e[0]&&e.length>1?fb(e[0],e):e[0]},Bw=function(e,t){return e.length>1?e.indexOf(fb(e[t],e)):t},m3="NEW_FOCUS",aL=function(e,t,n,r){var o=e.length,s=e[0],i=e[o-1],l=lb(n);if(!(n&&e.indexOf(n)>=0)){var u=n!==void 0?t.indexOf(n):-1,p=r?t.indexOf(r):u,h=r?e.indexOf(r):-1,m=u-p,v=t.indexOf(s),x=t.indexOf(i),y=sL(t),b=n!==void 0?y.indexOf(n):-1,w=b-(r?y.indexOf(r):u),k=Bw(e,0),_=Bw(e,o-1);if(u===-1||h===-1)return m3;if(!m&&h>=0)return h;if(u<=v&&l&&Math.abs(m)>1)return _;if(u>=x&&l&&Math.abs(m)>1)return k;if(m&&Math.abs(w)>1)return h;if(u<=v)return _;if(u>x)return k;if(m)return Math.abs(m)>1?h:(o+h+m)%o}},iL=function(e){return function(t){var n,r=(n=l3(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},lL=function(e,t,n){var r=e.map(function(s){var i=s.node;return i}),o=Lw(r.filter(iL(n)));return o&&o.length?Fw(o):Fw(Lw(t))},_1=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&_1(e.parentNode.host||e.parentNode,t),t},nv=function(e,t){for(var n=_1(e),r=_1(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},g3=function(e,t,n){var r=Jp(e),o=Jp(t),s=r[0],i=!1;return o.filter(Boolean).forEach(function(l){i=nv(i||l,l)||i,n.filter(Boolean).forEach(function(u){var p=nv(s,u);p&&(!i||ec(p,i)?i=p:i=nv(p,i))})}),i},cL=function(e,t){return e.reduce(function(n,r){return n.concat(Z$(r,t))},[])},uL=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(G$)},dL=function(e,t){var n=Zu(Jp(e).length>0?document:r3(e).ownerDocument),r=db(e).filter(eh),o=g3(n||e,e,r),s=new Map,i=zw(r,s),l=k1(r,s).filter(function(x){var y=x.node;return eh(y)});if(!(!l[0]&&(l=i,!l[0]))){var u=zw([o],s).map(function(x){var y=x.node;return y}),p=uL(u,l),h=p.map(function(x){var y=x.node;return y}),m=aL(h,u,n,t);if(m===m3){var v=lL(i,h,cL(r,s));if(v)return{node:v};console.warn("focus-lock: cannot find any node to move focus into");return}return m===void 0?m:p[m]}},fL=function(e){var t=db(e).filter(eh),n=g3(e,e,t),r=new Map,o=k1([n],r,!0),s=k1(t,r).filter(function(i){var l=i.node;return eh(l)}).map(function(i){var l=i.node;return l});return o.map(function(i){var l=i.node,u=i.index;return{node:l,index:u,lockItem:s.indexOf(l)>=0,guard:lb(l)}})},pL=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},rv=0,ov=!1,v3=function(e,t,n){n===void 0&&(n={});var r=dL(e,t);if(!ov&&r){if(rv>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),ov=!0,setTimeout(function(){ov=!1},1);return}rv++,pL(r.node,n.focusOptions),rv--}};function pb(e){setTimeout(e,1)}var hL=function(){return document&&document.activeElement===document.body},mL=function(){return hL()||rL()},tc=null,Ul=null,nc=null,Ju=!1,gL=function(){return!0},vL=function(t){return(tc.whiteList||gL)(t)},xL=function(t,n){nc={observerNode:t,portaledElement:n}},bL=function(t){return nc&&nc.portaledElement===t};function Hw(e,t,n,r){var o=null,s=e;do{var i=r[s];if(i.guard)i.node.dataset.focusAutoGuard&&(o=i);else if(i.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var yL=function(t){return t&&"current"in t?t.current:t},CL=function(t){return t?!!Ju:Ju==="meanwhile"},wL=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},SL=function(t,n){return n.some(function(r){return wL(t,r,r)})},th=function(){var t=!1;if(tc){var n=tc,r=n.observed,o=n.persistentFocus,s=n.autoFocus,i=n.shards,l=n.crossFrame,u=n.focusOptions,p=r||nc&&nc.portaledElement,h=document&&document.activeElement;if(p){var m=[p].concat(i.map(yL).filter(Boolean));if((!h||vL(h))&&(o||CL(l)||!mL()||!Ul&&s)&&(p&&!(h3(m)||h&&SL(h,m)||bL(h))&&(document&&!Ul&&h&&!s?(h.blur&&h.blur(),document.body.focus()):(t=v3(m,Ul,{focusOptions:u}),nc={})),Ju=!1,Ul=document&&document.activeElement),document){var v=document&&document.activeElement,x=fL(m),y=x.map(function(b){var w=b.node;return w}).indexOf(v);y>-1&&(x.filter(function(b){var w=b.guard,k=b.node;return w&&k.dataset.focusAutoGuard}).forEach(function(b){var w=b.node;return w.removeAttribute("tabIndex")}),Hw(y,x.length,1,x),Hw(y,-1,-1,x))}}}return t},x3=function(t){th()&&t&&(t.stopPropagation(),t.preventDefault())},hb=function(){return pb(th)},kL=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||xL(r,n)},_L=function(){return null},b3=function(){Ju="just",pb(function(){Ju="meanwhile"})},jL=function(){document.addEventListener("focusin",x3),document.addEventListener("focusout",hb),window.addEventListener("blur",b3)},PL=function(){document.removeEventListener("focusin",x3),document.removeEventListener("focusout",hb),window.removeEventListener("blur",b3)};function IL(e){return e.filter(function(t){var n=t.disabled;return!n})}function EL(e){var t=e.slice(-1)[0];t&&!tc&&jL();var n=tc,r=n&&t&&t.id===n.id;tc=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Ul=null,(!r||n.observed!==t.observed)&&t.onActivation(),th(),pb(th)):(PL(),Ul=null)}e3.assignSyncMedium(kL);t3.assignMedium(hb);N$.assignMedium(function(e){return e({moveFocusInside:v3,focusInside:h3})});const ML=z$(IL,EL)(_L);var y3=d.forwardRef(function(t,n){return d.createElement(n3,rn({sideCar:ML,ref:n},t))}),C3=n3.propTypes||{};C3.sideCar;TN(C3,["sideCar"]);y3.propTypes={};const Vw=y3;function w3(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function mb(e){var t;if(!w3(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function OL(e){var t,n;return(n=(t=S3(e))==null?void 0:t.defaultView)!=null?n:window}function S3(e){return w3(e)?e.ownerDocument:document}function DL(e){return S3(e).activeElement}function RL(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 AL(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function k3(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:mb(e)&&RL(e)?e:k3(AL(e))}var _3=e=>e.hasAttribute("tabindex"),NL=e=>_3(e)&&e.tabIndex===-1;function TL(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function j3(e){return e.parentElement&&j3(e.parentElement)?!0:e.hidden}function $L(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function P3(e){if(!mb(e)||j3(e)||TL(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]():$L(e)?!0:_3(e)}function LL(e){return e?mb(e)&&P3(e)&&!NL(e):!1}var zL=["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]"],FL=zL.join(),BL=e=>e.offsetWidth>0&&e.offsetHeight>0;function I3(e){const t=Array.from(e.querySelectorAll(FL));return t.unshift(e),t.filter(n=>P3(n)&&BL(n))}var Ww,HL=(Ww=Vw.default)!=null?Ww:Vw,E3=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:i,autoFocus:l,persistentFocus:u,lockFocusAcrossFrames:p}=e,h=d.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&I3(r.current).length===0&&requestAnimationFrame(()=>{var y;(y=r.current)==null||y.focus()})},[t,r]),m=d.useCallback(()=>{var x;(x=n==null?void 0:n.current)==null||x.focus()},[n]),v=o&&!n;return a.jsx(HL,{crossFrame:p,persistentFocus:u,autoFocus:l,disabled:i,onActivation:h,onDeactivation:m,returnFocus:v,children:s})};E3.displayName="FocusLock";var VL=tT?d.useLayoutEffect:d.useEffect;function j1(e,t=[]){const n=d.useRef(e);return VL(()=>{n.current=e}),d.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function WL(e,t,n,r){const o=j1(t);return d.useEffect(()=>{var s;const i=(s=AC(n))!=null?s:document;if(t)return i.addEventListener(e,o,r),()=>{i.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=AC(n))!=null?s:document).removeEventListener(e,o,r)}}function UL(e,t){const n=d.useId();return d.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function GL(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Er(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=j1(n),i=j1(t),[l,u]=d.useState(e.defaultIsOpen||!1),[p,h]=GL(r,l),m=UL(o,"disclosure"),v=d.useCallback(()=>{p||u(!1),i==null||i()},[p,i]),x=d.useCallback(()=>{p||u(!0),s==null||s()},[p,s]),y=d.useCallback(()=>{(h?v:x)()},[h,x,v]);return{isOpen:!!h,onOpen:x,onClose:v,onToggle:y,isControlled:p,getButtonProps:(b={})=>({...b,"aria-expanded":h,"aria-controls":m,onClick:O7(b.onClick,y)}),getDisclosureProps:(b={})=>({...b,hidden:!h,id:m})}}var[KL,qL]=$t({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),M3=Pe(function(t,n){const r=Hn("Input",t),{children:o,className:s,...i}=Yt(t),l=et("chakra-input__group",s),u={},p=_d(o),h=r.field;p.forEach(v=>{var x,y;r&&(h&&v.type.id==="InputLeftElement"&&(u.paddingStart=(x=h.height)!=null?x:h.h),h&&v.type.id==="InputRightElement"&&(u.paddingEnd=(y=h.height)!=null?y:h.h),v.type.id==="InputRightAddon"&&(u.borderEndRadius=0),v.type.id==="InputLeftAddon"&&(u.borderStartRadius=0))});const m=p.map(v=>{var x,y;const b=Ij({size:((x=v.props)==null?void 0:x.size)||t.size,variant:((y=v.props)==null?void 0:y.variant)||t.variant});return v.type.id!=="Input"?d.cloneElement(v,b):d.cloneElement(v,Object.assign(b,u,v.props))});return a.jsx(_e.div,{className:l,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...i,children:a.jsx(KL,{value:r,children:m})})});M3.displayName="InputGroup";var XL=_e("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),jm=Pe(function(t,n){var r,o;const{placement:s="left",...i}=t,l=qL(),u=l.field,h={[s==="left"?"insetStart":"insetEnd"]:"0",width:(r=u==null?void 0:u.height)!=null?r:u==null?void 0:u.h,height:(o=u==null?void 0:u.height)!=null?o:u==null?void 0:u.h,fontSize:u==null?void 0:u.fontSize,...l.element};return a.jsx(XL,{ref:n,__css:h,...i})});jm.id="InputElement";jm.displayName="InputElement";var O3=Pe(function(t,n){const{className:r,...o}=t,s=et("chakra-input__left-element",r);return a.jsx(jm,{ref:n,placement:"left",className:s,...o})});O3.id="InputLeftElement";O3.displayName="InputLeftElement";var gb=Pe(function(t,n){const{className:r,...o}=t,s=et("chakra-input__right-element",r);return a.jsx(jm,{ref:n,placement:"right",className:s,...o})});gb.id="InputRightElement";gb.displayName="InputRightElement";var Pm=Pe(function(t,n){const{htmlSize:r,...o}=t,s=Hn("Input",o),i=Yt(o),l=eb(i),u=et("chakra-input",t.className);return a.jsx(_e.input,{size:r,...l,__css:s.field,ref:n,className:u})});Pm.displayName="Input";Pm.id="Input";var Im=Pe(function(t,n){const r=Qa("Link",t),{className:o,isExternal:s,...i}=Yt(t);return a.jsx(_e.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:et("chakra-link",o),...i,__css:r})});Im.displayName="Link";var[YL,D3]=$t({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),vb=Pe(function(t,n){const r=Hn("List",t),{children:o,styleType:s="none",stylePosition:i,spacing:l,...u}=Yt(t),p=_d(o),m=l?{["& > *:not(style) ~ *:not(style)"]:{mt:l}}:{};return a.jsx(YL,{value:r,children:a.jsx(_e.ul,{ref:n,listStyleType:s,listStylePosition:i,role:"list",__css:{...r.container,...m},...u,children:p})})});vb.displayName="List";var QL=Pe((e,t)=>{const{as:n,...r}=e;return a.jsx(vb,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});QL.displayName="OrderedList";var Id=Pe(function(t,n){const{as:r,...o}=t;return a.jsx(vb,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});Id.displayName="UnorderedList";var No=Pe(function(t,n){const r=D3();return a.jsx(_e.li,{ref:n,...t,__css:r.item})});No.displayName="ListItem";var ZL=Pe(function(t,n){const r=D3();return a.jsx(An,{ref:n,role:"presentation",...t,__css:r.icon})});ZL.displayName="ListIcon";var Ua=Pe(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:i,column:l,row:u,autoFlow:p,autoRows:h,templateRows:m,autoColumns:v,templateColumns:x,...y}=t,b={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:i,gridAutoColumns:v,gridColumn:l,gridRow:u,gridAutoFlow:p,gridAutoRows:h,gridTemplateRows:m,gridTemplateColumns:x};return a.jsx(_e.div,{ref:n,__css:b,...y})});Ua.displayName="Grid";function R3(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):t1(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Za=_e("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});Za.displayName="Spacer";var A3=e=>a.jsx(_e.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});A3.displayName="StackItem";function JL(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{"&":R3(n,o=>r[o])}}var xb=Pe((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:i="0.5rem",wrap:l,children:u,divider:p,className:h,shouldWrapChildren:m,...v}=e,x=n?"row":r??"column",y=d.useMemo(()=>JL({spacing:i,direction:x}),[i,x]),b=!!p,w=!m&&!b,k=d.useMemo(()=>{const j=_d(u);return w?j:j.map((I,M)=>{const E=typeof I.key<"u"?I.key:M,O=M+1===j.length,A=m?a.jsx(A3,{children:I},E):I;if(!b)return A;const R=d.cloneElement(p,{__css:y}),T=O?null:R;return a.jsxs(d.Fragment,{children:[A,T]},E)})},[p,y,b,w,m,u]),_=et("chakra-stack",h);return a.jsx(_e.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:x,flexWrap:l,gap:b?void 0:i,className:_,...v,children:k})});xb.displayName="Stack";var N3=Pe((e,t)=>a.jsx(xb,{align:"center",...e,direction:"column",ref:t}));N3.displayName="VStack";var bb=Pe((e,t)=>a.jsx(xb,{align:"center",...e,direction:"row",ref:t}));bb.displayName="HStack";function Uw(e){return R3(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var ed=Pe(function(t,n){const{area:r,colSpan:o,colStart:s,colEnd:i,rowEnd:l,rowSpan:u,rowStart:p,...h}=t,m=Ij({gridArea:r,gridColumn:Uw(o),gridRow:Uw(u),gridColumnStart:s,gridColumnEnd:i,gridRowStart:p,gridRowEnd:l});return a.jsx(_e.div,{ref:n,__css:m,...h})});ed.displayName="GridItem";var ua=Pe(function(t,n){const r=Qa("Badge",t),{className:o,...s}=Yt(t);return a.jsx(_e.span,{ref:n,className:et("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});ua.displayName="Badge";var Br=Pe(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:i,borderWidth:l,borderStyle:u,borderColor:p,...h}=Qa("Divider",t),{className:m,orientation:v="horizontal",__css:x,...y}=Yt(t),b={vertical:{borderLeftWidth:r||i||l||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||l||"1px",width:"100%"}};return a.jsx(_e.hr,{ref:n,"aria-orientation":v,...y,__css:{...h,border:"0",borderColor:p,borderStyle:u,...b[v],...x},className:et("chakra-divider",m)})});Br.displayName="Divider";function ez(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function tz(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=d.useState([]),s=d.useRef(),i=()=>{s.current&&(clearTimeout(s.current),s.current=null)},l=()=>{i(),s.current=setTimeout(()=>{o([]),s.current=null},t)};d.useEffect(()=>i,[]);function u(p){return h=>{if(h.key==="Backspace"){const m=[...r];m.pop(),o(m);return}if(ez(h)){const m=r.concat(h.key);n(h)&&(h.preventDefault(),h.stopPropagation()),o(m),p(m.join("")),l()}}}return u}function nz(e,t,n,r){if(t==null)return r;if(!r)return e.find(i=>n(i).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(s=>n(s).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let s;return o.includes(r)?(s=o.indexOf(r)+1,s===o.length&&(s=0),o[s]):(s=e.indexOf(o[0]),e[s])}return r}function rz(){const e=d.useRef(new Map),t=e.current,n=d.useCallback((o,s,i,l)=>{e.current.set(i,{type:s,el:o,options:l}),o.addEventListener(s,i,l)},[]),r=d.useCallback((o,s,i,l)=>{o.removeEventListener(s,i,l),e.current.delete(i)},[]);return d.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function sv(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function T3(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:i,onMouseUp:l,onClick:u,onKeyDown:p,onKeyUp:h,tabIndex:m,onMouseOver:v,onMouseLeave:x,...y}=e,[b,w]=d.useState(!0),[k,_]=d.useState(!1),j=rz(),I=L=>{L&&L.tagName!=="BUTTON"&&w(!1)},M=b?m:m||0,E=n&&!r,O=d.useCallback(L=>{if(n){L.stopPropagation(),L.preventDefault();return}L.currentTarget.focus(),u==null||u(L)},[n,u]),D=d.useCallback(L=>{k&&sv(L)&&(L.preventDefault(),L.stopPropagation(),_(!1),j.remove(document,"keyup",D,!1))},[k,j]),A=d.useCallback(L=>{if(p==null||p(L),n||L.defaultPrevented||L.metaKey||!sv(L.nativeEvent)||b)return;const q=o&&L.key==="Enter";s&&L.key===" "&&(L.preventDefault(),_(!0)),q&&(L.preventDefault(),L.currentTarget.click()),j.add(document,"keyup",D,!1)},[n,b,p,o,s,j,D]),R=d.useCallback(L=>{if(h==null||h(L),n||L.defaultPrevented||L.metaKey||!sv(L.nativeEvent)||b)return;s&&L.key===" "&&(L.preventDefault(),_(!1),L.currentTarget.click())},[s,b,n,h]),T=d.useCallback(L=>{L.button===0&&(_(!1),j.remove(document,"mouseup",T,!1))},[j]),X=d.useCallback(L=>{if(L.button!==0)return;if(n){L.stopPropagation(),L.preventDefault();return}b||_(!0),L.currentTarget.focus({preventScroll:!0}),j.add(document,"mouseup",T,!1),i==null||i(L)},[n,b,i,j,T]),B=d.useCallback(L=>{L.button===0&&(b||_(!1),l==null||l(L))},[l,b]),U=d.useCallback(L=>{if(n){L.preventDefault();return}v==null||v(L)},[n,v]),Y=d.useCallback(L=>{k&&(L.preventDefault(),_(!1)),x==null||x(L)},[k,x]),V=Ct(t,I);return b?{...y,ref:V,type:"button","aria-disabled":E?void 0:n,disabled:E,onClick:O,onMouseDown:i,onMouseUp:l,onKeyUp:h,onKeyDown:p,onMouseOver:v,onMouseLeave:x}:{...y,ref:V,role:"button","data-active":at(k),"aria-disabled":n?"true":void 0,tabIndex:E?void 0:M,onClick:O,onMouseDown:X,onMouseUp:B,onKeyUp:R,onKeyDown:A,onMouseOver:U,onMouseLeave:Y}}function oz(e){const t=e.current;if(!t)return!1;const n=DL(t);return!n||t.contains(n)?!1:!!LL(n)}function $3(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;la(()=>{if(!s||oz(e))return;const i=(o==null?void 0:o.current)||e.current;let l;if(i)return l=requestAnimationFrame(()=>{i.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(l)}},[s,e,o])}var sz={preventScroll:!0,shouldFocus:!1};function az(e,t=sz){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,i=iz(e)?e.current:e,l=o&&s,u=d.useRef(l),p=d.useRef(s);Yl(()=>{!p.current&&s&&(u.current=l),p.current=s},[s,l]);const h=d.useCallback(()=>{if(!(!s||!i||!u.current)&&(u.current=!1,!i.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var m;(m=n.current)==null||m.focus({preventScroll:r})});else{const m=I3(i);m.length>0&&requestAnimationFrame(()=>{m[0].focus({preventScroll:r})})}},[s,r,i,n]);la(()=>{h()},[h]),_i(i,"transitionend",h)}function iz(e){return"current"in e}var _l=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),jn={arrowShadowColor:_l("--popper-arrow-shadow-color"),arrowSize:_l("--popper-arrow-size","8px"),arrowSizeHalf:_l("--popper-arrow-size-half"),arrowBg:_l("--popper-arrow-bg"),transformOrigin:_l("--popper-transform-origin"),arrowOffset:_l("--popper-arrow-offset")};function lz(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 cz={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"},uz=e=>cz[e],Gw={scroll:!0,resize:!0};function dz(e){let t;return typeof e=="object"?t={enabled:!0,options:{...Gw,...e}}:t={enabled:e,options:Gw},t}var fz={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`}},pz={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{Kw(e)},effect:({state:e})=>()=>{Kw(e)}},Kw=e=>{e.elements.popper.style.setProperty(jn.transformOrigin.var,uz(e.placement))},hz={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{mz(e)}},mz=e=>{var t;if(!e.placement)return;const n=gz(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:jn.arrowSize.varRef,height:jn.arrowSize.varRef,zIndex:-1});const r={[jn.arrowSizeHalf.var]:`calc(${jn.arrowSize.varRef} / 2 - 1px)`,[jn.arrowOffset.var]:`calc(${jn.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},gz=e=>{if(e.startsWith("top"))return{property:"bottom",value:jn.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:jn.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:jn.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:jn.arrowOffset.varRef}},vz={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{qw(e)},effect:({state:e})=>()=>{qw(e)}},qw=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=lz(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:jn.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},xz={"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"}},bz={"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 yz(e,t="ltr"){var n,r;const o=((n=xz[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=bz[e])!=null?r:o}var _r="top",ho="bottom",mo="right",jr="left",yb="auto",Ed=[_r,ho,mo,jr],xc="start",td="end",Cz="clippingParents",L3="viewport",yu="popper",wz="reference",Xw=Ed.reduce(function(e,t){return e.concat([t+"-"+xc,t+"-"+td])},[]),z3=[].concat(Ed,[yb]).reduce(function(e,t){return e.concat([t,t+"-"+xc,t+"-"+td])},[]),Sz="beforeRead",kz="read",_z="afterRead",jz="beforeMain",Pz="main",Iz="afterMain",Ez="beforeWrite",Mz="write",Oz="afterWrite",Dz=[Sz,kz,_z,jz,Pz,Iz,Ez,Mz,Oz];function ms(e){return e?(e.nodeName||"").toLowerCase():null}function Hr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Li(e){var t=Hr(e).Element;return e instanceof t||e instanceof Element}function uo(e){var t=Hr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Cb(e){if(typeof ShadowRoot>"u")return!1;var t=Hr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Rz(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];!uo(s)||!ms(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var l=o[i];l===!1?s.removeAttribute(i):s.setAttribute(i,l===!0?"":l)}))})}function Az(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]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=i.reduce(function(u,p){return u[p]="",u},{});!uo(o)||!ms(o)||(Object.assign(o.style,l),Object.keys(s).forEach(function(u){o.removeAttribute(u)}))})}}const Nz={name:"applyStyles",enabled:!0,phase:"write",fn:Rz,effect:Az,requires:["computeStyles"]};function hs(e){return e.split("-")[0]}var ji=Math.max,nh=Math.min,bc=Math.round;function P1(){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 F3(){return!/^((?!chrome|android).)*safari/i.test(P1())}function yc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&uo(e)&&(o=e.offsetWidth>0&&bc(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&bc(r.height)/e.offsetHeight||1);var i=Li(e)?Hr(e):window,l=i.visualViewport,u=!F3()&&n,p=(r.left+(u&&l?l.offsetLeft:0))/o,h=(r.top+(u&&l?l.offsetTop:0))/s,m=r.width/o,v=r.height/s;return{width:m,height:v,top:h,right:p+m,bottom:h+v,left:p,x:p,y:h}}function wb(e){var t=yc(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 B3(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Cb(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ta(e){return Hr(e).getComputedStyle(e)}function Tz(e){return["table","td","th"].indexOf(ms(e))>=0}function Ja(e){return((Li(e)?e.ownerDocument:e.document)||window.document).documentElement}function Em(e){return ms(e)==="html"?e:e.assignedSlot||e.parentNode||(Cb(e)?e.host:null)||Ja(e)}function Yw(e){return!uo(e)||ta(e).position==="fixed"?null:e.offsetParent}function $z(e){var t=/firefox/i.test(P1()),n=/Trident/i.test(P1());if(n&&uo(e)){var r=ta(e);if(r.position==="fixed")return null}var o=Em(e);for(Cb(o)&&(o=o.host);uo(o)&&["html","body"].indexOf(ms(o))<0;){var s=ta(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 Md(e){for(var t=Hr(e),n=Yw(e);n&&Tz(n)&&ta(n).position==="static";)n=Yw(n);return n&&(ms(n)==="html"||ms(n)==="body"&&ta(n).position==="static")?t:n||$z(e)||t}function Sb(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Bu(e,t,n){return ji(e,nh(t,n))}function Lz(e,t,n){var r=Bu(e,t,n);return r>n?n:r}function H3(){return{top:0,right:0,bottom:0,left:0}}function V3(e){return Object.assign({},H3(),e)}function W3(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var zz=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,V3(typeof t!="number"?t:W3(t,Ed))};function Fz(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,l=hs(n.placement),u=Sb(l),p=[jr,mo].indexOf(l)>=0,h=p?"height":"width";if(!(!s||!i)){var m=zz(o.padding,n),v=wb(s),x=u==="y"?_r:jr,y=u==="y"?ho:mo,b=n.rects.reference[h]+n.rects.reference[u]-i[u]-n.rects.popper[h],w=i[u]-n.rects.reference[u],k=Md(s),_=k?u==="y"?k.clientHeight||0:k.clientWidth||0:0,j=b/2-w/2,I=m[x],M=_-v[h]-m[y],E=_/2-v[h]/2+j,O=Bu(I,E,M),D=u;n.modifiersData[r]=(t={},t[D]=O,t.centerOffset=O-E,t)}}function Bz(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)||B3(t.elements.popper,o)&&(t.elements.arrow=o))}const Hz={name:"arrow",enabled:!0,phase:"main",fn:Fz,effect:Bz,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Cc(e){return e.split("-")[1]}var Vz={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wz(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:bc(n*o)/o||0,y:bc(r*o)/o||0}}function Qw(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,i=e.offsets,l=e.position,u=e.gpuAcceleration,p=e.adaptive,h=e.roundOffsets,m=e.isFixed,v=i.x,x=v===void 0?0:v,y=i.y,b=y===void 0?0:y,w=typeof h=="function"?h({x,y:b}):{x,y:b};x=w.x,b=w.y;var k=i.hasOwnProperty("x"),_=i.hasOwnProperty("y"),j=jr,I=_r,M=window;if(p){var E=Md(n),O="clientHeight",D="clientWidth";if(E===Hr(n)&&(E=Ja(n),ta(E).position!=="static"&&l==="absolute"&&(O="scrollHeight",D="scrollWidth")),E=E,o===_r||(o===jr||o===mo)&&s===td){I=ho;var A=m&&E===M&&M.visualViewport?M.visualViewport.height:E[O];b-=A-r.height,b*=u?1:-1}if(o===jr||(o===_r||o===ho)&&s===td){j=mo;var R=m&&E===M&&M.visualViewport?M.visualViewport.width:E[D];x-=R-r.width,x*=u?1:-1}}var T=Object.assign({position:l},p&&Vz),X=h===!0?Wz({x,y:b},Hr(n)):{x,y:b};if(x=X.x,b=X.y,u){var B;return Object.assign({},T,(B={},B[I]=_?"0":"",B[j]=k?"0":"",B.transform=(M.devicePixelRatio||1)<=1?"translate("+x+"px, "+b+"px)":"translate3d("+x+"px, "+b+"px, 0)",B))}return Object.assign({},T,(t={},t[I]=_?b+"px":"",t[j]=k?x+"px":"",t.transform="",t))}function Uz(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,i=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,p={placement:hs(t.placement),variation:Cc(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,Qw(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Qw(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Gz={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Uz,data:{}};var Kf={passive:!0};function Kz(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,l=i===void 0?!0:i,u=Hr(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&p.forEach(function(h){h.addEventListener("scroll",n.update,Kf)}),l&&u.addEventListener("resize",n.update,Kf),function(){s&&p.forEach(function(h){h.removeEventListener("scroll",n.update,Kf)}),l&&u.removeEventListener("resize",n.update,Kf)}}const qz={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Kz,data:{}};var Xz={left:"right",right:"left",bottom:"top",top:"bottom"};function Ep(e){return e.replace(/left|right|bottom|top/g,function(t){return Xz[t]})}var Yz={start:"end",end:"start"};function Zw(e){return e.replace(/start|end/g,function(t){return Yz[t]})}function kb(e){var t=Hr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function _b(e){return yc(Ja(e)).left+kb(e).scrollLeft}function Qz(e,t){var n=Hr(e),r=Ja(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,l=0,u=0;if(o){s=o.width,i=o.height;var p=F3();(p||!p&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:l+_b(e),y:u}}function Zz(e){var t,n=Ja(e),r=kb(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=ji(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=ji(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+_b(e),u=-r.scrollTop;return ta(o||n).direction==="rtl"&&(l+=ji(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:l,y:u}}function jb(e){var t=ta(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function U3(e){return["html","body","#document"].indexOf(ms(e))>=0?e.ownerDocument.body:uo(e)&&jb(e)?e:U3(Em(e))}function Hu(e,t){var n;t===void 0&&(t=[]);var r=U3(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Hr(r),i=o?[s].concat(s.visualViewport||[],jb(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(Hu(Em(i)))}function I1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Jz(e,t){var n=yc(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 Jw(e,t,n){return t===L3?I1(Qz(e,n)):Li(t)?Jz(t,n):I1(Zz(Ja(e)))}function eF(e){var t=Hu(Em(e)),n=["absolute","fixed"].indexOf(ta(e).position)>=0,r=n&&uo(e)?Md(e):e;return Li(r)?t.filter(function(o){return Li(o)&&B3(o,r)&&ms(o)!=="body"}):[]}function tF(e,t,n,r){var o=t==="clippingParents"?eF(e):[].concat(t),s=[].concat(o,[n]),i=s[0],l=s.reduce(function(u,p){var h=Jw(e,p,r);return u.top=ji(h.top,u.top),u.right=nh(h.right,u.right),u.bottom=nh(h.bottom,u.bottom),u.left=ji(h.left,u.left),u},Jw(e,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function G3(e){var t=e.reference,n=e.element,r=e.placement,o=r?hs(r):null,s=r?Cc(r):null,i=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(o){case _r:u={x:i,y:t.y-n.height};break;case ho:u={x:i,y:t.y+t.height};break;case mo:u={x:t.x+t.width,y:l};break;case jr:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var p=o?Sb(o):null;if(p!=null){var h=p==="y"?"height":"width";switch(s){case xc:u[p]=u[p]-(t[h]/2-n[h]/2);break;case td:u[p]=u[p]+(t[h]/2-n[h]/2);break}}return u}function nd(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,i=s===void 0?e.strategy:s,l=n.boundary,u=l===void 0?Cz:l,p=n.rootBoundary,h=p===void 0?L3:p,m=n.elementContext,v=m===void 0?yu:m,x=n.altBoundary,y=x===void 0?!1:x,b=n.padding,w=b===void 0?0:b,k=V3(typeof w!="number"?w:W3(w,Ed)),_=v===yu?wz:yu,j=e.rects.popper,I=e.elements[y?_:v],M=tF(Li(I)?I:I.contextElement||Ja(e.elements.popper),u,h,i),E=yc(e.elements.reference),O=G3({reference:E,element:j,strategy:"absolute",placement:o}),D=I1(Object.assign({},j,O)),A=v===yu?D:E,R={top:M.top-A.top+k.top,bottom:A.bottom-M.bottom+k.bottom,left:M.left-A.left+k.left,right:A.right-M.right+k.right},T=e.modifiersData.offset;if(v===yu&&T){var X=T[o];Object.keys(R).forEach(function(B){var U=[mo,ho].indexOf(B)>=0?1:-1,Y=[_r,ho].indexOf(B)>=0?"y":"x";R[B]+=X[Y]*U})}return R}function nF(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,p=u===void 0?z3:u,h=Cc(r),m=h?l?Xw:Xw.filter(function(y){return Cc(y)===h}):Ed,v=m.filter(function(y){return p.indexOf(y)>=0});v.length===0&&(v=m);var x=v.reduce(function(y,b){return y[b]=nd(e,{placement:b,boundary:o,rootBoundary:s,padding:i})[hs(b)],y},{});return Object.keys(x).sort(function(y,b){return x[y]-x[b]})}function rF(e){if(hs(e)===yb)return[];var t=Ep(e);return[Zw(e),t,Zw(t)]}function oF(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,i=n.altAxis,l=i===void 0?!0:i,u=n.fallbackPlacements,p=n.padding,h=n.boundary,m=n.rootBoundary,v=n.altBoundary,x=n.flipVariations,y=x===void 0?!0:x,b=n.allowedAutoPlacements,w=t.options.placement,k=hs(w),_=k===w,j=u||(_||!y?[Ep(w)]:rF(w)),I=[w].concat(j).reduce(function(se,W){return se.concat(hs(W)===yb?nF(t,{placement:W,boundary:h,rootBoundary:m,padding:p,flipVariations:y,allowedAutoPlacements:b}):W)},[]),M=t.rects.reference,E=t.rects.popper,O=new Map,D=!0,A=I[0],R=0;R<I.length;R++){var T=I[R],X=hs(T),B=Cc(T)===xc,U=[_r,ho].indexOf(X)>=0,Y=U?"width":"height",V=nd(t,{placement:T,boundary:h,rootBoundary:m,altBoundary:v,padding:p}),L=U?B?mo:jr:B?ho:_r;M[Y]>E[Y]&&(L=Ep(L));var q=Ep(L),z=[];if(s&&z.push(V[X]<=0),l&&z.push(V[L]<=0,V[q]<=0),z.every(function(se){return se})){A=T,D=!1;break}O.set(T,z)}if(D)for(var K=y?3:1,re=function(W){var G=I.find(function(te){var ae=O.get(te);if(ae)return ae.slice(0,W).every(function(oe){return oe})});if(G)return A=G,"break"},Q=K;Q>0;Q--){var le=re(Q);if(le==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const sF={name:"flip",enabled:!0,phase:"main",fn:oF,requiresIfExists:["offset"],data:{_skip:!1}};function eS(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 tS(e){return[_r,mo,ho,jr].some(function(t){return e[t]>=0})}function aF(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,i=nd(t,{elementContext:"reference"}),l=nd(t,{altBoundary:!0}),u=eS(i,r),p=eS(l,o,s),h=tS(u),m=tS(p);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:p,isReferenceHidden:h,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":m})}const iF={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:aF};function lF(e,t,n){var r=hs(e),o=[jr,_r].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=s[0],l=s[1];return i=i||0,l=(l||0)*o,[jr,mo].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function cF(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,i=z3.reduce(function(h,m){return h[m]=lF(m,t.rects,s),h},{}),l=i[t.placement],u=l.x,p=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=i}const uF={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:cF};function dF(e){var t=e.state,n=e.name;t.modifiersData[n]=G3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const fF={name:"popperOffsets",enabled:!0,phase:"read",fn:dF,data:{}};function pF(e){return e==="x"?"y":"x"}function hF(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!1:i,u=n.boundary,p=n.rootBoundary,h=n.altBoundary,m=n.padding,v=n.tether,x=v===void 0?!0:v,y=n.tetherOffset,b=y===void 0?0:y,w=nd(t,{boundary:u,rootBoundary:p,padding:m,altBoundary:h}),k=hs(t.placement),_=Cc(t.placement),j=!_,I=Sb(k),M=pF(I),E=t.modifiersData.popperOffsets,O=t.rects.reference,D=t.rects.popper,A=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,R=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(E){if(s){var B,U=I==="y"?_r:jr,Y=I==="y"?ho:mo,V=I==="y"?"height":"width",L=E[I],q=L+w[U],z=L-w[Y],K=x?-D[V]/2:0,re=_===xc?O[V]:D[V],Q=_===xc?-D[V]:-O[V],le=t.elements.arrow,se=x&&le?wb(le):{width:0,height:0},W=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:H3(),G=W[U],te=W[Y],ae=Bu(0,O[V],se[V]),oe=j?O[V]/2-K-ae-G-R.mainAxis:re-ae-G-R.mainAxis,pe=j?-O[V]/2+K+ae+te+R.mainAxis:Q+ae+te+R.mainAxis,fe=t.elements.arrow&&Md(t.elements.arrow),ge=fe?I==="y"?fe.clientTop||0:fe.clientLeft||0:0,Ce=(B=T==null?void 0:T[I])!=null?B:0,me=L+oe-Ce-ge,de=L+pe-Ce,De=Bu(x?nh(q,me):q,L,x?ji(z,de):z);E[I]=De,X[I]=De-L}if(l){var je,Be=I==="x"?_r:jr,rt=I==="x"?ho:mo,Ue=E[M],wt=M==="y"?"height":"width",Xe=Ue+w[Be],tt=Ue-w[rt],xe=[_r,jr].indexOf(k)!==-1,Re=(je=T==null?void 0:T[M])!=null?je:0,st=xe?Xe:Ue-O[wt]-D[wt]-Re+R.altAxis,mt=xe?Ue+O[wt]+D[wt]-Re-R.altAxis:tt,ve=x&&xe?Lz(st,Ue,mt):Bu(x?st:Xe,Ue,x?mt:tt);E[M]=ve,X[M]=ve-Ue}t.modifiersData[r]=X}}const mF={name:"preventOverflow",enabled:!0,phase:"main",fn:hF,requiresIfExists:["offset"]};function gF(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function vF(e){return e===Hr(e)||!uo(e)?kb(e):gF(e)}function xF(e){var t=e.getBoundingClientRect(),n=bc(t.width)/e.offsetWidth||1,r=bc(t.height)/e.offsetHeight||1;return n!==1||r!==1}function bF(e,t,n){n===void 0&&(n=!1);var r=uo(t),o=uo(t)&&xF(t),s=Ja(t),i=yc(e,o,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((ms(t)!=="body"||jb(s))&&(l=vF(t)),uo(t)?(u=yc(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=_b(s))),{x:i.left+l.scrollLeft-u.x,y:i.top+l.scrollTop-u.y,width:i.width,height:i.height}}function yF(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 i=[].concat(s.requires||[],s.requiresIfExists||[]);i.forEach(function(l){if(!n.has(l)){var u=t.get(l);u&&o(u)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function CF(e){var t=yF(e);return Dz.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function wF(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function SF(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 nS={placement:"bottom",modifiers:[],strategy:"absolute"};function rS(){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 kF(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?nS:o;return function(l,u,p){p===void 0&&(p=s);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},nS,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},m=[],v=!1,x={state:h,setOptions:function(k){var _=typeof k=="function"?k(h.options):k;b(),h.options=Object.assign({},s,h.options,_),h.scrollParents={reference:Li(l)?Hu(l):l.contextElement?Hu(l.contextElement):[],popper:Hu(u)};var j=CF(SF([].concat(r,h.options.modifiers)));return h.orderedModifiers=j.filter(function(I){return I.enabled}),y(),x.update()},forceUpdate:function(){if(!v){var k=h.elements,_=k.reference,j=k.popper;if(rS(_,j)){h.rects={reference:bF(_,Md(j),h.options.strategy==="fixed"),popper:wb(j)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(R){return h.modifiersData[R.name]=Object.assign({},R.data)});for(var I=0;I<h.orderedModifiers.length;I++){if(h.reset===!0){h.reset=!1,I=-1;continue}var M=h.orderedModifiers[I],E=M.fn,O=M.options,D=O===void 0?{}:O,A=M.name;typeof E=="function"&&(h=E({state:h,options:D,name:A,instance:x})||h)}}}},update:wF(function(){return new Promise(function(w){x.forceUpdate(),w(h)})}),destroy:function(){b(),v=!0}};if(!rS(l,u))return x;x.setOptions(p).then(function(w){!v&&p.onFirstUpdate&&p.onFirstUpdate(w)});function y(){h.orderedModifiers.forEach(function(w){var k=w.name,_=w.options,j=_===void 0?{}:_,I=w.effect;if(typeof I=="function"){var M=I({state:h,name:k,instance:x,options:j}),E=function(){};m.push(M||E)}})}function b(){m.forEach(function(w){return w()}),m=[]}return x}}var _F=[qz,fF,Gz,Nz,uF,sF,mF,Hz,iF],jF=kF({defaultModifiers:_F});function Pb(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:i=!0,offset:l,gutter:u=8,flip:p=!0,boundary:h="clippingParents",preventOverflow:m=!0,matchWidth:v,direction:x="ltr"}=e,y=d.useRef(null),b=d.useRef(null),w=d.useRef(null),k=yz(r,x),_=d.useRef(()=>{}),j=d.useCallback(()=>{var R;!t||!y.current||!b.current||((R=_.current)==null||R.call(_),w.current=jF(y.current,b.current,{placement:k,modifiers:[vz,hz,pz,{...fz,enabled:!!v},{name:"eventListeners",...dz(i)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:l??[0,u]}},{name:"flip",enabled:!!p,options:{padding:8}},{name:"preventOverflow",enabled:!!m,options:{boundary:h}},...n??[]],strategy:o}),w.current.forceUpdate(),_.current=w.current.destroy)},[k,t,n,v,i,s,l,u,p,m,h,o]);d.useEffect(()=>()=>{var R;!y.current&&!b.current&&((R=w.current)==null||R.destroy(),w.current=null)},[]);const I=d.useCallback(R=>{y.current=R,j()},[j]),M=d.useCallback((R={},T=null)=>({...R,ref:Ct(I,T)}),[I]),E=d.useCallback(R=>{b.current=R,j()},[j]),O=d.useCallback((R={},T=null)=>({...R,ref:Ct(E,T),style:{...R.style,position:o,minWidth:v?void 0:"max-content",inset:"0 auto auto 0"}}),[o,E,v]),D=d.useCallback((R={},T=null)=>{const{size:X,shadowColor:B,bg:U,style:Y,...V}=R;return{...V,ref:T,"data-popper-arrow":"",style:PF(R)}},[]),A=d.useCallback((R={},T=null)=>({...R,ref:T,"data-popper-arrow-inner":""}),[]);return{update(){var R;(R=w.current)==null||R.update()},forceUpdate(){var R;(R=w.current)==null||R.forceUpdate()},transformOrigin:jn.transformOrigin.varRef,referenceRef:I,popperRef:E,getPopperProps:O,getArrowProps:D,getArrowInnerProps:A,getReferenceProps:M}}function PF(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 Ib(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=nn(n),i=nn(t),[l,u]=d.useState(e.defaultIsOpen||!1),p=r!==void 0?r:l,h=r!==void 0,m=d.useId(),v=o??`disclosure-${m}`,x=d.useCallback(()=>{h||u(!1),i==null||i()},[h,i]),y=d.useCallback(()=>{h||u(!0),s==null||s()},[h,s]),b=d.useCallback(()=>{p?x():y()},[p,y,x]);function w(_={}){return{..._,"aria-expanded":p,"aria-controls":v,onClick(j){var I;(I=_.onClick)==null||I.call(_,j),b()}}}function k(_={}){return{..._,hidden:!p,id:v}}return{isOpen:p,onOpen:y,onClose:x,onToggle:b,isControlled:h,getButtonProps:w,getDisclosureProps:k}}function IF(e){const{ref:t,handler:n,enabled:r=!0}=e,o=nn(n),i=d.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;d.useEffect(()=>{if(!r)return;const l=m=>{av(m,t)&&(i.isPointerDown=!0)},u=m=>{if(i.ignoreEmulatedMouseEvents){i.ignoreEmulatedMouseEvents=!1;return}i.isPointerDown&&n&&av(m,t)&&(i.isPointerDown=!1,o(m))},p=m=>{i.ignoreEmulatedMouseEvents=!0,n&&i.isPointerDown&&av(m,t)&&(i.isPointerDown=!1,o(m))},h=K3(t.current);return h.addEventListener("mousedown",l,!0),h.addEventListener("mouseup",u,!0),h.addEventListener("touchstart",l,!0),h.addEventListener("touchend",p,!0),()=>{h.removeEventListener("mousedown",l,!0),h.removeEventListener("mouseup",u,!0),h.removeEventListener("touchstart",l,!0),h.removeEventListener("touchend",p,!0)}},[n,t,o,i,r])}function av(e,t){var n;const r=e.target;return r&&!K3(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function K3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function q3(e){const{isOpen:t,ref:n}=e,[r,o]=d.useState(t),[s,i]=d.useState(!1);return d.useEffect(()=>{s||(o(t),i(!0))},[t,s,r]),_i(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var u;const p=OL(n.current),h=new p.CustomEvent("animationend",{bubbles:!0});(u=n.current)==null||u.dispatchEvent(h)}}}function Eb(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[EF,MF,OF,DF]=Qx(),[RF,Od]=$t({strict:!1,name:"MenuContext"});function AF(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function X3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function oS(e){return X3(e).activeElement===e}function NF(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:i,isOpen:l,defaultIsOpen:u,onClose:p,onOpen:h,placement:m="bottom-start",lazyBehavior:v="unmount",direction:x,computePositionOnMount:y=!1,...b}=e,w=d.useRef(null),k=d.useRef(null),_=OF(),j=d.useCallback(()=>{requestAnimationFrame(()=>{var le;(le=w.current)==null||le.focus({preventScroll:!1})})},[]),I=d.useCallback(()=>{const le=setTimeout(()=>{var se;if(o)(se=o.current)==null||se.focus();else{const W=_.firstEnabled();W&&B(W.index)}});q.current.add(le)},[_,o]),M=d.useCallback(()=>{const le=setTimeout(()=>{const se=_.lastEnabled();se&&B(se.index)});q.current.add(le)},[_]),E=d.useCallback(()=>{h==null||h(),s?I():j()},[s,I,j,h]),{isOpen:O,onOpen:D,onClose:A,onToggle:R}=Ib({isOpen:l,defaultIsOpen:u,onClose:p,onOpen:E});IF({enabled:O&&r,ref:w,handler:le=>{var se;(se=k.current)!=null&&se.contains(le.target)||A()}});const T=Pb({...b,enabled:O||y,placement:m,direction:x}),[X,B]=d.useState(-1);la(()=>{O||B(-1)},[O]),$3(w,{focusRef:k,visible:O,shouldFocus:!0});const U=q3({isOpen:O,ref:w}),[Y,V]=AF(t,"menu-button","menu-list"),L=d.useCallback(()=>{D(),j()},[D,j]),q=d.useRef(new Set([]));VF(()=>{q.current.forEach(le=>clearTimeout(le)),q.current.clear()});const z=d.useCallback(()=>{D(),I()},[I,D]),K=d.useCallback(()=>{D(),M()},[D,M]),re=d.useCallback(()=>{var le,se;const W=X3(w.current),G=(le=w.current)==null?void 0:le.contains(W.activeElement);if(!(O&&!G))return;const ae=(se=_.item(X))==null?void 0:se.node;ae==null||ae.focus()},[O,X,_]),Q=d.useRef(null);return{openAndFocusMenu:L,openAndFocusFirstItem:z,openAndFocusLastItem:K,onTransitionEnd:re,unstable__animationState:U,descendants:_,popper:T,buttonId:Y,menuId:V,forceUpdate:T.forceUpdate,orientation:"vertical",isOpen:O,onToggle:R,onOpen:D,onClose:A,menuRef:w,buttonRef:k,focusedIndex:X,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:B,isLazy:i,lazyBehavior:v,initialFocusRef:o,rafId:Q}}function TF(e={},t=null){const n=Od(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:i}=n,l=d.useCallback(u=>{const p=u.key,m={Enter:s,ArrowDown:s,ArrowUp:i}[p];m&&(u.preventDefault(),u.stopPropagation(),m(u))},[s,i]);return{...e,ref:Ct(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":at(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:Fe(e.onClick,r),onKeyDown:Fe(e.onKeyDown,l)}}function E1(e){var t;return BF(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function $F(e={},t=null){const n=Od();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");const{focusedIndex:r,setFocusedIndex:o,menuRef:s,isOpen:i,onClose:l,menuId:u,isLazy:p,lazyBehavior:h,unstable__animationState:m}=n,v=MF(),x=tz({preventDefault:k=>k.key!==" "&&E1(k.target)}),y=d.useCallback(k=>{if(!k.currentTarget.contains(k.target))return;const _=k.key,I={Tab:E=>E.preventDefault(),Escape:l,ArrowDown:()=>{const E=v.nextEnabled(r);E&&o(E.index)},ArrowUp:()=>{const E=v.prevEnabled(r);E&&o(E.index)}}[_];if(I){k.preventDefault(),I(k);return}const M=x(E=>{const O=nz(v.values(),E,D=>{var A,R;return(R=(A=D==null?void 0:D.node)==null?void 0:A.textContent)!=null?R:""},v.item(r));if(O){const D=v.indexOf(O.node);o(D)}});E1(k.target)&&M(k)},[v,r,x,l,o]),b=d.useRef(!1);i&&(b.current=!0);const w=Eb({wasSelected:b.current,enabled:p,mode:h,isSelected:m.present});return{...e,ref:Ct(s,t),children:w?e.children:null,tabIndex:-1,role:"menu",id:u,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:Fe(e.onKeyDown,y)}}function LF(e={}){const{popper:t,isOpen:n}=Od();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function Y3(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:i,isDisabled:l,isFocusable:u,closeOnSelect:p,type:h,...m}=e,v=Od(),{setFocusedIndex:x,focusedIndex:y,closeOnSelect:b,onClose:w,menuRef:k,isOpen:_,menuId:j,rafId:I}=v,M=d.useRef(null),E=`${j}-menuitem-${d.useId()}`,{index:O,register:D}=DF({disabled:l&&!u}),A=d.useCallback(L=>{n==null||n(L),!l&&x(O)},[x,O,l,n]),R=d.useCallback(L=>{r==null||r(L),M.current&&!oS(M.current)&&A(L)},[A,r]),T=d.useCallback(L=>{o==null||o(L),!l&&x(-1)},[x,l,o]),X=d.useCallback(L=>{s==null||s(L),E1(L.currentTarget)&&(p??b)&&w()},[w,s,b,p]),B=d.useCallback(L=>{i==null||i(L),x(O)},[x,i,O]),U=O===y,Y=l&&!u;la(()=>{_&&(U&&!Y&&M.current?(I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{var L;(L=M.current)==null||L.focus(),I.current=null})):k.current&&!oS(k.current)&&k.current.focus({preventScroll:!0}))},[U,Y,k,_]);const V=T3({onClick:X,onFocus:B,onMouseEnter:A,onMouseMove:R,onMouseLeave:T,ref:Ct(D,M,t),isDisabled:l,isFocusable:u});return{...m,...V,type:h??V.type,id:E,role:"menuitem",tabIndex:U?0:-1}}function zF(e={},t=null){const{type:n="radio",isChecked:r,...o}=e;return{...Y3(o,t),role:`menuitem${n}`,"aria-checked":r}}function FF(e={}){const{children:t,type:n="radio",value:r,defaultValue:o,onChange:s,...i}=e,u=n==="radio"?"":[],[p,h]=Rc({defaultValue:o??u,value:r,onChange:s}),m=d.useCallback(y=>{if(n==="radio"&&typeof p=="string"&&h(y),n==="checkbox"&&Array.isArray(p)){const b=p.includes(y)?p.filter(w=>w!==y):p.concat(y);h(b)}},[p,h,n]),x=_d(t).map(y=>{if(y.type.id!=="MenuItemOption")return y;const b=k=>{var _,j;m(y.props.value),(j=(_=y.props).onClick)==null||j.call(_,k)},w=n==="radio"?y.props.value===p:p.includes(y.props.value);return d.cloneElement(y,{type:n,onClick:b,isChecked:w})});return{...i,children:x}}function BF(e){var t;if(!HF(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function HF(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function VF(e,t=[]){return d.useEffect(()=>()=>e(),t)}var[WF,Tc]=$t({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),Dd=e=>{const{children:t}=e,n=Hn("Menu",e),r=Yt(e),{direction:o}=xd(),{descendants:s,...i}=NF({...r,direction:o}),l=d.useMemo(()=>i,[i]),{isOpen:u,onClose:p,forceUpdate:h}=l;return a.jsx(EF,{value:s,children:a.jsx(RF,{value:l,children:a.jsx(WF,{value:n,children:Ax(t,{isOpen:u,onClose:p,forceUpdate:h})})})})};Dd.displayName="Menu";var Q3=Pe((e,t)=>{const n=Tc();return a.jsx(_e.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});Q3.displayName="MenuCommand";var Z3=Pe((e,t)=>{const{type:n,...r}=e,o=Tc(),s=r.as||n?n??void 0:"button",i=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(_e.button,{ref:t,type:s,...r,__css:i})}),Mb=e=>{const{className:t,children:n,...r}=e,o=Tc(),s=d.Children.only(n),i=d.isValidElement(s)?d.cloneElement(s,{focusable:"false","aria-hidden":!0,className:et("chakra-menu__icon",s.props.className)}):null,l=et("chakra-menu__icon-wrapper",t);return a.jsx(_e.span,{className:l,...r,__css:o.icon,children:i})};Mb.displayName="MenuIcon";var Vt=Pe((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:i,...l}=e,u=Y3(l,t),h=n||o?a.jsx("span",{style:{pointerEvents:"none",flex:1},children:i}):i;return a.jsxs(Z3,{...u,className:et("chakra-menu__menuitem",u.className),children:[n&&a.jsx(Mb,{fontSize:"0.8em",marginEnd:r,children:n}),h,o&&a.jsx(Q3,{marginStart:s,children:o})]})});Vt.displayName="MenuItem";var UF={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"}}},GF=_e(vn.div),Ga=Pe(function(t,n){var r,o;const{rootProps:s,motionProps:i,...l}=t,{isOpen:u,onTransitionEnd:p,unstable__animationState:h}=Od(),m=$F(l,n),v=LF(s),x=Tc();return a.jsx(_e.div,{...v,__css:{zIndex:(o=t.zIndex)!=null?o:(r=x.list)==null?void 0:r.zIndex},children:a.jsx(GF,{variants:UF,initial:!1,animate:u?"enter":"exit",__css:{outline:0,...x.list},...i,className:et("chakra-menu__menu-list",m.className),...m,onUpdate:p,onAnimationComplete:cm(h.onComplete,m.onAnimationComplete)})})});Ga.displayName="MenuList";var wc=Pe((e,t)=>{const{title:n,children:r,className:o,...s}=e,i=et("chakra-menu__group__title",o),l=Tc();return a.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&a.jsx(_e.p,{className:i,...s,__css:l.groupTitle,children:n}),r]})});wc.displayName="MenuGroup";var J3=e=>{const{className:t,title:n,...r}=e,o=FF(r);return a.jsx(wc,{title:n,className:et("chakra-menu__option-group",t),...o})};J3.displayName="MenuOptionGroup";var KF=Pe((e,t)=>{const n=Tc();return a.jsx(_e.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Rd=Pe((e,t)=>{const{children:n,as:r,...o}=e,s=TF(o,t),i=r||KF;return a.jsx(i,{...s,className:et("chakra-menu__menu-button",e.className),children:a.jsx(_e.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Rd.displayName="MenuButton";var qF=e=>a.jsx("svg",{viewBox:"0 0 14 14",width:"1em",height:"1em",...e,children:a.jsx("polygon",{fill:"currentColor",points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})}),rh=Pe((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",...o}=e,s=zF(o,t);return a.jsxs(Z3,{...s,className:et("chakra-menu__menuitem-option",o.className),children:[n!==null&&a.jsx(Mb,{fontSize:"0.8em",marginEnd:r,opacity:e.isChecked?1:0,children:n||a.jsx(qF,{})}),a.jsx("span",{style:{flex:1},children:s.children})]})});rh.id="MenuItemOption";rh.displayName="MenuItemOption";var XF={slideInBottom:{...m1,custom:{offsetY:16,reverse:!0}},slideInRight:{...m1,custom:{offsetX:16,reverse:!0}},scale:{...E5,custom:{initialScale:.95,reverse:!0}},none:{}},YF=_e(vn.section),QF=e=>XF[e||"none"],eP=d.forwardRef((e,t)=>{const{preset:n,motionProps:r=QF(n),...o}=e;return a.jsx(YF,{ref:t,...r,...o})});eP.displayName="ModalTransition";var ZF=Object.defineProperty,JF=(e,t,n)=>t in e?ZF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eB=(e,t,n)=>(JF(e,typeof t!="symbol"?t+"":t,n),n),tB=class{constructor(){eB(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}},M1=new tB;function tP(e,t){const[n,r]=d.useState(0);return d.useEffect(()=>{const o=e.current;if(o){if(t){const s=M1.add(o);r(s)}return()=>{M1.remove(o),r(0)}}},[t,e]),n}var nB=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},jl=new WeakMap,qf=new WeakMap,Xf={},iv=0,nP=function(e){return e&&(e.host||nP(e.parentNode))},rB=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=nP(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})},oB=function(e,t,n,r){var o=rB(t,Array.isArray(e)?e:[e]);Xf[n]||(Xf[n]=new WeakMap);var s=Xf[n],i=[],l=new Set,u=new Set(o),p=function(m){!m||l.has(m)||(l.add(m),p(m.parentNode))};o.forEach(p);var h=function(m){!m||u.has(m)||Array.prototype.forEach.call(m.children,function(v){if(l.has(v))h(v);else{var x=v.getAttribute(r),y=x!==null&&x!=="false",b=(jl.get(v)||0)+1,w=(s.get(v)||0)+1;jl.set(v,b),s.set(v,w),i.push(v),b===1&&y&&qf.set(v,!0),w===1&&v.setAttribute(n,"true"),y||v.setAttribute(r,"true")}})};return h(t),l.clear(),iv++,function(){i.forEach(function(m){var v=jl.get(m)-1,x=s.get(m)-1;jl.set(m,v),s.set(m,x),v||(qf.has(m)||m.removeAttribute(r),qf.delete(m)),x||m.removeAttribute(n)}),iv--,iv||(jl=new WeakMap,jl=new WeakMap,qf=new WeakMap,Xf={})}},sB=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||nB(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),oB(r,o,n,"aria-hidden")):function(){return null}};function aB(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:i=!0,onOverlayClick:l,onEsc:u}=e,p=d.useRef(null),h=d.useRef(null),[m,v,x]=lB(r,"chakra-modal","chakra-modal--header","chakra-modal--body");iB(p,t&&i);const y=tP(p,t),b=d.useRef(null),w=d.useCallback(A=>{b.current=A.target},[]),k=d.useCallback(A=>{A.key==="Escape"&&(A.stopPropagation(),s&&(n==null||n()),u==null||u())},[s,n,u]),[_,j]=d.useState(!1),[I,M]=d.useState(!1),E=d.useCallback((A={},R=null)=>({role:"dialog",...A,ref:Ct(R,p),id:m,tabIndex:-1,"aria-modal":!0,"aria-labelledby":_?v:void 0,"aria-describedby":I?x:void 0,onClick:Fe(A.onClick,T=>T.stopPropagation())}),[x,I,m,v,_]),O=d.useCallback(A=>{A.stopPropagation(),b.current===A.target&&M1.isTopModal(p.current)&&(o&&(n==null||n()),l==null||l())},[n,o,l]),D=d.useCallback((A={},R=null)=>({...A,ref:Ct(R,h),onClick:Fe(A.onClick,O),onKeyDown:Fe(A.onKeyDown,k),onMouseDown:Fe(A.onMouseDown,w)}),[k,w,O]);return{isOpen:t,onClose:n,headerId:v,bodyId:x,setBodyMounted:M,setHeaderMounted:j,dialogRef:p,overlayRef:h,getDialogProps:E,getDialogContainerProps:D,index:y}}function iB(e,t){const n=e.current;d.useEffect(()=>{if(!(!e.current||!t))return sB(e.current)},[t,e,n])}function lB(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[cB,$c]=$t({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[uB,zi]=$t({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),Fi=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:l,returnFocusOnClose:u,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:x,onCloseComplete:y}=t,b=Hn("Modal",t),k={...aB(t),autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:l,returnFocusOnClose:u,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:x};return a.jsx(uB,{value:k,children:a.jsx(cB,{value:b,children:a.jsx(nr,{onExitComplete:y,children:k.isOpen&&a.jsx(wd,{...n,children:r})})})})};Fi.displayName="Modal";var Mp="right-scroll-bar-position",Op="width-before-scroll-bar",dB="with-scroll-bars-hidden",fB="--removed-body-scroll-bar-size",rP=Z5(),lv=function(){},Mm=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:lv,onWheelCapture:lv,onTouchMoveCapture:lv}),o=r[0],s=r[1],i=e.forwardProps,l=e.children,u=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,v=e.sideCar,x=e.noIsolation,y=e.inert,b=e.allowPinchZoom,w=e.as,k=w===void 0?"div":w,_=e.gapMode,j=X5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=v,M=q5([n,t]),E=us(us({},j),o);return d.createElement(d.Fragment,null,h&&d.createElement(I,{sideCar:rP,removeScrollBar:p,shards:m,noIsolation:x,inert:y,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:_}),i?d.cloneElement(d.Children.only(l),us(us({},E),{ref:M})):d.createElement(k,us({},E,{className:u,ref:M}),l))});Mm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Mm.classNames={fullWidth:Op,zeroRight:Mp};var sS,pB=function(){if(sS)return sS;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hB(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pB();return t&&e.setAttribute("nonce",t),e}function mB(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gB(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var vB=function(){var e=0,t=null;return{add:function(n){e==0&&(t=hB())&&(mB(t,n),gB(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xB=function(){var e=vB();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oP=function(){var e=xB(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},bB={left:0,top:0,right:0,gap:0},cv=function(e){return parseInt(e||"",10)||0},yB=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[cv(n),cv(r),cv(o)]},CB=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return bB;var t=yB(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])}},wB=oP(),SB=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(dB,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(l,"px ").concat(r,`;
|
||
}
|
||
body {
|
||
overflow: hidden `).concat(r,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
||
padding-left: `.concat(o,`px;
|
||
padding-top: `).concat(s,`px;
|
||
padding-right: `).concat(i,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(l,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Mp,` {
|
||
right: `).concat(l,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Op,` {
|
||
margin-right: `).concat(l,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Mp," .").concat(Mp,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(Op," .").concat(Op,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body {
|
||
`).concat(fB,": ").concat(l,`px;
|
||
}
|
||
`)},kB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=d.useMemo(function(){return CB(o)},[o]);return d.createElement(wB,{styles:SB(s,!t,o,n?"":"!important")})},O1=!1;if(typeof window<"u")try{var Yf=Object.defineProperty({},"passive",{get:function(){return O1=!0,!0}});window.addEventListener("test",Yf,Yf),window.removeEventListener("test",Yf,Yf)}catch{O1=!1}var Pl=O1?{passive:!1}:!1,_B=function(e){return e.tagName==="TEXTAREA"},sP=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_B(e)&&n[t]==="visible")},jB=function(e){return sP(e,"overflowY")},PB=function(e){return sP(e,"overflowX")},aS=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=aP(e,r);if(o){var s=iP(e,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},IB=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},EB=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},aP=function(e,t){return e==="v"?jB(t):PB(t)},iP=function(e,t){return e==="v"?IB(t):EB(t)},MB=function(e,t){return e==="h"&&t==="rtl"?-1:1},OB=function(e,t,n,r,o){var s=MB(e,window.getComputedStyle(t).direction),i=s*r,l=n.target,u=t.contains(l),p=!1,h=i>0,m=0,v=0;do{var x=iP(e,l),y=x[0],b=x[1],w=x[2],k=b-w-s*y;(y||k)&&aP(e,l)&&(m+=k,v+=y),l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(h&&(o&&m===0||!o&&i>m)||!h&&(o&&v===0||!o&&-i>v))&&(p=!0),p},Qf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},iS=function(e){return[e.deltaX,e.deltaY]},lS=function(e){return e&&"current"in e?e.current:e},DB=function(e,t){return e[0]===t[0]&&e[1]===t[1]},RB=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},AB=0,Il=[];function NB(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(AB++)[0],s=d.useState(oP)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=w1([e.lockRef.current],(e.shards||[]).map(lS),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=d.useCallback(function(b,w){if("touches"in b&&b.touches.length===2)return!i.current.allowPinchZoom;var k=Qf(b),_=n.current,j="deltaX"in b?b.deltaX:_[0]-k[0],I="deltaY"in b?b.deltaY:_[1]-k[1],M,E=b.target,O=Math.abs(j)>Math.abs(I)?"h":"v";if("touches"in b&&O==="h"&&E.type==="range")return!1;var D=aS(O,E);if(!D)return!0;if(D?M=O:(M=O==="v"?"h":"v",D=aS(O,E)),!D)return!1;if(!r.current&&"changedTouches"in b&&(j||I)&&(r.current=M),!M)return!0;var A=r.current||M;return OB(A,w,b,A==="h"?j:I,!0)},[]),u=d.useCallback(function(b){var w=b;if(!(!Il.length||Il[Il.length-1]!==s)){var k="deltaY"in w?iS(w):Qf(w),_=t.current.filter(function(M){return M.name===w.type&&M.target===w.target&&DB(M.delta,k)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var j=(i.current.shards||[]).map(lS).filter(Boolean).filter(function(M){return M.contains(w.target)}),I=j.length>0?l(w,j[0]):!i.current.noIsolation;I&&w.cancelable&&w.preventDefault()}}},[]),p=d.useCallback(function(b,w,k,_){var j={name:b,delta:w,target:k,should:_};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(I){return I!==j})},1)},[]),h=d.useCallback(function(b){n.current=Qf(b),r.current=void 0},[]),m=d.useCallback(function(b){p(b.type,iS(b),b.target,l(b,e.lockRef.current))},[]),v=d.useCallback(function(b){p(b.type,Qf(b),b.target,l(b,e.lockRef.current))},[]);d.useEffect(function(){return Il.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",u,Pl),document.addEventListener("touchmove",u,Pl),document.addEventListener("touchstart",h,Pl),function(){Il=Il.filter(function(b){return b!==s}),document.removeEventListener("wheel",u,Pl),document.removeEventListener("touchmove",u,Pl),document.removeEventListener("touchstart",h,Pl)}},[]);var x=e.removeScrollBar,y=e.inert;return d.createElement(d.Fragment,null,y?d.createElement(s,{styles:RB(o)}):null,x?d.createElement(kB,{gapMode:e.gapMode}):null)}const TB=A$(rP,NB);var lP=d.forwardRef(function(e,t){return d.createElement(Mm,us({},e,{ref:t,sideCar:TB}))});lP.classNames=Mm.classNames;const $B=lP;function LB(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:i,finalFocusRef:l,returnFocusOnClose:u,preserveScrollBarGap:p,lockFocusAcrossFrames:h,isOpen:m}=zi(),[v,x]=D7();d.useEffect(()=>{!v&&x&&setTimeout(x)},[v,x]);const y=tP(r,m);return a.jsx(E3,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:l,restoreFocus:u,contentRef:r,lockFocusAcrossFrames:h,children:a.jsx($B,{removeScrollBar:!p,allowPinchZoom:i,enabled:y===1&&s,forwardProps:!0,children:e.children})})}var Bi=Pe((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...i}=e,{getDialogProps:l,getDialogContainerProps:u}=zi(),p=l(i,t),h=u(o),m=et("chakra-modal__content",n),v=$c(),x={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},y={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{motionPreset:b}=zi();return a.jsx(LB,{children:a.jsx(_e.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:y,children:a.jsx(eP,{preset:b,motionProps:s,className:m,...p,__css:x,children:r})})})});Bi.displayName="ModalContent";function Ad(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(Fi,{...n,initialFocusRef:t})}var Nd=Pe((e,t)=>a.jsx(Bi,{ref:t,role:"alertdialog",...e})),gs=Pe((e,t)=>{const{className:n,...r}=e,o=et("chakra-modal__footer",n),i={display:"flex",alignItems:"center",justifyContent:"flex-end",...$c().footer};return a.jsx(_e.footer,{ref:t,...r,__css:i,className:o})});gs.displayName="ModalFooter";var Ho=Pe((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=zi();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=et("chakra-modal__header",n),u={flex:0,...$c().header};return a.jsx(_e.header,{ref:t,className:i,id:o,...r,__css:u})});Ho.displayName="ModalHeader";var zB=_e(vn.div),Vo=Pe((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,i=et("chakra-modal__overlay",n),u={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...$c().overlay},{motionPreset:p}=zi(),m=o||(p==="none"?{}:I5);return a.jsx(zB,{...m,__css:u,ref:t,className:i,...s})});Vo.displayName="ModalOverlay";var Wo=Pe((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=zi();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=et("chakra-modal__body",n),l=$c();return a.jsx(_e.div,{ref:t,className:i,id:o,...r,__css:l.body})});Wo.displayName="ModalBody";var Td=Pe((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=zi(),i=et("chakra-modal__close-btn",r),l=$c();return a.jsx(hN,{ref:t,__css:l.closeButton,className:i,onClick:Fe(n,u=>{u.stopPropagation(),s()}),...o})});Td.displayName="ModalCloseButton";var FB=e=>a.jsx(An,{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"})}),BB=e=>a.jsx(An,{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 cS(e,t,n,r){d.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,i=Array.isArray(t)?t:[t],l=new s.MutationObserver(u=>{for(const p of u)p.type==="attributes"&&p.attributeName&&i.includes(p.attributeName)&&n(p)});return l.observe(e.current,{attributes:!0,attributeFilter:i}),()=>l.disconnect()})}function HB(e,t){const n=nn(e);d.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var VB=50,uS=300;function WB(e,t){const[n,r]=d.useState(!1),[o,s]=d.useState(null),[i,l]=d.useState(!0),u=d.useRef(null),p=()=>clearTimeout(u.current);HB(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?VB:null);const h=d.useCallback(()=>{i&&e(),u.current=setTimeout(()=>{l(!1),r(!0),s("increment")},uS)},[e,i]),m=d.useCallback(()=>{i&&t(),u.current=setTimeout(()=>{l(!1),r(!0),s("decrement")},uS)},[t,i]),v=d.useCallback(()=>{l(!0),r(!1),p()},[]);return d.useEffect(()=>()=>p(),[]),{up:h,down:m,stop:v,isSpinning:n}}var UB=/^[Ee0-9+\-.]$/;function GB(e){return UB.test(e)}function KB(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 qB(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:o=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:i=1,isReadOnly:l,isDisabled:u,isRequired:p,isInvalid:h,pattern:m="[0-9]*(.[0-9]+)?",inputMode:v="decimal",allowMouseWheel:x,id:y,onChange:b,precision:w,name:k,"aria-describedby":_,"aria-label":j,"aria-labelledby":I,onFocus:M,onBlur:E,onInvalid:O,getAriaValueText:D,isValidCharacter:A,format:R,parse:T,...X}=e,B=nn(M),U=nn(E),Y=nn(O),V=nn(A??GB),L=nn(D),q=h$(e),{update:z,increment:K,decrement:re}=q,[Q,le]=d.useState(!1),se=!(l||u),W=d.useRef(null),G=d.useRef(null),te=d.useRef(null),ae=d.useRef(null),oe=d.useCallback(ve=>ve.split("").filter(V).join(""),[V]),pe=d.useCallback(ve=>{var Ye;return(Ye=T==null?void 0:T(ve))!=null?Ye:ve},[T]),fe=d.useCallback(ve=>{var Ye;return((Ye=R==null?void 0:R(ve))!=null?Ye:ve).toString()},[R]);la(()=>{(q.valueAsNumber>s||q.valueAsNumber<o)&&(Y==null||Y("rangeOverflow",fe(q.value),q.valueAsNumber))},[q.valueAsNumber,q.value,fe,Y]),Yl(()=>{if(!W.current)return;if(W.current.value!=q.value){const Ye=pe(W.current.value);q.setValue(oe(Ye))}},[pe,oe]);const ge=d.useCallback((ve=i)=>{se&&K(ve)},[K,se,i]),Ce=d.useCallback((ve=i)=>{se&&re(ve)},[re,se,i]),me=WB(ge,Ce);cS(te,"disabled",me.stop,me.isSpinning),cS(ae,"disabled",me.stop,me.isSpinning);const de=d.useCallback(ve=>{if(ve.nativeEvent.isComposing)return;const ot=pe(ve.currentTarget.value);z(oe(ot)),G.current={start:ve.currentTarget.selectionStart,end:ve.currentTarget.selectionEnd}},[z,oe,pe]),De=d.useCallback(ve=>{var Ye,ot,lt;B==null||B(ve),G.current&&(ve.target.selectionStart=(ot=G.current.start)!=null?ot:(Ye=ve.currentTarget.value)==null?void 0:Ye.length,ve.currentTarget.selectionEnd=(lt=G.current.end)!=null?lt:ve.currentTarget.selectionStart)},[B]),je=d.useCallback(ve=>{if(ve.nativeEvent.isComposing)return;KB(ve,V)||ve.preventDefault();const Ye=Be(ve)*i,ot=ve.key,Me={ArrowUp:()=>ge(Ye),ArrowDown:()=>Ce(Ye),Home:()=>z(o),End:()=>z(s)}[ot];Me&&(ve.preventDefault(),Me(ve))},[V,i,ge,Ce,z,o,s]),Be=ve=>{let Ye=1;return(ve.metaKey||ve.ctrlKey)&&(Ye=.1),ve.shiftKey&&(Ye=10),Ye},rt=d.useMemo(()=>{const ve=L==null?void 0:L(q.value);if(ve!=null)return ve;const Ye=q.value.toString();return Ye||void 0},[q.value,L]),Ue=d.useCallback(()=>{let ve=q.value;if(q.value==="")return;/^[eE]/.test(q.value.toString())?q.setValue(""):(q.valueAsNumber<o&&(ve=o),q.valueAsNumber>s&&(ve=s),q.cast(ve))},[q,s,o]),wt=d.useCallback(()=>{le(!1),n&&Ue()},[n,le,Ue]),Xe=d.useCallback(()=>{t&&requestAnimationFrame(()=>{var ve;(ve=W.current)==null||ve.focus()})},[t]),tt=d.useCallback(ve=>{ve.preventDefault(),me.up(),Xe()},[Xe,me]),xe=d.useCallback(ve=>{ve.preventDefault(),me.down(),Xe()},[Xe,me]);_i(()=>W.current,"wheel",ve=>{var Ye,ot;const Me=((ot=(Ye=W.current)==null?void 0:Ye.ownerDocument)!=null?ot:document).activeElement===W.current;if(!x||!Me)return;ve.preventDefault();const $e=Be(ve)*i,At=Math.sign(ve.deltaY);At===-1?ge($e):At===1&&Ce($e)},{passive:!1});const Re=d.useCallback((ve={},Ye=null)=>{const ot=u||r&&q.isAtMax;return{...ve,ref:Ct(Ye,te),role:"button",tabIndex:-1,onPointerDown:Fe(ve.onPointerDown,lt=>{lt.button!==0||ot||tt(lt)}),onPointerLeave:Fe(ve.onPointerLeave,me.stop),onPointerUp:Fe(ve.onPointerUp,me.stop),disabled:ot,"aria-disabled":co(ot)}},[q.isAtMax,r,tt,me.stop,u]),st=d.useCallback((ve={},Ye=null)=>{const ot=u||r&&q.isAtMin;return{...ve,ref:Ct(Ye,ae),role:"button",tabIndex:-1,onPointerDown:Fe(ve.onPointerDown,lt=>{lt.button!==0||ot||xe(lt)}),onPointerLeave:Fe(ve.onPointerLeave,me.stop),onPointerUp:Fe(ve.onPointerUp,me.stop),disabled:ot,"aria-disabled":co(ot)}},[q.isAtMin,r,xe,me.stop,u]),mt=d.useCallback((ve={},Ye=null)=>{var ot,lt,Me,$e;return{name:k,inputMode:v,type:"text",pattern:m,"aria-labelledby":I,"aria-label":j,"aria-describedby":_,id:y,disabled:u,...ve,readOnly:(ot=ve.readOnly)!=null?ot:l,"aria-readonly":(lt=ve.readOnly)!=null?lt:l,"aria-required":(Me=ve.required)!=null?Me:p,required:($e=ve.required)!=null?$e:p,ref:Ct(W,Ye),value:fe(q.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(q.valueAsNumber)?void 0:q.valueAsNumber,"aria-invalid":co(h??q.isOutOfRange),"aria-valuetext":rt,autoComplete:"off",autoCorrect:"off",onChange:Fe(ve.onChange,de),onKeyDown:Fe(ve.onKeyDown,je),onFocus:Fe(ve.onFocus,De,()=>le(!0)),onBlur:Fe(ve.onBlur,U,wt)}},[k,v,m,I,j,fe,_,y,u,p,l,h,q.value,q.valueAsNumber,q.isOutOfRange,o,s,rt,de,je,De,U,wt]);return{value:fe(q.value),valueAsNumber:q.valueAsNumber,isFocused:Q,isDisabled:u,isReadOnly:l,getIncrementButtonProps:Re,getDecrementButtonProps:st,getInputProps:mt,htmlProps:X}}var[XB,Om]=$t({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[YB,Ob]=$t({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Dm=Pe(function(t,n){const r=Hn("NumberInput",t),o=Yt(t),s=tb(o),{htmlProps:i,...l}=qB(s),u=d.useMemo(()=>l,[l]);return a.jsx(YB,{value:u,children:a.jsx(XB,{value:r,children:a.jsx(_e.div,{...i,ref:n,className:et("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Dm.displayName="NumberInput";var Rm=Pe(function(t,n){const r=Om();return a.jsx(_e.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});Rm.displayName="NumberInputStepper";var Am=Pe(function(t,n){const{getInputProps:r}=Ob(),o=r(t,n),s=Om();return a.jsx(_e.input,{...o,className:et("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Am.displayName="NumberInputField";var cP=_e("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Nm=Pe(function(t,n){var r;const o=Om(),{getDecrementButtonProps:s}=Ob(),i=s(t,n);return a.jsx(cP,{...i,__css:o.stepper,children:(r=t.children)!=null?r:a.jsx(FB,{})})});Nm.displayName="NumberDecrementStepper";var Tm=Pe(function(t,n){var r;const{getIncrementButtonProps:o}=Ob(),s=o(t,n),i=Om();return a.jsx(cP,{...s,__css:i.stepper,children:(r=t.children)!=null?r:a.jsx(BB,{})})});Tm.displayName="NumberIncrementStepper";var[QB,Lc]=$t({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[ZB,Db]=$t({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Rb(e){const t=d.Children.only(e.children),{getTriggerProps:n}=Lc();return d.cloneElement(t,n(t.props,t.ref))}Rb.displayName="PopoverTrigger";var El={click:"click",hover:"hover"};function JB(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:i=!0,arrowSize:l,arrowShadowColor:u,trigger:p=El.click,openDelay:h=200,closeDelay:m=200,isLazy:v,lazyBehavior:x="unmount",computePositionOnMount:y,...b}=e,{isOpen:w,onClose:k,onOpen:_,onToggle:j}=Ib(e),I=d.useRef(null),M=d.useRef(null),E=d.useRef(null),O=d.useRef(!1),D=d.useRef(!1);w&&(D.current=!0);const[A,R]=d.useState(!1),[T,X]=d.useState(!1),B=d.useId(),U=o??B,[Y,V,L,q]=["popover-trigger","popover-content","popover-header","popover-body"].map(de=>`${de}-${U}`),{referenceRef:z,getArrowProps:K,getPopperProps:re,getArrowInnerProps:Q,forceUpdate:le}=Pb({...b,enabled:w||!!y}),se=q3({isOpen:w,ref:E});H5({enabled:w,ref:M}),$3(E,{focusRef:M,visible:w,shouldFocus:s&&p===El.click}),az(E,{focusRef:r,visible:w,shouldFocus:i&&p===El.click});const W=Eb({wasSelected:D.current,enabled:v,mode:x,isSelected:se.present}),G=d.useCallback((de={},De=null)=>{const je={...de,style:{...de.style,transformOrigin:jn.transformOrigin.varRef,[jn.arrowSize.var]:l?`${l}px`:void 0,[jn.arrowShadowColor.var]:u},ref:Ct(E,De),children:W?de.children:null,id:V,tabIndex:-1,role:"dialog",onKeyDown:Fe(de.onKeyDown,Be=>{n&&Be.key==="Escape"&&k()}),onBlur:Fe(de.onBlur,Be=>{const rt=dS(Be),Ue=uv(E.current,rt),wt=uv(M.current,rt);w&&t&&(!Ue&&!wt)&&k()}),"aria-labelledby":A?L:void 0,"aria-describedby":T?q:void 0};return p===El.hover&&(je.role="tooltip",je.onMouseEnter=Fe(de.onMouseEnter,()=>{O.current=!0}),je.onMouseLeave=Fe(de.onMouseLeave,Be=>{Be.nativeEvent.relatedTarget!==null&&(O.current=!1,setTimeout(()=>k(),m))})),je},[W,V,A,L,T,q,p,n,k,w,t,m,u,l]),te=d.useCallback((de={},De=null)=>re({...de,style:{visibility:w?"visible":"hidden",...de.style}},De),[w,re]),ae=d.useCallback((de,De=null)=>({...de,ref:Ct(De,I,z)}),[I,z]),oe=d.useRef(),pe=d.useRef(),fe=d.useCallback(de=>{I.current==null&&z(de)},[z]),ge=d.useCallback((de={},De=null)=>{const je={...de,ref:Ct(M,De,fe),id:Y,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":V};return p===El.click&&(je.onClick=Fe(de.onClick,j)),p===El.hover&&(je.onFocus=Fe(de.onFocus,()=>{oe.current===void 0&&_()}),je.onBlur=Fe(de.onBlur,Be=>{const rt=dS(Be),Ue=!uv(E.current,rt);w&&t&&Ue&&k()}),je.onKeyDown=Fe(de.onKeyDown,Be=>{Be.key==="Escape"&&k()}),je.onMouseEnter=Fe(de.onMouseEnter,()=>{O.current=!0,oe.current=window.setTimeout(()=>_(),h)}),je.onMouseLeave=Fe(de.onMouseLeave,()=>{O.current=!1,oe.current&&(clearTimeout(oe.current),oe.current=void 0),pe.current=window.setTimeout(()=>{O.current===!1&&k()},m)})),je},[Y,w,V,p,fe,j,_,t,k,h,m]);d.useEffect(()=>()=>{oe.current&&clearTimeout(oe.current),pe.current&&clearTimeout(pe.current)},[]);const Ce=d.useCallback((de={},De=null)=>({...de,id:L,ref:Ct(De,je=>{R(!!je)})}),[L]),me=d.useCallback((de={},De=null)=>({...de,id:q,ref:Ct(De,je=>{X(!!je)})}),[q]);return{forceUpdate:le,isOpen:w,onAnimationComplete:se.onComplete,onClose:k,getAnchorProps:ae,getArrowProps:K,getArrowInnerProps:Q,getPopoverPositionerProps:te,getPopoverProps:G,getTriggerProps:ge,getHeaderProps:Ce,getBodyProps:me}}function uv(e,t){return e===t||(e==null?void 0:e.contains(t))}function dS(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function $m(e){const t=Hn("Popover",e),{children:n,...r}=Yt(e),o=xd(),s=JB({...r,direction:o.direction});return a.jsx(QB,{value:s,children:a.jsx(ZB,{value:t,children:Ax(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}$m.displayName="Popover";function uP(e){const t=d.Children.only(e.children),{getAnchorProps:n}=Lc();return d.cloneElement(t,n(t.props,t.ref))}uP.displayName="PopoverAnchor";var dv=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function dP(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:i,shadowColor:l}=e,{getArrowProps:u,getArrowInnerProps:p}=Lc(),h=Db(),m=(t=n??r)!=null?t:o,v=s??i;return a.jsx(_e.div,{...u(),className:"chakra-popover__arrow-positioner",children:a.jsx(_e.div,{className:et("chakra-popover__arrow",e.className),...p(e),__css:{"--popper-arrow-shadow-color":dv("colors",l),"--popper-arrow-bg":dv("colors",m),"--popper-arrow-shadow":dv("shadows",v),...h.arrow}})})}dP.displayName="PopoverArrow";var Ab=Pe(function(t,n){const{getBodyProps:r}=Lc(),o=Db();return a.jsx(_e.div,{...r(t,n),className:et("chakra-popover__body",t.className),__css:o.body})});Ab.displayName="PopoverBody";function eH(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var tH={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]}}},nH=_e(vn.section),fP=Pe(function(t,n){const{variants:r=tH,...o}=t,{isOpen:s}=Lc();return a.jsx(nH,{ref:n,variants:eH(r),initial:!1,animate:s?"enter":"exit",...o})});fP.displayName="PopoverTransition";var Lm=Pe(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:i,getPopoverPositionerProps:l,onAnimationComplete:u}=Lc(),p=Db(),h={position:"relative",display:"flex",flexDirection:"column",...p.content};return a.jsx(_e.div,{...l(r),__css:p.popper,className:"chakra-popover__popper",children:a.jsx(fP,{...o,...i(s,n),onAnimationComplete:cm(u,s.onAnimationComplete),className:et("chakra-popover__content",t.className),__css:h})})});Lm.displayName="PopoverContent";var D1=e=>a.jsx(_e.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});D1.displayName="Circle";function rH(e,t,n){return(e-t)*100/(n-t)}var oH=aa({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),sH=aa({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),aH=aa({"0%":{left:"-40%"},"100%":{left:"100%"}}),iH=aa({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function pP(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:i,role:l="progressbar"}=e,u=rH(t,n,r);return{bind:{"data-indeterminate":i?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":i?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,u):o})(),role:l},percent:u,value:t}}var hP=e=>{const{size:t,isIndeterminate:n,...r}=e;return a.jsx(_e.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${sH} 2s linear infinite`:void 0},...r})};hP.displayName="Shape";var R1=Pe((e,t)=>{var n;const{size:r="48px",max:o=100,min:s=0,valueText:i,getValueText:l,value:u,capIsRound:p,children:h,thickness:m="10px",color:v="#0078d4",trackColor:x="#edebe9",isIndeterminate:y,...b}=e,w=pP({min:s,max:o,value:u,valueText:i,getValueText:l,isIndeterminate:y}),k=y?void 0:((n=w.percent)!=null?n:0)*2.64,_=k==null?void 0:`${k} ${264-k}`,j=y?{css:{animation:`${oH} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:_,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},I={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:r};return a.jsxs(_e.div,{ref:t,className:"chakra-progress",...w.bind,...b,__css:I,children:[a.jsxs(hP,{size:r,isIndeterminate:y,children:[a.jsx(D1,{stroke:x,strokeWidth:m,className:"chakra-progress__track"}),a.jsx(D1,{stroke:v,strokeWidth:m,className:"chakra-progress__indicator",strokeLinecap:p?"round":void 0,opacity:w.value===0&&!y?0:void 0,...j})]}),h]})});R1.displayName="CircularProgress";var[lH,cH]=$t({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),uH=Pe((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:i,...l}=e,u=pP({value:o,min:n,max:r,isIndeterminate:s,role:i}),h={height:"100%",...cH().filledTrack};return a.jsx(_e.div,{ref:t,style:{width:`${u.percent}%`,...l.style},...u.bind,...l,__css:h})}),mP=Pe((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:i,isAnimated:l,children:u,borderRadius:p,isIndeterminate:h,"aria-label":m,"aria-labelledby":v,"aria-valuetext":x,title:y,role:b,...w}=Yt(e),k=Hn("Progress",e),_=p??((n=k.track)==null?void 0:n.borderRadius),j={animation:`${iH} 1s linear infinite`},E={...!h&&i&&l&&j,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${aH} 1s ease infinite normal none running`}},O={overflow:"hidden",position:"relative",...k.track};return a.jsx(_e.div,{ref:t,borderRadius:_,__css:O,...w,children:a.jsxs(lH,{value:k,children:[a.jsx(uH,{"aria-label":m,"aria-labelledby":v,"aria-valuetext":x,min:o,max:s,value:r,isIndeterminate:h,css:E,borderRadius:_,title:y,role:b}),u]})})});mP.displayName="Progress";function dH(e){return e&&t1(e)&&t1(e.target)}function fH(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:i,isNative:l,...u}=e,[p,h]=d.useState(r||""),m=typeof n<"u",v=m?n:p,x=d.useRef(null),y=d.useCallback(()=>{const M=x.current;if(!M)return;let E="input:not(:disabled):checked";const O=M.querySelector(E);if(O){O.focus();return}E="input:not(:disabled)";const D=M.querySelector(E);D==null||D.focus()},[]),w=`radio-${d.useId()}`,k=o||w,_=d.useCallback(M=>{const E=dH(M)?M.target.value:M;m||h(E),t==null||t(String(E))},[t,m]),j=d.useCallback((M={},E=null)=>({...M,ref:Ct(E,x),role:"radiogroup"}),[]),I=d.useCallback((M={},E=null)=>({...M,ref:E,name:k,[l?"checked":"isChecked"]:v!=null?M.value===v:void 0,onChange(D){_(D)},"data-radiogroup":!0}),[l,k,_,v]);return{getRootProps:j,getRadioProps:I,name:k,ref:x,focus:y,setValue:h,value:v,onChange:_,isDisabled:s,isFocusable:i,htmlProps:u}}var[pH,gP]=$t({name:"RadioGroupContext",strict:!1}),oh=Pe((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:i,isDisabled:l,isFocusable:u,...p}=e,{value:h,onChange:m,getRootProps:v,name:x,htmlProps:y}=fH(p),b=d.useMemo(()=>({name:x,size:r,onChange:m,colorScheme:n,value:h,variant:o,isDisabled:l,isFocusable:u}),[x,r,m,n,h,o,l,u]);return a.jsx(pH,{value:b,children:a.jsx(_e.div,{...v(y,t),className:et("chakra-radio-group",i),children:s})})});oh.displayName="RadioGroup";var hH={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function mH(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:i,onChange:l,isInvalid:u,name:p,value:h,id:m,"data-radiogroup":v,"aria-describedby":x,...y}=e,b=`radio-${d.useId()}`,w=jd(),_=!!gP()||!!v;let I=!!w&&!_?w.id:b;I=m??I;const M=o??(w==null?void 0:w.isDisabled),E=s??(w==null?void 0:w.isReadOnly),O=i??(w==null?void 0:w.isRequired),D=u??(w==null?void 0:w.isInvalid),[A,R]=d.useState(!1),[T,X]=d.useState(!1),[B,U]=d.useState(!1),[Y,V]=d.useState(!1),[L,q]=d.useState(!!t),z=typeof n<"u",K=z?n:L;d.useEffect(()=>N5(R),[]);const re=d.useCallback(fe=>{if(E||M){fe.preventDefault();return}z||q(fe.target.checked),l==null||l(fe)},[z,M,E,l]),Q=d.useCallback(fe=>{fe.key===" "&&V(!0)},[V]),le=d.useCallback(fe=>{fe.key===" "&&V(!1)},[V]),se=d.useCallback((fe={},ge=null)=>({...fe,ref:ge,"data-active":at(Y),"data-hover":at(B),"data-disabled":at(M),"data-invalid":at(D),"data-checked":at(K),"data-focus":at(T),"data-focus-visible":at(T&&A),"data-readonly":at(E),"aria-hidden":!0,onMouseDown:Fe(fe.onMouseDown,()=>V(!0)),onMouseUp:Fe(fe.onMouseUp,()=>V(!1)),onMouseEnter:Fe(fe.onMouseEnter,()=>U(!0)),onMouseLeave:Fe(fe.onMouseLeave,()=>U(!1))}),[Y,B,M,D,K,T,E,A]),{onFocus:W,onBlur:G}=w??{},te=d.useCallback((fe={},ge=null)=>{const Ce=M&&!r;return{...fe,id:I,ref:ge,type:"radio",name:p,value:h,onChange:Fe(fe.onChange,re),onBlur:Fe(G,fe.onBlur,()=>X(!1)),onFocus:Fe(W,fe.onFocus,()=>X(!0)),onKeyDown:Fe(fe.onKeyDown,Q),onKeyUp:Fe(fe.onKeyUp,le),checked:K,disabled:Ce,readOnly:E,required:O,"aria-invalid":co(D),"aria-disabled":co(Ce),"aria-required":co(O),"data-readonly":at(E),"aria-describedby":x,style:hH}},[M,r,I,p,h,re,G,W,Q,le,K,E,O,D,x]);return{state:{isInvalid:D,isFocused:T,isChecked:K,isActive:Y,isHovered:B,isDisabled:M,isReadOnly:E,isRequired:O},getCheckboxProps:se,getRadioProps:se,getInputProps:te,getLabelProps:(fe={},ge=null)=>({...fe,ref:ge,onMouseDown:Fe(fe.onMouseDown,gH),"data-disabled":at(M),"data-checked":at(K),"data-invalid":at(D)}),getRootProps:(fe,ge=null)=>({...fe,ref:ge,"data-disabled":at(M),"data-checked":at(K),"data-invalid":at(D)}),htmlProps:y}}function gH(e){e.preventDefault(),e.stopPropagation()}function vH(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 zs=Pe((e,t)=>{var n;const r=gP(),{onChange:o,value:s}=e,i=Hn("Radio",{...r,...e}),l=Yt(e),{spacing:u="0.5rem",children:p,isDisabled:h=r==null?void 0:r.isDisabled,isFocusable:m=r==null?void 0:r.isFocusable,inputProps:v,...x}=l;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=cm(r.onChange,o));const w=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:k,getCheckboxProps:_,getLabelProps:j,getRootProps:I,htmlProps:M}=mH({...x,isChecked:y,isFocusable:m,isDisabled:h,onChange:b,name:w}),[E,O]=vH(M,Ej),D=_(O),A=k(v,t),R=j(),T=Object.assign({},E,I()),X={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...i.container},B={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.control},U={userSelect:"none",marginStart:u,...i.label};return a.jsxs(_e.label,{className:"chakra-radio",...T,__css:X,children:[a.jsx("input",{className:"chakra-radio__input",...A}),a.jsx(_e.span,{className:"chakra-radio__control",...D,__css:B}),p&&a.jsx(_e.span,{className:"chakra-radio__label",...R,__css:U,children:p})]})});zs.displayName="Radio";var vP=Pe(function(t,n){const{children:r,placeholder:o,className:s,...i}=t;return a.jsxs(_e.select,{...i,ref:n,className:et("chakra-select",s),children:[o&&a.jsx("option",{value:"",children:o}),r]})});vP.displayName="SelectField";function xH(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 xP=Pe((e,t)=>{var n;const r=Hn("Select",e),{rootProps:o,placeholder:s,icon:i,color:l,height:u,h:p,minH:h,minHeight:m,iconColor:v,iconSize:x,...y}=Yt(e),[b,w]=xH(y,Ej),k=eb(w),_={width:"100%",height:"fit-content",position:"relative",color:l},j={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return a.jsxs(_e.div,{className:"chakra-select__wrapper",__css:_,...b,...o,children:[a.jsx(vP,{ref:t,height:p??u,minH:h??m,placeholder:s,...k,__css:j,children:e.children}),a.jsx(bP,{"data-disabled":at(k.disabled),...(v||l)&&{color:v||l},__css:r.icon,...x&&{fontSize:x},children:i})]})});xP.displayName="Select";var bH=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"})}),yH=_e("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),bP=e=>{const{children:t=a.jsx(bH,{}),...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(yH,{...n,className:"chakra-select__icon-wrapper",children:d.isValidElement(t)?r:null})};bP.displayName="SelectIcon";function CH(){const e=d.useRef(!0);return d.useEffect(()=>{e.current=!1},[]),e.current}function wH(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}var SH=_e("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),A1=Mj("skeleton-start-color"),N1=Mj("skeleton-end-color"),kH=aa({from:{opacity:0},to:{opacity:1}}),_H=aa({from:{borderColor:A1.reference,background:A1.reference},to:{borderColor:N1.reference,background:N1.reference}}),zm=Pe((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=Qa("Skeleton",n),o=CH(),{startColor:s="",endColor:i="",isLoaded:l,fadeDuration:u,speed:p,className:h,fitContent:m,...v}=Yt(n),[x,y]=ds("colors",[s,i]),b=wH(l),w=et("chakra-skeleton",h),k={...x&&{[A1.variable]:x},...y&&{[N1.variable]:y}};if(l){const _=o||b?"none":`${kH} ${u}s`;return a.jsx(_e.div,{ref:t,className:w,__css:{animation:_},...v})}return a.jsx(SH,{ref:t,className:w,...v,__css:{width:m?"fit-content":void 0,...r,...k,_dark:{...r._dark,...k},animation:`${p}s linear infinite alternate ${_H}`}})});zm.displayName="Skeleton";var oo=e=>e?"":void 0,rc=e=>e?!0:void 0,ei=(...e)=>e.filter(Boolean).join(" ");function oc(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function jH(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 Ou(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var Dp={width:0,height:0},Zf=e=>e||Dp;function yP(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=b=>{var w;const k=(w=r[b])!=null?w:Dp;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Ou({orientation:t,vertical:{bottom:`calc(${n[b]}% - ${k.height/2}px)`},horizontal:{left:`calc(${n[b]}% - ${k.width/2}px)`}})}},i=t==="vertical"?r.reduce((b,w)=>Zf(b).height>Zf(w).height?b:w,Dp):r.reduce((b,w)=>Zf(b).width>Zf(w).width?b:w,Dp),l={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Ou({orientation:t,vertical:i?{paddingLeft:i.width/2,paddingRight:i.width/2}:{},horizontal:i?{paddingTop:i.height/2,paddingBottom:i.height/2}:{}})},u={position:"absolute",...Ou({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},p=n.length===1,h=[0,o?100-n[0]:n[0]],m=p?h:n;let v=m[0];!p&&o&&(v=100-v);const x=Math.abs(m[m.length-1]-m[0]),y={...u,...Ou({orientation:t,vertical:o?{height:`${x}%`,top:`${v}%`}:{height:`${x}%`,bottom:`${v}%`},horizontal:o?{width:`${x}%`,right:`${v}%`}:{width:`${x}%`,left:`${v}%`}})};return{trackStyle:u,innerTrackStyle:y,rootStyle:l,getThumbStyle:s}}function CP(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function PH(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function IH(e){const t=MH(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function wP(e){return!!e.touches}function EH(e){return wP(e)&&e.touches.length>1}function MH(e){var t;return(t=e.view)!=null?t:window}function OH(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function DH(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function SP(e,t="page"){return wP(e)?OH(e,t):DH(e,t)}function RH(e){return t=>{const n=IH(t);(!n||n&&t.button===0)&&e(t)}}function AH(e,t=!1){function n(o){e(o,{point:SP(o)})}return t?RH(n):n}function Rp(e,t,n,r){return PH(e,t,AH(n,t==="pointerdown"),r)}var NH=Object.defineProperty,TH=(e,t,n)=>t in e?NH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Po=(e,t,n)=>(TH(e,typeof t!="symbol"?t+"":t,n),n),$H=class{constructor(e,t,n){Po(this,"history",[]),Po(this,"startEvent",null),Po(this,"lastEvent",null),Po(this,"lastEventInfo",null),Po(this,"handlers",{}),Po(this,"removeListeners",()=>{}),Po(this,"threshold",3),Po(this,"win"),Po(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const l=fv(this.lastEventInfo,this.history),u=this.startEvent!==null,p=BH(l.offset,{x:0,y:0})>=this.threshold;if(!u&&!p)return;const{timestamp:h}=Pw();this.history.push({...l.point,timestamp:h});const{onStart:m,onMove:v}=this.handlers;u||(m==null||m(this.lastEvent,l),this.startEvent=this.lastEvent),v==null||v(this.lastEvent,l)}),Po(this,"onPointerMove",(l,u)=>{this.lastEvent=l,this.lastEventInfo=u,sT.update(this.updatePoint,!0)}),Po(this,"onPointerUp",(l,u)=>{const p=fv(u,this.history),{onEnd:h,onSessionEnd:m}=this.handlers;m==null||m(l,p),this.end(),!(!h||!this.startEvent)&&(h==null||h(l,p))});var r;if(this.win=(r=e.view)!=null?r:window,EH(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:SP(e)},{timestamp:s}=Pw();this.history=[{...o.point,timestamp:s}];const{onSessionStart:i}=t;i==null||i(e,fv(o,this.history)),this.removeListeners=FH(Rp(this.win,"pointermove",this.onPointerMove),Rp(this.win,"pointerup",this.onPointerUp),Rp(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),aT.update(this.updatePoint)}};function fS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function fv(e,t){return{point:e.point,delta:fS(e.point,t[t.length-1]),offset:fS(e.point,t[0]),velocity:zH(t,.1)}}var LH=e=>e*1e3;function zH(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>LH(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 i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function FH(...e){return t=>e.reduce((n,r)=>r(n),t)}function pv(e,t){return Math.abs(e-t)}function pS(e){return"x"in e&&"y"in e}function BH(e,t){if(typeof e=="number"&&typeof t=="number")return pv(e,t);if(pS(e)&&pS(t)){const n=pv(e.x,t.x),r=pv(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function kP(e){const t=d.useRef(null);return t.current=e,t}function _P(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:i,threshold:l}=t,u=!!(n||r||o||s||i),p=d.useRef(null),h=kP({onSessionStart:s,onSessionEnd:i,onStart:r,onMove:n,onEnd(m,v){p.current=null,o==null||o(m,v)}});d.useEffect(()=>{var m;(m=p.current)==null||m.updateHandlers(h.current)}),d.useEffect(()=>{const m=e.current;if(!m||!u)return;function v(x){p.current=new $H(x,h.current,l)}return Rp(m,"pointerdown",v)},[e,u,h,l]),d.useEffect(()=>()=>{var m;(m=p.current)==null||m.end(),p.current=null},[])}function HH(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 i,l;if("borderBoxSize"in s){const u=s.borderBoxSize,p=Array.isArray(u)?u[0]:u;i=p.inlineSize,l=p.blockSize}else i=e.offsetWidth,l=e.offsetHeight;t({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var VH=globalThis!=null&&globalThis.document?d.useLayoutEffect:d.useEffect;function WH(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 jP({getNodes:e,observeMutation:t=!0}){const[n,r]=d.useState([]),[o,s]=d.useState(0);return VH(()=>{const i=e(),l=i.map((u,p)=>HH(u,h=>{r(m=>[...m.slice(0,p),h,...m.slice(p+1)])}));if(t){const u=i[0];l.push(WH(u,()=>{s(p=>p+1)}))}return()=>{l.forEach(u=>{u==null||u()})}},[o]),n}function UH(e){return typeof e=="object"&&e!==null&&"current"in e}function GH(e){const[t]=jP({observeMutation:!1,getNodes(){return[UH(e)?e.current:e]}});return t}function KH(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:i,direction:l="ltr",orientation:u="horizontal",id:p,isDisabled:h,isReadOnly:m,onChangeStart:v,onChangeEnd:x,step:y=1,getAriaValueText:b,"aria-valuetext":w,"aria-label":k,"aria-labelledby":_,name:j,focusThumbOnChange:I=!0,minStepsBetweenThumbs:M=0,...E}=e,O=nn(v),D=nn(x),A=nn(b),R=CP({isReversed:i,direction:l,orientation:u}),[T,X]=Rc({value:o,defaultValue:s??[25,75],onChange:r});if(!Array.isArray(T))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof T}\``);const[B,U]=d.useState(!1),[Y,V]=d.useState(!1),[L,q]=d.useState(-1),z=!(h||m),K=d.useRef(T),re=T.map(ke=>Jl(ke,t,n)),Q=M*y,le=qH(re,t,n,Q),se=d.useRef({eventSource:null,value:[],valueBounds:[]});se.current.value=re,se.current.valueBounds=le;const W=re.map(ke=>n-ke+t),te=(R?W:re).map(ke=>Zp(ke,t,n)),ae=u==="vertical",oe=d.useRef(null),pe=d.useRef(null),fe=jP({getNodes(){const ke=pe.current,ze=ke==null?void 0:ke.querySelectorAll("[role=slider]");return ze?Array.from(ze):[]}}),ge=d.useId(),me=jH(p??ge),de=d.useCallback(ke=>{var ze,Le;if(!oe.current)return;se.current.eventSource="pointer";const We=oe.current.getBoundingClientRect(),{clientX:ct,clientY:xn}=(Le=(ze=ke.touches)==null?void 0:ze[0])!=null?Le:ke,jt=ae?We.bottom-xn:ct-We.left,Pt=ae?We.height:We.width;let sr=jt/Pt;return R&&(sr=1-sr),$5(sr,t,n)},[ae,R,n,t]),De=(n-t)/10,je=y||(n-t)/100,Be=d.useMemo(()=>({setValueAtIndex(ke,ze){if(!z)return;const Le=se.current.valueBounds[ke];ze=parseFloat(y1(ze,Le.min,je)),ze=Jl(ze,Le.min,Le.max);const We=[...se.current.value];We[ke]=ze,X(We)},setActiveIndex:q,stepUp(ke,ze=je){const Le=se.current.value[ke],We=R?Le-ze:Le+ze;Be.setValueAtIndex(ke,We)},stepDown(ke,ze=je){const Le=se.current.value[ke],We=R?Le+ze:Le-ze;Be.setValueAtIndex(ke,We)},reset(){X(K.current)}}),[je,R,X,z]),rt=d.useCallback(ke=>{const ze=ke.key,We={ArrowRight:()=>Be.stepUp(L),ArrowUp:()=>Be.stepUp(L),ArrowLeft:()=>Be.stepDown(L),ArrowDown:()=>Be.stepDown(L),PageUp:()=>Be.stepUp(L,De),PageDown:()=>Be.stepDown(L,De),Home:()=>{const{min:ct}=le[L];Be.setValueAtIndex(L,ct)},End:()=>{const{max:ct}=le[L];Be.setValueAtIndex(L,ct)}}[ze];We&&(ke.preventDefault(),ke.stopPropagation(),We(ke),se.current.eventSource="keyboard")},[Be,L,De,le]),{getThumbStyle:Ue,rootStyle:wt,trackStyle:Xe,innerTrackStyle:tt}=d.useMemo(()=>yP({isReversed:R,orientation:u,thumbRects:fe,thumbPercents:te}),[R,u,te,fe]),xe=d.useCallback(ke=>{var ze;const Le=ke??L;if(Le!==-1&&I){const We=me.getThumb(Le),ct=(ze=pe.current)==null?void 0:ze.ownerDocument.getElementById(We);ct&&setTimeout(()=>ct.focus())}},[I,L,me]);la(()=>{se.current.eventSource==="keyboard"&&(D==null||D(se.current.value))},[re,D]);const Re=ke=>{const ze=de(ke)||0,Le=se.current.value.map(Pt=>Math.abs(Pt-ze)),We=Math.min(...Le);let ct=Le.indexOf(We);const xn=Le.filter(Pt=>Pt===We);xn.length>1&&ze>se.current.value[ct]&&(ct=ct+xn.length-1),q(ct),Be.setValueAtIndex(ct,ze),xe(ct)},st=ke=>{if(L==-1)return;const ze=de(ke)||0;q(L),Be.setValueAtIndex(L,ze),xe(L)};_P(pe,{onPanSessionStart(ke){z&&(U(!0),Re(ke),O==null||O(se.current.value))},onPanSessionEnd(){z&&(U(!1),D==null||D(se.current.value))},onPan(ke){z&&st(ke)}});const mt=d.useCallback((ke={},ze=null)=>({...ke,...E,id:me.root,ref:Ct(ze,pe),tabIndex:-1,"aria-disabled":rc(h),"data-focused":oo(Y),style:{...ke.style,...wt}}),[E,h,Y,wt,me]),ve=d.useCallback((ke={},ze=null)=>({...ke,ref:Ct(ze,oe),id:me.track,"data-disabled":oo(h),style:{...ke.style,...Xe}}),[h,Xe,me]),Ye=d.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:me.innerTrack,style:{...ke.style,...tt}}),[tt,me]),ot=d.useCallback((ke,ze=null)=>{var Le;const{index:We,...ct}=ke,xn=re[We];if(xn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${We}\`. The \`value\` or \`defaultValue\` length is : ${re.length}`);const jt=le[We];return{...ct,ref:ze,role:"slider",tabIndex:z?0:void 0,id:me.getThumb(We),"data-active":oo(B&&L===We),"aria-valuetext":(Le=A==null?void 0:A(xn))!=null?Le:w==null?void 0:w[We],"aria-valuemin":jt.min,"aria-valuemax":jt.max,"aria-valuenow":xn,"aria-orientation":u,"aria-disabled":rc(h),"aria-readonly":rc(m),"aria-label":k==null?void 0:k[We],"aria-labelledby":k!=null&&k[We]||_==null?void 0:_[We],style:{...ke.style,...Ue(We)},onKeyDown:oc(ke.onKeyDown,rt),onFocus:oc(ke.onFocus,()=>{V(!0),q(We)}),onBlur:oc(ke.onBlur,()=>{V(!1),q(-1)})}},[me,re,le,z,B,L,A,w,u,h,m,k,_,Ue,rt,V]),lt=d.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:me.output,htmlFor:re.map((Le,We)=>me.getThumb(We)).join(" "),"aria-live":"off"}),[me,re]),Me=d.useCallback((ke,ze=null)=>{const{value:Le,...We}=ke,ct=!(Le<t||Le>n),xn=Le>=re[0]&&Le<=re[re.length-1];let jt=Zp(Le,t,n);jt=R?100-jt:jt;const Pt={position:"absolute",pointerEvents:"none",...Ou({orientation:u,vertical:{bottom:`${jt}%`},horizontal:{left:`${jt}%`}})};return{...We,ref:ze,id:me.getMarker(ke.value),role:"presentation","aria-hidden":!0,"data-disabled":oo(h),"data-invalid":oo(!ct),"data-highlighted":oo(xn),style:{...ke.style,...Pt}}},[h,R,n,t,u,re,me]),$e=d.useCallback((ke,ze=null)=>{const{index:Le,...We}=ke;return{...We,ref:ze,id:me.getInput(Le),type:"hidden",value:re[Le],name:Array.isArray(j)?j[Le]:`${j}-${Le}`}},[j,re,me]);return{state:{value:re,isFocused:Y,isDragging:B,getThumbPercent:ke=>te[ke],getThumbMinValue:ke=>le[ke].min,getThumbMaxValue:ke=>le[ke].max},actions:Be,getRootProps:mt,getTrackProps:ve,getInnerTrackProps:Ye,getThumbProps:ot,getMarkerProps:Me,getInputProps:$e,getOutputProps:lt}}function qH(e,t,n,r){return e.map((o,s)=>{const i=s===0?t:e[s-1]+r,l=s===e.length-1?n:e[s+1]-r;return{min:i,max:l}})}var[XH,Fm]=$t({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[YH,Bm]=$t({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),PP=Pe(function(t,n){const r={orientation:"horizontal",...t},o=Hn("Slider",r),s=Yt(r),{direction:i}=xd();s.direction=i;const{getRootProps:l,...u}=KH(s),p=d.useMemo(()=>({...u,name:r.name}),[u,r.name]);return a.jsx(XH,{value:p,children:a.jsx(YH,{value:o,children:a.jsx(_e.div,{...l({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});PP.displayName="RangeSlider";var T1=Pe(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=Fm(),i=Bm(),l=r(t,n);return a.jsxs(_e.div,{...l,className:ei("chakra-slider__thumb",t.className),__css:i.thumb,children:[l.children,s&&a.jsx("input",{...o({index:t.index})})]})});T1.displayName="RangeSliderThumb";var IP=Pe(function(t,n){const{getTrackProps:r}=Fm(),o=Bm(),s=r(t,n);return a.jsx(_e.div,{...s,className:ei("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});IP.displayName="RangeSliderTrack";var EP=Pe(function(t,n){const{getInnerTrackProps:r}=Fm(),o=Bm(),s=r(t,n);return a.jsx(_e.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});EP.displayName="RangeSliderFilledTrack";var Ap=Pe(function(t,n){const{getMarkerProps:r}=Fm(),o=Bm(),s=r(t,n);return a.jsx(_e.div,{...s,className:ei("chakra-slider__marker",t.className),__css:o.mark})});Ap.displayName="RangeSliderMark";function QH(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:i,isReversed:l,direction:u="ltr",orientation:p="horizontal",id:h,isDisabled:m,isReadOnly:v,onChangeStart:x,onChangeEnd:y,step:b=1,getAriaValueText:w,"aria-valuetext":k,"aria-label":_,"aria-labelledby":j,name:I,focusThumbOnChange:M=!0,...E}=e,O=nn(x),D=nn(y),A=nn(w),R=CP({isReversed:l,direction:u,orientation:p}),[T,X]=Rc({value:s,defaultValue:i??JH(n,r),onChange:o}),[B,U]=d.useState(!1),[Y,V]=d.useState(!1),L=!(m||v),q=(r-n)/10,z=b||(r-n)/100,K=Jl(T,n,r),re=r-K+n,le=Zp(R?re:K,n,r),se=p==="vertical",W=kP({min:n,max:r,step:b,isDisabled:m,value:K,isInteractive:L,isReversed:R,isVertical:se,eventSource:null,focusThumbOnChange:M,orientation:p}),G=d.useRef(null),te=d.useRef(null),ae=d.useRef(null),oe=d.useId(),pe=h??oe,[fe,ge]=[`slider-thumb-${pe}`,`slider-track-${pe}`],Ce=d.useCallback(Me=>{var $e,At;if(!G.current)return;const ke=W.current;ke.eventSource="pointer";const ze=G.current.getBoundingClientRect(),{clientX:Le,clientY:We}=(At=($e=Me.touches)==null?void 0:$e[0])!=null?At:Me,ct=se?ze.bottom-We:Le-ze.left,xn=se?ze.height:ze.width;let jt=ct/xn;R&&(jt=1-jt);let Pt=$5(jt,ke.min,ke.max);return ke.step&&(Pt=parseFloat(y1(Pt,ke.min,ke.step))),Pt=Jl(Pt,ke.min,ke.max),Pt},[se,R,W]),me=d.useCallback(Me=>{const $e=W.current;$e.isInteractive&&(Me=parseFloat(y1(Me,$e.min,z)),Me=Jl(Me,$e.min,$e.max),X(Me))},[z,X,W]),de=d.useMemo(()=>({stepUp(Me=z){const $e=R?K-Me:K+Me;me($e)},stepDown(Me=z){const $e=R?K+Me:K-Me;me($e)},reset(){me(i||0)},stepTo(Me){me(Me)}}),[me,R,K,z,i]),De=d.useCallback(Me=>{const $e=W.current,ke={ArrowRight:()=>de.stepUp(),ArrowUp:()=>de.stepUp(),ArrowLeft:()=>de.stepDown(),ArrowDown:()=>de.stepDown(),PageUp:()=>de.stepUp(q),PageDown:()=>de.stepDown(q),Home:()=>me($e.min),End:()=>me($e.max)}[Me.key];ke&&(Me.preventDefault(),Me.stopPropagation(),ke(Me),$e.eventSource="keyboard")},[de,me,q,W]),je=(t=A==null?void 0:A(K))!=null?t:k,Be=GH(te),{getThumbStyle:rt,rootStyle:Ue,trackStyle:wt,innerTrackStyle:Xe}=d.useMemo(()=>{const Me=W.current,$e=Be??{width:0,height:0};return yP({isReversed:R,orientation:Me.orientation,thumbRects:[$e],thumbPercents:[le]})},[R,Be,le,W]),tt=d.useCallback(()=>{W.current.focusThumbOnChange&&setTimeout(()=>{var $e;return($e=te.current)==null?void 0:$e.focus()})},[W]);la(()=>{const Me=W.current;tt(),Me.eventSource==="keyboard"&&(D==null||D(Me.value))},[K,D]);function xe(Me){const $e=Ce(Me);$e!=null&&$e!==W.current.value&&X($e)}_P(ae,{onPanSessionStart(Me){const $e=W.current;$e.isInteractive&&(U(!0),tt(),xe(Me),O==null||O($e.value))},onPanSessionEnd(){const Me=W.current;Me.isInteractive&&(U(!1),D==null||D(Me.value))},onPan(Me){W.current.isInteractive&&xe(Me)}});const Re=d.useCallback((Me={},$e=null)=>({...Me,...E,ref:Ct($e,ae),tabIndex:-1,"aria-disabled":rc(m),"data-focused":oo(Y),style:{...Me.style,...Ue}}),[E,m,Y,Ue]),st=d.useCallback((Me={},$e=null)=>({...Me,ref:Ct($e,G),id:ge,"data-disabled":oo(m),style:{...Me.style,...wt}}),[m,ge,wt]),mt=d.useCallback((Me={},$e=null)=>({...Me,ref:$e,style:{...Me.style,...Xe}}),[Xe]),ve=d.useCallback((Me={},$e=null)=>({...Me,ref:Ct($e,te),role:"slider",tabIndex:L?0:void 0,id:fe,"data-active":oo(B),"aria-valuetext":je,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":K,"aria-orientation":p,"aria-disabled":rc(m),"aria-readonly":rc(v),"aria-label":_,"aria-labelledby":_?void 0:j,style:{...Me.style,...rt(0)},onKeyDown:oc(Me.onKeyDown,De),onFocus:oc(Me.onFocus,()=>V(!0)),onBlur:oc(Me.onBlur,()=>V(!1))}),[L,fe,B,je,n,r,K,p,m,v,_,j,rt,De]),Ye=d.useCallback((Me,$e=null)=>{const At=!(Me.value<n||Me.value>r),ke=K>=Me.value,ze=Zp(Me.value,n,r),Le={position:"absolute",pointerEvents:"none",...ZH({orientation:p,vertical:{bottom:R?`${100-ze}%`:`${ze}%`},horizontal:{left:R?`${100-ze}%`:`${ze}%`}})};return{...Me,ref:$e,role:"presentation","aria-hidden":!0,"data-disabled":oo(m),"data-invalid":oo(!At),"data-highlighted":oo(ke),style:{...Me.style,...Le}}},[m,R,r,n,p,K]),ot=d.useCallback((Me={},$e=null)=>({...Me,ref:$e,type:"hidden",value:K,name:I}),[I,K]);return{state:{value:K,isFocused:Y,isDragging:B},actions:de,getRootProps:Re,getTrackProps:st,getInnerTrackProps:mt,getThumbProps:ve,getMarkerProps:Ye,getInputProps:ot}}function ZH(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function JH(e,t){return t<e?e:e+(t-e)/2}var[eV,Hm]=$t({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[tV,Vm]=$t({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),Nb=Pe((e,t)=>{var n;const r={...e,orientation:(n=e==null?void 0:e.orientation)!=null?n:"horizontal"},o=Hn("Slider",r),s=Yt(r),{direction:i}=xd();s.direction=i;const{getInputProps:l,getRootProps:u,...p}=QH(s),h=u(),m=l({},t);return a.jsx(eV,{value:p,children:a.jsx(tV,{value:o,children:a.jsxs(_e.div,{...h,className:ei("chakra-slider",r.className),__css:o.container,children:[r.children,a.jsx("input",{...m})]})})})});Nb.displayName="Slider";var Tb=Pe((e,t)=>{const{getThumbProps:n}=Hm(),r=Vm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__thumb",e.className),__css:r.thumb})});Tb.displayName="SliderThumb";var $b=Pe((e,t)=>{const{getTrackProps:n}=Hm(),r=Vm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__track",e.className),__css:r.track})});$b.displayName="SliderTrack";var Lb=Pe((e,t)=>{const{getInnerTrackProps:n}=Hm(),r=Vm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__filled-track",e.className),__css:r.filledTrack})});Lb.displayName="SliderFilledTrack";var Ll=Pe((e,t)=>{const{getMarkerProps:n}=Hm(),r=Vm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__marker",e.className),__css:r.mark})});Ll.displayName="SliderMark";var zb=Pe(function(t,n){const r=Hn("Switch",t),{spacing:o="0.5rem",children:s,...i}=Yt(t),{getIndicatorProps:l,getInputProps:u,getCheckboxProps:p,getRootProps:h,getLabelProps:m}=T5(i),v=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(_e.label,{...h(),className:et("chakra-switch",t.className),__css:v,children:[a.jsx("input",{className:"chakra-switch__input",...u({},n)}),a.jsx(_e.span,{...p(),className:"chakra-switch__track",__css:x,children:a.jsx(_e.span,{__css:r.thumb,className:"chakra-switch__thumb",...l()})}),s&&a.jsx(_e.span,{className:"chakra-switch__label",...m(),__css:y,children:s})]})});zb.displayName="Switch";var[nV,rV,oV,sV]=Qx();function aV(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:i,lazyBehavior:l="unmount",orientation:u="horizontal",direction:p="ltr",...h}=e,[m,v]=d.useState(n??0),[x,y]=Rc({defaultValue:n??0,value:o,onChange:r});d.useEffect(()=>{o!=null&&v(o)},[o]);const b=oV(),w=d.useId();return{id:`tabs-${(t=e.id)!=null?t:w}`,selectedIndex:x,focusedIndex:m,setSelectedIndex:y,setFocusedIndex:v,isManual:s,isLazy:i,lazyBehavior:l,orientation:u,descendants:b,direction:p,htmlProps:h}}var[iV,Wm]=$t({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function lV(e){const{focusedIndex:t,orientation:n,direction:r}=Wm(),o=rV(),s=d.useCallback(i=>{const l=()=>{var _;const j=o.nextEnabled(t);j&&((_=j.node)==null||_.focus())},u=()=>{var _;const j=o.prevEnabled(t);j&&((_=j.node)==null||_.focus())},p=()=>{var _;const j=o.firstEnabled();j&&((_=j.node)==null||_.focus())},h=()=>{var _;const j=o.lastEnabled();j&&((_=j.node)==null||_.focus())},m=n==="horizontal",v=n==="vertical",x=i.key,y=r==="ltr"?"ArrowLeft":"ArrowRight",b=r==="ltr"?"ArrowRight":"ArrowLeft",k={[y]:()=>m&&u(),[b]:()=>m&&l(),ArrowDown:()=>v&&l(),ArrowUp:()=>v&&u(),Home:p,End:h}[x];k&&(i.preventDefault(),k(i))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Fe(e.onKeyDown,s)}}function cV(e){const{isDisabled:t=!1,isFocusable:n=!1,...r}=e,{setSelectedIndex:o,isManual:s,id:i,setFocusedIndex:l,selectedIndex:u}=Wm(),{index:p,register:h}=sV({disabled:t&&!n}),m=p===u,v=()=>{o(p)},x=()=>{l(p),!s&&!(t&&n)&&o(p)},y=T3({...r,ref:Ct(h,e.ref),isDisabled:t,isFocusable:n,onClick:Fe(e.onClick,v)}),b="button";return{...y,id:MP(i,p),role:"tab",tabIndex:m?0:-1,type:b,"aria-selected":m,"aria-controls":OP(i,p),onFocus:t?void 0:Fe(e.onFocus,x)}}var[uV,dV]=$t({});function fV(e){const t=Wm(),{id:n,selectedIndex:r}=t,s=_d(e.children).map((i,l)=>d.createElement(uV,{key:l,value:{isSelected:l===r,id:OP(n,l),tabId:MP(n,l),selectedIndex:r}},i));return{...e,children:s}}function pV(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=Wm(),{isSelected:s,id:i,tabId:l}=dV(),u=d.useRef(!1);s&&(u.current=!0);const p=Eb({wasSelected:u.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:p?t:null,role:"tabpanel","aria-labelledby":l,hidden:!s,id:i}}function MP(e,t){return`${e}--tab-${t}`}function OP(e,t){return`${e}--tabpanel-${t}`}var[hV,Um]=$t({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),Qi=Pe(function(t,n){const r=Hn("Tabs",t),{children:o,className:s,...i}=Yt(t),{htmlProps:l,descendants:u,...p}=aV(i),h=d.useMemo(()=>p,[p]),{isFitted:m,...v}=l;return a.jsx(nV,{value:u,children:a.jsx(iV,{value:h,children:a.jsx(hV,{value:r,children:a.jsx(_e.div,{className:et("chakra-tabs",s),ref:n,...v,__css:r.root,children:o})})})})});Qi.displayName="Tabs";var Zi=Pe(function(t,n){const r=lV({...t,ref:n}),s={display:"flex",...Um().tablist};return a.jsx(_e.div,{...r,className:et("chakra-tabs__tablist",t.className),__css:s})});Zi.displayName="TabList";var fo=Pe(function(t,n){const r=pV({...t,ref:n}),o=Um();return a.jsx(_e.div,{outline:"0",...r,className:et("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});fo.displayName="TabPanel";var zc=Pe(function(t,n){const r=fV(t),o=Um();return a.jsx(_e.div,{...r,width:"100%",ref:n,className:et("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});zc.displayName="TabPanels";var Pr=Pe(function(t,n){const r=Um(),o=cV({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return a.jsx(_e.button,{...o,className:et("chakra-tabs__tab",t.className),__css:s})});Pr.displayName="Tab";function mV(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var gV=["h","minH","height","minHeight"],DP=Pe((e,t)=>{const n=Qa("Textarea",e),{className:r,rows:o,...s}=Yt(e),i=eb(s),l=o?mV(n,gV):n;return a.jsx(_e.textarea,{ref:t,rows:o,...i,className:et("chakra-textarea",r),__css:l})});DP.displayName="Textarea";var vV={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]}}}},$1=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Np=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function xV(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:i=o,closeOnEsc:l=!0,onOpen:u,onClose:p,placement:h,id:m,isOpen:v,defaultIsOpen:x,arrowSize:y=10,arrowShadowColor:b,arrowPadding:w,modifiers:k,isDisabled:_,gutter:j,offset:I,direction:M,...E}=e,{isOpen:O,onOpen:D,onClose:A}=Ib({isOpen:v,defaultIsOpen:x,onOpen:u,onClose:p}),{referenceRef:R,getPopperProps:T,getArrowInnerProps:X,getArrowProps:B}=Pb({enabled:O,placement:h,arrowPadding:w,modifiers:k,gutter:j,offset:I,direction:M}),U=d.useId(),V=`tooltip-${m??U}`,L=d.useRef(null),q=d.useRef(),z=d.useCallback(()=>{q.current&&(clearTimeout(q.current),q.current=void 0)},[]),K=d.useRef(),re=d.useCallback(()=>{K.current&&(clearTimeout(K.current),K.current=void 0)},[]),Q=d.useCallback(()=>{re(),A()},[A,re]),le=bV(L,Q),se=d.useCallback(()=>{if(!_&&!q.current){O&&le();const ge=Np(L);q.current=ge.setTimeout(D,t)}},[le,_,O,D,t]),W=d.useCallback(()=>{z();const ge=Np(L);K.current=ge.setTimeout(Q,n)},[n,Q,z]),G=d.useCallback(()=>{O&&r&&W()},[r,W,O]),te=d.useCallback(()=>{O&&i&&W()},[i,W,O]),ae=d.useCallback(ge=>{O&&ge.key==="Escape"&&W()},[O,W]);_i(()=>$1(L),"keydown",l?ae:void 0),_i(()=>{const ge=L.current;if(!ge)return null;const Ce=k3(ge);return Ce.localName==="body"?Np(L):Ce},"scroll",()=>{O&&s&&Q()},{passive:!0,capture:!0}),d.useEffect(()=>{_&&(z(),O&&A())},[_,O,A,z]),d.useEffect(()=>()=>{z(),re()},[z,re]),_i(()=>L.current,"pointerleave",W);const oe=d.useCallback((ge={},Ce=null)=>({...ge,ref:Ct(L,Ce,R),onPointerEnter:Fe(ge.onPointerEnter,de=>{de.pointerType!=="touch"&&se()}),onClick:Fe(ge.onClick,G),onPointerDown:Fe(ge.onPointerDown,te),onFocus:Fe(ge.onFocus,se),onBlur:Fe(ge.onBlur,W),"aria-describedby":O?V:void 0}),[se,W,te,O,V,G,R]),pe=d.useCallback((ge={},Ce=null)=>T({...ge,style:{...ge.style,[jn.arrowSize.var]:y?`${y}px`:void 0,[jn.arrowShadowColor.var]:b}},Ce),[T,y,b]),fe=d.useCallback((ge={},Ce=null)=>{const me={...ge.style,position:"relative",transformOrigin:jn.transformOrigin.varRef};return{ref:Ce,...E,...ge,id:V,role:"tooltip",style:me}},[E,V]);return{isOpen:O,show:se,hide:W,getTriggerProps:oe,getTooltipProps:fe,getTooltipPositionerProps:pe,getArrowProps:B,getArrowInnerProps:X}}var hv="chakra-ui:close-tooltip";function bV(e,t){return d.useEffect(()=>{const n=$1(e);return n.addEventListener(hv,t),()=>n.removeEventListener(hv,t)},[t,e]),()=>{const n=$1(e),r=Np(e);n.dispatchEvent(new r.CustomEvent(hv))}}function yV(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function CV(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var wV=_e(vn.div),Rt=Pe((e,t)=>{var n,r;const o=Qa("Tooltip",e),s=Yt(e),i=xd(),{children:l,label:u,shouldWrapChildren:p,"aria-label":h,hasArrow:m,bg:v,portalProps:x,background:y,backgroundColor:b,bgColor:w,motionProps:k,..._}=s,j=(r=(n=y??b)!=null?n:v)!=null?r:w;if(j){o.bg=j;const T=R7(i,"colors",j);o[jn.arrowBg.var]=T}const I=xV({..._,direction:i.direction}),M=typeof l=="string"||p;let E;if(M)E=a.jsx(_e.span,{display:"inline-block",tabIndex:0,...I.getTriggerProps(),children:l});else{const T=d.Children.only(l);E=d.cloneElement(T,I.getTriggerProps(T.props,T.ref))}const O=!!h,D=I.getTooltipProps({},t),A=O?yV(D,["role","id"]):D,R=CV(D,["role","id"]);return u?a.jsxs(a.Fragment,{children:[E,a.jsx(nr,{children:I.isOpen&&a.jsx(wd,{...x,children:a.jsx(_e.div,{...I.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:a.jsxs(wV,{variants:vV,initial:"exit",animate:"enter",exit:"exit",...k,...A,__css:o,children:[u,O&&a.jsx(_e.span,{srOnly:!0,...R,children:h}),m&&a.jsx(_e.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:a.jsx(_e.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):a.jsx(a.Fragment,{children:l})});Rt.displayName="Tooltip";const vo=e=>e.system,SV=e=>e.system.toastQueue,RP=ie(vo,e=>e.language,we),Pn=ie(e=>e,e=>e.system.isProcessing||!e.system.isConnected),kV=ie(vo,e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=e;return{consoleLogLevel:t,shouldLogToConsole:n}},{memoizeOptions:{resultEqualityCheck:_t}}),AP=e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=F(kV);return d.useEffect(()=>{n?(localStorage.setItem("ROARR_LOG","true"),localStorage.setItem("ROARR_FILTER",`context.logLevel:>=${A7[t]}`)):localStorage.setItem("ROARR_LOG","false"),NC.ROARR.write=N7.createLogWriter()},[t,n]),d.useEffect(()=>{const o={...T7};$7.set(NC.Roarr.child(o))},[]),d.useMemo(()=>qi(e),[e])},_V=()=>{const e=ee(),t=F(SV),n=j5();return d.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(L7())},[e,n,t]),null},Ji=()=>{const e=ee();return d.useCallback(n=>e(Tt(Ft(n))),[e])},jV=d.memo(_V);var PV=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 $d(e,t){var n=IV(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 IV(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=PV.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var EV=[".DS_Store","Thumbs.db"];function MV(e){return Ac(this,void 0,void 0,function(){return Nc(this,function(t){return sh(e)&&OV(e.dataTransfer)?[2,NV(e.dataTransfer,e.type)]:DV(e)?[2,RV(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,AV(e)]:[2,[]]})})}function OV(e){return sh(e)}function DV(e){return sh(e)&&sh(e.target)}function sh(e){return typeof e=="object"&&e!==null}function RV(e){return L1(e.target.files).map(function(t){return $d(t)})}function AV(e){return Ac(this,void 0,void 0,function(){var t;return Nc(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 $d(r)})]}})})}function NV(e,t){return Ac(this,void 0,void 0,function(){var n,r;return Nc(this,function(o){switch(o.label){case 0:return e.items?(n=L1(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(TV))]):[3,2];case 1:return r=o.sent(),[2,hS(NP(r))];case 2:return[2,hS(L1(e.files).map(function(s){return $d(s)}))]}})})}function hS(e){return e.filter(function(t){return EV.indexOf(t.name)===-1})}function L1(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function TV(e){if(typeof e.webkitGetAsEntry!="function")return mS(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?TP(t):mS(e)}function NP(e){return e.reduce(function(t,n){return w1(w1([],$w(t),!1),$w(Array.isArray(n)?NP(n):[n]),!1)},[])}function mS(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=$d(t);return Promise.resolve(n)}function $V(e){return Ac(this,void 0,void 0,function(){return Nc(this,function(t){return[2,e.isDirectory?TP(e):LV(e)]})})}function TP(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var i=this;t.readEntries(function(l){return Ac(i,void 0,void 0,function(){var u,p,h;return Nc(this,function(m){switch(m.label){case 0:if(l.length)return[3,5];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return u=m.sent(),n(u),[3,4];case 3:return p=m.sent(),r(p),[3,4];case 4:return[3,6];case 5:h=Promise.all(l.map($V)),o.push(h),s(),m.label=6;case 6:return[2]}})})},function(l){r(l)})}s()})}function LV(e){return Ac(this,void 0,void 0,function(){return Nc(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=$d(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var zV=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(i){var l=i.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?s===l.replace(/\/.*$/,""):o===l})}return!0};function gS(e){return HV(e)||BV(e)||LP(e)||FV()}function FV(){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 BV(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function HV(e){if(Array.isArray(e))return z1(e)}function vS(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 xS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vS(Object(n),!0).forEach(function(r){$P(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rd(e,t){return UV(e)||WV(e,t)||LP(e,t)||VV()}function VV(){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 LP(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 WV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,l;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(u){s=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function UV(e){if(Array.isArray(e))return e}var GV="file-invalid-type",KV="file-too-large",qV="file-too-small",XV="too-many-files",YV=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:GV,message:"File type must be ".concat(n)}},bS=function(t){return{code:KV,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},yS=function(t){return{code:qV,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},QV={code:XV,message:"Too many files"};function zP(e,t){var n=e.type==="application/x-moz-file"||zV(e,t);return[n,n?null:YV(t)]}function FP(e,t,n){if(bi(e.size))if(bi(t)&&bi(n)){if(e.size>n)return[!1,bS(n)];if(e.size<t)return[!1,yS(t)]}else{if(bi(t)&&e.size<t)return[!1,yS(t)];if(bi(n)&&e.size>n)return[!1,bS(n)]}return[!0,null]}function bi(e){return e!=null}function ZV(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,l=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(u){var p=zP(u,n),h=rd(p,1),m=h[0],v=FP(u,r,o),x=rd(v,1),y=x[0],b=l?l(u):null;return m&&y&&!b})}function ah(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Jf(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 CS(e){e.preventDefault()}function JV(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function eW(e){return e.indexOf("Edge/")!==-1}function tW(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return JV(e)||eW(e)}function ss(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),i=1;i<o;i++)s[i-1]=arguments[i];return t.some(function(l){return!ah(r)&&l&&l.apply(void 0,[r].concat(s)),ah(r)})}}function nW(){return"showOpenFilePicker"in window}function rW(e){if(bi(e)){var t=Object.entries(e).filter(function(n){var r=rd(n,2),o=r[0],s=r[1],i=!0;return BP(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),i=!1),(!Array.isArray(s)||!s.every(HP))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=rd(r,2),s=o[0],i=o[1];return xS(xS({},n),{},$P({},s,i))},{});return[{description:"Files",accept:t}]}return e}function oW(e){if(bi(e))return Object.entries(e).reduce(function(t,n){var r=rd(n,2),o=r[0],s=r[1];return[].concat(gS(t),[o],gS(s))},[]).filter(function(t){return BP(t)||HP(t)}).join(",")}function sW(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function aW(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function BP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function HP(e){return/^.*\.[\w]+$/.test(e)}var iW=["children"],lW=["open"],cW=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],uW=["refKey","onChange","onClick"];function dW(e){return hW(e)||pW(e)||VP(e)||fW()}function fW(){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 pW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hW(e){if(Array.isArray(e))return F1(e)}function mv(e,t){return vW(e)||gW(e,t)||VP(e,t)||mW()}function mW(){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 VP(e,t){if(e){if(typeof e=="string")return F1(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 F1(e,t)}}function F1(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 gW(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,l;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(u){s=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function vW(e){if(Array.isArray(e))return e}function wS(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 ln(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wS(Object(n),!0).forEach(function(r){B1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ih(e,t){if(e==null)return{};var n=xW(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 xW(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 Fb=d.forwardRef(function(e,t){var n=e.children,r=ih(e,iW),o=Bb(r),s=o.open,i=ih(o,lW);return d.useImperativeHandle(t,function(){return{open:s}},[s]),H.createElement(d.Fragment,null,n(ln(ln({},i),{},{open:s})))});Fb.displayName="Dropzone";var WP={disabled:!1,getFilesFromEvent:MV,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};Fb.defaultProps=WP;Fb.propTypes={children:Ht.func,accept:Ht.objectOf(Ht.arrayOf(Ht.string)),multiple:Ht.bool,preventDropOnDocument:Ht.bool,noClick:Ht.bool,noKeyboard:Ht.bool,noDrag:Ht.bool,noDragEventsBubbling:Ht.bool,minSize:Ht.number,maxSize:Ht.number,maxFiles:Ht.number,disabled:Ht.bool,getFilesFromEvent:Ht.func,onFileDialogCancel:Ht.func,onFileDialogOpen:Ht.func,useFsAccessApi:Ht.bool,autoFocus:Ht.bool,onDragEnter:Ht.func,onDragLeave:Ht.func,onDragOver:Ht.func,onDrop:Ht.func,onDropAccepted:Ht.func,onDropRejected:Ht.func,onError:Ht.func,validator:Ht.func};var H1={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Bb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=ln(ln({},WP),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,l=t.multiple,u=t.maxFiles,p=t.onDragEnter,h=t.onDragLeave,m=t.onDragOver,v=t.onDrop,x=t.onDropAccepted,y=t.onDropRejected,b=t.onFileDialogCancel,w=t.onFileDialogOpen,k=t.useFsAccessApi,_=t.autoFocus,j=t.preventDropOnDocument,I=t.noClick,M=t.noKeyboard,E=t.noDrag,O=t.noDragEventsBubbling,D=t.onError,A=t.validator,R=d.useMemo(function(){return oW(n)},[n]),T=d.useMemo(function(){return rW(n)},[n]),X=d.useMemo(function(){return typeof w=="function"?w:SS},[w]),B=d.useMemo(function(){return typeof b=="function"?b:SS},[b]),U=d.useRef(null),Y=d.useRef(null),V=d.useReducer(bW,H1),L=mv(V,2),q=L[0],z=L[1],K=q.isFocused,re=q.isFileDialogActive,Q=d.useRef(typeof window<"u"&&window.isSecureContext&&k&&nW()),le=function(){!Q.current&&re&&setTimeout(function(){if(Y.current){var Re=Y.current.files;Re.length||(z({type:"closeDialog"}),B())}},300)};d.useEffect(function(){return window.addEventListener("focus",le,!1),function(){window.removeEventListener("focus",le,!1)}},[Y,re,B,Q]);var se=d.useRef([]),W=function(Re){U.current&&U.current.contains(Re.target)||(Re.preventDefault(),se.current=[])};d.useEffect(function(){return j&&(document.addEventListener("dragover",CS,!1),document.addEventListener("drop",W,!1)),function(){j&&(document.removeEventListener("dragover",CS),document.removeEventListener("drop",W))}},[U,j]),d.useEffect(function(){return!r&&_&&U.current&&U.current.focus(),function(){}},[U,_,r]);var G=d.useCallback(function(xe){D?D(xe):console.error(xe)},[D]),te=d.useCallback(function(xe){xe.preventDefault(),xe.persist(),Ue(xe),se.current=[].concat(dW(se.current),[xe.target]),Jf(xe)&&Promise.resolve(o(xe)).then(function(Re){if(!(ah(xe)&&!O)){var st=Re.length,mt=st>0&&ZV({files:Re,accept:R,minSize:i,maxSize:s,multiple:l,maxFiles:u,validator:A}),ve=st>0&&!mt;z({isDragAccept:mt,isDragReject:ve,isDragActive:!0,type:"setDraggedFiles"}),p&&p(xe)}}).catch(function(Re){return G(Re)})},[o,p,G,O,R,i,s,l,u,A]),ae=d.useCallback(function(xe){xe.preventDefault(),xe.persist(),Ue(xe);var Re=Jf(xe);if(Re&&xe.dataTransfer)try{xe.dataTransfer.dropEffect="copy"}catch{}return Re&&m&&m(xe),!1},[m,O]),oe=d.useCallback(function(xe){xe.preventDefault(),xe.persist(),Ue(xe);var Re=se.current.filter(function(mt){return U.current&&U.current.contains(mt)}),st=Re.indexOf(xe.target);st!==-1&&Re.splice(st,1),se.current=Re,!(Re.length>0)&&(z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Jf(xe)&&h&&h(xe))},[U,h,O]),pe=d.useCallback(function(xe,Re){var st=[],mt=[];xe.forEach(function(ve){var Ye=zP(ve,R),ot=mv(Ye,2),lt=ot[0],Me=ot[1],$e=FP(ve,i,s),At=mv($e,2),ke=At[0],ze=At[1],Le=A?A(ve):null;if(lt&&ke&&!Le)st.push(ve);else{var We=[Me,ze];Le&&(We=We.concat(Le)),mt.push({file:ve,errors:We.filter(function(ct){return ct})})}}),(!l&&st.length>1||l&&u>=1&&st.length>u)&&(st.forEach(function(ve){mt.push({file:ve,errors:[QV]})}),st.splice(0)),z({acceptedFiles:st,fileRejections:mt,type:"setFiles"}),v&&v(st,mt,Re),mt.length>0&&y&&y(mt,Re),st.length>0&&x&&x(st,Re)},[z,l,R,i,s,u,v,x,y,A]),fe=d.useCallback(function(xe){xe.preventDefault(),xe.persist(),Ue(xe),se.current=[],Jf(xe)&&Promise.resolve(o(xe)).then(function(Re){ah(xe)&&!O||pe(Re,xe)}).catch(function(Re){return G(Re)}),z({type:"reset"})},[o,pe,G,O]),ge=d.useCallback(function(){if(Q.current){z({type:"openDialog"}),X();var xe={multiple:l,types:T};window.showOpenFilePicker(xe).then(function(Re){return o(Re)}).then(function(Re){pe(Re,null),z({type:"closeDialog"})}).catch(function(Re){sW(Re)?(B(Re),z({type:"closeDialog"})):aW(Re)?(Q.current=!1,Y.current?(Y.current.value=null,Y.current.click()):G(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."))):G(Re)});return}Y.current&&(z({type:"openDialog"}),X(),Y.current.value=null,Y.current.click())},[z,X,B,k,pe,G,T,l]),Ce=d.useCallback(function(xe){!U.current||!U.current.isEqualNode(xe.target)||(xe.key===" "||xe.key==="Enter"||xe.keyCode===32||xe.keyCode===13)&&(xe.preventDefault(),ge())},[U,ge]),me=d.useCallback(function(){z({type:"focus"})},[]),de=d.useCallback(function(){z({type:"blur"})},[]),De=d.useCallback(function(){I||(tW()?setTimeout(ge,0):ge())},[I,ge]),je=function(Re){return r?null:Re},Be=function(Re){return M?null:je(Re)},rt=function(Re){return E?null:je(Re)},Ue=function(Re){O&&Re.stopPropagation()},wt=d.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=xe.refKey,st=Re===void 0?"ref":Re,mt=xe.role,ve=xe.onKeyDown,Ye=xe.onFocus,ot=xe.onBlur,lt=xe.onClick,Me=xe.onDragEnter,$e=xe.onDragOver,At=xe.onDragLeave,ke=xe.onDrop,ze=ih(xe,cW);return ln(ln(B1({onKeyDown:Be(ss(ve,Ce)),onFocus:Be(ss(Ye,me)),onBlur:Be(ss(ot,de)),onClick:je(ss(lt,De)),onDragEnter:rt(ss(Me,te)),onDragOver:rt(ss($e,ae)),onDragLeave:rt(ss(At,oe)),onDrop:rt(ss(ke,fe)),role:typeof mt=="string"&&mt!==""?mt:"presentation"},st,U),!r&&!M?{tabIndex:0}:{}),ze)}},[U,Ce,me,de,De,te,ae,oe,fe,M,E,r]),Xe=d.useCallback(function(xe){xe.stopPropagation()},[]),tt=d.useMemo(function(){return function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=xe.refKey,st=Re===void 0?"ref":Re,mt=xe.onChange,ve=xe.onClick,Ye=ih(xe,uW),ot=B1({accept:R,multiple:l,type:"file",style:{display:"none"},onChange:je(ss(mt,fe)),onClick:je(ss(ve,Xe)),tabIndex:-1},st,Y);return ln(ln({},ot),Ye)}},[Y,n,l,fe,r]);return ln(ln({},q),{},{isFocused:K&&!r,getRootProps:wt,getInputProps:tt,rootRef:U,inputRef:Y,open:je(ge)})}function bW(e,t){switch(t.type){case"focus":return ln(ln({},e),{},{isFocused:!0});case"blur":return ln(ln({},e),{},{isFocused:!1});case"openDialog":return ln(ln({},H1),{},{isFileDialogActive:!0});case"closeDialog":return ln(ln({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ln(ln({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ln(ln({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return ln({},H1);default:return e}}function SS(){}function V1(){return V1=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},V1.apply(this,arguments)}var UP=["shift","alt","meta","mod","ctrl"],yW={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 $a(e){return(yW[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function CW(e){return UP.includes(e)}function gv(e,t){return t===void 0&&(t=","),e.split(t)}function vv(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(i){return $a(i)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},s=r.filter(function(i){return!UP.includes(i)});return V1({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&GP([$a(e.key),$a(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&KP([$a(e.key),$a(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){La.clear()})})();var La=new Set;function Hb(e){return Array.isArray(e)}function Tp(e,t){t===void 0&&(t=",");var n=Hb(e)?e:e.split(t);return n.every(function(r){return La.has(r.trim().toLowerCase())})}function GP(e){var t=Array.isArray(e)?e:[e];La.has("meta")&&La.forEach(function(n){return!CW(n)&&La.delete(n.toLowerCase())}),t.forEach(function(n){return La.add(n.toLowerCase())})}function KP(e){var t=Array.isArray(e)?e:[e];e==="meta"?La.clear():t.forEach(function(n){return La.delete(n.toLowerCase())})}function wW(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function SW(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function kW(e){return qP(e,["input","textarea","select"])}function qP(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return Hb(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function _W(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 jW=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,i=n.mod,l=n.shift,u=n.ctrl,p=n.keys,h=t.key,m=t.code,v=t.ctrlKey,x=t.metaKey,y=t.shiftKey,b=t.altKey,w=$a(m),k=h.toLowerCase();if(!r){if(o===!b&&k!=="alt"||l===!y&&k!=="shift")return!1;if(i){if(!x&&!v)return!1}else if(s===!x&&k!=="meta"&&k!=="os"||u===!v&&k!=="ctrl"&&k!=="control")return!1}return p&&p.length===1&&(p.includes(k)||p.includes(w))?!0:p?Tp(p):!p},PW=d.createContext(void 0),IW=function(){return d.useContext(PW)};function XP(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&&XP(e[r],t[r])},!0):e===t}var EW=d.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),MW=function(){return d.useContext(EW)};function OW(e){var t=d.useRef(void 0);return XP(t.current,e)||(t.current=e),t.current}var kS=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},DW=typeof window<"u"?d.useLayoutEffect:d.useEffect;function Qe(e,t,n,r){var o=d.useRef(null),s=d.useRef(!1),i=n instanceof Array?r instanceof Array?void 0:r:n,l=Hb(e)?e.join(i==null?void 0:i.splitKey):e,u=n instanceof Array?n:r instanceof Array?r:void 0,p=d.useCallback(t,u??[]),h=d.useRef(p);u?h.current=p:h.current=t;var m=OW(i),v=MW(),x=v.enabledScopes,y=IW();return DW(function(){if(!((m==null?void 0:m.enabled)===!1||!_W(x,m==null?void 0:m.scopes))){var b=function(I,M){var E;if(M===void 0&&(M=!1),!(kW(I)&&!qP(I,m==null?void 0:m.enableOnFormTags))&&!(m!=null&&m.ignoreEventWhen!=null&&m.ignoreEventWhen(I))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){kS(I);return}(E=I.target)!=null&&E.isContentEditable&&!(m!=null&&m.enableOnContentEditable)||gv(l,m==null?void 0:m.splitKey).forEach(function(O){var D,A=vv(O,m==null?void 0:m.combinationKey);if(jW(I,A,m==null?void 0:m.ignoreModifiers)||(D=A.keys)!=null&&D.includes("*")){if(M&&s.current)return;if(wW(I,A,m==null?void 0:m.preventDefault),!SW(I,A,m==null?void 0:m.enabled)){kS(I);return}h.current(I,A),M||(s.current=!0)}})}},w=function(I){I.key!==void 0&&(GP($a(I.code)),((m==null?void 0:m.keydown)===void 0&&(m==null?void 0:m.keyup)!==!0||m!=null&&m.keydown)&&b(I))},k=function(I){I.key!==void 0&&(KP($a(I.code)),s.current=!1,m!=null&&m.keyup&&b(I,!0))},_=o.current||(i==null?void 0:i.document)||document;return _.addEventListener("keyup",k),_.addEventListener("keydown",w),y&&gv(l,m==null?void 0:m.splitKey).forEach(function(j){return y.addHotkey(vv(j,m==null?void 0:m.combinationKey,m==null?void 0:m.description))}),function(){_.removeEventListener("keyup",k),_.removeEventListener("keydown",w),y&&gv(l,m==null?void 0:m.splitKey).forEach(function(j){return y.removeHotkey(vv(j,m==null?void 0:m.combinationKey,m==null?void 0:m.description))})}}},[l,m,x]),o}const RW=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return Qe("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($,{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($,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"full",height:"full",alignItems:"center",justifyContent:"center",p:4},children:a.jsx($,{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(so,{size:"lg",children:"Drop to Upload"}):a.jsxs(a.Fragment,{children:[a.jsx(so,{size:"lg",children:"Invalid Upload"}),a.jsx(so,{size:"md",children:"Must be single JPEG or PNG image"})]})})})]})},AW=d.memo(RW),NW=ie([be,wn],({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}},we),TW=e=>{const{children:t}=e,{autoAddBoardId:n,postUploadAction:r}=F(NW),o=F(Pn),s=Ji(),{t:i}=J(),[l,u]=d.useState(!1),[p]=Oj(),h=d.useCallback(j=>{u(!0),s({title:i("toast.uploadFailed"),description:j.errors.map(I=>I.message).join(`
|
||
`),status:"error"})},[i,s]),m=d.useCallback(async j=>{p({file:j,image_category:"user",is_intermediate:!1,postUploadAction:r,board_id:n==="none"?void 0:n})},[n,r,p]),v=d.useCallback((j,I)=>{if(I.length>1){s({title:i("toast.uploadFailed"),description:i("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}I.forEach(M=>{h(M)}),j.forEach(M=>{m(M)})},[i,s,m,h]),{getRootProps:x,getInputProps:y,isDragAccept:b,isDragReject:w,isDragActive:k,inputRef:_}=Bb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>u(!0),disabled:o,multiple:!1});return d.useEffect(()=>{const j=async I=>{var M,E;_.current&&(M=I.clipboardData)!=null&&M.files&&(_.current.files=I.clipboardData.files,(E=_.current)==null||E.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(nr,{children:k&&l&&a.jsx(vn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(AW,{isDragAccept:b,isDragReject:w,setIsHandlingUpload:u})},"image-upload-overlay")})]})},$W=d.memo(TW),LW=Pe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...i}={},isChecked:l,...u}=e;return a.jsx(Rt,{label:r,placement:o,hasArrow:s,...i,children:a.jsx(vc,{ref:t,colorScheme:l?"accent":"base",...u,children:n})})}),it=d.memo(LW);function zW(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 YP(e){return Array.isArray(e)?e:[e]}const FW=()=>{};function BW(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||FW:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function QP({data:e}){const t=[],n=[],r=e.reduce((o,s,i)=>(s.group?o[s.group]?o[s.group].push(i):o[s.group]=[i]:n.push(i),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(s=>e[s]))}),t.push(...n.map(o=>e[o])),t}function ZP(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==H.Fragment:!1}function JP(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=JP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function e6(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=JP(t))&&(r&&(r+=" "),r+=n);return r}const HW={app:100,modal:200,popover:300,overlay:400,max:9999};function Vb(e){return HW[e]}function VW(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 WW=z7({key:"mantine",prepend:!0});function UW(){return x5()||WW}var GW=Object.defineProperty,_S=Object.getOwnPropertySymbols,KW=Object.prototype.hasOwnProperty,qW=Object.prototype.propertyIsEnumerable,jS=(e,t,n)=>t in e?GW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XW=(e,t)=>{for(var n in t||(t={}))KW.call(t,n)&&jS(e,n,t[n]);if(_S)for(var n of _S(t))qW.call(t,n)&&jS(e,n,t[n]);return e};const xv="ref";function YW(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(!(xv in n))return{args:e,ref:t};t=n[xv];const r=XW({},n);return delete r[xv],{args:[r],ref:t}}const{cssFactory:QW}=(()=>{function e(n,r,o){const s=[],i=H7(n,s,o);return s.length<2?o:i+r(s)}function t(n){const{cache:r}=n,o=(...i)=>{const{ref:l,args:u}=YW(i),p=F7(u,r.registered);return B7(r,p,!1),`${r.key}-${p.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...i)=>e(r.registered,o,e6(i))}}return{cssFactory:t}})();function t6(){const e=UW();return VW(()=>QW({cache:e}),[e])}function ZW({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const i=n.reduce((l,u)=>(Object.keys(u.classNames).forEach(p=>{typeof l[p]!="string"?l[p]=`${u.classNames[p]}`:l[p]=`${l[p]} ${u.classNames[p]}`}),l),{});return Object.keys(t).reduce((l,u)=>(l[u]=e(t[u],i[u],r!=null&&r[u],Array.isArray(o)?o.filter(Boolean).map(p=>`${(s==null?void 0:s.key)||"mantine"}-${p}-${u}`).join(" "):o?`${(s==null?void 0:s.key)||"mantine"}-${o}-${u}`:null),l),{})}var JW=Object.defineProperty,PS=Object.getOwnPropertySymbols,eU=Object.prototype.hasOwnProperty,tU=Object.prototype.propertyIsEnumerable,IS=(e,t,n)=>t in e?JW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bv=(e,t)=>{for(var n in t||(t={}))eU.call(t,n)&&IS(e,n,t[n]);if(PS)for(var n of PS(t))tU.call(t,n)&&IS(e,n,t[n]);return e};function W1(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=bv(bv({},e[n]),t[n]):e[n]=bv({},t[n])}),e}function ES(e,t,n,r){const o=s=>typeof s=="function"?s(t,n||{},r):s||{};return Array.isArray(e)?e.map(s=>o(s.styles)).reduce((s,i)=>W1(s,i),{}):o(e)}function nU({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,i)=>(i.variants&&r in i.variants&&W1(s,i.variants[r](t,n,{variant:r,size:o})),i.sizes&&o in i.sizes&&W1(s,i.sizes[o](t,n,{variant:r,size:o})),s),{})}function or(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=ca(),i=mN(o==null?void 0:o.name),l=x5(),u={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:p,cx:h}=t6(),m=t(s,r,u),v=ES(o==null?void 0:o.styles,s,r,u),x=ES(i,s,r,u),y=nU({ctx:i,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),b=Object.fromEntries(Object.keys(m).map(w=>{const k=h({[p(m[w])]:!(o!=null&&o.unstyled)},p(y[w]),p(x[w]),p(v[w]));return[w,k]}));return{classes:ZW({cx:h,classes:b,context:i,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:l}),cx:h,theme:s}}return n}function MS(e){return`___ref-${e||""}`}var rU=Object.defineProperty,oU=Object.defineProperties,sU=Object.getOwnPropertyDescriptors,OS=Object.getOwnPropertySymbols,aU=Object.prototype.hasOwnProperty,iU=Object.prototype.propertyIsEnumerable,DS=(e,t,n)=>t in e?rU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cu=(e,t)=>{for(var n in t||(t={}))aU.call(t,n)&&DS(e,n,t[n]);if(OS)for(var n of OS(t))iU.call(t,n)&&DS(e,n,t[n]);return e},wu=(e,t)=>oU(e,sU(t));const Su={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${Oe(10)})`},transitionProperty:"transform, opacity"},ep={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(-${Oe(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(${Oe(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(${Oe(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Oe(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:wu(Cu({},Su),{common:{transformOrigin:"center center"}}),"pop-bottom-left":wu(Cu({},Su),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":wu(Cu({},Su),{common:{transformOrigin:"bottom right"}}),"pop-top-left":wu(Cu({},Su),{common:{transformOrigin:"top left"}}),"pop-top-right":wu(Cu({},Su),{common:{transformOrigin:"top right"}})},RS=["mousedown","touchstart"];function lU(e,t,n){const r=d.useRef();return d.useEffect(()=>{const o=s=>{const{target:i}=s??{};if(Array.isArray(n)){const l=(i==null?void 0:i.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(i)&&i.tagName!=="HTML";n.every(p=>!!p&&!s.composedPath().includes(p))&&!l&&e()}else r.current&&!r.current.contains(i)&&e()};return(t||RS).forEach(s=>document.addEventListener(s,o)),()=>{(t||RS).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function cU(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function uU(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function dU(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=d.useState(n?t:uU(e,t)),s=d.useRef();return d.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),cU(s.current,i=>o(i.matches))},[e]),r}const n6=typeof document<"u"?d.useLayoutEffect:d.useEffect;function $o(e,t){const n=d.useRef(!1);d.useEffect(()=>()=>{n.current=!1},[]),d.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function fU({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 $o(()=>{let o=-1;const s=i=>{i.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const pU=/input|select|textarea|button|object/,r6="a, input, select, textarea, button, object, [tabindex]";function hU(e){return e.style.display==="none"}function mU(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(hU(n))return!1;n=n.parentNode}return!0}function o6(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function U1(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(o6(e));return(pU.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&mU(e)}function s6(e){const t=o6(e);return(Number.isNaN(t)||t>=0)&&U1(e)}function gU(e){return Array.from(e.querySelectorAll(r6)).filter(s6)}function vU(e,t){const n=gU(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();if(!(r===o.activeElement||e===o.activeElement))return;t.preventDefault();const i=n[t.shiftKey?n.length-1:0];i&&i.focus()}function Wb(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function xU(e,t="body > :not(script)"){const n=Wb(),r=Array.from(document.querySelectorAll(t)).map(o=>{var s;if((s=o==null?void 0:o.shadowRoot)!=null&&s.contains(e)||o.contains(e))return;const i=o.getAttribute("aria-hidden"),l=o.getAttribute("data-hidden"),u=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!l&&!u&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:l||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 bU(e=!0){const t=d.useRef(),n=d.useRef(null),r=s=>{let i=s.querySelector("[data-autofocus]");if(!i){const l=Array.from(s.querySelectorAll(r6));i=l.find(s6)||l.find(U1)||null,!i&&U1(s)&&(i=s)}i&&i.focus({preventScroll:!0})},o=d.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=xU(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=i=>{i.key==="Tab"&&t.current&&vU(t.current,i)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const yU=H["useId".toString()]||(()=>{});function CU(){const e=yU();return e?`mantine-${e.replace(/:/g,"")}`:""}function Ub(e){const t=CU(),[n,r]=d.useState(t);return n6(()=>{r(Wb())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function AS(e,t,n){d.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function a6(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function wU(...e){return t=>{e.forEach(n=>a6(n,t))}}function Ld(...e){return d.useCallback(wU(...e),e)}function od({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=d.useState(t!==void 0?t:n),i=l=>{s(l),r==null||r(l)};return e!==void 0?[e,r,!0]:[o,i,!1]}function i6(e,t){return dU("(prefers-reduced-motion: reduce)",e,t)}const SU=e=>e<.5?2*e*e:-1+(4-2*e)*e,kU=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const i=!!n,u=(n||document.body).getBoundingClientRect(),p=t.getBoundingClientRect(),h=m=>p[m]-u[m];if(e==="y"){const m=h("top");if(m===0)return 0;if(r==="start"){const x=m-o;return x<=p.height*(s?0:1)||!s?x:0}const v=i?u.height:window.innerHeight;if(r==="end"){const x=m+o-v+p.height;return x>=-p.height*(s?0:1)||!s?x:0}return r==="center"?m-v/2+p.height/2:0}if(e==="x"){const m=h("left");if(m===0)return 0;if(r==="start"){const x=m-o;return x<=p.width||!s?x:0}const v=i?u.width:window.innerWidth;if(r==="end"){const x=m+o-v+p.width;return x>=-p.width||!s?x:0}return r==="center"?m-v/2+p.width/2:0}return 0},_U=({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]},jU=({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 l6({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=SU,offset:o=0,cancelable:s=!0,isList:i=!1}={}){const l=d.useRef(0),u=d.useRef(0),p=d.useRef(!1),h=d.useRef(null),m=d.useRef(null),v=i6(),x=()=>{l.current&&cancelAnimationFrame(l.current)},y=d.useCallback(({alignment:w="start"}={})=>{var k;p.current=!1,l.current&&x();const _=(k=_U({parent:h.current,axis:t}))!=null?k:0,j=kU({parent:h.current,target:m.current,axis:t,alignment:w,offset:o,isList:i})-(h.current?0:_);function I(){u.current===0&&(u.current=performance.now());const E=performance.now()-u.current,O=v||e===0?1:E/e,D=_+j*r(O);jU({parent:h.current,axis:t,distance:D}),!p.current&&O<1?l.current=requestAnimationFrame(I):(typeof n=="function"&&n(),u.current=0,l.current=0,x())}I()},[t,e,r,i,o,n,v]),b=()=>{s&&(p.current=!0)};return AS("wheel",b,{passive:!0}),AS("touchmove",b,{passive:!0}),d.useEffect(()=>x,[]),{scrollableRef:h,targetRef:m,scrollIntoView:y,cancel:x}}var NS=Object.getOwnPropertySymbols,PU=Object.prototype.hasOwnProperty,IU=Object.prototype.propertyIsEnumerable,EU=(e,t)=>{var n={};for(var r in e)PU.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&NS)for(var r of NS(e))t.indexOf(r)<0&&IU.call(e,r)&&(n[r]=e[r]);return n};function Gm(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:i,ml:l,mr:u,p,px:h,py:m,pt:v,pb:x,pl:y,pr:b,bg:w,c:k,opacity:_,ff:j,fz:I,fw:M,lts:E,ta:O,lh:D,fs:A,tt:R,td:T,w:X,miw:B,maw:U,h:Y,mih:V,mah:L,bgsz:q,bgp:z,bgr:K,bga:re,pos:Q,top:le,left:se,bottom:W,right:G,inset:te,display:ae}=t,oe=EU(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:gN({m:n,mx:r,my:o,mt:s,mb:i,ml:l,mr:u,p,px:h,py:m,pt:v,pb:x,pl:y,pr:b,bg:w,c:k,opacity:_,ff:j,fz:I,fw:M,lts:E,ta:O,lh:D,fs:A,tt:R,td:T,w:X,miw:B,maw:U,h:Y,mih:V,mah:L,bgsz:q,bgp:z,bgr:K,bga:re,pos:Q,top:le,left:se,bottom:W,right:G,inset:te,display:ae}),rest:oe}}function MU(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>Cw(ut({size:r,sizes:t.breakpoints}))-Cw(ut({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function OU({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return MU(e,t).reduce((i,l)=>{if(l==="base"&&e.base!==void 0){const p=n(e.base,t);return Array.isArray(r)?(r.forEach(h=>{i[h]=p}),i):(i[r]=p,i)}const u=n(e[l],t);return Array.isArray(r)?(i[t.fn.largerThan(l)]={},r.forEach(p=>{i[t.fn.largerThan(l)][p]=u}),i):(i[t.fn.largerThan(l)]={[r]:u},i)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,i)=>(s[i]=o,s),{}):{[r]:o}}function DU(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 RU(e){return Oe(e)}function AU(e){return e}function NU(e,t){return ut({size:e,sizes:t.fontSizes})}const TU=["-xs","-sm","-md","-lg","-xl"];function $U(e,t){return TU.includes(e)?`calc(${ut({size:e.replace("-",""),sizes:t.spacing})} * -1)`:ut({size:e,sizes:t.spacing})}const LU={identity:AU,color:DU,size:RU,fontSize:NU,spacing:$U},zU={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 FU=Object.defineProperty,TS=Object.getOwnPropertySymbols,BU=Object.prototype.hasOwnProperty,HU=Object.prototype.propertyIsEnumerable,$S=(e,t,n)=>t in e?FU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LS=(e,t)=>{for(var n in t||(t={}))BU.call(t,n)&&$S(e,n,t[n]);if(TS)for(var n of TS(t))HU.call(t,n)&&$S(e,n,t[n]);return e};function zS(e,t,n=zU){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(OU({value:e[s],getValue:LU[n[s].type],property:n[s].property,theme:t})),o),[]).reduce((o,s)=>(Object.keys(s).forEach(i=>{typeof s[i]=="object"&&s[i]!==null&&i in o?o[i]=LS(LS({},o[i]),s[i]):o[i]=s[i]}),o),{})}function FS(e,t){return typeof e=="function"?e(t):e}function VU(e,t,n){const r=ca(),{css:o,cx:s}=t6();return Array.isArray(e)?s(n,o(zS(t,r)),e.map(i=>o(FS(i,r)))):s(n,o(FS(e,r)),o(zS(t,r)))}var WU=Object.defineProperty,lh=Object.getOwnPropertySymbols,c6=Object.prototype.hasOwnProperty,u6=Object.prototype.propertyIsEnumerable,BS=(e,t,n)=>t in e?WU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UU=(e,t)=>{for(var n in t||(t={}))c6.call(t,n)&&BS(e,n,t[n]);if(lh)for(var n of lh(t))u6.call(t,n)&&BS(e,n,t[n]);return e},GU=(e,t)=>{var n={};for(var r in e)c6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lh)for(var r of lh(e))t.indexOf(r)<0&&u6.call(e,r)&&(n[r]=e[r]);return n};const d6=d.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:i}=n,l=GU(n,["className","component","style","sx"]);const{systemStyles:u,rest:p}=Gm(l),h=o||"div";return H.createElement(h,UU({ref:t,className:VU(i,u,r),style:s},p))});d6.displayName="@mantine/core/Box";const Mr=d6;var KU=Object.defineProperty,qU=Object.defineProperties,XU=Object.getOwnPropertyDescriptors,HS=Object.getOwnPropertySymbols,YU=Object.prototype.hasOwnProperty,QU=Object.prototype.propertyIsEnumerable,VS=(e,t,n)=>t in e?KU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WS=(e,t)=>{for(var n in t||(t={}))YU.call(t,n)&&VS(e,n,t[n]);if(HS)for(var n of HS(t))QU.call(t,n)&&VS(e,n,t[n]);return e},ZU=(e,t)=>qU(e,XU(t)),JU=or(e=>({root:ZU(WS(WS({},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 eG=JU;var tG=Object.defineProperty,ch=Object.getOwnPropertySymbols,f6=Object.prototype.hasOwnProperty,p6=Object.prototype.propertyIsEnumerable,US=(e,t,n)=>t in e?tG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nG=(e,t)=>{for(var n in t||(t={}))f6.call(t,n)&&US(e,n,t[n]);if(ch)for(var n of ch(t))p6.call(t,n)&&US(e,n,t[n]);return e},rG=(e,t)=>{var n={};for(var r in e)f6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ch)for(var r of ch(e))t.indexOf(r)<0&&p6.call(e,r)&&(n[r]=e[r]);return n};const h6=d.forwardRef((e,t)=>{const n=Sn("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:i}=n,l=rG(n,["className","component","unstyled","variant"]),{classes:u,cx:p}=eG(null,{name:"UnstyledButton",unstyled:s,variant:i});return H.createElement(Mr,nG({component:o,ref:t,className:p(u.root,r),type:o==="button"?"button":void 0},l))});h6.displayName="@mantine/core/UnstyledButton";const oG=h6;var sG=Object.defineProperty,aG=Object.defineProperties,iG=Object.getOwnPropertyDescriptors,GS=Object.getOwnPropertySymbols,lG=Object.prototype.hasOwnProperty,cG=Object.prototype.propertyIsEnumerable,KS=(e,t,n)=>t in e?sG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G1=(e,t)=>{for(var n in t||(t={}))lG.call(t,n)&&KS(e,n,t[n]);if(GS)for(var n of GS(t))cG.call(t,n)&&KS(e,n,t[n]);return e},qS=(e,t)=>aG(e,iG(t));const uG=["subtle","filled","outline","light","default","transparent","gradient"],tp={xs:Oe(18),sm:Oe(22),md:Oe(28),lg:Oe(34),xl:Oe(44)};function dG({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%"})}:uG.includes(e)?G1({border:`${Oe(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var fG=or((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:qS(G1({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:ut({size:s,sizes:tp}),minHeight:ut({size:s,sizes:tp}),width:ut({size:s,sizes:tp}),minWidth:ut({size:s,sizes:tp})},dG({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":qS(G1({content:'""'},e.fn.cover(Oe(-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 pG=fG;var hG=Object.defineProperty,uh=Object.getOwnPropertySymbols,m6=Object.prototype.hasOwnProperty,g6=Object.prototype.propertyIsEnumerable,XS=(e,t,n)=>t in e?hG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YS=(e,t)=>{for(var n in t||(t={}))m6.call(t,n)&&XS(e,n,t[n]);if(uh)for(var n of uh(t))g6.call(t,n)&&XS(e,n,t[n]);return e},QS=(e,t)=>{var n={};for(var r in e)m6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uh)for(var r of uh(e))t.indexOf(r)<0&&g6.call(e,r)&&(n[r]=e[r]);return n};function mG(e){var t=e,{size:n,color:r}=t,o=QS(t,["size","color"]);const s=o,{style:i}=s,l=QS(s,["style"]);return H.createElement("svg",YS({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,style:YS({width:n},i)},l),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 gG=Object.defineProperty,dh=Object.getOwnPropertySymbols,v6=Object.prototype.hasOwnProperty,x6=Object.prototype.propertyIsEnumerable,ZS=(e,t,n)=>t in e?gG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JS=(e,t)=>{for(var n in t||(t={}))v6.call(t,n)&&ZS(e,n,t[n]);if(dh)for(var n of dh(t))x6.call(t,n)&&ZS(e,n,t[n]);return e},e4=(e,t)=>{var n={};for(var r in e)v6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dh)for(var r of dh(e))t.indexOf(r)<0&&x6.call(e,r)&&(n[r]=e[r]);return n};function vG(e){var t=e,{size:n,color:r}=t,o=e4(t,["size","color"]);const s=o,{style:i}=s,l=e4(s,["style"]);return H.createElement("svg",JS({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r,style:JS({width:n,height:n},i)},l),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 xG=Object.defineProperty,fh=Object.getOwnPropertySymbols,b6=Object.prototype.hasOwnProperty,y6=Object.prototype.propertyIsEnumerable,t4=(e,t,n)=>t in e?xG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,n4=(e,t)=>{for(var n in t||(t={}))b6.call(t,n)&&t4(e,n,t[n]);if(fh)for(var n of fh(t))y6.call(t,n)&&t4(e,n,t[n]);return e},r4=(e,t)=>{var n={};for(var r in e)b6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fh)for(var r of fh(e))t.indexOf(r)<0&&y6.call(e,r)&&(n[r]=e[r]);return n};function bG(e){var t=e,{size:n,color:r}=t,o=r4(t,["size","color"]);const s=o,{style:i}=s,l=r4(s,["style"]);return H.createElement("svg",n4({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,style:n4({width:n},i)},l),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 yG=Object.defineProperty,ph=Object.getOwnPropertySymbols,C6=Object.prototype.hasOwnProperty,w6=Object.prototype.propertyIsEnumerable,o4=(e,t,n)=>t in e?yG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CG=(e,t)=>{for(var n in t||(t={}))C6.call(t,n)&&o4(e,n,t[n]);if(ph)for(var n of ph(t))w6.call(t,n)&&o4(e,n,t[n]);return e},wG=(e,t)=>{var n={};for(var r in e)C6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ph)for(var r of ph(e))t.indexOf(r)<0&&w6.call(e,r)&&(n[r]=e[r]);return n};const yv={bars:mG,oval:vG,dots:bG},SG={xs:Oe(18),sm:Oe(22),md:Oe(36),lg:Oe(44),xl:Oe(58)},kG={size:"md"};function S6(e){const t=Sn("Loader",kG,e),{size:n,color:r,variant:o}=t,s=wG(t,["size","color","variant"]),i=ca(),l=o in yv?o:i.loader;return H.createElement(Mr,CG({role:"presentation",component:yv[l]||yv.bars,size:ut({size:n,sizes:SG}),color:i.fn.variant({variant:"filled",primaryFallback:!1,color:r||i.primaryColor}).background},s))}S6.displayName="@mantine/core/Loader";var _G=Object.defineProperty,hh=Object.getOwnPropertySymbols,k6=Object.prototype.hasOwnProperty,_6=Object.prototype.propertyIsEnumerable,s4=(e,t,n)=>t in e?_G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,a4=(e,t)=>{for(var n in t||(t={}))k6.call(t,n)&&s4(e,n,t[n]);if(hh)for(var n of hh(t))_6.call(t,n)&&s4(e,n,t[n]);return e},jG=(e,t)=>{var n={};for(var r in e)k6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hh)for(var r of hh(e))t.indexOf(r)<0&&_6.call(e,r)&&(n[r]=e[r]);return n};const PG={color:"gray",size:"md",variant:"subtle"},j6=d.forwardRef((e,t)=>{const n=Sn("ActionIcon",PG,e),{className:r,color:o,children:s,radius:i,size:l,variant:u,gradient:p,disabled:h,loaderProps:m,loading:v,unstyled:x,__staticSelector:y}=n,b=jG(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:w,cx:k,theme:_}=pG({radius:i,color:o,gradient:p},{name:["ActionIcon",y],unstyled:x,size:l,variant:u}),j=H.createElement(S6,a4({color:_.fn.variant({color:o,variant:u}).color,size:"100%","data-action-icon-loader":!0},m));return H.createElement(oG,a4({className:k(w.root,r),ref:t,disabled:h,"data-disabled":h||void 0,"data-loading":v||void 0,unstyled:x},b),v?j:s)});j6.displayName="@mantine/core/ActionIcon";const IG=j6;var EG=Object.defineProperty,MG=Object.defineProperties,OG=Object.getOwnPropertyDescriptors,mh=Object.getOwnPropertySymbols,P6=Object.prototype.hasOwnProperty,I6=Object.prototype.propertyIsEnumerable,i4=(e,t,n)=>t in e?EG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DG=(e,t)=>{for(var n in t||(t={}))P6.call(t,n)&&i4(e,n,t[n]);if(mh)for(var n of mh(t))I6.call(t,n)&&i4(e,n,t[n]);return e},RG=(e,t)=>MG(e,OG(t)),AG=(e,t)=>{var n={};for(var r in e)P6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mh)for(var r of mh(e))t.indexOf(r)<0&&I6.call(e,r)&&(n[r]=e[r]);return n};function E6(e){const t=Sn("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,i=AG(t,["children","target","className","innerRef"]),l=ca(),[u,p]=d.useState(!1),h=d.useRef();return n6(()=>(p(!0),h.current=r?typeof r=="string"?document.querySelector(r):r:document.createElement("div"),r||document.body.appendChild(h.current),()=>{!r&&document.body.removeChild(h.current)}),[r]),u?Lr.createPortal(H.createElement("div",RG(DG({className:o,dir:l.dir},i),{ref:s}),n),h.current):null}E6.displayName="@mantine/core/Portal";var NG=Object.defineProperty,gh=Object.getOwnPropertySymbols,M6=Object.prototype.hasOwnProperty,O6=Object.prototype.propertyIsEnumerable,l4=(e,t,n)=>t in e?NG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,TG=(e,t)=>{for(var n in t||(t={}))M6.call(t,n)&&l4(e,n,t[n]);if(gh)for(var n of gh(t))O6.call(t,n)&&l4(e,n,t[n]);return e},$G=(e,t)=>{var n={};for(var r in e)M6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gh)for(var r of gh(e))t.indexOf(r)<0&&O6.call(e,r)&&(n[r]=e[r]);return n};function D6(e){var t=e,{withinPortal:n=!0,children:r}=t,o=$G(t,["withinPortal","children"]);return n?H.createElement(E6,TG({},o),r):H.createElement(H.Fragment,null,r)}D6.displayName="@mantine/core/OptionalPortal";var LG=Object.defineProperty,vh=Object.getOwnPropertySymbols,R6=Object.prototype.hasOwnProperty,A6=Object.prototype.propertyIsEnumerable,c4=(e,t,n)=>t in e?LG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u4=(e,t)=>{for(var n in t||(t={}))R6.call(t,n)&&c4(e,n,t[n]);if(vh)for(var n of vh(t))A6.call(t,n)&&c4(e,n,t[n]);return e},zG=(e,t)=>{var n={};for(var r in e)R6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vh)for(var r of vh(e))t.indexOf(r)<0&&A6.call(e,r)&&(n[r]=e[r]);return n};function N6(e){const t=e,{width:n,height:r,style:o}=t,s=zG(t,["width","height","style"]);return H.createElement("svg",u4({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:u4({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"}))}N6.displayName="@mantine/core/CloseIcon";var FG=Object.defineProperty,xh=Object.getOwnPropertySymbols,T6=Object.prototype.hasOwnProperty,$6=Object.prototype.propertyIsEnumerable,d4=(e,t,n)=>t in e?FG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BG=(e,t)=>{for(var n in t||(t={}))T6.call(t,n)&&d4(e,n,t[n]);if(xh)for(var n of xh(t))$6.call(t,n)&&d4(e,n,t[n]);return e},HG=(e,t)=>{var n={};for(var r in e)T6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xh)for(var r of xh(e))t.indexOf(r)<0&&$6.call(e,r)&&(n[r]=e[r]);return n};const VG={xs:Oe(12),sm:Oe(16),md:Oe(20),lg:Oe(28),xl:Oe(34)},WG={size:"sm"},L6=d.forwardRef((e,t)=>{const n=Sn("CloseButton",WG,e),{iconSize:r,size:o,children:s}=n,i=HG(n,["iconSize","size","children"]),l=Oe(r||VG[o]);return H.createElement(IG,BG({ref:t,__staticSelector:"CloseButton",size:o},i),s||H.createElement(N6,{width:l,height:l}))});L6.displayName="@mantine/core/CloseButton";const z6=L6;var UG=Object.defineProperty,GG=Object.defineProperties,KG=Object.getOwnPropertyDescriptors,f4=Object.getOwnPropertySymbols,qG=Object.prototype.hasOwnProperty,XG=Object.prototype.propertyIsEnumerable,p4=(e,t,n)=>t in e?UG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,np=(e,t)=>{for(var n in t||(t={}))qG.call(t,n)&&p4(e,n,t[n]);if(f4)for(var n of f4(t))XG.call(t,n)&&p4(e,n,t[n]);return e},YG=(e,t)=>GG(e,KG(t));function QG({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function ZG({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 JG(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function eK({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 tK=or((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:i,gradient:l,weight:u,transform:p,align:h,strikethrough:m,italic:v},{size:x})=>{const y=e.fn.variant({variant:"gradient",gradient:l});return{root:YG(np(np(np(np({},e.fn.fontStyles()),e.fn.focusStyles()),JG(n)),eK({theme:e,truncate:r})),{color:ZG({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||x===void 0?"inherit":ut({size:x,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:QG({underline:i,strikethrough:m}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":u,textTransform:p,textAlign:h,fontStyle:v?"italic":void 0}),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const nK=tK;var rK=Object.defineProperty,bh=Object.getOwnPropertySymbols,F6=Object.prototype.hasOwnProperty,B6=Object.prototype.propertyIsEnumerable,h4=(e,t,n)=>t in e?rK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oK=(e,t)=>{for(var n in t||(t={}))F6.call(t,n)&&h4(e,n,t[n]);if(bh)for(var n of bh(t))B6.call(t,n)&&h4(e,n,t[n]);return e},sK=(e,t)=>{var n={};for(var r in e)F6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bh)for(var r of bh(e))t.indexOf(r)<0&&B6.call(e,r)&&(n[r]=e[r]);return n};const aK={variant:"text"},H6=d.forwardRef((e,t)=>{const n=Sn("Text",aK,e),{className:r,size:o,weight:s,transform:i,color:l,align:u,variant:p,lineClamp:h,truncate:m,gradient:v,inline:x,inherit:y,underline:b,strikethrough:w,italic:k,classNames:_,styles:j,unstyled:I,span:M,__staticSelector:E}=n,O=sK(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}=nK({color:l,lineClamp:h,truncate:m,inline:x,inherit:y,underline:b,strikethrough:w,italic:k,weight:s,transform:i,align:u,gradient:v},{unstyled:I,name:E||"Text",variant:p,size:o});return H.createElement(Mr,oK({ref:t,className:A(D.root,{[D.gradient]:p==="gradient"},r),component:M?"span":"div"},O))});H6.displayName="@mantine/core/Text";const Sc=H6,rp={xs:Oe(1),sm:Oe(2),md:Oe(3),lg:Oe(4),xl:Oe(5)};function op(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 iK=or((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:Oe(1),borderTop:`${ut({size:n,sizes:rp})} ${r} ${op(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${ut({size:n,sizes:rp})} ${r} ${op(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:Oe(ut({size:n,sizes:rp})),borderTopColor:op(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:Oe(ut({size:n,sizes:rp})),borderLeftColor:op(e,t),borderLeftStyle:r}}));const lK=iK;var cK=Object.defineProperty,uK=Object.defineProperties,dK=Object.getOwnPropertyDescriptors,yh=Object.getOwnPropertySymbols,V6=Object.prototype.hasOwnProperty,W6=Object.prototype.propertyIsEnumerable,m4=(e,t,n)=>t in e?cK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g4=(e,t)=>{for(var n in t||(t={}))V6.call(t,n)&&m4(e,n,t[n]);if(yh)for(var n of yh(t))W6.call(t,n)&&m4(e,n,t[n]);return e},fK=(e,t)=>uK(e,dK(t)),pK=(e,t)=>{var n={};for(var r in e)V6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yh)for(var r of yh(e))t.indexOf(r)<0&&W6.call(e,r)&&(n[r]=e[r]);return n};const hK={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},K1=d.forwardRef((e,t)=>{const n=Sn("Divider",hK,e),{className:r,color:o,orientation:s,size:i,label:l,labelPosition:u,labelProps:p,variant:h,styles:m,classNames:v,unstyled:x}=n,y=pK(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:b,cx:w}=lK({color:o},{classNames:v,styles:m,unstyled:x,name:"Divider",variant:h,size:i}),k=s==="vertical",_=s==="horizontal",j=!!l&&_,I=!(p!=null&&p.color);return H.createElement(Mr,g4({ref:t,className:w(b.root,{[b.vertical]:k,[b.horizontal]:_,[b.withLabel]:j},r),role:"separator"},y),j&&H.createElement(Sc,fK(g4({},p),{size:(p==null?void 0:p.size)||"xs",mt:Oe(2),className:w(b.label,b[u],{[b.labelDefaultStyles]:I})}),l))});K1.displayName="@mantine/core/Divider";var mK=Object.defineProperty,gK=Object.defineProperties,vK=Object.getOwnPropertyDescriptors,v4=Object.getOwnPropertySymbols,xK=Object.prototype.hasOwnProperty,bK=Object.prototype.propertyIsEnumerable,x4=(e,t,n)=>t in e?mK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b4=(e,t)=>{for(var n in t||(t={}))xK.call(t,n)&&x4(e,n,t[n]);if(v4)for(var n of v4(t))bK.call(t,n)&&x4(e,n,t[n]);return e},yK=(e,t)=>gK(e,vK(t)),CK=or((e,t,{size:n})=>({item:yK(b4({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${ut({size:n,sizes:e.spacing})} / 1.5) ${ut({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:ut({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]":b4({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(${ut({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${ut({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${ut({size:n,sizes:e.spacing})} / 1.5) ${ut({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const wK=CK;var SK=Object.defineProperty,y4=Object.getOwnPropertySymbols,kK=Object.prototype.hasOwnProperty,_K=Object.prototype.propertyIsEnumerable,C4=(e,t,n)=>t in e?SK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jK=(e,t)=>{for(var n in t||(t={}))kK.call(t,n)&&C4(e,n,t[n]);if(y4)for(var n of y4(t))_K.call(t,n)&&C4(e,n,t[n]);return e};function Gb({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:i,onItemHover:l,onItemSelect:u,itemsRefs:p,itemComponent:h,size:m,nothingFound:v,creatable:x,createLabel:y,unstyled:b,variant:w}){const{classes:k}=wK(null,{classNames:n,styles:r,unstyled:b,name:i,variant:w,size:m}),_=[],j=[];let I=null;const M=(O,D)=>{const A=typeof o=="function"?o(O.value):!1;return H.createElement(h,jK({key:O.value,className:k.item,"data-disabled":O.disabled||void 0,"data-hovered":!O.disabled&&t===D||void 0,"data-selected":!O.disabled&&A||void 0,selected:A,onMouseEnter:()=>l(D),id:`${s}-${D}`,role:"option",tabIndex:-1,"aria-selected":t===D,ref:R=>{p&&p.current&&(p.current[O.value]=R)},onMouseDown:O.disabled?null:R=>{R.preventDefault(),u(O)},disabled:O.disabled,variant:w},O))};let E=null;if(e.forEach((O,D)=>{O.creatable?I=D:O.group?(E!==O.group&&(E=O.group,j.push(H.createElement("div",{className:k.separator,key:`__mantine-divider-${D}`},H.createElement(K1,{classNames:{label:k.separatorLabel},label:O.group})))),j.push(M(O,D))):_.push(M(O,D))}),x){const O=e[I];_.push(H.createElement("div",{key:Wb(),className:k.item,"data-hovered":t===I||void 0,onMouseEnter:()=>l(I),onMouseDown:D=>{D.preventDefault(),u(O)},tabIndex:-1,ref:D=>{p&&p.current&&(p.current[O.value]=D)}},y))}return j.length>0&&_.length>0&&_.unshift(H.createElement("div",{className:k.separator,key:"empty-group-separator"},H.createElement(K1,null))),j.length>0||_.length>0?H.createElement(H.Fragment,null,j,_):H.createElement(Sc,{size:m,unstyled:b,className:k.nothingFound},v)}Gb.displayName="@mantine/core/SelectItems";var PK=Object.defineProperty,Ch=Object.getOwnPropertySymbols,U6=Object.prototype.hasOwnProperty,G6=Object.prototype.propertyIsEnumerable,w4=(e,t,n)=>t in e?PK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IK=(e,t)=>{for(var n in t||(t={}))U6.call(t,n)&&w4(e,n,t[n]);if(Ch)for(var n of Ch(t))G6.call(t,n)&&w4(e,n,t[n]);return e},EK=(e,t)=>{var n={};for(var r in e)U6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ch)for(var r of Ch(e))t.indexOf(r)<0&&G6.call(e,r)&&(n[r]=e[r]);return n};const Kb=d.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=EK(n,["label","value"]);return H.createElement("div",IK({ref:t},s),r||o)});Kb.displayName="@mantine/core/DefaultItem";function MK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function K6(...e){return t=>e.forEach(n=>MK(n,t))}function el(...e){return d.useCallback(K6(...e),e)}const q6=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(DK);if(s){const i=s.props.children,l=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return d.createElement(q1,rn({},r,{ref:t}),d.isValidElement(i)?d.cloneElement(i,void 0,l):null)}return d.createElement(q1,rn({},r,{ref:t}),n)});q6.displayName="Slot";const q1=d.forwardRef((e,t)=>{const{children:n,...r}=e;return d.isValidElement(n)?d.cloneElement(n,{...RK(r,n.props),ref:K6(t,n.ref)}):d.Children.count(n)>1?d.Children.only(null):null});q1.displayName="SlotClone";const OK=({children:e})=>d.createElement(d.Fragment,null,e);function DK(e){return d.isValidElement(e)&&e.type===OK}function RK(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]=(...l)=>{s(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}const AK=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],zd=AK.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,l=s?q6:t;return d.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),d.createElement(l,rn({},i,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),X1=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function NK(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Fd=e=>{const{present:t,children:n}=e,r=TK(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=el(r.ref,o.ref);return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Fd.displayName="Presence";function TK(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[l,u]=NK(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const p=sp(r.current);s.current=l==="mounted"?p:"none"},[l]),X1(()=>{const p=r.current,h=o.current;if(h!==e){const v=s.current,x=sp(p);e?u("MOUNT"):x==="none"||(p==null?void 0:p.display)==="none"?u("UNMOUNT"):u(h&&v!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),X1(()=>{if(t){const p=m=>{const x=sp(r.current).includes(m.animationName);m.target===t&&x&&Lr.flushSync(()=>u("ANIMATION_END"))},h=m=>{m.target===t&&(s.current=sp(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:d.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function sp(e){return(e==null?void 0:e.animationName)||"none"}function $K(e,t=[]){let n=[];function r(s,i){const l=d.createContext(i),u=n.length;n=[...n,i];function p(m){const{scope:v,children:x,...y}=m,b=(v==null?void 0:v[e][u])||l,w=d.useMemo(()=>y,Object.values(y));return d.createElement(b.Provider,{value:w},x)}function h(m,v){const x=(v==null?void 0:v[e][u])||l,y=d.useContext(x);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${s}\``)}return p.displayName=s+"Provider",[p,h]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(l){const u=(l==null?void 0:l[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return o.scopeName=e,[r,LK(o,...t)]}function LK(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((l,{useScope:u,scopeName:p})=>{const m=u(s)[`__scope${p}`];return{...l,...m}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function yi(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 zK=d.createContext(void 0);function FK(e){const t=d.useContext(zK);return e||t||"ltr"}function BK(e,[t,n]){return Math.min(n,Math.max(t,e))}function Pi(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 HK(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const X6="ScrollArea",[Y6,s0e]=$K(X6),[VK,xo]=Y6(X6),WK=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[l,u]=d.useState(null),[p,h]=d.useState(null),[m,v]=d.useState(null),[x,y]=d.useState(null),[b,w]=d.useState(null),[k,_]=d.useState(0),[j,I]=d.useState(0),[M,E]=d.useState(!1),[O,D]=d.useState(!1),A=el(t,T=>u(T)),R=FK(o);return d.createElement(VK,{scope:n,type:r,dir:R,scrollHideDelay:s,scrollArea:l,viewport:p,onViewportChange:h,content:m,onContentChange:v,scrollbarX:x,onScrollbarXChange:y,scrollbarXEnabled:M,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:O,onScrollbarYEnabledChange:D,onCornerWidthChange:_,onCornerHeightChange:I},d.createElement(zd.div,rn({dir:R},i,{ref:A,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})))}),UK="ScrollAreaViewport",GK=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=xo(UK,n),i=d.useRef(null),l=el(t,i,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(zd.div,rn({"data-radix-scroll-area-viewport":""},o,{ref:l,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)))}),da="ScrollAreaScrollbar",KK=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=xo(da,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,l=e.orientation==="horizontal";return d.useEffect(()=>(l?s(!0):i(!0),()=>{l?s(!1):i(!1)}),[l,s,i]),o.type==="hover"?d.createElement(qK,rn({},r,{ref:t,forceMount:n})):o.type==="scroll"?d.createElement(XK,rn({},r,{ref:t,forceMount:n})):o.type==="auto"?d.createElement(Q6,rn({},r,{ref:t,forceMount:n})):o.type==="always"?d.createElement(qb,rn({},r,{ref:t})):null}),qK=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=xo(da,e.__scopeScrollArea),[s,i]=d.useState(!1);return d.useEffect(()=>{const l=o.scrollArea;let u=0;if(l){const p=()=>{window.clearTimeout(u),i(!0)},h=()=>{u=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",p),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",p),l.removeEventListener("pointerleave",h)}}},[o.scrollArea,o.scrollHideDelay]),d.createElement(Fd,{present:n||s},d.createElement(Q6,rn({"data-state":s?"visible":"hidden"},r,{ref:t})))}),XK=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=xo(da,e.__scopeScrollArea),s=e.orientation==="horizontal",i=qm(()=>u("SCROLL_END"),100),[l,u]=HK("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(l==="idle"){const p=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[l,o.scrollHideDelay,u]),d.useEffect(()=>{const p=o.viewport,h=s?"scrollLeft":"scrollTop";if(p){let m=p[h];const v=()=>{const x=p[h];m!==x&&(u("SCROLL"),i()),m=x};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[o.viewport,s,u,i]),d.createElement(Fd,{present:n||l!=="hidden"},d.createElement(qb,rn({"data-state":l==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Pi(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Pi(e.onPointerLeave,()=>u("POINTER_LEAVE"))})))}),Q6=d.forwardRef((e,t)=>{const n=xo(da,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=d.useState(!1),l=e.orientation==="horizontal",u=qm(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;i(l?p:h)}},10);return kc(n.viewport,u),kc(n.content,u),d.createElement(Fd,{present:r||s},d.createElement(qb,rn({"data-state":s?"visible":"hidden"},o,{ref:t})))}),qb=d.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=xo(da,e.__scopeScrollArea),s=d.useRef(null),i=d.useRef(0),[l,u]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=tI(l.viewport,l.content),h={...r,sizes:l,onSizesChange:u,hasThumb:p>0&&p<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:v=>i.current=v};function m(v,x){return rq(v,i.current,l,x)}return n==="horizontal"?d.createElement(YK,rn({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollLeft,x=S4(v,l,o.dir);s.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollLeft=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollLeft=m(v,o.dir))}})):n==="vertical"?d.createElement(QK,rn({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollTop,x=S4(v,l);s.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollTop=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollTop=m(v))}})):null}),YK=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=xo(da,e.__scopeScrollArea),[i,l]=d.useState(),u=d.useRef(null),p=el(t,u,s.onScrollbarXChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(J6,rn({"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":Km(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,m)=>{if(s.viewport){const v=s.viewport.scrollLeft+h.deltaX;e.onWheelScroll(v),rI(v,m)&&h.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:wh(i.paddingLeft),paddingEnd:wh(i.paddingRight)}})}}))}),QK=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=xo(da,e.__scopeScrollArea),[i,l]=d.useState(),u=d.useRef(null),p=el(t,u,s.onScrollbarYChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(J6,rn({"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":Km(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,m)=>{if(s.viewport){const v=s.viewport.scrollTop+h.deltaY;e.onWheelScroll(v),rI(v,m)&&h.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:wh(i.paddingTop),paddingEnd:wh(i.paddingBottom)}})}}))}),[ZK,Z6]=Y6(da),J6=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:p,onWheelScroll:h,onResize:m,...v}=e,x=xo(da,n),[y,b]=d.useState(null),w=el(t,A=>b(A)),k=d.useRef(null),_=d.useRef(""),j=x.viewport,I=r.content-r.viewport,M=yi(h),E=yi(u),O=qm(m,10);function D(A){if(k.current){const R=A.clientX-k.current.left,T=A.clientY-k.current.top;p({x:R,y:T})}}return d.useEffect(()=>{const A=R=>{const T=R.target;(y==null?void 0:y.contains(T))&&M(R,I)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[j,y,I,M]),d.useEffect(E,[r,E]),kc(y,O),kc(x.content,O),d.createElement(ZK,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:yi(s),onThumbPointerUp:yi(i),onThumbPositionChange:E,onThumbPointerDown:yi(l)},d.createElement(zd.div,rn({},v,{ref:w,style:{position:"absolute",...v.style},onPointerDown:Pi(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),k.current=y.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",D(A))}),onPointerMove:Pi(e.onPointerMove,D),onPointerUp:Pi(e.onPointerUp,A=>{const R=A.target;R.hasPointerCapture(A.pointerId)&&R.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=_.current,k.current=null})})))}),Y1="ScrollAreaThumb",JK=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Z6(Y1,e.__scopeScrollArea);return d.createElement(Fd,{present:n||o.hasThumb},d.createElement(eq,rn({ref:t},r)))}),eq=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=xo(Y1,n),i=Z6(Y1,n),{onThumbPositionChange:l}=i,u=el(t,m=>i.onThumbChange(m)),p=d.useRef(),h=qm(()=>{p.current&&(p.current(),p.current=void 0)},100);return d.useEffect(()=>{const m=s.viewport;if(m){const v=()=>{if(h(),!p.current){const x=oq(m,l);p.current=x,l()}};return l(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[s.viewport,h,l]),d.createElement(zd.div,rn({"data-state":i.hasThumb?"visible":"hidden"},o,{ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Pi(e.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),y=m.clientX-x.left,b=m.clientY-x.top;i.onThumbPointerDown({x:y,y:b})}),onPointerUp:Pi(e.onPointerUp,i.onThumbPointerUp)}))}),eI="ScrollAreaCorner",tq=d.forwardRef((e,t)=>{const n=xo(eI,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.createElement(nq,rn({},e,{ref:t})):null}),nq=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=xo(eI,n),[s,i]=d.useState(0),[l,u]=d.useState(0),p=!!(s&&l);return kc(o.scrollbarX,()=>{var h;const m=((h=o.scrollbarX)===null||h===void 0?void 0:h.offsetHeight)||0;o.onCornerHeightChange(m),u(m)}),kc(o.scrollbarY,()=>{var h;const m=((h=o.scrollbarY)===null||h===void 0?void 0:h.offsetWidth)||0;o.onCornerWidthChange(m),i(m)}),p?d.createElement(zd.div,rn({},r,{ref:t,style:{width:s,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function wh(e){return e?parseInt(e,10):0}function tI(e,t){const n=e/t;return isNaN(n)?0:n}function Km(e){const t=tI(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function rq(e,t,n,r="ltr"){const o=Km(n),s=o/2,i=t||s,l=o-i,u=n.scrollbar.paddingStart+i,p=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return nI([u,p],m)(e)}function S4(e,t,n="ltr"){const r=Km(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,l=s-r,u=n==="ltr"?[0,i]:[i*-1,0],p=BK(e,u);return nI([0,i],[0,l])(p)}function nI(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 rI(e,t){return e>0&&e<t}const oq=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,l=n.top!==s.top;(i||l)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function qm(e,t){const n=yi(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 kc(e,t){const n=yi(t);X1(()=>{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 sq=WK,aq=GK,k4=KK,_4=JK,iq=tq;var lq=or((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?Oe(t):void 0,paddingBottom:n?Oe(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${Oe(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${MS("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:Oe(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:Oe(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:MS("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:Oe(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:Oe(44),minHeight:Oe(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 cq=lq;var uq=Object.defineProperty,dq=Object.defineProperties,fq=Object.getOwnPropertyDescriptors,Sh=Object.getOwnPropertySymbols,oI=Object.prototype.hasOwnProperty,sI=Object.prototype.propertyIsEnumerable,j4=(e,t,n)=>t in e?uq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q1=(e,t)=>{for(var n in t||(t={}))oI.call(t,n)&&j4(e,n,t[n]);if(Sh)for(var n of Sh(t))sI.call(t,n)&&j4(e,n,t[n]);return e},aI=(e,t)=>dq(e,fq(t)),iI=(e,t)=>{var n={};for(var r in e)oI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sh)for(var r of Sh(e))t.indexOf(r)<0&&sI.call(e,r)&&(n[r]=e[r]);return n};const lI={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},Xm=d.forwardRef((e,t)=>{const n=Sn("ScrollArea",lI,e),{children:r,className:o,classNames:s,styles:i,scrollbarSize:l,scrollHideDelay:u,type:p,dir:h,offsetScrollbars:m,viewportRef:v,onScrollPositionChange:x,unstyled:y,variant:b,viewportProps:w}=n,k=iI(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[_,j]=d.useState(!1),I=ca(),{classes:M,cx:E}=cq({scrollbarSize:l,offsetScrollbars:m,scrollbarHovered:_,hidden:p==="never"},{name:"ScrollArea",classNames:s,styles:i,unstyled:y,variant:b});return H.createElement(sq,{type:p==="never"?"always":p,scrollHideDelay:u,dir:h||I.dir,ref:t,asChild:!0},H.createElement(Mr,Q1({className:E(M.root,o)},k),H.createElement(aq,aI(Q1({},w),{className:M.viewport,ref:v,onScroll:typeof x=="function"?({currentTarget:O})=>x({x:O.scrollLeft,y:O.scrollTop}):void 0}),r),H.createElement(k4,{orientation:"horizontal",className:M.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(_4,{className:M.thumb})),H.createElement(k4,{orientation:"vertical",className:M.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(_4,{className:M.thumb})),H.createElement(iq,{className:M.corner})))}),cI=d.forwardRef((e,t)=>{const n=Sn("ScrollAreaAutosize",lI,e),{children:r,classNames:o,styles:s,scrollbarSize:i,scrollHideDelay:l,type:u,dir:p,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:x,sx:y,variant:b,viewportProps:w}=n,k=iI(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return H.createElement(Mr,aI(Q1({},k),{ref:t,sx:[{display:"flex"},...YP(y)]}),H.createElement(Mr,{sx:{display:"flex",flexDirection:"column",flex:1}},H.createElement(Xm,{classNames:o,styles:s,scrollHideDelay:l,scrollbarSize:i,type:u,dir:p,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:x,variant:b,viewportProps:w},r)))});cI.displayName="@mantine/core/ScrollAreaAutosize";Xm.displayName="@mantine/core/ScrollArea";Xm.Autosize=cI;const uI=Xm;var pq=Object.defineProperty,hq=Object.defineProperties,mq=Object.getOwnPropertyDescriptors,kh=Object.getOwnPropertySymbols,dI=Object.prototype.hasOwnProperty,fI=Object.prototype.propertyIsEnumerable,P4=(e,t,n)=>t in e?pq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I4=(e,t)=>{for(var n in t||(t={}))dI.call(t,n)&&P4(e,n,t[n]);if(kh)for(var n of kh(t))fI.call(t,n)&&P4(e,n,t[n]);return e},gq=(e,t)=>hq(e,mq(t)),vq=(e,t)=>{var n={};for(var r in e)dI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kh)for(var r of kh(e))t.indexOf(r)<0&&fI.call(e,r)&&(n[r]=e[r]);return n};const Ym=d.forwardRef((e,t)=>{var n=e,{style:r}=n,o=vq(n,["style"]);return H.createElement(uI,gq(I4({},o),{style:I4({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});Ym.displayName="@mantine/core/SelectScrollArea";var xq=or(()=>({dropdown:{},itemsWrapper:{padding:Oe(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const bq=xq;function Fc(e){return e.split("-")[1]}function Xb(e){return e==="y"?"height":"width"}function Lo(e){return e.split("-")[0]}function ti(e){return["top","bottom"].includes(Lo(e))?"x":"y"}function E4(e,t,n){let{reference:r,floating:o}=e;const s=r.x+r.width/2-o.width/2,i=r.y+r.height/2-o.height/2,l=ti(t),u=Xb(l),p=r[u]/2-o[u]/2,h=l==="x";let m;switch(Lo(t)){case"top":m={x:s,y:r.y-o.height};break;case"bottom":m={x:s,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:i};break;case"left":m={x:r.x-o.width,y:i};break;default:m={x:r.x,y:r.y}}switch(Fc(t)){case"start":m[l]-=p*(n&&h?-1:1);break;case"end":m[l]+=p*(n&&h?-1:1)}return m}const yq=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let p=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:m}=E4(p,r,u),v=r,x={},y=0;for(let b=0;b<l.length;b++){const{name:w,fn:k}=l[b],{x:_,y:j,data:I,reset:M}=await k({x:h,y:m,initialPlacement:r,placement:v,strategy:o,middlewareData:x,rects:p,platform:i,elements:{reference:e,floating:t}});h=_??h,m=j??m,x={...x,[w]:{...x[w],...I}},M&&y<=50&&(y++,typeof M=="object"&&(M.placement&&(v=M.placement),M.rects&&(p=M.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):M.rects),{x:h,y:m}=E4(p,v,u)),b=-1)}return{x:h,y:m,placement:v,strategy:o,middlewareData:x}};function na(e,t){return typeof e=="function"?e(t):e}function Yb(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 _c(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Qb(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:u}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:v=!1,padding:x=0}=na(t,e),y=Yb(x),b=l[v?m==="floating"?"reference":"floating":m],w=_c(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(l.floating)),boundary:p,rootBoundary:h,strategy:u})),k=m==="floating"?{...i.floating,x:r,y:o}:i.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),j=await(s.isElement==null?void 0:s.isElement(_))&&await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1},I=_c(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:k,offsetParent:_,strategy:u}):k);return{top:(w.top-I.top+y.top)/j.y,bottom:(I.bottom-w.bottom+y.bottom)/j.y,left:(w.left-I.left+y.left)/j.x,right:(I.right-w.right+y.right)/j.x}}const Ka=Math.min,ls=Math.max;function Z1(e,t,n){return ls(e,Ka(t,n))}const M4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l}=t,{element:u,padding:p=0}=na(e,t)||{};if(u==null)return{};const h=Yb(p),m={x:n,y:r},v=ti(o),x=Xb(v),y=await i.getDimensions(u),b=v==="y",w=b?"top":"left",k=b?"bottom":"right",_=b?"clientHeight":"clientWidth",j=s.reference[x]+s.reference[v]-m[v]-s.floating[x],I=m[v]-s.reference[v],M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let E=M?M[_]:0;E&&await(i.isElement==null?void 0:i.isElement(M))||(E=l.floating[_]||s.floating[x]);const O=j/2-I/2,D=E/2-y[x]/2-1,A=Ka(h[w],D),R=Ka(h[k],D),T=A,X=E-y[x]-R,B=E/2-y[x]/2+O,U=Z1(T,B,X),Y=Fc(o)!=null&&B!=U&&s.reference[x]/2-(B<T?A:R)-y[x]/2<0?B<T?T-B:X-B:0;return{[v]:m[v]-Y,data:{[v]:U,centerOffset:B-U+Y}}}}),Cq=["top","right","bottom","left"];Cq.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const wq={left:"right",right:"left",bottom:"top",top:"bottom"};function _h(e){return e.replace(/left|right|bottom|top/g,t=>wq[t])}function Sq(e,t,n){n===void 0&&(n=!1);const r=Fc(e),o=ti(e),s=Xb(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=_h(i)),{main:i,cross:_h(i)}}const kq={start:"end",end:"start"};function Cv(e){return e.replace(/start|end/g,t=>kq[t])}const _q=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:s,initialPlacement:i,platform:l,elements:u}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...b}=na(e,t),w=Lo(r),k=Lo(i)===i,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),j=m||(k||!y?[_h(i)]:function(T){const X=_h(T);return[Cv(T),X,Cv(X)]}(i));m||x==="none"||j.push(...function(T,X,B,U){const Y=Fc(T);let V=function(L,q,z){const K=["left","right"],re=["right","left"],Q=["top","bottom"],le=["bottom","top"];switch(L){case"top":case"bottom":return z?q?re:K:q?K:re;case"left":case"right":return q?Q:le;default:return[]}}(Lo(T),B==="start",U);return Y&&(V=V.map(L=>L+"-"+Y),X&&(V=V.concat(V.map(Cv)))),V}(i,y,x,_));const I=[i,...j],M=await Qb(t,b),E=[];let O=((n=o.flip)==null?void 0:n.overflows)||[];if(p&&E.push(M[w]),h){const{main:T,cross:X}=Sq(r,s,_);E.push(M[T],M[X])}if(O=[...O,{placement:r,overflows:E}],!E.every(T=>T<=0)){var D,A;const T=(((D=o.flip)==null?void 0:D.index)||0)+1,X=I[T];if(X)return{data:{index:T,overflows:O},reset:{placement:X}};let B=(A=O.filter(U=>U.overflows[0]<=0).sort((U,Y)=>U.overflows[1]-Y.overflows[1])[0])==null?void 0:A.placement;if(!B)switch(v){case"bestFit":{var R;const U=(R=O.map(Y=>[Y.placement,Y.overflows.filter(V=>V>0).reduce((V,L)=>V+L,0)]).sort((Y,V)=>Y[1]-V[1])[0])==null?void 0:R[0];U&&(B=U);break}case"initialPlacement":B=i}if(r!==B)return{reset:{placement:B}}}return{}}}};function O4(e){const t=Ka(...e.map(r=>r.left)),n=Ka(...e.map(r=>r.top));return{x:t,y:n,width:ls(...e.map(r=>r.right))-t,height:ls(...e.map(r=>r.bottom))-n}}const jq=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:i}=t,{padding:l=2,x:u,y:p}=na(e,t),h=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),m=function(b){const w=b.slice().sort((j,I)=>j.y-I.y),k=[];let _=null;for(let j=0;j<w.length;j++){const I=w[j];!_||I.y-_.y>_.height/2?k.push([I]):k[k.length-1].push(I),_=I}return k.map(j=>_c(O4(j)))}(h),v=_c(O4(h)),x=Yb(l),y=await s.getElementRects({reference:{getBoundingClientRect:function(){if(m.length===2&&m[0].left>m[1].right&&u!=null&&p!=null)return m.find(b=>u>b.left-x.left&&u<b.right+x.right&&p>b.top-x.top&&p<b.bottom+x.bottom)||v;if(m.length>=2){if(ti(n)==="x"){const M=m[0],E=m[m.length-1],O=Lo(n)==="top",D=M.top,A=E.bottom,R=O?M.left:E.left,T=O?M.right:E.right;return{top:D,bottom:A,left:R,right:T,width:T-R,height:A-D,x:R,y:D}}const b=Lo(n)==="left",w=ls(...m.map(M=>M.right)),k=Ka(...m.map(M=>M.left)),_=m.filter(M=>b?M.left===k:M.right===w),j=_[0].top,I=_[_.length-1].bottom;return{top:j,bottom:I,left:k,right:w,width:w-k,height:I-j,x:k,y:j}}return v}},floating:r.floating,strategy:i});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}}:{}}}},Pq=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(s,i){const{placement:l,platform:u,elements:p}=s,h=await(u.isRTL==null?void 0:u.isRTL(p.floating)),m=Lo(l),v=Fc(l),x=ti(l)==="x",y=["left","top"].includes(m)?-1:1,b=h&&x?-1:1,w=na(i,s);let{mainAxis:k,crossAxis:_,alignmentAxis:j}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...w};return v&&typeof j=="number"&&(_=v==="end"?-1*j:j),x?{x:_*b,y:k*y}:{x:k*y,y:_*b}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function pI(e){return e==="x"?"y":"x"}const Iq=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:w=>{let{x:k,y:_}=w;return{x:k,y:_}}},...u}=na(e,t),p={x:n,y:r},h=await Qb(t,u),m=ti(Lo(o)),v=pI(m);let x=p[m],y=p[v];if(s){const w=m==="y"?"bottom":"right";x=Z1(x+h[m==="y"?"top":"left"],x,x-h[w])}if(i){const w=v==="y"?"bottom":"right";y=Z1(y+h[v==="y"?"top":"left"],y,y-h[w])}const b=l.fn({...t,[m]:x,[v]:y});return{...b,data:{x:b.x-n,y:b.y-r}}}}},Eq=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:u=!0,crossAxis:p=!0}=na(e,t),h={x:n,y:r},m=ti(o),v=pI(m);let x=h[m],y=h[v];const b=na(l,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(u){const j=m==="y"?"height":"width",I=s.reference[m]-s.floating[j]+w.mainAxis,M=s.reference[m]+s.reference[j]-w.mainAxis;x<I?x=I:x>M&&(x=M)}if(p){var k,_;const j=m==="y"?"width":"height",I=["top","left"].includes(Lo(o)),M=s.reference[v]-s.floating[j]+(I&&((k=i.offset)==null?void 0:k[v])||0)+(I?0:w.crossAxis),E=s.reference[v]+s.reference[j]+(I?0:((_=i.offset)==null?void 0:_[v])||0)-(I?w.crossAxis:0);y<M?y=M:y>E&&(y=E)}return{[m]:x,[v]:y}}}},Mq=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...l}=na(e,t),u=await Qb(t,l),p=Lo(n),h=Fc(n),m=ti(n)==="x",{width:v,height:x}=r.floating;let y,b;p==="top"||p==="bottom"?(y=p,b=h===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=p,y=h==="end"?"top":"bottom");const w=x-u[y],k=v-u[b],_=!t.middlewareData.shift;let j=w,I=k;if(m){const E=v-u.left-u.right;I=h||_?Ka(k,E):E}else{const E=x-u.top-u.bottom;j=h||_?Ka(w,E):E}if(_&&!h){const E=ls(u.left,0),O=ls(u.right,0),D=ls(u.top,0),A=ls(u.bottom,0);m?I=v-2*(E!==0||O!==0?E+O:ls(u.left,u.right)):j=x-2*(D!==0||A!==0?D+A:ls(u.top,u.bottom))}await i({...t,availableWidth:I,availableHeight:j});const M=await o.getDimensions(s.floating);return v!==M.width||x!==M.height?{reset:{rects:!0}}:{}}}};function zr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vs(e){return zr(e).getComputedStyle(e)}function hI(e){return e instanceof zr(e).Node}function qa(e){return hI(e)?(e.nodeName||"").toLowerCase():"#document"}function Uo(e){return e instanceof HTMLElement||e instanceof zr(e).HTMLElement}function D4(e){return typeof ShadowRoot<"u"&&(e instanceof zr(e).ShadowRoot||e instanceof ShadowRoot)}function sd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=vs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Oq(e){return["table","td","th"].includes(qa(e))}function J1(e){const t=Zb(),n=vs(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 Zb(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Qm(e){return["html","body","#document"].includes(qa(e))}const ex=Math.min,sc=Math.max,jh=Math.round,ap=Math.floor,Xa=e=>({x:e,y:e});function mI(e){const t=vs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Uo(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=jh(n)!==s||jh(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function Ys(e){return e instanceof Element||e instanceof zr(e).Element}function Jb(e){return Ys(e)?e:e.contextElement}function ac(e){const t=Jb(e);if(!Uo(t))return Xa(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=mI(t);let i=(s?jh(n.width):n.width)/r,l=(s?jh(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}const Dq=Xa(0);function gI(e){const t=zr(e);return Zb()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Dq}function Hi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Jb(e);let i=Xa(1);t&&(r?Ys(r)&&(i=ac(r)):i=ac(e));const l=function(v,x,y){return x===void 0&&(x=!1),!(!y||x&&y!==zr(v))&&x}(s,n,r)?gI(s):Xa(0);let u=(o.left+l.x)/i.x,p=(o.top+l.y)/i.y,h=o.width/i.x,m=o.height/i.y;if(s){const v=zr(s),x=r&&Ys(r)?zr(r):r;let y=v.frameElement;for(;y&&r&&x!==v;){const b=ac(y),w=y.getBoundingClientRect(),k=getComputedStyle(y),_=w.left+(y.clientLeft+parseFloat(k.paddingLeft))*b.x,j=w.top+(y.clientTop+parseFloat(k.paddingTop))*b.y;u*=b.x,p*=b.y,h*=b.x,m*=b.y,u+=_,p+=j,y=zr(y).frameElement}}return _c({width:h,height:m,x:u,y:p})}function Zm(e){return Ys(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Qs(e){var t;return(t=(hI(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vI(e){return Hi(Qs(e)).left+Zm(e).scrollLeft}function jc(e){if(qa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||D4(e)&&e.host||Qs(e);return D4(t)?t.host:t}function xI(e){const t=jc(e);return Qm(t)?e.ownerDocument?e.ownerDocument.body:e.body:Uo(t)&&sd(t)?t:xI(t)}function Ph(e,t){var n;t===void 0&&(t=[]);const r=xI(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=zr(r);return o?t.concat(s,s.visualViewport||[],sd(r)?r:[]):t.concat(r,Ph(r))}function R4(e,t,n){let r;if(t==="viewport")r=function(o,s){const i=zr(o),l=Qs(o),u=i.visualViewport;let p=l.clientWidth,h=l.clientHeight,m=0,v=0;if(u){p=u.width,h=u.height;const x=Zb();(!x||x&&s==="fixed")&&(m=u.offsetLeft,v=u.offsetTop)}return{width:p,height:h,x:m,y:v}}(e,n);else if(t==="document")r=function(o){const s=Qs(o),i=Zm(o),l=o.ownerDocument.body,u=sc(s.scrollWidth,s.clientWidth,l.scrollWidth,l.clientWidth),p=sc(s.scrollHeight,s.clientHeight,l.scrollHeight,l.clientHeight);let h=-i.scrollLeft+vI(o);const m=-i.scrollTop;return vs(l).direction==="rtl"&&(h+=sc(s.clientWidth,l.clientWidth)-u),{width:u,height:p,x:h,y:m}}(Qs(e));else if(Ys(t))r=function(o,s){const i=Hi(o,!0,s==="fixed"),l=i.top+o.clientTop,u=i.left+o.clientLeft,p=Uo(o)?ac(o):Xa(1);return{width:o.clientWidth*p.x,height:o.clientHeight*p.y,x:u*p.x,y:l*p.y}}(t,n);else{const o=gI(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return _c(r)}function bI(e,t){const n=jc(e);return!(n===t||!Ys(n)||Qm(n))&&(vs(n).position==="fixed"||bI(n,t))}function Rq(e,t,n){const r=Uo(t),o=Qs(t),s=n==="fixed",i=Hi(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=Xa(0);if(r||!r&&!s)if((qa(t)!=="body"||sd(o))&&(l=Zm(t)),Uo(t)){const p=Hi(t,!0,s,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else o&&(u.x=vI(o));return{x:i.left+l.scrollLeft-u.x,y:i.top+l.scrollTop-u.y,width:i.width,height:i.height}}function A4(e,t){return Uo(e)&&vs(e).position!=="fixed"?t?t(e):e.offsetParent:null}function N4(e,t){const n=zr(e);if(!Uo(e))return n;let r=A4(e,t);for(;r&&Oq(r)&&vs(r).position==="static";)r=A4(r,t);return r&&(qa(r)==="html"||qa(r)==="body"&&vs(r).position==="static"&&!J1(r))?n:r||function(o){let s=jc(o);for(;Uo(s)&&!Qm(s);){if(J1(s))return s;s=jc(s)}return null}(e)||n}const Aq={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Uo(n),s=Qs(n);if(n===s)return t;let i={scrollLeft:0,scrollTop:0},l=Xa(1);const u=Xa(0);if((o||!o&&r!=="fixed")&&((qa(n)!=="body"||sd(s))&&(i=Zm(n)),Uo(n))){const p=Hi(n);l=ac(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-i.scrollLeft*l.x+u.x,y:t.y*l.y-i.scrollTop*l.y+u.y}},getDocumentElement:Qs,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?function(u,p){const h=p.get(u);if(h)return h;let m=Ph(u).filter(b=>Ys(b)&&qa(b)!=="body"),v=null;const x=vs(u).position==="fixed";let y=x?jc(u):u;for(;Ys(y)&&!Qm(y);){const b=vs(y),w=J1(y);w||b.position!=="fixed"||(v=null),(x?!w&&!v:!w&&b.position==="static"&&v&&["absolute","fixed"].includes(v.position)||sd(y)&&!w&&bI(u,y))?m=m.filter(k=>k!==y):v=b,y=jc(y)}return p.set(u,m),m}(t,this._c):[].concat(n),r],i=s[0],l=s.reduce((u,p)=>{const h=R4(t,p,o);return u.top=sc(h.top,u.top),u.right=ex(h.right,u.right),u.bottom=ex(h.bottom,u.bottom),u.left=sc(h.left,u.left),u},R4(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:N4,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||N4,s=this.getDimensions;return{reference:Rq(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 mI(e)},getScale:ac,isElement:Ys,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function Nq(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,p=Jb(e),h=o||s?[...p?Ph(p):[],...Ph(t)]:[];h.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const m=p&&l?function(w,k){let _,j=null;const I=Qs(w);function M(){clearTimeout(_),j&&j.disconnect(),j=null}return function E(O,D){O===void 0&&(O=!1),D===void 0&&(D=1),M();const{left:A,top:R,width:T,height:X}=w.getBoundingClientRect();if(O||k(),!T||!X)return;const B={rootMargin:-ap(R)+"px "+-ap(I.clientWidth-(A+T))+"px "+-ap(I.clientHeight-(R+X))+"px "+-ap(A)+"px",threshold:sc(0,ex(1,D))||1};let U=!0;function Y(V){const L=V[0].intersectionRatio;if(L!==D){if(!U)return E();L?E(!1,L):_=setTimeout(()=>{E(!1,1e-7)},100)}U=!1}try{j=new IntersectionObserver(Y,{...B,root:I.ownerDocument})}catch{j=new IntersectionObserver(Y,B)}j.observe(w)}(!0),M}(p,n):null;let v,x=-1,y=null;i&&(y=new ResizeObserver(w=>{let[k]=w;k&&k.target===p&&y&&(y.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),p&&!u&&y.observe(p),y.observe(t));let b=u?Hi(e):null;return u&&function w(){const k=Hi(e);!b||k.x===b.x&&k.y===b.y&&k.width===b.width&&k.height===b.height||n(),b=k,v=requestAnimationFrame(w)}(),n(),()=>{h.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),m&&m(),y&&y.disconnect(),y=null,u&&cancelAnimationFrame(v)}}const Tq=(e,t,n)=>{const r=new Map,o={platform:Aq,...n},s={...o.platform,_c:r};return yq(e,t,{...o,platform:s})},$q=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?M4({element:t.current,padding:n}).fn(o):{}:t?M4({element:t,padding:n}).fn(o):{}}}};var $p=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Ih(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(!Ih(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)&&!Ih(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function T4(e){const t=d.useRef(e);return $p(()=>{t.current=e}),t}function Lq(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:i}=e,[l,u]=d.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=d.useState(r);Ih(p,r)||h(r);const m=d.useRef(null),v=d.useRef(null),x=d.useRef(l),y=T4(s),b=T4(o),[w,k]=d.useState(null),[_,j]=d.useState(null),I=d.useCallback(R=>{m.current!==R&&(m.current=R,k(R))},[]),M=d.useCallback(R=>{v.current!==R&&(v.current=R,j(R))},[]),E=d.useCallback(()=>{if(!m.current||!v.current)return;const R={placement:t,strategy:n,middleware:p};b.current&&(R.platform=b.current),Tq(m.current,v.current,R).then(T=>{const X={...T,isPositioned:!0};O.current&&!Ih(x.current,X)&&(x.current=X,Lr.flushSync(()=>{u(X)}))})},[p,t,n,b]);$p(()=>{i===!1&&x.current.isPositioned&&(x.current.isPositioned=!1,u(R=>({...R,isPositioned:!1})))},[i]);const O=d.useRef(!1);$p(()=>(O.current=!0,()=>{O.current=!1}),[]),$p(()=>{if(w&&_){if(y.current)return y.current(w,_,E);E()}},[w,_,E,y]);const D=d.useMemo(()=>({reference:m,floating:v,setReference:I,setFloating:M}),[I,M]),A=d.useMemo(()=>({reference:w,floating:_}),[w,_]);return d.useMemo(()=>({...l,update:E,refs:D,elements:A,reference:I,floating:M}),[l,E,D,A,I,M])}var zq=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Fq(){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 Bq=d.createContext(null),Hq=()=>d.useContext(Bq);function Vq(e){return(e==null?void 0:e.ownerDocument)||document}function Wq(e){return Vq(e).defaultView||window}function ip(e){return e?e instanceof Wq(e).Element:!1}const Uq=Nx["useInsertionEffect".toString()],Gq=Uq||(e=>e());function Kq(e){const t=d.useRef(()=>{});return Gq(()=>{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 qq(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=Lq(e),s=Hq(),i=d.useRef(null),l=d.useRef({}),u=d.useState(()=>Fq())[0],[p,h]=d.useState(null),m=d.useCallback(k=>{const _=ip(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;o.refs.setReference(_)},[o.refs]),v=d.useCallback(k=>{(ip(k)||k===null)&&(i.current=k,h(k)),(ip(o.refs.reference.current)||o.refs.reference.current===null||k!==null&&!ip(k))&&o.refs.setReference(k)},[o.refs]),x=d.useMemo(()=>({...o.refs,setReference:v,setPositionReference:m,domReference:i}),[o.refs,v,m]),y=d.useMemo(()=>({...o.elements,domReference:p}),[o.elements,p]),b=Kq(n),w=d.useMemo(()=>({...o,refs:x,elements:y,dataRef:l,nodeId:r,events:u,open:t,onOpenChange:b}),[o,r,u,t,b,x,y]);return zq(()=>{const k=s==null?void 0:s.nodesRef.current.find(_=>_.id===r);k&&(k.context=w)}),d.useMemo(()=>({...o,context:w,refs:x,reference:v,positionReference:m}),[o,x,w,v,m])}function Xq({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 Nq(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),$o(()=>{t.update()},r),$o(()=>{s(i=>i+1)},[e])}function Yq(e){const t=[Pq(e.offset)];return e.middlewares.shift&&t.push(Iq({limiter:Eq()})),e.middlewares.flip&&t.push(_q()),e.middlewares.inline&&t.push(jq()),t.push($q({element:e.arrowRef,padding:e.arrowOffset})),t}function Qq(e){const[t,n]=od({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var i;(i=e.onClose)==null||i.call(e),n(!1)},o=()=>{var i,l;t?((i=e.onClose)==null||i.call(e),n(!1)):((l=e.onOpen)==null||l.call(e),n(!0))},s=qq({placement:e.position,middleware:[...Yq(e),...e.width==="target"?[Mq({apply({rects:i}){var l,u;Object.assign((u=(l=s.refs.floating.current)==null?void 0:l.style)!=null?u:{},{width:`${i.reference.width}px`})}})]:[]]});return Xq({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),$o(()=>{var i;(i=e.onPositionChange)==null||i.call(e,s.placement)},[s.placement]),$o(()=>{var i,l;e.opened?(l=e.onOpen)==null||l.call(e):(i=e.onClose)==null||i.call(e)},[e.opened]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const yI={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"},[Zq,CI]=zW(yI.context);var Jq=Object.defineProperty,eX=Object.defineProperties,tX=Object.getOwnPropertyDescriptors,Eh=Object.getOwnPropertySymbols,wI=Object.prototype.hasOwnProperty,SI=Object.prototype.propertyIsEnumerable,$4=(e,t,n)=>t in e?Jq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lp=(e,t)=>{for(var n in t||(t={}))wI.call(t,n)&&$4(e,n,t[n]);if(Eh)for(var n of Eh(t))SI.call(t,n)&&$4(e,n,t[n]);return e},nX=(e,t)=>eX(e,tX(t)),rX=(e,t)=>{var n={};for(var r in e)wI.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&&SI.call(e,r)&&(n[r]=e[r]);return n};const oX={refProp:"ref",popupType:"dialog"},kI=d.forwardRef((e,t)=>{const n=Sn("PopoverTarget",oX,e),{children:r,refProp:o,popupType:s}=n,i=rX(n,["children","refProp","popupType"]);if(!ZP(r))throw new Error(yI.children);const l=i,u=CI(),p=Ld(u.reference,r.ref,t),h=u.withRoles?{"aria-haspopup":s,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return d.cloneElement(r,lp(nX(lp(lp(lp({},l),h),u.targetProps),{className:e6(u.targetProps.className,l.className,r.props.className),[o]:p}),u.controlled?null:{onClick:u.onToggle}))});kI.displayName="@mantine/core/PopoverTarget";var sX=or((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${Oe(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:`${Oe(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const aX=sX;var iX=Object.defineProperty,L4=Object.getOwnPropertySymbols,lX=Object.prototype.hasOwnProperty,cX=Object.prototype.propertyIsEnumerable,z4=(e,t,n)=>t in e?iX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ml=(e,t)=>{for(var n in t||(t={}))lX.call(t,n)&&z4(e,n,t[n]);if(L4)for(var n of L4(t))cX.call(t,n)&&z4(e,n,t[n]);return e};const F4={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function uX({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in ep?Ml(Ml(Ml({transitionProperty:ep[e].transitionProperty},o),ep[e].common),ep[e][F4[t]]):null:Ml(Ml(Ml({transitionProperty:e.transitionProperty},o),e.common),e[F4[t]])}function dX({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:i,onExited:l}){const u=ca(),p=i6(),h=u.respectReducedMotion?p:!1,[m,v]=d.useState(h?0:e),[x,y]=d.useState(r?"entered":"exited"),b=d.useRef(-1),w=k=>{const _=k?o:s,j=k?i:l;y(k?"pre-entering":"pre-exiting"),window.clearTimeout(b.current);const I=h?0:k?e:t;if(v(I),I===0)typeof _=="function"&&_(),typeof j=="function"&&j(),y(k?"entered":"exited");else{const M=window.setTimeout(()=>{typeof _=="function"&&_(),y(k?"entering":"exiting")},10);b.current=window.setTimeout(()=>{window.clearTimeout(M),typeof j=="function"&&j(),y(k?"entered":"exited")},I)}};return $o(()=>{w(r)},[r]),d.useEffect(()=>()=>window.clearTimeout(b.current),[]),{transitionDuration:m,transitionStatus:x,transitionTimingFunction:n||u.transitionTimingFunction}}function _I({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:i,onExit:l,onEntered:u,onEnter:p,onExited:h}){const{transitionDuration:m,transitionStatus:v,transitionTimingFunction:x}=dX({mounted:o,exitDuration:r,duration:n,timingFunction:i,onExit:l,onEntered:u,onEnter:p,onExited:h});return m===0?o?H.createElement(H.Fragment,null,s({})):e?s({display:"none"}):null:v==="exited"?e?s({display:"none"}):null:H.createElement(H.Fragment,null,s(uX({transition:t,duration:m,state:v,timingFunction:x})))}_I.displayName="@mantine/core/Transition";function jI({children:e,active:t=!0,refProp:n="ref"}){const r=bU(t),o=Ld(r,e==null?void 0:e.ref);return ZP(e)?d.cloneElement(e,{[n]:o}):e}jI.displayName="@mantine/core/FocusTrap";var fX=Object.defineProperty,pX=Object.defineProperties,hX=Object.getOwnPropertyDescriptors,B4=Object.getOwnPropertySymbols,mX=Object.prototype.hasOwnProperty,gX=Object.prototype.propertyIsEnumerable,H4=(e,t,n)=>t in e?fX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ja=(e,t)=>{for(var n in t||(t={}))mX.call(t,n)&&H4(e,n,t[n]);if(B4)for(var n of B4(t))gX.call(t,n)&&H4(e,n,t[n]);return e},cp=(e,t)=>pX(e,hX(t));function V4(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function W4(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 vX={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function xX({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:i,dir:l}){const[u,p="center"]=e.split("-"),h={width:Oe(t),height:Oe(t),transform:"rotate(45deg)",position:"absolute",[vX[u]]:Oe(r)},m=Oe(-t/2);return u==="left"?cp(ja(ja({},h),V4(p,i,n,o)),{right:m,borderLeftColor:"transparent",borderBottomColor:"transparent"}):u==="right"?cp(ja(ja({},h),V4(p,i,n,o)),{left:m,borderRightColor:"transparent",borderTopColor:"transparent"}):u==="top"?cp(ja(ja({},h),W4(p,s,n,o,l)),{bottom:m,borderTopColor:"transparent",borderLeftColor:"transparent"}):u==="bottom"?cp(ja(ja({},h),W4(p,s,n,o,l)),{top:m,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var bX=Object.defineProperty,yX=Object.defineProperties,CX=Object.getOwnPropertyDescriptors,Mh=Object.getOwnPropertySymbols,PI=Object.prototype.hasOwnProperty,II=Object.prototype.propertyIsEnumerable,U4=(e,t,n)=>t in e?bX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wX=(e,t)=>{for(var n in t||(t={}))PI.call(t,n)&&U4(e,n,t[n]);if(Mh)for(var n of Mh(t))II.call(t,n)&&U4(e,n,t[n]);return e},SX=(e,t)=>yX(e,CX(t)),kX=(e,t)=>{var n={};for(var r in e)PI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mh)for(var r of Mh(e))t.indexOf(r)<0&&II.call(e,r)&&(n[r]=e[r]);return n};const EI=d.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:l,visible:u,arrowX:p,arrowY:h}=n,m=kX(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const v=ca();return u?H.createElement("div",SX(wX({},m),{ref:t,style:xX({position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:l,dir:v.dir,arrowX:p,arrowY:h})})):null});EI.displayName="@mantine/core/FloatingArrow";var _X=Object.defineProperty,jX=Object.defineProperties,PX=Object.getOwnPropertyDescriptors,Oh=Object.getOwnPropertySymbols,MI=Object.prototype.hasOwnProperty,OI=Object.prototype.propertyIsEnumerable,G4=(e,t,n)=>t in e?_X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ol=(e,t)=>{for(var n in t||(t={}))MI.call(t,n)&&G4(e,n,t[n]);if(Oh)for(var n of Oh(t))OI.call(t,n)&&G4(e,n,t[n]);return e},up=(e,t)=>jX(e,PX(t)),IX=(e,t)=>{var n={};for(var r in e)MI.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&&OI.call(e,r)&&(n[r]=e[r]);return n};const EX={};function DI(e){var t;const n=Sn("PopoverDropdown",EX,e),{style:r,className:o,children:s,onKeyDownCapture:i}=n,l=IX(n,["style","className","children","onKeyDownCapture"]),u=CI(),{classes:p,cx:h}=aX({radius:u.radius,shadow:u.shadow},{name:u.__staticSelector,classNames:u.classNames,styles:u.styles,unstyled:u.unstyled,variant:u.variant}),m=fU({opened:u.opened,shouldReturnFocus:u.returnFocus}),v=u.withRoles?{"aria-labelledby":u.getTargetId(),id:u.getDropdownId(),role:"dialog"}:{};return u.disabled?null:H.createElement(D6,up(Ol({},u.portalProps),{withinPortal:u.withinPortal}),H.createElement(_I,up(Ol({mounted:u.opened},u.transitionProps),{transition:u.transitionProps.transition||"fade",duration:(t=u.transitionProps.duration)!=null?t:150,keepMounted:u.keepMounted,exitDuration:typeof u.transitionProps.exitDuration=="number"?u.transitionProps.exitDuration:u.transitionProps.duration}),x=>{var y,b;return H.createElement(jI,{active:u.trapFocus},H.createElement(Mr,Ol(up(Ol({},v),{tabIndex:-1,ref:u.floating,style:up(Ol(Ol({},r),x),{zIndex:u.zIndex,top:(y=u.y)!=null?y:0,left:(b=u.x)!=null?b:0,width:u.width==="target"?void 0:Oe(u.width)}),className:h(p.dropdown,o),onKeyDownCapture:BW(u.onClose,{active:u.closeOnEscape,onTrigger:m,onKeyDown:i}),"data-position":u.placement}),l),s,H.createElement(EI,{ref:u.arrowRef,arrowX:u.arrowX,arrowY:u.arrowY,visible:u.withArrow,position:u.placement,arrowSize:u.arrowSize,arrowRadius:u.arrowRadius,arrowOffset:u.arrowOffset,arrowPosition:u.arrowPosition,className:p.arrow})))}))}DI.displayName="@mantine/core/PopoverDropdown";function MX(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 K4=Object.getOwnPropertySymbols,OX=Object.prototype.hasOwnProperty,DX=Object.prototype.propertyIsEnumerable,RX=(e,t)=>{var n={};for(var r in e)OX.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&K4)for(var r of K4(e))t.indexOf(r)<0&&DX.call(e,r)&&(n[r]=e[r]);return n};const AX={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:Vb("popover"),__staticSelector:"Popover",width:"max-content"};function Bc(e){var t,n,r,o,s,i;const l=d.useRef(null),u=Sn("Popover",AX,e),{children:p,position:h,offset:m,onPositionChange:v,positionDependencies:x,opened:y,transitionProps:b,width:w,middlewares:k,withArrow:_,arrowSize:j,arrowOffset:I,arrowRadius:M,arrowPosition:E,unstyled:O,classNames:D,styles:A,closeOnClickOutside:R,withinPortal:T,portalProps:X,closeOnEscape:B,clickOutsideEvents:U,trapFocus:Y,onClose:V,onOpen:L,onChange:q,zIndex:z,radius:K,shadow:re,id:Q,defaultOpened:le,__staticSelector:se,withRoles:W,disabled:G,returnFocus:te,variant:ae,keepMounted:oe}=u,pe=RX(u,["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"]),[fe,ge]=d.useState(null),[Ce,me]=d.useState(null),de=Ub(Q),De=ca(),je=Qq({middlewares:k,width:w,position:MX(De.dir,h),offset:typeof m=="number"?m+(_?j/2:0):m,arrowRef:l,arrowOffset:I,onPositionChange:v,positionDependencies:x,opened:y,defaultOpened:le,onChange:q,onOpen:L,onClose:V});lU(()=>je.opened&&R&&je.onClose(),U,[fe,Ce]);const Be=d.useCallback(Ue=>{ge(Ue),je.floating.reference(Ue)},[je.floating.reference]),rt=d.useCallback(Ue=>{me(Ue),je.floating.floating(Ue)},[je.floating.floating]);return H.createElement(Zq,{value:{returnFocus:te,disabled:G,controlled:je.controlled,reference:Be,floating:rt,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:(i=(s=(o=je.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:i.y,opened:je.opened,arrowRef:l,transitionProps:b,width:w,withArrow:_,arrowSize:j,arrowOffset:I,arrowRadius:M,arrowPosition:E,placement:je.floating.placement,trapFocus:Y,withinPortal:T,portalProps:X,zIndex:z,radius:K,shadow:re,closeOnEscape:B,onClose:je.onClose,onToggle:je.onToggle,getTargetId:()=>`${de}-target`,getDropdownId:()=>`${de}-dropdown`,withRoles:W,targetProps:pe,__staticSelector:se,classNames:D,styles:A,unstyled:O,variant:ae,keepMounted:oe}},p)}Bc.Target=kI;Bc.Dropdown=DI;Bc.displayName="@mantine/core/Popover";var NX=Object.defineProperty,Dh=Object.getOwnPropertySymbols,RI=Object.prototype.hasOwnProperty,AI=Object.prototype.propertyIsEnumerable,q4=(e,t,n)=>t in e?NX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,TX=(e,t)=>{for(var n in t||(t={}))RI.call(t,n)&&q4(e,n,t[n]);if(Dh)for(var n of Dh(t))AI.call(t,n)&&q4(e,n,t[n]);return e},$X=(e,t)=>{var n={};for(var r in e)RI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dh)for(var r of Dh(e))t.indexOf(r)<0&&AI.call(e,r)&&(n[r]=e[r]);return n};function LX(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:i,innerRef:l,__staticSelector:u,styles:p,classNames:h,unstyled:m}=t,v=$X(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:x}=bq(null,{name:u,styles:p,classNames:h,unstyled:m});return H.createElement(Bc.Dropdown,TX({p:0,onMouseDown:y=>y.preventDefault()},v),H.createElement("div",{style:{maxHeight:Oe(o),display:"flex"}},H.createElement(Mr,{component:r||"div",id:`${i}-items`,"aria-labelledby":`${i}-label`,role:"listbox",onMouseDown:y=>y.preventDefault(),style:{flex:1,overflowY:r!==Ym?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},H.createElement("div",{className:x.itemsWrapper,style:{flexDirection:s}},n))))}function Ba({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:s,__staticSelector:i,onDirectionChange:l,switchDirectionOnFlip:u,zIndex:p,dropdownPosition:h,positionDependencies:m=[],classNames:v,styles:x,unstyled:y,readOnly:b,variant:w}){return H.createElement(Bc,{unstyled:y,classNames:v,styles:x,width:"target",withRoles:!1,opened:e,middlewares:{flip:h==="flip",shift:!1},position:h==="flip"?"bottom":h,positionDependencies:m,zIndex:p,__staticSelector:i,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:b,onPositionChange:k=>u&&(l==null?void 0:l(k==="top"?"column-reverse":"column")),variant:w},s)}Ba.Target=Bc.Target;Ba.Dropdown=LX;var zX=Object.defineProperty,FX=Object.defineProperties,BX=Object.getOwnPropertyDescriptors,Rh=Object.getOwnPropertySymbols,NI=Object.prototype.hasOwnProperty,TI=Object.prototype.propertyIsEnumerable,X4=(e,t,n)=>t in e?zX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dp=(e,t)=>{for(var n in t||(t={}))NI.call(t,n)&&X4(e,n,t[n]);if(Rh)for(var n of Rh(t))TI.call(t,n)&&X4(e,n,t[n]);return e},HX=(e,t)=>FX(e,BX(t)),VX=(e,t)=>{var n={};for(var r in e)NI.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&&TI.call(e,r)&&(n[r]=e[r]);return n};function $I(e,t,n){const r=Sn(e,t,n),{label:o,description:s,error:i,required:l,classNames:u,styles:p,className:h,unstyled:m,__staticSelector:v,sx:x,errorProps:y,labelProps:b,descriptionProps:w,wrapperProps:k,id:_,size:j,style:I,inputContainer:M,inputWrapperOrder:E,withAsterisk:O,variant:D}=r,A=VX(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),R=Ub(_),{systemStyles:T,rest:X}=Gm(A),B=dp({label:o,description:s,error:i,required:l,classNames:u,className:h,__staticSelector:v,sx:x,errorProps:y,labelProps:b,descriptionProps:w,unstyled:m,styles:p,id:R,size:j,style:I,inputContainer:M,inputWrapperOrder:E,withAsterisk:O,variant:D},k);return HX(dp({},X),{classNames:u,styles:p,unstyled:m,wrapperProps:dp(dp({},B),T),inputProps:{required:l,classNames:u,styles:p,unstyled:m,id:R,size:j,__staticSelector:v,error:i,variant:D}})}var WX=or((e,t,{size:n})=>({label:{display:"inline-block",fontSize:ut({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 UX=WX;var GX=Object.defineProperty,Ah=Object.getOwnPropertySymbols,LI=Object.prototype.hasOwnProperty,zI=Object.prototype.propertyIsEnumerable,Y4=(e,t,n)=>t in e?GX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KX=(e,t)=>{for(var n in t||(t={}))LI.call(t,n)&&Y4(e,n,t[n]);if(Ah)for(var n of Ah(t))zI.call(t,n)&&Y4(e,n,t[n]);return e},qX=(e,t)=>{var n={};for(var r in e)LI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ah)for(var r of Ah(e))t.indexOf(r)<0&&zI.call(e,r)&&(n[r]=e[r]);return n};const XX={labelElement:"label",size:"sm"},ey=d.forwardRef((e,t)=>{const n=Sn("InputLabel",XX,e),{labelElement:r,children:o,required:s,size:i,classNames:l,styles:u,unstyled:p,className:h,htmlFor:m,__staticSelector:v,variant:x,onMouseDown:y}=n,b=qX(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:w,cx:k}=UX(null,{name:["InputWrapper",v],classNames:l,styles:u,unstyled:p,variant:x,size:i});return H.createElement(Mr,KX({component:r,ref:t,className:k(w.label,h),htmlFor:r==="label"?m:void 0,onMouseDown:_=>{y==null||y(_),!_.defaultPrevented&&_.detail>1&&_.preventDefault()}},b),o,s&&H.createElement("span",{className:w.required,"aria-hidden":!0}," *"))});ey.displayName="@mantine/core/InputLabel";var YX=or((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${ut({size:n,sizes:e.fontSizes})} - ${Oe(2)})`,lineHeight:1.2,display:"block"}}));const QX=YX;var ZX=Object.defineProperty,Nh=Object.getOwnPropertySymbols,FI=Object.prototype.hasOwnProperty,BI=Object.prototype.propertyIsEnumerable,Q4=(e,t,n)=>t in e?ZX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JX=(e,t)=>{for(var n in t||(t={}))FI.call(t,n)&&Q4(e,n,t[n]);if(Nh)for(var n of Nh(t))BI.call(t,n)&&Q4(e,n,t[n]);return e},eY=(e,t)=>{var n={};for(var r in e)FI.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&&BI.call(e,r)&&(n[r]=e[r]);return n};const tY={size:"sm"},ty=d.forwardRef((e,t)=>{const n=Sn("InputError",tY,e),{children:r,className:o,classNames:s,styles:i,unstyled:l,size:u,__staticSelector:p,variant:h}=n,m=eY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:x}=QX(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:l,variant:h,size:u});return H.createElement(Sc,JX({className:x(v.error,o),ref:t},m),r)});ty.displayName="@mantine/core/InputError";var nY=or((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${ut({size:n,sizes:e.fontSizes})} - ${Oe(2)})`,lineHeight:1.2,display:"block"}}));const rY=nY;var oY=Object.defineProperty,Th=Object.getOwnPropertySymbols,HI=Object.prototype.hasOwnProperty,VI=Object.prototype.propertyIsEnumerable,Z4=(e,t,n)=>t in e?oY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sY=(e,t)=>{for(var n in t||(t={}))HI.call(t,n)&&Z4(e,n,t[n]);if(Th)for(var n of Th(t))VI.call(t,n)&&Z4(e,n,t[n]);return e},aY=(e,t)=>{var n={};for(var r in e)HI.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&&VI.call(e,r)&&(n[r]=e[r]);return n};const iY={size:"sm"},ny=d.forwardRef((e,t)=>{const n=Sn("InputDescription",iY,e),{children:r,className:o,classNames:s,styles:i,unstyled:l,size:u,__staticSelector:p,variant:h}=n,m=aY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:x}=rY(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:l,variant:h,size:u});return H.createElement(Sc,sY({color:"dimmed",className:x(v.description,o),ref:t,unstyled:l},m),r)});ny.displayName="@mantine/core/InputDescription";const WI=d.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),lY=WI.Provider,cY=()=>d.useContext(WI);function uY(e,{hasDescription:t,hasError:n}){const r=e.findIndex(u=>u==="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 dY=Object.defineProperty,fY=Object.defineProperties,pY=Object.getOwnPropertyDescriptors,J4=Object.getOwnPropertySymbols,hY=Object.prototype.hasOwnProperty,mY=Object.prototype.propertyIsEnumerable,ek=(e,t,n)=>t in e?dY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gY=(e,t)=>{for(var n in t||(t={}))hY.call(t,n)&&ek(e,n,t[n]);if(J4)for(var n of J4(t))mY.call(t,n)&&ek(e,n,t[n]);return e},vY=(e,t)=>fY(e,pY(t)),xY=or(e=>({root:vY(gY({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const bY=xY;var yY=Object.defineProperty,CY=Object.defineProperties,wY=Object.getOwnPropertyDescriptors,$h=Object.getOwnPropertySymbols,UI=Object.prototype.hasOwnProperty,GI=Object.prototype.propertyIsEnumerable,tk=(e,t,n)=>t in e?yY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pa=(e,t)=>{for(var n in t||(t={}))UI.call(t,n)&&tk(e,n,t[n]);if($h)for(var n of $h(t))GI.call(t,n)&&tk(e,n,t[n]);return e},nk=(e,t)=>CY(e,wY(t)),SY=(e,t)=>{var n={};for(var r in e)UI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$h)for(var r of $h(e))t.indexOf(r)<0&&GI.call(e,r)&&(n[r]=e[r]);return n};const kY={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},KI=d.forwardRef((e,t)=>{const n=Sn("InputWrapper",kY,e),{className:r,label:o,children:s,required:i,id:l,error:u,description:p,labelElement:h,labelProps:m,descriptionProps:v,errorProps:x,classNames:y,styles:b,size:w,inputContainer:k,__staticSelector:_,unstyled:j,inputWrapperOrder:I,withAsterisk:M,variant:E}=n,O=SY(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}=bY(null,{classNames:y,styles:b,name:["InputWrapper",_],unstyled:j,variant:E,size:w}),R={classNames:y,styles:b,unstyled:j,size:w,variant:E,__staticSelector:_},T=typeof M=="boolean"?M:i,X=l?`${l}-error`:x==null?void 0:x.id,B=l?`${l}-description`:v==null?void 0:v.id,Y=`${!!u&&typeof u!="boolean"?X:""} ${p?B:""}`,V=Y.trim().length>0?Y.trim():void 0,L=o&&H.createElement(ey,Pa(Pa({key:"label",labelElement:h,id:l?`${l}-label`:void 0,htmlFor:l,required:T},R),m),o),q=p&&H.createElement(ny,nk(Pa(Pa({key:"description"},v),R),{size:(v==null?void 0:v.size)||R.size,id:(v==null?void 0:v.id)||B}),p),z=H.createElement(d.Fragment,{key:"input"},k(s)),K=typeof u!="boolean"&&u&&H.createElement(ty,nk(Pa(Pa({},x),R),{size:(x==null?void 0:x.size)||R.size,key:"error",id:(x==null?void 0:x.id)||X}),u),re=I.map(Q=>{switch(Q){case"label":return L;case"input":return z;case"description":return q;case"error":return K;default:return null}});return H.createElement(lY,{value:Pa({describedBy:V},uY(I,{hasDescription:!!q,hasError:!!K}))},H.createElement(Mr,Pa({className:A(D.root,r),ref:t},O),re))});KI.displayName="@mantine/core/InputWrapper";var _Y=Object.defineProperty,Lh=Object.getOwnPropertySymbols,qI=Object.prototype.hasOwnProperty,XI=Object.prototype.propertyIsEnumerable,rk=(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={}))qI.call(t,n)&&rk(e,n,t[n]);if(Lh)for(var n of Lh(t))XI.call(t,n)&&rk(e,n,t[n]);return e},PY=(e,t)=>{var n={};for(var r in e)qI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lh)for(var r of Lh(e))t.indexOf(r)<0&&XI.call(e,r)&&(n[r]=e[r]);return n};const IY={},YI=d.forwardRef((e,t)=>{const n=Sn("InputPlaceholder",IY,e),{sx:r}=n,o=PY(n,["sx"]);return H.createElement(Mr,jY({component:"span",sx:[s=>s.fn.placeholderStyles(),...YP(r)],ref:t},o))});YI.displayName="@mantine/core/InputPlaceholder";var EY=Object.defineProperty,MY=Object.defineProperties,OY=Object.getOwnPropertyDescriptors,ok=Object.getOwnPropertySymbols,DY=Object.prototype.hasOwnProperty,RY=Object.prototype.propertyIsEnumerable,sk=(e,t,n)=>t in e?EY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fp=(e,t)=>{for(var n in t||(t={}))DY.call(t,n)&&sk(e,n,t[n]);if(ok)for(var n of ok(t))RY.call(t,n)&&sk(e,n,t[n]);return e},wv=(e,t)=>MY(e,OY(t));const no={xs:Oe(30),sm:Oe(36),md:Oe(42),lg:Oe(50),xl:Oe(60)},AY=["default","filled","unstyled"];function NY({theme:e,variant:t}){return AY.includes(t)?t==="default"?{border:`${Oe(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:`${Oe(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:Oe(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var TY=or((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:i,offsetBottom:l,offsetTop:u,pointer:p},{variant:h,size:m})=>{const v=e.fn.variant({variant:"filled",color:"red"}).background,x=h==="default"||h==="filled"?{minHeight:ut({size:m,sizes:no}),paddingLeft:`calc(${ut({size:m,sizes:no})} / 3)`,paddingRight:s?o||ut({size:m,sizes:no}):`calc(${ut({size:m,sizes:no})} / 3)`,borderRadius:e.fn.radius(n)}:h==="unstyled"&&s?{paddingRight:o||ut({size:m,sizes:no})}:null;return{wrapper:{position:"relative",marginTop:u?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:l?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:wv(fp(fp(wv(fp({},e.fn.fontStyles()),{height:t?h==="unstyled"?void 0:"auto":ut({size:m,sizes:no}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${ut({size:m,sizes:no})} - ${Oe(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:ut({size:m,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:p?"pointer":void 0}),NY({theme:e,variant:h})),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:v,borderColor:v,"&::placeholder":{opacity:1,color:v}},"&[data-with-icon]":{paddingLeft:typeof i=="number"?Oe(i):ut({size:m,sizes:no})},"&::placeholder":wv(fp({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:i?Oe(i):ut({size:m,sizes:no}),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||ut({size:m,sizes:no})}}});const $Y=TY;var LY=Object.defineProperty,zY=Object.defineProperties,FY=Object.getOwnPropertyDescriptors,zh=Object.getOwnPropertySymbols,QI=Object.prototype.hasOwnProperty,ZI=Object.prototype.propertyIsEnumerable,ak=(e,t,n)=>t in e?LY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pp=(e,t)=>{for(var n in t||(t={}))QI.call(t,n)&&ak(e,n,t[n]);if(zh)for(var n of zh(t))ZI.call(t,n)&&ak(e,n,t[n]);return e},ik=(e,t)=>zY(e,FY(t)),BY=(e,t)=>{var n={};for(var r in e)QI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zh)for(var r of zh(e))t.indexOf(r)<0&&ZI.call(e,r)&&(n[r]=e[r]);return n};const HY={size:"sm",variant:"default"},tl=d.forwardRef((e,t)=>{const n=Sn("Input",HY,e),{className:r,error:o,required:s,disabled:i,variant:l,icon:u,style:p,rightSectionWidth:h,iconWidth:m,rightSection:v,rightSectionProps:x,radius:y,size:b,wrapperProps:w,classNames:k,styles:_,__staticSelector:j,multiline:I,sx:M,unstyled:E,pointer:O}=n,D=BY(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:R,describedBy:T}=cY(),{classes:X,cx:B}=$Y({radius:y,multiline:I,invalid:!!o,rightSectionWidth:h?Oe(h):void 0,iconWidth:m,withRightSection:!!v,offsetBottom:A,offsetTop:R,pointer:O},{classNames:k,styles:_,name:["Input",j],unstyled:E,variant:l,size:b}),{systemStyles:U,rest:Y}=Gm(D);return H.createElement(Mr,pp(pp({className:B(X.wrapper,r),sx:M,style:p},U),w),u&&H.createElement("div",{className:X.icon},u),H.createElement(Mr,ik(pp({component:"input"},Y),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":T,disabled:i,"data-disabled":i||void 0,"data-with-icon":!!u||void 0,"data-invalid":!!o||void 0,className:X.input})),v&&H.createElement("div",ik(pp({},x),{className:X.rightSection}),v))});tl.displayName="@mantine/core/Input";tl.Wrapper=KI;tl.Label=ey;tl.Description=ny;tl.Error=ty;tl.Placeholder=YI;const Pc=tl;var VY=Object.defineProperty,Fh=Object.getOwnPropertySymbols,JI=Object.prototype.hasOwnProperty,eE=Object.prototype.propertyIsEnumerable,lk=(e,t,n)=>t in e?VY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ck=(e,t)=>{for(var n in t||(t={}))JI.call(t,n)&&lk(e,n,t[n]);if(Fh)for(var n of Fh(t))eE.call(t,n)&&lk(e,n,t[n]);return e},WY=(e,t)=>{var n={};for(var r in e)JI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fh)for(var r of Fh(e))t.indexOf(r)<0&&eE.call(e,r)&&(n[r]=e[r]);return n};const UY={multiple:!1},tE=d.forwardRef((e,t)=>{const n=Sn("FileButton",UY,e),{onChange:r,children:o,multiple:s,accept:i,name:l,form:u,resetRef:p,disabled:h,capture:m,inputProps:v}=n,x=WY(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),y=d.useRef(),b=()=>{!h&&y.current.click()},w=_=>{r(s?Array.from(_.currentTarget.files):_.currentTarget.files[0]||null)};return a6(p,()=>{y.current.value=""}),H.createElement(H.Fragment,null,o(ck({onClick:b},x)),H.createElement("input",ck({style:{display:"none"},type:"file",accept:i,multiple:s,onChange:w,ref:Ld(t,y),name:l,form:u,capture:m},v)))});tE.displayName="@mantine/core/FileButton";const nE={xs:Oe(16),sm:Oe(22),md:Oe(26),lg:Oe(30),xl:Oe(36)},GY={xs:Oe(10),sm:Oe(12),md:Oe(14),lg:Oe(16),xl:Oe(18)};var KY=or((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:ut({size:o,sizes:nE}),paddingLeft:`calc(${ut({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?ut({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:ut({size:o,sizes:GY}),borderRadius:ut({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${Oe(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${ut({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const qY=KY;var XY=Object.defineProperty,Bh=Object.getOwnPropertySymbols,rE=Object.prototype.hasOwnProperty,oE=Object.prototype.propertyIsEnumerable,uk=(e,t,n)=>t in e?XY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YY=(e,t)=>{for(var n in t||(t={}))rE.call(t,n)&&uk(e,n,t[n]);if(Bh)for(var n of Bh(t))oE.call(t,n)&&uk(e,n,t[n]);return e},QY=(e,t)=>{var n={};for(var r in e)rE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Bh)for(var r of Bh(e))t.indexOf(r)<0&&oE.call(e,r)&&(n[r]=e[r]);return n};const ZY={xs:16,sm:22,md:24,lg:26,xl:30};function sE(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:i,disabled:l,readOnly:u,size:p,radius:h="sm",variant:m,unstyled:v}=t,x=QY(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:y,cx:b}=qY({disabled:l,readOnly:u,radius:h},{name:"MultiSelect",classNames:r,styles:o,unstyled:v,size:p,variant:m});return H.createElement("div",YY({className:b(y.defaultValue,s)},x),H.createElement("span",{className:y.defaultValueLabel},n),!l&&!u&&H.createElement(z6,{"aria-hidden":!0,onMouseDown:i,size:ZY[p],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:y.defaultValueRemove,tabIndex:-1,unstyled:v}))}sE.displayName="@mantine/core/MultiSelect/DefaultValue";function JY({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,disableSelectedItemFiltering:i}){if(!t&&s.length===0)return e;if(!t){const u=[];for(let p=0;p<e.length;p+=1)(i||!s.some(h=>h===e[p].value&&!e[p].disabled))&&u.push(e[p]);return u}const l=[];for(let u=0;u<e.length&&(o(r,!i&&s.some(p=>p===e[u].value&&!e[u].disabled),e[u])&&l.push(e[u]),!(l.length>=n));u+=1);return l}var eQ=Object.defineProperty,Hh=Object.getOwnPropertySymbols,aE=Object.prototype.hasOwnProperty,iE=Object.prototype.propertyIsEnumerable,dk=(e,t,n)=>t in e?eQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fk=(e,t)=>{for(var n in t||(t={}))aE.call(t,n)&&dk(e,n,t[n]);if(Hh)for(var n of Hh(t))iE.call(t,n)&&dk(e,n,t[n]);return e},tQ=(e,t)=>{var n={};for(var r in e)aE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hh)for(var r of Hh(e))t.indexOf(r)<0&&iE.call(e,r)&&(n[r]=e[r]);return n};const nQ={xs:Oe(14),sm:Oe(18),md:Oe(20),lg:Oe(24),xl:Oe(28)};function rQ(e){var t=e,{size:n,error:r,style:o}=t,s=tQ(t,["size","error","style"]);const i=ca(),l=ut({size:n,sizes:nQ});return H.createElement("svg",fk({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:fk({color:r?i.colors.red[6]:i.colors.gray[6],width:l,height:l},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 oQ=Object.defineProperty,sQ=Object.defineProperties,aQ=Object.getOwnPropertyDescriptors,pk=Object.getOwnPropertySymbols,iQ=Object.prototype.hasOwnProperty,lQ=Object.prototype.propertyIsEnumerable,hk=(e,t,n)=>t in e?oQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cQ=(e,t)=>{for(var n in t||(t={}))iQ.call(t,n)&&hk(e,n,t[n]);if(pk)for(var n of pk(t))lQ.call(t,n)&&hk(e,n,t[n]);return e},uQ=(e,t)=>sQ(e,aQ(t));function lE({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?H.createElement(z6,uQ(cQ({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):H.createElement(rQ,{error:o,size:r})}lE.displayName="@mantine/core/SelectRightSection";var dQ=Object.defineProperty,fQ=Object.defineProperties,pQ=Object.getOwnPropertyDescriptors,Vh=Object.getOwnPropertySymbols,cE=Object.prototype.hasOwnProperty,uE=Object.prototype.propertyIsEnumerable,mk=(e,t,n)=>t in e?dQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sv=(e,t)=>{for(var n in t||(t={}))cE.call(t,n)&&mk(e,n,t[n]);if(Vh)for(var n of Vh(t))uE.call(t,n)&&mk(e,n,t[n]);return e},gk=(e,t)=>fQ(e,pQ(t)),hQ=(e,t)=>{var n={};for(var r in e)cE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vh)for(var r of Vh(e))t.indexOf(r)<0&&uE.call(e,r)&&(n[r]=e[r]);return n};function dE(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,i=hQ(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const l=typeof n=="function"?n(s):n;return{rightSection:!i.readOnly&&!(i.disabled&&i.shouldClear)&&H.createElement(lE,Sv({},i)),styles:gk(Sv({},l),{rightSection:gk(Sv({},l==null?void 0:l.rightSection),{pointerEvents:i.shouldClear?void 0:"none"})})}}var mQ=Object.defineProperty,gQ=Object.defineProperties,vQ=Object.getOwnPropertyDescriptors,vk=Object.getOwnPropertySymbols,xQ=Object.prototype.hasOwnProperty,bQ=Object.prototype.propertyIsEnumerable,xk=(e,t,n)=>t in e?mQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yQ=(e,t)=>{for(var n in t||(t={}))xQ.call(t,n)&&xk(e,n,t[n]);if(vk)for(var n of vk(t))bQ.call(t,n)&&xk(e,n,t[n]);return e},CQ=(e,t)=>gQ(e,vQ(t)),wQ=or((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(${ut({size:n,sizes:no})} - ${Oe(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:ut({size:n,sizes:no})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${Oe(2)}) calc(${e.spacing.xs} / 2)`},searchInput:CQ(yQ({},e.fn.fontStyles()),{flex:1,minWidth:Oe(60),backgroundColor:"transparent",border:0,outline:0,fontSize:ut({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:ut({size:n,sizes:nE}),"&::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 SQ=wQ;var kQ=Object.defineProperty,_Q=Object.defineProperties,jQ=Object.getOwnPropertyDescriptors,Wh=Object.getOwnPropertySymbols,fE=Object.prototype.hasOwnProperty,pE=Object.prototype.propertyIsEnumerable,bk=(e,t,n)=>t in e?kQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dl=(e,t)=>{for(var n in t||(t={}))fE.call(t,n)&&bk(e,n,t[n]);if(Wh)for(var n of Wh(t))pE.call(t,n)&&bk(e,n,t[n]);return e},yk=(e,t)=>_Q(e,jQ(t)),PQ=(e,t)=>{var n={};for(var r in e)fE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wh)for(var r of Wh(e))t.indexOf(r)<0&&pE.call(e,r)&&(n[r]=e[r]);return n};function IQ(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function EQ(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function Ck(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 MQ={size:"sm",valueComponent:sE,itemComponent:Kb,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:IQ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:EQ,switchDirectionOnFlip:!1,zIndex:Vb("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},hE=d.forwardRef((e,t)=>{const n=Sn("MultiSelect",MQ,e),{className:r,style:o,required:s,label:i,description:l,size:u,error:p,classNames:h,styles:m,wrapperProps:v,value:x,defaultValue:y,data:b,onChange:w,valueComponent:k,itemComponent:_,id:j,transitionProps:I,maxDropdownHeight:M,shadow:E,nothingFound:O,onFocus:D,onBlur:A,searchable:R,placeholder:T,filter:X,limit:B,clearSearchOnChange:U,clearable:Y,clearSearchOnBlur:V,variant:L,onSearchChange:q,searchValue:z,disabled:K,initiallyOpened:re,radius:Q,icon:le,rightSection:se,rightSectionWidth:W,creatable:G,getCreateLabel:te,shouldCreate:ae,onCreate:oe,sx:pe,dropdownComponent:fe,onDropdownClose:ge,onDropdownOpen:Ce,maxSelectedValues:me,withinPortal:de,portalProps:De,switchDirectionOnFlip:je,zIndex:Be,selectOnBlur:rt,name:Ue,dropdownPosition:wt,errorProps:Xe,labelProps:tt,descriptionProps:xe,form:Re,positionDependencies:st,onKeyDown:mt,unstyled:ve,inputContainer:Ye,inputWrapperOrder:ot,readOnly:lt,withAsterisk:Me,clearButtonProps:$e,hoverOnSearchChange:At,disableSelectedItemFiltering:ke}=n,ze=PQ(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:We,theme:ct}=SQ({invalid:!!p},{name:"MultiSelect",classNames:h,styles:m,unstyled:ve,size:u,variant:L}),{systemStyles:xn,rest:jt}=Gm(ze),Pt=d.useRef(),sr=d.useRef({}),In=Ub(j),[pn,on]=d.useState(re),[Qt,mr]=d.useState(-1),[yo,ar]=d.useState("column"),[ir,Is]=od({value:z,defaultValue:"",finalValue:void 0,onChange:q}),[Es,pa]=d.useState(!1),{scrollIntoView:ha,targetRef:il,scrollableRef:ma}=l6({duration:0,offset:5,cancelable:!1,isList:!0}),ll=G&&typeof te=="function";let qe=null;const Nt=b.map(Je=>typeof Je=="string"?{label:Je,value:Je}:Je),En=QP({data:Nt}),[xt,ga]=od({value:Ck(x,b),defaultValue:Ck(y,b),finalValue:[],onChange:w}),Rr=d.useRef(!!me&&me<xt.length),qd=Je=>{if(!lt){const St=xt.filter(bt=>bt!==Je);ga(St),me&&St.length<me&&(Rr.current=!1)}},Dg=Je=>{Is(Je.currentTarget.value),!K&&!Rr.current&&R&&on(!0)},Rg=Je=>{typeof D=="function"&&D(Je),!K&&!Rr.current&&R&&on(!0)},Mn=JY({data:En,searchable:R,searchValue:ir,limit:B,filter:X,value:xt,disableSelectedItemFiltering:ke});ll&&ae(ir,En)&&(qe=te(ir),Mn.push({label:ir,value:ir,creatable:!0}));const Ms=Math.min(Qt,Mn.length-1),Xd=(Je,St,bt)=>{let kt=Je;for(;bt(kt);)if(kt=St(kt),!Mn[kt].disabled)return kt;return Je};$o(()=>{mr(At&&ir?0:-1)},[ir,At]),$o(()=>{!K&&xt.length>b.length&&on(!1),me&&xt.length<me&&(Rr.current=!1),me&&xt.length>=me&&(Rr.current=!0,on(!1))},[xt]);const cl=Je=>{if(!lt)if(U&&Is(""),xt.includes(Je.value))qd(Je.value);else{if(Je.creatable&&typeof oe=="function"){const St=oe(Je.value);typeof St<"u"&&St!==null&&ga(typeof St=="string"?[...xt,St]:[...xt,St.value])}else ga([...xt,Je.value]);xt.length===me-1&&(Rr.current=!0,on(!1)),Mn.length===1&&on(!1)}},Yc=Je=>{typeof A=="function"&&A(Je),rt&&Mn[Ms]&&pn&&cl(Mn[Ms]),V&&Is(""),on(!1)},ai=Je=>{if(Es||(mt==null||mt(Je),lt)||Je.key!=="Backspace"&&me&&Rr.current)return;const St=yo==="column",bt=()=>{mr(Kn=>{var Wt;const kn=Xd(Kn,lr=>lr+1,lr=>lr<Mn.length-1);return pn&&(il.current=sr.current[(Wt=Mn[kn])==null?void 0:Wt.value],ha({alignment:St?"end":"start"})),kn})},kt=()=>{mr(Kn=>{var Wt;const kn=Xd(Kn,lr=>lr-1,lr=>lr>0);return pn&&(il.current=sr.current[(Wt=Mn[kn])==null?void 0:Wt.value],ha({alignment:St?"start":"end"})),kn})};switch(Je.key){case"ArrowUp":{Je.preventDefault(),on(!0),St?kt():bt();break}case"ArrowDown":{Je.preventDefault(),on(!0),St?bt():kt();break}case"Enter":{Je.preventDefault(),Mn[Ms]&&pn?cl(Mn[Ms]):on(!0);break}case" ":{R||(Je.preventDefault(),Mn[Ms]&&pn?cl(Mn[Ms]):on(!0));break}case"Backspace":{xt.length>0&&ir.length===0&&(ga(xt.slice(0,-1)),on(!0),me&&(Rr.current=!1));break}case"Home":{if(!R){Je.preventDefault(),pn||on(!0);const Kn=Mn.findIndex(Wt=>!Wt.disabled);mr(Kn),ha({alignment:St?"end":"start"})}break}case"End":{if(!R){Je.preventDefault(),pn||on(!0);const Kn=Mn.map(Wt=>!!Wt.disabled).lastIndexOf(!1);mr(Kn),ha({alignment:St?"end":"start"})}break}case"Escape":on(!1)}},Qc=xt.map(Je=>{let St=En.find(bt=>bt.value===Je&&!bt.disabled);return!St&&ll&&(St={value:Je,label:Je}),St}).filter(Je=>!!Je).map((Je,St)=>H.createElement(k,yk(Dl({},Je),{variant:L,disabled:K,className:Le.value,readOnly:lt,onRemove:bt=>{bt.preventDefault(),bt.stopPropagation(),qd(Je.value)},key:Je.value,size:u,styles:m,classNames:h,radius:Q,index:St}))),Zc=Je=>xt.includes(Je),Ag=()=>{var Je;Is(""),ga([]),(Je=Pt.current)==null||Je.focus(),me&&(Rr.current=!1)},va=!lt&&(Mn.length>0?pn:pn&&!!O);return $o(()=>{const Je=va?Ce:ge;typeof Je=="function"&&Je()},[va]),H.createElement(Pc.Wrapper,Dl(Dl({required:s,id:In,label:i,error:p,description:l,size:u,className:r,style:o,classNames:h,styles:m,__staticSelector:"MultiSelect",sx:pe,errorProps:Xe,descriptionProps:xe,labelProps:tt,inputContainer:Ye,inputWrapperOrder:ot,unstyled:ve,withAsterisk:Me,variant:L},xn),v),H.createElement(Ba,{opened:va,transitionProps:I,shadow:"sm",withinPortal:de,portalProps:De,__staticSelector:"MultiSelect",onDirectionChange:ar,switchDirectionOnFlip:je,zIndex:Be,dropdownPosition:wt,positionDependencies:[...st,ir],classNames:h,styles:m,unstyled:ve,variant:L},H.createElement(Ba.Target,null,H.createElement("div",{className:Le.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":pn&&va?`${In}-items`:null,"aria-controls":In,"aria-expanded":pn,onMouseLeave:()=>mr(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:Ue,value:xt.join(","),form:Re,disabled:K}),H.createElement(Pc,Dl({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:u,variant:L,disabled:K,error:p,required:s,radius:Q,icon:le,unstyled:ve,onMouseDown:Je=>{var St;Je.preventDefault(),!K&&!Rr.current&&on(!pn),(St=Pt.current)==null||St.focus()},classNames:yk(Dl({},h),{input:We({[Le.input]:!R},h==null?void 0:h.input)})},dE({theme:ct,rightSection:se,rightSectionWidth:W,styles:m,size:u,shouldClear:Y&&xt.length>0,onClear:Ag,error:p,disabled:K,clearButtonProps:$e,readOnly:lt})),H.createElement("div",{className:Le.values,"data-clearable":Y||void 0},Qc,H.createElement("input",Dl({ref:Ld(t,Pt),type:"search",id:In,className:We(Le.searchInput,{[Le.searchInputPointer]:!R,[Le.searchInputInputHidden]:!pn&&xt.length>0||!R&&xt.length>0,[Le.searchInputEmpty]:xt.length===0}),onKeyDown:ai,value:ir,onChange:Dg,onFocus:Rg,onBlur:Yc,readOnly:!R||Rr.current||lt,placeholder:xt.length===0?T:void 0,disabled:K,"data-mantine-stop-propagation":pn,autoComplete:"off",onCompositionStart:()=>pa(!0),onCompositionEnd:()=>pa(!1)},jt)))))),H.createElement(Ba.Dropdown,{component:fe||Ym,maxHeight:M,direction:yo,id:In,innerRef:ma,__staticSelector:"MultiSelect",classNames:h,styles:m},H.createElement(Gb,{data:Mn,hovered:Ms,classNames:h,styles:m,uuid:In,__staticSelector:"MultiSelect",onItemHover:mr,onItemSelect:cl,itemsRefs:sr,itemComponent:_,size:u,nothingFound:O,isItemSelected:Zc,creatable:G&&!!qe,createLabel:qe,unstyled:ve,variant:L}))))});hE.displayName="@mantine/core/MultiSelect";var OQ=Object.defineProperty,DQ=Object.defineProperties,RQ=Object.getOwnPropertyDescriptors,Uh=Object.getOwnPropertySymbols,mE=Object.prototype.hasOwnProperty,gE=Object.prototype.propertyIsEnumerable,wk=(e,t,n)=>t in e?OQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kv=(e,t)=>{for(var n in t||(t={}))mE.call(t,n)&&wk(e,n,t[n]);if(Uh)for(var n of Uh(t))gE.call(t,n)&&wk(e,n,t[n]);return e},AQ=(e,t)=>DQ(e,RQ(t)),NQ=(e,t)=>{var n={};for(var r in e)mE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Uh)for(var r of Uh(e))t.indexOf(r)<0&&gE.call(e,r)&&(n[r]=e[r]);return n};const TQ={type:"text",size:"sm",__staticSelector:"TextInput"},vE=d.forwardRef((e,t)=>{const n=$I("TextInput",TQ,e),{inputProps:r,wrapperProps:o}=n,s=NQ(n,["inputProps","wrapperProps"]);return H.createElement(Pc.Wrapper,kv({},o),H.createElement(Pc,AQ(kv(kv({},r),s),{ref:t})))});vE.displayName="@mantine/core/TextInput";function $Q({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:i}){if(!t)return e;const l=s!=null&&e.find(p=>p.value===s)||null;if(l&&!i&&(l==null?void 0:l.label)===r){if(n){if(n>=e.length)return e;const p=e.indexOf(l),h=p+n,m=h-e.length;return m>0?e.slice(p-m):e.slice(p,h)}return e}const u=[];for(let p=0;p<e.length&&(o(r,e[p])&&u.push(e[p]),!(u.length>=n));p+=1);return u}var LQ=or(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const zQ=LQ;var FQ=Object.defineProperty,BQ=Object.defineProperties,HQ=Object.getOwnPropertyDescriptors,Gh=Object.getOwnPropertySymbols,xE=Object.prototype.hasOwnProperty,bE=Object.prototype.propertyIsEnumerable,Sk=(e,t,n)=>t in e?FQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ku=(e,t)=>{for(var n in t||(t={}))xE.call(t,n)&&Sk(e,n,t[n]);if(Gh)for(var n of Gh(t))bE.call(t,n)&&Sk(e,n,t[n]);return e},_v=(e,t)=>BQ(e,HQ(t)),VQ=(e,t)=>{var n={};for(var r in e)xE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gh)for(var r of Gh(e))t.indexOf(r)<0&&bE.call(e,r)&&(n[r]=e[r]);return n};function WQ(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function UQ(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const GQ={required:!1,size:"sm",shadow:"sm",itemComponent:Kb,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:WQ,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:UQ,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:Vb("popover"),positionDependencies:[],dropdownPosition:"flip"},ry=d.forwardRef((e,t)=>{const n=$I("Select",GQ,e),{inputProps:r,wrapperProps:o,shadow:s,data:i,value:l,defaultValue:u,onChange:p,itemComponent:h,onKeyDown:m,onBlur:v,onFocus:x,transitionProps:y,initiallyOpened:b,unstyled:w,classNames:k,styles:_,filter:j,maxDropdownHeight:I,searchable:M,clearable:E,nothingFound:O,limit:D,disabled:A,onSearchChange:R,searchValue:T,rightSection:X,rightSectionWidth:B,creatable:U,getCreateLabel:Y,shouldCreate:V,selectOnBlur:L,onCreate:q,dropdownComponent:z,onDropdownClose:K,onDropdownOpen:re,withinPortal:Q,portalProps:le,switchDirectionOnFlip:se,zIndex:W,name:G,dropdownPosition:te,allowDeselect:ae,placeholder:oe,filterDataOnExactSearchMatch:pe,form:fe,positionDependencies:ge,readOnly:Ce,clearButtonProps:me,hoverOnSearchChange:de}=n,De=VQ(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:Be,theme:rt}=zQ(),[Ue,wt]=d.useState(b),[Xe,tt]=d.useState(-1),xe=d.useRef(),Re=d.useRef({}),[st,mt]=d.useState("column"),ve=st==="column",{scrollIntoView:Ye,targetRef:ot,scrollableRef:lt}=l6({duration:0,offset:5,cancelable:!1,isList:!0}),Me=ae===void 0?E:ae,$e=qe=>{if(Ue!==qe){wt(qe);const Nt=qe?re:K;typeof Nt=="function"&&Nt()}},At=U&&typeof Y=="function";let ke=null;const ze=i.map(qe=>typeof qe=="string"?{label:qe,value:qe}:qe),Le=QP({data:ze}),[We,ct,xn]=od({value:l,defaultValue:u,finalValue:null,onChange:p}),jt=Le.find(qe=>qe.value===We),[Pt,sr]=od({value:T,defaultValue:(jt==null?void 0:jt.label)||"",finalValue:void 0,onChange:R}),In=qe=>{sr(qe),M&&typeof R=="function"&&R(qe)},pn=()=>{var qe;Ce||(ct(null),xn||In(""),(qe=xe.current)==null||qe.focus())};d.useEffect(()=>{const qe=Le.find(Nt=>Nt.value===We);qe?In(qe.label):(!At||!We)&&In("")},[We]),d.useEffect(()=>{jt&&(!M||!Ue)&&In(jt.label)},[jt==null?void 0:jt.label]);const on=qe=>{if(!Ce)if(Me&&(jt==null?void 0:jt.value)===qe.value)ct(null),$e(!1);else{if(qe.creatable&&typeof q=="function"){const Nt=q(qe.value);typeof Nt<"u"&&Nt!==null&&ct(typeof Nt=="string"?Nt:Nt.value)}else ct(qe.value);xn||In(qe.label),tt(-1),$e(!1),xe.current.focus()}},Qt=$Q({data:Le,searchable:M,limit:D,searchValue:Pt,filter:j,filterDataOnExactSearchMatch:pe,value:We});At&&V(Pt,Qt)&&(ke=Y(Pt),Qt.push({label:Pt,value:Pt,creatable:!0}));const mr=(qe,Nt,En)=>{let xt=qe;for(;En(xt);)if(xt=Nt(xt),!Qt[xt].disabled)return xt;return qe};$o(()=>{tt(de&&Pt?0:-1)},[Pt,de]);const yo=We?Qt.findIndex(qe=>qe.value===We):0,ar=!Ce&&(Qt.length>0?Ue:Ue&&!!O),ir=()=>{tt(qe=>{var Nt;const En=mr(qe,xt=>xt-1,xt=>xt>0);return ot.current=Re.current[(Nt=Qt[En])==null?void 0:Nt.value],ar&&Ye({alignment:ve?"start":"end"}),En})},Is=()=>{tt(qe=>{var Nt;const En=mr(qe,xt=>xt+1,xt=>xt<Qt.length-1);return ot.current=Re.current[(Nt=Qt[En])==null?void 0:Nt.value],ar&&Ye({alignment:ve?"end":"start"}),En})},Es=()=>window.setTimeout(()=>{var qe;ot.current=Re.current[(qe=Qt[yo])==null?void 0:qe.value],Ye({alignment:ve?"end":"start"})},50);$o(()=>{ar&&Es()},[ar]);const pa=qe=>{switch(typeof m=="function"&&m(qe),qe.key){case"ArrowUp":{qe.preventDefault(),Ue?ve?ir():Is():(tt(yo),$e(!0),Es());break}case"ArrowDown":{qe.preventDefault(),Ue?ve?Is():ir():(tt(yo),$e(!0),Es());break}case"Home":{if(!M){qe.preventDefault(),Ue||$e(!0);const Nt=Qt.findIndex(En=>!En.disabled);tt(Nt),ar&&Ye({alignment:ve?"end":"start"})}break}case"End":{if(!M){qe.preventDefault(),Ue||$e(!0);const Nt=Qt.map(En=>!!En.disabled).lastIndexOf(!1);tt(Nt),ar&&Ye({alignment:ve?"end":"start"})}break}case"Escape":{qe.preventDefault(),$e(!1),tt(-1);break}case" ":{M||(qe.preventDefault(),Qt[Xe]&&Ue?on(Qt[Xe]):($e(!0),tt(yo),Es()));break}case"Enter":M||qe.preventDefault(),Qt[Xe]&&Ue&&(qe.preventDefault(),on(Qt[Xe]))}},ha=qe=>{typeof v=="function"&&v(qe);const Nt=Le.find(En=>En.value===We);L&&Qt[Xe]&&Ue&&on(Qt[Xe]),In((Nt==null?void 0:Nt.label)||""),$e(!1)},il=qe=>{typeof x=="function"&&x(qe),M&&$e(!0)},ma=qe=>{Ce||(In(qe.currentTarget.value),E&&qe.currentTarget.value===""&&ct(null),tt(-1),$e(!0))},ll=()=>{Ce||($e(!Ue),We&&!Ue&&tt(yo))};return H.createElement(Pc.Wrapper,_v(ku({},o),{__staticSelector:"Select"}),H.createElement(Ba,{opened:ar,transitionProps:y,shadow:s,withinPortal:Q,portalProps:le,__staticSelector:"Select",onDirectionChange:mt,switchDirectionOnFlip:se,zIndex:W,dropdownPosition:te,positionDependencies:[...ge,Pt],classNames:k,styles:_,unstyled:w,variant:r.variant},H.createElement(Ba.Target,null,H.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":ar?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":ar,onMouseLeave:()=>tt(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:G,value:We||"",form:fe,disabled:A}),H.createElement(Pc,ku(_v(ku(ku({autoComplete:"off",type:"search"},r),De),{ref:Ld(t,xe),onKeyDown:pa,__staticSelector:"Select",value:Pt,placeholder:oe,onChange:ma,"aria-autocomplete":"list","aria-controls":ar?`${r.id}-items`:null,"aria-activedescendant":Xe>=0?`${r.id}-${Xe}`:null,onMouseDown:ll,onBlur:ha,onFocus:il,readOnly:!M||Ce,disabled:A,"data-mantine-stop-propagation":ar,name:null,classNames:_v(ku({},k),{input:Be({[je.input]:!M},k==null?void 0:k.input)})}),dE({theme:rt,rightSection:X,rightSectionWidth:B,styles:_,size:r.size,shouldClear:E&&!!jt,onClear:pn,error:o.error,clearButtonProps:me,disabled:A,readOnly:Ce}))))),H.createElement(Ba.Dropdown,{component:z||Ym,maxHeight:I,direction:st,id:r.id,innerRef:lt,__staticSelector:"Select",classNames:k,styles:_},H.createElement(Gb,{data:Qt,hovered:Xe,classNames:k,styles:_,isItemSelected:qe=>qe===We,uuid:r.id,__staticSelector:"Select",onItemHover:tt,onItemSelect:on,itemsRefs:Re,itemComponent:h,size:r.size,nothingFound:O,creatable:At&&!!ke,createLabel:ke,"aria-label":o.label,unstyled:w,variant:r.variant}))))});ry.displayName="@mantine/core/Select";const Bd=()=>{const[e,t,n,r,o,s,i,l,u,p,h,m,v,x,y,b,w,k,_,j,I,M,E,O,D,A,R,T,X,B,U,Y,V,L,q,z,K,re,Q,le,se,W,G,te,ae,oe,pe,fe,ge,Ce,me,de,De,je,Be,rt,Ue,wt,Xe,tt,xe,Re,st,mt,ve,Ye,ot,lt,Me,$e,At,ke,ze,Le,We,ct]=ds("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:i,base400:l,base450:u,base500:p,base550:h,base600:m,base650:v,base700:x,base750:y,base800:b,base850:w,base900:k,base950:_,accent50:j,accent100:I,accent150:M,accent200:E,accent250:O,accent300:D,accent350:A,accent400:R,accent450:T,accent500:X,accent550:B,accent600:U,accent650:Y,accent700:V,accent750:L,accent800:q,accent850:z,accent900:K,accent950:re,baseAlpha50:Q,baseAlpha100:le,baseAlpha150:se,baseAlpha200:W,baseAlpha250:G,baseAlpha300:te,baseAlpha350:ae,baseAlpha400:oe,baseAlpha450:pe,baseAlpha500:fe,baseAlpha550:ge,baseAlpha600:Ce,baseAlpha650:me,baseAlpha700:de,baseAlpha750:De,baseAlpha800:je,baseAlpha850:Be,baseAlpha900:rt,baseAlpha950:Ue,accentAlpha50:wt,accentAlpha100:Xe,accentAlpha150:tt,accentAlpha200:xe,accentAlpha250:Re,accentAlpha300:st,accentAlpha350:mt,accentAlpha400:ve,accentAlpha450:Ye,accentAlpha500:ot,accentAlpha550:lt,accentAlpha600:Me,accentAlpha650:$e,accentAlpha700:At,accentAlpha750:ke,accentAlpha800:ze,accentAlpha850:Le,accentAlpha900:We,accentAlpha950:ct}},Ae=(e,t)=>n=>n==="light"?e:t,yE=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:l,base800:u,base900:p,accent200:h,accent300:m,accent400:v,accent500:x,accent600:y}=Bd(),{colorMode:b}=ia(),[w]=ds("shadows",["dark-lg"]),[k,_,j]=ds("space",[1,2,6]),[I]=ds("radii",["base"]),[M]=ds("lineHeights",["base"]);return d.useCallback(()=>({label:{color:Ae(l,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,l)(b)}},input:{border:"unset",backgroundColor:Ae(e,p)(b),borderRadius:I,borderStyle:"solid",borderWidth:"2px",borderColor:Ae(n,u)(b),color:Ae(p,t)(b),minHeight:"unset",lineHeight:M,height:"auto",paddingRight:0,paddingLeft:0,paddingInlineStart:_,paddingInlineEnd:j,paddingTop:k,paddingBottom:k,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(b)},"&:focus":{borderColor:Ae(m,y)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(h,y)(b)},"&[data-disabled]":{backgroundColor:Ae(r,l)(b),color:Ae(i,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,l)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,u)(b),borderColor:Ae(n,u)(b),boxShadow:w},item:{backgroundColor:Ae(n,u)(b),color:Ae(u,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)},"&[data-active]":{backgroundColor:Ae(r,l)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)}},"&[data-selected]":{backgroundColor:Ae(v,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,i)(b),cursor:"not-allowed"}},rightSection:{width:32,button:{color:Ae(p,t)(b)}}}),[h,m,v,x,y,t,n,r,o,e,s,i,l,u,p,w,b,M,I,k,_,j])},KQ=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,onChange:o,label:s,disabled:i,...l}=e,u=ee(),[p,h]=d.useState(""),m=d.useCallback(b=>{b.shiftKey&&u(Ir(!0))},[u]),v=d.useCallback(b=>{b.shiftKey||u(Ir(!1))},[u]),x=d.useCallback(b=>{o&&o(b)},[o]),y=yE();return a.jsx(Rt,{label:n,placement:"top",hasArrow:!0,children:a.jsx(ry,{ref:r,label:s?a.jsx(fn,{isDisabled:i,children:a.jsx(Gn,{children:s})}):void 0,disabled:i,searchValue:p,onSearchChange:h,onChange:x,onKeyDown:m,onKeyUp:v,searchable:t,maxDropdownHeight:300,styles:y,...l})})},Kt=d.memo(KQ),qQ=ie([be],({changeBoardModal:e})=>{const{isModalOpen:t,imagesToChange:n}=e;return{isModalOpen:t,imagesToChange:n}},we),XQ=()=>{const e=ee(),[t,n]=d.useState(),{data:r,isFetching:o}=um(),{imagesToChange:s,isModalOpen:i}=F(qQ),[l]=V7(),[u]=W7(),{t:p}=J(),h=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]),m=d.useCallback(()=>{e(TC()),e(Tx(!1))},[e]),v=d.useCallback(()=>{!s.length||!t||(t==="none"?u({imageDTOs:s}):l({imageDTOs:s,board_id:t}),n(null),e(TC()))},[l,e,s,u,t]),x=d.useRef(null);return a.jsx(Ad,{isOpen:i,onClose:m,leastDestructiveRef:x,isCentered:!0,children:a.jsx(Vo,{children:a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:p("boards.changeBoard")}),a.jsx(Wo,{children:a.jsxs($,{sx:{flexDir:"column",gap:4},children:[a.jsxs(ye,{children:["Moving ",`${s.length}`," image",`${s.length>1?"s":""}`," to board:"]}),a.jsx(Kt,{placeholder:p(o?"boards.loading":"boards.selectBoard"),disabled:o,onChange:y=>n(y),value:t,data:h})]})}),a.jsxs(gs,{children:[a.jsx(it,{ref:x,onClick:m,children:p("boards.cancel")}),a.jsx(it,{colorScheme:"accent",onClick:v,ml:3,children:p("boards.move")})]})]})})})},YQ=d.memo(XQ),QQ=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:i,helperText:l,...u}=e;return a.jsx(Rt,{label:i,hasArrow:!0,placement:"top",isDisabled:!i,children:a.jsx(fn,{isDisabled:n,width:r,alignItems:"center",...o,children:a.jsxs($,{sx:{flexDir:"column",w:"full"},children:[a.jsxs($,{sx:{alignItems:"center",w:"full"},children:[t&&a.jsx(Gn,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx,pe:4},...s,children:t}),a.jsx(zb,{...u})]}),l&&a.jsx(D5,{children:a.jsx(ye,{variant:"subtext",children:l})})]})})})},Gt=d.memo(QQ),ZQ=e=>{const{t}=J(),{imageUsage:n,topMessage:r=t("gallery.currentlyInUse"),bottomMessage:o=t("gallery.featuresWillReset")}=e;return!n||!Ro(n)?null:a.jsxs(a.Fragment,{children:[a.jsx(ye,{children:r}),a.jsxs(Id,{sx:{paddingInlineStart:6},children:[n.isInitialImage&&a.jsx(No,{children:t("common.img2img")}),n.isCanvasImage&&a.jsx(No,{children:t("common.unifiedCanvas")}),n.isControlNetImage&&a.jsx(No,{children:t("common.controlNet")}),n.isNodesImage&&a.jsx(No,{children:t("common.nodeEditor")})]}),a.jsx(ye,{children:o})]})},CE=d.memo(ZQ),JQ=ie([be,U7],(e,t)=>{const{system:n,config:r,deleteImageModal:o}=e,{shouldConfirmOnDelete:s}=n,{canRestoreDeletedImagesFromBin:i}=r,{imagesToDelete:l,isModalOpen:u}=o,p=(l??[]).map(({image_name:m})=>Dj(e,m)),h={isInitialImage:Ro(p,m=>m.isInitialImage),isCanvasImage:Ro(p,m=>m.isCanvasImage),isNodesImage:Ro(p,m=>m.isNodesImage),isControlNetImage:Ro(p,m=>m.isControlNetImage)};return{shouldConfirmOnDelete:s,canRestoreDeletedImagesFromBin:i,imagesToDelete:l,imagesUsage:t,isModalOpen:u,imageUsageSummary:h}},we),eZ=()=>{const e=ee(),{t}=J(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imagesToDelete:o,imagesUsage:s,isModalOpen:i,imageUsageSummary:l}=F(JQ),u=d.useCallback(v=>e(Rj(!v.target.checked)),[e]),p=d.useCallback(()=>{e($C()),e(G7(!1))},[e]),h=d.useCallback(()=>{!o.length||!s.length||(e($C()),e(K7({imageDTOs:o,imagesUsage:s})))},[e,o,s]),m=d.useRef(null);return a.jsx(Ad,{isOpen:i,onClose:p,leastDestructiveRef:m,isCentered:!0,children:a.jsx(Vo,{children:a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),a.jsx(Wo,{children:a.jsxs($,{direction:"column",gap:3,children:[a.jsx(CE,{imageUsage:l}),a.jsx(Br,{}),a.jsx(ye,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),a.jsx(ye,{children:t("common.areYouSure")}),a.jsx(Gt,{label:t("common.dontAskMeAgain"),isChecked:!n,onChange:u})]})}),a.jsxs(gs,{children:[a.jsx(it,{ref:m,onClick:p,children:"Cancel"}),a.jsx(it,{colorScheme:"error",onClick:h,ml:3,children:"Delete"})]})]})})})},tZ=d.memo(eZ),wE=Pe((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...i}=e;return a.jsx(Rt,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:a.jsx(ps,{ref:t,role:n,colorScheme:s?"accent":"base",...i})})});wE.displayName="IAIIconButton";const Te=d.memo(wE);var SE={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},kk=H.createContext&&H.createContext(SE),Ha=globalThis&&globalThis.__assign||function(){return Ha=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},Ha.apply(this,arguments)},nZ=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 kE(e){return e&&e.map(function(t,n){return H.createElement(t.tag,Ha({key:n},t.attr),kE(t.child))})}function Ne(e){return function(t){return H.createElement(rZ,Ha({attr:Ha({},e.attr)},t),kE(e.child))}}function rZ(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,i=nZ(e,["attr","size","title"]),l=o||n.size||"1em",u;return n.className&&(u=n.className),e.className&&(u=(u?u+" ":"")+e.className),H.createElement("svg",Ha({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,i,{className:u,style:Ha(Ha({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&H.createElement("title",null,s),e.children)};return kk!==void 0?H.createElement(kk.Consumer,null,function(n){return t(n)}):t(SE)}function oZ(e){return Ne({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 sZ(e){return Ne({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 aZ(e){return Ne({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 iZ(e){return Ne({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 lZ(e){return Ne({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 cZ(e){return Ne({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 uZ(e){return Ne({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 dZ(e){return Ne({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 _E(e){return Ne({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 fZ(e){return Ne({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 pZ(e){return Ne({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 jE(e){return Ne({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 hZ(e){return Ne({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 PE(e){return Ne({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 IE(e){return Ne({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 Hc(e){return Ne({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 mZ(e){return Ne({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 gZ(e){return Ne({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 Jm(e){return Ne({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 vZ(e){return Ne({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 xZ(e){return Ne({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 bZ(e){return Ne({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 yZ(e){return Ne({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 CZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function wZ(e){return Ne({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 EE(e){return Ne({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 SZ(e){return Ne({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 kZ(e){return Ne({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 _Z(e){return Ne({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 jZ(e){return Ne({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 ME(e){return Ne({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 PZ(e){return Ne({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 IZ(e){return Ne({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 Vi(e){return Ne({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 EZ(e){return Ne({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 OE(e){return Ne({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 MZ(e){return Ne({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 OZ(e){return Ne({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 DE(e){return Ne({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 RE(e){return Ne({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 DZ(e){return Ne({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 AE(e){return Ne({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 RZ(e){return Ne({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 AZ(e){return Ne({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 _k(e){return Ne({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 nl(e){return Ne({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 NE(e){return Ne({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 NZ(e){return Ne({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 TZ(e){return Ne({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 $Z(e){return Ne({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 eg(e){return Ne({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 LZ(e){return Ne({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 TE(e){return Ne({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 zZ(e){return Ne({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 FZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function jk(e){return Ne({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 $E(e){return Ne({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 BZ(e){return Ne({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 LE(e){return Ne({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 HZ(e){return Ne({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 Wr(e){return Ne({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 tg(e){return Ne({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 ng(e){return Ne({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 VZ(e){return Ne({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 zE(e){return Ne({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 Xt=e=>{const t=F(i=>i.config.disabledTabs),n=F(i=>i.config.disabledFeatures),r=F(i=>i.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 WZ(e){const{title:t,hotkey:n,description:r}=e;return a.jsxs(Ua,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs(Ua,{children:[a.jsx(ye,{fontWeight:600,children:t}),r&&a.jsx(ye,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),a.jsx(Ie,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function UZ({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Er(),{t:o}=J(),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"}],i=[{title:o("hotkeys.setPrompt.title"),desc:o("hotkeys.setPrompt.desc"),hotkey:"P"},{title:o("hotkeys.setSeed.title"),desc:o("hotkeys.setSeed.desc"),hotkey:"S"},{title:o("hotkeys.setParameters.title"),desc:o("hotkeys.setParameters.desc"),hotkey:"A"},{title:o("hotkeys.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"}],l=[{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"}],u=[{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"}],h=m=>a.jsx($,{flexDir:"column",gap:4,children:m.map((v,x)=>a.jsxs($,{flexDir:"column",px:2,gap:4,children:[a.jsx(WZ,{title:v.title,description:v.desc,hotkey:v.hotkey}),x<m.length-1&&a.jsx(Br,{})]},x))});return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:n}),a.jsxs(Fi,{isOpen:t,onClose:r,children:[a.jsx(Vo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{children:o("hotkeys.keyboardShortcuts")}),a.jsx(Td,{}),a.jsx(Wo,{children:a.jsx(M5,{allowMultiple:!0,children:a.jsxs($,{flexDir:"column",gap:2,children:[a.jsxs(Tl,{children:[a.jsx(Al,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.appHotkeys")}),a.jsx(Nl,{})]})}),a.jsx($l,{children:h(s)})]}),a.jsxs(Tl,{children:[a.jsx(Al,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.generalHotkeys")}),a.jsx(Nl,{})]})}),a.jsx($l,{children:h(i)})]}),a.jsxs(Tl,{children:[a.jsx(Al,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),a.jsx(Nl,{})]})}),a.jsx($l,{children:h(l)})]}),a.jsxs(Tl,{children:[a.jsx(Al,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),a.jsx(Nl,{})]})}),a.jsx($l,{children:h(u)})]}),a.jsxs(Tl,{children:[a.jsx(Al,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.nodesHotkeys")}),a.jsx(Nl,{})]})}),a.jsx($l,{children:h(p)})]})]})})}),a.jsx(gs,{})]})]})]})}function Pk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function Ik(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var GZ=function(e,t){return typeof t=="boolean"?t:!e},KZ=function(e){return d.useReducer(GZ,e)};const qZ=KZ;function XZ(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},[]),i=d.useCallback(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},t)},[t]),l=d.useCallback(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return d.useEffect(function(){o.current=e},[e]),d.useEffect(function(){return i(),l},[t]),[s,l,i]}function YZ(e,t,n){t===void 0&&(t=0),n===void 0&&(n=[]);var r=XZ(e,t),o=r[0],s=r[1],i=r[2];return d.useEffect(i,n),[o,s]}var QZ=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)},i=function(){return o(!1)};t&&e&&e.current&&(Pk(e.current,"mouseover",s),Pk(e.current,"mouseout",i));var l=e.current;return function(){t&&l&&(Ik(l,"mouseover",s),Ik(l,"mouseout",i))}},[t,e]),r};const FE=QZ,ZZ=({showVersion:e=!0})=>{const{data:t}=q7(),n=d.useRef(null),r=FE(n);return a.jsxs($,{alignItems:"center",gap:5,ps:1,ref:n,children:[a.jsx(Xi,{src:Aj,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),a.jsxs($,{sx:{gap:3,alignItems:"center"},children:[a.jsxs(ye,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",a.jsx("strong",{children:"ai"})]}),a.jsx(nr,{children:e&&r&&t&&a.jsx(vn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(ye,{sx:{fontWeight:600,marginTop:1,color:"base.300",fontSize:14},variant:"subtext",children:t.version})},"statusText")})]})]})},JZ=d.memo(ZZ),eJ=e=>{const{tooltip:t,inputRef:n,label:r,disabled:o,required:s,...i}=e,l=yE();return a.jsx(Rt,{label:t,placement:"top",hasArrow:!0,children:a.jsx(ry,{label:r?a.jsx(fn,{isRequired:s,isDisabled:o,children:a.jsx(Gn,{children:r})}):void 0,disabled:o,ref:n,styles:l,...i})})},$n=d.memo(eJ),tJ={ar:vt.t("common.langArabic",{lng:"ar"}),nl:vt.t("common.langDutch",{lng:"nl"}),en:vt.t("common.langEnglish",{lng:"en"}),fr:vt.t("common.langFrench",{lng:"fr"}),de:vt.t("common.langGerman",{lng:"de"}),he:vt.t("common.langHebrew",{lng:"he"}),it:vt.t("common.langItalian",{lng:"it"}),ja:vt.t("common.langJapanese",{lng:"ja"}),ko:vt.t("common.langKorean",{lng:"ko"}),pl:vt.t("common.langPolish",{lng:"pl"}),pt_BR:vt.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:vt.t("common.langPortuguese",{lng:"pt"}),ru:vt.t("common.langRussian",{lng:"ru"}),zh_CN:vt.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:vt.t("common.langSpanish",{lng:"es"}),uk:vt.t("common.langUkranian",{lng:"ua"})};function Io(e){const{t}=J(),{label:n,textProps:r,useBadge:o=!1,badgeLabel:s=t("settings.experimental"),badgeProps:i,...l}=e;return a.jsxs($,{justifyContent:"space-between",py:1,children:[a.jsxs($,{gap:2,alignItems:"center",children:[a.jsx(ye,{sx:{fontSize:14,_dark:{color:"base.300"}},...r,children:n}),o&&a.jsx(ua,{size:"xs",sx:{px:2,color:"base.700",bg:"accent.200",_dark:{bg:"accent.500",color:"base.200"}},...i,children:s})]}),a.jsx(Gt,{...l})]})}const nJ=e=>a.jsx($,{sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base",bg:"base.100",_dark:{bg:"base.900"}},children:e.children}),zl=d.memo(nJ);function rJ(){const e=ee(),{data:t,refetch:n}=X7(),[r,{isLoading:o}]=Y7(),s=d.useCallback(()=>{r().unwrap().then(l=>{e(Q7()),e(Nj()),e(Tt({title:`Cleared ${l} intermediates`,status:"info"}))})},[r,e]);d.useEffect(()=>{n()},[n]);const i=t?`Clear ${t} Intermediate${t>1?"s":""}`:"No Intermediates to Clear";return a.jsxs(zl,{children:[a.jsx(so,{size:"sm",children:"Clear Intermediates"}),a.jsx(it,{colorScheme:"warning",onClick:s,isLoading:o,isDisabled:!t,children:i}),a.jsx(ye,{fontWeight:"bold",children:"Clearing intermediates will reset your Canvas and ControlNet state."}),a.jsx(ye,{variant:"subtext",children:"Intermediate images are byproducts of generation, different from the result images in the gallery. Clearing intermediates will free disk space."}),a.jsx(ye,{variant:"subtext",children:"Your gallery images will not be deleted."})]})}const oJ=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:l,base800:u,base900:p,accent200:h,accent300:m,accent400:v,accent500:x,accent600:y}=Bd(),{colorMode:b}=ia(),[w]=ds("shadows",["dark-lg"]);return d.useCallback(()=>({label:{color:Ae(l,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,l)(b)}},searchInput:{":placeholder":{color:Ae(r,l)(b)}},input:{backgroundColor:Ae(e,p)(b),borderWidth:"2px",borderColor:Ae(n,u)(b),color:Ae(p,t)(b),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(b)},"&:focus":{borderColor:Ae(m,y)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(h,y)(b)},"&[data-disabled]":{backgroundColor:Ae(r,l)(b),color:Ae(i,o)(b),cursor:"not-allowed"}},value:{backgroundColor:Ae(n,u)(b),color:Ae(p,t)(b),button:{color:Ae(p,t)(b)},"&:hover":{backgroundColor:Ae(r,l)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,u)(b),borderColor:Ae(n,u)(b),boxShadow:w},item:{backgroundColor:Ae(n,u)(b),color:Ae(u,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)},"&[data-active]":{backgroundColor:Ae(r,l)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)}},"&[data-selected]":{backgroundColor:Ae(v,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,i)(b),cursor:"not-allowed"}},rightSection:{width:24,padding:20,button:{color:Ae(p,t)(b)}}}),[h,m,v,x,y,t,n,r,o,e,s,i,l,u,p,w,b])},sJ=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,label:o,disabled:s,...i}=e,l=ee(),u=d.useCallback(m=>{m.shiftKey&&l(Ir(!0))},[l]),p=d.useCallback(m=>{m.shiftKey||l(Ir(!1))},[l]),h=oJ();return a.jsx(Rt,{label:n,placement:"top",hasArrow:!0,isOpen:!0,children:a.jsx(hE,{label:o?a.jsx(fn,{isDisabled:s,children:a.jsx(Gn,{children:o})}):void 0,ref:r,disabled:s,onKeyDown:u,onKeyUp:p,searchable:t,maxDropdownHeight:300,styles:h,...i})})},aJ=d.memo(sJ),iJ=rr(dm,(e,t)=>({value:t,label:e})).sort((e,t)=>e.label.localeCompare(t.label));function lJ(){const e=ee(),{t}=J(),n=F(o=>o.ui.favoriteSchedulers),r=d.useCallback(o=>{e(Z7(o))},[e]);return a.jsx(aJ,{label:t("settings.favoriteSchedulers"),value:n,data:iJ,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const cJ=ie([be],({system:e,ui:t,generation:n})=>{const{shouldConfirmOnDelete:r,enableImageDebugging:o,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:l,shouldUseNSFWChecker:u,shouldUseWatermarker:p}=e,{shouldUseSliders:h,shouldShowProgressInViewer:m,shouldAutoChangeDimensions:v}=t,{shouldShowAdvancedOptions:x}=n;return{shouldConfirmOnDelete:r,enableImageDebugging:o,shouldUseSliders:h,shouldShowProgressInViewer:m,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:l,shouldShowAdvancedOptions:x,shouldUseNSFWChecker:u,shouldUseWatermarker:p,shouldAutoChangeDimensions:v}},{memoizeOptions:{resultEqualityCheck:_t}}),uJ=({children:e,config:t})=>{const n=ee(),{t:r}=J(),[o,s]=d.useState(3),i=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,l=(t==null?void 0:t.shouldShowResetWebUiText)??!0,u=(t==null?void 0:t.shouldShowAdvancedOptionsSettings)??!0,p=(t==null?void 0:t.shouldShowClearIntermediates)??!0,h=(t==null?void 0:t.shouldShowLocalizationToggle)??!0;d.useEffect(()=>{i||n(LC(!1))},[i,n]);const{isNSFWCheckerAvailable:m,isWatermarkerAvailable:v}=Tj(void 0,{selectFromResult:({data:Q})=>({isNSFWCheckerAvailable:(Q==null?void 0:Q.nsfw_methods.includes("nsfw_checker"))??!1,isWatermarkerAvailable:(Q==null?void 0:Q.watermarking_methods.includes("invisible_watermark"))??!1})}),{isOpen:x,onOpen:y,onClose:b}=Er(),{isOpen:w,onOpen:k,onClose:_}=Er(),{shouldConfirmOnDelete:j,enableImageDebugging:I,shouldUseSliders:M,shouldShowProgressInViewer:E,consoleLogLevel:O,shouldLogToConsole:D,shouldAntialiasProgressImage:A,shouldShowAdvancedOptions:R,shouldUseNSFWChecker:T,shouldUseWatermarker:X,shouldAutoChangeDimensions:B}=F(cJ),U=d.useCallback(()=>{Object.keys(window.localStorage).forEach(Q=>{(J7.includes(Q)||Q.startsWith(eD))&&localStorage.removeItem(Q)}),b(),k(),setInterval(()=>s(Q=>Q-1),1e3)},[b,k]);d.useEffect(()=>{o<=0&&window.location.reload()},[o]);const Y=d.useCallback(Q=>{n(tD(Q))},[n]),V=d.useCallback(Q=>{n(nD(Q))},[n]),L=d.useCallback(Q=>{n(LC(Q.target.checked))},[n]),{colorMode:q,toggleColorMode:z}=ia(),K=Xt("localization").isFeatureEnabled,re=F(RP);return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:y}),a.jsxs(Fi,{isOpen:x,onClose:b,size:"2xl",isCentered:!0,children:[a.jsx(Vo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{bg:"none",children:r("common.settingsLabel")}),a.jsx(Td,{}),a.jsx(Wo,{children:a.jsxs($,{sx:{gap:4,flexDirection:"column"},children:[a.jsxs(zl,{children:[a.jsx(so,{size:"sm",children:r("settings.general")}),a.jsx(Io,{label:r("settings.confirmOnDelete"),isChecked:j,onChange:Q=>n(Rj(Q.target.checked))}),u&&a.jsx(Io,{label:r("settings.showAdvancedOptions"),isChecked:R,onChange:Q=>n(rD(Q.target.checked))})]}),a.jsxs(zl,{children:[a.jsx(so,{size:"sm",children:r("settings.generation")}),a.jsx(lJ,{}),a.jsx(Io,{label:"Enable NSFW Checker",isDisabled:!m,isChecked:T,onChange:Q=>n(oD(Q.target.checked))}),a.jsx(Io,{label:"Enable Invisible Watermark",isDisabled:!v,isChecked:X,onChange:Q=>n(sD(Q.target.checked))})]}),a.jsxs(zl,{children:[a.jsx(so,{size:"sm",children:r("settings.ui")}),a.jsx(Io,{label:r("common.darkMode"),isChecked:q==="dark",onChange:z}),a.jsx(Io,{label:r("settings.useSlidersForAll"),isChecked:M,onChange:Q=>n(aD(Q.target.checked))}),a.jsx(Io,{label:r("settings.showProgressInViewer"),isChecked:E,onChange:Q=>n($j(Q.target.checked))}),a.jsx(Io,{label:r("settings.antialiasProgressImages"),isChecked:A,onChange:Q=>n(iD(Q.target.checked))}),a.jsx(Io,{label:r("settings.autoChangeDimensions"),isChecked:B,onChange:Q=>n(lD(Q.target.checked))}),h&&a.jsx($n,{disabled:!K,label:r("common.languagePickerLabel"),value:re,data:Object.entries(tJ).map(([Q,le])=>({value:Q,label:le})),onChange:V})]}),i&&a.jsxs(zl,{children:[a.jsx(so,{size:"sm",children:r("settings.developer")}),a.jsx(Io,{label:r("settings.shouldLogToConsole"),isChecked:D,onChange:L}),a.jsx($n,{disabled:!D,label:r("settings.consoleLogLevel"),onChange:Y,value:O,data:cD.concat()}),a.jsx(Io,{label:r("settings.enableImageDebugging"),isChecked:I,onChange:Q=>n(uD(Q.target.checked))})]}),p&&a.jsx(rJ,{}),a.jsxs(zl,{children:[a.jsx(so,{size:"sm",children:r("settings.resetWebUI")}),a.jsx(it,{colorScheme:"error",onClick:U,children:r("settings.resetWebUI")}),l&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{variant:"subtext",children:r("settings.resetWebUIDesc1")}),a.jsx(ye,{variant:"subtext",children:r("settings.resetWebUIDesc2")})]})]})]})}),a.jsx(gs,{children:a.jsx(it,{onClick:b,children:r("common.close")})})]})]}),a.jsxs(Fi,{closeOnOverlayClick:!1,isOpen:w,onClose:_,isCentered:!0,closeOnEsc:!1,children:[a.jsx(Vo,{backdropFilter:"blur(40px)"}),a.jsxs(Bi,{children:[a.jsx(Ho,{}),a.jsx(Wo,{children:a.jsx($,{justifyContent:"center",children:a.jsx(ye,{fontSize:"lg",children:a.jsxs(ye,{children:[r("settings.resetComplete")," Reloading in ",o,"..."]})})})}),a.jsx(gs,{})]})]})]})},dJ=d.memo(uJ),fJ=ie(vo,e=>{const{isConnected:t,isProcessing:n,statusTranslationKey:r,currentIteration:o,totalIterations:s,currentStatusHasSteps:i}=e;return{isConnected:t,isProcessing:n,currentIteration:o,totalIterations:s,statusTranslationKey:r,currentStatusHasSteps:i}},we),Ek={ok:"green.400",working:"yellow.400",error:"red.400"},Mk={ok:"green.600",working:"yellow.500",error:"red.500"},pJ=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,statusTranslationKey:o}=F(fJ),{t:s}=J(),i=d.useRef(null),l=d.useMemo(()=>t?"working":e?"ok":"error",[t,e]),u=d.useMemo(()=>{if(n&&r)return` (${n}/${r})`},[n,r]),p=FE(i);return a.jsxs($,{ref:i,h:"full",px:2,alignItems:"center",gap:5,children:[a.jsx(nr,{children:p&&a.jsx(vn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsxs(ye,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:Mk[l],_dark:{color:Ek[l]}},children:[s(o),u]})},"statusText")}),a.jsx(An,{as:hZ,sx:{boxSize:"0.5rem",color:Mk[l],_dark:{color:Ek[l]}}})]})},hJ=d.memo(pJ),mJ=()=>{const{t:e}=J(),t=Xt("bugLink").isFeatureEnabled,n=Xt("discordLink").isFeatureEnabled,r=Xt("githubLink").isFeatureEnabled,o="http://github.com/invoke-ai/InvokeAI",s="https://discord.gg/ZmtBAhwWhy";return a.jsxs($,{sx:{gap:2,alignItems:"center"},children:[a.jsx(JZ,{}),a.jsx(Za,{}),a.jsx(hJ,{}),a.jsxs(Dd,{children:[a.jsx(Rd,{as:Te,variant:"link","aria-label":e("accessibility.menu"),icon:a.jsx(fZ,{}),sx:{boxSize:8}}),a.jsxs(Ga,{motionProps:gc,children:[a.jsxs(wc,{title:e("common.communityLabel"),children:[r&&a.jsx(Vt,{as:"a",href:o,target:"_blank",icon:a.jsx(sZ,{}),children:e("common.githubLabel")}),t&&a.jsx(Vt,{as:"a",href:`${o}/issues`,target:"_blank",icon:a.jsx(pZ,{}),children:e("common.reportBugLabel")}),n&&a.jsx(Vt,{as:"a",href:s,target:"_blank",icon:a.jsx(oZ,{}),children:e("common.discordLabel")})]}),a.jsxs(wc,{title:e("common.settingsLabel"),children:[a.jsx(UZ,{children:a.jsx(Vt,{as:"button",icon:a.jsx(MZ,{}),children:e("common.hotkeysLabel")})}),a.jsx(dJ,{children:a.jsx(Vt,{as:"button",icon:a.jsx(IE,{}),children:e("common.settingsLabel")})})]})]})]})]})},gJ=d.memo(mJ),vJ=ie(vo,e=>{const{isUploading:t}=e;let n="";return t&&(n="Uploading..."),{tooltip:n,shouldShow:t}}),xJ=()=>{const{shouldShow:e,tooltip:t}=F(vJ);return e?a.jsx($,{sx:{alignItems:"center",justifyContent:"center",color:"base.600"},children:a.jsx(Rt,{label:t,placement:"right",hasArrow:!0,children:a.jsx(Ki,{})})}):null},bJ=d.memo(xJ);/*!
|
||
* OverlayScrollbars
|
||
* Version: 2.2.1
|
||
*
|
||
* Copyright (c) Rene Haas | KingSora.
|
||
* https://github.com/KingSora
|
||
*
|
||
* Released under the MIT license.
|
||
*/function Dt(e,t){if(og(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Dt(Object.keys(e),n=>t(e[n],n,e));return e}function er(e,t){const n=ni(t);if(Ko(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?Ak(e,s,t):t.reduce((i,l)=>(i[l]=Ak(e,s,l),i),o)}return o}e&&Dt(Vr(t),o=>NJ(e,o,t[o]))}const Oo=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,i;const l=(h,m)=>{const v=s,x=h,y=m||(r?!r(v,x):v!==x);return(y||o)&&(s=x,i=v),[s,y,i]};return[t?h=>l(t(s,i),h):l,h=>[s,!!h,i]]},Hd=()=>typeof window<"u",BE=Hd()&&Node.ELEMENT_NODE,{toString:yJ,hasOwnProperty:jv}=Object.prototype,fa=e=>e===void 0,rg=e=>e===null,CJ=e=>fa(e)||rg(e)?`${e}`:yJ.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Va=e=>typeof e=="number",ni=e=>typeof e=="string",oy=e=>typeof e=="boolean",Go=e=>typeof e=="function",Ko=e=>Array.isArray(e),ad=e=>typeof e=="object"&&!Ko(e)&&!rg(e),og=e=>{const t=!!e&&e.length,n=Va(t)&&t>-1&&t%1==0;return Ko(e)||!Go(e)&&n?t>0&&ad(e)?t-1 in e:!0:!1},tx=e=>{if(!e||!ad(e)||CJ(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=jv.call(e,n),i=o&&jv.call(o,"isPrototypeOf");if(r&&!s&&!i)return!1;for(t in e);return fa(t)||jv.call(e,t)},Kh=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===BE:!1},sg=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===BE:!1},sy=(e,t,n)=>e.indexOf(t,n),zt=(e,t,n)=>(!n&&!ni(t)&&og(t)?Array.prototype.push.apply(e,t):e.push(t),e),Wi=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{zt(n,r)}):Dt(e,r=>{zt(n,r)}),n)},ay=e=>!!e&&e.length===0,js=(e,t,n)=>{Dt(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},ag=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Vr=e=>e?Object.keys(e):[],un=(e,t,n,r,o,s,i)=>{const l=[t,n,r,o,s,i];return(typeof e!="object"||rg(e))&&!Go(e)&&(e={}),Dt(l,u=>{Dt(Vr(u),p=>{const h=u[p];if(e===h)return!0;const m=Ko(h);if(h&&(tx(h)||m)){const v=e[p];let x=v;m&&!Ko(v)?x=[]:!m&&!tx(v)&&(x={}),e[p]=un(x,h)}else e[p]=h})}),e},iy=e=>{for(const t in e)return!1;return!0},HE=(e,t,n,r)=>{if(fa(r))return n?n[e]:t;n&&(ni(r)||Va(r))&&(n[e]=r)},Jn=(e,t,n)=>{if(fa(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},Cr=(e,t)=>{e&&e.removeAttribute(t)},Ii=(e,t,n,r)=>{if(n){const o=Jn(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const i=Wi(s).join(" ").trim();Jn(e,t,i)}},wJ=(e,t,n)=>{const r=Jn(e,t)||"";return new Set(r.split(" ")).has(n)},zo=(e,t)=>HE("scrollLeft",0,e,t),Zs=(e,t)=>HE("scrollTop",0,e,t),nx=Hd()&&Element.prototype,VE=(e,t)=>{const n=[],r=t?sg(t)?t:null:document;return r?zt(n,r.querySelectorAll(e)):n},SJ=(e,t)=>{const n=t?sg(t)?t:null:document;return n?n.querySelector(e):null},qh=(e,t)=>sg(e)?(nx.matches||nx.msMatchesSelector).call(e,t):!1,ly=e=>e?Wi(e.childNodes):[],ra=e=>e?e.parentElement:null,Gl=(e,t)=>{if(sg(e)){const n=nx.closest;if(n)return n.call(e,t);do{if(qh(e,t))return e;e=ra(e)}while(e)}return null},kJ=(e,t,n)=>{const r=e&&Gl(e,t),o=e&&SJ(n,r),s=Gl(o,t)===r;return r&&o?r===e||o===e||s&&Gl(Gl(e,n),t)!==r:!1},cy=(e,t,n)=>{if(n&&e){let r=t,o;og(n)?(o=document.createDocumentFragment(),Dt(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)}},lo=(e,t)=>{cy(e,null,t)},_J=(e,t)=>{cy(ra(e),e,t)},Ok=(e,t)=>{cy(ra(e),e&&e.nextSibling,t)},xs=e=>{if(og(e))Dt(Wi(e),t=>xs(t));else if(e){const t=ra(e);t&&t.removeChild(e)}},Ei=e=>{const t=document.createElement("div");return e&&Jn(t,"class",e),t},WE=e=>{const t=Ei();return t.innerHTML=e.trim(),Dt(ly(t),n=>xs(n))},rx=e=>e.charAt(0).toUpperCase()+e.slice(1),jJ=()=>Ei().style,PJ=["-webkit-","-moz-","-o-","-ms-"],IJ=["WebKit","Moz","O","MS","webkit","moz","o","ms"],Pv={},Iv={},EJ=e=>{let t=Iv[e];if(ag(Iv,e))return t;const n=rx(e),r=jJ();return Dt(PJ,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,rx(s)+n].find(l=>r[l]!==void 0))}),Iv[e]=t||""},Vd=e=>{if(Hd()){let t=Pv[e]||window[e];return ag(Pv,e)||(Dt(IJ,n=>(t=t||window[n+rx(e)],!t)),Pv[e]=t),t}},MJ=Vd("MutationObserver"),Dk=Vd("IntersectionObserver"),Kl=Vd("ResizeObserver"),UE=Vd("cancelAnimationFrame"),GE=Vd("requestAnimationFrame"),Xh=Hd()&&window.setTimeout,ox=Hd()&&window.clearTimeout,OJ=/[^\x20\t\r\n\f]+/g,KE=(e,t,n)=>{const r=e&&e.classList;let o,s=0,i=!1;if(r&&t&&ni(t)){const l=t.match(OJ)||[];for(i=l.length>0;o=l[s++];)i=!!n(r,o)&&i}return i},uy=(e,t)=>{KE(e,t,(n,r)=>n.remove(r))},Js=(e,t)=>(KE(e,t,(n,r)=>n.add(r)),uy.bind(0,e,t)),ig=(e,t,n,r)=>{if(e&&t){let o=!0;return Dt(n,s=>{const i=r?r(e[s]):e[s],l=r?r(t[s]):t[s];i!==l&&(o=!1)}),o}return!1},qE=(e,t)=>ig(e,t,["w","h"]),XE=(e,t)=>ig(e,t,["x","y"]),DJ=(e,t)=>ig(e,t,["t","r","b","l"]),Rk=(e,t,n)=>ig(e,t,["width","height"],n&&(r=>Math.round(r))),ao=()=>{},Fl=e=>{let t;const n=e?Xh:GE,r=e?ox:UE;return[o=>{r(t),t=n(o,Go(e)?e():e)},()=>r(t)]},dy=(e,t)=>{let n,r,o,s=ao;const{v:i,g:l,p:u}=t||{},p=function(y){s(),ox(n),n=r=void 0,s=ao,e.apply(this,y)},h=x=>u&&r?u(r,x):x,m=()=>{s!==ao&&p(h(o)||o)},v=function(){const y=Wi(arguments),b=Go(i)?i():i;if(Va(b)&&b>=0){const k=Go(l)?l():l,_=Va(k)&&k>=0,j=b>0?Xh:GE,I=b>0?ox:UE,E=h(y)||y,O=p.bind(0,E);s();const D=j(O,b);s=()=>I(D),_&&!n&&(n=Xh(m,k)),r=o=E}else p(y)};return v.m=m,v},RJ={opacity:1,zindex:1},hp=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},AJ=(e,t)=>!RJ[e.toLowerCase()]&&Va(t)?`${t}px`:t,Ak=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],NJ=(e,t,n)=>{try{const{style:r}=e;fa(r[t])?r.setProperty(t,n):r[t]=AJ(t,n)}catch{}},id=e=>er(e,"direction")==="rtl",Nk=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,i=`${r}right${o}`,l=`${r}bottom${o}`,u=`${r}left${o}`,p=er(e,[s,i,l,u]);return{t:hp(p[s],!0),r:hp(p[i],!0),b:hp(p[l],!0),l:hp(p[u],!0)}},{round:Tk}=Math,fy={w:0,h:0},ld=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:fy,Lp=e=>e?{w:e.clientWidth,h:e.clientHeight}:fy,Yh=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:fy,Qh=e=>{const t=parseFloat(er(e,"height"))||0,n=parseFloat(er(e,"width"))||0;return{w:n-Tk(n),h:t-Tk(t)}},fs=e=>e.getBoundingClientRect();let mp;const TJ=()=>{if(fa(mp)){mp=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){mp=!0}}))}catch{}}return mp},YE=e=>e.split(" "),$J=(e,t,n,r)=>{Dt(YE(t),o=>{e.removeEventListener(o,n,r)})},Nn=(e,t,n,r)=>{var o;const s=TJ(),i=(o=s&&r&&r.S)!=null?o:s,l=r&&r.$||!1,u=r&&r.C||!1,p=[],h=s?{passive:i,capture:l}:l;return Dt(YE(t),m=>{const v=u?x=>{e.removeEventListener(m,v,l),n&&n(x)}:n;zt(p,$J.bind(null,e,m,v,l)),e.addEventListener(m,v,h)}),js.bind(0,p)},QE=e=>e.stopPropagation(),ZE=e=>e.preventDefault(),LJ={x:0,y:0},Ev=e=>{const t=e?fs(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:LJ},$k=(e,t)=>{Dt(Ko(t)?t:[t],e)},py=e=>{const t=new Map,n=(s,i)=>{if(s){const l=t.get(s);$k(u=>{l&&l[u?"delete":"clear"](u)},i)}else t.forEach(l=>{l.clear()}),t.clear()},r=(s,i)=>{if(ni(s)){const p=t.get(s)||new Set;return t.set(s,p),$k(h=>{Go(h)&&p.add(h)},i),n.bind(0,s,i)}oy(i)&&i&&n();const l=Vr(s),u=[];return Dt(l,p=>{const h=s[p];h&&zt(u,r(p,h))}),js.bind(0,u)},o=(s,i)=>{const l=t.get(s);Dt(Wi(l),u=>{i&&!ay(i)?u.apply(0,i):u()})};return r(e||{}),[r,n,o]},Lk=e=>JSON.stringify(e,(t,n)=>{if(Go(n))throw new Error;return n}),zJ={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"]}},JE=(e,t)=>{const n={},r=Vr(t).concat(Vr(e));return Dt(r,o=>{const s=e[o],i=t[o];if(ad(s)&&ad(i))un(n[o]={},JE(s,i)),iy(n[o])&&delete n[o];else if(ag(t,o)&&i!==s){let l=!0;if(Ko(s)||Ko(i))try{Lk(s)===Lk(i)&&(l=!1)}catch{}l&&(n[o]=i)}}),n},eM="os-environment",tM=`${eM}-flexbox-glue`,FJ=`${tM}-max`,nM="os-scrollbar-hidden",Mv="data-overlayscrollbars-initialize",Do="data-overlayscrollbars",rM=`${Do}-overflow-x`,oM=`${Do}-overflow-y`,ic="overflowVisible",BJ="scrollbarHidden",zk="scrollbarPressed",Zh="updating",Ma="data-overlayscrollbars-viewport",Ov="arrange",sM="scrollbarHidden",lc=ic,sx="data-overlayscrollbars-padding",HJ=lc,Fk="data-overlayscrollbars-content",hy="os-size-observer",VJ=`${hy}-appear`,WJ=`${hy}-listener`,UJ="os-trinsic-observer",GJ="os-no-css-vars",KJ="os-theme-none",Or="os-scrollbar",qJ=`${Or}-rtl`,XJ=`${Or}-horizontal`,YJ=`${Or}-vertical`,aM=`${Or}-track`,my=`${Or}-handle`,QJ=`${Or}-visible`,ZJ=`${Or}-cornerless`,Bk=`${Or}-transitionless`,Hk=`${Or}-interaction`,Vk=`${Or}-unusable`,Wk=`${Or}-auto-hidden`,Uk=`${Or}-wheel`,JJ=`${aM}-interactive`,eee=`${my}-interactive`,iM={},Ui=()=>iM,tee=e=>{const t=[];return Dt(Ko(e)?e:[e],n=>{const r=Vr(n);Dt(r,o=>{zt(t,iM[o]=n[o])})}),t},nee="__osOptionsValidationPlugin",ree="__osSizeObserverPlugin",gy="__osScrollbarsHidingPlugin",oee="__osClickScrollPlugin";let Dv;const Gk=(e,t,n,r)=>{lo(e,t);const o=Lp(t),s=ld(t),i=Qh(n);return r&&xs(t),{x:s.h-o.h+i.h,y:s.w-o.w+i.w}},see=e=>{let t=!1;const n=Js(e,nM);try{t=er(e,EJ("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},aee=(e,t)=>{const n="hidden";er(e,{overflowX:n,overflowY:n,direction:"rtl"}),zo(e,0);const r=Ev(e),o=Ev(t);zo(e,-999);const s=Ev(t);return{i:r.x===o.x,n:o.x!==s.x}},iee=(e,t)=>{const n=Js(e,tM),r=fs(e),o=fs(t),s=Rk(o,r,!0),i=Js(e,FJ),l=fs(e),u=fs(t),p=Rk(u,l,!0);return n(),i(),s&&p},lee=()=>{const{body:e}=document,n=WE(`<div class="${eM}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=py(),[i,l]=Oo({o:Gk(e,n,r),u:XE},Gk.bind(0,e,n,r,!0)),[u]=l(),p=see(n),h={x:u.x===0,y:u.y===0},m={elements:{host:null,padding:!p,viewport:_=>p&&_===_.ownerDocument.body&&_,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},v=un({},zJ),x=un.bind(0,{},v),y=un.bind(0,{},m),b={k:u,A:h,I:p,L:er(n,"zIndex")==="-1",B:aee(n,r),V:iee(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:y,q:_=>un(m,_)&&y(),F:x,G:_=>un(v,_)&&x(),X:un({},m),U:un({},v)},w=window.addEventListener,k=dy(_=>s(_?"z":"r"),{v:33,g:99});if(Cr(n,"style"),xs(n),w("resize",k.bind(0,!1)),!p&&(!h.x||!h.y)){let _;w("resize",()=>{const j=Ui()[gy];_=_||j&&j.R(),_&&_(b,i,k.bind(0,!0))})}return b},Dr=()=>(Dv||(Dv=lee()),Dv),vy=(e,t)=>Go(t)?t.apply(0,e):t,cee=(e,t,n,r)=>{const o=fa(r)?n:r;return vy(e,o)||t.apply(0,e)},lM=(e,t,n,r)=>{const o=fa(r)?n:r,s=vy(e,o);return!!s&&(Kh(s)?s:t.apply(0,e))},uee=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:i}=Dr(),{nativeScrollbarsOverlaid:l,body:u}=t,p=r??l,h=fa(o)?u:o,m=(s.x||s.y)&&p,v=e&&(rg(h)?!i:h);return!!m||!!v},xy=new WeakMap,dee=(e,t)=>{xy.set(e,t)},fee=e=>{xy.delete(e)},cM=e=>xy.get(e),Kk=(e,t)=>e?t.split(".").reduce((n,r)=>n&&ag(n,r)?n[r]:void 0,e):void 0,ax=(e,t,n)=>r=>[Kk(e,r),n||Kk(t,r)!==void 0],uM=e=>{let t=e;return[()=>t,n=>{t=un({},t,n)}]},gp="tabindex",vp=Ei.bind(0,""),Rv=e=>{lo(ra(e),ly(e)),xs(e)},pee=e=>{const t=Dr(),{N:n,I:r}=t,o=Ui()[gy],s=o&&o.T,{elements:i}=n(),{host:l,padding:u,viewport:p,content:h}=i,m=Kh(e),v=m?{}:e,{elements:x}=v,{host:y,padding:b,viewport:w,content:k}=x||{},_=m?e:v.target,j=qh(_,"textarea"),I=_.ownerDocument,M=I.documentElement,E=_===I.body,O=I.defaultView,D=cee.bind(0,[_]),A=lM.bind(0,[_]),R=vy.bind(0,[_]),T=D.bind(0,vp,p),X=A.bind(0,vp,h),B=T(w),U=B===_,Y=U&&E,V=!U&&X(k),L=!U&&Kh(B)&&B===V,q=L&&!!R(h),z=q?T():B,K=q?V:X(),Q=Y?M:L?z:B,le=j?D(vp,l,y):_,se=Y?Q:le,W=L?K:V,G=I.activeElement,te=!U&&O.top===O&&G===_,ae={W:_,Z:se,J:Q,K:!U&&A(vp,u,b),tt:W,nt:!U&&!r&&s&&s(t),ot:Y?M:Q,st:Y?I:Q,et:O,ct:I,rt:j,it:E,lt:m,ut:U,dt:L,ft:(Xe,tt)=>wJ(Q,U?Do:Ma,U?tt:Xe),_t:(Xe,tt,xe)=>Ii(Q,U?Do:Ma,U?tt:Xe,xe)},oe=Vr(ae).reduce((Xe,tt)=>{const xe=ae[tt];return zt(Xe,xe&&!ra(xe)?xe:!1)},[]),pe=Xe=>Xe?sy(oe,Xe)>-1:null,{W:fe,Z:ge,K:Ce,J:me,tt:de,nt:De}=ae,je=[()=>{Cr(ge,Do),Cr(ge,Mv),Cr(fe,Mv),E&&(Cr(M,Do),Cr(M,Mv))}],Be=j&&pe(ge);let rt=j?fe:ly([de,me,Ce,ge,fe].find(Xe=>pe(Xe)===!1));const Ue=Y?fe:de||me;return[ae,()=>{Jn(ge,Do,U?"viewport":"host"),Jn(Ce,sx,""),Jn(de,Fk,""),U||Jn(me,Ma,"");const Xe=E&&!U?Js(ra(_),nM):ao;if(Be&&(Ok(fe,ge),zt(je,()=>{Ok(ge,fe),xs(ge)})),lo(Ue,rt),lo(ge,Ce),lo(Ce||ge,!U&&me),lo(me,de),zt(je,()=>{Xe(),Cr(Ce,sx),Cr(de,Fk),Cr(me,rM),Cr(me,oM),Cr(me,Ma),pe(de)&&Rv(de),pe(me)&&Rv(me),pe(Ce)&&Rv(Ce)}),r&&!U&&(Ii(me,Ma,sM,!0),zt(je,Cr.bind(0,me,Ma))),De&&(_J(me,De),zt(je,xs.bind(0,De))),te){const tt=Jn(me,gp);Jn(me,gp,"-1"),me.focus();const xe=()=>tt?Jn(me,gp,tt):Cr(me,gp),Re=Nn(I,"pointerdown keydown",()=>{xe(),Re()});zt(je,[xe,Re])}else G&&G.focus&&G.focus();rt=0},js.bind(0,je)]},hee=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=Dr(),{ht:i}=r(),{vt:l}=o,u=(n||!s)&&l;return u&&er(n,{height:i?"":"100%"}),{gt:u,wt:u}}},mee=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,ut:l}=e,[u,p]=Oo({u:DJ,o:Nk()},Nk.bind(0,o,"padding",""));return(h,m,v)=>{let[x,y]=p(v);const{I:b,V:w}=Dr(),{bt:k}=n(),{gt:_,wt:j,yt:I}=h,[M,E]=m("paddingAbsolute");(_||y||!w&&j)&&([x,y]=u(v));const D=!l&&(E||I||y);if(D){const A=!M||!s&&!b,R=x.r+x.l,T=x.t+x.b,X={marginRight:A&&!k?-R:0,marginBottom:A?-T:0,marginLeft:A&&k?-R:0,top:A?-x.t:0,right:A?k?-x.r:"auto":0,left:A?k?"auto":-x.l:0,width:A?`calc(100% + ${R}px)`:""},B={paddingTop:A?x.t:0,paddingRight:A?x.r:0,paddingBottom:A?x.b:0,paddingLeft:A?x.l:0};er(s||i,X),er(i,B),r({K:x,St:!A,P:s?B:un({},X,B)})}return{xt:D}}},{max:ix}=Math,Oa=ix.bind(0,0),dM="visible",qk="hidden",gee=42,xp={u:qE,o:{w:0,h:0}},vee={u:XE,o:{x:qk,y:qk}},xee=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Oa(e.w-t.w),h:Oa(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},bp=e=>e.indexOf(dM)===0,bee=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,nt:l,ut:u,_t:p,it:h,et:m}=e,{k:v,V:x,I:y,A:b}=Dr(),w=Ui()[gy],k=!u&&!y&&(b.x||b.y),_=h&&u,[j,I]=Oo(xp,Qh.bind(0,i)),[M,E]=Oo(xp,Yh.bind(0,i)),[O,D]=Oo(xp),[A,R]=Oo(xp),[T]=Oo(vee),X=(q,z)=>{if(er(i,{height:""}),z){const{St:K,K:re}=n(),{$t:Q,D:le}=q,se=Qh(o),W=Lp(o),G=er(i,"boxSizing")==="content-box",te=K||G?re.b+re.t:0,ae=!(b.x&&G);er(i,{height:W.h+se.h+(Q.x&&ae?le.x:0)-te})}},B=(q,z)=>{const K=!y&&!q?gee:0,re=(pe,fe,ge)=>{const Ce=er(i,pe),de=(z?z[pe]:Ce)==="scroll";return[Ce,de,de&&!y?fe?K:ge:0,fe&&!!K]},[Q,le,se,W]=re("overflowX",b.x,v.x),[G,te,ae,oe]=re("overflowY",b.y,v.y);return{Ct:{x:Q,y:G},$t:{x:le,y:te},D:{x:se,y:ae},M:{x:W,y:oe}}},U=(q,z,K,re)=>{const Q=(te,ae)=>{const oe=bp(te),pe=ae&&oe&&te.replace(`${dM}-`,"")||"";return[ae&&!oe?te:"",bp(pe)?"hidden":pe]},[le,se]=Q(K.x,z.x),[W,G]=Q(K.y,z.y);return re.overflowX=se&&W?se:le,re.overflowY=G&&le?G:W,B(q,re)},Y=(q,z,K,re)=>{const{D:Q,M:le}=q,{x:se,y:W}=le,{x:G,y:te}=Q,{P:ae}=n(),oe=z?"marginLeft":"marginRight",pe=z?"paddingLeft":"paddingRight",fe=ae[oe],ge=ae.marginBottom,Ce=ae[pe],me=ae.paddingBottom;re.width=`calc(100% + ${te+-1*fe}px)`,re[oe]=-te+fe,re.marginBottom=-G+ge,K&&(re[pe]=Ce+(W?te:0),re.paddingBottom=me+(se?G:0))},[V,L]=w?w.H(k,x,i,l,n,B,Y):[()=>k,()=>[ao]];return(q,z,K)=>{const{gt:re,Ot:Q,wt:le,xt:se,vt:W,yt:G}=q,{ht:te,bt:ae}=n(),[oe,pe]=z("showNativeOverlaidScrollbars"),[fe,ge]=z("overflow"),Ce=oe&&b.x&&b.y,me=!u&&!x&&(re||le||Q||pe||W),de=bp(fe.x),De=bp(fe.y),je=de||De;let Be=I(K),rt=E(K),Ue=D(K),wt=R(K),Xe;if(pe&&y&&p(sM,BJ,!Ce),me&&(Xe=B(Ce),X(Xe,te)),re||se||le||G||pe){je&&p(lc,ic,!1);const[ke,ze]=L(Ce,ae,Xe),[Le,We]=Be=j(K),[ct,xn]=rt=M(K),jt=Lp(i);let Pt=ct,sr=jt;ke(),(xn||We||pe)&&ze&&!Ce&&V(ze,ct,Le,ae)&&(sr=Lp(i),Pt=Yh(i));const In={w:Oa(ix(ct.w,Pt.w)+Le.w),h:Oa(ix(ct.h,Pt.h)+Le.h)},pn={w:Oa((_?m.innerWidth:sr.w+Oa(jt.w-ct.w))+Le.w),h:Oa((_?m.innerHeight+Le.h:sr.h+Oa(jt.h-ct.h))+Le.h)};wt=A(pn),Ue=O(xee(In,pn),K)}const[tt,xe]=wt,[Re,st]=Ue,[mt,ve]=rt,[Ye,ot]=Be,lt={x:Re.w>0,y:Re.h>0},Me=de&&De&&(lt.x||lt.y)||de&<.x&&!lt.y||De&<.y&&!lt.x;if(se||G||ot||ve||xe||st||ge||pe||me){const ke={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},ze=U(Ce,lt,fe,ke),Le=V(ze,mt,Ye,ae);u||Y(ze,ae,Le,ke),me&&X(ze,te),u?(Jn(o,rM,ke.overflowX),Jn(o,oM,ke.overflowY)):er(i,ke)}Ii(o,Do,ic,Me),Ii(s,sx,HJ,Me),u||Ii(i,Ma,lc,je);const[$e,At]=T(B(Ce).Ct);return r({Ct:$e,zt:{x:tt.w,y:tt.h},Tt:{x:Re.w,y:Re.h},Et:lt}),{It:At,At:xe,Lt:st}}},Xk=(e,t,n)=>{const r={},o=t||{},s=Vr(e).concat(Vr(o));return Dt(s,i=>{const l=e[i],u=o[i];r[i]=!!(n||l||u)}),r},yee=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:i,A:l,V:u}=Dr(),p=!i&&(l.x||l.y),h=[hee(e,t),mee(e,t),bee(e,t)];return(m,v,x)=>{const y=Xk(un({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},v),{},x),b=p||!u,w=b&&zo(r),k=b&&Zs(r);o("",Zh,!0);let _=y;return Dt(h,j=>{_=Xk(_,j(_,m,!!x)||{},x)}),zo(r,w),Zs(r,k),o("",Zh),s||(zo(n,0),Zs(n,0)),_}},Cee=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},i=l=>{if(n){const u=n.reduce((p,h)=>{if(h){const[m,v]=h,x=v&&m&&(l?l(m):VE(m,e));x&&x.length&&v&&ni(v)&&zt(p,[x,v.trim()],!0)}return p},[]);Dt(u,p=>Dt(p[0],h=>{const m=p[1],v=r.get(h)||[];if(e.contains(h)){const y=Nn(h,m,b=>{o?(y(),r.delete(h)):t(b)});r.set(h,zt(v,y))}else js(v),r.delete(h)}))}};return n&&(r=new WeakMap,i()),[s,i]},Yk=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:i,Dt:l,Mt:u,Rt:p,kt:h}=r||{},m=dy(()=>{o&&n(!0)},{v:33,g:99}),[v,x]=Cee(e,m,l),y=s||[],b=i||[],w=y.concat(b),k=(j,I)=>{const M=p||ao,E=h||ao,O=new Set,D=new Set;let A=!1,R=!1;if(Dt(j,T=>{const{attributeName:X,target:B,type:U,oldValue:Y,addedNodes:V,removedNodes:L}=T,q=U==="attributes",z=U==="childList",K=e===B,re=q&&ni(X)?Jn(B,X):0,Q=re!==0&&Y!==re,le=sy(b,X)>-1&&Q;if(t&&(z||!K)){const se=!q,W=q&&Q,G=W&&u&&qh(B,u),ae=(G?!M(B,X,Y,re):se||W)&&!E(T,!!G,e,r);Dt(V,oe=>O.add(oe)),Dt(L,oe=>O.add(oe)),R=R||ae}!t&&K&&Q&&!M(B,X,Y,re)&&(D.add(X),A=A||le)}),O.size>0&&x(T=>Wi(O).reduce((X,B)=>(zt(X,VE(T,B)),qh(B,T)?zt(X,B):X),[])),t)return!I&&R&&n(!1),[!1];if(D.size>0||A){const T=[Wi(D),A];return!I&&n.apply(0,T),T}},_=new MJ(j=>k(j));return _.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:w,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(v(),_.disconnect(),o=!1)},()=>{if(o){m.m();const j=_.takeRecords();return!ay(j)&&k(j,!0)}}]},yp=3333333,Cp=e=>e&&(e.height||e.width),fM=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Ui()[ree],{B:i}=Dr(),u=WE(`<div class="${hy}"><div class="${WJ}"></div></div>`)[0],p=u.firstChild,h=id.bind(0,e),[m]=Oo({o:void 0,_:!0,u:(b,w)=>!(!b||!Cp(b)&&Cp(w))}),v=b=>{const w=Ko(b)&&b.length>0&&ad(b[0]),k=!w&&oy(b[0]);let _=!1,j=!1,I=!0;if(w){const[M,,E]=m(b.pop().contentRect),O=Cp(M),D=Cp(E);_=!E||!O,j=!D&&O,I=!_}else k?[,I]=b:j=b===!0;if(r&&I){const M=k?b[0]:id(u);zo(u,M?i.n?-yp:i.i?0:yp:yp),Zs(u,yp)}_||t({gt:!k,Yt:k?b:void 0,Vt:!!j})},x=[];let y=o?v:!1;return[()=>{js(x),xs(u)},()=>{if(Kl){const b=new Kl(v);b.observe(p),zt(x,()=>{b.disconnect()})}else if(s){const[b,w]=s.O(p,v,o);y=b,zt(x,w)}if(r){const[b]=Oo({o:void 0},h);zt(x,Nn(u,"scroll",w=>{const k=b(),[_,j,I]=k;j&&(uy(p,"ltr rtl"),_?Js(p,"rtl"):Js(p,"ltr"),v([!!_,j,I])),QE(w)}))}y&&(Js(u,VJ),zt(x,Nn(u,"animationstart",y,{C:!!Kl}))),(Kl||s)&&lo(e,u)}]},wee=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,See=(e,t)=>{let n;const r=Ei(UJ),o=[],[s]=Oo({o:!1}),i=(u,p)=>{if(u){const h=s(wee(u)),[,m]=h;if(m)return!p&&t(h),[h]}},l=(u,p)=>{if(u&&u.length>0)return i(u.pop(),p)};return[()=>{js(o),xs(r)},()=>{if(Dk)n=new Dk(u=>l(u),{root:e}),n.observe(r),zt(o,()=>{n.disconnect()});else{const u=()=>{const m=ld(r);i(m)},[p,h]=fM(r,u);zt(o,p),h(),u()}lo(e,r)},()=>{if(n)return l(n.takeRecords(),!0)}]},Qk=`[${Do}]`,kee=`[${Ma}]`,Av=["tabindex"],Zk=["wrap","cols","rows"],Nv=["id","class","style","open"],_ee=(e,t,n)=>{let r,o,s;const{Z:i,J:l,tt:u,rt:p,ut:h,ft:m,_t:v}=e,{V:x}=Dr(),[y]=Oo({u:qE,o:{w:0,h:0}},()=>{const U=m(lc,ic),Y=m(Ov,""),V=Y&&zo(l),L=Y&&Zs(l);v(lc,ic),v(Ov,""),v("",Zh,!0);const q=Yh(u),z=Yh(l),K=Qh(l);return v(lc,ic,U),v(Ov,"",Y),v("",Zh),zo(l,V),Zs(l,L),{w:z.w+q.w+K.w,h:z.h+q.h+K.h}}),b=p?Zk:Nv.concat(Zk),w=dy(n,{v:()=>r,g:()=>o,p(U,Y){const[V]=U,[L]=Y;return[Vr(V).concat(Vr(L)).reduce((q,z)=>(q[z]=V[z]||L[z],q),{})]}}),k=U=>{Dt(U||Av,Y=>{if(sy(Av,Y)>-1){const V=Jn(i,Y);ni(V)?Jn(l,Y,V):Cr(l,Y)}})},_=(U,Y)=>{const[V,L]=U,q={vt:L};return t({ht:V}),!Y&&n(q),q},j=({gt:U,Yt:Y,Vt:V})=>{const L=!U||V?n:w;let q=!1;if(Y){const[z,K]=Y;q=K,t({bt:z})}L({gt:U,yt:q})},I=(U,Y)=>{const[,V]=y(),L={wt:V};return V&&!Y&&(U?n:w)(L),L},M=(U,Y,V)=>{const L={Ot:Y};return Y?!V&&w(L):h||k(U),L},[E,O,D]=u||!x?See(i,_):[ao,ao,ao],[A,R]=h?[ao,ao]:fM(i,j,{Vt:!0,Bt:!0}),[T,X]=Yk(i,!1,M,{Pt:Nv,Ht:Nv.concat(Av)}),B=h&&Kl&&new Kl(j.bind(0,{gt:!0}));return B&&B.observe(i),k(),[()=>{E(),A(),s&&s[0](),B&&B.disconnect(),T()},()=>{R(),O()},()=>{const U={},Y=X(),V=D(),L=s&&s[1]();return Y&&un(U,M.apply(0,zt(Y,!0))),V&&un(U,_.apply(0,zt(V,!0))),L&&un(U,I.apply(0,zt(L,!0))),U},U=>{const[Y]=U("update.ignoreMutation"),[V,L]=U("update.attributes"),[q,z]=U("update.elementEvents"),[K,re]=U("update.debounce"),Q=z||L,le=se=>Go(Y)&&Y(se);if(Q&&(s&&(s[1](),s[0]()),s=Yk(u||l,!0,I,{Ht:b.concat(V||[]),Dt:q,Mt:Qk,kt:(se,W)=>{const{target:G,attributeName:te}=se;return(!W&&te&&!h?kJ(G,Qk,kee):!1)||!!Gl(G,`.${Or}`)||!!le(se)}})),re)if(w.m(),Ko(K)){const se=K[0],W=K[1];r=Va(se)&&se,o=Va(W)&&W}else Va(K)?(r=K,o=!1):(r=!1,o=!1)}]},Jk={x:0,y:0},jee=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:Jk,Tt:Jk,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:id(e.Z)}),Pee=(e,t)=>{const n=ax(t,{}),[r,o,s]=py(),[i,l,u]=pee(e),p=uM(jee(i)),[h,m]=p,v=yee(i,p),x=(j,I,M)=>{const O=Vr(j).some(D=>j[D])||!iy(I)||M;return O&&s("u",[j,I,M]),O},[y,b,w,k]=_ee(i,m,j=>x(v(n,j),{},!1)),_=h.bind(0);return _.jt=j=>r("u",j),_.Nt=()=>{const{W:j,J:I}=i,M=zo(j),E=Zs(j);b(),l(),zo(I,M),Zs(I,E)},_.qt=i,[(j,I)=>{const M=ax(t,j,I);return k(M),x(v(M,w(),I),j,!!I)},_,()=>{o(),y(),u()}]},{round:e_}=Math,Iee=e=>{const{width:t,height:n}=fs(e),{w:r,h:o}=ld(e);return{x:e_(t)/r||1,y:e_(n)/o||1}},Eee=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:i}=e,{pointers:l}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(l||[]).includes(i)},Mee=(e,t)=>Nn(e,"mousedown",Nn.bind(0,t,"click",QE,{C:!0,$:!0}),{$:!0}),t_="pointerup pointerleave pointercancel lostpointercapture",Oee=(e,t,n,r,o,s,i)=>{const{B:l}=Dr(),{Ft:u,Gt:p,Xt:h}=r,m=`scroll${i?"Left":"Top"}`,v=`client${i?"X":"Y"}`,x=i?"width":"height",y=i?"left":"top",b=i?"w":"h",w=i?"x":"y",k=(_,j)=>I=>{const{Tt:M}=s(),E=ld(p)[b]-ld(u)[b],D=j*I/E*M[w],R=id(h)&&i?l.n||l.i?1:-1:1;o[m]=_+D*R};return Nn(p,"pointerdown",_=>{const j=Gl(_.target,`.${my}`)===u,I=j?u:p;if(Ii(t,Do,zk,!0),Eee(_,e,j)){const M=!j&&_.shiftKey,E=()=>fs(u),O=()=>fs(p),D=(z,K)=>(z||E())[y]-(K||O())[y],A=k(o[m]||0,1/Iee(o)[w]),R=_[v],T=E(),X=O(),B=T[x],U=D(T,X)+B/2,Y=R-X[y],V=j?0:Y-U,L=z=>{js(q),I.releasePointerCapture(z.pointerId)},q=[Ii.bind(0,t,Do,zk),Nn(n,t_,L),Nn(n,"selectstart",z=>ZE(z),{S:!1}),Nn(p,t_,L),Nn(p,"pointermove",z=>{const K=z[v]-R;(j||M)&&A(V+K)})];if(M)A(V);else if(!j){const z=Ui()[oee];z&&zt(q,z.O(A,D,V,B,Y))}I.setPointerCapture(_.pointerId)}})},Dee=(e,t)=>(n,r,o,s,i,l)=>{const{Xt:u}=n,[p,h]=Fl(333),m=!!i.scrollBy;let v=!0;return js.bind(0,[Nn(u,"pointerenter",()=>{r(Hk,!0)}),Nn(u,"pointerleave pointercancel",()=>{r(Hk)}),Nn(u,"wheel",x=>{const{deltaX:y,deltaY:b,deltaMode:w}=x;m&&v&&w===0&&ra(u)===s&&i.scrollBy({left:y,top:b,behavior:"smooth"}),v=!1,r(Uk,!0),p(()=>{v=!0,r(Uk)}),ZE(x)},{S:!1,$:!0}),Mee(u,o),Oee(e,s,o,n,i,t,l),h])},{min:lx,max:n_,abs:Ree,round:Aee}=Math,pM=(e,t,n,r)=>{if(r){const l=n?"x":"y",{Tt:u,zt:p}=r,h=p[l],m=u[l];return n_(0,lx(1,h/(h+m)))}const o=n?"width":"height",s=fs(e)[o],i=fs(t)[o];return n_(0,lx(1,s/i))},Nee=(e,t,n,r,o,s)=>{const{B:i}=Dr(),l=s?"x":"y",u=s?"Left":"Top",{Tt:p}=r,h=Aee(p[l]),m=Ree(n[`scroll${u}`]),v=s&&o,x=i.i?m:h-m,b=lx(1,(v?x:m)/h),w=pM(e,t,s);return 1/w*(1-w)*b},Tee=(e,t,n)=>{const{N:r,L:o}=Dr(),{scrollbars:s}=r(),{slot:i}=s,{ct:l,W:u,Z:p,J:h,lt:m,ot:v,it:x,ut:y}=t,{scrollbars:b}=m?{}:e,{slot:w}=b||{},k=lM([u,p,h],()=>y&&x?u:p,i,w),_=(V,L,q)=>{const z=q?Js:uy;Dt(V,K=>{z(K.Xt,L)})},j=(V,L)=>{Dt(V,q=>{const[z,K]=L(q);er(z,K)})},I=(V,L,q)=>{j(V,z=>{const{Ft:K,Gt:re}=z;return[K,{[q?"width":"height"]:`${(100*pM(K,re,q,L)).toFixed(3)}%`}]})},M=(V,L,q)=>{const z=q?"X":"Y";j(V,K=>{const{Ft:re,Gt:Q,Xt:le}=K,se=Nee(re,Q,v,L,id(le),q);return[re,{transform:se===se?`translate${z}(${(100*se).toFixed(3)}%)`:""}]})},E=[],O=[],D=[],A=(V,L,q)=>{const z=oy(q),K=z?q:!0,re=z?!q:!0;K&&_(O,V,L),re&&_(D,V,L)},R=V=>{I(O,V,!0),I(D,V)},T=V=>{M(O,V,!0),M(D,V)},X=V=>{const L=V?XJ:YJ,q=V?O:D,z=ay(q)?Bk:"",K=Ei(`${Or} ${L} ${z}`),re=Ei(aM),Q=Ei(my),le={Xt:K,Gt:re,Ft:Q};return o||Js(K,GJ),lo(K,re),lo(re,Q),zt(q,le),zt(E,[xs.bind(0,K),n(le,A,l,p,v,V)]),le},B=X.bind(0,!0),U=X.bind(0,!1),Y=()=>{lo(k,O[0].Xt),lo(k,D[0].Xt),Xh(()=>{A(Bk)},300)};return B(),U(),[{Ut:R,Wt:T,Zt:A,Jt:{Kt:O,Qt:B,tn:j.bind(0,O)},nn:{Kt:D,Qt:U,tn:j.bind(0,D)}},Y,js.bind(0,E)]},$ee=(e,t,n,r)=>{let o,s,i,l,u,p=0;const h=uM({}),[m]=h,[v,x]=Fl(),[y,b]=Fl(),[w,k]=Fl(100),[_,j]=Fl(100),[I,M]=Fl(()=>p),[E,O,D]=Tee(e,n.qt,Dee(t,n)),{Z:A,J:R,ot:T,st:X,ut:B,it:U}=n.qt,{Jt:Y,nn:V,Zt:L,Ut:q,Wt:z}=E,{tn:K}=Y,{tn:re}=V,Q=te=>{const{Xt:ae}=te,oe=B&&!U&&ra(ae)===R&&ae;return[oe,{transform:oe?`translate(${zo(T)}px, ${Zs(T)}px)`:""}]},le=(te,ae)=>{if(M(),te)L(Wk);else{const oe=()=>L(Wk,!0);p>0&&!ae?I(oe):oe()}},se=()=>{l=s,l&&le(!0)},W=[k,M,j,b,x,D,Nn(A,"pointerover",se,{C:!0}),Nn(A,"pointerenter",se),Nn(A,"pointerleave",()=>{l=!1,s&&le(!1)}),Nn(A,"pointermove",()=>{o&&v(()=>{k(),le(!0),_(()=>{o&&le(!1)})})}),Nn(X,"scroll",te=>{y(()=>{z(n()),i&&le(!0),w(()=>{i&&!l&&le(!1)})}),r(te),B&&K(Q),B&&re(Q)})],G=m.bind(0);return G.qt=E,G.Nt=O,[(te,ae,oe)=>{const{At:pe,Lt:fe,It:ge,yt:Ce}=oe,{A:me}=Dr(),de=ax(t,te,ae),De=n(),{Tt:je,Ct:Be,bt:rt}=De,[Ue,wt]=de("showNativeOverlaidScrollbars"),[Xe,tt]=de("scrollbars.theme"),[xe,Re]=de("scrollbars.visibility"),[st,mt]=de("scrollbars.autoHide"),[ve]=de("scrollbars.autoHideDelay"),[Ye,ot]=de("scrollbars.dragScroll"),[lt,Me]=de("scrollbars.clickScroll"),$e=pe||fe||Ce,At=ge||Re,ke=Ue&&me.x&&me.y,ze=(Le,We)=>{const ct=xe==="visible"||xe==="auto"&&Le==="scroll";return L(QJ,ct,We),ct};if(p=ve,wt&&L(KJ,ke),tt&&(L(u),L(Xe,!0),u=Xe),mt&&(o=st==="move",s=st==="leave",i=st!=="never",le(!i,!0)),ot&&L(eee,Ye),Me&&L(JJ,lt),At){const Le=ze(Be.x,!0),We=ze(Be.y,!1);L(ZJ,!(Le&&We))}$e&&(q(De),z(De),L(Vk,!je.x,!0),L(Vk,!je.y,!1),L(qJ,rt&&!U))},G,js.bind(0,W)]},hM=(e,t,n)=>{Go(e)&&e(t||void 0,n||void 0)},za=(e,t,n)=>{const{F:r,N:o,Y:s,j:i}=Dr(),l=Ui(),u=Kh(e),p=u?e:e.target,h=cM(p);if(t&&!h){let m=!1;const v=B=>{const U=Ui()[nee],Y=U&&U.O;return Y?Y(B,!0):B},x=un({},r(),v(t)),[y,b,w]=py(n),[k,_,j]=Pee(e,x),[I,M,E]=$ee(e,x,_,B=>w("scroll",[X,B])),O=(B,U)=>k(B,!!U),D=O.bind(0,{},!0),A=s(D),R=i(D),T=B=>{fee(p),A(),R(),E(),j(),m=!0,w("destroyed",[X,!!B]),b()},X={options(B,U){if(B){const Y=U?r():{},V=JE(x,un(Y,v(B)));iy(V)||(un(x,V),O(V))}return un({},x)},on:y,off:(B,U)=>{B&&U&&b(B,U)},state(){const{zt:B,Tt:U,Ct:Y,Et:V,K:L,St:q,bt:z}=_();return un({},{overflowEdge:B,overflowAmount:U,overflowStyle:Y,hasOverflow:V,padding:L,paddingAbsolute:q,directionRTL:z,destroyed:m})},elements(){const{W:B,Z:U,K:Y,J:V,tt:L,ot:q,st:z}=_.qt,{Jt:K,nn:re}=M.qt,Q=se=>{const{Ft:W,Gt:G,Xt:te}=se;return{scrollbar:te,track:G,handle:W}},le=se=>{const{Kt:W,Qt:G}=se,te=Q(W[0]);return un({},te,{clone:()=>{const ae=Q(G());return I({},!0,{}),ae}})};return un({},{target:B,host:U,padding:Y||V,viewport:V,content:L||V,scrollOffsetElement:q,scrollEventElement:z,scrollbarHorizontal:le(K),scrollbarVertical:le(re)})},update:B=>O({},B),destroy:T.bind(0)};return _.jt((B,U,Y)=>{I(U,Y,B)}),dee(p,X),Dt(Vr(l),B=>hM(l[B],0,X)),uee(_.qt.it,o().cancel,!u&&e.cancel)?(T(!0),X):(_.Nt(),M.Nt(),w("initialized",[X]),_.jt((B,U,Y)=>{const{gt:V,yt:L,vt:q,At:z,Lt:K,It:re,wt:Q,Ot:le}=B;w("updated",[X,{updateHints:{sizeChanged:V,directionChanged:L,heightIntrinsicChanged:q,overflowEdgeChanged:z,overflowAmountChanged:K,overflowStyleChanged:re,contentMutation:Q,hostMutation:le},changedOptions:U,force:Y}])}),X.update(!0),X)}return h};za.plugin=e=>{Dt(tee(e),t=>hM(t,za))};za.valid=e=>{const t=e&&e.elements,n=Go(t)&&t();return tx(n)&&!!cM(n.target)};za.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:i,U:l,N:u,q:p,F:h,G:m}=Dr();return un({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:i,staticDefaultOptions:l,getDefaultInitialization:u,setDefaultInitialization:p,getDefaultOptions:h,setDefaultOptions:m})};const Lee=()=>{if(typeof window>"u"){const p=()=>{};return[p,p]}let e,t;const n=window,r=typeof n.requestIdleCallback=="function",o=n.requestAnimationFrame,s=n.cancelAnimationFrame,i=r?n.requestIdleCallback:o,l=r?n.cancelIdleCallback:s,u=()=>{l(e),s(t)};return[(p,h)=>{u(),e=i(r?()=>{u(),t=o(p)}:p,typeof h=="object"?h:{timeout:2233})},u]},mM=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=d.useMemo(Lee,[]),i=d.useRef(null),l=d.useRef(r),u=d.useRef(t),p=d.useRef(n);return d.useEffect(()=>{l.current=r},[r]),d.useEffect(()=>{const{current:h}=i;u.current=t,za.valid(h)&&h.options(t||{},!0)},[t]),d.useEffect(()=>{const{current:h}=i;p.current=n,za.valid(h)&&h.on(n||{},!0)},[n]),d.useEffect(()=>()=>{var h;s(),(h=i.current)==null||h.destroy()},[]),d.useMemo(()=>[h=>{const m=i.current;if(za.valid(m))return;const v=l.current,x=u.current||{},y=p.current||{},b=()=>i.current=za(h,x,y);v?o(b,v):b()},()=>i.current],[])},zee=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:i,...l}=e,u=n,p=d.useRef(null),h=d.useRef(null),[m,v]=mM({options:r,events:o,defer:s});return d.useEffect(()=>{const{current:x}=p,{current:y}=h;return x&&y&&m({target:x,elements:{viewport:y,content:y}}),()=>{var b;return(b=v())==null?void 0:b.destroy()}},[m,n]),d.useImperativeHandle(t,()=>({osInstance:v,getElement:()=>p.current}),[]),H.createElement(u,{"data-overlayscrollbars-initialize":"",ref:p,...l},H.createElement("div",{ref:h},i))},lg=d.forwardRef(zee),Fee=e=>{const{boardToDelete:t,setBoardToDelete:n}=e,{t:r}=J(),o=F(_=>_.config.canRestoreDeletedImagesFromBin),{currentData:s,isFetching:i}=dD((t==null?void 0:t.board_id)??Fr.skipToken),l=d.useMemo(()=>ie([be],_=>{const j=(s??[]).map(M=>Dj(_,M));return{imageUsageSummary:{isInitialImage:Ro(j,M=>M.isInitialImage),isCanvasImage:Ro(j,M=>M.isCanvasImage),isNodesImage:Ro(j,M=>M.isNodesImage),isControlNetImage:Ro(j,M=>M.isControlNetImage)}}}),[s]),[u,{isLoading:p}]=fD(),[h,{isLoading:m}]=pD(),{imageUsageSummary:v}=F(l),x=d.useCallback(()=>{t&&(u(t.board_id),n(void 0))},[t,u,n]),y=d.useCallback(()=>{t&&(h(t.board_id),n(void 0))},[t,h,n]),b=d.useCallback(()=>{n(void 0)},[n]),w=d.useRef(null),k=d.useMemo(()=>m||p||i,[m,p,i]);return t?a.jsx(Ad,{isOpen:!!t,onClose:b,leastDestructiveRef:w,isCentered:!0,children:a.jsx(Vo,{children:a.jsxs(Nd,{children:[a.jsxs(Ho,{fontSize:"lg",fontWeight:"bold",children:["Delete ",t.board_name]}),a.jsx(Wo,{children:a.jsxs($,{direction:"column",gap:3,children:[i?a.jsx(zm,{children:a.jsx($,{sx:{w:"full",h:32}})}):a.jsx(CE,{imageUsage:v,topMessage:r("boards.topMessage"),bottomMessage:r("boards.bottomMessage")}),a.jsx(ye,{children:"Deleted boards cannot be restored."}),a.jsx(ye,{children:r(o?"gallery.deleteImageBin":"gallery.deleteImagePermanent")})]})}),a.jsx(gs,{children:a.jsxs($,{sx:{justifyContent:"space-between",width:"full",gap:2},children:[a.jsx(it,{ref:w,onClick:b,children:"Cancel"}),a.jsx(it,{colorScheme:"warning",isLoading:k,onClick:x,children:"Delete Board Only"}),a.jsx(it,{colorScheme:"error",isLoading:k,onClick:y,children:"Delete Board and Images"})]})})]})})}):null},Bee=d.memo(Fee),Hee=()=>{const{t:e}=J(),[t,{isLoading:n}]=hD(),r=e("boards.myBoard"),o=d.useCallback(()=>{t(r)},[t,r]);return a.jsx(Te,{icon:a.jsx(nl,{}),isLoading:n,tooltip:e("boards.addBoard"),"aria-label":e("boards.addBoard"),onClick:o,size:"sm"})},Vee=d.memo(Hee);var gM=kd({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=kd({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),Wee=kd({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"}),Uee=kd({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"})})}),Gee=kd({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});const Kee=ie([be],({gallery:e})=>{const{boardSearchText:t}=e;return{boardSearchText:t}},we),qee=()=>{const e=ee(),{boardSearchText:t}=F(Kee),n=d.useRef(null),{t:r}=J(),o=d.useCallback(u=>{e(zC(u))},[e]),s=d.useCallback(()=>{e(zC(""))},[e]),i=d.useCallback(u=>{u.key==="Escape"&&s()},[s]),l=d.useCallback(u=>{o(u.target.value)},[o]);return d.useEffect(()=>{n.current&&n.current.focus()},[]),a.jsxs(M3,{children:[a.jsx(Pm,{ref:n,placeholder:r("boards.searchBoard"),value:t,onKeyDown:i,onChange:l}),t&&t.length&&a.jsx(gb,{children:a.jsx(ps,{onClick:s,size:"xs",variant:"ghost","aria-label":r("boards.clearSearch"),opacity:.5,icon:a.jsx(Wee,{boxSize:2})})})]})},Xee=d.memo(qee);function vM(e){return mD(e)}function Yee(e){return gD(e)}const xM=(e,t)=>{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_CONTROLNET_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:s}=t.data.current.payload,i=s.board_id??"none",l=e.context.boardId;return i!==l}return r==="IMAGE_DTOS"}case"REMOVE_FROM_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:s}=t.data.current.payload;return s.board_id!=="none"}return r==="IMAGE_DTOS"}default:return!1}},Qee=e=>{const{isOver:t,label:n="Drop"}=e,r=d.useRef(Fa()),{colorMode:o}=ia();return a.jsx(vn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsxs($,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[a.jsx($,{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($,{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)},bM=d.memo(Qee),Zee=e=>{const{dropLabel:t,data:n,disabled:r}=e,o=d.useRef(Fa()),{isOver:s,setNodeRef:i,active:l}=vM({id:o.current,disabled:r,data:n});return a.jsx(Ie,{ref:i,position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",pointerEvents:"none",children:a.jsx(nr,{children:xM(n,l)&&a.jsx(bM,{isOver:s,label:t})})})},by=d.memo(Zee),Jee=({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}}}),yy=d.memo(Jee),ete=()=>a.jsx($,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(ua,{variant:"solid",sx:{bg:"accent.400",_dark:{bg:"accent.500"}},children:"auto"})}),yM=d.memo(ete);function Cy(e){const[t,n]=d.useState(!1),[r,o]=d.useState(!1),[s,i]=d.useState(!1),[l,u]=d.useState([0,0]),p=d.useRef(null),h=F(v=>v.ui.globalContextMenuCloseTrigger);d.useEffect(()=>{if(t)setTimeout(()=>{o(!0),setTimeout(()=>{i(!0)})});else{i(!1);const v=setTimeout(()=>{o(t)},1e3);return()=>clearTimeout(v)}},[t]),d.useEffect(()=>{n(!1),i(!1),o(!1)},[h]),WL("contextmenu",v=>{var x;(x=p.current)!=null&&x.contains(v.target)||v.target===p.current?(v.preventDefault(),n(!0),u([v.pageX,v.pageY])):n(!1)});const m=d.useCallback(()=>{var v,x;(x=(v=e.menuProps)==null?void 0:v.onClose)==null||x.call(v),n(!1)},[e.menuProps]);return a.jsxs(a.Fragment,{children:[e.children(p),r&&a.jsx(wd,{...e.portalProps,children:a.jsxs(Dd,{isOpen:s,gutter:0,...e.menuProps,onClose:m,children:[a.jsx(Rd,{"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:l[0],top:l[1],cursor:"default"},...e.menuButtonProps}),e.renderMenu()]})})]})}const ug=e=>{const{boardName:t}=um(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)||"Uncategorized"}}});return t},tte=({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(Vt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Wr,{}),onClick:n,children:"Delete Board"})]})},nte=d.memo(tte),rte=()=>a.jsx(a.Fragment,{}),ote=d.memo(rte),ste=({board:e,board_id:t,setBoardToDelete:n,children:r})=>{const o=ee(),s=d.useMemo(()=>ie(be,({gallery:x,system:y})=>{const b=x.autoAddBoardId===t,w=y.isProcessing,k=x.autoAssignBoardOnClick;return{isAutoAdd:b,isProcessing:w,autoAssignBoardOnClick:k}},we),[t]),{isAutoAdd:i,isProcessing:l,autoAssignBoardOnClick:u}=F(s),p=ug(t),h=d.useCallback(()=>{o(fm(t))},[t,o]),m=d.useCallback(x=>{x.preventDefault()},[]),{t:v}=J();return a.jsx(Cy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>a.jsx(Ga,{sx:{visibility:"visible !important"},motionProps:gc,onContextMenu:m,children:a.jsxs(wc,{title:p,children:[a.jsx(Vt,{icon:a.jsx(nl,{}),isDisabled:i||l||u,onClick:h,children:v("boards.menuItemAutoAdd")}),!e&&a.jsx(ote,{}),e&&a.jsx(nte,{board:e,setBoardToDelete:n})]})}),children:r})},CM=d.memo(ste),ate=({board:e,isSelected:t,setBoardToDelete:n})=>{const r=ee(),o=d.useMemo(()=>ie(be,({gallery:R,system:T})=>{const X=e.board_id===R.autoAddBoardId,B=R.autoAssignBoardOnClick,U=T.isProcessing;return{isSelectedForAutoAdd:X,autoAssignBoardOnClick:B,isProcessing:U}},we),[e.board_id]),{isSelectedForAutoAdd:s,autoAssignBoardOnClick:i,isProcessing:l}=F(o),[u,p]=d.useState(!1),h=d.useCallback(()=>{p(!0)},[]),m=d.useCallback(()=>{p(!1)},[]),{data:v}=Lj(e.board_id),{data:x}=zj(e.board_id),y=d.useMemo(()=>{if(!(!v||!x))return`${v} image${v>1?"s":""}, ${x} asset${x>1?"s":""}`},[x,v]),{currentData:b}=po(e.cover_image_name??Fr.skipToken),{board_name:w,board_id:k}=e,[_,j]=d.useState(w),I=d.useCallback(()=>{r(Fj(k)),i&&!l&&r(fm(k))},[k,i,l,r]),[M,{isLoading:E}]=vD(),O=d.useMemo(()=>({id:k,actionType:"ADD_TO_BOARD",context:{boardId:k}}),[k]),D=d.useCallback(async R=>{if(!R.trim()){j(w);return}if(R!==w)try{const{board_name:T}=await M({board_id:k,changes:{board_name:R}}).unwrap();j(T)}catch{j(w)}},[k,w,M]),A=d.useCallback(R=>{j(R)},[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx($,{onMouseOver:h,onMouseOut:m,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",w:"full",h:"full"},children:a.jsx(CM,{board:e,board_id:k,setBoardToDelete:n,children:R=>a.jsx(Rt,{label:y,openDelay:1e3,hasArrow:!0,children:a.jsxs($,{ref:R,onClick:I,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[b!=null&&b.thumbnail_url?a.jsx(Xi,{src:b==null?void 0:b.thumbnail_url,draggable:!1,sx:{objectFit:"cover",w:"full",h:"full",maxH:"full",borderRadius:"base",borderBottomRadius:"lg"}}):a.jsx($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(An,{boxSize:12,as:VZ,sx:{mt:-6,opacity:.7,color:"base.500",_dark:{color:"base.500"}}})}),s&&a.jsx(yM,{}),a.jsx(yy,{isSelected:t,isHovered:u}),a.jsx($,{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(km,{value:_,isDisabled:E,submitOnBlur:!0,onChange:A,onSubmit:D,sx:{w:"full"},children:[a.jsx(Sm,{sx:{p:0,fontWeight:t?700:500,textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},noOfLines:1}),a.jsx(wm,{sx:{p:0,_focusVisible:{p:0,textAlign:"center",boxShadow:"none"}}})]})}),a.jsx(by,{data:O,dropLabel:a.jsx(ye,{fontSize:"md",children:"Move"})})]})})})})})},ite=d.memo(ate),lte=ie(be,({gallery:e,system:t})=>{const{autoAddBoardId:n,autoAssignBoardOnClick:r}=e,{isProcessing:o}=t;return{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}},we),wM=d.memo(({isSelected:e})=>{const t=ee(),{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}=F(lte),s=ug("none"),i=d.useCallback(()=>{t(Fj("none")),r&&!o&&t(fm("none"))},[t,r,o]),[l,u]=d.useState(!1),p=d.useCallback(()=>{u(!0)},[]),h=d.useCallback(()=>{u(!1)},[]),m=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($,{onMouseOver:p,onMouseOut:h,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"base",w:"full",h:"full"},children:a.jsx(CM,{board_id:"none",children:v=>a.jsxs($,{ref:v,onClick:i,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($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(Xi,{src:Aj,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(yM,{}),a.jsx($,{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:s}),a.jsx(yy,{isSelected:e,isHovered:l}),a.jsx(by,{data:m,dropLabel:a.jsx(ye,{fontSize:"md",children:"Move"})})]})})})})});wM.displayName="HoverableBoard";const cte=d.memo(wM),ute=ie([be],({gallery:e})=>{const{selectedBoardId:t,boardSearchText:n}=e;return{selectedBoardId:t,boardSearchText:n}},we),dte=e=>{const{isOpen:t}=e,{selectedBoardId:n,boardSearchText:r}=F(ute),{data:o}=um(),s=r?o==null?void 0:o.filter(u=>u.board_name.toLowerCase().includes(r.toLowerCase())):o,[i,l]=d.useState();return a.jsxs(a.Fragment,{children:[a.jsx(ym,{in:t,animateOpacity:!0,children:a.jsxs($,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[a.jsxs($,{sx:{gap:2,alignItems:"center"},children:[a.jsx(Xee,{}),a.jsx(Vee,{})]}),a.jsx(lg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsxs(Ua,{className:"list-container",sx:{gridTemplateColumns:"repeat(auto-fill, minmax(108px, 1fr));",maxH:346},children:[a.jsx(ed,{sx:{p:1.5},children:a.jsx(cte,{isSelected:n==="none"})}),s&&s.map(u=>a.jsx(ed,{sx:{p:1.5},children:a.jsx(ite,{board:u,isSelected:n===u.board_id,setBoardToDelete:l})},u.board_id))]})})]})}),a.jsx(Bee,{boardToDelete:i,setBoardToDelete:l})]})},fte=d.memo(dte),pte=ie([be],e=>{const{selectedBoardId:t}=e.gallery;return{selectedBoardId:t}},we),hte=e=>{const{isOpen:t,onToggle:n}=e,{selectedBoardId:r}=F(pte),o=ug(r),s=d.useMemo(()=>o.length>20?`${o.substring(0,20)}...`:o,[o]);return a.jsxs($,{as:vc,onClick:n,size:"sm",sx:{position:"relative",gap:2,w:"full",justifyContent:"space-between",alignItems:"center",px:2},children:[a.jsx(ye,{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"}})]})},mte=d.memo(hte),gte=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return a.jsxs($m,{isLazy:o,...s,children:[a.jsx(Rb,{children:t}),a.jsxs(Lm,{shadow:"dark-lg",children:[r&&a.jsx(dP,{}),n]})]})},Wd=d.memo(gte);function vte(e){return Ne({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 xte=e=>{const[t,n]=d.useState(!1),{label:r,value:o,min:s=1,max:i=100,step:l=1,onChange:u,tooltipSuffix:p="",withSliderMarks:h=!1,withInput:m=!1,isInteger:v=!1,inputWidth:x=16,withReset:y=!1,hideTooltip:b=!1,isCompact:w=!1,isDisabled:k=!1,sliderMarks:_,handleReset:j,sliderFormControlProps:I,sliderFormLabelProps:M,sliderMarkProps:E,sliderTrackProps:O,sliderThumbProps:D,sliderNumberInputProps:A,sliderNumberInputFieldProps:R,sliderNumberInputStepperProps:T,sliderTooltipProps:X,sliderIAIIconButtonProps:B,...U}=e,Y=ee(),{t:V}=J(),[L,q]=d.useState(String(o));d.useEffect(()=>{q(o)},[o]);const z=d.useMemo(()=>A!=null&&A.min?A.min:s,[s,A==null?void 0:A.min]),K=d.useMemo(()=>A!=null&&A.max?A.max:i,[i,A==null?void 0:A.max]),re=d.useCallback(ae=>{u(ae)},[u]),Q=d.useCallback(ae=>{ae.target.value===""&&(ae.target.value=String(z));const oe=Ri(v?Math.floor(Number(ae.target.value)):Number(L),z,K),pe=Eu(oe,l);u(pe),q(pe)},[v,L,z,K,u,l]),le=d.useCallback(ae=>{q(ae)},[]),se=d.useCallback(()=>{j&&j()},[j]),W=d.useCallback(ae=>{ae.target instanceof HTMLDivElement&&ae.target.focus()},[]),G=d.useCallback(ae=>{ae.shiftKey&&Y(Ir(!0))},[Y]),te=d.useCallback(ae=>{ae.shiftKey||Y(Ir(!1))},[Y]);return a.jsxs(fn,{onClick:W,sx:w?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},isDisabled:k,...I,children:[r&&a.jsx(Gn,{sx:m?{mb:-1.5}:{},...M,children:r}),a.jsxs(bb,{w:"100%",gap:2,alignItems:"center",children:[a.jsxs(Nb,{"aria-label":r,value:o,min:s,max:i,step:l,onChange:re,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:k,...U,children:[h&&!_&&a.jsxs(a.Fragment,{children:[a.jsx(Ll,{value:s,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...E,children:s}),a.jsx(Ll,{value:i,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...E,children:i})]}),h&&_&&a.jsx(a.Fragment,{children:_.map((ae,oe)=>oe===0?a.jsx(Ll,{value:ae,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...E,children:ae},ae):oe===_.length-1?a.jsx(Ll,{value:ae,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...E,children:ae},ae):a.jsx(Ll,{value:ae,sx:{transform:"translateX(-50%)"},...E,children:ae},ae))}),a.jsx($b,{...O,children:a.jsx(Lb,{})}),a.jsx(Rt,{hasArrow:!0,placement:"top",isOpen:t,label:`${o}${p}`,hidden:b,...X,children:a.jsx(Tb,{...D,zIndex:0})})]}),m&&a.jsxs(Dm,{min:z,max:K,step:l,value:L,onChange:le,onBlur:Q,focusInputOnChange:!1,...A,children:[a.jsx(Am,{onKeyDown:G,onKeyUp:te,minWidth:x,...R}),a.jsxs(Rm,{...T,children:[a.jsx(Tm,{onClick:()=>u(Number(L))}),a.jsx(Nm,{onClick:()=>u(Number(L))})]})]}),y&&a.jsx(Te,{size:"sm","aria-label":V("accessibility.reset"),tooltip:V("accessibility.reset"),icon:a.jsx(vte,{}),isDisabled:k,onClick:se,...B})]})]})},Ze=d.memo(xte),SM=d.forwardRef(({label:e,tooltip:t,description:n,disabled:r,...o},s)=>a.jsx(Rt,{label:t,placement:"top",hasArrow:!0,openDelay:500,children:a.jsx(Ie,{ref:s,...o,children:a.jsxs(Ie,{children:[a.jsx(Sc,{children:e}),n&&a.jsx(Sc,{size:"xs",color:"base.600",children:n})]})})}));SM.displayName="IAIMantineSelectItemWithTooltip";const ri=d.memo(SM),bte=ie([be],({gallery:e,system:t})=>{const{autoAddBoardId:n,autoAssignBoardOnClick:r}=e,{isProcessing:o}=t;return{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}},we),yte=()=>{const e=ee(),{t}=J(),{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}=F(bte),s=d.useRef(null),{boards:i,hasBoards:l}=um(void 0,{selectFromResult:({data:p})=>{const h=[{label:"None",value:"none"}];return p==null||p.forEach(({board_id:m,board_name:v})=>{h.push({label:v,value:m})}),{boards:h,hasBoards:h.length>1}}}),u=d.useCallback(p=>{p&&e(fm(p))},[e]);return a.jsx(Kt,{label:t("boards.autoAddBoard"),inputRef:s,autoFocus:!0,placeholder:t("boards.selectBoard"),value:n,data:i,nothingFound:t("boards.noMatching"),itemComponent:ri,disabled:!l||r||o,filter:(p,h)=>{var m;return((m=h.label)==null?void 0:m.toLowerCase().includes(p.toLowerCase().trim()))||h.value.toLowerCase().includes(p.toLowerCase().trim())},onChange:u})},Cte=d.memo(yte),wte=e=>{const{label:t,...n}=e,{colorMode:r}=ia();return a.jsx(Cm,{colorScheme:"accent",...n,children:a.jsx(ye,{sx:{fontSize:"sm",color:Ae("base.800","base.200")(r)},children:t})})},ur=d.memo(wte),Ste=ie([be],e=>{const{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}=e.gallery;return{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}},we),kte=()=>{const e=ee(),{t}=J(),{galleryImageMinimumWidth:n,shouldAutoSwitch:r,autoAssignBoardOnClick:o}=F(Ste),s=d.useCallback(u=>{e(FC(u))},[e]),i=d.useCallback(()=>{e(FC(64))},[e]),l=d.useCallback(u=>{e(xD(u.target.checked))},[e]);return a.jsx(Wd,{triggerComponent:a.jsx(Te,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:a.jsx(zE,{})}),children:a.jsxs($,{direction:"column",gap:2,children:[a.jsx(Ze,{value:n,onChange:s,min:45,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:i}),a.jsx(Gt,{label:t("gallery.autoSwitchNewImages"),isChecked:r,onChange:l}),a.jsx(ur,{label:t("gallery.autoAssignBoardOnClick"),isChecked:o,onChange:u=>e(bD(u.target.checked))}),a.jsx(Cte,{})]})})},_te=d.memo(kte),jte=e=>e.image?a.jsx(zm,{sx:{w:`${e.image.width}px`,h:"auto",objectFit:"contain",aspectRatio:`${e.image.width}/${e.image.height}`}}):a.jsx($,{sx:{opacity:.7,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(Ki,{size:"xl"})}),tr=e=>{const{icon:t=Vi,boxSize:n=16}=e;return a.jsxs($,{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"},...e.sx},children:[t&&a.jsx(An,{as:t,boxSize:n,opacity:.7}),e.label&&a.jsx(ye,{textAlign:"center",children:e.label})]})},dg=0,oi=1,Vc=2,kM=4;function Pte(e,t){return n=>e(t(n))}function Ite(e,t){return t(e)}function _M(e,t){return n=>e(t,n)}function r_(e,t){return()=>e(t)}function wy(e,t){return t(e),e}function rl(...e){return e}function Ete(e){e()}function o_(e){return()=>e}function Mte(...e){return()=>{e.map(Ete)}}function fg(){}function pr(e,t){return e(oi,t)}function Rn(e,t){e(dg,t)}function Sy(e){e(Vc)}function pg(e){return e(kM)}function Ut(e,t){return pr(e,_M(t,dg))}function s_(e,t){const n=e(oi,r=>{n(),t(r)});return n}function yn(){const e=[];return(t,n)=>{switch(t){case Vc:e.splice(0,e.length);return;case oi:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case dg:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function dt(e){let t=e;const n=yn();return(r,o)=>{switch(r){case oi:o(t);break;case dg:t=o;break;case kM:return t}return n(r,o)}}function Ote(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case oi:return s?n===s?void 0:(r(),n=s,t=pr(e,s),t):(r(),fg);case Vc:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Vu(e){return wy(yn(),t=>Ut(e,t))}function cc(e,t){return wy(dt(t),n=>Ut(e,n))}function Dte(...e){return t=>e.reduceRight(Ite,t)}function ft(e,...t){const n=Dte(...t);return(r,o)=>{switch(r){case oi:return pr(e,n(o));case Vc:Sy(e);return}}}function jM(e,t){return e===t}function kr(e=jM){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Un(e){return t=>n=>{e(n)&&t(n)}}function tn(e){return t=>Pte(t,e)}function Da(e){return t=>()=>t(e)}function wp(e,t){return n=>r=>n(t=e(t,r))}function cx(e){return t=>n=>{e>0?e--:t(n)}}function Du(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function a_(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function cs(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const l=Math.pow(2,i);pr(s,u=>{const p=n;n=n|l,t[i]=u,p!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const l=()=>s([i].concat(t));n===o?l():r=l}}function i_(...e){return function(t,n){switch(t){case oi:return Mte(...e.map(r=>pr(r,n)));case Vc:return;default:throw new Error(`unrecognized action ${t}`)}}}function It(e,t=jM){return ft(e,kr(t))}function qs(...e){const t=yn(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const l=Math.pow(2,i);pr(s,u=>{n[i]=u,r=r|l,r===o&&Rn(t,n)})}),function(s,i){switch(s){case oi:return r===o&&i(n),pr(t,i);case Vc:return Sy(t);default:throw new Error(`unrecognized action ${s}`)}}}function Ps(e,t=[],{singleton:n}={singleton:!0}){return{id:Rte(),constructor:e,dependencies:t,singleton:n}}const Rte=()=>Symbol();function Ate(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const l=o(s.map(u=>n(u)));return i&&t.set(r,l),l};return n(e)}function Nte(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)r.hasOwnProperty(i)||(n[i]=t[i]);return n}const Sp=typeof document<"u"?H.useLayoutEffect:H.useEffect;function Tte(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),l=H.createContext({});function u(b,w){b.propsReady&&Rn(b.propsReady,!1);for(const k of r){const _=b[t.required[k]];Rn(_,w[k])}for(const k of o)if(k in w){const _=b[t.optional[k]];Rn(_,w[k])}b.propsReady&&Rn(b.propsReady,!0)}function p(b){return s.reduce((w,k)=>(w[k]=_=>{const j=b[t.methods[k]];Rn(j,_)},w),{})}function h(b){return i.reduce((w,k)=>(w[k]=Ote(b[t.events[k]]),w),{})}return{Component:H.forwardRef((b,w)=>{const{children:k,..._}=b,[j]=H.useState(()=>wy(Ate(e),M=>u(M,_))),[I]=H.useState(r_(h,j));return Sp(()=>{for(const M of i)M in _&&pr(I[M],_[M]);return()=>{Object.values(I).map(Sy)}},[_,I,j]),Sp(()=>{u(j,_)}),H.useImperativeHandle(w,o_(p(j))),H.createElement(l.Provider,{value:j},n?H.createElement(n,Nte([...r,...o,...i],_),k):k)}),usePublisher:b=>H.useCallback(_M(Rn,H.useContext(l)[b]),[b]),useEmitterValue:b=>{const k=H.useContext(l)[b],[_,j]=H.useState(r_(pg,k));return Sp(()=>pr(k,I=>{I!==_&&j(o_(I))}),[k,_]),_},useEmitter:(b,w)=>{const _=H.useContext(l)[b];Sp(()=>pr(_,w),[w,_])}}}const $te=typeof document<"u"?H.useLayoutEffect:H.useEffect,Lte=$te;var ky=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(ky||{});const zte={0:"debug",1:"log",2:"warn",3:"error"},Fte=()=>typeof globalThis>"u"?window:globalThis,PM=Ps(()=>{const e=dt(3);return{log:dt((n,r,o=1)=>{var s;const i=(s=Fte().VIRTUOSO_LOG_LEVEL)!=null?s:pg(e);o>=i&&console[zte[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function IM(e,t=!0){const n=H.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=H.useMemo(()=>new ResizeObserver(s=>{const i=s[0].target;i.offsetParent!==null&&e(i)}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function hg(e,t=!0){return IM(e,t).callbackRef}function Jh(e,t){return Math.round(e.getBoundingClientRect()[t])}function EM(e,t){return Math.abs(e-t)<1.01}function MM(e,t,n,r=fg,o){const s=H.useRef(null),i=H.useRef(null),l=H.useRef(null),u=H.useCallback(m=>{const v=m.target,x=v===window||v===document,y=x?window.pageYOffset||document.documentElement.scrollTop:v.scrollTop,b=x?document.documentElement.scrollHeight:v.scrollHeight,w=x?window.innerHeight:v.offsetHeight,k=()=>{e({scrollTop:Math.max(y,0),scrollHeight:b,viewportHeight:w})};m.suppressFlushSync?k():yD.flushSync(k),i.current!==null&&(y===i.current||y<=0||y===b-w)&&(i.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t]);H.useEffect(()=>{const m=o||s.current;return r(o||s.current),u({target:m,suppressFlushSync:!0}),m.addEventListener("scroll",u,{passive:!0}),()=>{r(null),m.removeEventListener("scroll",u)}},[s,u,n,r,o]);function p(m){const v=s.current;if(!v||"offsetHeight"in v&&v.offsetHeight===0)return;const x=m.behavior==="smooth";let y,b,w;v===window?(b=Math.max(Jh(document.documentElement,"height"),document.documentElement.scrollHeight),y=window.innerHeight,w=document.documentElement.scrollTop):(b=v.scrollHeight,y=Jh(v,"height"),w=v.scrollTop);const k=b-y;if(m.top=Math.ceil(Math.max(Math.min(k,m.top),0)),EM(y,b)||m.top===w){e({scrollTop:w,scrollHeight:b,viewportHeight:y}),x&&t(!0);return}x?(i.current=m.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,i.current=null,t(!0)},1e3)):i.current=null,v.scrollTo(m)}function h(m){s.current.scrollBy(m)}return{scrollerRef:s,scrollByCallback:h,scrollToCallback:p}}const mg=Ps(()=>{const e=yn(),t=yn(),n=dt(0),r=yn(),o=dt(0),s=yn(),i=yn(),l=dt(0),u=dt(0),p=dt(0),h=dt(0),m=yn(),v=yn(),x=dt(!1);return Ut(ft(e,tn(({scrollTop:y})=>y)),t),Ut(ft(e,tn(({scrollHeight:y})=>y)),i),Ut(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:l,fixedHeaderHeight:u,fixedFooterHeight:p,footerHeight:h,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:m,scrollBy:v,statefulScrollTop:o,deviation:n,scrollingInProgress:x}},[],{singleton:!0}),Bte=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Hte(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Bte)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const em="up",Wu="down",Vte="none",Wte={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Ute=0,OM=Ps(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=dt(!1),l=dt(!0),u=yn(),p=yn(),h=dt(4),m=dt(Ute),v=cc(ft(i_(ft(It(t),cx(1),Da(!0)),ft(It(t),cx(1),Da(!1),a_(100))),kr()),!1),x=cc(ft(i_(ft(s,Da(!0)),ft(s,Da(!1),a_(200))),kr()),!1);Ut(ft(qs(It(t),It(m)),tn(([_,j])=>_<=j),kr()),l),Ut(ft(l,Du(50)),p);const y=Vu(ft(qs(e,It(n),It(r),It(o),It(h)),wp((_,[{scrollTop:j,scrollHeight:I},M,E,O,D])=>{const A=j+M-I>-D,R={viewportHeight:M,scrollTop:j,scrollHeight:I};if(A){let X,B;return j>_.state.scrollTop?(X="SCROLLED_DOWN",B=_.state.scrollTop-j):(X="SIZE_DECREASED",B=_.state.scrollTop-j||_.scrollTopDelta),{atBottom:!0,state:R,atBottomBecause:X,scrollTopDelta:B}}let T;return R.scrollHeight>_.state.scrollHeight?T="SIZE_INCREASED":M<_.state.viewportHeight?T="VIEWPORT_HEIGHT_DECREASING":j<_.state.scrollTop?T="SCROLLING_UPWARDS":T="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:T,state:R}},Wte),kr((_,j)=>_&&_.atBottom===j.atBottom))),b=cc(ft(e,wp((_,{scrollTop:j,scrollHeight:I,viewportHeight:M})=>{if(EM(_.scrollHeight,I))return{scrollTop:j,scrollHeight:I,jump:0,changed:!1};{const E=I-(j+M)<1;return _.scrollTop!==j&&E?{scrollHeight:I,scrollTop:j,jump:_.scrollTop-j,changed:!0}:{scrollHeight:I,scrollTop:j,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Un(_=>_.changed),tn(_=>_.jump)),0);Ut(ft(y,tn(_=>_.atBottom)),i),Ut(ft(i,Du(50)),u);const w=dt(Wu);Ut(ft(e,tn(({scrollTop:_})=>_),kr(),wp((_,j)=>pg(x)?{direction:_.direction,prevScrollTop:j}:{direction:j<_.prevScrollTop?em:Wu,prevScrollTop:j},{direction:Wu,prevScrollTop:0}),tn(_=>_.direction)),w),Ut(ft(e,Du(50),Da(Vte)),w);const k=dt(0);return Ut(ft(v,Un(_=>!_),Da(0)),k),Ut(ft(t,Du(100),cs(v),Un(([_,j])=>!!j),wp(([_,j],[I])=>[j,I],[0,0]),tn(([_,j])=>j-_)),k),{isScrolling:v,isAtTop:l,isAtBottom:i,atBottomState:y,atTopStateChange:p,atBottomStateChange:u,scrollDirection:w,atBottomThreshold:h,atTopThreshold:m,scrollVelocity:k,lastJumpDueToItemResize:b}},rl(mg)),Gte=Ps(([{log:e}])=>{const t=dt(!1),n=Vu(ft(t,Un(r=>r),kr()));return pr(t,r=>{r&&pg(e)("props updated",{},ky.DEBUG)}),{propsReady:t,didMount:n}},rl(PM),{singleton:!0});function DM(e,t){e==0?t():requestAnimationFrame(()=>DM(e-1,t))}function Kte(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}function ux(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function qte(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const tm="top",nm="bottom",l_="none";function c_(e,t,n){return typeof e=="number"?n===em&&t===tm||n===Wu&&t===nm?e:0:n===em?t===tm?e.main:e.reverse:t===nm?e.main:e.reverse}function u_(e,t){return typeof e=="number"?e:e[t]||0}const Xte=Ps(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=yn(),i=dt(0),l=dt(0),u=dt(0),p=cc(ft(qs(It(e),It(t),It(r),It(s,ux),It(u),It(i),It(o),It(n),It(l)),tn(([h,m,v,[x,y],b,w,k,_,j])=>{const I=h-_,M=w+k,E=Math.max(v-I,0);let O=l_;const D=u_(j,tm),A=u_(j,nm);return x-=_,x+=v+k,y+=v+k,y-=_,x>h+M-D&&(O=em),y<h-E+m+A&&(O=Wu),O!==l_?[Math.max(I-v-c_(b,tm,O)-D,0),I-E-k+m+c_(b,nm,O)+A]:null}),Un(h=>h!=null),kr(ux)),[0,0]);return{listBoundary:s,overscan:u,topListHeight:i,increaseViewportBy:l,visibleRange:p}},rl(mg),{singleton:!0}),Yte=Ps(([{scrollVelocity:e}])=>{const t=dt(!1),n=yn(),r=dt(!1);return Ut(ft(e,cs(r,t,n),Un(([o,s])=>!!s),tn(([o,s,i,l])=>{const{exit:u,enter:p}=s;if(i){if(u(o,l))return!1}else if(p(o,l))return!0;return i}),kr()),t),pr(ft(qs(t,e,n),cs(r)),([[o,s,i],l])=>o&&l&&l.change&&l.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},rl(OM),{singleton:!0});function Qte(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const Zte=Ps(([{scrollTo:e,scrollContainerState:t}])=>{const n=yn(),r=yn(),o=yn(),s=dt(!1),i=dt(void 0);return Ut(ft(qs(n,r),tn(([{viewportHeight:l,scrollTop:u,scrollHeight:p},{offsetTop:h}])=>({scrollTop:Math.max(0,u-h),scrollHeight:p,viewportHeight:l}))),t),Ut(ft(e,cs(r),tn(([l,{offsetTop:u}])=>({...l,top:l.top+u}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},rl(mg)),Tv="-webkit-sticky",d_="sticky",RM=Qte(()=>{if(typeof document>"u")return d_;const e=document.createElement("div");return e.style.position=Tv,e.style.position===Tv?Tv:d_});function Jte(e,t){const n=H.useRef(null),r=H.useCallback(l=>{if(l===null||!l.offsetParent)return;const u=l.getBoundingClientRect(),p=u.width;let h,m;if(t){const v=t.getBoundingClientRect(),x=u.top-v.top;h=v.height-Math.max(0,x),m=x+t.scrollTop}else h=window.innerHeight-Math.max(0,u.top),m=u.top+window.pageYOffset;n.current={offsetTop:m,visibleHeight:h,visibleWidth:p},e(n.current)},[e,t]),{callbackRef:o,ref:s}=IM(r),i=H.useCallback(()=>{r(s.current)},[r,s]);return H.useEffect(()=>{if(t){t.addEventListener("scroll",i);const l=new ResizeObserver(i);return l.observe(t),()=>{t.removeEventListener("scroll",i),l.unobserve(t)}}else return window.addEventListener("scroll",i),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[i,t]),o}H.createContext(void 0);const AM=H.createContext(void 0);function ene(e){return e}RM();const tne={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},NM={width:"100%",height:"100%",position:"absolute",top:0};RM();function Mi(e,t){if(typeof e!="string")return{context:t}}function nne({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...l}){const u=e("scrollContainerState"),p=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("scrollerRef"),v=n("context"),{scrollerRef:x,scrollByCallback:y,scrollToCallback:b}=MM(u,h,p,m);return t("scrollTo",b),t("scrollBy",y),H.createElement(p,{ref:x,style:{...tne,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...l,...Mi(p,v)},i)})}function rne({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...l}){const u=e("windowScrollContainerState"),p=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("totalListHeight"),v=n("deviation"),x=n("customScrollParent"),y=n("context"),{scrollerRef:b,scrollByCallback:w,scrollToCallback:k}=MM(u,h,p,fg,x);return Lte(()=>(b.current=x||window,()=>{b.current=null}),[b,x]),t("windowScrollTo",k),t("scrollBy",w),H.createElement(p,{style:{position:"relative",...s,...m!==0?{height:m+v}:{}},"data-virtuoso-scroller":!0,...l,...Mi(p,y)},i)})}const f_={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},one={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:p_,ceil:h_,floor:rm,min:$v,max:Uu}=Math;function sne(e){return{...one,items:e}}function m_(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 ane(e,t){return e&&e.column===t.column&&e.row===t.row}function kp(e,t){return e&&e.width===t.width&&e.height===t.height}const ine=Ps(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:l,scrollContainerState:u,footerHeight:p,headerHeight:h},m,v,{propsReady:x,didMount:y},{windowViewportRect:b,useWindowScroll:w,customScrollParent:k,windowScrollContainerState:_,windowScrollTo:j},I])=>{const M=dt(0),E=dt(0),O=dt(f_),D=dt({height:0,width:0}),A=dt({height:0,width:0}),R=yn(),T=yn(),X=dt(0),B=dt(null),U=dt({row:0,column:0}),Y=yn(),V=yn(),L=dt(!1),q=dt(0),z=dt(!0),K=dt(!1);pr(ft(y,cs(q),Un(([G,te])=>!!te)),()=>{Rn(z,!1),Rn(E,0)}),pr(ft(qs(y,z,A,D,q,K),Un(([G,te,ae,oe,,pe])=>G&&!te&&ae.height!==0&&oe.height!==0&&!pe)),([,,,,G])=>{Rn(K,!0),DM(1,()=>{Rn(R,G)}),s_(ft(r),()=>{Rn(n,[0,0]),Rn(z,!0)})}),Ut(ft(V,Un(G=>G!=null&&G.scrollTop>0),Da(0)),E),pr(ft(y,cs(V),Un(([,G])=>G!=null)),([,G])=>{G&&(Rn(D,G.viewport),Rn(A,G==null?void 0:G.item),Rn(U,G.gap),G.scrollTop>0&&(Rn(L,!0),s_(ft(r,cx(1)),te=>{Rn(L,!1)}),Rn(i,{top:G.scrollTop})))}),Ut(ft(D,tn(({height:G})=>G)),o),Ut(ft(qs(It(D,kp),It(A,kp),It(U,(G,te)=>G&&G.column===te.column&&G.row===te.row),It(r)),tn(([G,te,ae,oe])=>({viewport:G,item:te,gap:ae,scrollTop:oe}))),Y),Ut(ft(qs(It(M),t,It(U,ane),It(A,kp),It(D,kp),It(B),It(E),It(L),It(z),It(q)),Un(([,,,,,,,G])=>!G),tn(([G,[te,ae],oe,pe,fe,ge,Ce,,me,de])=>{const{row:De,column:je}=oe,{height:Be,width:rt}=pe,{width:Ue}=fe;if(Ce===0&&(G===0||Ue===0))return f_;if(rt===0){const ot=Kte(de,G),lt=ot===0?Math.max(Ce-1,0):ot;return sne(m_(ot,lt,ge))}const wt=TM(Ue,rt,je);let Xe,tt;me?te===0&&ae===0&&Ce>0?(Xe=0,tt=Ce-1):(Xe=wt*rm((te+De)/(Be+De)),tt=wt*h_((ae+De)/(Be+De))-1,tt=$v(G-1,Uu(tt,wt-1)),Xe=$v(tt,Uu(0,Xe))):(Xe=0,tt=-1);const xe=m_(Xe,tt,ge),{top:Re,bottom:st}=g_(fe,oe,pe,xe),mt=h_(G/wt),Ye=mt*Be+(mt-1)*De-st;return{items:xe,offsetTop:Re,offsetBottom:Ye,top:Re,bottom:st,itemHeight:Be,itemWidth:rt}})),O),Ut(ft(B,Un(G=>G!==null),tn(G=>G.length)),M),Ut(ft(qs(D,A,O,U),Un(([G,te,{items:ae}])=>ae.length>0&&te.height!==0&&G.height!==0),tn(([G,te,{items:ae},oe])=>{const{top:pe,bottom:fe}=g_(G,oe,te,ae);return[pe,fe]}),kr(ux)),n);const re=dt(!1);Ut(ft(r,cs(re),tn(([G,te])=>te||G!==0)),re);const Q=Vu(ft(It(O),Un(({items:G})=>G.length>0),cs(M,re),Un(([{items:G},te,ae])=>ae&&G[G.length-1].index===te-1),tn(([,G])=>G-1),kr())),le=Vu(ft(It(O),Un(({items:G})=>G.length>0&&G[0].index===0),Da(0),kr())),se=Vu(ft(It(O),cs(L),Un(([{items:G},te])=>G.length>0&&!te),tn(([{items:G}])=>({startIndex:G[0].index,endIndex:G[G.length-1].index})),kr(qte),Du(0)));Ut(se,v.scrollSeekRangeChanged),Ut(ft(R,cs(D,A,M,U),tn(([G,te,ae,oe,pe])=>{const fe=Hte(G),{align:ge,behavior:Ce,offset:me}=fe;let de=fe.index;de==="LAST"&&(de=oe-1),de=Uu(0,de,$v(oe-1,de));let De=dx(te,pe,ae,de);return ge==="end"?De=p_(De-te.height+ae.height):ge==="center"&&(De=p_(De-te.height/2+ae.height/2)),me&&(De+=me),{top:De,behavior:Ce}})),i);const W=cc(ft(O,tn(G=>G.offsetBottom+G.bottom)),0);return Ut(ft(b,tn(G=>({width:G.visibleWidth,height:G.visibleHeight}))),D),{data:B,totalCount:M,viewportDimensions:D,itemDimensions:A,scrollTop:r,scrollHeight:T,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:R,smoothScrollTargetReached:l,windowViewportRect:b,windowScrollTo:j,useWindowScroll:w,customScrollParent:k,windowScrollContainerState:_,deviation:X,scrollContainerState:u,footerHeight:p,headerHeight:h,initialItemCount:E,gap:U,restoreStateFrom:V,...v,initialTopMostItemIndex:q,gridState:O,totalListHeight:W,...m,startReached:le,endReached:Q,rangeChanged:se,stateChanged:Y,propsReady:x,stateRestoreInProgress:L,...I}},rl(Xte,mg,OM,Yte,Gte,Zte,PM));function g_(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=dx(e,t,n,r[0].index),i=dx(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function dx(e,t,n,r){const o=TM(e.width,n.width,t.column),s=rm(r/o),i=s*n.height+Uu(0,s-1)*t.row;return i>0?i+t.row:i}function TM(e,t,n){return Uu(1,rm((e+n)/(rm(t)+n)))}const lne=Ps(()=>{const e=dt(p=>`Item ${p}`),t=dt({}),n=dt(null),r=dt("virtuoso-grid-item"),o=dt("virtuoso-grid-list"),s=dt(ene),i=dt("div"),l=dt(fg),u=(p,h=null)=>cc(ft(t,tn(m=>m[p]),kr()),h);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:l,FooterComponent:u("Footer"),HeaderComponent:u("Header"),ListComponent:u("List","div"),ItemComponent:u("Item","div"),ScrollerComponent:u("Scroller","div"),ScrollSeekPlaceholder:u("ScrollSeekPlaceholder","div")}}),cne=Ps(([e,t])=>({...e,...t}),rl(ine,lne)),une=H.memo(function(){const t=cn("gridState"),n=cn("listClassName"),r=cn("itemClassName"),o=cn("itemContent"),s=cn("computeItemKey"),i=cn("isSeeking"),l=Fo("scrollHeight"),u=cn("ItemComponent"),p=cn("ListComponent"),h=cn("ScrollSeekPlaceholder"),m=cn("context"),v=Fo("itemDimensions"),x=Fo("gap"),y=cn("log"),b=cn("stateRestoreInProgress"),w=hg(k=>{const _=k.parentElement.parentElement.scrollHeight;l(_);const j=k.firstChild;if(j){const{width:I,height:M}=j.getBoundingClientRect();v({width:I,height:M})}x({row:v_("row-gap",getComputedStyle(k).rowGap,y),column:v_("column-gap",getComputedStyle(k).columnGap,y)})});return b?null:H.createElement(p,{ref:w,className:n,...Mi(p,m),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(k=>{const _=s(k.index,k.data,m);return i?H.createElement(h,{key:_,...Mi(h,m),index:k.index,height:t.itemHeight,width:t.itemWidth}):H.createElement(u,{...Mi(u,m),className:r,"data-index":k.index,key:_},o(k.index,k.data,m))}))}),dne=H.memo(function(){const t=cn("HeaderComponent"),n=Fo("headerHeight"),r=cn("headerFooterTag"),o=hg(i=>n(Jh(i,"height"))),s=cn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Mi(t,s))):null}),fne=H.memo(function(){const t=cn("FooterComponent"),n=Fo("footerHeight"),r=cn("headerFooterTag"),o=hg(i=>n(Jh(i,"height"))),s=cn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Mi(t,s))):null}),pne=({children:e})=>{const t=H.useContext(AM),n=Fo("itemDimensions"),r=Fo("viewportDimensions"),o=hg(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:NM,ref:o},e)},hne=({children:e})=>{const t=H.useContext(AM),n=Fo("windowViewportRect"),r=Fo("itemDimensions"),o=cn("customScrollParent"),s=Jte(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:NM},e)},mne=H.memo(function({...t}){const n=cn("useWindowScroll"),r=cn("customScrollParent"),o=r||n?xne:vne,s=r||n?hne:pne;return H.createElement(o,{...t},H.createElement(s,null,H.createElement(dne,null),H.createElement(une,null),H.createElement(fne,null)))}),{Component:gne,usePublisher:Fo,useEmitterValue:cn,useEmitter:$M}=Tte(cne,{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"}},mne),vne=nne({usePublisher:Fo,useEmitterValue:cn,useEmitter:$M}),xne=rne({usePublisher:Fo,useEmitterValue:cn,useEmitter:$M});function v_(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,ky.WARN),t==="normal"?0:parseInt(t??"0",10)}const bne=gne,yne=e=>{const t=F(s=>s.gallery.galleryView),{data:n}=Lj(e),{data:r}=zj(e),o=d.useMemo(()=>t==="images"?n:r,[t,r,n]);return{totalImages:n,totalAssets:r,currentViewTotal:o}};function gg(e,t={}){let n=d.useCallback(o=>t.keys?NN(e,t.keys,o):e.listen(o),[t.keys,e]),r=e.get.bind(e);return d.useSyncExternalStore(n,r,r)}const Cne=({imageDTO:e})=>a.jsx($,{sx:{pointerEvents:"none",flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,p:2,alignItems:"flex-start",gap:2},children:a.jsxs(ua,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]})}),wne=d.memo(Cne),_y=({postUploadAction:e,isDisabled:t})=>{const n=F(u=>u.gallery.autoAddBoardId),[r]=Oj(),o=d.useCallback(u=>{const p=u[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:i,open:l}=Bb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:o,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:s,getUploadInputProps:i,openUploader:l}},vg=()=>{const e=ee(),t=Ji(),{t:n}=J(),r=d.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),o=d.useCallback(()=>{t({title:n("toast.parameterNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),s=d.useCallback(()=>{t({title:n("toast.parametersSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),i=d.useCallback(()=>{t({title:n("toast.parametersNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),l=d.useCallback((E,O,D,A)=>{if(Hf(E)||Vf(O)||xu(D)||U0(A)){Hf(E)&&e($u(E)),Vf(O)&&e(Lu(O)),xu(D)&&e(zu(D)),xu(A)&&e(Fu(A)),r();return}o()},[e,r,o]),u=d.useCallback(E=>{if(!Hf(E)){o();return}e($u(E)),r()},[e,r,o]),p=d.useCallback(E=>{if(!Vf(E)){o();return}e(Lu(E)),r()},[e,r,o]),h=d.useCallback(E=>{if(!xu(E)){o();return}e(zu(E)),r()},[e,r,o]),m=d.useCallback(E=>{if(!U0(E)){o();return}e(Fu(E)),r()},[e,r,o]),v=d.useCallback(E=>{if(!BC(E)){o();return}e(Hp(E)),r()},[e,r,o]),x=d.useCallback(E=>{if(!G0(E)){o();return}e(Vp(E)),r()},[e,r,o]),y=d.useCallback(E=>{if(!HC(E)){o();return}e(n1(E)),r()},[e,r,o]),b=d.useCallback(E=>{if(!K0(E)){o();return}e(r1(E)),r()},[e,r,o]),w=d.useCallback(E=>{if(!q0(E)){o();return}e(Wp(E)),r()},[e,r,o]),k=d.useCallback(E=>{if(!VC(E)){o();return}e(Ai(E)),r()},[e,r,o]),_=d.useCallback(E=>{if(!WC(E)){o();return}e(Ni(E)),r()},[e,r,o]),j=d.useCallback(E=>{if(!UC(E)){o();return}e(Up(E)),r()},[e,r,o]),I=d.useCallback(E=>{e(pm(E))},[e]),M=d.useCallback(E=>{if(!E){i();return}const{cfg_scale:O,height:D,model:A,positive_prompt:R,negative_prompt:T,scheduler:X,seed:B,steps:U,width:Y,strength:V,positive_style_prompt:L,negative_style_prompt:q,refiner_model:z,refiner_cfg_scale:K,refiner_steps:re,refiner_scheduler:Q,refiner_positive_aesthetic_score:le,refiner_negative_aesthetic_score:se,refiner_start:W}=E;G0(O)&&e(Vp(O)),HC(A)&&e(n1(A)),Hf(R)&&e($u(R)),Vf(T)&&e(Lu(T)),K0(X)&&e(r1(X)),BC(B)&&e(Hp(B)),q0(U)&&e(Wp(U)),VC(Y)&&e(Ai(Y)),WC(D)&&e(Ni(D)),UC(V)&&e(Up(V)),xu(L)&&e(zu(L)),U0(q)&&e(Fu(q)),CD(z)&&e(Bj(z)),q0(re)&&e(o1(re)),G0(K)&&e(s1(K)),K0(Q)&&e(Hj(Q)),wD(le)&&e(a1(le)),SD(se)&&e(i1(se)),kD(W)&&e(l1(W)),s()},[i,s,e]);return{recallBothPrompts:l,recallPositivePrompt:u,recallNegativePrompt:p,recallSDXLPositiveStylePrompt:h,recallSDXLNegativeStylePrompt:m,recallSeed:v,recallCfgScale:x,recallModel:y,recallScheduler:b,recallSteps:w,recallWidth:k,recallHeight:_,recallStrength:j,recallAllParameters:M,sendToImageToImage:I}},LM=()=>{const e=Ji(),{t}=J(),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{const i=await(await fetch(o)).blob();await navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),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 Sne(e){return Ne({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.5 9c-.42 0-.83.04-1.24.11L1.01 3 1 10l9 2-9 2 .01 7 8.07-3.46C9.59 21.19 12.71 24 16.5 24c4.14 0 7.5-3.36 7.5-7.5S20.64 9 16.5 9zm0 13c-3.03 0-5.5-2.47-5.5-5.5s2.47-5.5 5.5-5.5 5.5 2.47 5.5 5.5-2.47 5.5-5.5 5.5z"}},{tag:"path",attr:{d:"M18.27 14.03l-1.77 1.76-1.77-1.76-.7.7 1.76 1.77-1.76 1.77.7.7 1.77-1.76 1.77 1.76.7-.7-1.76-1.77 1.76-1.77z"}}]})(e)}function xg(e){return Ne({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 kne(e){return Ne({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 _ne(e){return Ne({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 jne(e){return Ne({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function jy(e){return Ne({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 Py(e){return Ne({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 zM(e){return Ne({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 Iy=e=>e.config;$x("gallery/requestedBoardImagesDeletion");const Pne=$x("gallery/sentImageToCanvas"),FM=$x("gallery/sentImageToImg2Img"),Ine=e=>{const{imageDTO:t}=e,n=ee(),{t:r}=J(),o=Ji(),s=Xt("unifiedCanvas").isFeatureEnabled,{shouldFetchMetadataFromApi:i}=F(Iy),l=gg(Lx),{metadata:u,workflow:p,isLoading:h}=zx({image:t,shouldFetchMetadataFromApi:i},{selectFromResult:B=>{var U,Y;return{isLoading:B.isFetching,metadata:(U=B==null?void 0:B.currentData)==null?void 0:U.metadata,workflow:(Y=B==null?void 0:B.currentData)==null?void 0:Y.workflow}}}),[m]=Fx(),[v]=Bx(),{isClipboardAPIAvailable:x,copyImageToClipboard:y}=LM(),b=d.useCallback(()=>{t&&n(hm([t]))},[n,t]),{recallBothPrompts:w,recallSeed:k,recallAllParameters:_}=vg(),j=d.useCallback(()=>{w(u==null?void 0:u.positive_prompt,u==null?void 0:u.negative_prompt,u==null?void 0:u.positive_style_prompt,u==null?void 0:u.negative_style_prompt)},[u==null?void 0:u.negative_prompt,u==null?void 0:u.positive_prompt,u==null?void 0:u.positive_style_prompt,u==null?void 0:u.negative_style_prompt,w]),I=d.useCallback(()=>{k(u==null?void 0:u.seed)},[u==null?void 0:u.seed,k]),M=d.useCallback(()=>{p&&n(Hx(p))},[n,p]),E=d.useCallback(()=>{n(FM()),n(pm(t))},[n,t]),O=d.useCallback(()=>{n(Pne()),Lr.flushSync(()=>{n(Ra("unifiedCanvas"))}),n(Vj(t)),o({title:r("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},[n,t,r,o]),D=d.useCallback(()=>{_(u)},[u,_]),A=d.useCallback(()=>{n(Wj([t])),n(Tx(!0))},[n,t]),R=d.useCallback(()=>{y(t.image_url)},[y,t.image_url]),T=d.useCallback(()=>{t&&m({imageDTOs:[t]})},[m,t]),X=d.useCallback(()=>{t&&v({imageDTOs:[t]})},[v,t]);return a.jsxs(a.Fragment,{children:[a.jsx(Vt,{as:"a",href:t.image_url,target:"_blank",icon:a.jsx(EE,{}),children:r("common.openInNewTab")}),x&&a.jsx(Vt,{icon:a.jsx(Hc,{}),onClickCapture:R,children:r("parameters.copyImage")}),a.jsx(Vt,{as:"a",download:!0,href:t.image_url,target:"_blank",icon:a.jsx(Jm,{}),w:"100%",children:r("parameters.downloadImage")}),a.jsx(Vt,{icon:h?a.jsx(_p,{}):a.jsx(xg,{}),onClickCapture:M,isDisabled:h||!p,children:r("nodes.loadWorkflow")}),a.jsx(Vt,{icon:h?a.jsx(_p,{}):a.jsx(NE,{}),onClickCapture:j,isDisabled:h||(u==null?void 0:u.positive_prompt)===void 0&&(u==null?void 0:u.negative_prompt)===void 0,children:r("parameters.usePrompt")}),a.jsx(Vt,{icon:h?a.jsx(_p,{}):a.jsx(TE,{}),onClickCapture:I,isDisabled:h||(u==null?void 0:u.seed)===void 0,children:r("parameters.useSeed")}),a.jsx(Vt,{icon:h?a.jsx(_p,{}):a.jsx(_E,{}),onClickCapture:D,isDisabled:h||!u,children:r("parameters.useAll")}),a.jsx(Vt,{icon:a.jsx(jk,{}),onClickCapture:E,id:"send-to-img2img",children:r("parameters.sendToImg2Img")}),s&&a.jsx(Vt,{icon:a.jsx(jk,{}),onClickCapture:O,id:"send-to-canvas",children:r("parameters.sendToUnifiedCanvas")}),a.jsx(Vt,{icon:a.jsx(ME,{}),onClickCapture:A,children:"Change Board"}),t.starred?a.jsx(Vt,{icon:l?l.off.icon:a.jsx(Py,{}),onClickCapture:X,children:l?l.off.text:"Unstar Image"}):a.jsx(Vt,{icon:l?l.on.icon:a.jsx(jy,{}),onClickCapture:T,children:l?l.on.text:"Star Image"}),a.jsx(Vt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Wr,{}),onClickCapture:b,children:r("gallery.deleteImage")})]})},BM=d.memo(Ine),_p=()=>a.jsx($,{w:"14px",alignItems:"center",justifyContent:"center",children:a.jsx(Ki,{size:"xs"})}),Ene=()=>{const e=ee(),t=F(m=>m.gallery.selection),n=gg(Lx),[r]=Fx(),[o]=Bx(),s=d.useCallback(()=>{e(Wj(t)),e(Tx(!0))},[e,t]),i=d.useCallback(()=>{e(hm(t))},[e,t]),l=d.useCallback(()=>{r({imageDTOs:t})},[r,t]),u=d.useCallback(()=>{o({imageDTOs:t})},[o,t]),p=d.useMemo(()=>t.every(m=>m.starred),[t]),h=d.useMemo(()=>t.every(m=>!m.starred),[t]);return a.jsxs(a.Fragment,{children:[p&&a.jsx(Vt,{icon:n?n.on.icon:a.jsx(jy,{}),onClickCapture:u,children:n?n.off.text:"Unstar All"}),(h||!p&&!h)&&a.jsx(Vt,{icon:n?n.on.icon:a.jsx(Py,{}),onClickCapture:l,children:n?n.on.text:"Star All"}),a.jsx(Vt,{icon:a.jsx(ME,{}),onClickCapture:s,children:"Change Board"}),a.jsx(Vt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Wr,{}),onClickCapture:i,children:"Delete Selection"})]})},Mne=d.memo(Ene),One=ie([be],({gallery:e})=>({selectionCount:e.selection.length}),we),Dne=({imageDTO:e,children:t})=>{const{selectionCount:n}=F(One),r=d.useCallback(o=>{o.preventDefault()},[]);return a.jsx(Cy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>e?n>1?a.jsx(Ga,{sx:{visibility:"visible !important"},motionProps:gc,onContextMenu:r,children:a.jsx(Mne,{})}):a.jsx(Ga,{sx:{visibility:"visible !important"},motionProps:gc,onContextMenu:r,children:a.jsx(BM,{imageDTO:e})}):null,children:t})},Rne=d.memo(Dne),Ane=e=>{const{data:t,disabled:n,...r}=e,o=d.useRef(Fa()),{attributes:s,listeners:i,setNodeRef:l}=Yee({id:o.current,disabled:n,data:t});return a.jsx(Ie,{ref:l,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,...s,...i,...r})},Nne=d.memo(Ane),Tne=a.jsx(An,{as:ng,sx:{boxSize:16}}),$ne=a.jsx(tr,{icon:Vi}),Lne=e=>{const{imageDTO:t,onError:n,onClick:r,withMetadataOverlay:o=!1,isDropDisabled:s=!1,isDragDisabled:i=!1,isUploadDisabled:l=!1,minSize:u=24,postUploadAction:p,imageSx:h,fitContainer:m=!1,droppableData:v,draggableData:x,dropLabel:y,isSelected:b=!1,thumbnail:w=!1,noContentFallback:k=$ne,uploadElement:_=Tne,useThumbailFallback:j,withHoverOverlay:I=!1,children:M,onMouseOver:E,onMouseOut:O}=e,{colorMode:D}=ia(),[A,R]=d.useState(!1),T=d.useCallback(V=>{E&&E(V),R(!0)},[E]),X=d.useCallback(V=>{O&&O(V),R(!1)},[O]),{getUploadButtonProps:B,getUploadInputProps:U}=_y({postUploadAction:p,isDisabled:l}),Y=l?{}:{cursor:"pointer",bg:Ae("base.200","base.700")(D),_hover:{bg:Ae("base.300","base.650")(D),color:Ae("base.500","base.300")(D)}};return a.jsx(Rne,{imageDTO:t,children:V=>a.jsxs($,{ref:V,onMouseOver:T,onMouseOut:X,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative",minW:u||void 0,minH:u||void 0,userSelect:"none",cursor:i||!t?"default":"pointer"},children:[t&&a.jsxs($,{sx:{w:"full",h:"full",position:m?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[a.jsx(Xi,{src:w?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallbackSrc:j?t.thumbnail_url:void 0,fallback:j?void 0:a.jsx(jte,{image:t}),onError:n,draggable:!1,sx:{w:t.width,objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",...h}}),o&&a.jsx(wne,{imageDTO:t}),a.jsx(yy,{isSelected:b,isHovered:I?A:!1})]}),!t&&!l&&a.jsx(a.Fragment,{children:a.jsxs($,{sx:{minH:u,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:Ae("base.500","base.500")(D),...Y},...B(),children:[a.jsx("input",{...U()}),_]})}),!t&&l&&k,t&&!i&&a.jsx(Nne,{data:x,disabled:i||!t,onClick:r}),M,!s&&a.jsx(by,{data:v,disabled:s,dropLabel:y})]})})},Ya=d.memo(Lne),zne=()=>a.jsx(zm,{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"}})}),Fne=d.memo(zne),Bne=ie([be,Vx],({gallery:e},t)=>{const n=e.selection;return{queryArgs:t,selection:n}},we),Hne=e=>{const t=ee(),{queryArgs:n,selection:r}=F(Bne),{imageDTOs:o}=Uj(n,{selectFromResult:p=>({imageDTOs:p.data?_D.selectAll(p.data):[]})}),s=Xt("multiselect").isFeatureEnabled,i=d.useCallback(p=>{var h;if(e){if(!s){t(bu([e]));return}if(p.shiftKey){const m=e.image_name,v=(h=r[r.length-1])==null?void 0:h.image_name,x=o.findIndex(b=>b.image_name===v),y=o.findIndex(b=>b.image_name===m);if(x>-1&&y>-1){const b=Math.min(x,y),w=Math.max(x,y),k=o.slice(b,w+1);t(bu(kw(r.concat(k))))}}else p.ctrlKey||p.metaKey?r.some(m=>m.image_name===e.image_name)&&r.length>1?t(bu(r.filter(m=>m.image_name!==e.image_name))):t(bu(kw(r.concat(e)))):t(bu([e]))}},[t,e,o,r,s]),l=d.useMemo(()=>e?r.some(p=>p.image_name===e.image_name):!1,[e,r]),u=d.useMemo(()=>r.length,[r.length]);return{selection:r,selectionCount:u,isSelected:l,handleClick:i}},Vne=e=>{const{onClick:t,tooltip:n,icon:r,styleOverrides:o}=e,s=Ti("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(Te,{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}})},uc=d.memo(Vne),Wne=e=>{const t=ee(),{imageName:n}=e,{currentData:r}=po(n),o=F(E=>E.hotkeys.shift),{t:s}=J(),{handleClick:i,isSelected:l,selection:u,selectionCount:p}=Hne(r),h=gg(Lx),m=d.useCallback(E=>{E.stopPropagation(),r&&t(hm([r]))},[t,r]),v=d.useMemo(()=>{if(p>1)return{id:"gallery-image",payloadType:"IMAGE_DTOS",payload:{imageDTOs:u}};if(r)return{id:"gallery-image",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r,u,p]),[x]=Fx(),[y]=Bx(),b=d.useCallback(()=>{r&&(r.starred&&y({imageDTOs:[r]}),r.starred||x({imageDTOs:[r]}))},[x,y,r]),[w,k]=d.useState(!1),_=d.useCallback(()=>{k(!0)},[]),j=d.useCallback(()=>{k(!1)},[]),I=d.useMemo(()=>{if(r!=null&&r.starred)return h?h.on.icon:a.jsx(Py,{size:"20"});if(!(r!=null&&r.starred)&&w)return h?h.off.icon:a.jsx(jy,{size:"20"})},[r==null?void 0:r.starred,w,h]),M=d.useMemo(()=>r!=null&&r.starred?h?h.off.text:"Unstar":r!=null&&r.starred?"":h?h.on.text:"Star",[r==null?void 0:r.starred,h]);return r?a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none"},children:a.jsx($,{userSelect:"none",sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1"},children:a.jsx(Ya,{onClick:i,imageDTO:r,draggableData:v,isSelected:l,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(uc,{onClick:b,icon:I,tooltip:M}),w&&o&&a.jsx(uc,{onClick:m,icon:a.jsx(Wr,{}),tooltip:s("gallery.deleteImage"),styleOverrides:{bottom:2,top:"auto"}})]})})})}):a.jsx(Fne,{})},Une=d.memo(Wne),Gne=Pe((e,t)=>a.jsx(Ie,{className:"item-container",ref:t,p:1.5,children:e.children})),Kne=d.memo(Gne),qne=Pe((e,t)=>{const n=F(r=>r.gallery.galleryImageMinimumWidth);return a.jsx(Ua,{...e,className:"list-container",ref:t,sx:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr));`},children:e.children})}),Xne=d.memo(qne),Yne={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},Qne=()=>{const{t:e}=J(),t=d.useRef(null),[n,r]=d.useState(null),[o,s]=mM(Yne),i=F(w=>w.gallery.selectedBoardId),{currentViewTotal:l}=yne(i),u=F(Vx),{currentData:p,isFetching:h,isSuccess:m,isError:v}=Uj(u),[x]=Gj(),y=d.useMemo(()=>!p||!l?!1:p.ids.length<l,[p,l]),b=d.useCallback(()=>{y&&x({...u,offset:(p==null?void 0:p.ids.length)??0,limit:Kj})},[y,x,u,p==null?void 0:p.ids.length]);return d.useEffect(()=>{const{current:w}=t;return n&&w&&o({target:w,elements:{viewport:n}}),()=>{var k;return(k=s())==null?void 0:k.destroy()}},[n,o,s]),p?m&&(p==null?void 0:p.ids.length)===0?a.jsx($,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(tr,{label:e("gallery.noImagesInGallery"),icon:Vi})}):m&&p?a.jsxs(a.Fragment,{children:[a.jsx(Ie,{ref:t,"data-overlayscrollbars":"",h:"100%",children:a.jsx(bne,{style:{height:"100%"},data:p.ids,endReached:b,components:{Item:Kne,List:Xne},scrollerRef:r,itemContent:(w,k)=>a.jsx(Une,{imageName:k},k)})}),a.jsx(it,{onClick:b,isDisabled:!y,isLoading:h,loadingText:e("gallery.loading"),flexShrink:0,children:`Load More (${p.ids.length} of ${l})`})]}):v?a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsx(tr,{label:e("gallery.unableToLoad"),icon:bZ})}):null:a.jsx($,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(tr,{label:e("gallery.loading"),icon:Vi})})},Zne=d.memo(Qne),Jne=ie([be],e=>{const{galleryView:t}=e.gallery;return{galleryView:t}},we),ere=()=>{const e=d.useRef(null),t=d.useRef(null),{galleryView:n}=F(Jne),r=ee(),{isOpen:o,onToggle:s}=Er({defaultIsOpen:!0}),i=d.useCallback(()=>{r(GC("images"))},[r]),l=d.useCallback(()=>{r(GC("assets"))},[r]);return a.jsxs(N3,{layerStyle:"first",sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base",p:2},children:[a.jsxs(Ie,{sx:{w:"full"},children:[a.jsxs($,{ref:e,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[a.jsx(mte,{isOpen:o,onToggle:s}),a.jsx(_te,{})]}),a.jsx(Ie,{children:a.jsx(fte,{isOpen:o})})]}),a.jsxs($,{ref:t,direction:"column",gap:2,h:"full",w:"full",children:[a.jsx($,{sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:a.jsx(Qi,{index:n==="images"?0:1,variant:"unstyled",size:"sm",sx:{w:"full"},children:a.jsx(Zi,{children:a.jsxs(mn,{isAttached:!0,sx:{w:"full"},children:[a.jsx(Pr,{as:it,size:"sm",isChecked:n==="images",onClick:i,sx:{w:"full"},leftIcon:a.jsx(EZ,{}),children:"Images"}),a.jsx(Pr,{as:it,size:"sm",isChecked:n==="assets",onClick:l,sx:{w:"full"},leftIcon:a.jsx(zZ,{}),children:"Assets"})]})})})}),a.jsx(Zne,{})]})]})},tre=d.memo(ere),nre=ie(vo,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable,currentIteration:e.currentIteration,totalIterations:e.totalIterations,sessionId:e.sessionId,cancelType:e.cancelType,isCancelScheduled:e.isCancelScheduled}),{memoizeOptions:{resultEqualityCheck:_t}}),rre=e=>{const t=ee(),{btnGroupWidth:n="auto",asIconButton:r=!1,...o}=e,{isProcessing:s,isConnected:i,isCancelable:l,cancelType:u,isCancelScheduled:p,sessionId:h}=F(nre),m=d.useCallback(()=>{if(h){if(u==="scheduled"){t(jD());return}t(PD({session_id:h}))}},[t,h,u]),{t:v}=J(),x=d.useCallback(w=>{const k=Array.isArray(w)?w[0]:w;t(ID(k))},[t]);Qe("shift+x",()=>{(i||s)&&l&&m()},[i,s,l]);const y=d.useMemo(()=>v(p?"parameters.cancel.isScheduled":u==="immediate"?"parameters.cancel.immediate":"parameters.cancel.schedule"),[v,u,p]),b=d.useMemo(()=>p?a.jsx(Qp,{}):u==="immediate"?a.jsx(jne,{}):a.jsx(Sne,{}),[u,p]);return a.jsxs(mn,{isAttached:!0,width:n,children:[r?a.jsx(Te,{icon:b,tooltip:y,"aria-label":y,isDisabled:!i||!s||!l,onClick:m,colorScheme:"error",id:"cancel-button",...o}):a.jsx(it,{leftIcon:b,tooltip:y,"aria-label":y,isDisabled:!i||!s||!l,onClick:m,colorScheme:"error",id:"cancel-button",...o,children:v("parameters.cancel.cancel")}),a.jsxs(Dd,{closeOnSelect:!1,children:[a.jsx(Rd,{as:Te,tooltip:v("parameters.cancel.setType"),"aria-label":v("parameters.cancel.setType"),icon:a.jsx(Gee,{w:"1em",h:"1em"}),paddingX:0,paddingY:0,colorScheme:"error",minWidth:5,...o}),a.jsx(Ga,{minWidth:"240px",children:a.jsxs(J3,{value:u,title:"Cancel Type",type:"radio",onChange:x,children:[a.jsx(rh,{value:"immediate",children:v("parameters.cancel.immediate")}),a.jsx(rh,{value:"scheduled",children:v("parameters.cancel.schedule")})]})})]})]})},HM=d.memo(rre),ore=ie([be,wn],(e,t)=>{const{generation:n,system:r,nodes:o}=e,{initialImage:s,model:i}=n,{isProcessing:l,isConnected:u}=r,p=[];return l&&p.push(vt.t("parameters.invoke.systemBusy")),u||p.push(vt.t("parameters.invoke.systemDisconnected")),t==="img2img"&&!s&&p.push(vt.t("parameters.invoke.noInitialImageSelected")),t==="nodes"?o.shouldValidateGraph&&(o.nodes.length||p.push(vt.t("parameters.invoke.noNodesInGraph")),o.nodes.forEach(h=>{if(!Cn(h))return;const m=o.nodeTemplates[h.data.type];if(!m){p.push(vt.t("parameters.invoke.missingNodeTemplate"));return}const v=ED([h],o.edges);Tn(h.data.inputs,x=>{const y=m.inputs[x.name],b=v.some(w=>w.target===h.id&&w.targetHandle===x.name);if(!y){p.push(vt.t("parameters.invoke.missingFieldTemplate"));return}if(y.required&&x.value===void 0&&!b){p.push(vt.t("parameters.invoke.missingInputForField",{nodeLabel:h.data.label||m.title,fieldLabel:x.label||y.title}));return}})})):(i||p.push(vt.t("parameters.invoke.noModelSelected")),e.controlNet.isEnabled&&rr(e.controlNet.controlNets).forEach((h,m)=>{h.isEnabled&&(h.model||p.push(vt.t("parameters.invoke.noModelForControlNet",{index:m+1})),(!h.controlImage||!h.processedControlImage&&h.processorType!=="none")&&p.push(vt.t("parameters.invoke.noControlImageForControlNet",{index:m+1})))})),{isReady:!p.length,isProcessing:l,reasons:p}},we),Ud=()=>{const{isReady:e,isProcessing:t,reasons:n}=F(ore);return{isReady:e,isProcessing:t,reasons:n}},sre=ie(vo,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:_t}}),are=()=>{const{t:e}=J(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=F(sre),s=n?Math.round(n*100/r):0;return a.jsx(mP,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!o,height:"full",colorScheme:"accent"})},ire=d.memo(are);function VM(e){const{asIconButton:t=!1,sx:n,...r}=e,o=ee(),{isReady:s,isProcessing:i}=Ud(),l=F(wn),u=d.useCallback(()=>{o(bd()),o(mm(l))},[o,l]),{t:p}=J();return Qe(["ctrl+enter","meta+enter"],u,{enabled:()=>s,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[s,l]),a.jsx(Ie,{style:{flexGrow:4},position:"relative",children:a.jsxs(Ie,{style:{position:"relative"},children:[!s&&a.jsx(Ie,{sx:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip",borderRadius:"base",...n},...r,children:a.jsx(ire,{})}),t?a.jsx(Te,{"aria-label":p("parameters.invoke.invoke"),type:"submit",icon:a.jsx(_k,{}),isDisabled:!s,onClick:u,tooltip:a.jsx(fx,{}),colorScheme:"accent",isLoading:i,id:"invoke-button","data-progress":i,sx:{w:"full",flexGrow:1,...n},...r}):a.jsx(it,{tooltip:a.jsx(fx,{}),"aria-label":p("parameters.invoke.invoke"),type:"submit","data-progress":i,isDisabled:!s,onClick:u,colorScheme:"accent",id:"invoke-button",leftIcon:i?void 0:a.jsx(_k,{}),isLoading:i,loadingText:p("parameters.invoke.invoke"),sx:{w:"full",flexGrow:1,fontWeight:700,...n},...r,children:"Invoke"})]})})}const lre=ie([be],({gallery:e})=>{const{autoAddBoardId:t}=e;return{autoAddBoardId:t}},we),fx=d.memo(()=>{const{isReady:e,reasons:t}=Ud(),{autoAddBoardId:n}=F(lre),r=ug(n),{t:o}=J();return a.jsxs($,{flexDir:"column",gap:1,children:[a.jsx(ye,{fontWeight:600,children:o(e?"parameters.invoke.readyToInvoke":"parameters.invoke.unableToInvoke")}),t.length>0&&a.jsx(Id,{children:t.map((s,i)=>a.jsx(No,{children:a.jsx(ye,{fontWeight:400,children:s})},`${s}.${i}`))}),a.jsx(Br,{opacity:.2,borderColor:"base.50",_dark:{borderColor:"base.900"}}),a.jsxs(ye,{fontWeight:400,fontStyle:"oblique 10deg",children:[o("parameters.invoke.addingImagesTo")," ",a.jsx(ye,{as:"span",fontWeight:600,children:r||"Uncategorized"})]})]})});fx.displayName="InvokeButtonTooltipContent";const cre=()=>a.jsxs($,{layerStyle:"first",sx:{gap:2,borderRadius:"base",p:2},children:[a.jsx(VM,{}),a.jsx(HM,{})]}),WM=d.memo(cre),{createElement:Ic,createContext:ure,forwardRef:UM,useCallback:Ls,useContext:GM,useEffect:ea,useImperativeHandle:KM,useLayoutEffect:dre,useMemo:fre,useRef:$r,useState:Gu}=Nx,x_=Nx["useId".toString()],Ku=dre,pre=typeof x_=="function"?x_:()=>null;let hre=0;function Ey(e=null){const t=pre(),n=$r(e||t||null);return n.current===null&&(n.current=""+hre++),n.current}const bg=ure(null);bg.displayName="PanelGroupContext";function qM({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:i=null,maxSize:l=null,minSize:u,onCollapse:p=null,onResize:h=null,order:m=null,style:v={},tagName:x="div"}){const y=GM(bg);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const b=Ey(i),{collapsePanel:w,expandPanel:k,getPanelSize:_,getPanelStyle:j,registerPanel:I,resizePanel:M,units:E,unregisterPanel:O}=y;u==null&&(E==="percentages"?u=10:u=0);const D=$r({onCollapse:p,onResize:h});ea(()=>{D.current.onCollapse=p,D.current.onResize=h});const A=j(b,o),R=$r({size:b_(A)}),T=$r({callbacksRef:D,collapsedSize:n,collapsible:r,defaultSize:o,id:b,idWasAutoGenerated:i==null,maxSize:l,minSize:u,order:m});return Ku(()=>{R.current.size=b_(A),T.current.callbacksRef=D,T.current.collapsedSize=n,T.current.collapsible=r,T.current.defaultSize=o,T.current.id=b,T.current.idWasAutoGenerated=i==null,T.current.maxSize=l,T.current.minSize=u,T.current.order=m}),Ku(()=>(I(b,T),()=>{O(b)}),[m,b,I,O]),KM(s,()=>({collapse:()=>w(b),expand:()=>k(b),getCollapsed(){return R.current.size===0},getId(){return b},getSize(X){return _(b,X)},resize:(X,B)=>M(b,X,B)}),[w,k,_,b,M]),Ic(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,...v}})}const Wa=UM((e,t)=>Ic(qM,{...e,forwardedRef:t}));qM.displayName="Panel";Wa.displayName="forwardRef(Panel)";function b_(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const Gi=10;function Ru(e,t,n,r,o,s,i,l){const{id:u,panels:p,units:h}=t,m=h==="pixels"?Aa(u):NaN,{sizes:v}=l||{},x=v||s,y=Sr(p),b=x.concat();let w=0;{const j=o<0?r:n,I=y.findIndex(D=>D.current.id===j),M=y[I],E=x[I],O=px(h,m,M,E,E+Math.abs(o),e);if(E===O)return x;O===0&&E>0&&i.set(j,E),o=o<0?E-O:O-E}let k=o<0?n:r,_=y.findIndex(j=>j.current.id===k);for(;;){const j=y[_],I=x[_],M=Math.abs(o)-Math.abs(w),E=px(h,m,j,I,I-M,e);if(I!==E&&(E===0&&I>0&&i.set(j.current.id,I),w+=I-E,b[_]=E,w.toPrecision(Gi).localeCompare(Math.abs(o).toPrecision(Gi),void 0,{numeric:!0})>=0))break;if(o<0){if(--_<0)break}else if(++_>=y.length)break}return w===0?x:(k=o<0?r:n,_=y.findIndex(j=>j.current.id===k),b[_]=x[_]+w,b)}function Rl(e,t,n){t.forEach((r,o)=>{const s=e[o];if(!s)return;const{callbacksRef:i,collapsedSize:l,collapsible:u,id:p}=s.current,h=n[p];if(h!==r){n[p]=r;const{onCollapse:m,onResize:v}=i.current;v&&v(r,h),u&&m&&((h==null||h===l)&&r!==l?m(!1):h!==l&&r===l&&m(!0))}})}function mre({groupId:e,panels:t,units:n}){const r=n==="pixels"?Aa(e):NaN,o=Sr(t),s=Array(o.length);let i=0,l=100;for(let u=0;u<o.length;u++){const p=o[u],{defaultSize:h}=p.current;h!=null&&(i++,s[u]=n==="pixels"?h/r*100:h,l-=s[u])}for(let u=0;u<o.length;u++){const p=o[u];let{defaultSize:h,id:m,maxSize:v,minSize:x}=p.current;if(h!=null)continue;n==="pixels"&&(x=x/r*100,v!=null&&(v=v/r*100));const y=o.length-i,b=Math.min(v??100,Math.max(x,l/y));s[u]=b,i++,l-=b}if(l!==0)for(let u=0;u<o.length;u++){const p=o[u];let{maxSize:h,minSize:m}=p.current;n==="pixels"&&(m=m/r*100,h!=null&&(h=h/r*100));const v=Math.min(h??100,Math.max(m,s[u]+l));if(v!==s[u]&&(l-=v-s[u],s[u]=v,Math.abs(l).toFixed(3)==="0.000"))break}return Math.abs(l).toFixed(3),s}function Lv(e,t){if(t.length<2)return[null,null];const n=t.findIndex(i=>i.current.id===e);if(n<0)return[null,null];const r=n===t.length-1,o=r?t[n-1].current.id:e,s=r?e:t[n+1].current.id;return[o,s]}function Aa(e){const t=cd(e);if(t==null)return NaN;const n=t.getAttribute("data-panel-group-direction"),r=My(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 XM(e,t,n){if(e.size===1)return"100";const o=Sr(e).findIndex(i=>i.current.id===t),s=n[o];return s==null?"0":s.toPrecision(Gi)}function gre(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function cd(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function yg(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function vre(e){return YM().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function YM(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function My(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function Oy(e,t,n){var u,p,h,m;const r=yg(t),o=My(e),s=r?o.indexOf(r):-1,i=((p=(u=n[s])==null?void 0:u.current)==null?void 0:p.id)??null,l=((m=(h=n[s+1])==null?void 0:h.current)==null?void 0:m.id)??null;return[i,l]}function Sr(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 px(e,t,n,r,o,s=null){var h;let{collapsedSize:i,collapsible:l,maxSize:u,minSize:p}=n.current;if(e==="pixels"&&(i=i/t*100,u!=null&&(u=u/t*100),p=p/t*100),l){if(r>i){if(o<=p/2+i)return i}else if(!((h=s==null?void 0:s.type)==null?void 0:h.startsWith("key"))&&o<p)return i}return Math.min(u??100,Math.max(p,o))}function xre(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 zv({groupId:e,panels:t,nextSizes:n,prevSizes:r,units:o}){n=[...n];const s=Sr(t),i=o==="pixels"?Aa(e):NaN;let l=0;for(let u=0;u<s.length;u++){const p=s[u],h=r[u],m=n[u],v=px(o,i,p,h,m);m!=v&&(l+=m-v,n[u]=v)}if(l.toFixed(3)!=="0.000")for(let u=0;u<s.length;u++){const p=s[u];let{maxSize:h,minSize:m}=p.current;o==="pixels"&&(m=m/i*100,h!=null&&(h=h/i*100));const v=Math.min(h??100,Math.max(m,n[u]+l));if(v!==n[u]&&(l-=v-n[u],n[u]=v,Math.abs(l).toFixed(3)==="0.000"))break}return l.toFixed(3),n}function QM(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function bre({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){ea(()=>{const{direction:i,panels:l}=e.current,u=cd(t);QM(u!=null,`No group found for id "${t}"`);const{height:p,width:h}=u.getBoundingClientRect(),v=My(t).map(x=>{const y=x.getAttribute("data-panel-resize-handle-id"),b=Sr(l),[w,k]=Oy(t,y,b);if(w==null||k==null)return()=>{};let _=0,j=100,I=0,M=0;b.forEach(T=>{const{id:X,maxSize:B,minSize:U}=T.current;X===w?(_=U,j=B??100):(I+=U,M+=B??100)});const E=Math.min(j,100-I),O=Math.max(_,(b.length-1)*100-M),D=XM(l,w,o);x.setAttribute("aria-valuemax",""+Math.round(E)),x.setAttribute("aria-valuemin",""+Math.round(O)),x.setAttribute("aria-valuenow",""+Math.round(parseInt(D)));const A=T=>{if(!T.defaultPrevented)switch(T.key){case"Enter":{T.preventDefault();const X=b.findIndex(B=>B.current.id===w);if(X>=0){const B=b[X],U=o[X];if(U!=null){let Y=0;U.toPrecision(Gi)<=B.current.minSize.toPrecision(Gi)?Y=i==="horizontal"?h:p:Y=-(i==="horizontal"?h:p);const V=Ru(T,e.current,w,k,Y,o,s.current,null);o!==V&&r(V)}}break}}};x.addEventListener("keydown",A);const R=gre(w);return R!=null&&x.setAttribute("aria-controls",R.id),()=>{x.removeAttribute("aria-valuemax"),x.removeAttribute("aria-valuemin"),x.removeAttribute("aria-valuenow"),x.removeEventListener("keydown",A),R!=null&&x.removeAttribute("aria-controls")}});return()=>{v.forEach(x=>x())}},[e,t,n,s,r,o])}function yre({disabled:e,handleId:t,resizeHandler:n}){ea(()=>{if(e||n==null)return;const r=yg(t);if(r==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const i=YM(),l=vre(t);QM(l!==null);const u=s.shiftKey?l>0?l-1:i.length-1:l+1<i.length?l+1:0;i[u].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function Fv(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 ZM(e,t,n,r=0,o=null){const s=n==="horizontal";let i=0;if(hx(e))i=s?e.clientX:e.clientY;else if(mx(e)){const h=e.touches[0];i=s?h.screenX:h.screenY}else return 0;const l=yg(t),u=o||l.getBoundingClientRect(),p=s?u.left:u.top;return i-p-r}function Cre(e,t,n,r,o,s,i){const{dragOffset:l=0,dragHandleRect:u,sizes:p}=i||{},h=p||s;if(wre(e)){const m=o==="horizontal",x=cd(t).getBoundingClientRect(),y=m?x.width:x.height,b=e.shiftKey?10:100,w=y/b;let k=0;switch(e.key){case"ArrowDown":k=m?0:w;break;case"ArrowLeft":k=m?-w:0;break;case"ArrowRight":k=m?w:0;break;case"ArrowUp":k=m?0:-w;break;case"End":k=y;break;case"Home":k=-y;break}const[_,j]=Oy(t,n,r),I=k<0?_:j,M=r.findIndex(O=>O.current.id===I),E=r[M];if(E.current.collapsible){const O=h[M];(O===0||O.toPrecision(Gi)===E.current.minSize.toPrecision(Gi))&&(k=k<0?-E.current.minSize*y:E.current.minSize*y)}return k}else return ZM(e,n,o,l,u)}function wre(e){return e.type==="keydown"}function hx(e){return e.type.startsWith("mouse")}function mx(e){return e.type.startsWith("touch")}let gx=null,wi=null;function JM(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 Sre(){wi!==null&&(document.head.removeChild(wi),gx=null,wi=null)}function Bv(e){if(gx===e)return;gx=e;const t=JM(e);wi===null&&(wi=document.createElement("style"),document.head.appendChild(wi)),wi.innerHTML=`*{cursor: ${t}!important;}`}function kre(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function eO(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 tO(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 _re(e,t,n){const r=tO(e,n);if(r){const o=eO(t);return r[o]??null}return null}function jre(e,t,n,r){const o=eO(t),s=tO(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(i){console.error(i)}}const Hv={};function y_(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 Au={getItem:e=>(y_(Au),Au.getItem(e)),setItem:(e,t)=>{y_(Au),Au.setItem(e,t)}};function nO({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:i=null,onLayout:l,storage:u=Au,style:p={},tagName:h="div",units:m="percentages"}){const v=Ey(i),[x,y]=Gu(null),[b,w]=Gu(new Map),k=$r(null);$r({didLogDefaultSizeWarning:!1,didLogIdAndOrderWarning:!1,didLogInvalidLayoutWarning:!1,prevPanelIds:[]});const _=$r({onLayout:l});ea(()=>{_.current.onLayout=l});const j=$r({}),[I,M]=Gu([]),E=$r(new Map),O=$r(0),D=$r({direction:r,id:v,panels:b,sizes:I,units:m});KM(s,()=>({getId:()=>v,getLayout:z=>{const{sizes:K,units:re}=D.current;if((z??re)==="pixels"){const le=Aa(v);return K.map(se=>se/100*le)}else return K},setLayout:(z,K)=>{const{id:re,panels:Q,sizes:le,units:se}=D.current;if((K||se)==="pixels"){const ae=Aa(re);z=z.map(oe=>oe/ae*100)}const W=j.current,G=Sr(Q),te=zv({groupId:re,panels:Q,nextSizes:z,prevSizes:le,units:se});Fv(le,te)||(M(te),Rl(G,te,W))}}),[v]),Ku(()=>{D.current.direction=r,D.current.id=v,D.current.panels=b,D.current.sizes=I,D.current.units=m}),bre({committedValuesRef:D,groupId:v,panels:b,setSizes:M,sizes:I,panelSizeBeforeCollapse:E}),ea(()=>{const{onLayout:z}=_.current,{panels:K,sizes:re}=D.current;if(re.length>0){z&&z(re);const Q=j.current,le=Sr(K);Rl(le,re,Q)}},[I]),Ku(()=>{const{id:z,sizes:K,units:re}=D.current;if(K.length===b.size)return;let Q=null;if(e){const le=Sr(b);Q=_re(e,le,u)}if(Q!=null){const le=zv({groupId:z,panels:b,nextSizes:Q,prevSizes:Q,units:re});M(le)}else{const le=mre({groupId:z,panels:b,units:re});M(le)}},[e,b,u]),ea(()=>{if(e){if(I.length===0||I.length!==b.size)return;const z=Sr(b);Hv[e]||(Hv[e]=kre(jre,100)),Hv[e](e,z,I,u)}},[e,b,I,u]),Ku(()=>{if(m==="pixels"){const z=new ResizeObserver(()=>{const{panels:K,sizes:re}=D.current,Q=zv({groupId:v,panels:K,nextSizes:re,prevSizes:re,units:m});Fv(re,Q)||M(Q)});return z.observe(cd(v)),()=>{z.disconnect()}}},[v,m]);const A=Ls((z,K)=>{const{panels:re,units:Q}=D.current,se=Sr(re).findIndex(te=>te.current.id===z),W=I[se];if((K??Q)==="pixels"){const te=Aa(v);return W/100*te}else return W},[v,I]),R=Ls((z,K)=>{const{panels:re}=D.current;return re.size===0?{flexBasis:0,flexGrow:K??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:XM(re,z,I),flexShrink:1,overflow:"hidden",pointerEvents:o&&x!==null?"none":void 0}},[x,o,I]),T=Ls((z,K)=>{const{units:re}=D.current;xre(re,K),w(Q=>{if(Q.has(z))return Q;const le=new Map(Q);return le.set(z,K),le})},[]),X=Ls(z=>re=>{re.preventDefault();const{direction:Q,panels:le,sizes:se}=D.current,W=Sr(le),[G,te]=Oy(v,z,W);if(G==null||te==null)return;let ae=Cre(re,v,z,W,Q,se,k.current);if(ae===0)return;const pe=cd(v).getBoundingClientRect(),fe=Q==="horizontal";document.dir==="rtl"&&fe&&(ae=-ae);const ge=fe?pe.width:pe.height,Ce=ae/ge*100,me=Ru(re,D.current,G,te,Ce,se,E.current,k.current),de=!Fv(se,me);if((hx(re)||mx(re))&&O.current!=Ce&&Bv(de?fe?"horizontal":"vertical":fe?ae<0?"horizontal-min":"horizontal-max":ae<0?"vertical-min":"vertical-max"),de){const De=j.current;M(me),Rl(W,me,De)}O.current=Ce},[v]),B=Ls(z=>{w(K=>{if(!K.has(z))return K;const re=new Map(K);return re.delete(z),re})},[]),U=Ls(z=>{const{panels:K,sizes:re}=D.current,Q=K.get(z);if(Q==null)return;const{collapsedSize:le,collapsible:se}=Q.current;if(!se)return;const W=Sr(K),G=W.indexOf(Q);if(G<0)return;const te=re[G];if(te===le)return;E.current.set(z,te);const[ae,oe]=Lv(z,W);if(ae==null||oe==null)return;const fe=G===W.length-1?te:le-te,ge=Ru(null,D.current,ae,oe,fe,re,E.current,null);if(re!==ge){const Ce=j.current;M(ge),Rl(W,ge,Ce)}},[]),Y=Ls(z=>{const{panels:K,sizes:re}=D.current,Q=K.get(z);if(Q==null)return;const{collapsedSize:le,minSize:se}=Q.current,W=E.current.get(z)||se;if(!W)return;const G=Sr(K),te=G.indexOf(Q);if(te<0||re[te]!==le)return;const[oe,pe]=Lv(z,G);if(oe==null||pe==null)return;const ge=te===G.length-1?le-W:W,Ce=Ru(null,D.current,oe,pe,ge,re,E.current,null);if(re!==Ce){const me=j.current;M(Ce),Rl(G,Ce,me)}},[]),V=Ls((z,K,re)=>{const{id:Q,panels:le,sizes:se,units:W}=D.current;if((re||W)==="pixels"){const rt=Aa(Q);K=K/rt*100}const G=le.get(z);if(G==null)return;let{collapsedSize:te,collapsible:ae,maxSize:oe,minSize:pe}=G.current;if(W==="pixels"){const rt=Aa(Q);pe=pe/rt*100,oe!=null&&(oe=oe/rt*100)}const fe=Sr(le),ge=fe.indexOf(G);if(ge<0)return;const Ce=se[ge];if(Ce===K)return;ae&&K===te||(K=Math.min(oe??100,Math.max(pe,K)));const[me,de]=Lv(z,fe);if(me==null||de==null)return;const je=ge===fe.length-1?Ce-K:K-Ce,Be=Ru(null,D.current,me,de,je,se,E.current,null);if(se!==Be){const rt=j.current;M(Be),Rl(fe,Be,rt)}},[]),L=fre(()=>({activeHandleId:x,collapsePanel:U,direction:r,expandPanel:Y,getPanelSize:A,getPanelStyle:R,groupId:v,registerPanel:T,registerResizeHandle:X,resizePanel:V,startDragging:(z,K)=>{if(y(z),hx(K)||mx(K)){const re=yg(z);k.current={dragHandleRect:re.getBoundingClientRect(),dragOffset:ZM(K,z,r),sizes:D.current.sizes}}},stopDragging:()=>{Sre(),y(null),k.current=null},units:m,unregisterPanel:B}),[x,U,r,Y,A,R,v,T,X,V,m,B]),q={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Ic(bg.Provider,{children:Ic(h,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":v,"data-panel-group-units":m,style:{...q,...p}}),value:L})}const Cg=UM((e,t)=>Ic(nO,{...e,forwardedRef:t}));nO.displayName="PanelGroup";Cg.displayName="forwardRef(PanelGroup)";function vx({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:i="div"}){const l=$r(null),u=$r({onDragging:o});ea(()=>{u.current.onDragging=o});const p=GM(bg);if(p===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:h,direction:m,groupId:v,registerResizeHandle:x,startDragging:y,stopDragging:b}=p,w=Ey(r),k=h===w,[_,j]=Gu(!1),[I,M]=Gu(null),E=Ls(()=>{l.current.blur(),b();const{onDragging:A}=u.current;A&&A(!1)},[b]);ea(()=>{if(n)M(null);else{const D=x(w);M(()=>D)}},[n,w,x]),ea(()=>{if(n||I==null||!k)return;const D=X=>{I(X)},A=X=>{I(X)},T=l.current.ownerDocument;return T.body.addEventListener("contextmenu",E),T.body.addEventListener("mousemove",D),T.body.addEventListener("touchmove",D),T.body.addEventListener("mouseleave",A),window.addEventListener("mouseup",E),window.addEventListener("touchend",E),()=>{T.body.removeEventListener("contextmenu",E),T.body.removeEventListener("mousemove",D),T.body.removeEventListener("touchmove",D),T.body.removeEventListener("mouseleave",A),window.removeEventListener("mouseup",E),window.removeEventListener("touchend",E)}},[m,n,k,I,E]),yre({disabled:n,handleId:w,resizeHandler:I});const O={cursor:JM(m),touchAction:"none",userSelect:"none"};return Ic(i,{children:e,className:t,"data-resize-handle-active":k?"pointer":_?"keyboard":void 0,"data-panel-group-direction":m,"data-panel-group-id":v,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":w,onBlur:()=>j(!1),onFocus:()=>j(!0),onMouseDown:D=>{y(w,D.nativeEvent);const{onDragging:A}=u.current;A&&A(!0)},onMouseUp:E,onTouchCancel:E,onTouchEnd:E,onTouchStart:D=>{y(w,D.nativeEvent);const{onDragging:A}=u.current;A&&A(!0)},ref:l,role:"separator",style:{...O,...s},tabIndex:0})}vx.displayName="PanelResizeHandle";const Pre=e=>{const{direction:t="horizontal",collapsedDirection:n,isCollapsed:r=!1,...o}=e,s=Ti("base.100","base.850"),i=Ti("base.300","base.700");return t==="horizontal"?a.jsx(vx,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx($,{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:i}}},...o,children:a.jsx(Ie,{sx:{w:1,h:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})}):a.jsx(vx,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx($,{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:i}}},...o,children:a.jsx(Ie,{sx:{h:1,w:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})})},om=d.memo(Pre),Dy=()=>{const e=ee(),t=F(o=>o.ui.panels),n=d.useCallback(o=>t[o]??"",[t]),r=d.useCallback((o,s)=>{e(MD({name:o,value:s}))},[e]);return{getItem:n,setItem:r}};const Ire=e=>{const{label:t,data:n,fileName:r,withDownload:o=!0,withCopy:s=!0}=e,i=d.useMemo(()=>OD(n)?n:JSON.stringify(n,null,2),[n]),l=d.useCallback(()=>{navigator.clipboard.writeText(i)},[i]),u=d.useCallback(()=>{const h=new Blob([i]),m=document.createElement("a");m.href=URL.createObjectURL(h),m.download=`${r||t}.json`,document.body.appendChild(m),m.click(),m.remove()},[i,t,r]),{t:p}=J();return a.jsxs($,{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(lg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsx("pre",{children:i})})}),a.jsxs($,{sx:{position:"absolute",top:0,insetInlineEnd:0,p:2},children:[o&&a.jsx(Rt,{label:`${p("gallery.download")} ${t} JSON`,children:a.jsx(ps,{"aria-label":`${p("gallery.download")} ${t} JSON`,icon:a.jsx(Jm,{}),variant:"ghost",opacity:.7,onClick:u})}),s&&a.jsx(Rt,{label:`${p("gallery.copy")} ${t} JSON`,children:a.jsx(ps,{"aria-label":`${p("gallery.copy")} ${t} JSON`,icon:a.jsx(Hc,{}),variant:"ghost",opacity:.7,onClick:l})})]})]})},Oi=d.memo(Ire),Ere=ie(be,({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}},we),Mre=()=>{const{data:e}=F(Ere);return e?a.jsx(Oi,{data:e,label:"Node Data"}):a.jsx(tr,{label:"No node selected",icon:null})},Ore=d.memo(Mre),Dre=e=>a.jsx($,{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(lg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:e.children})})}),Ry=d.memo(Dre),Rre=({output:e})=>{const{image:t}=e,{data:n}=po(t.image_name);return a.jsx(Ya,{imageDTO:n})},Are=d.memo(Rre),Nre=ie(be,({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}},we),Tre=()=>{const{node:e,template:t,nes:n}=F(Nre),{t:r}=J();return!e||!n||!Cn(e)?a.jsx(tr,{label:r("nodes.noNodeSelected"),icon:null}):n.outputs.length===0?a.jsx(tr,{label:r("nodes.noOutputRecorded"),icon:null}):a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Ry,{children:a.jsx($,{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(Are,{output:o},Lre(o,s))):a.jsx(Oi,{data:n.outputs,label:r("nodes.nodesOutputs")})})})})},$re=d.memo(Tre),Lre=(e,t)=>`${e.type}-${t}`,zre=ie(be,({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}},we),Fre=()=>{const{template:e}=F(zre),{t}=J();return e?a.jsx(Oi,{data:e,label:t("nodes.NodeTemplate")}):a.jsx(tr,{label:t("nodes.noNodeSelected"),icon:null})},Bre=d.memo(Fre),Hre=()=>a.jsx($,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(Qi,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(Zi,{children:[a.jsx(Pr,{children:"Outputs"}),a.jsx(Pr,{children:"Data"}),a.jsx(Pr,{children:"Template"})]}),a.jsxs(zc,{children:[a.jsx(fo,{children:a.jsx($re,{})}),a.jsx(fo,{children:a.jsx(Ore,{})}),a.jsx(fo,{children:a.jsx(Bre,{})})]})]})}),Vre=d.memo(Hre),Ay=e=>{e.stopPropagation()},Wre={display:"flex",flexDirection:"row",alignItems:"center",gap:10},Ure=e=>{const{label:t="",labelPos:n="top",isDisabled:r=!1,isInvalid:o,formControlProps:s,...i}=e,l=ee(),u=d.useCallback(h=>{h.shiftKey&&l(Ir(!0))},[l]),p=d.useCallback(h=>{h.shiftKey||l(Ir(!1))},[l]);return a.jsxs(fn,{isInvalid:o,isDisabled:r,...s,style:n==="side"?Wre:void 0,children:[t!==""&&a.jsx(Gn,{children:t}),a.jsx(Pm,{...i,onPaste:Ay,onKeyDown:u,onKeyUp:p})]})},io=d.memo(Ure),Gre=Pe((e,t)=>{const n=ee(),r=d.useCallback(s=>{s.shiftKey&&n(Ir(!0))},[n]),o=d.useCallback(s=>{s.shiftKey||n(Ir(!1))},[n]);return a.jsx(DP,{ref:t,onPaste:Ay,onKeyDown:r,onKeyUp:o,...e})}),oa=d.memo(Gre),Kre=ie(be,({nodes:e})=>{const{author:t,name:n,description:r,tags:o,version:s,contact:i,notes:l}=e.workflow;return{name:n,author:t,description:r,tags:o,version:s,contact:i,notes:l}},we),qre=()=>{const{author:e,name:t,description:n,tags:r,version:o,contact:s,notes:i}=F(Kre),l=ee(),u=d.useCallback(w=>{l(DD(w.target.value))},[l]),p=d.useCallback(w=>{l(RD(w.target.value))},[l]),h=d.useCallback(w=>{l(AD(w.target.value))},[l]),m=d.useCallback(w=>{l(ND(w.target.value))},[l]),v=d.useCallback(w=>{l(TD(w.target.value))},[l]),x=d.useCallback(w=>{l($D(w.target.value))},[l]),y=d.useCallback(w=>{l(LD(w.target.value))},[l]),{t:b}=J();return a.jsx(Ry,{children:a.jsxs($,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:[a.jsxs($,{sx:{gap:2,w:"full"},children:[a.jsx(io,{label:b("nodes.workflowName"),value:t,onChange:u}),a.jsx(io,{label:b("nodes.workflowVersion"),value:o,onChange:m})]}),a.jsxs($,{sx:{gap:2,w:"full"},children:[a.jsx(io,{label:b("nodes.workflowAuthor"),value:e,onChange:p}),a.jsx(io,{label:b("nodes.workflowContact"),value:s,onChange:h})]}),a.jsx(io,{label:b("nodes.workflowTags"),value:r,onChange:x}),a.jsxs(fn,{as:$,sx:{flexDir:"column"},children:[a.jsx(Gn,{children:b("nodes.workflowDescription")}),a.jsx(oa,{onChange:v,value:n,fontSize:"sm",sx:{resize:"none"}})]}),a.jsxs(fn,{as:$,sx:{flexDir:"column",h:"full"},children:[a.jsx(Gn,{children:b("nodes.workflowNotes")}),a.jsx(oa,{onChange:y,value:i,fontSize:"sm",sx:{h:"full",resize:"none"}})]})]})})},Xre=d.memo(qre);function Yre(e,t,n){var r=this,o=d.useRef(null),s=d.useRef(0),i=d.useRef(null),l=d.useRef([]),u=d.useRef(),p=d.useRef(),h=d.useRef(e),m=d.useRef(!0);d.useEffect(function(){h.current=e},[e]);var v=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var x=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,b="maxWait"in n,w=b?Math.max(+n.maxWait||0,t):null;d.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var k=d.useMemo(function(){var _=function(D){var A=l.current,R=u.current;return l.current=u.current=null,s.current=D,p.current=h.current.apply(R,A)},j=function(D,A){v&&cancelAnimationFrame(i.current),i.current=v?requestAnimationFrame(D):setTimeout(D,A)},I=function(D){if(!m.current)return!1;var A=D-o.current;return!o.current||A>=t||A<0||b&&D-s.current>=w},M=function(D){return i.current=null,y&&l.current?_(D):(l.current=u.current=null,p.current)},E=function D(){var A=Date.now();if(I(A))return M(A);if(m.current){var R=t-(A-o.current),T=b?Math.min(R,w-(A-s.current)):R;j(D,T)}},O=function(){var D=Date.now(),A=I(D);if(l.current=[].slice.call(arguments),u.current=r,o.current=D,A){if(!i.current&&m.current)return s.current=o.current,j(E,t),x?_(o.current):p.current;if(b)return j(E,t),_(o.current)}return i.current||j(E,t),p.current};return O.cancel=function(){i.current&&(v?cancelAnimationFrame(i.current):clearTimeout(i.current)),s.current=0,l.current=o.current=u.current=i.current=null},O.isPending=function(){return!!i.current},O.flush=function(){return i.current?M(Date.now()):p.current},O},[x,b,t,w,y,v]);return k}function Qre(e,t){return e===t}function C_(e){return typeof e=="function"?function(){return e}:e}function Zre(e,t,n){var r,o,s=n&&n.equalityFn||Qre,i=(r=d.useState(C_(e)),o=r[1],[r[0],d.useCallback(function(m){return o(C_(m))},[])]),l=i[0],u=i[1],p=Yre(d.useCallback(function(m){return u(m)},[u]),t,n),h=d.useRef(e);return s(h.current,e)||(p(e),h.current=e),[l,p]}const rO=()=>{const e=F(r=>r.nodes),[t]=Zre(e,300);return d.useMemo(()=>zD(t),[t])},Jre=()=>{const e=rO(),{t}=J();return a.jsx($,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:a.jsx(Oi,{data:e,label:t("nodes.workflow")})})},eoe=d.memo(Jre),toe=({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}}})},oO=d.memo(toe),sO=e=>{const t=ee(),n=d.useMemo(()=>ie(be,({nodes:i})=>i.mouseOverNode===e,we),[e]),r=F(n),o=d.useCallback(()=>{!r&&t(KC(e))},[t,e,r]),s=d.useCallback(()=>{r&&t(KC(null))},[t,r]);return{isMouseOverNode:r,handleMouseOver:o,handleMouseOut:s}},aO=(e,t)=>{const n=d.useMemo(()=>ie(be,({nodes:o})=>{var i;const s=o.nodes.find(l=>l.id===e);if(Cn(s))return(i=s==null?void 0:s.data.inputs[t])==null?void 0:i.label},we),[t,e]);return F(n)},iO=(e,t,n)=>{const r=d.useMemo(()=>ie(be,({nodes:s})=>{var u;const i=s.nodes.find(p=>p.id===e);if(!Cn(i))return;const l=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return(u=l==null?void 0:l[Wx[n]][t])==null?void 0:u.title},we),[t,n,e]);return F(r)},lO=(e,t)=>{const n=d.useMemo(()=>ie(be,({nodes:o})=>{const s=o.nodes.find(i=>i.id===e);if(Cn(s))return s==null?void 0:s.data.inputs[t]},we),[t,e]);return F(n)},wg=(e,t,n)=>{const r=d.useMemo(()=>ie(be,({nodes:s})=>{const i=s.nodes.find(u=>u.id===e);if(!Cn(i))return;const l=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return l==null?void 0:l[Wx[n]][t]},we),[t,n,e]);return F(r)},noe=({nodeId:e,fieldName:t,kind:n})=>{const r=lO(e,t),o=wg(e,t,n),s=FD(o),{t:i}=J(),l=d.useMemo(()=>BD(r)?r.label&&(o!=null&&o.title)?`${r.label} (${o.title})`:r.label&&!o?r.label:!r.label&&o?o.title:i("nodes.unknownField"):(o==null?void 0:o.title)||i("nodes.unknownField"),[r,o,i]);return a.jsxs($,{sx:{flexDir:"column"},children:[a.jsx(ye,{sx:{fontWeight:600},children:l}),o&&a.jsx(ye,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:o.description}),o&&a.jsxs(ye,{children:["Type: ",yd[o.type].title]}),s&&a.jsxs(ye,{children:["Input: ",HD(o.input)]})]})},Ny=d.memo(noe),roe=Pe((e,t)=>{const{nodeId:n,fieldName:r,kind:o,isMissingInput:s=!1,withTooltip:i=!1}=e,l=aO(n,r),u=iO(n,r,o),{t:p}=J(),h=ee(),[m,v]=d.useState(l||u||p("nodes.unknownFeild")),x=d.useCallback(async b=>{b&&(b===l||b===u)||(v(b||u||p("nodes.unknownField")),h(VD({nodeId:n,fieldName:r,label:b})))},[l,u,h,n,r,p]),y=d.useCallback(b=>{v(b)},[]);return d.useEffect(()=>{v(l||u||p("nodes.unknownField"))},[l,u,p]),a.jsx(Rt,{label:i?a.jsx(Ny,{nodeId:n,fieldName:r,kind:"input"}):void 0,openDelay:gm,placement:"top",hasArrow:!0,children:a.jsx($,{ref:t,sx:{position:"relative",overflow:"hidden",alignItems:"center",justifyContent:"flex-start",gap:1,h:"full"},children:a.jsxs(km,{value:m,onChange:y,onSubmit:x,as:$,sx:{position:"relative",alignItems:"center",h:"full"},children:[a.jsx(Sm,{sx:{p:0,fontWeight:s?600:400,textAlign:"left",_hover:{fontWeight:"600 !important"}},noOfLines:1}),a.jsx(wm,{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(uO,{})]})})})}),cO=d.memo(roe),uO=d.memo(()=>{const{isEditing:e,getEditButtonProps:t}=V5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&(o(r),r.preventDefault())},[t]);return e?null:a.jsx($,{onClick:n,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,cursor:"text"})});uO.displayName="EditableControls";const ooe=e=>{const{nodeId:t,field:n}=e,r=ee(),o=d.useCallback(s=>{r(WD({nodeId:t,fieldName:n.name,value:s.target.checked}))},[r,n.name,t]);return a.jsx(zb,{className:"nodrag",onChange:o,isChecked:n.value})},soe=d.memo(ooe);function Sg(){return(Sg=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 dO(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 xx(e){var t=d.useRef(e),n=d.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Ec=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},qu=function(e){return"touches"in e},bx=function(e){return e&&e.ownerDocument.defaultView||self},w_=function(e,t,n){var r=e.getBoundingClientRect(),o=qu(t)?function(s,i){for(var l=0;l<s.length;l++)if(s[l].identifier===i)return s[l];return s[0]}(t.touches,n):t;return{left:Ec((o.pageX-(r.left+bx(e).pageXOffset))/r.width),top:Ec((o.pageY-(r.top+bx(e).pageYOffset))/r.height)}},S_=function(e){!qu(e)&&e.preventDefault()},Ty=H.memo(function(e){var t=e.onMove,n=e.onKey,r=dO(e,["onMove","onKey"]),o=d.useRef(null),s=xx(t),i=xx(n),l=d.useRef(null),u=d.useRef(!1),p=d.useMemo(function(){var x=function(w){S_(w),(qu(w)?w.touches.length>0:w.buttons>0)&&o.current?s(w_(o.current,w,l.current)):b(!1)},y=function(){return b(!1)};function b(w){var k=u.current,_=bx(o.current),j=w?_.addEventListener:_.removeEventListener;j(k?"touchmove":"mousemove",x),j(k?"touchend":"mouseup",y)}return[function(w){var k=w.nativeEvent,_=o.current;if(_&&(S_(k),!function(I,M){return M&&!qu(I)}(k,u.current)&&_)){if(qu(k)){u.current=!0;var j=k.changedTouches||[];j.length&&(l.current=j[0].identifier)}_.focus(),s(w_(_,k,l.current)),b(!0)}},function(w){var k=w.which||w.keyCode;k<37||k>40||(w.preventDefault(),i({left:k===39?.05:k===37?-.05:0,top:k===40?.05:k===38?-.05:0}))},b]},[i,s]),h=p[0],m=p[1],v=p[2];return d.useEffect(function(){return v},[v]),H.createElement("div",Sg({},r,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:o,onKeyDown:m,tabIndex:0,role:"slider"}))}),kg=function(e){return e.filter(Boolean).join(" ")},$y=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=kg(["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}}))},dr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},fO=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:dr(e.h),s:dr(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:dr(o/2),a:dr(r,2)}},yx=function(e){var t=fO(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Vv=function(e){var t=fO(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},aoe=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var s=Math.floor(t),i=r*(1-n),l=r*(1-(t-s)*n),u=r*(1-(1-t+s)*n),p=s%6;return{r:dr(255*[r,l,i,i,u,r][p]),g:dr(255*[u,r,r,l,i,i][p]),b:dr(255*[i,i,u,r,r,l][p]),a:dr(o,2)}},ioe=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),i=s-Math.min(t,n,r),l=i?s===t?(n-r)/i:s===n?2+(r-t)/i:4+(t-n)/i:0;return{h:dr(60*(l<0?l+6:l)),s:dr(s?i/s*100:0),v:dr(s/255*100),a:o}},loe=H.memo(function(e){var t=e.hue,n=e.onChange,r=kg(["react-colorful__hue",e.className]);return H.createElement("div",{className:r},H.createElement(Ty,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Ec(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":dr(t),"aria-valuemax":"360","aria-valuemin":"0"},H.createElement($y,{className:"react-colorful__hue-pointer",left:t/360,color:yx({h:t,s:100,v:100,a:1})})))}),coe=H.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:yx({h:t.h,s:100,v:100,a:1})};return H.createElement("div",{className:"react-colorful__saturation",style:r},H.createElement(Ty,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Ec(t.s+100*o.left,0,100),v:Ec(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+dr(t.s)+"%, Brightness "+dr(t.v)+"%"},H.createElement($y,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:yx(t)})))}),pO=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function uoe(e,t,n){var r=xx(n),o=d.useState(function(){return e.toHsva(t)}),s=o[0],i=o[1],l=d.useRef({color:t,hsva:s});d.useEffect(function(){if(!e.equal(t,l.current.color)){var p=e.toHsva(t);l.current={hsva:p,color:t},i(p)}},[t,e]),d.useEffect(function(){var p;pO(s,l.current.hsva)||e.equal(p=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:p},r(p))},[s,e,r]);var u=d.useCallback(function(p){i(function(h){return Object.assign({},h,p)})},[]);return[s,u]}var doe=typeof window<"u"?d.useLayoutEffect:d.useEffect,foe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},k_=new Map,poe=function(e){doe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!k_.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}`,k_.set(t,n);var r=foe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},hoe=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+Vv(Object.assign({},n,{a:0}))+", "+Vv(Object.assign({},n,{a:1}))+")"},s=kg(["react-colorful__alpha",t]),i=dr(100*n.a);return H.createElement("div",{className:s},H.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),H.createElement(Ty,{onMove:function(l){r({a:l.left})},onKey:function(l){r({a:Ec(n.a+l.left)})},"aria-label":"Alpha","aria-valuetext":i+"%","aria-valuenow":i,"aria-valuemin":"0","aria-valuemax":"100"},H.createElement($y,{className:"react-colorful__alpha-pointer",left:n.a,color:Vv(n)})))},moe=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,i=dO(e,["className","colorModel","color","onChange"]),l=d.useRef(null);poe(l);var u=uoe(n,o,s),p=u[0],h=u[1],m=kg(["react-colorful",t]);return H.createElement("div",Sg({},i,{ref:l,className:m}),H.createElement(coe,{hsva:p,onChange:h}),H.createElement(loe,{hue:p.h,onChange:h}),H.createElement(hoe,{hsva:p,onChange:h,className:"react-colorful__last-control"}))},goe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:ioe,fromHsva:aoe,equal:pO},hO=function(e){return H.createElement(moe,Sg({},e,{colorModel:goe}))};const voe=e=>{const{nodeId:t,field:n}=e,r=ee(),o=d.useCallback(s=>{r(UD({nodeId:t,fieldName:n.name,value:s}))},[r,n.name,t]);return a.jsx(hO,{className:"nodrag",color:n.value,onChange:o})},xoe=d.memo(voe),mO=e=>{const t=qi("models"),[n,r,o]=e.split("/"),s=GD.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},boe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=ee(),{data:s}=Ux(),i=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]),l=d.useMemo(()=>{if(!s)return[];const p=[];return Tn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:dn[h.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const h=mO(p);h&&o(KD({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx($n,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:l,onChange:u,sx:{width:"100%"}})},yoe=d.memo(boe),Coe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=ee(),s=d.useCallback(i=>{o(qD({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return a.jsx(xP,{className:"nowheel nodrag",onChange:s,value:n.value,children:r.options.map(i=>a.jsx("option",{value:i,children:r.ui_choice_labels?r.ui_choice_labels[i]:i},i))})},woe=d.memo(Coe),Soe=e=>{var p;const{nodeId:t,field:n}=e,r=ee(),{currentData:o}=po(((p=n.value)==null?void 0:p.image_name)??Fr.skipToken),s=d.useCallback(()=>{r(XD({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),i=d.useMemo(()=>{if(o)return{id:`node-${t}-${n.name}`,payloadType:"IMAGE_DTO",payload:{imageDTO:o}}},[n.name,o,t]),l=d.useMemo(()=>({id:`node-${t}-${n.name}`,actionType:"SET_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}}),[n.name,t]),u=d.useMemo(()=>({type:"SET_NODES_IMAGE",nodeId:t,fieldName:n.name}),[t,n.name]);return a.jsx($,{className:"nodrag",sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Ya,{imageDTO:o,droppableData:l,draggableData:i,postUploadAction:u,useThumbailFallback:!0,uploadElement:a.jsx(gO,{}),dropLabel:a.jsx(vO,{}),minSize:8,children:a.jsx(uc,{onClick:s,icon:o?a.jsx(tg,{}):void 0,tooltip:"Reset Image"})})})},koe=d.memo(Soe),gO=d.memo(()=>a.jsx(ye,{fontSize:16,fontWeight:600,children:"Drop or Upload"}));gO.displayName="UploadElement";const vO=d.memo(()=>a.jsx(ye,{fontSize:16,fontWeight:600,children:"Drop"}));vO.displayName="DropLabel";const _oe=e=>{const t=qi("models"),[n,r,o]=e.split("/"),s=YD.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},joe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=ee(),{data:s}=vm(),{t:i}=J(),l=d.useMemo(()=>{if(!s)return[];const h=[];return Tn(s.entities,(m,v)=>{m&&h.push({value:v,label:m.model_name,group:dn[m.base_model]})}),h.sort((m,v)=>m.disabled&&!v.disabled?1:-1)},[s]),u=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(h=>{if(!h)return;const m=_oe(h);m&&o(QD({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return(s==null?void 0:s.ids.length)===0?a.jsx($,{sx:{justifyContent:"center",p:2},children:a.jsx(ye,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(Kt,{className:"nowheel nodrag",value:(u==null?void 0:u.id)??null,placeholder:l.length>0?i("models.selectLoRA"):i("models.noLoRAsAvailable"),data:l,nothingFound:i("models.noMatchingLoRAs"),itemComponent:ri,disabled:l.length===0,filter:(h,m)=>{var v;return((v=m.label)==null?void 0:v.toLowerCase().includes(h.toLowerCase().trim()))||m.value.toLowerCase().includes(h.toLowerCase().trim())},error:!u,onChange:p,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},Poe=d.memo(joe),_g=e=>{const t=qi("models"),[n,r,o]=e.split("/"),s=ZD.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 Wc(e){const{iconMode:t=!1,...n}=e,r=ee(),{t:o}=J(),[s,{isLoading:i}]=JD(),l=()=>{s().unwrap().then(u=>{r(Tt(Ft({title:`${o("modelManager.modelsSynced")}`,status:"success"})))}).catch(u=>{u&&r(Tt(Ft({title:`${o("modelManager.modelSyncFailed")}`,status:"error"})))})};return t?a.jsx(Te,{icon:a.jsx(LE,{}),tooltip:o("modelManager.syncModels"),"aria-label":o("modelManager.syncModels"),isLoading:i,onClick:l,size:"sm",...n}):a.jsx(it,{isLoading:i,onClick:l,minW:"max-content",...n,children:"Sync Models"})}const Ioe=e=>{var y,b;const{nodeId:t,field:n}=e,r=ee(),o=Xt("syncModels").isFeatureEnabled,{t:s}=J(),{data:i,isLoading:l}=Xu(qC),{data:u,isLoading:p}=Bo(qC),h=d.useMemo(()=>l||p,[l,p]),m=d.useMemo(()=>{if(!u)return[];const w=[];return Tn(u.entities,(k,_)=>{k&&w.push({value:_,label:k.model_name,group:dn[k.base_model]})}),i&&Tn(i.entities,(k,_)=>{k&&w.push({value:_,label:k.model_name,group:dn[k.base_model]})}),w},[u,i]),v=d.useMemo(()=>{var w,k,_,j;return((u==null?void 0:u.entities[`${(w=n.value)==null?void 0:w.base_model}/main/${(k=n.value)==null?void 0:k.model_name}`])||(i==null?void 0:i.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,u==null?void 0:u.entities,i==null?void 0:i.entities]),x=d.useCallback(w=>{if(!w)return;const k=_g(w);k&&r(qj({nodeId:t,fieldName:n.name,value:k}))},[r,n.name,t]);return a.jsxs($,{sx:{w:"full",alignItems:"center",gap:2},children:[h?a.jsx(ye,{variant:"subtext",children:"Loading..."}):a.jsx(Kt,{className:"nowheel nodrag",tooltip:v==null?void 0:v.description,value:v==null?void 0:v.id,placeholder:m.length>0?s("models.selectModel"):s("models.noModelsAvailable"),data:m,error:!v,disabled:m.length===0,onChange:x,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),o&&a.jsx(Wc,{className:"nodrag",iconMode:!0})]})},Eoe=d.memo(Ioe),sm=/^-?(0\.)?\.?$/,Moe=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:i,min:l,max:u,isInteger:p=!0,formControlProps:h,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:x,tooltipProps:y,...b}=e,w=ee(),[k,_]=d.useState(String(s));d.useEffect(()=>{!k.match(sm)&&s!==Number(k)&&_(String(s))},[s,k]);const j=O=>{_(O),O.match(sm)||i(p?Math.floor(Number(O)):Number(O))},I=O=>{const D=Ri(p?Math.floor(Number(O.target.value)):Number(O.target.value),l,u);_(String(D)),i(D)},M=d.useCallback(O=>{O.shiftKey&&w(Ir(!0))},[w]),E=d.useCallback(O=>{O.shiftKey||w(Ir(!1))},[w]);return a.jsx(Rt,{...y,children:a.jsxs(fn,{isDisabled:n,isInvalid:o,...h,children:[t&&a.jsx(Gn,{...m,children:t}),a.jsxs(Dm,{value:k,min:l,max:u,keepWithinRange:!0,clampValueOnBlur:!1,onChange:j,onBlur:I,...b,onPaste:Ay,children:[a.jsx(Am,{...v,onKeyDown:M,onKeyUp:E}),r&&a.jsxs(Rm,{children:[a.jsx(Tm,{...x}),a.jsx(Nm,{...x})]})]})]})})},Uc=d.memo(Moe),Ooe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=ee(),[s,i]=d.useState(String(n.value)),l=d.useMemo(()=>r.type==="integer",[r.type]),u=p=>{i(p),p.match(sm)||o(eR({nodeId:t,fieldName:n.name,value:l?Math.floor(Number(p)):Number(p)}))};return d.useEffect(()=>{!s.match(sm)&&n.value!==Number(s)&&i(String(n.value))},[n.value,s]),a.jsxs(Dm,{onChange:u,value:s,step:l?1:.1,precision:l?0:3,children:[a.jsx(Am,{className:"nodrag"}),a.jsxs(Rm,{children:[a.jsx(Tm,{}),a.jsx(Nm,{})]})]})},Doe=d.memo(Ooe),Roe=e=>{var m,v;const{nodeId:t,field:n}=e,r=ee(),{t:o}=J(),s=Xt("syncModels").isFeatureEnabled,{data:i,isLoading:l}=Bo(Gx),u=d.useMemo(()=>{if(!i)return[];const x=[];return Tn(i.entities,(y,b)=>{y&&x.push({value:b,label:y.model_name,group:dn[y.base_model]})}),x},[i]),p=d.useMemo(()=>{var x,y;return(i==null?void 0:i.entities[`${(x=n.value)==null?void 0:x.base_model}/main/${(y=n.value)==null?void 0:y.model_name}`])??null},[(m=n.value)==null?void 0:m.base_model,(v=n.value)==null?void 0:v.model_name,i==null?void 0:i.entities]),h=d.useCallback(x=>{if(!x)return;const y=_g(x);y&&r(tR({nodeId:t,fieldName:n.name,value:y}))},[r,n.name,t]);return l?a.jsx(Kt,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Kt,{className:"nowheel nodrag",tooltip:p==null?void 0:p.description,value:p==null?void 0:p.id,placeholder:u.length>0?o("models.selectModel"):o("models.noModelsAvailable"),data:u,error:!p,disabled:u.length===0,onChange:h,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Wc,{className:"nodrag",iconMode:!0})]})},Aoe=d.memo(Roe),Noe=e=>{var v,x;const{nodeId:t,field:n}=e,r=ee(),{t:o}=J(),s=Xt("syncModels").isFeatureEnabled,{data:i}=Xu(XC),{data:l,isLoading:u}=Bo(XC),p=d.useMemo(()=>{if(!l)return[];const y=[];return Tn(l.entities,(b,w)=>{!b||b.base_model!=="sdxl"||y.push({value:w,label:b.model_name,group:dn[b.base_model]})}),i&&Tn(i.entities,(b,w)=>{!b||b.base_model!=="sdxl"||y.push({value:w,label:b.model_name,group:dn[b.base_model]})}),y},[l,i]),h=d.useMemo(()=>{var y,b,w,k;return((l==null?void 0:l.entities[`${(y=n.value)==null?void 0:y.base_model}/main/${(b=n.value)==null?void 0:b.model_name}`])||(i==null?void 0:i.entities[`${(w=n.value)==null?void 0:w.base_model}/onnx/${(k=n.value)==null?void 0:k.model_name}`]))??null},[(v=n.value)==null?void 0:v.base_model,(x=n.value)==null?void 0:x.model_name,l==null?void 0:l.entities,i==null?void 0:i.entities]),m=d.useCallback(y=>{if(!y)return;const b=_g(y);b&&r(qj({nodeId:t,fieldName:n.name,value:b}))},[r,n.name,t]);return u?a.jsx(Kt,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Kt,{className:"nowheel nodrag",tooltip:h==null?void 0:h.description,value:h==null?void 0:h.id,placeholder:p.length>0?o("models.selectModel"):o("models.noModelsAvailable"),data:p,error:!h,disabled:p.length===0,onChange:m,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Wc,{className:"nodrag",iconMode:!0})]})},Toe=d.memo(Noe),$oe=ie([be],({ui:e})=>{const{favoriteSchedulers:t}=e;return{data:rr(dm,(r,o)=>({value:o,label:r,group:t.includes(o)?"Favorites":void 0})).sort((r,o)=>r.label.localeCompare(o.label))}},we),Loe=e=>{const{nodeId:t,field:n}=e,r=ee(),{data:o}=F($oe),s=d.useCallback(i=>{i&&r(nR({nodeId:t,fieldName:n.name,value:i}))},[r,n.name,t]);return a.jsx(Kt,{className:"nowheel nodrag",sx:{".mantine-Select-dropdown":{width:"14rem !important"}},value:n.value,data:o,onChange:s})},zoe=d.memo(Loe),Foe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=ee(),s=d.useCallback(i=>{o(rR({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return r.ui_component==="textarea"?a.jsx(oa,{className:"nodrag",onChange:s,value:n.value,rows:5,resize:"none"}):a.jsx(io,{onChange:s,value:n.value})},Boe=d.memo(Foe),xO=e=>{const t=qi("models"),[n,r,o]=e.split("/"),s=oR.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},Hoe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=ee(),{data:s}=Xj(),i=d.useMemo(()=>{if(!s)return[];const p=[{value:"default",label:"Default",group:"Default"}];return Tn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:dn[h.base_model]})}),p.sort((h,m)=>h.disabled&&!m.disabled?1:-1)},[s]),l=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]),u=d.useCallback(p=>{if(!p)return;const h=xO(p);h&&o(sR({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx(Kt,{className:"nowheel nodrag",itemComponent:ri,tooltip:l==null?void 0:l.description,value:(l==null?void 0:l.id)??"default",placeholder:"Default",data:i,onChange:u,disabled:i.length===0,error:!l,clearable:!0,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},Voe=d.memo(Hoe),Woe=e=>{const t=qi("models"),[n,r,o]=e.split("/"),s=aR.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},Uoe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=ee(),{data:s}=iR(),i=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]),l=d.useMemo(()=>{if(!s)return[];const p=[];return Tn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:dn[h.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const h=Woe(p);h&&o(lR({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx($n,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:l,onChange:u,sx:{width:"100%"}})},Goe=d.memo(Uoe),Koe=({nodeId:e,fieldName:t})=>{const n=lO(e,t),r=wg(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"?a.jsx(Boe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="boolean"&&(r==null?void 0:r.type)==="boolean"?a.jsx(soe,{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"?a.jsx(Doe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="enum"&&(r==null?void 0:r.type)==="enum"?a.jsx(woe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ImageField"&&(r==null?void 0:r.type)==="ImageField"?a.jsx(koe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="MainModelField"&&(r==null?void 0:r.type)==="MainModelField"?a.jsx(Eoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLRefinerModelField"&&(r==null?void 0:r.type)==="SDXLRefinerModelField"?a.jsx(Aoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="VaeModelField"&&(r==null?void 0:r.type)==="VaeModelField"?a.jsx(Voe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="LoRAModelField"&&(r==null?void 0:r.type)==="LoRAModelField"?a.jsx(Poe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ControlNetModelField"&&(r==null?void 0:r.type)==="ControlNetModelField"?a.jsx(yoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="IPAdapterModelField"&&(r==null?void 0:r.type)==="IPAdapterModelField"?a.jsx(Goe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ColorField"&&(r==null?void 0:r.type)==="ColorField"?a.jsx(xoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLMainModelField"&&(r==null?void 0:r.type)==="SDXLMainModelField"?a.jsx(Toe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="Scheduler"&&(r==null?void 0:r.type)==="Scheduler"?a.jsx(zoe,{nodeId:e,field:n,fieldTemplate:r}):n&&r?null:a.jsx(Ie,{p:1,children:a.jsxs(ye,{sx:{fontSize:"sm",fontWeight:600,color:"error.400",_dark:{color:"error.300"}},children:["Unknown field type: ",n==null?void 0:n.type]})})},bO=d.memo(Koe),qoe=({nodeId:e,fieldName:t})=>{const n=ee(),{isMouseOverNode:r,handleMouseOut:o,handleMouseOver:s}=sO(e),{t:i}=J(),l=d.useCallback(()=>{n(Yj({nodeId:e,fieldName:t}))},[n,t,e]);return a.jsxs($,{onMouseEnter:s,onMouseLeave:o,layerStyle:"second",sx:{position:"relative",borderRadius:"base",w:"full",p:2},children:[a.jsxs(fn,{as:$,sx:{flexDir:"column",gap:1,flexShrink:1},children:[a.jsxs(Gn,{sx:{display:"flex",alignItems:"center",mb:0},children:[a.jsx(cO,{nodeId:e,fieldName:t,kind:"input"}),a.jsx(Za,{}),a.jsx(Rt,{label:a.jsx(Ny,{nodeId:e,fieldName:t,kind:"input"}),openDelay:gm,placement:"top",hasArrow:!0,children:a.jsx($,{h:"full",alignItems:"center",children:a.jsx(An,{as:OE})})}),a.jsx(Te,{"aria-label":i("nodes.removeLinearView"),tooltip:i("nodes.removeLinearView"),variant:"ghost",size:"sm",onClick:l,icon:a.jsx(Wr,{})})]}),a.jsx(bO,{nodeId:e,fieldName:t})]}),a.jsx(oO,{isSelected:!1,isHovered:r})]})},Xoe=d.memo(qoe),Yoe=ie(be,({nodes:e})=>({fields:e.workflow.exposedFields}),we),Qoe=()=>{const{fields:e}=F(Yoe),{t}=J();return a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Ry,{children:a.jsx($,{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(Xoe,{nodeId:n,fieldName:r},`${n}.${r}`)):a.jsx(tr,{label:t("nodes.noFieldsLinearview"),icon:null})})})})},Zoe=d.memo(Qoe),Joe=()=>a.jsx($,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(Qi,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(Zi,{children:[a.jsx(Pr,{children:"Linear"}),a.jsx(Pr,{children:"Details"}),a.jsx(Pr,{children:"JSON"})]}),a.jsxs(zc,{children:[a.jsx(fo,{children:a.jsx(Zoe,{})}),a.jsx(fo,{children:a.jsx(Xre,{})}),a.jsx(fo,{children:a.jsx(eoe,{})})]})]})}),ese=d.memo(Joe),tse=()=>{const[e,t]=d.useState(!1),[n,r]=d.useState(!1),o=d.useRef(null),s=Dy(),i=d.useCallback(()=>{o.current&&o.current.setLayout([50,50])},[]);return a.jsxs($,{sx:{flexDir:"column",gap:2,height:"100%",width:"100%"},children:[a.jsx(WM,{}),a.jsxs(Cg,{ref:o,id:"workflow-panel-group",direction:"vertical",style:{height:"100%",width:"100%"},storage:s,children:[a.jsx(Wa,{id:"workflow",collapsible:!0,onCollapse:t,minSize:25,children:a.jsx(ese,{})}),a.jsx(om,{direction:"vertical",onDoubleClick:i,collapsedDirection:e?"top":n?"bottom":void 0}),a.jsx(Wa,{id:"inspector",collapsible:!0,onCollapse:r,minSize:25,children:a.jsx(Vre,{})})]})]})},nse=d.memo(tse),__=(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()?Lr.flushSync(()=>{var h;(h=n.current)==null||h.expand()}):Lr.flushSync(()=>{var h;(h=n.current)==null||h.collapse()})},[]),i=d.useCallback(()=>{Lr.flushSync(()=>{var p;(p=n.current)==null||p.expand()})},[]),l=d.useCallback(()=>{Lr.flushSync(()=>{var p;(p=n.current)==null||p.collapse()})},[]),u=d.useCallback(()=>{Lr.flushSync(()=>{var p;(p=n.current)==null||p.resize(e,t)})},[e,t]);return{ref:n,minSize:e,isCollapsed:r,setIsCollapsed:o,reset:u,toggle:s,expand:i,collapse:l}},rse=({isGalleryCollapsed:e,galleryPanelRef:t})=>{const{t:n}=J(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(wd,{children:a.jsx($,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineEnd:"1.63rem",children:a.jsx(Te,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":n("common.showGalleryPanel"),onClick:r,icon:a.jsx(_ne,{}),sx:{p:0,px:3,h:48,borderStartEndRadius:0,borderEndEndRadius:0,shadow:"2xl"}})})}):null},ose=d.memo(rse),Wv={borderStartStartRadius:0,borderEndStartRadius:0,shadow:"2xl"},sse=({isSidePanelCollapsed:e,sidePanelRef:t})=>{const{t:n}=J(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(wd,{children:a.jsxs($,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"5.13rem",direction:"column",gap:2,children:[a.jsx(Te,{tooltip:"Show Side Panel (O, T)","aria-label":n("common.showOptionsPanel"),onClick:r,sx:Wv,icon:a.jsx($E,{})}),a.jsx(VM,{asIconButton:!0,sx:Wv}),a.jsx(HM,{sx:Wv,asIconButton:!0})]})}):null},ase=d.memo(sse),ise=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:i}=Er({defaultIsOpen:o}),{colorMode:l}=ia();return a.jsxs(Ie,{children:[a.jsxs($,{onClick:i,sx:{alignItems:"center",p:2,px:4,gap:2,borderTopRadius:"base",borderBottomRadius:s?0:"base",bg:Ae("base.250","base.750")(l),color:Ae("base.900","base.100")(l),_hover:{bg:Ae("base.300","base.700")(l)},fontSize:"sm",fontWeight:600,cursor:"pointer",transitionProperty:"common",transitionDuration:"normal",userSelect:"none"},children:[t,a.jsx(nr,{children:n&&a.jsx(vn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(ye,{sx:{color:"accent.500",_dark:{color:"accent.300"}},children:n})},"statusText")}),a.jsx(Za,{}),a.jsx(cg,{sx:{w:"1rem",h:"1rem",transform:s?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(ym,{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})})]})},hr=d.memo(ise),lse=ie(be,e=>{const{combinatorial:t,isEnabled:n}=e.dynamicPrompts;return{combinatorial:t,isDisabled:!n}},we),cse=()=>{const{combinatorial:e,isDisabled:t}=F(lse),n=ee(),{t:r}=J(),o=d.useCallback(()=>{n(cR())},[n]);return a.jsx(Gt,{isDisabled:t,label:r("prompt.combinatorial"),isChecked:e,onChange:o})},use=d.memo(cse),dse=ie(be,e=>{const{isEnabled:t}=e.dynamicPrompts;return{isEnabled:t}},we),fse=()=>{const e=ee(),{isEnabled:t}=F(dse),{t:n}=J(),r=d.useCallback(()=>{e(uR())},[e]);return a.jsx(Gt,{label:n("prompt.enableDynamicPrompts"),isChecked:t,onChange:r})},pse=d.memo(fse),hse=ie(be,e=>{const{maxPrompts:t,combinatorial:n,isEnabled:r}=e.dynamicPrompts,{min:o,sliderMax:s,inputMax:i}=e.config.sd.dynamicPrompts.maxPrompts;return{maxPrompts:t,min:o,sliderMax:s,inputMax:i,isDisabled:!r||!n}},we),mse=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=F(hse),s=ee(),{t:i}=J(),l=d.useCallback(p=>{s(dR(p))},[s]),u=d.useCallback(()=>{s(fR())},[s]);return a.jsx(Ze,{label:i("prompt.maxPrompts"),isDisabled:o,min:t,max:n,value:e,onChange:l,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},gse=d.memo(mse),vse=ie(be,e=>{const{isEnabled:t}=e.dynamicPrompts;return{activeLabel:t?"Enabled":void 0}},we),xse=()=>{const{activeLabel:e}=F(vse),{t}=J();return Xt("dynamicPrompting").isFeatureEnabled?a.jsx(hr,{label:t("prompt.dynamicPrompts"),activeLabel:e,children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(pse,{}),a.jsx(use,{}),a.jsx(gse,{})]})}):null},Gc=d.memo(xse),bse=e=>{const t=ee(),{lora:n}=e,r=d.useCallback(i=>{t(pR({id:n.id,weight:i}))},[t,n.id]),o=d.useCallback(()=>{t(hR(n.id))},[t,n.id]),s=d.useCallback(()=>{t(mR(n.id))},[t,n.id]);return a.jsxs($,{sx:{gap:2.5,alignItems:"flex-end"},children:[a.jsx(Ze,{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(Te,{size:"sm",onClick:s,tooltip:"Remove LoRA","aria-label":"Remove LoRA",icon:a.jsx(Wr,{}),colorScheme:"error"})]})},yse=d.memo(bse),Cse=ie(be,({lora:e})=>({lorasArray:rr(e.loras)}),we),wse=()=>{const{lorasArray:e}=F(Cse);return a.jsx(a.Fragment,{children:e.map((t,n)=>a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[n>0&&a.jsx(Br,{pt:1}),a.jsx(yse,{lora:t})]},t.model_name))})},Sse=d.memo(wse),kse=ie(be,({lora:e})=>({loras:e.loras}),we),_se=()=>{const e=ee(),{loras:t}=F(kse),{data:n}=vm(),r=F(i=>i.generation.model),o=d.useMemo(()=>{if(!n)return[];const i=[];return Tn(n.entities,(l,u)=>{if(!l||u in t)return;const p=(r==null?void 0:r.base_model)!==l.base_model;i.push({value:u,label:l.model_name,disabled:p,group:dn[l.base_model],tooltip:p?`Incompatible base model: ${l.base_model}`:void 0})}),i.sort((l,u)=>l.label&&!u.label?1:-1),i.sort((l,u)=>l.disabled&&!u.disabled?1:-1)},[t,n,r==null?void 0:r.base_model]),s=d.useCallback(i=>{if(!i)return;const l=n==null?void 0:n.entities[i];l&&e(gR(l))},[e,n==null?void 0:n.entities]);return(n==null?void 0:n.ids.length)===0?a.jsx($,{sx:{justifyContent:"center",p:2},children:a.jsx(ye,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(Kt,{placeholder:o.length===0?"All LoRAs added":"Add LoRA",value:null,data:o,nothingFound:"No matching LoRAs",itemComponent:ri,disabled:o.length===0,filter:(i,l)=>{var u;return((u=l.label)==null?void 0:u.toLowerCase().includes(i.toLowerCase().trim()))||l.value.toLowerCase().includes(i.toLowerCase().trim())},onChange:s})},jse=d.memo(_se),Pse=ie(be,e=>{const t=Qj(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},we),Ise=()=>{const{activeLabel:e}=F(Pse);return Xt("lora").isFeatureEnabled?a.jsx(hr,{label:"LoRA",activeLabel:e,children:a.jsxs($,{sx:{flexDir:"column",gap:2},children:[a.jsx(jse,{}),a.jsx(Sse,{})]})}):null},Kc=d.memo(Ise),Ese=ie(be,({generation:e})=>{const{model:t}=e;return{mainModel:t}},we),Mse=e=>{const{controlNetId:t,model:n,isEnabled:r}=e.controlNet,o=ee(),s=F(Pn),{mainModel:i}=F(Ese),{t:l}=J(),{data:u}=Ux(),p=d.useMemo(()=>{if(!u)return[];const v=[];return Tn(u.entities,(x,y)=>{if(!x)return;const b=(x==null?void 0:x.base_model)!==(i==null?void 0:i.base_model);v.push({value:y,label:x.model_name,group:dn[x.base_model],disabled:b,tooltip:b?`${l("controlnet.incompatibleBaseModel")} ${x.base_model}`:void 0})}),v},[u,i==null?void 0:i.base_model,l]),h=d.useMemo(()=>(u==null?void 0:u.entities[`${n==null?void 0:n.base_model}/controlnet/${n==null?void 0:n.model_name}`])??null,[n==null?void 0:n.base_model,n==null?void 0:n.model_name,u==null?void 0:u.entities]),m=d.useCallback(v=>{if(!v)return;const x=mO(v);x&&o(Zj({controlNetId:t,model:x}))},[t,o]);return a.jsx(Kt,{itemComponent:ri,data:p,error:!h||(i==null?void 0:i.base_model)!==h.base_model,placeholder:l("controlnet.selectModel"),value:(h==null?void 0:h.id)??null,onChange:m,disabled:s||!r,tooltip:h==null?void 0:h.description})},Ose=d.memo(Mse),Dse=e=>{const{weight:t,isEnabled:n,controlNetId:r}=e.controlNet,o=ee(),{t:s}=J(),i=d.useCallback(l=>{o(vR({controlNetId:r,weight:l}))},[r,o]);return a.jsx(Ze,{isDisabled:!n,label:s("controlnet.weight"),value:t,onChange:i,min:0,max:2,step:.01,withSliderMarks:!0,sliderMarks:[0,1,2]})},Rse=d.memo(Dse),Ase=ie(be,({controlNet:e,gallery:t})=>{const{pendingControlImages:n}=e,{autoAddBoardId:r}=t;return{pendingControlImages:n,autoAddBoardId:r}},we),Nse=({isSmall:e,controlNet:t})=>{const{controlImage:n,processedControlImage:r,processorType:o,isEnabled:s,controlNetId:i}=t,l=ee(),{t:u}=J(),{pendingControlImages:p,autoAddBoardId:h}=F(Ase),m=F(wn),[v,x]=d.useState(!1),{currentData:y}=po(n??Fr.skipToken),{currentData:b}=po(r??Fr.skipToken),[w]=xR(),[k]=bR(),[_]=yR(),j=d.useCallback(()=>{l(CR({controlNetId:i,controlImage:null}))},[i,l]),I=d.useCallback(async()=>{b&&(await w({imageDTO:b,is_intermediate:!1}).unwrap(),h!=="none"?k({imageDTO:b,board_id:h}):_({imageDTO:b}))},[b,w,h,k,_]),M=d.useCallback(()=>{y&&(m==="unifiedCanvas"?l(Ao({width:y.width,height:y.height})):(l(Ai(y.width)),l(Ni(y.height))))},[y,m,l]),E=d.useCallback(()=>{x(!0)},[]),O=d.useCallback(()=>{x(!1)},[]),D=d.useMemo(()=>{if(y)return{id:i,payloadType:"IMAGE_DTO",payload:{imageDTO:y}}},[y,i]),A=d.useMemo(()=>({id:i,actionType:"SET_CONTROLNET_IMAGE",context:{controlNetId:i}}),[i]),R=d.useMemo(()=>({type:"SET_CONTROLNET_IMAGE",controlNetId:i}),[i]),T=y&&b&&!v&&!p.includes(i)&&o!=="none";return a.jsxs($,{onMouseEnter:E,onMouseLeave:O,sx:{position:"relative",w:"full",h:e?28:366,alignItems:"center",justifyContent:"center",pointerEvents:s?"auto":"none",opacity:s?1:.5},children:[a.jsx(Ya,{draggableData:D,droppableData:A,imageDTO:y,isDropDisabled:T||!s,postUploadAction:R}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:T?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:a.jsx(Ya,{draggableData:D,droppableData:A,imageDTO:b,isUploadDisabled:!0,isDropDisabled:!s})}),a.jsxs(a.Fragment,{children:[a.jsx(uc,{onClick:j,icon:y?a.jsx(tg,{}):void 0,tooltip:u("controlnet.resetControlImage")}),a.jsx(uc,{onClick:I,icon:y?a.jsx(eg,{size:16}):void 0,tooltip:u("controlnet.saveControlImage"),styleOverrides:{marginTop:6}}),a.jsx(uc,{onClick:M,icon:y?a.jsx($Z,{size:16}):void 0,tooltip:u("controlnet.setControlImageDimensions"),styleOverrides:{marginTop:12}})]}),p.includes(i)&&a.jsx($,{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(Ki,{size:"xl",sx:{color:"base.100",_dark:{color:"base.400"}}})})]})},j_=d.memo(Nse),qo=()=>{const e=ee();return d.useCallback((n,r)=>{e(wR({controlNetId:n,changes:r}))},[e])};function Xo(e){return a.jsx($,{sx:{flexDirection:"column",gap:2},children:e.children})}const P_=go.canny_image_processor.default,Tse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{low_threshold:o,high_threshold:s}=n,i=F(Pn),l=qo(),{t:u}=J(),p=d.useCallback(x=>{l(t,{low_threshold:x})},[t,l]),h=d.useCallback(()=>{l(t,{low_threshold:P_.low_threshold})},[t,l]),m=d.useCallback(x=>{l(t,{high_threshold:x})},[t,l]),v=d.useCallback(()=>{l(t,{high_threshold:P_.high_threshold})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Ze,{isDisabled:i||!r,label:u("controlnet.lowThreshold"),value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),a.jsx(Ze,{isDisabled:i||!r,label:u("controlnet.highThreshold"),value:s,onChange:m,handleReset:v,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},$se=d.memo(Tse),_u=go.content_shuffle_image_processor.default,Lse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,w:i,h:l,f:u}=n,p=qo(),h=F(Pn),{t:m}=J(),v=d.useCallback(E=>{p(t,{detect_resolution:E})},[t,p]),x=d.useCallback(()=>{p(t,{detect_resolution:_u.detect_resolution})},[t,p]),y=d.useCallback(E=>{p(t,{image_resolution:E})},[t,p]),b=d.useCallback(()=>{p(t,{image_resolution:_u.image_resolution})},[t,p]),w=d.useCallback(E=>{p(t,{w:E})},[t,p]),k=d.useCallback(()=>{p(t,{w:_u.w})},[t,p]),_=d.useCallback(E=>{p(t,{h:E})},[t,p]),j=d.useCallback(()=>{p(t,{h:_u.h})},[t,p]),I=d.useCallback(E=>{p(t,{f:E})},[t,p]),M=d.useCallback(()=>{p(t,{f:_u.f})},[t,p]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:m("controlnet.detectResolution"),value:s,onChange:v,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Ze,{label:m("controlnet.imageResolution"),value:o,onChange:y,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Ze,{label:m("controlnet.w"),value:i,onChange:w,handleReset:k,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Ze,{label:m("controlnet.h"),value:l,onChange:_,handleReset:j,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Ze,{label:m("controlnet.f"),value:u,onChange:I,handleReset:M,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r})]})},zse=d.memo(Lse),I_=go.hed_image_processor.default,Fse=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o},isEnabled:s}=e,i=F(Pn),l=qo(),{t:u}=J(),p=d.useCallback(y=>{l(t,{detect_resolution:y})},[t,l]),h=d.useCallback(y=>{l(t,{image_resolution:y})},[t,l]),m=d.useCallback(y=>{l(t,{scribble:y.target.checked})},[t,l]),v=d.useCallback(()=>{l(t,{detect_resolution:I_.detect_resolution})},[t,l]),x=d.useCallback(()=>{l(t,{image_resolution:I_.image_resolution})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:u("controlnet.detectResolution"),value:n,onChange:p,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:i||!s}),a.jsx(Ze,{label:u("controlnet.imageResolution"),value:r,onChange:h,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:i||!s}),a.jsx(Gt,{label:u("controlnet.scribble"),isChecked:o,onChange:m,isDisabled:i||!s})]})},Bse=d.memo(Fse),E_=go.lineart_anime_image_processor.default,Hse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=qo(),l=F(Pn),{t:u}=J(),p=d.useCallback(x=>{i(t,{detect_resolution:x})},[t,i]),h=d.useCallback(x=>{i(t,{image_resolution:x})},[t,i]),m=d.useCallback(()=>{i(t,{detect_resolution:E_.detect_resolution})},[t,i]),v=d.useCallback(()=>{i(t,{image_resolution:E_.image_resolution})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:u("controlnet.detectResolution"),value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Ze,{label:u("controlnet.imageResolution"),value:o,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},Vse=d.memo(Hse),M_=go.lineart_image_processor.default,Wse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,coarse:i}=n,l=qo(),u=F(Pn),{t:p}=J(),h=d.useCallback(b=>{l(t,{detect_resolution:b})},[t,l]),m=d.useCallback(b=>{l(t,{image_resolution:b})},[t,l]),v=d.useCallback(()=>{l(t,{detect_resolution:M_.detect_resolution})},[t,l]),x=d.useCallback(()=>{l(t,{image_resolution:M_.image_resolution})},[t,l]),y=d.useCallback(b=>{l(t,{coarse:b.target.checked})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:p("controlnet.detectResolution"),value:s,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(Ze,{label:p("controlnet.imageResolution"),value:o,onChange:m,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(Gt,{label:p("controlnet.coarse"),isChecked:i,onChange:y,isDisabled:u||!r})]})},Use=d.memo(Wse),O_=go.mediapipe_face_processor.default,Gse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{max_faces:o,min_confidence:s}=n,i=qo(),l=F(Pn),{t:u}=J(),p=d.useCallback(x=>{i(t,{max_faces:x})},[t,i]),h=d.useCallback(x=>{i(t,{min_confidence:x})},[t,i]),m=d.useCallback(()=>{i(t,{max_faces:O_.max_faces})},[t,i]),v=d.useCallback(()=>{i(t,{min_confidence:O_.min_confidence})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:u("controlnet.maxFaces"),value:o,onChange:p,handleReset:m,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Ze,{label:u("controlnet.minConfidence"),value:s,onChange:h,handleReset:v,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},Kse=d.memo(Gse),D_=go.midas_depth_image_processor.default,qse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{a_mult:o,bg_th:s}=n,i=qo(),l=F(Pn),{t:u}=J(),p=d.useCallback(x=>{i(t,{a_mult:x})},[t,i]),h=d.useCallback(x=>{i(t,{bg_th:x})},[t,i]),m=d.useCallback(()=>{i(t,{a_mult:D_.a_mult})},[t,i]),v=d.useCallback(()=>{i(t,{bg_th:D_.bg_th})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:u("controlnet.amult"),value:o,onChange:p,handleReset:m,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Ze,{label:u("controlnet.bgth"),value:s,onChange:h,handleReset:v,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},Xse=d.memo(qse),jp=go.mlsd_image_processor.default,Yse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,thr_d:i,thr_v:l}=n,u=qo(),p=F(Pn),{t:h}=J(),m=d.useCallback(j=>{u(t,{detect_resolution:j})},[t,u]),v=d.useCallback(j=>{u(t,{image_resolution:j})},[t,u]),x=d.useCallback(j=>{u(t,{thr_d:j})},[t,u]),y=d.useCallback(j=>{u(t,{thr_v:j})},[t,u]),b=d.useCallback(()=>{u(t,{detect_resolution:jp.detect_resolution})},[t,u]),w=d.useCallback(()=>{u(t,{image_resolution:jp.image_resolution})},[t,u]),k=d.useCallback(()=>{u(t,{thr_d:jp.thr_d})},[t,u]),_=d.useCallback(()=>{u(t,{thr_v:jp.thr_v})},[t,u]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:h("controlnet.detectResolution"),value:s,onChange:m,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Ze,{label:h("controlnet.imageResolution"),value:o,onChange:v,handleReset:w,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Ze,{label:h("controlnet.w"),value:i,onChange:x,handleReset:k,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Ze,{label:h("controlnet.h"),value:l,onChange:y,handleReset:_,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:p||!r})]})},Qse=d.memo(Yse),R_=go.normalbae_image_processor.default,Zse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=qo(),l=F(Pn),{t:u}=J(),p=d.useCallback(x=>{i(t,{detect_resolution:x})},[t,i]),h=d.useCallback(x=>{i(t,{image_resolution:x})},[t,i]),m=d.useCallback(()=>{i(t,{detect_resolution:R_.detect_resolution})},[t,i]),v=d.useCallback(()=>{i(t,{image_resolution:R_.image_resolution})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:u("controlnet.detectResolution"),value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Ze,{label:u("controlnet.imageResolution"),value:o,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},Jse=d.memo(Zse),A_=go.openpose_image_processor.default,eae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,hand_and_face:i}=n,l=qo(),u=F(Pn),{t:p}=J(),h=d.useCallback(b=>{l(t,{detect_resolution:b})},[t,l]),m=d.useCallback(b=>{l(t,{image_resolution:b})},[t,l]),v=d.useCallback(()=>{l(t,{detect_resolution:A_.detect_resolution})},[t,l]),x=d.useCallback(()=>{l(t,{image_resolution:A_.image_resolution})},[t,l]),y=d.useCallback(b=>{l(t,{hand_and_face:b.target.checked})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:p("controlnet.detectResolution"),value:s,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(Ze,{label:p("controlnet.imageResolution"),value:o,onChange:m,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(Gt,{label:p("controlnet.handAndFace"),isChecked:i,onChange:y,isDisabled:u||!r})]})},tae=d.memo(eae),N_=go.pidi_image_processor.default,nae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,scribble:i,safe:l}=n,u=qo(),p=F(Pn),{t:h}=J(),m=d.useCallback(k=>{u(t,{detect_resolution:k})},[t,u]),v=d.useCallback(k=>{u(t,{image_resolution:k})},[t,u]),x=d.useCallback(()=>{u(t,{detect_resolution:N_.detect_resolution})},[t,u]),y=d.useCallback(()=>{u(t,{image_resolution:N_.image_resolution})},[t,u]),b=d.useCallback(k=>{u(t,{scribble:k.target.checked})},[t,u]),w=d.useCallback(k=>{u(t,{safe:k.target.checked})},[t,u]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:h("controlnet.detectResolution"),value:s,onChange:m,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Ze,{label:h("controlnet.imageResolution"),value:o,onChange:v,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Gt,{label:h("controlnet.scribble"),isChecked:i,onChange:b}),a.jsx(Gt,{label:h("controlnet.safe"),isChecked:l,onChange:w,isDisabled:p||!r})]})},rae=d.memo(nae),oae=e=>null,sae=d.memo(oae),aae=e=>{const{controlNetId:t,isEnabled:n,processorNode:r}=e.controlNet;return r.type==="canny_image_processor"?a.jsx($se,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="hed_image_processor"?a.jsx(Bse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_image_processor"?a.jsx(Use,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="content_shuffle_image_processor"?a.jsx(zse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_anime_image_processor"?a.jsx(Vse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mediapipe_face_processor"?a.jsx(Kse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="midas_depth_image_processor"?a.jsx(Xse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mlsd_image_processor"?a.jsx(Qse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="normalbae_image_processor"?a.jsx(Jse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="openpose_image_processor"?a.jsx(tae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="pidi_image_processor"?a.jsx(rae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="zoe_depth_image_processor"?a.jsx(sae,{controlNetId:t,processorNode:r,isEnabled:n}):null},iae=d.memo(aae),lae=e=>{const{controlNetId:t,isEnabled:n,shouldAutoConfig:r}=e.controlNet,o=ee(),s=F(Pn),{t:i}=J(),l=d.useCallback(()=>{o(SR({controlNetId:t}))},[t,o]);return a.jsx(Gt,{label:i("controlnet.autoConfigure"),"aria-label":i("controlnet.autoConfigure"),isChecked:r,onChange:l,isDisabled:s||!n})},cae=d.memo(lae),uae=e=>{const{controlNet:t}=e,n=ee(),{t:r}=J(),o=d.useCallback(()=>{n(kR({controlNet:t}))},[t,n]),s=d.useCallback(()=>{n(_R({controlNet:t}))},[t,n]);return a.jsxs($,{sx:{gap:2},children:[a.jsx(Te,{size:"sm",icon:a.jsx(Vi,{}),tooltip:r("controlnet.importImageFromCanvas"),"aria-label":r("controlnet.importImageFromCanvas"),onClick:o}),a.jsx(Te,{size:"sm",icon:a.jsx(AE,{}),tooltip:r("controlnet.importMaskFromCanvas"),"aria-label":r("controlnet.importMaskFromCanvas"),onClick:s})]})},dae=d.memo(uae),T_=e=>`${Math.round(e*100)}%`,fae=e=>{const{beginStepPct:t,endStepPct:n,isEnabled:r,controlNetId:o}=e.controlNet,s=ee(),{t:i}=J(),l=d.useCallback(u=>{s(jR({controlNetId:o,beginStepPct:u[0]})),s(PR({controlNetId:o,endStepPct:u[1]}))},[o,s]);return a.jsxs(fn,{isDisabled:!r,children:[a.jsx(Gn,{children:i("controlnet.beginEndStepPercent")}),a.jsx(bb,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(PP,{"aria-label":["Begin Step %","End Step %!"],value:[t,n],onChange:l,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!r,children:[a.jsx(IP,{children:a.jsx(EP,{})}),a.jsx(Rt,{label:T_(t),placement:"top",hasArrow:!0,children:a.jsx(T1,{index:0})}),a.jsx(Rt,{label:T_(n),placement:"top",hasArrow:!0,children:a.jsx(T1,{index:1})}),a.jsx(Ap,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(Ap,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(Ap,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})},pae=d.memo(fae);function hae(e){const{controlMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=ee(),{t:s}=J(),i=[{label:s("controlnet.balanced"),value:"balanced"},{label:s("controlnet.prompt"),value:"more_prompt"},{label:s("controlnet.control"),value:"more_control"},{label:s("controlnet.megaControl"),value:"unbalanced"}],l=d.useCallback(u=>{o(IR({controlNetId:r,controlMode:u}))},[r,o]);return a.jsx($n,{disabled:!n,label:s("controlnet.controlMode"),data:i,value:String(t),onChange:l})}const mae=ie(Iy,e=>rr(go,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)),we),gae=e=>{const t=ee(),{controlNetId:n,isEnabled:r,processorNode:o}=e.controlNet,s=F(Pn),i=F(mae),{t:l}=J(),u=d.useCallback(p=>{t(ER({controlNetId:n,processorType:p}))},[n,t]);return a.jsx(Kt,{label:l("controlnet.processor"),value:o.type??"canny_image_processor",data:i,onChange:u,disabled:s||!r})},vae=d.memo(gae);function xae(e){const{resizeMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=ee(),{t:s}=J(),i=[{label:s("controlnet.resize"),value:"just_resize"},{label:s("controlnet.crop"),value:"crop_resize"},{label:s("controlnet.fill"),value:"fill_resize"}],l=d.useCallback(u=>{o(MR({controlNetId:r,resizeMode:u}))},[r,o]);return a.jsx($n,{disabled:!n,label:s("controlnet.resizeMode"),data:i,value:String(t),onChange:l})}const bae=e=>{const{controlNet:t}=e,{controlNetId:n}=t,r=ee(),{t:o}=J(),s=F(wn),i=ie(be,({controlNet:y})=>{const b=y.controlNets[n];if(!b)return{isEnabled:!1,shouldAutoConfig:!1};const{isEnabled:w,shouldAutoConfig:k}=b;return{isEnabled:w,shouldAutoConfig:k}},we),{isEnabled:l,shouldAutoConfig:u}=F(i),[p,h]=qZ(!1),m=d.useCallback(()=>{r(OR({controlNetId:n}))},[n,r]),v=d.useCallback(()=>{r(DR({sourceControlNetId:n,newControlNetId:Fa()}))},[n,r]),x=d.useCallback(()=>{r(RR({controlNetId:n}))},[n,r]);return a.jsxs($,{sx:{flexDir:"column",gap:3,p:2,borderRadius:"base",position:"relative",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsxs($,{sx:{gap:2,alignItems:"center"},children:[a.jsx(Gt,{tooltip:o("controlnet.toggleControlNet"),"aria-label":o("controlnet.toggleControlNet"),isChecked:l,onChange:x}),a.jsx(Ie,{sx:{w:"full",minW:0,opacity:l?1:.5,pointerEvents:l?"auto":"none",transitionProperty:"common",transitionDuration:"0.1s"},children:a.jsx(Ose,{controlNet:t})}),s==="unifiedCanvas"&&a.jsx(dae,{controlNet:t}),a.jsx(Te,{size:"sm",tooltip:o("controlnet.duplicate"),"aria-label":o("controlnet.duplicate"),onClick:v,icon:a.jsx(Hc,{})}),a.jsx(Te,{size:"sm",tooltip:o("controlnet.delete"),"aria-label":o("controlnet.delete"),colorScheme:"error",onClick:m,icon:a.jsx(Wr,{})}),a.jsx(Te,{size:"sm",tooltip:o(p?"controlnet.hideAdvanced":"controlnet.showAdvanced"),"aria-label":o(p?"controlnet.hideAdvanced":"controlnet.showAdvanced"),onClick:h,variant:"ghost",sx:{_hover:{bg:"none"}},icon:a.jsx(cg,{sx:{boxSize:4,color:"base.700",transform:p?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal",_dark:{color:"base.300"}}})}),!u&&a.jsx(Ie,{sx:{position:"absolute",w:1.5,h:1.5,borderRadius:"full",top:4,insetInlineEnd:4,bg:"accent.700",_dark:{bg:"accent.400"}}})]}),a.jsxs($,{sx:{w:"full",flexDirection:"column",gap:3},children:[a.jsxs($,{sx:{gap:4,w:"full",alignItems:"center"},children:[a.jsxs($,{sx:{flexDir:"column",gap:3,h:28,w:"full",paddingInlineStart:1,paddingInlineEnd:p?1:0,pb:2,justifyContent:"space-between"},children:[a.jsx(Rse,{controlNet:t}),a.jsx(pae,{controlNet:t})]}),!p&&a.jsx($,{sx:{alignItems:"center",justifyContent:"center",h:28,w:28,aspectRatio:"1/1"},children:a.jsx(j_,{controlNet:t,isSmall:!0})})]}),a.jsxs($,{sx:{gap:2},children:[a.jsx(hae,{controlNet:t}),a.jsx(xae,{controlNet:t})]}),a.jsx(vae,{controlNet:t})]}),p&&a.jsxs(a.Fragment,{children:[a.jsx(j_,{controlNet:t}),a.jsx(cae,{controlNet:t}),a.jsx(iae,{controlNet:t})]})]})},yae=d.memo(bae),Cae=ie(be,e=>{const{isEnabled:t}=e.controlNet;return{isEnabled:t}},we),wae=()=>{const{isEnabled:e}=F(Cae),t=ee(),n=d.useCallback(()=>{t(AR())},[t]);return a.jsx(Gt,{label:"Enable ControlNet",isChecked:e,onChange:n,formControlProps:{width:"100%"}})},Sae=d.memo(wae),kae=ie([be],({controlNet:e})=>{const{controlNets:t,isEnabled:n}=e,r=NR(t),o=n&&r.length>0?`${r.length} Active`:void 0;return{controlNetsArray:rr(t),activeLabel:o}},we),_ae=()=>{const{controlNetsArray:e,activeLabel:t}=F(kae),n=Xt("controlNet").isFeatureDisabled,r=ee(),{firstModel:o}=Ux(void 0,{selectFromResult:i=>({firstModel:i.data?TR.getSelectors().selectAll(i.data)[0]:void 0})}),s=d.useCallback(()=>{if(!o)return;const i=Fa();r($R({controlNetId:i})),r(Zj({controlNetId:i,model:o}))},[r,o]);return n?null:a.jsx(hr,{label:"Control Adapters",activeLabel:t,children:a.jsxs($,{sx:{flexDir:"column",gap:2},children:[a.jsxs($,{sx:{w:"100%",gap:2,p:2,ps:3,borderRadius:"base",alignItems:"center",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsx(Sae,{}),a.jsx(Te,{tooltip:"Add ControlNet","aria-label":"Add ControlNet",icon:a.jsx(nl,{}),isDisabled:!o,flexGrow:1,size:"sm",onClick:s})]}),e.map((i,l)=>a.jsxs(d.Fragment,{children:[l>0&&a.jsx(Br,{}),a.jsx(yae,{controlNet:i})]},i.controlNetId))]})})},qc=d.memo(_ae),jae=ie(be,e=>{const{shouldUseNoiseSettings:t,shouldUseCpuNoise:n}=e.generation;return{isDisabled:!t,shouldUseCpuNoise:n}},we),Pae=()=>{const e=ee(),{isDisabled:t,shouldUseCpuNoise:n}=F(jae),{t:r}=J(),o=s=>e(LR(s.target.checked));return a.jsx(Gt,{isDisabled:t,label:r("parameters.useCpuNoise"),isChecked:n,onChange:o})},Iae=ie(be,e=>{const{shouldUseNoiseSettings:t,threshold:n}=e.generation;return{isDisabled:!t,threshold:n}},we);function Eae(){const e=ee(),{threshold:t,isDisabled:n}=F(Iae),{t:r}=J();return a.jsx(Ze,{isDisabled:n,label:r("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:o=>e(YC(o)),handleReset:()=>e(YC(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const Mae=()=>{const e=ee(),{t}=J(),n=F(o=>o.generation.shouldUseNoiseSettings),r=o=>e(zR(o.target.checked));return a.jsx(Gt,{label:t("parameters.enableNoiseSettings"),isChecked:n,onChange:r})},Oae=ie(be,e=>{const{shouldUseNoiseSettings:t,perlin:n}=e.generation;return{isDisabled:!t,perlin:n}},we);function Dae(){const e=ee(),{perlin:t,isDisabled:n}=F(Oae),{t:r}=J();return a.jsx(Ze,{isDisabled:n,label:r("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:o=>e(QC(o)),handleReset:()=>e(QC(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const Rae=ie(be,e=>{const{shouldUseNoiseSettings:t}=e.generation;return{activeLabel:t?"Enabled":void 0}},we),Aae=()=>{const{t:e}=J(),t=Xt("noise").isFeatureEnabled,n=Xt("perlinNoise").isFeatureEnabled,r=Xt("noiseThreshold").isFeatureEnabled,{activeLabel:o}=F(Rae);return t?a.jsx(hr,{label:e("parameters.noiseSettings"),activeLabel:o,children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(Mae,{}),a.jsx(Pae,{}),n&&a.jsx(Dae,{}),r&&a.jsx(Eae,{})]})}):null},Gd=d.memo(Aae),Ur=e=>e.generation,Nae=ie(Ur,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},we),Tae=()=>{const{t:e}=J(),{seamlessXAxis:t}=F(Nae),n=ee(),r=d.useCallback(o=>{n(FR(o.target.checked))},[n]);return a.jsx(Gt,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},$ae=d.memo(Tae),Lae=ie(Ur,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},we),zae=()=>{const{t:e}=J(),{seamlessYAxis:t}=F(Lae),n=ee(),r=d.useCallback(o=>{n(BR(o.target.checked))},[n]);return a.jsx(Gt,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},Fae=d.memo(zae),Bae=(e,t)=>{if(e&&t)return"X & Y";if(e)return"X";if(t)return"Y"},Hae=ie(Ur,e=>{const{seamlessXAxis:t,seamlessYAxis:n}=e;return{activeLabel:Bae(t,n)}},we),Vae=()=>{const{t:e}=J(),{activeLabel:t}=F(Hae);return Xt("seamless").isFeatureEnabled?a.jsx(hr,{label:e("parameters.seamlessTiling"),activeLabel:t,children:a.jsxs($,{sx:{gap:5},children:[a.jsx(Ie,{flexGrow:1,children:a.jsx($ae,{})}),a.jsx(Ie,{flexGrow:1,children:a.jsx(Fae,{})})]})}):null},Xc=d.memo(Vae),Wae=e=>{const{onClick:t}=e,{t:n}=J();return a.jsx(Te,{size:"sm","aria-label":n("embedding.addEmbedding"),tooltip:n("embedding.addEmbedding"),icon:a.jsx(PE,{}),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})},jg=d.memo(Wae),Uae="28rem",Gae=e=>{const{onSelect:t,isOpen:n,onClose:r,children:o}=e,{data:s}=HR(),i=d.useRef(null),{t:l}=J(),u=F(m=>m.generation.model),p=d.useMemo(()=>{if(!s)return[];const m=[];return Tn(s.entities,(v,x)=>{if(!v)return;const y=(u==null?void 0:u.base_model)!==v.base_model;m.push({value:v.model_name,label:v.model_name,group:dn[v.base_model],disabled:y,tooltip:y?`${l("embedding.incompatibleModel")} ${v.base_model}`:void 0})}),m.sort((v,x)=>{var y;return v.label&&x.label?(y=v.label)!=null&&y.localeCompare(x.label)?-1:1:-1}),m.sort((v,x)=>v.disabled&&!x.disabled?1:-1)},[s,u==null?void 0:u.base_model,l]),h=d.useCallback(m=>{m&&t(m)},[t]);return a.jsxs($m,{initialFocusRef:i,isOpen:n,onClose:r,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(Rb,{children:o}),a.jsx(Lm,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Ab,{sx:{p:0,w:`calc(${Uae} - 2rem )`},children:p.length===0?a.jsx($,{sx:{justifyContent:"center",p:2,fontSize:"sm",color:"base.500",_dark:{color:"base.700"}},children:a.jsx(ye,{children:"No Embeddings Loaded"})}):a.jsx(Kt,{inputRef:i,autoFocus:!0,placeholder:l("embedding.addEmbedding"),value:null,data:p,nothingFound:l("embedding.noMatchingEmbedding"),itemComponent:ri,disabled:p.length===0,onDropdownClose:r,filter:(m,v)=>{var x;return((x=v.label)==null?void 0:x.toLowerCase().includes(m.toLowerCase().trim()))||v.value.toLowerCase().includes(m.toLowerCase().trim())},onChange:h})})})]})},Pg=d.memo(Gae),Kae=()=>{const e=F(m=>m.generation.negativePrompt),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Er(),s=ee(),{t:i}=J(),l=d.useCallback(m=>{s(Lu(m.target.value))},[s]),u=d.useCallback(m=>{m.key==="<"&&o()},[o]),p=d.useCallback(m=>{if(!t.current)return;const v=t.current.selectionStart;if(v===void 0)return;let x=e.slice(0,v);x[x.length-1]!=="<"&&(x+="<"),x+=`${m}>`;const y=x.length;x+=e.slice(v),Lr.flushSync(()=>{s(Lu(x))}),t.current.selectionEnd=y,r()},[s,r,e]),h=Xt("embedding").isFeatureEnabled;return a.jsxs(fn,{children:[a.jsx(Pg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(oa,{id:"negativePrompt",name:"negativePrompt",ref:t,value:e,placeholder:i("parameters.negativePromptPlaceholder"),onChange:l,resize:"vertical",fontSize:"sm",minH:16,...h&&{onKeyDown:u}})}),!n&&h&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(jg,{onClick:o})})]})},yO=d.memo(Kae),qae=ie([be,wn],({generation:e},t)=>({prompt:e.positivePrompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:_t}}),Xae=()=>{const e=ee(),{prompt:t,activeTabName:n}=F(qae),r=Ud(),o=d.useRef(null),{isOpen:s,onClose:i,onOpen:l}=Er(),{t:u}=J(),p=d.useCallback(x=>{e($u(x.target.value))},[e]);Qe("alt+a",()=>{var x;(x=o.current)==null||x.focus()},[]);const h=d.useCallback(x=>{if(!o.current)return;const y=o.current.selectionStart;if(y===void 0)return;let b=t.slice(0,y);b[b.length-1]!=="<"&&(b+="<"),b+=`${x}>`;const w=b.length;b+=t.slice(y),Lr.flushSync(()=>{e($u(b))}),o.current.selectionStart=w,o.current.selectionEnd=w,i()},[e,i,t]),m=Xt("embedding").isFeatureEnabled,v=d.useCallback(x=>{x.key==="Enter"&&x.shiftKey===!1&&r&&(x.preventDefault(),e(bd()),e(mm(n))),m&&x.key==="<"&&l()},[r,e,n,l,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(fn,{children:a.jsx(Pg,{isOpen:s,onClose:i,onSelect:h,children:a.jsx(oa,{id:"prompt",name:"prompt",ref:o,value:t,placeholder:u("parameters.positivePromptPlaceholder"),onChange:p,onKeyDown:v,resize:"vertical",minH:32})})}),!s&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(jg,{onClick:l})})]})},CO=d.memo(Xae);function Yae(){const e=F(o=>o.sdxl.shouldConcatSDXLStylePrompt),t=ee(),{t:n}=J(),r=()=>{t(VR(!e))};return a.jsx(Te,{"aria-label":n("sdxl.concatPromptStyle"),tooltip:n("sdxl.concatPromptStyle"),variant:"outline",isChecked:e,onClick:r,icon:a.jsx(DE,{}),size:"xs",sx:{position:"absolute",insetInlineEnd:1,top:6,border:"none",color:e?"accent.500":"base.500",_hover:{bg:"none"}}})}const $_={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 wO(){return a.jsxs($,{children:[a.jsx(Ie,{as:vn.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",...$_,_dark:{borderColor:"accent.500"}}}),a.jsx(Ie,{as:vn.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(DE,{size:12})}),a.jsx(Ie,{as:vn.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",...$_,_dark:{borderColor:"accent.500"}}})]})}const Qae=ie([be,wn],({sdxl:e},t)=>{const{negativeStylePrompt:n,shouldConcatSDXLStylePrompt:r}=e;return{prompt:n,shouldConcatSDXLStylePrompt:r,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:_t}}),Zae=()=>{const e=ee(),t=Ud(),n=d.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Er(),{t:i}=J(),{prompt:l,activeTabName:u,shouldConcatSDXLStylePrompt:p}=F(Qae),h=d.useCallback(y=>{e(Fu(y.target.value))},[e]),m=d.useCallback(y=>{if(!n.current)return;const b=n.current.selectionStart;if(b===void 0)return;let w=l.slice(0,b);w[w.length-1]!=="<"&&(w+="<"),w+=`${y}>`;const k=w.length;w+=l.slice(b),Lr.flushSync(()=>{e(Fu(w))}),n.current.selectionStart=k,n.current.selectionEnd=k,o()},[e,o,l]),v=Xt("embedding").isFeatureEnabled,x=d.useCallback(y=>{y.key==="Enter"&&y.shiftKey===!1&&t&&(y.preventDefault(),e(bd()),e(mm(u))),v&&y.key==="<"&&s()},[t,e,u,s,v]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(nr,{children:p&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(wO,{})})}),a.jsx(fn,{children:a.jsx(Pg,{isOpen:r,onClose:o,onSelect:m,children:a.jsx(oa,{id:"prompt",name:"prompt",ref:n,value:l,placeholder:i("sdxl.negStylePrompt"),onChange:h,onKeyDown:x,resize:"vertical",fontSize:"sm",minH:16})})}),!r&&v&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(jg,{onClick:s})})]})},Jae=d.memo(Zae),eie=ie([be,wn],({sdxl:e},t)=>{const{positiveStylePrompt:n,shouldConcatSDXLStylePrompt:r}=e;return{prompt:n,shouldConcatSDXLStylePrompt:r,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:_t}}),tie=()=>{const e=ee(),t=Ud(),n=d.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Er(),{t:i}=J(),{prompt:l,activeTabName:u,shouldConcatSDXLStylePrompt:p}=F(eie),h=d.useCallback(y=>{e(zu(y.target.value))},[e]),m=d.useCallback(y=>{if(!n.current)return;const b=n.current.selectionStart;if(b===void 0)return;let w=l.slice(0,b);w[w.length-1]!=="<"&&(w+="<"),w+=`${y}>`;const k=w.length;w+=l.slice(b),Lr.flushSync(()=>{e(zu(w))}),n.current.selectionStart=k,n.current.selectionEnd=k,o()},[e,o,l]),v=Xt("embedding").isFeatureEnabled,x=d.useCallback(y=>{y.key==="Enter"&&y.shiftKey===!1&&t&&(y.preventDefault(),e(bd()),e(mm(u))),v&&y.key==="<"&&s()},[t,e,u,s,v]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(nr,{children:p&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(wO,{})})}),a.jsx(fn,{children:a.jsx(Pg,{isOpen:r,onClose:o,onSelect:m,children:a.jsx(oa,{id:"prompt",name:"prompt",ref:n,value:l,placeholder:i("sdxl.posStylePrompt"),onChange:h,onKeyDown:x,resize:"vertical",minH:16})})}),!r&&v&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(jg,{onClick:s})})]})},nie=d.memo(tie);function Ly(){return a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsx(CO,{}),a.jsx(Yae,{}),a.jsx(nie,{}),a.jsx(yO,{}),a.jsx(Jae,{})]})}const ol=()=>{const{isRefinerAvailable:e}=Bo(Gx,{selectFromResult:({data:t})=>({isRefinerAvailable:t?t.ids.length>0:!1})});return e},rie=ie([be],({sdxl:e,ui:t,hotkeys:n})=>{const{refinerCFGScale:r}=e,{shouldUseSliders:o}=t,{shift:s}=n;return{refinerCFGScale:r,shouldUseSliders:o,shift:s}},we),oie=()=>{const{refinerCFGScale:e,shouldUseSliders:t,shift:n}=F(rie),r=ol(),o=ee(),{t:s}=J(),i=d.useCallback(u=>o(s1(u)),[o]),l=d.useCallback(()=>o(s1(7)),[o]);return t?a.jsx(Ze,{label:s("sdxl.cfgScale"),step:n?.1:.5,min:1,max:20,onChange:i,handleReset:l,value:e,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!r}):a.jsx(Uc,{label:s("sdxl.cfgScale"),step:.5,min:1,max:200,onChange:i,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"},isDisabled:!r})},sie=d.memo(oie),aie=e=>{const t=qi("models"),[n,r,o]=e.split("/"),s=WR.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},iie=ie(be,e=>({model:e.sdxl.refinerModel}),we),lie=()=>{const e=ee(),t=Xt("syncModels").isFeatureEnabled,{model:n}=F(iie),{t:r}=J(),{data:o,isLoading:s}=Bo(Gx),i=d.useMemo(()=>{if(!o)return[];const p=[];return Tn(o.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:dn[h.base_model]})}),p},[o]),l=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]),u=d.useCallback(p=>{if(!p)return;const h=aie(p);h&&e(Bj(h))},[e]);return s?a.jsx(Kt,{label:r("sdxl.refinermodel"),placeholder:r("sdxl.loading"),disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Kt,{tooltip:l==null?void 0:l.description,label:r("sdxl.refinermodel"),value:l==null?void 0:l.id,placeholder:i.length>0?r("sdxl.selectAModel"):r("sdxl.noModelsAvailable"),data:i,error:i.length===0,disabled:i.length===0,onChange:u,w:"100%"}),t&&a.jsx(Ie,{mt:7,children:a.jsx(Wc,{iconMode:!0})})]})},cie=d.memo(lie),uie=ie([be],({sdxl:e,hotkeys:t})=>{const{refinerNegativeAestheticScore:n}=e,{shift:r}=t;return{refinerNegativeAestheticScore:n,shift:r}},we),die=()=>{const{refinerNegativeAestheticScore:e,shift:t}=F(uie),n=ol(),r=ee(),{t:o}=J(),s=d.useCallback(l=>r(i1(l)),[r]),i=d.useCallback(()=>r(i1(2.5)),[r]);return a.jsx(Ze,{label:o("sdxl.negAestheticScore"),step:t?.1:.5,min:1,max:10,onChange:s,handleReset:i,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},fie=d.memo(die),pie=ie([be],({sdxl:e,hotkeys:t})=>{const{refinerPositiveAestheticScore:n}=e,{shift:r}=t;return{refinerPositiveAestheticScore:n,shift:r}},we),hie=()=>{const{refinerPositiveAestheticScore:e,shift:t}=F(pie),n=ol(),r=ee(),{t:o}=J(),s=d.useCallback(l=>r(a1(l)),[r]),i=d.useCallback(()=>r(a1(6)),[r]);return a.jsx(Ze,{label:o("sdxl.posAestheticScore"),step:t?.1:.5,min:1,max:10,onChange:s,handleReset:i,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},mie=d.memo(hie),gie=ie(be,({ui:e,sdxl:t})=>{const{refinerScheduler:n}=t,{favoriteSchedulers:r}=e,o=rr(dm,(s,i)=>({value:i,label:s,group:r.includes(i)?"Favorites":void 0})).sort((s,i)=>s.label.localeCompare(i.label));return{refinerScheduler:n,data:o}},we),vie=()=>{const e=ee(),{t}=J(),{refinerScheduler:n,data:r}=F(gie),o=ol(),s=d.useCallback(i=>{i&&e(Hj(i))},[e]);return a.jsx(Kt,{w:"100%",label:t("sdxl.scheduler"),value:n,data:r,onChange:s,disabled:!o})},xie=d.memo(vie),bie=ie([be],({sdxl:e})=>{const{refinerStart:t}=e;return{refinerStart:t}},we),yie=()=>{const{refinerStart:e}=F(bie),t=ee(),n=ol(),r=d.useCallback(i=>t(l1(i)),[t]),{t:o}=J(),s=d.useCallback(()=>t(l1(.8)),[t]);return a.jsx(Ze,{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})},Cie=d.memo(yie),wie=ie([be],({sdxl:e,ui:t})=>{const{refinerSteps:n}=e,{shouldUseSliders:r}=t;return{refinerSteps:n,shouldUseSliders:r}},we),Sie=()=>{const{refinerSteps:e,shouldUseSliders:t}=F(wie),n=ol(),r=ee(),{t:o}=J(),s=d.useCallback(l=>{r(o1(l))},[r]),i=d.useCallback(()=>{r(o1(20))},[r]);return t?a.jsx(Ze,{label:o("sdxl.steps"),min:1,max:100,step:1,onChange:s,handleReset:i,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:500},isDisabled:!n}):a.jsx(Uc,{label:o("sdxl.steps"),min:1,max:500,step:1,onChange:s,value:e,numberInputFieldProps:{textAlign:"center"},isDisabled:!n})},kie=d.memo(Sie);function _ie(){const e=F(s=>s.sdxl.shouldUseSDXLRefiner),t=ol(),n=ee(),{t:r}=J(),o=s=>{n(UR(s.target.checked))};return a.jsx(Gt,{label:r("sdxl.useRefiner"),isChecked:e,onChange:o,isDisabled:!t})}const jie=ie(be,e=>{const{shouldUseSDXLRefiner:t}=e.sdxl,{shouldUseSliders:n}=e.ui;return{activeLabel:t?"Enabled":void 0,shouldUseSliders:n}},we),Pie=()=>{const{activeLabel:e,shouldUseSliders:t}=F(jie),{t:n}=J();return a.jsx(hr,{label:n("sdxl.refiner"),activeLabel:e,children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(_ie,{}),a.jsx(cie,{}),a.jsxs($,{gap:2,flexDirection:t?"column":"row",children:[a.jsx(kie,{}),a.jsx(sie,{})]}),a.jsx(xie,{}),a.jsx(mie,{}),a.jsx(fie,{}),a.jsx(Cie,{})]})})},zy=d.memo(Pie),Iie=ie([be],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:l}=t.sd.guidance,{cfgScale:u}=e,{shouldUseSliders:p}=n,{shift:h}=r;return{cfgScale:u,initial:o,min:s,sliderMax:i,inputMax:l,shouldUseSliders:p,shift:h}},we),Eie=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:i}=F(Iie),l=ee(),{t:u}=J(),p=d.useCallback(m=>l(Vp(m)),[l]),h=d.useCallback(()=>l(Vp(t)),[l,t]);return s?a.jsx(Ze,{label:u("parameters.cfgScale"),step:i?.1:.5,min:n,max:r,onChange:p,handleReset:h,value:e,sliderNumberInputProps:{max:o},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1}):a.jsx(Uc,{label:u("parameters.cfgScale"),step:.5,min:n,max:o,onChange:p,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})},bs=d.memo(Eie),Mie=ie([be],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:i}=e.config.sd.iterations,{iterations:l}=e.generation,{shouldUseSliders:u}=e.ui,p=e.dynamicPrompts.isEnabled&&e.dynamicPrompts.combinatorial,h=e.hotkeys.shift?s:i;return{iterations:l,initial:t,min:n,sliderMax:r,inputMax:o,step:h,shouldUseSliders:u,isDisabled:p}},we),Oie=()=>{const{iterations:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i,isDisabled:l}=F(Mie),u=ee(),{t:p}=J(),h=d.useCallback(v=>{u(ZC(v))},[u]),m=d.useCallback(()=>{u(ZC(t))},[u,t]);return i?a.jsx(Ze,{isDisabled:l,label:p("parameters.images"),step:s,min:n,max:r,onChange:h,handleReset:m,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):a.jsx(Uc,{isDisabled:l,label:p("parameters.images"),step:s,min:n,max:o,onChange:h,value:e,numberInputFieldProps:{textAlign:"center"}})},ys=d.memo(Oie),Die=ie(be,e=>({model:e.generation.model}),we),Rie=()=>{const e=ee(),{t}=J(),{model:n}=F(Die),r=Xt("syncModels").isFeatureEnabled,{data:o,isLoading:s}=Bo(JC),{data:i,isLoading:l}=Xu(JC),u=F(wn),p=d.useMemo(()=>{if(!o)return[];const v=[];return Tn(o.entities,(x,y)=>{x&&v.push({value:y,label:x.model_name,group:dn[x.base_model]})}),Tn(i==null?void 0:i.entities,(x,y)=>{!x||u==="unifiedCanvas"||u==="img2img"||v.push({value:y,label:x.model_name,group:dn[x.base_model]})}),v},[o,i,u]),h=d.useMemo(()=>((o==null?void 0:o.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])||(i==null?void 0:i.entities[`${n==null?void 0:n.base_model}/onnx/${n==null?void 0:n.model_name}`]))??null,[o==null?void 0:o.entities,n,i==null?void 0:i.entities]),m=d.useCallback(v=>{if(!v)return;const x=_g(v);x&&e(n1(x))},[e]);return s||l?a.jsx(Kt,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:3,children:[a.jsx(Kt,{tooltip:h==null?void 0:h.description,label:t("modelManager.model"),value:h==null?void 0:h.id,placeholder:p.length>0?"Select a model":"No models available",data:p,error:p.length===0,disabled:p.length===0,onChange:m,w:"100%"}),r&&a.jsx(Ie,{mt:7,children:a.jsx(Wc,{iconMode:!0})})]})},Aie=d.memo(Rie),Nie=ie(be,({generation:e})=>{const{model:t,vae:n}=e;return{model:t,vae:n}},we),Tie=()=>{const e=ee(),{t}=J(),{model:n,vae:r}=F(Nie),{data:o}=Xj(),s=d.useMemo(()=>{if(!o)return[];const u=[{value:"default",label:"Default",group:"Default"}];return Tn(o.entities,(p,h)=>{if(!p)return;const m=(n==null?void 0:n.base_model)!==p.base_model;u.push({value:h,label:p.model_name,group:dn[p.base_model],disabled:m,tooltip:m?`Incompatible base model: ${p.base_model}`:void 0})}),u.sort((p,h)=>p.disabled&&!h.disabled?1:-1)},[o,n==null?void 0:n.base_model]),i=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]),l=d.useCallback(u=>{if(!u||u==="default"){e(ew(null));return}const p=xO(u);p&&e(ew(p))},[e]);return a.jsx(Kt,{itemComponent:ri,tooltip:i==null?void 0:i.description,label:t("modelManager.vae"),value:(i==null?void 0:i.id)??"default",placeholder:"Default",data:s,onChange:l,disabled:s.length===0,clearable:!0})},$ie=d.memo(Tie),Lie=ie([Kx,Ur],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=rr(dm,(s,i)=>({value:i,label:s,group:r.includes(i)?"Favorites":void 0})).sort((s,i)=>s.label.localeCompare(i.label));return{scheduler:n,data:o}},we),zie=()=>{const e=ee(),{t}=J(),{scheduler:n,data:r}=F(Lie),o=d.useCallback(s=>{s&&e(r1(s))},[e]);return a.jsx(Kt,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})},Fie=d.memo(zie),Bie=ie(be,({generation:e})=>{const{vaePrecision:t}=e;return{vaePrecision:t}},we),Hie=["fp16","fp32"],Vie=()=>{const e=ee(),{vaePrecision:t}=F(Bie),n=d.useCallback(r=>{r&&e(GR(r))},[e]);return a.jsx($n,{label:"VAE Precision",value:t,data:Hie,onChange:n})},Wie=d.memo(Vie),Uie=()=>{const e=Xt("vae").isFeatureEnabled;return a.jsxs($,{gap:3,w:"full",flexWrap:e?"wrap":"nowrap",children:[a.jsx(Ie,{w:"full",children:a.jsx(Aie,{})}),a.jsx(Ie,{w:"full",children:a.jsx(Fie,{})}),e&&a.jsxs($,{w:"full",gap:3,children:[a.jsx($ie,{}),a.jsx(Wie,{})]})]})},Cs=d.memo(Uie),SO=[{name:"Free",value:null},{name:"2:3",value:2/3},{name:"16:9",value:16/9},{name:"1:1",value:1/1}],kO=SO.map(e=>e.value);function _O(){const e=F(o=>o.generation.aspectRatio),t=ee(),n=F(o=>o.generation.shouldFitToWidthHeight),r=F(wn);return a.jsx($,{gap:2,flexGrow:1,children:a.jsx(mn,{isAttached:!0,children:SO.map(o=>a.jsx(it,{size:"sm",isChecked:e===o.value,isDisabled:r==="img2img"?!n:!1,onClick:()=>{t(Mo(o.value)),t(Yu(!1))},children:o.name},o.name))})})}const Gie=ie([be],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:l}=n.sd.height,{model:u,height:p}=e,{aspectRatio:h}=e,m=t.shift?i:l;return{model:u,height:p,min:r,sliderMax:o,inputMax:s,step:m,aspectRatio:h}},we),Kie=e=>{const{model:t,height:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:l}=F(Gie),u=ee(),{t:p}=J(),h=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,m=d.useCallback(x=>{if(u(Ni(x)),l){const y=fr(x*l,8);u(Ai(y))}},[u,l]),v=d.useCallback(()=>{if(u(Ni(h)),l){const x=fr(h*l,8);u(Ai(x))}},[u,h,l]);return a.jsx(Ze,{label:p("parameters.height"),value:n,min:r,step:i,max:o,onChange:m,handleReset:v,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},qie=d.memo(Kie),Xie=ie([be],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:l}=n.sd.width,{model:u,width:p,aspectRatio:h}=e,m=t.shift?i:l;return{model:u,width:p,min:r,sliderMax:o,inputMax:s,step:m,aspectRatio:h}},we),Yie=e=>{const{model:t,width:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:l}=F(Xie),u=ee(),{t:p}=J(),h=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,m=d.useCallback(x=>{if(u(Ai(x)),l){const y=fr(x/l,8);u(Ni(y))}},[u,l]),v=d.useCallback(()=>{if(u(Ai(h)),l){const x=fr(h/l,8);u(Ni(x))}},[u,h,l]);return a.jsx(Ze,{label:p("parameters.width"),value:n,min:r,step:i,max:o,onChange:m,handleReset:v,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},Qie=d.memo(Yie),Zie=ie([Ur,wn],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}=e;return{activeTabName:t,shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}});function Mc(){const{t:e}=J(),t=ee(),{activeTabName:n,shouldFitToWidthHeight:r,shouldLockAspectRatio:o,width:s,height:i}=F(Zie),l=d.useCallback(()=>{o?(t(Yu(!1)),kO.includes(s/i)?t(Mo(s/i)):t(Mo(null))):(t(Yu(!0)),t(Mo(s/i)))},[o,s,i,t]),u=d.useCallback(()=>{t(KR()),t(Mo(null)),o&&t(Mo(i/s))},[t,o,s,i]);return a.jsxs($,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsxs($,{alignItems:"center",gap:2,children:[a.jsx(ye,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:e("parameters.aspectRatio")}),a.jsx(Za,{}),a.jsx(_O,{}),a.jsx(Te,{tooltip:e("ui.swapSizes"),"aria-label":e("ui.swapSizes"),size:"sm",icon:a.jsx(zM,{}),fontSize:20,isDisabled:n==="img2img"?!r:!1,onClick:u}),a.jsx(Te,{tooltip:e("ui.lockRatio"),"aria-label":e("ui.lockRatio"),size:"sm",icon:a.jsx(RE,{}),isChecked:o,isDisabled:n==="img2img"?!r:!1,onClick:l})]}),a.jsx($,{gap:2,alignItems:"center",children:a.jsxs($,{gap:2,flexDirection:"column",width:"full",children:[a.jsx(Qie,{isDisabled:n==="img2img"?!r:!1}),a.jsx(qie,{isDisabled:n==="img2img"?!r:!1})]})})]})}const Jie=ie([be],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:l,fineStep:u,coarseStep:p}=t.sd.steps,{steps:h}=e,{shouldUseSliders:m}=n,v=r.shift?u:p;return{steps:h,initial:o,min:s,sliderMax:i,inputMax:l,step:v,shouldUseSliders:m}},we),ele=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i}=F(Jie),l=ee(),{t:u}=J(),p=d.useCallback(v=>{l(Wp(v))},[l]),h=d.useCallback(()=>{l(Wp(t))},[l,t]),m=d.useCallback(()=>{l(bd())},[l]);return i?a.jsx(Ze,{label:u("parameters.steps"),min:n,max:r,step:s,onChange:p,handleReset:h,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):a.jsx(Uc,{label:u("parameters.steps"),min:n,max:o,step:s,onChange:p,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:m})},ws=d.memo(ele);function jO(){const e=ee(),t=F(o=>o.generation.shouldFitToWidthHeight),n=o=>e(qR(o.target.checked)),{t:r}=J();return a.jsx(Gt,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function tle(){const e=F(i=>i.generation.seed),t=F(i=>i.generation.shouldRandomizeSeed),n=F(i=>i.generation.shouldGenerateVariations),{t:r}=J(),o=ee(),s=i=>o(Hp(i));return a.jsx(Uc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:Jj,max:e5,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e})}const nle=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function rle(){const e=ee(),t=F(o=>o.generation.shouldRandomizeSeed),{t:n}=J(),r=()=>e(Hp(nle(Jj,e5)));return a.jsx(Te,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:a.jsx(NZ,{})})}const ole=()=>{const e=ee(),{t}=J(),n=F(o=>o.generation.shouldRandomizeSeed),r=o=>e(XR(o.target.checked));return a.jsx(Gt,{label:t("common.random"),isChecked:n,onChange:r})},sle=d.memo(ole),ale=()=>a.jsxs($,{sx:{gap:3,alignItems:"flex-end"},children:[a.jsx(tle,{}),a.jsx(rle,{}),a.jsx(sle,{})]}),Ss=d.memo(ale),PO=e=>a.jsxs($,{sx:{flexDir:"column",gap:2,bg:"base.100",px:4,pt:2,pb:4,borderRadius:"base",_dark:{bg:"base.750"}},children:[e.label&&a.jsx(ye,{fontSize:"sm",fontWeight:"bold",sx:{color:"base.600",_dark:{color:"base.300"}},children:e.label}),e.children]});PO.displayName="SubSettingsWrapper";const Oc=d.memo(PO),ile=ie([be],({sdxl:e})=>{const{sdxlImg2ImgDenoisingStrength:t}=e;return{sdxlImg2ImgDenoisingStrength:t}},we),lle=()=>{const{sdxlImg2ImgDenoisingStrength:e}=F(ile),t=ee(),{t:n}=J(),r=d.useCallback(s=>t(tw(s)),[t]),o=d.useCallback(()=>{t(tw(.7))},[t]);return a.jsx(Oc,{children:a.jsx(Ze,{label:n("sdxl.denoisingStrength"),step:.01,min:0,max:1,onChange:r,handleReset:o,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0})})},IO=d.memo(lle),cle=ie([Kx,Ur],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},we),ule=()=>{const{shouldUseSliders:e,activeLabel:t}=F(cle);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Mc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Mc,{})]}),a.jsx(IO,{}),a.jsx(jO,{})]})})},dle=d.memo(ule),fle=()=>a.jsxs(a.Fragment,{children:[a.jsx(Ly,{}),a.jsx(dle,{}),a.jsx(zy,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(Xc,{})]}),ple=d.memo(fle),hle=ie(be,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},we),mle=()=>{const{shouldUseSliders:e,activeLabel:t}=F(hle);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsx($,{sx:{flexDirection:"column",gap:3},children:e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Mc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Mc,{})]})})})},EO=d.memo(mle),gle=()=>a.jsxs(a.Fragment,{children:[a.jsx(Ly,{}),a.jsx(EO,{}),a.jsx(zy,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(Xc,{})]}),vle=d.memo(gle),xle=[{label:"Unmasked",value:"unmasked"},{label:"Mask",value:"mask"},{label:"Mask Edge",value:"edge"}],ble=()=>{const e=ee(),t=F(o=>o.generation.canvasCoherenceMode),{t:n}=J(),r=o=>{o&&e(YR(o))};return a.jsx($n,{label:n("parameters.coherenceMode"),data:xle,value:t,onChange:r})},yle=d.memo(ble),Cle=()=>{const e=ee(),t=F(r=>r.generation.canvasCoherenceSteps),{t:n}=J();return a.jsx(Ze,{label:n("parameters.coherenceSteps"),min:1,max:100,step:1,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(nw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(nw(20))}})},wle=d.memo(Cle),Sle=()=>{const e=ee(),t=F(r=>r.generation.canvasCoherenceStrength),{t:n}=J();return a.jsx(Ze,{label:n("parameters.coherenceStrength"),min:0,max:1,step:.01,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(rw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(rw(.3))}})},kle=d.memo(Sle);function _le(){const e=ee(),t=F(r=>r.generation.maskBlur),{t:n}=J();return a.jsx(Ze,{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 jle=[{label:"Box Blur",value:"box"},{label:"Gaussian Blur",value:"gaussian"}];function Ple(){const e=F(o=>o.generation.maskBlurMethod),t=ee(),{t:n}=J(),r=o=>{o&&t(QR(o))};return a.jsx($n,{value:e,onChange:r,label:n("parameters.maskBlurMethod"),data:jle})}const Ile=()=>{const{t:e}=J();return a.jsx(hr,{label:e("parameters.compositingSettingsHeader"),children:a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsxs(Oc,{label:e("parameters.coherencePassHeader"),children:[a.jsx(yle,{}),a.jsx(wle,{}),a.jsx(kle,{})]}),a.jsx(Br,{}),a.jsxs(Oc,{label:e("parameters.maskAdjustmentsHeader"),children:[a.jsx(_le,{}),a.jsx(Ple,{})]})]})})},MO=d.memo(Ile),Ele=ie([be],({generation:e})=>{const{infillMethod:t}=e;return{infillMethod:t}},we),Mle=()=>{const e=ee(),{infillMethod:t}=F(Ele),{data:n,isLoading:r}=Tj(),o=n==null?void 0:n.infill_methods,{t:s}=J(),i=d.useCallback(l=>{e(ZR(l))},[e]);return a.jsx($n,{disabled:(o==null?void 0:o.length)===0,placeholder:r?"Loading...":void 0,label:s("parameters.infillMethod"),value:t,data:o??[],onChange:i})},Ole=d.memo(Mle),Dle=ie([Ur],e=>{const{infillPatchmatchDownscaleSize:t,infillMethod:n}=e;return{infillPatchmatchDownscaleSize:t,infillMethod:n}},we),Rle=()=>{const e=ee(),{infillPatchmatchDownscaleSize:t,infillMethod:n}=F(Dle),{t:r}=J(),o=d.useCallback(i=>{e(sw(i))},[e]),s=d.useCallback(()=>{e(sw(2))},[e]);return a.jsx(Ze,{isDisabled:n!=="patchmatch",label:r("parameters.patchmatchDownScaleSize"),min:1,max:10,value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},Ale=d.memo(Rle),Nle=ie([Ur],e=>{const{infillTileSize:t,infillMethod:n}=e;return{infillTileSize:t,infillMethod:n}},we),Tle=()=>{const e=ee(),{infillTileSize:t,infillMethod:n}=F(Nle),{t:r}=J(),o=d.useCallback(i=>{e(aw(i))},[e]),s=d.useCallback(()=>{e(aw(32))},[e]);return a.jsx(Ze,{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})},$le=d.memo(Tle),Lle=ie([Ur],e=>{const{infillMethod:t}=e;return{infillMethod:t}},we);function zle(){const{infillMethod:e}=F(Lle);return a.jsxs($,{children:[e==="tile"&&a.jsx($le,{}),e==="patchmatch"&&a.jsx(Ale,{})]})}const Lt=e=>e.canvas,bo=ie([Lt,wn,vo],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Fle=ie([Lt],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},we),Ble=()=>{const e=ee(),{boundingBoxScale:t}=F(Fle),{t:n}=J(),r=o=>{e(eA(o))};return a.jsx(Kt,{label:n("parameters.scaleBeforeProcessing"),data:JR,value:t,onChange:r})},Hle=d.memo(Ble),Vle=ie([Ur,Lt],(e,t)=>{const{scaledBoundingBoxDimensions:n,boundingBoxScaleMethod:r}=t,{model:o,aspectRatio:s}=e;return{model:o,scaledBoundingBoxDimensions:n,isManual:r==="manual",aspectRatio:s}},we),Wle=()=>{const e=ee(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=F(Vle),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=J(),l=p=>{let h=r.width;const m=Math.floor(p);o&&(h=fr(m*o,64)),e(Gp({width:h,height:m}))},u=()=>{let p=r.width;const h=Math.floor(s);o&&(p=fr(h*o,64)),e(Gp({width:p,height:h}))};return a.jsx(Ze,{isDisabled:!n,label:i("parameters.scaledHeight"),min:64,max:1536,step:64,value:r.height,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},Ule=d.memo(Wle),Gle=ie([Lt,Ur],(e,t)=>{const{boundingBoxScaleMethod:n,scaledBoundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,scaledBoundingBoxDimensions:r,aspectRatio:s,isManual:n==="manual"}},we),Kle=()=>{const e=ee(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=F(Gle),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=J(),l=p=>{const h=Math.floor(p);let m=r.height;o&&(m=fr(h/o,64)),e(Gp({width:h,height:m}))},u=()=>{const p=Math.floor(s);let h=r.height;o&&(h=fr(p/o,64)),e(Gp({width:p,height:h}))};return a.jsx(Ze,{isDisabled:!n,label:i("parameters.scaledWidth"),min:64,max:1536,step:64,value:r.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},qle=d.memo(Kle),Xle=()=>{const{t:e}=J();return a.jsx(hr,{label:e("parameters.infillScalingHeader"),children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsxs(Oc,{children:[a.jsx(Ole,{}),a.jsx(zle,{})]}),a.jsx(Br,{}),a.jsxs(Oc,{children:[a.jsx(Hle,{}),a.jsx(qle,{}),a.jsx(Ule,{})]})]})})},OO=d.memo(Xle),Yle=ie([be,bo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},we),Qle=()=>{const e=ee(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=F(Yle),{t:s}=J(),i=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,l=p=>{if(e(Ao({...n,height:Math.floor(p)})),o){const h=fr(p*o,64);e(Ao({width:h,height:Math.floor(p)}))}},u=()=>{if(e(Ao({...n,height:Math.floor(i)})),o){const p=fr(i*o,64);e(Ao({width:p,height:Math.floor(i)}))}};return a.jsx(Ze,{label:s("parameters.boundingBoxHeight"),min:64,max:1536,step:64,value:n.height,onChange:l,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},Zle=d.memo(Qle),Jle=ie([be,bo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},we),ece=()=>{const e=ee(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=F(Jle),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=J(),l=p=>{if(e(Ao({...n,width:Math.floor(p)})),o){const h=fr(p/o,64);e(Ao({width:Math.floor(p),height:h}))}},u=()=>{if(e(Ao({...n,width:Math.floor(s)})),o){const p=fr(s/o,64);e(Ao({width:Math.floor(s),height:p}))}};return a.jsx(Ze,{label:i("parameters.boundingBoxWidth"),min:64,max:1536,step:64,value:n.width,onChange:l,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},tce=d.memo(ece),nce=ie([Ur,Lt],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r}=e,{boundingBoxDimensions:o}=t;return{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,boundingBoxDimensions:o}});function am(){const e=ee(),{t}=J(),{shouldLockAspectRatio:n,boundingBoxDimensions:r}=F(nce),o=d.useCallback(()=>{n?(e(Yu(!1)),kO.includes(r.width/r.height)?e(Mo(r.width/r.height)):e(Mo(null))):(e(Yu(!0)),e(Mo(r.width/r.height)))},[n,r,e]),s=d.useCallback(()=>{e(tA()),e(Mo(null)),n&&e(Mo(r.height/r.width))},[e,n,r]);return a.jsxs($,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.100",_dark:{bg:"base.750"}},children:[a.jsxs($,{alignItems:"center",gap:2,children:[a.jsx(ye,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:t("parameters.aspectRatio")}),a.jsx(Za,{}),a.jsx(_O,{}),a.jsx(Te,{tooltip:t("ui.swapSizes"),"aria-label":t("ui.swapSizes"),size:"sm",icon:a.jsx(zM,{}),fontSize:20,onClick:s}),a.jsx(Te,{tooltip:t("ui.lockRatio"),"aria-label":t("ui.lockRatio"),size:"sm",icon:a.jsx(RE,{}),isChecked:n,onClick:o})]}),a.jsx(tce,{}),a.jsx(Zle,{})]})}const rce=ie(be,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},we),oce=()=>{const{shouldUseSliders:e,activeLabel:t}=F(rce);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}),a.jsx(IO,{})]})})},sce=d.memo(oce);function ace(){return a.jsxs(a.Fragment,{children:[a.jsx(Ly,{}),a.jsx(sce,{}),a.jsx(zy,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(OO,{}),a.jsx(MO,{}),a.jsx(Xc,{})]})}function ice(){const e=F(u=>u.generation.clipSkip),{model:t}=F(u=>u.generation),n=ee(),{t:r}=J(),o=d.useCallback(u=>{n(iw(u))},[n]),s=d.useCallback(()=>{n(iw(0))},[n]),i=d.useMemo(()=>t?Wf[t.base_model].maxClip:Wf["sd-1"].maxClip,[t]),l=d.useMemo(()=>t?Wf[t.base_model].markers:Wf["sd-1"].markers,[t]);return a.jsx(Ze,{label:r("parameters.clipSkip"),"aria-label":r("parameters.clipSkip"),min:0,max:i,step:1,value:e,onChange:o,withSliderMarks:!0,sliderMarks:l,withInput:!0,withReset:!0,handleReset:s})}const lce=ie(be,e=>({activeLabel:e.generation.clipSkip>0?"Clip Skip":void 0}),we);function Fy(){const{activeLabel:e}=F(lce),t=F(r=>r.generation.shouldShowAdvancedOptions),{t:n}=J();return t?a.jsx(hr,{label:n("common.advanced"),activeLabel:e,children:a.jsx($,{sx:{flexDir:"column",gap:2},children:a.jsx(ice,{})})}):null}function By(){return a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsx(CO,{}),a.jsx(yO,{})]})}function cce(){const e=F(o=>o.generation.horizontalSymmetrySteps),t=F(o=>o.generation.steps),n=ee(),{t:r}=J();return a.jsx(Ze,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(lw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(lw(0))})}function uce(){const e=F(o=>o.generation.verticalSymmetrySteps),t=F(o=>o.generation.steps),n=ee(),{t:r}=J();return a.jsx(Ze,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(cw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(cw(0))})}function dce(){const e=F(n=>n.generation.shouldUseSymmetry),t=ee();return a.jsx(Gt,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(nA(n.target.checked))})}const fce=ie(be,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),we),pce=()=>{const{t:e}=J(),{activeLabel:t}=F(fce);return Xt("symmetry").isFeatureEnabled?a.jsx(hr,{label:e("parameters.symmetry"),activeLabel:t,children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(dce,{}),a.jsx(cce,{}),a.jsx(uce,{})]})}):null},Hy=d.memo(pce),hce=ie([be],({generation:e,hotkeys:t,config:n})=>{const{initial:r,min:o,sliderMax:s,inputMax:i,fineStep:l,coarseStep:u}=n.sd.img2imgStrength,{img2imgStrength:p}=e,h=t.shift?l:u;return{img2imgStrength:p,initial:r,min:o,sliderMax:s,inputMax:i,step:h}},we),mce=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=F(hce),i=ee(),{t:l}=J(),u=d.useCallback(h=>i(Up(h)),[i]),p=d.useCallback(()=>{i(Up(t))},[i,t]);return a.jsx(Oc,{children:a.jsx(Ze,{label:`${l("parameters.denoisingStrength")}`,step:s,min:n,max:r,onChange:u,handleReset:p,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,sliderNumberInputProps:{max:o}})})},DO=d.memo(mce),gce=ie([Kx,Ur],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},we),vce=()=>{const{shouldUseSliders:e,activeLabel:t}=F(gce);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Mc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Mc,{})]}),a.jsx(DO,{}),a.jsx(jO,{})]})})},xce=d.memo(vce),bce=()=>a.jsxs(a.Fragment,{children:[a.jsx(By,{}),a.jsx(xce,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(Hy,{}),a.jsx(Xc,{}),a.jsx(Fy,{})]}),yce=d.memo(bce),Cce=()=>a.jsxs(a.Fragment,{children:[a.jsx(By,{}),a.jsx(EO,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(Hy,{}),a.jsx(Xc,{}),a.jsx(Fy,{})]}),wce=d.memo(Cce),Sce=ie(be,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},we),kce=()=>{const{shouldUseSliders:e,activeLabel:t}=F(Sce);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}),a.jsx(DO,{})]})})},_ce=d.memo(kce),jce=()=>a.jsxs(a.Fragment,{children:[a.jsx(By,{}),a.jsx(_ce,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Hy,{}),a.jsx(OO,{}),a.jsx(MO,{}),a.jsx(Xc,{}),a.jsx(Fy,{})]}),Pce=d.memo(jce),Ice=()=>{const e=F(wn),t=F(n=>n.generation.model);return e==="txt2img"?a.jsx(zp,{children:t&&t.base_model==="sdxl"?a.jsx(vle,{}):a.jsx(wce,{})}):e==="img2img"?a.jsx(zp,{children:t&&t.base_model==="sdxl"?a.jsx(ple,{}):a.jsx(yce,{})}):e==="unifiedCanvas"?a.jsx(zp,{children:t&&t.base_model==="sdxl"?a.jsx(ace,{}):a.jsx(Pce,{})}):null},Ece=d.memo(Ice),zp=d.memo(e=>a.jsxs($,{sx:{w:"full",h:"full",flexDir:"column",gap:2},children:[a.jsx(WM,{}),a.jsx($,{layerStyle:"first",sx:{w:"full",h:"full",position:"relative",borderRadius:"base",p:2},children:a.jsx($,{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(lg,{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($,{sx:{gap:2,flexDirection:"column",h:"full",w:"full"},children:e.children})})})})})]}));zp.displayName="ParametersPanelWrapper";const Mce=ie([be],e=>{const{initialImage:t}=e.generation;return{initialImage:t,isResetButtonDisabled:!t}},we),Oce=()=>{const{initialImage:e}=F(Mce),{currentData:t}=po((e==null?void 0:e.imageName)??Fr.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(Ya,{imageDTO:t,droppableData:r,draggableData:n,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Initial Image",noContentFallback:a.jsx(tr,{label:"No initial image selected"})})},Dce=d.memo(Oce),Rce=ie([be],e=>{const{initialImage:t}=e.generation;return{isResetButtonDisabled:!t}},we),Ace={type:"SET_INITIAL_IMAGE"},Nce=()=>{const{isResetButtonDisabled:e}=F(Rce),t=ee(),{getUploadButtonProps:n,getUploadInputProps:r}=_y({postUploadAction:Ace}),o=d.useCallback(()=>{t(rA())},[t]);return a.jsxs($,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",p:2,gap:4},children:[a.jsxs($,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(ye,{sx:{ps:2,fontWeight:600,userSelect:"none",color:"base.700",_dark:{color:"base.200"}},children:"Initial Image"}),a.jsx(Za,{}),a.jsx(Te,{tooltip:"Upload Initial Image","aria-label":"Upload Initial Image",icon:a.jsx(ng,{}),...n()}),a.jsx(Te,{tooltip:"Reset Initial Image","aria-label":"Reset Initial Image",icon:a.jsx(tg,{}),onClick:o,isDisabled:e})]}),a.jsx(Dce,{}),a.jsx("input",{...r()})]})},Tce=d.memo(Nce),$ce=ie([be],({system:e})=>{const{isProcessing:t,isConnected:n}=e;return n&&!t}),Lce=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=J(),o=F($ce);return a.jsx(Te,{onClick:t,icon:a.jsx(Wr,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})},zce=[{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 Fce(){const e=F(r=>r.postprocessing.esrganModelName),t=ee(),n=r=>t(oA(r));return a.jsx($n,{label:"ESRGAN Model",value:e,itemComponent:ri,onChange:n,data:zce})}const Bce=e=>{const{imageDTO:t}=e,n=ee(),r=F(Pn),{t:o}=J(),{isOpen:s,onOpen:i,onClose:l}=Er(),u=d.useCallback(()=>{l(),t&&n(t5({image_name:t.image_name}))},[n,t,l]);return a.jsx(Wd,{isOpen:s,onClose:l,triggerComponent:a.jsx(Te,{onClick:i,icon:a.jsx(CZ,{}),"aria-label":o("parameters.upscale")}),children:a.jsxs($,{sx:{flexDirection:"column",gap:4},children:[a.jsx(Fce,{}),a.jsx(it,{size:"sm",isDisabled:!t||r,onClick:u,children:o("parameters.upscaleImage")})]})})},Hce=d.memo(Bce),Vce=ie([be,wn],({gallery:e,system:t,ui:n,config:r},o)=>{const{isProcessing:s,isConnected:i,shouldConfirmOnDelete:l,progressImage:u}=t,{shouldShowImageDetails:p,shouldHidePreview:h,shouldShowProgressInViewer:m}=n,{shouldFetchMetadataFromApi:v}=r,x=e.selection[e.selection.length-1];return{canDeleteImage:i&&!s,shouldConfirmOnDelete:l,isProcessing:s,isConnected:i,shouldDisableToolbarButtons:!!u||!x,shouldShowImageDetails:p,activeTabName:o,shouldHidePreview:h,shouldShowProgressInViewer:m,lastSelectedImage:x,shouldFetchMetadataFromApi:v}},{memoizeOptions:{resultEqualityCheck:_t}}),Wce=e=>{const t=ee(),{isProcessing:n,isConnected:r,shouldDisableToolbarButtons:o,shouldShowImageDetails:s,lastSelectedImage:i,shouldShowProgressInViewer:l,shouldFetchMetadataFromApi:u}=F(Vce),p=Xt("upscaling").isFeatureEnabled,h=Ji(),{t:m}=J(),{recallBothPrompts:v,recallSeed:x,recallAllParameters:y}=vg(),{currentData:b}=po((i==null?void 0:i.image_name)??Fr.skipToken),w=d.useMemo(()=>i?{image:i,shouldFetchMetadataFromApi:u}:Fr.skipToken,[i,u]),{metadata:k,workflow:_,isLoading:j}=zx(w,{selectFromResult:B=>{var U,Y;return{isLoading:B.isFetching,metadata:(U=B==null?void 0:B.currentData)==null?void 0:U.metadata,workflow:(Y=B==null?void 0:B.currentData)==null?void 0:Y.workflow}}}),I=d.useCallback(()=>{_&&t(Hx(_))},[t,_]),M=d.useCallback(()=>{y(k)},[k,y]);Qe("a",()=>{},[k,y]);const E=d.useCallback(()=>{x(k==null?void 0:k.seed)},[k==null?void 0:k.seed,x]);Qe("s",E,[b]);const O=d.useCallback(()=>{v(k==null?void 0:k.positive_prompt,k==null?void 0:k.negative_prompt,k==null?void 0:k.positive_style_prompt,k==null?void 0:k.negative_style_prompt)},[k==null?void 0:k.negative_prompt,k==null?void 0:k.positive_prompt,k==null?void 0:k.positive_style_prompt,k==null?void 0:k.negative_style_prompt,v]);Qe("p",O,[b]),Qe("w",I,[_]);const D=d.useCallback(()=>{t(FM()),t(pm(b))},[t,b]);Qe("shift+i",D,[b]);const A=d.useCallback(()=>{b&&t(t5({image_name:b.image_name}))},[t,b]),R=d.useCallback(()=>{b&&t(hm([b]))},[t,b]);Qe("Shift+U",()=>{A()},{enabled:()=>!!(p&&!o&&r&&!n)},[p,b,o,r,n]);const T=d.useCallback(()=>t(sA(!s)),[t,s]);Qe("i",()=>{b?T():h({title:m("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[b,s,h]),Qe("delete",()=>{R()},[t,b]);const X=d.useCallback(()=>{t($j(!l))},[t,l]);return a.jsx(a.Fragment,{children:a.jsxs($,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},...e,children:[a.jsx(mn,{isAttached:!0,isDisabled:o,children:a.jsxs(Dd,{children:[a.jsx(Rd,{as:Te,"aria-label":`${m("parameters.sendTo")}...`,tooltip:`${m("parameters.sendTo")}...`,isDisabled:!b,icon:a.jsx(FZ,{})}),a.jsx(Ga,{motionProps:gc,children:b&&a.jsx(BM,{imageDTO:b})})]})}),a.jsxs(mn,{isAttached:!0,isDisabled:o,children:[a.jsx(Te,{isLoading:j,icon:a.jsx(xg,{}),tooltip:`${m("nodes.loadWorkflow")} (W)`,"aria-label":`${m("nodes.loadWorkflow")} (W)`,isDisabled:!_,onClick:I}),a.jsx(Te,{isLoading:j,icon:a.jsx(NE,{}),tooltip:`${m("parameters.usePrompt")} (P)`,"aria-label":`${m("parameters.usePrompt")} (P)`,isDisabled:!(k!=null&&k.positive_prompt),onClick:O}),a.jsx(Te,{isLoading:j,icon:a.jsx(TE,{}),tooltip:`${m("parameters.useSeed")} (S)`,"aria-label":`${m("parameters.useSeed")} (S)`,isDisabled:!(k!=null&&k.seed),onClick:E}),a.jsx(Te,{isLoading:j,icon:a.jsx(_E,{}),tooltip:`${m("parameters.useAll")} (A)`,"aria-label":`${m("parameters.useAll")} (A)`,isDisabled:!k,onClick:M})]}),p&&a.jsx(mn,{isAttached:!0,isDisabled:o,children:p&&a.jsx(Hce,{imageDTO:b})}),a.jsx(mn,{isAttached:!0,isDisabled:o,children:a.jsx(Te,{icon:a.jsx(PE,{}),tooltip:`${m("parameters.info")} (I)`,"aria-label":`${m("parameters.info")} (I)`,isChecked:s,onClick:T})}),a.jsx(mn,{isAttached:!0,children:a.jsx(Te,{"aria-label":m("settings.displayInProgress"),tooltip:m("settings.displayInProgress"),icon:a.jsx(IZ,{}),isChecked:l,onClick:X})}),a.jsx(mn,{isAttached:!0,children:a.jsx(Lce,{onClick:R,isDisabled:o})})]})})},Uce=d.memo(Wce),Gce=ie([be,Vx],(e,t)=>{var _,j;const{data:n,status:r}=aA.endpoints.listImages.select(t)(e),{data:o}=e.gallery.galleryView==="images"?uw.endpoints.getBoardImagesTotal.select(t.board_id??"none")(e):uw.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(e),s=e.gallery.selection[e.gallery.selection.length-1],i=r==="pending";if(!n||!s||o===0)return{isFetching:i,queryArgs:t,isOnFirstImage:!0,isOnLastImage:!0};const l={...t,offset:n.ids.length,limit:Kj},u=iA.getSelectors(),p=u.selectAll(n),h=p.findIndex(I=>I.image_name===s.image_name),m=Ri(h+1,0,p.length-1),v=Ri(h-1,0,p.length-1),x=(_=p[m])==null?void 0:_.image_name,y=(j=p[v])==null?void 0:j.image_name,b=x?u.selectById(n,x):void 0,w=y?u.selectById(n,y):void 0,k=p.length;return{loadedImagesCount:p.length,currentImageIndex:h,areMoreImagesAvailable:(o??0)>k,isFetching:r==="pending",nextImage:b,prevImage:w,queryArgs:l}},{memoizeOptions:{resultEqualityCheck:_t}}),RO=()=>{const e=ee(),{nextImage:t,prevImage:n,areMoreImagesAvailable:r,isFetching:o,queryArgs:s,loadedImagesCount:i,currentImageIndex:l}=F(Gce),u=d.useCallback(()=>{n&&e(dw(n))},[e,n]),p=d.useCallback(()=>{t&&e(dw(t))},[e,t]),[h]=Gj(),m=d.useCallback(()=>{h(s)},[h,s]);return{handlePrevImage:u,handleNextImage:p,isOnFirstImage:l===0,isOnLastImage:l!==void 0&&l===i-1,nextImage:t,prevImage:n,areMoreImagesAvailable:r,handleLoadMoreImages:m,isFetching:o}};function Kce(e){return Ne({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 qce=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:i}=J();return t?a.jsxs($,{gap:2,children:[n&&a.jsx(Rt,{label:`Recall ${e}`,children:a.jsx(ps,{"aria-label":i("accessibility.useThisParameter"),icon:a.jsx(Kce,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&a.jsx(Rt,{label:`Copy ${e}`,children:a.jsx(ps,{"aria-label":`Copy ${e}`,icon:a.jsx(Hc,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),a.jsxs($,{direction:o?"column":"row",children:[a.jsxs(ye,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?a.jsxs(Im,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",a.jsx(gM,{mx:"2px"})]}):a.jsx(ye,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},to=d.memo(qce),Xce=e=>{const{metadata:t}=e,{t:n}=J(),{recallPositivePrompt:r,recallNegativePrompt:o,recallSeed:s,recallCfgScale:i,recallModel:l,recallScheduler:u,recallSteps:p,recallWidth:h,recallHeight:m,recallStrength:v}=vg(),x=d.useCallback(()=>{r(t==null?void 0:t.positive_prompt)},[t==null?void 0:t.positive_prompt,r]),y=d.useCallback(()=>{o(t==null?void 0:t.negative_prompt)},[t==null?void 0:t.negative_prompt,o]),b=d.useCallback(()=>{s(t==null?void 0:t.seed)},[t==null?void 0:t.seed,s]),w=d.useCallback(()=>{l(t==null?void 0:t.model)},[t==null?void 0:t.model,l]),k=d.useCallback(()=>{h(t==null?void 0:t.width)},[t==null?void 0:t.width,h]),_=d.useCallback(()=>{m(t==null?void 0:t.height)},[t==null?void 0:t.height,m]),j=d.useCallback(()=>{u(t==null?void 0:t.scheduler)},[t==null?void 0:t.scheduler,u]),I=d.useCallback(()=>{p(t==null?void 0:t.steps)},[t==null?void 0:t.steps,p]),M=d.useCallback(()=>{i(t==null?void 0:t.cfg_scale)},[t==null?void 0:t.cfg_scale,i]),E=d.useCallback(()=>{v(t==null?void 0:t.strength)},[t==null?void 0:t.strength,v]);return!t||Object.keys(t).length===0?null:a.jsxs(a.Fragment,{children:[t.created_by&&a.jsx(to,{label:n("metadata.createdBy"),value:t.created_by}),t.generation_mode&&a.jsx(to,{label:n("metadata.generationMode"),value:t.generation_mode}),t.positive_prompt&&a.jsx(to,{label:n("metadata.positivePrompt"),labelPosition:"top",value:t.positive_prompt,onClick:x}),t.negative_prompt&&a.jsx(to,{label:n("metadata.NegativePrompt"),labelPosition:"top",value:t.negative_prompt,onClick:y}),t.seed!==void 0&&t.seed!==null&&a.jsx(to,{label:n("metadata.seed"),value:t.seed,onClick:b}),t.model!==void 0&&t.model!==null&&t.model.model_name&&a.jsx(to,{label:n("metadata.model"),value:t.model.model_name,onClick:w}),t.width&&a.jsx(to,{label:n("metadata.width"),value:t.width,onClick:k}),t.height&&a.jsx(to,{label:n("metadata.height"),value:t.height,onClick:_}),t.scheduler&&a.jsx(to,{label:n("metadata.scheduler"),value:t.scheduler,onClick:j}),t.steps&&a.jsx(to,{label:n("metadata.steps"),value:t.steps,onClick:I}),t.cfg_scale!==void 0&&t.cfg_scale!==null&&a.jsx(to,{label:n("metadata.cfgScale"),value:t.cfg_scale,onClick:M}),t.strength&&a.jsx(to,{label:n("metadata.strength"),value:t.strength,onClick:E})]})},Yce=d.memo(Xce),Qce=({image:e})=>{const{t}=J(),{shouldFetchMetadataFromApi:n}=F(Iy),{metadata:r,workflow:o}=zx({image:e,shouldFetchMetadataFromApi:n},{selectFromResult:s=>{var i,l;return{metadata:(i=s==null?void 0:s.currentData)==null?void 0:i.metadata,workflow:(l=s==null?void 0:s.currentData)==null?void 0:l.workflow}}});return a.jsxs($,{layerStyle:"first",sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",borderRadius:"base",position:"absolute",overflow:"hidden"},children:[a.jsxs($,{gap:2,children:[a.jsx(ye,{fontWeight:"semibold",children:"File:"}),a.jsxs(Im,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,a.jsx(gM,{mx:"2px"})]})]}),a.jsx(Yce,{metadata:r}),a.jsxs(Qi,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(Zi,{children:[a.jsx(Pr,{children:t("metadata.metadata")}),a.jsx(Pr,{children:t("metadata.imageDetails")}),a.jsx(Pr,{children:t("metadata.workflow")})]}),a.jsxs(zc,{children:[a.jsx(fo,{children:r?a.jsx(Oi,{data:r,label:t("metadata.metadata")}):a.jsx(tr,{label:t("metadata.noMetaData")})}),a.jsx(fo,{children:e?a.jsx(Oi,{data:e,label:t("metadata.imageDetails")}):a.jsx(tr,{label:t("metadata.noImageDetails")})}),a.jsx(fo,{children:o?a.jsx(Oi,{data:o,label:t("metadata.workflow")}):a.jsx(tr,{label:t("metadata.noWorkFlow")})})]})]})]})},Zce=d.memo(Qce),Uv={color:"base.100",pointerEvents:"auto"},Jce=()=>{const{t:e}=J(),{handlePrevImage:t,handleNextImage:n,isOnFirstImage:r,isOnLastImage:o,handleLoadMoreImages:s,areMoreImagesAvailable:i,isFetching:l}=RO();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(ps,{"aria-label":e("accessibility.previousImage"),icon:a.jsx(iZ,{size:64}),variant:"unstyled",onClick:t,boxSize:16,sx:Uv})}),a.jsxs(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineEnd:0},children:[!o&&a.jsx(ps,{"aria-label":e("accessibility.nextImage"),icon:a.jsx(lZ,{size:64}),variant:"unstyled",onClick:n,boxSize:16,sx:Uv}),o&&i&&!l&&a.jsx(ps,{"aria-label":e("accessibility.loadMore"),icon:a.jsx(aZ,{size:64}),variant:"unstyled",onClick:s,boxSize:16,sx:Uv}),o&&i&&l&&a.jsx($,{sx:{w:16,h:16,alignItems:"center",justifyContent:"center"},children:a.jsx(Ki,{opacity:.5,size:"xl"})})]})]})},AO=d.memo(Jce),eue=ie([be,lA],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{progressImage:i,shouldAntialiasProgressImage:l}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n==null?void 0:n.image_name,progressImage:i,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:l}},{memoizeOptions:{resultEqualityCheck:_t}}),tue=()=>{const{shouldShowImageDetails:e,imageName:t,progressImage:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=F(eue),{handlePrevImage:s,handleNextImage:i,isOnLastImage:l,handleLoadMoreImages:u,areMoreImagesAvailable:p,isFetching:h}=RO();Qe("left",()=>{s()},[s]),Qe("right",()=>{if(l&&p&&!h){u();return}l||i()},[l,p,u,h,i]);const{currentData:m}=po(t??Fr.skipToken),v=d.useMemo(()=>{if(m)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:m}}},[m]),x=d.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]),[y,b]=d.useState(!1),w=d.useRef(0),{t:k}=J(),_=d.useCallback(()=>{b(!0),window.clearTimeout(w.current)},[]),j=d.useCallback(()=>{w.current=window.setTimeout(()=>{b(!1)},500)},[]);return a.jsxs($,{onMouseOver:_,onMouseOut:j,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n&&r?a.jsx(Xi,{src:n.dataURL,width:n.width,height:n.height,draggable:!1,sx:{objectFit:"contain",maxWidth:"full",maxHeight:"full",height:"auto",position:"absolute",borderRadius:"base",imageRendering:o?"auto":"pixelated"}}):a.jsx(Ya,{imageDTO:m,droppableData:x,draggableData:v,isUploadDisabled:!0,fitContainer:!0,useThumbailFallback:!0,dropLabel:k("gallery.setCurrentImage"),noContentFallback:a.jsx(tr,{icon:Vi,label:"No image selected"})}),e&&m&&a.jsx(Ie,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base"},children:a.jsx(Zce,{image:m})}),a.jsx(nr,{children:!e&&m&&y&&a.jsx(vn.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(AO,{})},"nextPrevButtons")})]})},nue=d.memo(tue),rue=()=>a.jsxs($,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[a.jsx(Uce,{}),a.jsx(nue,{})]}),oue=d.memo(rue),sue=()=>a.jsx(Ie,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:2,borderRadius:"base"},children:a.jsx($,{sx:{width:"100%",height:"100%"},children:a.jsx(oue,{})})}),NO=d.memo(sue),aue=()=>{const e=d.useRef(null),t=d.useCallback(()=>{e.current&&e.current.setLayout([50,50])},[]),n=Dy();return a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsxs(Cg,{ref:e,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},storage:n,units:"percentages",children:[a.jsx(Wa,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:a.jsx(Tce,{})}),a.jsx(om,{onDoubleClick:t}),a.jsx(Wa,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,children:a.jsx(NO,{})})]})})},iue=d.memo(aue);var lue=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n};const L_=Dc(lue);function Cx(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 cue=Object.defineProperty,z_=Object.getOwnPropertySymbols,uue=Object.prototype.hasOwnProperty,due=Object.prototype.propertyIsEnumerable,F_=(e,t,n)=>t in e?cue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fue=(e,t)=>{for(var n in t||(t={}))uue.call(t,n)&&F_(e,n,t[n]);if(z_)for(var n of z_(t))due.call(t,n)&&F_(e,n,t[n]);return e};function TO(e,t){if(t===null||typeof t!="object")return{};const n=fue({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const pue="__MANTINE_FORM_INDEX__";function B_(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${pue}`)):!1:!1}function H_(e,t,n){typeof n.value=="object"&&(n.value=ql(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function ql(e){if(typeof e!="object")return e;var t=0,n,r,o,s=Object.prototype.toString.call(e);if(s==="[object Object]"?o=Object.create(e.__proto__||null):s==="[object Array]"?o=Array(e.length):s==="[object Set]"?(o=new Set,e.forEach(function(i){o.add(ql(i))})):s==="[object Map]"?(o=new Map,e.forEach(function(i,l){o.set(ql(l),ql(i))})):s==="[object Date]"?o=new Date(+e):s==="[object RegExp]"?o=new RegExp(e.source,e.flags):s==="[object DataView]"?o=new e.constructor(ql(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++)H_(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]||H_(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function $O(e){return typeof e!="string"?[]:e.split(".")}function Ig(e,t,n){const r=$O(e);if(r.length===0)return n;const o=ql(n);if(r.length===1)return o[r[0]]=t,o;let s=o[r[0]];for(let i=1;i<r.length-1;i+=1){if(s===void 0)return o;s=s[r[i]]}return s[r[r.length-1]]=t,o}function Ws(e,t){const n=$O(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 V_(e){const t=Cx(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function wx(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,s)=>{const i=e[s],l=`${n===""?"":`${n}.`}${s}`,u=Ws(l,t);let p=!1;return typeof i=="function"&&(o[l]=i(u,t,l)),typeof i=="object"&&Array.isArray(u)&&(p=!0,u.forEach((h,m)=>wx(i,t,`${l}.${m}`,o))),typeof i=="object"&&typeof u=="object"&&u!==null&&(p||wx(i,t,l,o)),o},r)}function Sx(e,t){return V_(typeof e=="function"?e(t):wx(e,t))}function Pp(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=Sx(t,n),o=Object.keys(r.errors).find(s=>e.split(".").every((i,l)=>i===s.split(".")[l]));return{hasError:!!o,error:o?r.errors[o]:null}}function hue(e,{from:t,to:n},r){const o=Ws(e,r);if(!Array.isArray(o))return r;const s=[...o],i=o[t];return s.splice(t,1),s.splice(n,0,i),Ig(e,s,r)}var mue=Object.defineProperty,W_=Object.getOwnPropertySymbols,gue=Object.prototype.hasOwnProperty,vue=Object.prototype.propertyIsEnumerable,U_=(e,t,n)=>t in e?mue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xue=(e,t)=>{for(var n in t||(t={}))gue.call(t,n)&&U_(e,n,t[n]);if(W_)for(var n of W_(t))vue.call(t,n)&&U_(e,n,t[n]);return e};function bue(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,i=xue({},r);return Object.keys(r).every(l=>{let u,p;if(l.startsWith(o)&&(u=l,p=l.replace(o,s)),l.startsWith(s)&&(u=l.replace(s,o),p=l),u&&p){const h=i[u],m=i[p];return m===void 0?delete i[u]:i[u]=m,h===void 0?delete i[p]:i[p]=h,!1}return!0}),i}function yue(e,t,n){const r=Ws(e,n);return Array.isArray(r)?Ig(e,r.filter((o,s)=>s!==t),n):n}var Cue=Object.defineProperty,G_=Object.getOwnPropertySymbols,wue=Object.prototype.hasOwnProperty,Sue=Object.prototype.propertyIsEnumerable,K_=(e,t,n)=>t in e?Cue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kue=(e,t)=>{for(var n in t||(t={}))wue.call(t,n)&&K_(e,n,t[n]);if(G_)for(var n of G_(t))Sue.call(t,n)&&K_(e,n,t[n]);return e};function q_(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function X_(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=TO(`${o}.${t}`,s));const i=kue({},s),l=new Set;return Object.entries(s).filter(([u])=>{if(!u.startsWith(`${o}.`))return!1;const p=q_(u,o);return Number.isNaN(p)?!1:p>=t}).forEach(([u,p])=>{const h=q_(u,o),m=u.replace(`${o}.${h}`,`${o}.${h+r}`);i[m]=p,l.add(m),l.has(u)||delete i[u]}),i}function _ue(e,t,n,r){const o=Ws(e,r);if(!Array.isArray(o))return r;const s=[...o];return s.splice(typeof n=="number"?n:s.length,0,t),Ig(e,s,r)}function Y_(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 jue(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 Pue=Object.defineProperty,Iue=Object.defineProperties,Eue=Object.getOwnPropertyDescriptors,Q_=Object.getOwnPropertySymbols,Mue=Object.prototype.hasOwnProperty,Oue=Object.prototype.propertyIsEnumerable,Z_=(e,t,n)=>t in e?Pue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ia=(e,t)=>{for(var n in t||(t={}))Mue.call(t,n)&&Z_(e,n,t[n]);if(Q_)for(var n of Q_(t))Oue.call(t,n)&&Z_(e,n,t[n]);return e},Gv=(e,t)=>Iue(e,Eue(t));function sl({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:s=!1,validateInputOnBlur:i=!1,transformValues:l=p=>p,validate:u}={}){const[p,h]=d.useState(r),[m,v]=d.useState(n),[x,y]=d.useState(e),[b,w]=d.useState(Cx(t)),k=d.useRef(e),_=W=>{k.current=W},j=d.useCallback(()=>h({}),[]),I=W=>{const G=W?Ia(Ia({},x),W):x;_(G),v({})},M=d.useCallback(W=>w(G=>Cx(typeof W=="function"?W(G):W)),[]),E=d.useCallback(()=>w({}),[]),O=d.useCallback(()=>{y(e),E(),_(e),v({}),j()},[]),D=d.useCallback((W,G)=>M(te=>Gv(Ia({},te),{[W]:G})),[]),A=d.useCallback(W=>M(G=>{if(typeof W!="string")return G;const te=Ia({},G);return delete te[W],te}),[]),R=d.useCallback(W=>v(G=>{if(typeof W!="string")return G;const te=TO(W,G);return delete te[W],te}),[]),T=d.useCallback((W,G)=>{const te=B_(W,s);R(W),h(ae=>Gv(Ia({},ae),{[W]:!0})),y(ae=>{const oe=Ig(W,G,ae);if(te){const pe=Pp(W,u,oe);pe.hasError?D(W,pe.error):A(W)}return oe}),!te&&o&&D(W,null)},[]),X=d.useCallback(W=>{y(G=>{const te=typeof W=="function"?W(G):W;return Ia(Ia({},G),te)}),o&&E()},[]),B=d.useCallback((W,G)=>{R(W),y(te=>hue(W,G,te)),w(te=>bue(W,G,te))},[]),U=d.useCallback((W,G)=>{R(W),y(te=>yue(W,G,te)),w(te=>X_(W,G,te,-1))},[]),Y=d.useCallback((W,G,te)=>{R(W),y(ae=>_ue(W,G,te,ae)),w(ae=>X_(W,te,ae,1))},[]),V=d.useCallback(()=>{const W=Sx(u,x);return w(W.errors),W},[x,u]),L=d.useCallback(W=>{const G=Pp(W,u,x);return G.hasError?D(W,G.error):A(W),G},[x,u]),q=(W,{type:G="input",withError:te=!0,withFocus:ae=!0}={})=>{const pe={onChange:jue(fe=>T(W,fe))};return te&&(pe.error=b[W]),G==="checkbox"?pe.checked=Ws(W,x):pe.value=Ws(W,x),ae&&(pe.onFocus=()=>h(fe=>Gv(Ia({},fe),{[W]:!0})),pe.onBlur=()=>{if(B_(W,i)){const fe=Pp(W,u,x);fe.hasError?D(W,fe.error):A(W)}}),pe},z=(W,G)=>te=>{te==null||te.preventDefault();const ae=V();ae.hasErrors?G==null||G(ae.errors,x,te):W==null||W(l(x),te)},K=W=>l(W||x),re=d.useCallback(W=>{W.preventDefault(),O()},[]),Q=W=>{if(W){const te=Ws(W,m);if(typeof te=="boolean")return te;const ae=Ws(W,x),oe=Ws(W,k.current);return!L_(ae,oe)}return Object.keys(m).length>0?Y_(m):!L_(x,k.current)},le=d.useCallback(W=>Y_(p,W),[p]),se=d.useCallback(W=>W?!Pp(W,u,x).hasError:!Sx(u,x).hasErrors,[x,u]);return{values:x,errors:b,setValues:X,setErrors:M,setFieldValue:T,setFieldError:D,clearFieldError:A,clearErrors:E,reset:O,validate:V,validateField:L,reorderListItem:B,removeListItem:U,insertListItem:Y,getInputProps:q,onSubmit:z,onReset:re,isDirty:Q,isTouched:le,setTouched:h,setDirty:v,resetTouched:j,resetDirty:I,isValid:se,getTransformedValues:K}}function gn(e){const{...t}=e,{base50:n,base100:r,base200:o,base300:s,base800:i,base700:l,base900:u,accent500:p,accent300:h}=Bd(),{colorMode:m}=ia();return a.jsx(vE,{styles:()=>({input:{color:Ae(u,r)(m),backgroundColor:Ae(n,u)(m),borderColor:Ae(o,i)(m),borderWidth:2,outline:"none",":focus":{borderColor:Ae(h,p)(m)}},label:{color:Ae(l,s)(m),fontWeight:"normal",marginBottom:4}}),...t})}const Due=[{value:"sd-1",label:dn["sd-1"]},{value:"sd-2",label:dn["sd-2"]},{value:"sdxl",label:dn.sdxl},{value:"sdxl-refiner",label:dn["sdxl-refiner"]}];function Kd(e){const{...t}=e,{t:n}=J();return a.jsx($n,{label:n("modelManager.baseModel"),data:Due,...t})}function LO(e){const{data:t}=n5(),{...n}=e;return a.jsx($n,{label:"Config File",placeholder:"Select A Config File",data:t||[],...n})}const Rue=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function Eg(e){const{...t}=e,{t:n}=J();return a.jsx($n,{label:n("modelManager.variant"),data:Rue,...t})}function im(e,t=!0){let n;t?n=new RegExp("[^\\\\/]+(?=\\.)"):n=new RegExp("[^\\\\/]+(?=[\\\\/]?$)");const r=e.match(n);return r?r[0]:""}function zO(e){const{t}=J(),n=ee(),{model_path:r}=e,o=sl({initialValues:{model_name:r?im(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]=r5(),[i,l]=d.useState(!1),u=p=>{s({body:p}).unwrap().then(h=>{n(Tt(Ft({title:t("modelManager.modelAdded",{modelName:p.model_name}),status:"success"}))),o.reset(),r&&n(Cd(null))}).catch(h=>{h&&n(Tt(Ft({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(p=>u(p)),style:{width:"100%"},children:a.jsxs($,{flexDirection:"column",gap:2,children:[a.jsx(gn,{label:t("modelManager.model"),required:!0,...o.getInputProps("model_name")}),a.jsx(Kd,{label:t("modelManager.baseModel"),...o.getInputProps("base_model")}),a.jsx(gn,{label:t("modelManager.modelLocation"),required:!0,...o.getInputProps("path"),onBlur:p=>{if(o.values.model_name===""){const h=im(p.currentTarget.value);h&&o.setFieldValue("model_name",h)}}}),a.jsx(gn,{label:t("modelManager.description"),...o.getInputProps("description")}),a.jsx(gn,{label:t("modelManager.vaeLocation"),...o.getInputProps("vae")}),a.jsx(Eg,{label:t("modelManager.variant"),...o.getInputProps("variant")}),a.jsxs($,{flexDirection:"column",width:"100%",gap:2,children:[i?a.jsx(gn,{required:!0,label:t("modelManager.customConfigFileLocation"),...o.getInputProps("config")}):a.jsx(LO,{required:!0,width:"100%",...o.getInputProps("config")}),a.jsx(ur,{isChecked:i,onChange:()=>l(!i),label:t("modelManager.useCustomConfig")}),a.jsx(it,{mt:2,type:"submit",children:t("modelManager.addModel")})]})]})})}function FO(e){const{t}=J(),n=ee(),{model_path:r}=e,[o]=r5(),s=sl({initialValues:{model_name:r?im(r,!1):"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"diffusers",error:void 0,vae:"",variant:"normal"}}),i=l=>{o({body:l}).unwrap().then(u=>{n(Tt(Ft({title:t("modelManager.modelAdded",{modelName:l.model_name}),status:"success"}))),s.reset(),r&&n(Cd(null))}).catch(u=>{u&&n(Tt(Ft({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:s.onSubmit(l=>i(l)),style:{width:"100%"},children:a.jsxs($,{flexDirection:"column",gap:2,children:[a.jsx(gn,{required:!0,label:t("modelManager.model"),...s.getInputProps("model_name")}),a.jsx(Kd,{label:t("modelManager.baseModel"),...s.getInputProps("base_model")}),a.jsx(gn,{required:!0,label:t("modelManager.modelLocation"),placeholder:t("modelManager.modelLocationValidationMsg"),...s.getInputProps("path"),onBlur:l=>{if(s.values.model_name===""){const u=im(l.currentTarget.value,!1);u&&s.setFieldValue("model_name",u)}}}),a.jsx(gn,{label:t("modelManager.description"),...s.getInputProps("description")}),a.jsx(gn,{label:t("modelManager.vaeLocation"),...s.getInputProps("vae")}),a.jsx(Eg,{label:t("modelManager.variant"),...s.getInputProps("variant")}),a.jsx(it,{mt:2,type:"submit",children:t("modelManager.addModel")})]})})}const BO=[{label:"Diffusers",value:"diffusers"},{label:"Checkpoint / Safetensors",value:"checkpoint"}];function Aue(){const[e,t]=d.useState("diffusers"),{t:n}=J();return a.jsxs($,{flexDirection:"column",gap:4,width:"100%",children:[a.jsx($n,{label:n("modelManager.modelType"),value:e,data:BO,onChange:r=>{r&&t(r)}}),a.jsxs($,{sx:{p:4,borderRadius:4,bg:"base.300",_dark:{bg:"base.850"}},children:[e==="diffusers"&&a.jsx(FO,{}),e==="checkpoint"&&a.jsx(zO,{})]})]})}const Nue=[{label:"None",value:"none"},{label:"v_prediction",value:"v_prediction"},{label:"epsilon",value:"epsilon"},{label:"sample",value:"sample"}];function Tue(){const e=ee(),{t}=J(),n=F(l=>l.system.isProcessing),[r,{isLoading:o}]=o5(),s=sl({initialValues:{location:"",prediction_type:void 0}}),i=l=>{const u={location:l.location,prediction_type:l.prediction_type==="none"?void 0:l.prediction_type};r({body:u}).unwrap().then(p=>{e(Tt(Ft({title:t("toast.modelAddSimple"),status:"success"}))),s.reset()}).catch(p=>{p&&(console.log(p),e(Tt(Ft({title:`${p.data.detail} `,status:"error"}))))})};return a.jsx("form",{onSubmit:s.onSubmit(l=>i(l)),style:{width:"100%"},children:a.jsxs($,{flexDirection:"column",width:"100%",gap:4,children:[a.jsx(gn,{label:t("modelManager.modelLocation"),placeholder:t("modelManager.simpleModelDesc"),w:"100%",...s.getInputProps("location")}),a.jsx($n,{label:t("modelManager.predictionType"),data:Nue,defaultValue:"none",...s.getInputProps("prediction_type")}),a.jsx(it,{type:"submit",isLoading:o,isDisabled:o||n,children:t("modelManager.addModel")})]})})}function $ue(){const[e,t]=d.useState("simple");return a.jsxs($,{flexDirection:"column",width:"100%",overflow:"scroll",maxHeight:window.innerHeight-250,gap:4,children:[a.jsxs(mn,{isAttached:!0,children:[a.jsx(it,{size:"sm",isChecked:e=="simple",onClick:()=>t("simple"),children:"Simple"}),a.jsx(it,{size:"sm",isChecked:e=="advanced",onClick:()=>t("advanced"),children:"Advanced"})]}),a.jsxs($,{sx:{p:4,borderRadius:4,background:"base.200",_dark:{background:"base.800"}},children:[e==="simple"&&a.jsx(Tue,{}),e==="advanced"&&a.jsx(Aue,{})]})]})}function Lue(e){const{...t}=e;return a.jsx(uI,{w:"100%",...t,children:e.children})}function zue(){const e=F(b=>b.modelmanager.searchFolder),[t,n]=d.useState(""),{data:r}=Bo(Ci),{foundModels:o,alreadyInstalled:s,filteredModels:i}=s5({search_path:e||""},{selectFromResult:({data:b})=>{const w=wN(r==null?void 0:r.entities),k=rr(w,"path"),_=yN(b,k),j=PN(b,k);return{foundModels:b,alreadyInstalled:J_(j,t),filteredModels:J_(_,t)}}}),[l,{isLoading:u}]=o5(),p=ee(),{t:h}=J(),m=d.useCallback(b=>{const w=b.currentTarget.id.split("\\").splice(-1)[0];l({body:{location:b.currentTarget.id}}).unwrap().then(k=>{p(Tt(Ft({title:`Added Model: ${w}`,status:"success"})))}).catch(k=>{k&&p(Tt(Ft({title:h("toast.modelAddFailed"),status:"error"})))})},[p,l,h]),v=d.useCallback(b=>{n(b.target.value)},[]),x=({models:b,showActions:w=!0})=>b.map(k=>a.jsxs($,{sx:{p:4,gap:4,alignItems:"center",borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs($,{w:"100%",sx:{flexDirection:"column",minW:"25%"},children:[a.jsx(ye,{sx:{fontWeight:600},children:k.split("\\").slice(-1)[0]}),a.jsx(ye,{sx:{fontSize:"sm",color:"base.600",_dark:{color:"base.400"}},children:k})]}),w?a.jsxs($,{gap:2,children:[a.jsx(it,{id:k,onClick:m,isLoading:u,children:h("modelManager.quickAdd")}),a.jsx(it,{onClick:()=>p(Cd(k)),isLoading:u,children:h("modelManager.advanced")})]}):a.jsx(ye,{sx:{fontWeight:600,p:2,borderRadius:4,color:"accent.50",bg:"accent.400",_dark:{color:"accent.100",bg:"accent.600"}},children:"Installed"})]},k));return(()=>e?!o||o.length===0?a.jsx($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",height:96,userSelect:"none",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(ye,{variant:"subtext",children:h("modelManager.noModels")})}):a.jsxs($,{sx:{flexDirection:"column",gap:2,w:"100%",minW:"50%"},children:[a.jsx(io,{onChange:v,label:h("modelManager.search"),labelPos:"side"}),a.jsxs($,{p:2,gap:2,children:[a.jsxs(ye,{sx:{fontWeight:600},children:["Models Found: ",o.length]}),a.jsxs(ye,{sx:{fontWeight:600,color:"accent.500",_dark:{color:"accent.200"}},children:["Not Installed: ",i.length]})]}),a.jsx(Lue,{offsetScrollbars:!0,children:a.jsxs($,{gap:2,flexDirection:"column",children:[x({models:i}),x({models:s,showActions:!1})]})})]}):null)()}const J_=(e,t)=>{const n=[];return Tn(e,r=>{if(!r)return null;r.includes(t)&&n.push(r)}),n};function Fue(){const e=F(l=>l.modelmanager.advancedAddScanModel),{t}=J(),[n,r]=d.useState("diffusers"),[o,s]=d.useState(!0);d.useEffect(()=>{e&&[".ckpt",".safetensors",".pth",".pt"].some(l=>e.endsWith(l))?r("checkpoint"):r("diffusers")},[e,r,o]);const i=ee();return e?a.jsxs(Ie,{as:vn.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($,{justifyContent:"space-between",alignItems:"center",children:[a.jsx(ye,{size:"xl",fontWeight:600,children:o||n==="checkpoint"?"Add Checkpoint Model":"Add Diffusers Model"}),a.jsx(Te,{icon:a.jsx(HZ,{}),"aria-label":t("modelManager.closeAdvanced"),onClick:()=>i(Cd(null)),size:"sm"})]}),a.jsx($n,{label:t("modelManager.modelType"),value:n,data:BO,onChange:l=>{l&&(r(l),s(l==="checkpoint"))}}),o?a.jsx(zO,{model_path:e},e):a.jsx(FO,{model_path:e},e)]}):null}function Bue(){const e=ee(),{t}=J(),n=F(l=>l.modelmanager.searchFolder),{refetch:r}=s5({search_path:n||""}),o=sl({initialValues:{folder:""}}),s=d.useCallback(l=>{e(fw(l.folder))},[e]),i=()=>{r()};return a.jsx("form",{onSubmit:o.onSubmit(l=>s(l)),style:{width:"100%"},children:a.jsxs($,{sx:{w:"100%",gap:2,borderRadius:4,alignItems:"center"},children:[a.jsxs($,{w:"100%",alignItems:"center",gap:4,minH:12,children:[a.jsx(ye,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",minW:"max-content",_dark:{color:"base.300"}},children:"Folder"}),n?a.jsx($,{sx:{w:"100%",p:2,px:4,bg:"base.300",borderRadius:4,fontSize:"sm",fontWeight:"bold",_dark:{bg:"base.700"}},children:n}):a.jsx(io,{w:"100%",size:"md",...o.getInputProps("folder")})]}),a.jsxs($,{gap:2,children:[n?a.jsx(Te,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:a.jsx(LE,{}),onClick:i,fontSize:18,size:"sm"}):a.jsx(Te,{"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),icon:a.jsx(LZ,{}),fontSize:18,size:"sm",type:"submit"}),a.jsx(Te,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:a.jsx(Wr,{}),size:"sm",onClick:()=>{e(fw(null)),e(Cd(null))},isDisabled:!n,colorScheme:"red"})]})]})})}const Hue=d.memo(Bue);function Vue(){return a.jsxs($,{flexDirection:"column",w:"100%",gap:4,children:[a.jsx(Hue,{}),a.jsxs($,{gap:4,children:[a.jsx($,{sx:{maxHeight:window.innerHeight-300,overflow:"scroll",gap:4,w:"100%"},children:a.jsx(zue,{})}),a.jsx(Fue,{})]})]})}function Wue(){const[e,t]=d.useState("add"),{t:n}=J();return a.jsxs($,{flexDirection:"column",gap:4,children:[a.jsxs(mn,{isAttached:!0,children:[a.jsx(it,{onClick:()=>t("add"),isChecked:e=="add",size:"sm",width:"100%",children:n("modelManager.addModel")}),a.jsx(it,{onClick:()=>t("scan"),isChecked:e=="scan",size:"sm",width:"100%",children:n("modelManager.scanForModels")})]}),e=="add"&&a.jsx($ue,{}),e=="scan"&&a.jsx(Vue,{})]})}const Uue=[{label:"Stable Diffusion 1",value:"sd-1"},{label:"Stable Diffusion 2",value:"sd-2"}];function Gue(){var L,q;const{t:e}=J(),t=ee(),{data:n}=Bo(Ci),[r,{isLoading:o}]=cA(),[s,i]=d.useState("sd-1"),l=ww(n==null?void 0:n.entities,(z,K)=>(z==null?void 0:z.model_format)==="diffusers"&&(z==null?void 0:z.base_model)==="sd-1"),u=ww(n==null?void 0:n.entities,(z,K)=>(z==null?void 0:z.model_format)==="diffusers"&&(z==null?void 0:z.base_model)==="sd-2"),p=d.useMemo(()=>({"sd-1":l,"sd-2":u}),[l,u]),[h,m]=d.useState(((L=Object.keys(p[s]))==null?void 0:L[0])??null),[v,x]=d.useState(((q=Object.keys(p[s]))==null?void 0:q[1])??null),[y,b]=d.useState(null),[w,k]=d.useState(""),[_,j]=d.useState(.5),[I,M]=d.useState("weighted_sum"),[E,O]=d.useState("root"),[D,A]=d.useState(""),[R,T]=d.useState(!1),X=Object.keys(p[s]).filter(z=>z!==v&&z!==y),B=Object.keys(p[s]).filter(z=>z!==h&&z!==y),U=Object.keys(p[s]).filter(z=>z!==h&&z!==v),Y=z=>{i(z),m(null),x(null)},V=()=>{const z=[];let K=[h,v,y];K=K.filter(Q=>Q!==null),K.forEach(Q=>{var se;const le=(se=Q==null?void 0:Q.split("/"))==null?void 0:se[2];le&&z.push(le)});const re={model_names:z,merged_model_name:w!==""?w:z.join("-"),alpha:_,interp:I,force:R,merge_dest_directory:E==="root"?void 0:D};r({base_model:s,body:re}).unwrap().then(Q=>{t(Tt(Ft({title:e("modelManager.modelsMerged"),status:"success"})))}).catch(Q=>{Q&&t(Tt(Ft({title:e("modelManager.modelsMergeFailed"),status:"error"})))})};return a.jsxs($,{flexDirection:"column",rowGap:4,children:[a.jsxs($,{sx:{flexDirection:"column",rowGap:1},children:[a.jsx(ye,{children:e("modelManager.modelMergeHeaderHelp1")}),a.jsx(ye,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),a.jsxs($,{columnGap:4,children:[a.jsx($n,{label:"Model Type",w:"100%",data:Uue,value:s,onChange:Y}),a.jsx(Kt,{label:e("modelManager.modelOne"),w:"100%",value:h,placeholder:e("modelManager.selectModel"),data:X,onChange:z=>m(z)}),a.jsx(Kt,{label:e("modelManager.modelTwo"),w:"100%",placeholder:e("modelManager.selectModel"),value:v,data:B,onChange:z=>x(z)}),a.jsx(Kt,{label:e("modelManager.modelThree"),data:U,w:"100%",placeholder:e("modelManager.selectModel"),clearable:!0,onChange:z=>{z?(b(z),M("weighted_sum")):(b(null),M("add_difference"))}})]}),a.jsx(io,{label:e("modelManager.mergedModelName"),value:w,onChange:z=>k(z.target.value)}),a.jsxs($,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(Ze,{label:e("modelManager.alpha"),min:.01,max:.99,step:.01,value:_,onChange:z=>j(z),withInput:!0,withReset:!0,handleReset:()=>j(.5),withSliderMarks:!0}),a.jsx(ye,{variant:"subtext",fontSize:"sm",children:e("modelManager.modelMergeAlphaHelp")})]}),a.jsxs($,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(ye,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),a.jsx(oh,{value:I,onChange:z=>M(z),children:a.jsx($,{columnGap:4,children:y===null?a.jsxs(a.Fragment,{children:[a.jsx(zs,{value:"weighted_sum",children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.weightedSum")})}),a.jsx(zs,{value:"sigmoid",children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.sigmoid")})}),a.jsx(zs,{value:"inv_sigmoid",children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):a.jsx(zs,{value:"add_difference",children:a.jsx(Rt,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.addDifference")})})})})})]}),a.jsxs($,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.900"}},children:[a.jsxs($,{columnGap:4,children:[a.jsx(ye,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:e("modelManager.mergedModelSaveLocation")}),a.jsx(oh,{value:E,onChange:z=>O(z),children:a.jsxs($,{columnGap:4,children:[a.jsx(zs,{value:"root",children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.invokeAIFolder")})}),a.jsx(zs,{value:"custom",children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.custom")})})]})})]}),E==="custom"&&a.jsx(io,{label:e("modelManager.mergedModelCustomSaveLocation"),value:D,onChange:z=>A(z.target.value)})]}),a.jsx(ur,{label:e("modelManager.ignoreMismatch"),isChecked:R,onChange:z=>T(z.target.checked),fontWeight:"500"}),a.jsx(it,{onClick:V,isLoading:o,isDisabled:h===null||v===null,children:e("modelManager.merge")})]})}const Kue=Pe((e,t)=>{const{t:n}=J(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:i,children:l,title:u,triggerComponent:p}=e,{isOpen:h,onOpen:m,onClose:v}=Er(),x=d.useRef(null),y=()=>{o(),v()},b=()=>{i&&i(),v()};return a.jsxs(a.Fragment,{children:[d.cloneElement(p,{onClick:m,ref:t}),a.jsx(Ad,{isOpen:h,leastDestructiveRef:x,onClose:v,isCentered:!0,children:a.jsx(Vo,{children:a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:u}),a.jsx(Wo,{children:l}),a.jsxs(gs,{children:[a.jsx(it,{ref:x,onClick:b,children:s}),a.jsx(it,{colorScheme:"error",onClick:y,ml:3,children:r})]})]})})})]})}),Vy=d.memo(Kue);function que(e){const{model:t}=e,n=ee(),{t:r}=J(),[o,{isLoading:s}]=uA(),[i,l]=d.useState("InvokeAIRoot"),[u,p]=d.useState("");d.useEffect(()=>{l("InvokeAIRoot")},[t]);const h=()=>{l("InvokeAIRoot")},m=()=>{const v={base_model:t.base_model,model_name:t.model_name,convert_dest_directory:i==="Custom"?u:void 0};if(i==="Custom"&&u===""){n(Tt(Ft({title:r("modelManager.noCustomLocationProvided"),status:"error"})));return}n(Tt(Ft({title:`${r("modelManager.convertingModelBegin")}: ${t.model_name}`,status:"info"}))),o(v).unwrap().then(()=>{n(Tt(Ft({title:`${r("modelManager.modelConverted")}: ${t.model_name}`,status:"success"})))}).catch(()=>{n(Tt(Ft({title:`${r("modelManager.modelConversionFailed")}: ${t.model_name}`,status:"error"})))})};return a.jsxs(Vy,{title:`${r("modelManager.convert")} ${t.model_name}`,acceptCallback:m,cancelCallback:h,acceptButtonText:`${r("modelManager.convert")}`,triggerComponent:a.jsxs(it,{size:"sm","aria-label":r("modelManager.convertToDiffusers"),className:" modal-close-btn",isLoading:s,children:["🧨 ",r("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[a.jsxs($,{flexDirection:"column",rowGap:4,children:[a.jsx(ye,{children:r("modelManager.convertToDiffusersHelpText1")}),a.jsxs(Id,{children:[a.jsx(No,{children:r("modelManager.convertToDiffusersHelpText2")}),a.jsx(No,{children:r("modelManager.convertToDiffusersHelpText3")}),a.jsx(No,{children:r("modelManager.convertToDiffusersHelpText4")}),a.jsx(No,{children:r("modelManager.convertToDiffusersHelpText5")})]}),a.jsx(ye,{children:r("modelManager.convertToDiffusersHelpText6")})]}),a.jsxs($,{flexDir:"column",gap:2,children:[a.jsxs($,{marginTop:4,flexDir:"column",gap:2,children:[a.jsx(ye,{fontWeight:"600",children:r("modelManager.convertToDiffusersSaveLocation")}),a.jsx(oh,{value:i,onChange:v=>l(v),children:a.jsxs($,{gap:4,children:[a.jsx(zs,{value:"InvokeAIRoot",children:a.jsx(Rt,{label:"Save converted model in the InvokeAI root folder",children:r("modelManager.invokeRoot")})}),a.jsx(zs,{value:"Custom",children:a.jsx(Rt,{label:"Save converted model in a custom folder",children:r("modelManager.custom")})})]})})]}),i==="Custom"&&a.jsxs($,{flexDirection:"column",rowGap:2,children:[a.jsx(ye,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:r("modelManager.customSaveLocation")}),a.jsx(io,{value:u,onChange:v=>{p(v.target.value)},width:"full"})]})]})]})}function Xue(e){const t=F(Pn),{model:n}=e,[r,{isLoading:o}]=a5(),{data:s}=n5(),[i,l]=d.useState(!1);d.useEffect(()=>{s!=null&&s.includes(n.config)||l(!0)},[s,n.config]);const u=ee(),{t:p}=J(),h=sl({initialValues:{model_name:n.model_name?n.model_name:"",base_model:n.base_model,model_type:"main",path:n.path?n.path:"",description:n.description?n.description:"",model_format:"checkpoint",vae:n.vae?n.vae:"",config:n.config?n.config:"",variant:n.variant},validate:{path:v=>v.trim().length===0?"Must provide a path":null}}),m=d.useCallback(v=>{const x={base_model:n.base_model,model_name:n.model_name,body:v};r(x).unwrap().then(y=>{h.setValues(y),u(Tt(Ft({title:p("modelManager.modelUpdated"),status:"success"})))}).catch(y=>{h.reset(),u(Tt(Ft({title:p("modelManager.modelUpdateFailed"),status:"error"})))})},[h,u,n.base_model,n.model_name,p,r]);return a.jsxs($,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs($,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs($,{flexDirection:"column",children:[a.jsx(ye,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(ye,{fontSize:"sm",color:"base.400",children:[dn[n.base_model]," Model"]})]}),[""].includes(n.base_model)?a.jsx(ua,{sx:{p:2,borderRadius:4,bg:"error.200",_dark:{bg:"error.400"}},children:"Conversion Not Supported"}):a.jsx(que,{model:n})]}),a.jsx(Br,{}),a.jsx($,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",children:a.jsx("form",{onSubmit:h.onSubmit(v=>m(v)),children:a.jsxs($,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(gn,{label:p("modelManager.name"),...h.getInputProps("model_name")}),a.jsx(gn,{label:p("modelManager.description"),...h.getInputProps("description")}),a.jsx(Kd,{required:!0,...h.getInputProps("base_model")}),a.jsx(Eg,{required:!0,...h.getInputProps("variant")}),a.jsx(gn,{required:!0,label:p("modelManager.modelLocation"),...h.getInputProps("path")}),a.jsx(gn,{label:p("modelManager.vaeLocation"),...h.getInputProps("vae")}),a.jsxs($,{flexDirection:"column",gap:2,children:[i?a.jsx(gn,{required:!0,label:p("modelManager.config"),...h.getInputProps("config")}):a.jsx(LO,{required:!0,...h.getInputProps("config")}),a.jsx(ur,{isChecked:i,onChange:()=>l(!i),label:"Use Custom Config"})]}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:p("modelManager.updateModel")})]})})})]})}function Yue(e){const t=F(Pn),{model:n}=e,[r,{isLoading:o}]=a5(),s=ee(),{t:i}=J(),l=sl({initialValues:{model_name:n.model_name?n.model_name:"",base_model:n.base_model,model_type:"main",path:n.path?n.path:"",description:n.description?n.description:"",model_format:"diffusers",vae:n.vae?n.vae:"",variant:n.variant},validate:{path:p=>p.trim().length===0?"Must provide a path":null}}),u=d.useCallback(p=>{const h={base_model:n.base_model,model_name:n.model_name,body:p};r(h).unwrap().then(m=>{l.setValues(m),s(Tt(Ft({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{l.reset(),s(Tt(Ft({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[l,s,n.base_model,n.model_name,i,r]);return a.jsxs($,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs($,{flexDirection:"column",children:[a.jsx(ye,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(ye,{fontSize:"sm",color:"base.400",children:[dn[n.base_model]," Model"]})]}),a.jsx(Br,{}),a.jsx("form",{onSubmit:l.onSubmit(p=>u(p)),children:a.jsxs($,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(gn,{label:i("modelManager.name"),...l.getInputProps("model_name")}),a.jsx(gn,{label:i("modelManager.description"),...l.getInputProps("description")}),a.jsx(Kd,{required:!0,...l.getInputProps("base_model")}),a.jsx(Eg,{required:!0,...l.getInputProps("variant")}),a.jsx(gn,{required:!0,label:i("modelManager.modelLocation"),...l.getInputProps("path")}),a.jsx(gn,{label:i("modelManager.vaeLocation"),...l.getInputProps("vae")}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})]})}function Que(e){const t=F(Pn),{model:n}=e,[r,{isLoading:o}]=dA(),s=ee(),{t:i}=J(),l=sl({initialValues:{model_name:n.model_name?n.model_name:"",base_model:n.base_model,model_type:"lora",path:n.path?n.path:"",description:n.description?n.description:"",model_format:n.model_format},validate:{path:p=>p.trim().length===0?"Must provide a path":null}}),u=d.useCallback(p=>{const h={base_model:n.base_model,model_name:n.model_name,body:p};r(h).unwrap().then(m=>{l.setValues(m),s(Tt(Ft({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{l.reset(),s(Tt(Ft({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[s,l,n.base_model,n.model_name,i,r]);return a.jsxs($,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs($,{flexDirection:"column",children:[a.jsx(ye,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(ye,{fontSize:"sm",color:"base.400",children:[dn[n.base_model]," Model ⋅"," ",fA[n.model_format]," format"]})]}),a.jsx(Br,{}),a.jsx("form",{onSubmit:l.onSubmit(p=>u(p)),children:a.jsxs($,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(gn,{label:i("modelManager.name"),...l.getInputProps("model_name")}),a.jsx(gn,{label:i("modelManager.description"),...l.getInputProps("description")}),a.jsx(Kd,{...l.getInputProps("base_model")}),a.jsx(gn,{label:i("modelManager.modelLocation"),...l.getInputProps("path")}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})]})}function Zue(e){const t=F(Pn),{t:n}=J(),r=ee(),[o]=pA(),[s]=hA(),{model:i,isSelected:l,setSelectedModelId:u}=e,p=d.useCallback(()=>{u(i.id)},[i.id,u]),h=d.useCallback(()=>{const m={main:o,lora:s,onnx:o}[i.model_type];m(i).unwrap().then(v=>{r(Tt(Ft({title:`${n("modelManager.modelDeleted")}: ${i.model_name}`,status:"success"})))}).catch(v=>{v&&r(Tt(Ft({title:`${n("modelManager.modelDeleteFailed")}: ${i.model_name}`,status:"error"})))}),u(void 0)},[o,s,i,u,r,n]);return a.jsxs($,{sx:{gap:2,alignItems:"center",w:"full"},children:[a.jsx($,{as:it,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:p,children:a.jsxs($,{gap:4,alignItems:"center",children:[a.jsx(ua,{minWidth:14,p:.5,fontSize:"sm",variant:"solid",children:mA[i.base_model]}),a.jsx(Rt,{label:i.description,hasArrow:!0,placement:"bottom",children:a.jsx(ye,{sx:{fontWeight:500},children:i.model_name})})]})}),a.jsx(Vy,{title:n("modelManager.deleteModel"),acceptCallback:h,acceptButtonText:n("modelManager.delete"),triggerComponent:a.jsx(Te,{icon:a.jsx(Uee,{}),"aria-label":n("modelManager.deleteConfig"),isDisabled:t,colorScheme:"error"}),children:a.jsxs($,{rowGap:4,flexDirection:"column",children:[a.jsx("p",{style:{fontWeight:"bold"},children:n("modelManager.deleteMsg1")}),a.jsx("p",{children:n("modelManager.deleteMsg2")})]})})]})}const Jue=e=>{const{selectedModelId:t,setSelectedModelId:n}=e,{t:r}=J(),[o,s]=d.useState(""),[i,l]=d.useState("all"),{filteredDiffusersModels:u,isLoadingDiffusersModels:p}=Bo(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredDiffusersModels:ju(j,"main","diffusers",o),isLoadingDiffusersModels:I})}),{filteredCheckpointModels:h,isLoadingCheckpointModels:m}=Bo(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredCheckpointModels:ju(j,"main","checkpoint",o),isLoadingCheckpointModels:I})}),{filteredLoraModels:v,isLoadingLoraModels:x}=vm(void 0,{selectFromResult:({data:j,isLoading:I})=>({filteredLoraModels:ju(j,"lora",void 0,o),isLoadingLoraModels:I})}),{filteredOnnxModels:y,isLoadingOnnxModels:b}=Xu(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredOnnxModels:ju(j,"onnx","onnx",o),isLoadingOnnxModels:I})}),{filteredOliveModels:w,isLoadingOliveModels:k}=Xu(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredOliveModels:ju(j,"onnx","olive",o),isLoadingOliveModels:I})}),_=d.useCallback(j=>{s(j.target.value)},[]);return a.jsx($,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:a.jsxs($,{flexDirection:"column",gap:4,paddingInlineEnd:4,children:[a.jsxs(mn,{isAttached:!0,children:[a.jsx(it,{onClick:()=>l("all"),isChecked:i==="all",size:"sm",children:r("modelManager.allModels")}),a.jsx(it,{size:"sm",onClick:()=>l("diffusers"),isChecked:i==="diffusers",children:r("modelManager.diffusersModels")}),a.jsx(it,{size:"sm",onClick:()=>l("checkpoint"),isChecked:i==="checkpoint",children:r("modelManager.checkpointModels")}),a.jsx(it,{size:"sm",onClick:()=>l("onnx"),isChecked:i==="onnx",children:r("modelManager.onnxModels")}),a.jsx(it,{size:"sm",onClick:()=>l("olive"),isChecked:i==="olive",children:r("modelManager.oliveModels")}),a.jsx(it,{size:"sm",onClick:()=>l("lora"),isChecked:i==="lora",children:r("modelManager.loraModels")})]}),a.jsx(io,{onChange:_,label:r("modelManager.search"),labelPos:"side"}),a.jsxs($,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-280,overflow:"scroll",children:[p&&a.jsx(Hl,{loadingMessage:"Loading Diffusers..."}),["all","diffusers"].includes(i)&&!p&&u.length>0&&a.jsx(Bl,{title:"Diffusers",modelList:u,selected:{selectedModelId:t,setSelectedModelId:n}},"diffusers"),m&&a.jsx(Hl,{loadingMessage:"Loading Checkpoints..."}),["all","checkpoint"].includes(i)&&!m&&h.length>0&&a.jsx(Bl,{title:"Checkpoints",modelList:h,selected:{selectedModelId:t,setSelectedModelId:n}},"checkpoints"),x&&a.jsx(Hl,{loadingMessage:"Loading LoRAs..."}),["all","lora"].includes(i)&&!x&&v.length>0&&a.jsx(Bl,{title:"LoRAs",modelList:v,selected:{selectedModelId:t,setSelectedModelId:n}},"loras"),k&&a.jsx(Hl,{loadingMessage:"Loading Olives..."}),["all","olive"].includes(i)&&!k&&w.length>0&&a.jsx(Bl,{title:"Olives",modelList:w,selected:{selectedModelId:t,setSelectedModelId:n}},"olive"),b&&a.jsx(Hl,{loadingMessage:"Loading ONNX..."}),["all","onnx"].includes(i)&&!b&&y.length>0&&a.jsx(Bl,{title:"ONNX",modelList:y,selected:{selectedModelId:t,setSelectedModelId:n}},"onnx")]})]})})},ede=d.memo(Jue),ju=(e,t,n,r)=>{const o=[];return Tn(e==null?void 0:e.entities,s=>{if(!s)return;const i=s.model_name.toLowerCase().includes(r.toLowerCase()),l=n===void 0||s.model_format===n,u=s.model_type===t;i&&l&&u&&o.push(s)}),o},Wy=d.memo(e=>a.jsx($,{flexDirection:"column",gap:4,borderRadius:4,p:4,sx:{bg:"base.200",_dark:{bg:"base.800"}},children:e.children}));Wy.displayName="StyledModelContainer";const Bl=d.memo(e=>{const{title:t,modelList:n,selected:r}=e;return a.jsx(Wy,{children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(ye,{variant:"subtext",fontSize:"sm",children:t}),n.map(o=>a.jsx(Zue,{model:o,isSelected:r.selectedModelId===o.id,setSelectedModelId:r.setSelectedModelId},o.id))]})})});Bl.displayName="ModelListWrapper";const Hl=d.memo(({loadingMessage:e})=>a.jsx(Wy,{children:a.jsxs($,{justifyContent:"center",alignItems:"center",flexDirection:"column",p:4,gap:8,children:[a.jsx(Ki,{}),a.jsx(ye,{variant:"subtext",children:e||"Fetching..."})]})}));Hl.displayName="FetchingModelsLoader";function tde(){const[e,t]=d.useState(),{mainModel:n}=Bo(Ci,{selectFromResult:({data:s})=>({mainModel:e?s==null?void 0:s.entities[e]:void 0})}),{loraModel:r}=vm(void 0,{selectFromResult:({data:s})=>({loraModel:e?s==null?void 0:s.entities[e]:void 0})}),o=n||r;return a.jsxs($,{sx:{gap:8,w:"full",h:"full"},children:[a.jsx(ede,{selectedModelId:e,setSelectedModelId:t}),a.jsx(nde,{model:o})]})}const nde=e=>{const{model:t}=e;return(t==null?void 0:t.model_format)==="checkpoint"?a.jsx(Xue,{model:t},t.id):(t==null?void 0:t.model_format)==="diffusers"?a.jsx(Yue,{model:t},t.id):(t==null?void 0:t.model_type)==="lora"?a.jsx(Que,{model:t},t.id):a.jsx($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",maxH:96,userSelect:"none"},children:a.jsx(ye,{variant:"subtext",children:"No Model Selected"})})};function rde(){const{t:e}=J();return a.jsxs($,{sx:{w:"full",p:4,borderRadius:4,gap:4,justifyContent:"space-between",alignItems:"center",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsx(ye,{sx:{fontWeight:600},children:e("modelManager.syncModels")}),a.jsx(ye,{fontSize:"sm",sx:{_dark:{color:"base.400"}},children:e("modelManager.syncModelsDesc")})]}),a.jsx(Wc,{})]})}function ode(){return a.jsx($,{children:a.jsx(rde,{})})}const ej=[{id:"modelManager",label:vt.t("modelManager.modelManager"),content:a.jsx(tde,{})},{id:"importModels",label:vt.t("modelManager.importModels"),content:a.jsx(Wue,{})},{id:"mergeModels",label:vt.t("modelManager.mergeModels"),content:a.jsx(Gue,{})},{id:"settings",label:vt.t("modelManager.settings"),content:a.jsx(ode,{})}],sde=()=>a.jsxs(Qi,{isLazy:!0,variant:"line",layerStyle:"first",sx:{w:"full",h:"full",p:4,gap:4,borderRadius:"base"},children:[a.jsx(Zi,{children:ej.map(e=>a.jsx(Pr,{sx:{borderTopRadius:"base"},children:e.label},e.id))}),a.jsx(zc,{sx:{w:"full",h:"full"},children:ej.map(e=>a.jsx(fo,{sx:{w:"full",h:"full"},children:e.content},e.id))})]}),ade=d.memo(sde),ide={enum:"",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,IPAdapterField:void 0,IPAdapterModelField: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:"",UNetField:void 0,VaeField:void 0,VaeModelField:void 0},lde=(e,t)=>{const n={id:e,name:t.name,type:t.type,label:"",fieldKind:"input"};return n.value=t.default??ide[t.type],n},cde=ie([e=>e.nodes],e=>e.nodeTemplates),Kv={dragHandle:`.${Yi}`},ude=()=>{const e=F(cde),t=qx();return d.useCallback(n=>{var x;const r=Fa();let o=window.innerWidth/2,s=window.innerHeight/2;const i=(x=document.querySelector("#workflow-editor"))==null?void 0:x.getBoundingClientRect();i&&(o=i.width/2-c1/2,s=i.height/2-c1/2);const{x:l,y:u}=t.project({x:o,y:s});if(n==="current_image")return{...Kv,id:r,type:"current_image",position:{x:l,y:u},data:{id:r,type:"current_image",isOpen:!0,label:"Current Image"}};if(n==="notes")return{...Kv,id:r,type:"notes",position:{x:l,y:u},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 h=pw(p.inputs,(y,b,w)=>{const k=Fa(),_=lde(k,b);return y[w]=_,y},{}),m=pw(p.outputs,(y,b,w)=>{const _={id:Fa(),name:w,type:b.type,fieldKind:"output"};return y[w]=_,y},{});return{...Kv,id:r,type:"invocation",position:{x:l,y:u},data:{id:r,type:n,version:p.version,label:"",notes:"",isOpen:!0,embedWorkflow:!1,isIntermediate:!0,inputs:h,outputs:m}}},[e,t])},HO=d.forwardRef(({label:e,description:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs("div",{children:[a.jsx(ye,{fontWeight:600,children:e}),a.jsx(ye,{size:"xs",sx:{color:"base.600",_dark:{color:"base.500"}},children:t})]})}));HO.displayName="AddNodePopoverSelectItem";const dde=(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))},fde=()=>{const e=ee(),t=ude(),n=Ji(),{t:r}=J(),o=ie([be],({nodes:y})=>{const b=rr(y.nodeTemplates,w=>({label:w.title,value:w.type,description:w.description,tags:w.tags}));return b.push({label:r("nodes.currentImage"),value:"current_image",description:r("nodes.currentImageDescription"),tags:["progress"]}),b.push({label:r("nodes.notes"),value:"notes",description:r("nodes.notesDescription"),tags:["notes"]}),b.sort((w,k)=>w.label.localeCompare(k.label)),{data:b,t:r}},we),{data:s}=F(o),i=F(y=>y.nodes.isAddNodePopoverOpen),l=d.useRef(null),u=d.useCallback(y=>{const b=t(y);if(!b){const w=r("nodes.unknownInvocation",{nodeType:y});n({status:"error",title:w});return}e(gA(b))},[e,t,n,r]),p=d.useCallback(y=>{y&&u(y)},[u]),h=d.useCallback(()=>{e(vA())},[e]),m=d.useCallback(()=>{e(i5())},[e]),v=d.useCallback(y=>{y.preventDefault(),m(),setTimeout(()=>{var b;(b=l.current)==null||b.focus()},0)},[m]),x=d.useCallback(()=>{h()},[h]);return Qe(["shift+a","space"],v),Qe(["escape"],x),a.jsxs($m,{initialFocusRef:l,isOpen:i,onClose:h,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(uP,{children:a.jsx($,{sx:{position:"absolute",top:"15%",insetInlineStart:"50%",pointerEvents:"none"}})}),a.jsx(Lm,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Ab,{sx:{p:0},children:a.jsx(Kt,{inputRef:l,selectOnBlur:!1,placeholder:r("nodes.nodeSearch"),value:null,data:s,maxDropdownHeight:400,nothingFound:r("nodes.noMatchingNodes"),itemComponent:HO,filter:dde,onChange:p,hoverOnSearchChange:!0,onDropdownClose:h,sx:{width:"32rem",input:{padding:"0.5rem"}}})})})]})},pde=d.memo(fde);var hde="\0",gi="\0",tj="",wr,Si,Tr,fd,dc,fc,ro,as,Na,is,Ta,Fs,Bs,pc,hc,Hs,Eo,pd,kx,bj;let mde=(bj=class{constructor(t){en(this,pd);en(this,wr,!0);en(this,Si,!1);en(this,Tr,!1);en(this,fd,void 0);en(this,dc,()=>{});en(this,fc,()=>{});en(this,ro,{});en(this,as,{});en(this,Na,{});en(this,is,{});en(this,Ta,{});en(this,Fs,{});en(this,Bs,{});en(this,pc,0);en(this,hc,0);en(this,Hs,void 0);en(this,Eo,void 0);t&&(eo(this,wr,t.hasOwnProperty("directed")?t.directed:!0),eo(this,Si,t.hasOwnProperty("multigraph")?t.multigraph:!1),eo(this,Tr,t.hasOwnProperty("compound")?t.compound:!1)),Se(this,Tr)&&(eo(this,Hs,{}),eo(this,Eo,{}),Se(this,Eo)[gi]={})}isDirected(){return Se(this,wr)}isMultigraph(){return Se(this,Si)}isCompound(){return Se(this,Tr)}setGraph(t){return eo(this,fd,t),this}graph(){return Se(this,fd)}setDefaultNodeLabel(t){return eo(this,dc,t),typeof t!="function"&&eo(this,dc,()=>t),this}nodeCount(){return Se(this,pc)}nodes(){return Object.keys(Se(this,ro))}sources(){var t=this;return this.nodes().filter(n=>Object.keys(Se(t,as)[n]).length===0)}sinks(){var t=this;return this.nodes().filter(n=>Object.keys(Se(t,is)[n]).length===0)}setNodes(t,n){var r=arguments,o=this;return t.forEach(function(s){r.length>1?o.setNode(s,n):o.setNode(s)}),this}setNode(t,n){return Se(this,ro).hasOwnProperty(t)?(arguments.length>1&&(Se(this,ro)[t]=n),this):(Se(this,ro)[t]=arguments.length>1?n:Se(this,dc).call(this,t),Se(this,Tr)&&(Se(this,Hs)[t]=gi,Se(this,Eo)[t]={},Se(this,Eo)[gi][t]=!0),Se(this,as)[t]={},Se(this,Na)[t]={},Se(this,is)[t]={},Se(this,Ta)[t]={},++vu(this,pc)._,this)}node(t){return Se(this,ro)[t]}hasNode(t){return Se(this,ro).hasOwnProperty(t)}removeNode(t){var n=this;if(Se(this,ro).hasOwnProperty(t)){var r=o=>n.removeEdge(Se(n,Fs)[o]);delete Se(this,ro)[t],Se(this,Tr)&&(os(this,pd,kx).call(this,t),delete Se(this,Hs)[t],this.children(t).forEach(function(o){n.setParent(o)}),delete Se(this,Eo)[t]),Object.keys(Se(this,as)[t]).forEach(r),delete Se(this,as)[t],delete Se(this,Na)[t],Object.keys(Se(this,is)[t]).forEach(r),delete Se(this,is)[t],delete Se(this,Ta)[t],--vu(this,pc)._}return this}setParent(t,n){if(!Se(this,Tr))throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=gi;else{n+="";for(var r=n;r!==void 0;r=this.parent(r))if(r===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),os(this,pd,kx).call(this,t),Se(this,Hs)[t]=n,Se(this,Eo)[n][t]=!0,this}parent(t){if(Se(this,Tr)){var n=Se(this,Hs)[t];if(n!==gi)return n}}children(t=gi){if(Se(this,Tr)){var n=Se(this,Eo)[t];if(n)return Object.keys(n)}else{if(t===gi)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=Se(this,Na)[t];if(n)return Object.keys(n)}successors(t){var n=Se(this,Ta)[t];if(n)return Object.keys(n)}neighbors(t){var n=this.predecessors(t);if(n){const o=new Set(n);for(var r of this.successors(t))o.add(r);return Array.from(o.values())}}isLeaf(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){var n=new this.constructor({directed:Se(this,wr),multigraph:Se(this,Si),compound:Se(this,Tr)});n.setGraph(this.graph());var r=this;Object.entries(Se(this,ro)).forEach(function([i,l]){t(i)&&n.setNode(i,l)}),Object.values(Se(this,Fs)).forEach(function(i){n.hasNode(i.v)&&n.hasNode(i.w)&&n.setEdge(i,r.edge(i))});var o={};function s(i){var l=r.parent(i);return l===void 0||n.hasNode(l)?(o[i]=l,l):l in o?o[l]:s(l)}return Se(this,Tr)&&n.nodes().forEach(i=>n.setParent(i,s(i))),n}setDefaultEdgeLabel(t){return eo(this,fc,t),typeof t!="function"&&eo(this,fc,()=>t),this}edgeCount(){return Se(this,hc)}edges(){return Object.values(Se(this,Fs))}setPath(t,n){var r=this,o=arguments;return t.reduce(function(s,i){return o.length>1?r.setEdge(s,i,n):r.setEdge(s,i),i}),this}setEdge(){var t,n,r,o,s=!1,i=arguments[0];typeof i=="object"&&i!==null&&"v"in i?(t=i.v,n=i.w,r=i.name,arguments.length===2&&(o=arguments[1],s=!0)):(t=i,n=arguments[1],r=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),t=""+t,n=""+n,r!==void 0&&(r=""+r);var l=Nu(Se(this,wr),t,n,r);if(Se(this,Bs).hasOwnProperty(l))return s&&(Se(this,Bs)[l]=o),this;if(r!==void 0&&!Se(this,Si))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),Se(this,Bs)[l]=s?o:Se(this,fc).call(this,t,n,r);var u=gde(Se(this,wr),t,n,r);return t=u.v,n=u.w,Object.freeze(u),Se(this,Fs)[l]=u,nj(Se(this,Na)[n],t),nj(Se(this,Ta)[t],n),Se(this,as)[n][l]=u,Se(this,is)[t][l]=u,vu(this,hc)._++,this}edge(t,n,r){var o=arguments.length===1?qv(Se(this,wr),arguments[0]):Nu(Se(this,wr),t,n,r);return Se(this,Bs)[o]}edgeAsObj(){const t=this.edge(...arguments);return typeof t!="object"?{label:t}:t}hasEdge(t,n,r){var o=arguments.length===1?qv(Se(this,wr),arguments[0]):Nu(Se(this,wr),t,n,r);return Se(this,Bs).hasOwnProperty(o)}removeEdge(t,n,r){var o=arguments.length===1?qv(Se(this,wr),arguments[0]):Nu(Se(this,wr),t,n,r),s=Se(this,Fs)[o];return s&&(t=s.v,n=s.w,delete Se(this,Bs)[o],delete Se(this,Fs)[o],rj(Se(this,Na)[n],t),rj(Se(this,Ta)[t],n),delete Se(this,as)[n][o],delete Se(this,is)[t][o],vu(this,hc)._--),this}inEdges(t,n){var r=Se(this,as)[t];if(r){var o=Object.values(r);return n?o.filter(s=>s.v===n):o}}outEdges(t,n){var r=Se(this,is)[t];if(r){var o=Object.values(r);return n?o.filter(s=>s.w===n):o}}nodeEdges(t,n){var r=this.inEdges(t,n);if(r)return r.concat(this.outEdges(t,n))}},wr=new WeakMap,Si=new WeakMap,Tr=new WeakMap,fd=new WeakMap,dc=new WeakMap,fc=new WeakMap,ro=new WeakMap,as=new WeakMap,Na=new WeakMap,is=new WeakMap,Ta=new WeakMap,Fs=new WeakMap,Bs=new WeakMap,pc=new WeakMap,hc=new WeakMap,Hs=new WeakMap,Eo=new WeakMap,pd=new WeakSet,kx=function(t){delete Se(this,Eo)[Se(this,Hs)[t]][t]},bj);function nj(e,t){e[t]?e[t]++:e[t]=1}function rj(e,t){--e[t]||delete e[t]}function Nu(e,t,n,r){var o=""+t,s=""+n;if(!e&&o>s){var i=o;o=s,s=i}return o+tj+s+tj+(r===void 0?hde:r)}function gde(e,t,n,r){var o=""+t,s=""+n;if(!e&&o>s){var i=o;o=s,s=i}var l={v:o,w:s};return r&&(l.name=r),l}function qv(e,t){return Nu(e,t.v,t.w,t.name)}var Uy=mde,vde="2.1.13",xde={Graph:Uy,version:vde},bde=Uy,yde={write:Cde,read:kde};function Cde(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:wde(e),edges:Sde(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function wde(e){return e.nodes().map(function(t){var n=e.node(t),r=e.parent(t),o={v:t};return n!==void 0&&(o.value=n),r!==void 0&&(o.parent=r),o})}function Sde(e){return e.edges().map(function(t){var n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function kde(e){var t=new bde(e.options).setGraph(e.value);return e.nodes.forEach(function(n){t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(function(n){t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var _de=jde;function jde(e){var t={},n=[],r;function o(s){t.hasOwnProperty(s)||(t[s]=!0,r.push(s),e.successors(s).forEach(o),e.predecessors(s).forEach(o))}return e.nodes().forEach(function(s){r=[],o(s),r.length&&n.push(r)}),n}var Zn,Vs,hd,_x,md,jx,mc,Fp,yj;let Pde=(yj=class{constructor(){en(this,hd);en(this,md);en(this,mc);en(this,Zn,[]);en(this,Vs,{})}size(){return Se(this,Zn).length}keys(){return Se(this,Zn).map(function(t){return t.key})}has(t){return Se(this,Vs).hasOwnProperty(t)}priority(t){var n=Se(this,Vs)[t];if(n!==void 0)return Se(this,Zn)[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return Se(this,Zn)[0].key}add(t,n){var r=Se(this,Vs);if(t=String(t),!r.hasOwnProperty(t)){var o=Se(this,Zn),s=o.length;return r[t]=s,o.push({key:t,priority:n}),os(this,md,jx).call(this,s),!0}return!1}removeMin(){os(this,mc,Fp).call(this,0,Se(this,Zn).length-1);var t=Se(this,Zn).pop();return delete Se(this,Vs)[t.key],os(this,hd,_x).call(this,0),t.key}decrease(t,n){var r=Se(this,Vs)[t];if(n>Se(this,Zn)[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+Se(this,Zn)[r].priority+" New: "+n);Se(this,Zn)[r].priority=n,os(this,md,jx).call(this,r)}},Zn=new WeakMap,Vs=new WeakMap,hd=new WeakSet,_x=function(t){var n=Se(this,Zn),r=2*t,o=r+1,s=t;r<n.length&&(s=n[r].priority<n[s].priority?r:s,o<n.length&&(s=n[o].priority<n[s].priority?o:s),s!==t&&(os(this,mc,Fp).call(this,t,s),os(this,hd,_x).call(this,s)))},md=new WeakSet,jx=function(t){for(var n=Se(this,Zn),r=n[t].priority,o;t!==0&&(o=t>>1,!(n[o].priority<r));)os(this,mc,Fp).call(this,t,o),t=o},mc=new WeakSet,Fp=function(t,n){var r=Se(this,Zn),o=Se(this,Vs),s=r[t],i=r[n];r[t]=i,r[n]=s,o[i.key]=t,o[s.key]=n},yj);var VO=Pde,Ide=VO,WO=Mde,Ede=()=>1;function Mde(e,t,n,r){return Ode(e,String(t),n||Ede,r||function(o){return e.outEdges(o)})}function Ode(e,t,n,r){var o={},s=new Ide,i,l,u=function(p){var h=p.v!==i?p.v:p.w,m=o[h],v=n(p),x=l.distance+v;if(v<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+v);x<m.distance&&(m.distance=x,m.predecessor=i,s.decrease(h,x))};for(e.nodes().forEach(function(p){var h=p===t?0:Number.POSITIVE_INFINITY;o[p]={distance:h},s.add(p,h)});s.size()>0&&(i=s.removeMin(),l=o[i],l.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(u);return o}var Dde=WO,Rde=Ade;function Ade(e,t,n){return e.nodes().reduce(function(r,o){return r[o]=Dde(e,o,t,n),r},{})}var UO=Nde;function Nde(e){var t=0,n=[],r={},o=[];function s(i){var l=r[i]={onStack:!0,lowlink:t,index:t++};if(n.push(i),e.successors(i).forEach(function(h){r.hasOwnProperty(h)?r[h].onStack&&(l.lowlink=Math.min(l.lowlink,r[h].index)):(s(h),l.lowlink=Math.min(l.lowlink,r[h].lowlink))}),l.lowlink===l.index){var u=[],p;do p=n.pop(),r[p].onStack=!1,u.push(p);while(i!==p);o.push(u)}}return e.nodes().forEach(function(i){r.hasOwnProperty(i)||s(i)}),o}var Tde=UO,$de=Lde;function Lde(e){return Tde(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var zde=Bde,Fde=()=>1;function Bde(e,t,n){return Hde(e,t||Fde,n||function(r){return e.outEdges(r)})}function Hde(e,t,n){var r={},o=e.nodes();return o.forEach(function(s){r[s]={},r[s][s]={distance:0},o.forEach(function(i){s!==i&&(r[s][i]={distance:Number.POSITIVE_INFINITY})}),n(s).forEach(function(i){var l=i.v===s?i.w:i.v,u=t(i);r[s][l]={distance:u,predecessor:s}})}),o.forEach(function(s){var i=r[s];o.forEach(function(l){var u=r[l];o.forEach(function(p){var h=u[s],m=i[p],v=u[p],x=h.distance+m.distance;x<v.distance&&(v.distance=x,v.predecessor=m.predecessor)})})}),r}function GO(e){var t={},n={},r=[];function o(s){if(n.hasOwnProperty(s))throw new Px;t.hasOwnProperty(s)||(n[s]=!0,t[s]=!0,e.predecessors(s).forEach(o),delete n[s],r.push(s))}if(e.sinks().forEach(o),Object.keys(t).length!==e.nodeCount())throw new Px;return r}class Px extends Error{constructor(){super(...arguments)}}var KO=GO;GO.CycleException=Px;var oj=KO,Vde=Wde;function Wde(e){try{oj(e)}catch(t){if(t instanceof oj.CycleException)return!1;throw t}return!0}var qO=Ude;function Ude(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?l=>e.successors(l):l=>e.neighbors(l),o=n==="post"?Gde:Kde,s=[],i={};return t.forEach(l=>{if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);o(l,r,i,s)}),s}function Gde(e,t,n,r){for(var o=[[e,!1]];o.length>0;){var s=o.pop();s[1]?r.push(s[0]):n.hasOwnProperty(s[0])||(n[s[0]]=!0,o.push([s[0],!0]),XO(t(s[0]),i=>o.push([i,!1])))}}function Kde(e,t,n,r){for(var o=[e];o.length>0;){var s=o.pop();n.hasOwnProperty(s)||(n[s]=!0,r.push(s),XO(t(s),i=>o.push(i)))}}function XO(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var qde=qO,Xde=Yde;function Yde(e,t){return qde(e,t,"post")}var Qde=qO,Zde=Jde;function Jde(e,t){return Qde(e,t,"pre")}var efe=Uy,tfe=VO,nfe=rfe;function rfe(e,t){var n=new efe,r={},o=new tfe,s;function i(u){var p=u.v===s?u.w:u.v,h=o.priority(p);if(h!==void 0){var m=t(u);m<h&&(r[p]=s,o.decrease(p,m))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(u){o.add(u,Number.POSITIVE_INFINITY),n.setNode(u)}),o.decrease(e.nodes()[0],0);for(var l=!1;o.size()>0;){if(s=o.removeMin(),r.hasOwnProperty(s))n.setEdge(s,r[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(i)}return n}var ofe={components:_de,dijkstra:WO,dijkstraAll:Rde,findCycles:$de,floydWarshall:zde,isAcyclic:Vde,postorder:Xde,preorder:Zde,prim:nfe,tarjan:UO,topsort:KO},sj=xde,sfe={Graph:sj.Graph,json:yde,alg:ofe,version:sj.version};const aj=Dc(sfe),afe=()=>{const e=qx(),t=F(r=>r.nodes.shouldValidateGraph);return d.useCallback(({source:r,sourceHandle:o,target:s,targetHandle:i})=>{var x,y;if(!t)return!0;const l=e.getEdges(),u=e.getNodes();if(!(r&&o&&s&&i))return!1;const p=e.getNode(r),h=e.getNode(s);if(!(p&&h&&p.data&&h.data))return!1;const m=(x=p.data.outputs[o])==null?void 0:x.type,v=(y=h.data.inputs[i])==null?void 0:y.type;if(!m||!v||l.filter(b=>b.target===s&&b.targetHandle===i).find(b=>{b.source===r&&b.sourceHandle})||l.find(b=>b.target===s&&b.targetHandle===i)&&v!=="CollectionItem")return!1;if(m!==v){const b=m==="CollectionItem"&&!Us.includes(v),w=v==="CollectionItem"&&!Us.includes(m)&&!Gs.includes(m),k=Gs.includes(v)&&(()=>{if(!Gs.includes(v))return!1;const M=l5[v],E=c5[M];return m===M||m===E})(),_=m==="Collection"&&(Us.includes(v)||Gs.includes(v)),j=v==="Collection"&&Us.includes(m);return b||w||k||_||j||m==="integer"&&v==="float"}return YO(r,s,u,l)},[e,t])},YO=(e,t,n,r)=>{const o=new aj.Graph;return n.forEach(s=>{o.setNode(s.id)}),r.forEach(s=>{o.setEdge(s.source,s.target)}),o.setEdge(e,t),aj.alg.isAcyclic(o)},ud=e=>`var(--invokeai-colors-${e.split(".").join("-")})`,ife=ie(be,({nodes:e})=>{const{shouldAnimateEdges:t,currentConnectionFieldType:n,shouldColorEdges:r}=e,o=ud(n&&r?yd[n].color:"base.500");let s="react-flow__custom_connection-path";return t&&(s=s.concat(" animated")),{stroke:o,className:s}}),lfe=({fromX:e,fromY:t,fromPosition:n,toX:r,toY:o,toPosition:s})=>{const{stroke:i,className:l}=F(ife),u={sourceX:e,sourceY:t,sourcePosition:n,targetX:r,targetY:o,targetPosition:s},[p]=Xx(u);return a.jsx("g",{children:a.jsx("path",{fill:"none",stroke:i,strokeWidth:2,className:l,d:p,style:{opacity:.8}})})},cfe=d.memo(lfe),QO=(e,t,n,r,o)=>ie(be,({nodes:s})=>{var v,x;const i=s.nodes.find(y=>y.id===e),l=s.nodes.find(y=>y.id===n),u=Cn(i)&&Cn(l),p=(i==null?void 0:i.selected)||(l==null?void 0:l.selected)||o,h=u?(x=(v=i==null?void 0:i.data)==null?void 0:v.outputs[t||""])==null?void 0:x.type:void 0,m=h&&s.shouldColorEdges?ud(yd[h].color):ud("base.500");return{isSelected:p,shouldAnimate:s.shouldAnimateEdges&&p,stroke:m}},we),ufe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,data:l,selected:u,source:p,target:h,sourceHandleId:m,targetHandleId:v})=>{const x=d.useMemo(()=>QO(p,m,h,v,u),[u,p,m,h,v]),{isSelected:y,shouldAnimate:b}=F(x),[w,k,_]=Xx({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s}),{base500:j}=Bd();return a.jsxs(a.Fragment,{children:[a.jsx(u5,{path:w,markerEnd:i,style:{strokeWidth:y?3:2,stroke:j,opacity:y?.8:.5,animation:b?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:b?5:"none"}}),(l==null?void 0:l.count)&&l.count>1&&a.jsx(xA,{children:a.jsx($,{sx:{position:"absolute",transform:`translate(-50%, -50%) translate(${k}px,${_}px)`},className:"nodrag nopan",children:a.jsx(ua,{variant:"solid",sx:{bg:"base.500",opacity:y?.8:.5,boxShadow:"base"},children:l.count})})})]})},dfe=d.memo(ufe),ffe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,selected:l,source:u,target:p,sourceHandleId:h,targetHandleId:m})=>{const v=d.useMemo(()=>QO(u,h,p,m,l),[u,h,p,m,l]),{isSelected:x,shouldAnimate:y,stroke:b}=F(v),[w]=Xx({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s});return a.jsx(u5,{path:w,markerEnd:i,style:{strokeWidth:x?3:2,stroke:b,opacity:x?.8:.5,animation:y?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:y?5:"none"}})},pfe=d.memo(ffe),hfe=e=>{const{nodeId:t,width:n,children:r,selected:o}=e,{isMouseOverNode:s,handleMouseOut:i,handleMouseOver:l}=sO(t),u=d.useMemo(()=>ie(be,({nodes:_})=>{var j;return((j=_.nodeExecutionStates[t])==null?void 0:j.status)===Ks.IN_PROGRESS}),[t]),p=F(u),[h,m,v,x]=ds("shadows",["nodeInProgress.light","nodeInProgress.dark","shadows.xl","shadows.base"]),y=ee(),b=Ti(h,m),w=F(_=>_.nodes.nodeOpacity),k=d.useCallback(_=>{!_.ctrlKey&&!_.altKey&&!_.metaKey&&!_.shiftKey&&y(bA(t)),y(d5())},[y,t]);return a.jsxs(Ie,{onClick:k,onMouseEnter:l,onMouseLeave:i,className:Yi,sx:{h:"full",position:"relative",borderRadius:"base",w:n??c1,transitionProperty:"common",transitionDuration:"0.1s",cursor:"grab",opacity:w},children:[a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",pointerEvents:"none",shadow:`${v}, ${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:"normal",opacity:.7,shadow:p?b:void 0,zIndex:-1}}),r,a.jsx(oO,{isSelected:o,isHovered:s})]})},Mg=d.memo(hfe),mfe=ie(be,({system:e,gallery:t})=>({imageDTO:t.selection[t.selection.length-1],progressImage:e.progressImage})),gfe=e=>{const{progressImage:t,imageDTO:n}=yA(mfe);return t?a.jsx(Xv,{nodeProps:e,children:a.jsx(Xi,{src:t.dataURL,sx:{w:"full",h:"full",objectFit:"contain",borderRadius:"base"}})}):n?a.jsx(Xv,{nodeProps:e,children:a.jsx(Ya,{imageDTO:n,isDragDisabled:!0,useThumbailFallback:!0})}):a.jsx(Xv,{nodeProps:e,children:a.jsx(tr,{})})},vfe=d.memo(gfe),Xv=e=>{const[t,n]=d.useState(!1),r=()=>{n(!0)},o=()=>{n(!1)};return a.jsx(Mg,{nodeId:e.nodeProps.id,selected:e.nodeProps.selected,width:384,children:a.jsxs($,{onMouseEnter:r,onMouseLeave:o,className:Yi,sx:{position:"relative",flexDirection:"column"},children:[a.jsx($,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",alignItems:"center",justifyContent:"center",h:8},children:a.jsx(ye,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",_dark:{color:"base.200"}},children:"Current Image"})}),a.jsxs($,{layerStyle:"nodeBody",sx:{w:"full",h:"full",borderBottomRadius:"base",p:2},children:[e.children,t&&a.jsx(vn.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(AO,{})},"nextPrevButtons")]})]})})},xfe=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.embedWorkflow:!1},we),[e]);return F(t)},ZO=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?Ro(o.data.outputs,s=>CA.includes(s.type)):!1},we),[e]);return F(t)},bfe=({nodeId:e})=>{const t=ee(),n=ZO(e),r=xfe(e),o=d.useCallback(s=>{t(wA({nodeId:e,embedWorkflow:s.target.checked}))},[t,e]);return n?a.jsxs(fn,{as:$,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(Gn,{sx:{fontSize:"xs",mb:"1px"},children:"Embed Workflow"}),a.jsx(Cm,{className:"nopan",size:"sm",onChange:o,isChecked:r})]}):null},yfe=d.memo(bfe),Cfe=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.isIntermediate:!1},we),[e]);return F(t)},wfe=({nodeId:e})=>{const t=ee(),n=ZO(e),r=Cfe(e),o=d.useCallback(s=>{t(SA({nodeId:e,isIntermediate:!s.target.checked}))},[t,e]);return n?a.jsxs(fn,{as:$,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(Gn,{sx:{fontSize:"xs",mb:"1px"},children:"Save to Gallery"}),a.jsx(Cm,{className:"nopan",size:"sm",onChange:o,isChecked:!r})]}):null},Sfe=d.memo(wfe),kfe=({nodeId:e})=>a.jsxs($,{className:Yi,layerStyle:"nodeFooter",sx:{w:"full",borderBottomRadius:"base",px:2,py:0,h:6,justifyContent:"space-between"},children:[a.jsx(yfe,{nodeId:e}),a.jsx(Sfe,{nodeId:e})]}),_fe=d.memo(kfe),jfe=({nodeId:e,isOpen:t})=>{const n=ee(),r=kA(),o=d.useCallback(()=>{n(_A({nodeId:e,isOpen:!t})),r(e)},[n,t,e,r]);return a.jsx(Te,{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"}})})},Gy=d.memo(jfe),JO=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.label:!1},we),[e]);return F(t)},e8=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return!1;const s=o?r.nodeTemplates[o.data.type]:void 0;return s==null?void 0:s.title},we),[e]);return F(t)},Pfe=({nodeId:e,title:t})=>{const n=ee(),r=JO(e),o=e8(e),{t:s}=J(),[i,l]=d.useState(""),u=d.useCallback(async h=>{n(jA({nodeId:e,label:h})),l(r||t||o||s("nodes.problemSettingTitle"))},[n,e,t,o,r,s]),p=d.useCallback(h=>{l(h)},[]);return d.useEffect(()=>{l(r||t||o||s("nodes.problemSettingTitle"))},[r,o,t,s]),a.jsx($,{sx:{overflow:"hidden",w:"full",h:"full",alignItems:"center",justifyContent:"center",cursor:"text"},children:a.jsxs(km,{as:$,value:i,onChange:p,onSubmit:u,sx:{alignItems:"center",position:"relative",w:"full",h:"full"},children:[a.jsx(Sm,{fontSize:"sm",sx:{p:0,w:"full"},noOfLines:1}),a.jsx(wm,{className:"nodrag",fontSize:"sm",sx:{p:0,fontWeight:700,_focusVisible:{p:0,boxShadow:"none"}}}),a.jsx(Ife,{})]})})},t8=d.memo(Pfe);function Ife(){const{isEditing:e,getEditButtonProps:t}=V5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&o(r)},[t]);return e?null:a.jsx(Ie,{className:Yi,onDoubleClick:n,sx:{position:"absolute",w:"full",h:"full",top:0,cursor:"grab"}})}const Ky=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return o==null?void 0:o.data},we),[e]);return F(t)},Efe=({nodeId:e})=>{const t=Ky(e),{base400:n,base600:r}=Bd(),o=Ti(n,r),s=d.useMemo(()=>({borderWidth:0,borderRadius:"3px",width:"1rem",height:"1rem",backgroundColor:o,zIndex:-1}),[o]);return Kp(t)?a.jsxs(a.Fragment,{children:[a.jsx(Mu,{type:"target",id:`${t.id}-collapsed-target`,isConnectable:!1,position:Vl.Left,style:{...s,left:"-0.5rem"}}),rr(t.inputs,i=>a.jsx(Mu,{type:"target",id:i.name,isConnectable:!1,position:Vl.Left,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-input-handle`)),a.jsx(Mu,{type:"source",id:`${t.id}-collapsed-source`,isConnectable:!1,position:Vl.Right,style:{...s,right:"-0.5rem"}}),rr(t.outputs,i=>a.jsx(Mu,{type:"source",id:i.name,isConnectable:!1,position:Vl.Right,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-output-handle`))]}):null},Mfe=d.memo(Efe),Ofe=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);return r.nodeTemplates[(o==null?void 0:o.data.type)??""]},we),[e]);return F(t)},Dfe=({nodeId:e})=>{const t=ee(),n=Ky(e),{t:r}=J(),o=d.useCallback(s=>{t(PA({nodeId:e,notes:s.target.value}))},[t,e]);return Kp(n)?a.jsxs(fn,{children:[a.jsx(Gn,{children:r("nodes.notes")}),a.jsx(oa,{value:n==null?void 0:n.notes,onChange:o,rows:10})]}):null},Rfe=d.memo(Dfe),Afe=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{var i;const o=r.nodes.find(l=>l.id===e);if(!Cn(o))return!1;const s=r.nodeTemplates[(o==null?void 0:o.data.type)??""];return!(s!=null&&s.version)||!((i=o.data)!=null&&i.version)?!1:Pj(s.version,o.data.version)===0},we),[e]);return F(t)},Nfe=({nodeId:e})=>{const{isOpen:t,onOpen:n,onClose:r}=Er(),o=JO(e),s=e8(e),i=Afe(e),{t:l}=J();return a.jsxs(a.Fragment,{children:[a.jsx(Rt,{label:a.jsx(n8,{nodeId:e}),placement:"top",shouldWrapChildren:!0,children:a.jsx($,{className:"nodrag",onClick:n,sx:{alignItems:"center",justifyContent:"center",w:8,h:8,cursor:"pointer"},children:a.jsx(An,{as:OE,sx:{boxSize:4,w:8,color:i?"base.400":"error.400"}})})}),a.jsxs(Fi,{isOpen:t,onClose:r,isCentered:!0,children:[a.jsx(Vo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{children:o||s||l("nodes.unknownNode")}),a.jsx(Td,{}),a.jsx(Wo,{children:a.jsx(Rfe,{nodeId:e})}),a.jsx(gs,{})]})]})]})},Tfe=d.memo(Nfe),n8=d.memo(({nodeId:e})=>{const t=Ky(e),n=Ofe(e),{t:r}=J(),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(()=>!Kp(t)||!n?null:t.version?n.version?_w(t.version,n.version,"<")?a.jsxs(ye,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateNode"),")"]}):_w(t.version,n.version,">")?a.jsxs(ye,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateApp"),")"]}):a.jsxs(ye,{as:"span",children:[r("nodes.version")," ",t.version]}):a.jsxs(ye,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.unknownTemplate"),")"]}):a.jsx(ye,{as:"span",sx:{color:"error.500"},children:r("nodes.versionUnknown")}),[t,n,r]);return Kp(t)?a.jsxs($,{sx:{flexDir:"column"},children:[a.jsx(ye,{as:"span",sx:{fontWeight:600},children:o}),a.jsx(ye,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:n==null?void 0:n.description}),s,(t==null?void 0:t.notes)&&a.jsx(ye,{children:t.notes})]}):a.jsx(ye,{sx:{fontWeight:600},children:r("nodes.unknownNode")})});n8.displayName="TooltipContent";const Yv=3,ij={circle:{transitionProperty:"none",transitionDuration:"0s"},".chakra-progress__track":{stroke:"transparent"}},$fe=({nodeId:e})=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>r.nodeExecutionStates[e]),[e]),n=F(t);return n?a.jsx(Rt,{label:a.jsx(r8,{nodeExecutionState:n}),placement:"top",children:a.jsx($,{className:Yi,sx:{w:5,h:"full",alignItems:"center",justifyContent:"flex-end"},children:a.jsx(o8,{nodeExecutionState:n})})}):null},Lfe=d.memo($fe),r8=d.memo(({nodeExecutionState:e})=>{const{status:t,progress:n,progressImage:r}=e,{t:o}=J();return t===Ks.PENDING?a.jsx(ye,{children:"Pending"}):t===Ks.IN_PROGRESS?r?a.jsxs($,{sx:{pos:"relative",pt:1.5,pb:.5},children:[a.jsx(Xi,{src:r.dataURL,sx:{w:32,h:32,borderRadius:"base",objectFit:"contain"}}),n!==null&&a.jsxs(ua,{variant:"solid",sx:{pos:"absolute",top:2.5,insetInlineEnd:1},children:[Math.round(n*100),"%"]})]}):n!==null?a.jsxs(ye,{children:[o("nodes.executionStateInProgress")," (",Math.round(n*100),"%)"]}):a.jsx(ye,{children:o("nodes.executionStateInProgress")}):t===Ks.COMPLETED?a.jsx(ye,{children:o("nodes.executionStateCompleted")}):t===Ks.FAILED?a.jsx(ye,{children:o("nodes.executionStateError")}):null});r8.displayName="TooltipLabel";const o8=d.memo(e=>{const{progress:t,status:n}=e.nodeExecutionState;return n===Ks.PENDING?a.jsx(An,{as:vZ,sx:{boxSize:Yv,color:"base.600",_dark:{color:"base.300"}}}):n===Ks.IN_PROGRESS?t===null?a.jsx(R1,{isIndeterminate:!0,size:"14px",color:"base.500",thickness:14,sx:ij}):a.jsx(R1,{value:Math.round(t*100),size:"14px",color:"base.500",thickness:14,sx:ij}):n===Ks.COMPLETED?a.jsx(An,{as:jE,sx:{boxSize:Yv,color:"ok.600",_dark:{color:"ok.300"}}}):n===Ks.FAILED?a.jsx(An,{as:yZ,sx:{boxSize:Yv,color:"error.600",_dark:{color:"error.300"}}}):null});o8.displayName="StatusIcon";const zfe=({nodeId:e,isOpen:t})=>a.jsxs($,{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(Gy,{nodeId:e,isOpen:t}),a.jsx(t8,{nodeId:e}),a.jsxs($,{alignItems:"center",children:[a.jsx(Lfe,{nodeId:e}),a.jsx(Tfe,{nodeId:e})]}),!t&&a.jsx(Mfe,{nodeId:e})]}),Ffe=d.memo(zfe),Bfe=(e,t,n,r)=>ie(be,o=>{if(!r)return vt.t("nodes.noFieldType");const{currentConnectionFieldType:s,connectionStartParams:i,nodes:l,edges:u}=o.nodes;if(!i||!s)return vt.t("nodes.noConnectionInProgress");const{handleType:p,nodeId:h,handleId:m}=i;if(!p||!h||!m)return vt.t("nodes.noConnectionData");const v=n==="target"?r:s,x=n==="source"?r:s;if(e===h)return vt.t("nodes.cannotConnectToSelf");if(n===p)return n==="source"?vt.t("nodes.cannotConnectOutputToOutput"):vt.t("nodes.cannotConnectInputToInput");if(u.find(b=>b.target===e&&b.targetHandle===t)&&v!=="CollectionItem")return vt.t("nodes.inputMayOnlyHaveOneConnection");if(x!==v){const b=x==="CollectionItem"&&!Us.includes(v),w=v==="CollectionItem"&&!Us.includes(x)&&!Gs.includes(x),k=Gs.includes(v)&&(()=>{if(!Gs.includes(v))return!1;const M=l5[v],E=c5[M];return x===M||x===E})(),_=x==="Collection"&&(Us.includes(v)||Gs.includes(v)),j=v==="Collection"&&Us.includes(x);if(!(b||w||k||_||j||x==="integer"&&v==="float"))return vt.t("nodes.fieldTypesMustMatch")}return YO(p==="source"?h:e,p==="source"?e:h,l,u)?null:vt.t("nodes.connectionWouldCreateCycle")}),Hfe=(e,t,n)=>{const r=d.useMemo(()=>ie(be,({nodes:s})=>{var l;const i=s.nodes.find(u=>u.id===e);if(Cn(i))return(l=i==null?void 0:i.data[Wx[n]][t])==null?void 0:l.type},we),[t,n,e]);return F(r)},Vfe=ie(be,({nodes:e})=>e.currentConnectionFieldType!==null&&e.connectionStartParams!==null),s8=({nodeId:e,fieldName:t,kind:n})=>{const r=Hfe(e,t,n),o=d.useMemo(()=>ie(be,({nodes:v})=>!!v.edges.filter(x=>(n==="input"?x.target:x.source)===e&&(n==="input"?x.targetHandle:x.sourceHandle)===t).length),[t,n,e]),s=d.useMemo(()=>Bfe(e,t,n==="input"?"target":"source",r),[e,t,n,r]),i=d.useMemo(()=>ie(be,({nodes:v})=>{var x,y,b;return((x=v.connectionStartParams)==null?void 0:x.nodeId)===e&&((y=v.connectionStartParams)==null?void 0:y.handleId)===t&&((b=v.connectionStartParams)==null?void 0:b.handleType)==={input:"target",output:"source"}[n]}),[t,n,e]),l=F(o),u=F(Vfe),p=F(i),h=F(s),m=d.useMemo(()=>!!(u&&h&&!p),[h,u,p]);return{isConnected:l,isConnectionInProgress:u,isConnectionStartField:p,connectionError:h,shouldDim:m}},Wfe=e=>{const{fieldTemplate:t,handleType:n,isConnectionInProgress:r,isConnectionStartField:o,connectionError:s}=e,{name:i,type:l}=t,{color:u,title:p}=yd[l],h=d.useMemo(()=>{const v=Us.includes(l),x=Gs.includes(l),y=IA.includes(l),b=ud(u),w={backgroundColor:v||x?"var(--invokeai-colors-base-900)":b,position:"absolute",width:"1rem",height:"1rem",borderWidth:v||x?4:0,borderStyle:"solid",borderColor:b,borderRadius:y?4:"100%",zIndex:1};return n==="target"?w.insetInlineStart="-1rem":w.insetInlineEnd="-1rem",r&&!o&&s&&(w.filter="opacity(0.4) grayscale(0.7)"),r&&s?o?w.cursor="grab":w.cursor="not-allowed":w.cursor="crosshair",w},[s,n,r,o,l,u]),m=d.useMemo(()=>r&&o?p:r&&s?s??p:p,[s,r,o,p]);return a.jsx(Rt,{label:m,placement:n==="target"?"start":"end",hasArrow:!0,openDelay:gm,children:a.jsx(Mu,{type:n,id:i,position:n==="target"?Vl.Left:Vl.Right,style:h})})},a8=d.memo(Wfe),Ufe=({nodeId:e,fieldName:t})=>{const n=wg(e,t,"output"),{isConnected:r,isConnectionInProgress:o,isConnectionStartField:s,connectionError:i,shouldDim:l}=s8({nodeId:e,fieldName:t,kind:"output"});return(n==null?void 0:n.fieldKind)!=="output"?a.jsx(Ix,{shouldDim:l,children:a.jsxs(fn,{sx:{color:"error.400",textAlign:"right",fontSize:"sm"},children:["Unknown output: ",t]})}):a.jsxs(Ix,{shouldDim:l,children:[a.jsx(Rt,{label:a.jsx(Ny,{nodeId:e,fieldName:t,kind:"output"}),openDelay:gm,placement:"top",shouldWrapChildren:!0,hasArrow:!0,children:a.jsx(fn,{isDisabled:r,pe:2,children:a.jsx(Gn,{sx:{mb:0,fontWeight:500},children:n==null?void 0:n.title})})}),a.jsx(a8,{fieldTemplate:n,handleType:"source",isConnectionInProgress:o,isConnectionStartField:s,connectionError:i})]})},Gfe=d.memo(Ufe),Ix=d.memo(({shouldDim:e,children:t})=>a.jsx($,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",justifyContent:"flex-end"},children:t}));Ix.displayName="OutputFieldWrapper";const Kfe=(e,t)=>{const n=d.useMemo(()=>ie(be,({nodes:o})=>{var i;const s=o.nodes.find(l=>l.id===e);if(Cn(s))return((i=s==null?void 0:s.data.inputs[t])==null?void 0:i.value)!==void 0},we),[t,e]);return F(n)},qfe=(e,t)=>{const n=d.useMemo(()=>ie(be,({nodes:o})=>{const s=o.nodes.find(u=>u.id===e);if(!Cn(s))return;const i=o.nodeTemplates[(s==null?void 0:s.data.type)??""],l=i==null?void 0:i.inputs[t];return l==null?void 0:l.input},we),[t,e]);return F(n)},Xfe=({nodeId:e,fieldName:t,kind:n,children:r})=>{const o=ee(),s=aO(e,t),i=iO(e,t,n),l=qfe(e,t),{t:u}=J(),p=d.useCallback(w=>{w.preventDefault()},[]),h=d.useMemo(()=>ie(be,({nodes:w})=>({isExposed:!!w.workflow.exposedFields.find(_=>_.nodeId===e&&_.fieldName===t)}),we),[t,e]),m=d.useMemo(()=>["any","direct"].includes(l??"__UNKNOWN_INPUT__"),[l]),{isExposed:v}=F(h),x=d.useCallback(()=>{o(EA({nodeId:e,fieldName:t}))},[o,t,e]),y=d.useCallback(()=>{o(Yj({nodeId:e,fieldName:t}))},[o,t,e]),b=d.useMemo(()=>{const w=[];return m&&!v&&w.push(a.jsx(Vt,{icon:a.jsx(nl,{}),onClick:x,children:"Add to Linear View"},`${e}.${t}.expose-field`)),m&&v&&w.push(a.jsx(Vt,{icon:a.jsx(RZ,{}),onClick:y,children:"Remove from Linear View"},`${e}.${t}.unexpose-field`)),w},[t,x,y,v,m,e]);return a.jsx(Cy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>b.length?a.jsx(Ga,{sx:{visibility:"visible !important"},motionProps:gc,onContextMenu:p,children:a.jsx(wc,{title:s||i||u("nodes.unknownField"),children:b})}):null,children:r})},Yfe=d.memo(Xfe),Qfe=({nodeId:e,fieldName:t})=>{const n=wg(e,t,"input"),r=Kfe(e,t),{isConnected:o,isConnectionInProgress:s,isConnectionStartField:i,connectionError:l,shouldDim:u}=s8({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(Ex,{shouldDim:u,children:a.jsxs(fn,{sx:{color:"error.400",textAlign:"left",fontSize:"sm"},children:["Unknown input: ",t]})}):a.jsxs(Ex,{shouldDim:u,children:[a.jsxs(fn,{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(Yfe,{nodeId:e,fieldName:t,kind:"input",children:h=>a.jsx(Gn,{sx:{display:"flex",alignItems:"center",h:"full",mb:0,px:1,gap:2},children:a.jsx(cO,{ref:h,nodeId:e,fieldName:t,kind:"input",isMissingInput:p,withTooltip:!0})})}),a.jsx(Ie,{children:a.jsx(bO,{nodeId:e,fieldName:t})})]}),n.input!=="direct"&&a.jsx(a8,{fieldTemplate:n,handleType:"target",isConnectionInProgress:s,isConnectionStartField:i,connectionError:l})]})},lj=d.memo(Qfe),Ex=d.memo(({shouldDim:e,children:t})=>a.jsx($,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",w:"full",h:"full"},children:t}));Ex.displayName="InputFieldWrapper";const Zfe=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return[];const s=r.nodeTemplates[o.data.type];return s?rr(s.outputs).filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},we),[e]);return F(t)},Jfe=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?Ro(o.data.outputs,s=>MA.includes(s.type)):!1},we),[e]);return F(t)},epe=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return[];const s=r.nodeTemplates[o.data.type];return s?rr(s.inputs).filter(i=>i.input==="connection").filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},we),[e]);return F(t)},tpe=e=>{const t=d.useMemo(()=>ie(be,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return[];const s=r.nodeTemplates[o.data.type];return s?rr(s.inputs).filter(i=>["any","direct"].includes(i.input)).filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},we),[e]);return F(t)},npe=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>{const s=epe(e),i=tpe(e),l=Zfe(e),u=Jfe(e);return a.jsxs(Mg,{nodeId:e,selected:o,children:[a.jsx(Ffe,{nodeId:e,isOpen:t,label:n,selected:o,type:r}),t&&a.jsxs(a.Fragment,{children:[a.jsx($,{layerStyle:"nodeBody",sx:{flexDirection:"column",w:"full",h:"full",py:2,gap:1,borderBottomRadius:u?0:"base"},children:a.jsxs($,{sx:{flexDir:"column",px:2,w:"full",h:"full"},children:[a.jsxs(Ua,{gridTemplateColumns:"1fr auto",gridAutoRows:"1fr",children:[s.map((p,h)=>a.jsx(ed,{gridColumnStart:1,gridRowStart:h+1,children:a.jsx(lj,{nodeId:e,fieldName:p})},`${e}.${p}.input-field`)),l.map((p,h)=>a.jsx(ed,{gridColumnStart:2,gridRowStart:h+1,children:a.jsx(Gfe,{nodeId:e,fieldName:p})},`${e}.${p}.output-field`))]}),i.map(p=>a.jsx(lj,{nodeId:e,fieldName:p},`${e}.${p}.input-field`))]})}),u&&a.jsx(_fe,{nodeId:e})]})]})},rpe=d.memo(npe),ope=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>a.jsxs(Mg,{nodeId:e,selected:o,children:[a.jsxs($,{className:Yi,layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",h:8,fontWeight:600,fontSize:"sm"},children:[a.jsx(Gy,{nodeId:e,isOpen:t}),a.jsx(ye,{sx:{w:"full",textAlign:"center",pe:8,color:"error.500",_dark:{color:"error.300"}},children:n?`${n} (${r})`:r})]}),t&&a.jsx($,{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(ye,{as:"span",children:"Unknown node type: "}),a.jsx(ye,{as:"span",fontWeight:600,children:r})]})})]}),spe=d.memo(ope),ape=e=>{const{data:t,selected:n}=e,{id:r,type:o,isOpen:s,label:i}=t,l=d.useMemo(()=>ie(be,({nodes:p})=>!!p.nodeTemplates[o]),[o]);return F(l)?a.jsx(rpe,{nodeId:r,isOpen:s,label:i,type:o,selected:n}):a.jsx(spe,{nodeId:r,isOpen:s,label:i,type:o,selected:n})},ipe=d.memo(ape),lpe=e=>{const{id:t,data:n,selected:r}=e,{notes:o,isOpen:s}=n,i=ee(),l=d.useCallback(u=>{i(OA({nodeId:t,value:u.target.value}))},[i,t]);return a.jsxs(Mg,{nodeId:t,selected:r,children:[a.jsxs($,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:s?0:"base",alignItems:"center",justifyContent:"space-between",h:8},children:[a.jsx(Gy,{nodeId:t,isOpen:s}),a.jsx(t8,{nodeId:t,title:"Notes"}),a.jsx(Ie,{minW:8})]}),s&&a.jsx(a.Fragment,{children:a.jsx($,{layerStyle:"nodeBody",className:"nopan",sx:{cursor:"auto",flexDirection:"column",borderBottomRadius:"base",w:"full",h:"full",p:2,gap:1},children:a.jsx($,{className:"nopan",sx:{flexDir:"column",w:"full",h:"full"},children:a.jsx(oa,{value:o,onChange:l,rows:8,resize:"none",sx:{fontSize:"xs"}})})})})]})},cpe=d.memo(lpe),upe=["Delete","Backspace"],dpe={collapsed:dfe,default:pfe},fpe={invocation:ipe,current_image:vfe,notes:cpe},ppe={hideAttribution:!0},hpe=ie(be,({nodes:e})=>{const{shouldSnapToGrid:t,selectionMode:n}=e;return{shouldSnapToGrid:t,selectionMode:n}},we),mpe=()=>{const e=ee(),t=F(j=>j.nodes.nodes),n=F(j=>j.nodes.edges),r=F(j=>j.nodes.viewport),{shouldSnapToGrid:o,selectionMode:s}=F(hpe),i=afe(),[l]=ds("radii",["base"]),u=d.useCallback(j=>{e(DA(j))},[e]),p=d.useCallback(j=>{e(RA(j))},[e]),h=d.useCallback((j,I)=>{e(AA(I))},[e]),m=d.useCallback(j=>{e(NA(j))},[e]),v=d.useCallback(()=>{e(TA())},[e]),x=d.useCallback(j=>{e($A(j))},[e]),y=d.useCallback(j=>{e(LA(j))},[e]),b=d.useCallback(({nodes:j,edges:I})=>{e(zA(j?j.map(M=>M.id):[])),e(FA(I?I.map(M=>M.id):[]))},[e]),w=d.useCallback((j,I)=>{e(BA(I))},[e]),k=d.useCallback(()=>{e(d5())},[e]),_=d.useCallback(j=>{HA.set(j),j.fitView()},[]);return Qe(["Ctrl+c","Meta+c"],j=>{j.preventDefault(),e(VA())}),Qe(["Ctrl+a","Meta+a"],j=>{j.preventDefault(),e(WA())}),Qe(["Ctrl+v","Meta+v"],j=>{j.preventDefault(),e(UA())}),a.jsx(GA,{id:"workflow-editor",defaultViewport:r,nodeTypes:fpe,edgeTypes:dpe,nodes:t,edges:n,onInit:_,onNodesChange:u,onEdgesChange:p,onEdgesDelete:x,onNodesDelete:y,onConnectStart:h,onConnect:m,onConnectEnd:v,onMoveEnd:w,connectionLineComponent:cfe,onSelectionChange:b,isValidConnection:i,minZoom:.1,snapToGrid:o,snapGrid:[25,25],connectionRadius:30,proOptions:ppe,style:{borderRadius:l},onPaneClick:k,deleteKeyCode:upe,selectionMode:s,children:a.jsx(ZN,{})})},gpe=()=>{const e=ee(),{t}=J(),n=d.useCallback(()=>{e(i5())},[e]);return a.jsx($,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:2},children:a.jsx(Te,{tooltip:t("nodes.addNodeToolTip"),"aria-label":t("nodes.addNode"),icon:a.jsx(nl,{}),onClick:n})})},vpe=d.memo(gpe),xpe=()=>{const e=ee(),t=AP("nodes"),{t:n}=J();return d.useCallback(o=>{if(!o)return;const s=new FileReader;s.onload=async()=>{const i=s.result;try{const l=JSON.parse(String(i)),u=KA.safeParse(l);if(!u.success){const{message:p}=qA(u.error,{prefix:n("nodes.workflowValidation")});t.error({error:XA(u.error)},p),e(Tt(Ft({title:n("nodes.unableToValidateWorkflow"),status:"error",duration:5e3}))),s.abort();return}e(Hx(u.data)),s.abort()}catch{e(Tt(Ft({title:n("nodes.unableToLoadWorkflow"),status:"error"})))}},s.readAsText(o)},[e,t,n])},bpe=d.memo(e=>e.error.issues[0]?a.jsx(ye,{children:hw(e.error.issues[0],{prefix:null}).toString()}):a.jsx(Id,{children:e.error.issues.map((t,n)=>a.jsx(No,{children:a.jsx(ye,{children:hw(t,{prefix:null}).toString()})},n))}));bpe.displayName="WorkflowValidationErrorContent";const ype=()=>{const{t:e}=J(),t=d.useRef(null),n=xpe();return a.jsx(tE,{resetRef:t,accept:"application/json",onChange:n,children:r=>a.jsx(Te,{icon:a.jsx(ng,{}),tooltip:e("nodes.loadWorkflow"),"aria-label":e("nodes.loadWorkflow"),...r})})},Cpe=d.memo(ype),wpe=()=>{const{t:e}=J(),t=ee(),{isOpen:n,onOpen:r,onClose:o}=Er(),s=d.useRef(null),i=F(u=>u.nodes.nodes.length),l=d.useCallback(()=>{t(YA()),t(Tt(Ft({title:e("toast.nodesCleared"),status:"success"}))),o()},[t,e,o]);return a.jsxs(a.Fragment,{children:[a.jsx(Te,{icon:a.jsx(Wr,{}),tooltip:e("nodes.resetWorkflow"),"aria-label":e("nodes.resetWorkflow"),onClick:r,isDisabled:!i,colorScheme:"error"}),a.jsxs(Ad,{isOpen:n,onClose:o,leastDestructiveRef:s,isCentered:!0,children:[a.jsx(Vo,{}),a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:e("nodes.resetWorkflow")}),a.jsx(Wo,{py:4,children:a.jsxs($,{flexDir:"column",gap:2,children:[a.jsx(ye,{children:e("nodes.resetWorkflowDesc")}),a.jsx(ye,{variant:"subtext",children:e("nodes.resetWorkflowDesc2")})]})}),a.jsxs(gs,{children:[a.jsx(vc,{ref:s,onClick:o,children:e("common.cancel")}),a.jsx(vc,{colorScheme:"error",ml:3,onClick:l,children:e("common.accept")})]})]})]})]})},Spe=d.memo(wpe),kpe=()=>{const{t:e}=J(),t=rO(),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(Te,{icon:a.jsx(Jm,{}),tooltip:e("nodes.downloadWorkflow"),"aria-label":e("nodes.downloadWorkflow"),onClick:n})},_pe=d.memo(kpe),jpe=()=>a.jsxs($,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:"50%",transform:"translate(-50%)"},children:[a.jsx(_pe,{}),a.jsx(Cpe,{}),a.jsx(Spe,{})]}),Ppe=d.memo(jpe),Ipe=()=>a.jsx($,{sx:{gap:2,flexDir:"column"},children:rr(yd,({title:e,description:t,color:n},r)=>a.jsx(Rt,{label:t,children:a.jsx(ua,{sx:{userSelect:"none",color:parseInt(n.split(".")[1]??"0",10)<500?"base.800":"base.50",bg:n},textAlign:"center",children:e})},r))}),Epe=d.memo(Ipe),Mpe=()=>{const{t:e}=J(),t=ee(),n=d.useCallback(()=>{t(QA())},[t]);return a.jsx(it,{leftIcon:a.jsx(BZ,{}),tooltip:e("nodes.reloadNodeTemplates"),"aria-label":e("nodes.reloadNodeTemplates"),onClick:n,children:e("nodes.reloadNodeTemplates")})},Ope=d.memo(Mpe),Pu={fontWeight:600},Dpe=ie(be,({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===ZA.Full}},we),Rpe=Pe((e,t)=>{const{isOpen:n,onOpen:r,onClose:o}=Er(),s=ee(),{shouldAnimateEdges:i,shouldValidateGraph:l,shouldSnapToGrid:u,shouldColorEdges:p,selectionModeIsChecked:h}=F(Dpe),m=d.useCallback(k=>{s(JA(k.target.checked))},[s]),v=d.useCallback(k=>{s(e9(k.target.checked))},[s]),x=d.useCallback(k=>{s(t9(k.target.checked))},[s]),y=d.useCallback(k=>{s(n9(k.target.checked))},[s]),b=d.useCallback(k=>{s(r9(k.target.checked))},[s]),{t:w}=J();return a.jsxs(a.Fragment,{children:[a.jsx(Te,{ref:t,"aria-label":w("nodes.workflowSettings"),tooltip:w("nodes.workflowSettings"),icon:a.jsx(IE,{}),onClick:r}),a.jsxs(Fi,{isOpen:n,onClose:o,size:"2xl",isCentered:!0,children:[a.jsx(Vo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{children:w("nodes.workflowSettings")}),a.jsx(Td,{}),a.jsx(Wo,{children:a.jsxs($,{sx:{flexDirection:"column",gap:4,py:4},children:[a.jsx(so,{size:"sm",children:"General"}),a.jsx(Gt,{formLabelProps:Pu,onChange:v,isChecked:i,label:w("nodes.animatedEdges"),helperText:w("nodes.animatedEdgesHelp")}),a.jsx(Br,{}),a.jsx(Gt,{formLabelProps:Pu,isChecked:u,onChange:x,label:w("nodes.snapToGrid"),helperText:w("nodes.snapToGridHelp")}),a.jsx(Br,{}),a.jsx(Gt,{formLabelProps:Pu,isChecked:p,onChange:y,label:w("nodes.colorCodeEdges"),helperText:w("nodes.colorCodeEdgesHelp")}),a.jsx(Gt,{formLabelProps:Pu,isChecked:h,onChange:b,label:w("nodes.fullyContainNodes"),helperText:w("nodes.fullyContainNodesHelp")}),a.jsx(so,{size:"sm",pt:4,children:"Advanced"}),a.jsx(Gt,{formLabelProps:Pu,isChecked:l,onChange:m,label:w("nodes.validateConnections"),helperText:w("nodes.validateConnectionsHelp")}),a.jsx(Ope,{})]})})]})]})]})}),Ape=d.memo(Rpe),Npe=()=>{const e=F(t=>t.nodes.shouldShowFieldTypeLegend);return a.jsxs($,{sx:{gap:2,position:"absolute",top:2,insetInlineEnd:2},children:[a.jsx(Ape,{}),e&&a.jsx(Epe,{})]})},Tpe=d.memo(Npe);function $pe(){const e=ee(),t=F(o=>o.nodes.nodeOpacity),{t:n}=J(),r=d.useCallback(o=>{e(o9(o))},[e]);return a.jsx($,{alignItems:"center",children:a.jsxs(Nb,{"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($b,{children:a.jsx(Lb,{})}),a.jsx(Tb,{})]})})}function Lpe(e){return Ne({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 zpe(e){return Ne({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 Fpe(e){return Ne({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)}const Bpe=()=>{const{t:e}=J(),{zoomIn:t,zoomOut:n,fitView:r}=qx(),o=ee(),s=F(h=>h.nodes.shouldShowMinimapPanel),i=d.useCallback(()=>{t()},[t]),l=d.useCallback(()=>{n()},[n]),u=d.useCallback(()=>{r()},[r]),p=d.useCallback(()=>{o(s9(!s))},[s,o]);return a.jsxs(mn,{isAttached:!0,orientation:"vertical",children:[a.jsx(Te,{tooltip:e("nodes.zoomInNodes"),"aria-label":e("nodes.zoomInNodes"),onClick:i,icon:a.jsx(Fpe,{})}),a.jsx(Te,{tooltip:e("nodes.zoomOutNodes"),"aria-label":e("nodes.zoomOutNodes"),onClick:l,icon:a.jsx(zpe,{})}),a.jsx(Te,{tooltip:e("nodes.fitViewportNodes"),"aria-label":e("nodes.fitViewportNodes"),onClick:u,icon:a.jsx(wZ,{})}),a.jsx(Te,{tooltip:e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),"aria-label":e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),isChecked:s,onClick:p,icon:a.jsx(DZ,{})})]})},Hpe=d.memo(Bpe),Vpe=()=>a.jsxs($,{sx:{gap:2,position:"absolute",bottom:2,insetInlineStart:2},children:[a.jsx(Hpe,{}),a.jsx($pe,{})]}),Wpe=d.memo(Vpe),Upe=_e(GN),Gpe=()=>{const e=F(r=>r.nodes.shouldShowMinimapPanel),t=Ti("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-600)"),n=Ti("var(--invokeai-colors-blackAlpha-300)","var(--invokeai-colors-blackAlpha-600)");return a.jsx($,{sx:{gap:2,position:"absolute",bottom:2,insetInlineEnd:2},children:e&&a.jsx(Upe,{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})})},Kpe=d.memo(Gpe),qpe=()=>{const e=F(n=>n.nodes.isReady),{t}=J();return a.jsxs($,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center"},children:[a.jsx(nr,{children:e&&a.jsxs(vn.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(mpe,{}),a.jsx(pde,{}),a.jsx(vpe,{}),a.jsx(Ppe,{}),a.jsx(Tpe,{}),a.jsx(Wpe,{}),a.jsx(Kpe,{})]})}),a.jsx(nr,{children:!e&&a.jsx(vn.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($,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:a.jsx(tr,{label:t("nodes.loadingNodes"),icon:xg})})})})]})},Xpe=d.memo(qpe),Ype=()=>a.jsx(a9,{children:a.jsx(Xpe,{})}),Qpe=d.memo(Ype),Zpe=()=>a.jsx(NO,{}),Jpe=d.memo(Zpe);var Mx={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=mw;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=mw;e.exports=r.Konva})(Mx,Mx.exports);var ehe=Mx.exports;const dd=Dc(ehe);var i8={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 the=function(t){var n={},r=d,o=Ip,s=Object.assign;function i(c){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+c,g=1;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),y=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),M=Symbol.iterator;function E(c){return c===null||typeof c!="object"?null:(c=M&&c[M]||c["@@iterator"],typeof c=="function"?c:null)}function O(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case h:return"Fragment";case p:return"Portal";case v:return"Profiler";case m:return"StrictMode";case w:return"Suspense";case k:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case y:return(c.displayName||"Context")+".Consumer";case x:return(c._context.displayName||"Context")+".Provider";case b:var f=c.render;return c=c.displayName,c||(c=f.displayName||f.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case _:return f=c.displayName||null,f!==null?f:O(c.type)||"Memo";case j:f=c._payload,c=c._init;try{return O(c(f))}catch{}}return null}function D(c){var f=c.type;switch(c.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 c=f.render,c=c.displayName||c.name||"",f.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return O(f);case 8:return f===m?"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(c){var f=c,g=c;if(c.alternate)for(;f.return;)f=f.return;else{c=f;do f=c,f.flags&4098&&(g=f.return),c=f.return;while(c)}return f.tag===3?g:null}function R(c){if(A(c)!==c)throw Error(i(188))}function T(c){var f=c.alternate;if(!f){if(f=A(c),f===null)throw Error(i(188));return f!==c?null:c}for(var g=c,C=f;;){var S=g.return;if(S===null)break;var P=S.alternate;if(P===null){if(C=S.return,C!==null){g=C;continue}break}if(S.child===P.child){for(P=S.child;P;){if(P===g)return R(S),c;if(P===C)return R(S),f;P=P.sibling}throw Error(i(188))}if(g.return!==C.return)g=S,C=P;else{for(var N=!1,Z=S.child;Z;){if(Z===g){N=!0,g=S,C=P;break}if(Z===C){N=!0,C=S,g=P;break}Z=Z.sibling}if(!N){for(Z=P.child;Z;){if(Z===g){N=!0,g=P,C=S;break}if(Z===C){N=!0,C=P,g=S;break}Z=Z.sibling}if(!N)throw Error(i(189))}}if(g.alternate!==C)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?c:f}function X(c){return c=T(c),c!==null?B(c):null}function B(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var f=B(c);if(f!==null)return f;c=c.sibling}return null}function U(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){if(c.tag!==4){var f=U(c);if(f!==null)return f}c=c.sibling}return null}var Y=Array.isArray,V=t.getPublicInstance,L=t.getRootHostContext,q=t.getChildHostContext,z=t.prepareForCommit,K=t.resetAfterCommit,re=t.createInstance,Q=t.appendInitialChild,le=t.finalizeInitialChildren,se=t.prepareUpdate,W=t.shouldSetTextContent,G=t.createTextInstance,te=t.scheduleTimeout,ae=t.cancelTimeout,oe=t.noTimeout,pe=t.isPrimaryRenderer,fe=t.supportsMutation,ge=t.supportsPersistence,Ce=t.supportsHydration,me=t.getInstanceFromNode,de=t.preparePortalMount,De=t.getCurrentEventPriority,je=t.detachDeletedInstance,Be=t.supportsMicrotasks,rt=t.scheduleMicrotask,Ue=t.supportsTestSelectors,wt=t.findFiberRoot,Xe=t.getBoundingRect,tt=t.getTextContent,xe=t.isHiddenSubtree,Re=t.matchAccessibilityRole,st=t.setFocusIfFocusable,mt=t.setupIntersectionObserver,ve=t.appendChild,Ye=t.appendChildToContainer,ot=t.commitTextUpdate,lt=t.commitMount,Me=t.commitUpdate,$e=t.insertBefore,At=t.insertInContainerBefore,ke=t.removeChild,ze=t.removeChildFromContainer,Le=t.resetTextContent,We=t.hideInstance,ct=t.hideTextInstance,xn=t.unhideInstance,jt=t.unhideTextInstance,Pt=t.clearContainer,sr=t.cloneInstance,In=t.createContainerChildSet,pn=t.appendChildToContainerChildSet,on=t.finalizeContainerChildren,Qt=t.replaceContainerChildren,mr=t.cloneHiddenInstance,yo=t.cloneHiddenTextInstance,ar=t.canHydrateInstance,ir=t.canHydrateTextInstance,Is=t.canHydrateSuspenseInstance,Es=t.isSuspenseInstancePending,pa=t.isSuspenseInstanceFallback,ha=t.getSuspenseInstanceFallbackErrorDetails,il=t.registerSuspenseInstanceRetry,ma=t.getNextHydratableSibling,ll=t.getFirstHydratableChild,qe=t.getFirstHydratableChildWithinContainer,Nt=t.getFirstHydratableChildWithinSuspenseInstance,En=t.hydrateInstance,xt=t.hydrateTextInstance,ga=t.hydrateSuspenseInstance,Rr=t.getNextHydratableInstanceAfterSuspenseInstance,qd=t.commitHydratedContainer,Dg=t.commitHydratedSuspenseInstance,Rg=t.clearSuspenseBoundary,Mn=t.clearSuspenseBoundaryFromContainer,Ms=t.shouldDeleteUnhydratedTailInstances,Xd=t.didNotMatchHydratedContainerTextInstance,cl=t.didNotMatchHydratedTextInstance,Yc;function ai(c){if(Yc===void 0)try{throw Error()}catch(g){var f=g.stack.trim().match(/\n( *(at )?)/);Yc=f&&f[1]||""}return`
|
||
`+Yc+c}var Qc=!1;function Zc(c,f){if(!c||Qc)return"";Qc=!0;var g=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 C=Ee}Reflect.construct(c,[],f)}else{try{f.call()}catch(Ee){C=Ee}c.call(f.prototype)}else{try{throw Error()}catch(Ee){C=Ee}c()}}catch(Ee){if(Ee&&C&&typeof Ee.stack=="string"){for(var S=Ee.stack.split(`
|
||
`),P=C.stack.split(`
|
||
`),N=S.length-1,Z=P.length-1;1<=N&&0<=Z&&S[N]!==P[Z];)Z--;for(;1<=N&&0<=Z;N--,Z--)if(S[N]!==P[Z]){if(N!==1||Z!==1)do if(N--,Z--,0>Z||S[N]!==P[Z]){var ue=`
|
||
`+S[N].replace(" at new "," at ");return c.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",c.displayName)),ue}while(1<=N&&0<=Z);break}}}finally{Qc=!1,Error.prepareStackTrace=g}return(c=c?c.displayName||c.name:"")?ai(c):""}var Ag=Object.prototype.hasOwnProperty,va=[],Je=-1;function St(c){return{current:c}}function bt(c){0>Je||(c.current=va[Je],va[Je]=null,Je--)}function kt(c,f){Je++,va[Je]=c.current,c.current=f}var Kn={},Wt=St(Kn),kn=St(!1),lr=Kn;function ul(c,f){var g=c.type.contextTypes;if(!g)return Kn;var C=c.stateNode;if(C&&C.__reactInternalMemoizedUnmaskedChildContext===f)return C.__reactInternalMemoizedMaskedChildContext;var S={},P;for(P in g)S[P]=f[P];return C&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=S),S}function gr(c){return c=c.childContextTypes,c!=null}function Yd(){bt(kn),bt(Wt)}function Qy(c,f,g){if(Wt.current!==Kn)throw Error(i(168));kt(Wt,f),kt(kn,g)}function Zy(c,f,g){var C=c.stateNode;if(f=f.childContextTypes,typeof C.getChildContext!="function")return g;C=C.getChildContext();for(var S in C)if(!(S in f))throw Error(i(108,D(c)||"Unknown",S));return s({},g,C)}function Qd(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Kn,lr=Wt.current,kt(Wt,c),kt(kn,kn.current),!0}function Jy(c,f,g){var C=c.stateNode;if(!C)throw Error(i(169));g?(c=Zy(c,f,lr),C.__reactInternalMemoizedMergedChildContext=c,bt(kn),bt(Wt),kt(Wt,c)):bt(kn),kt(kn,g)}var Co=Math.clz32?Math.clz32:C8,b8=Math.log,y8=Math.LN2;function C8(c){return c>>>=0,c===0?32:31-(b8(c)/y8|0)|0}var Zd=64,Jd=4194304;function Jc(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function ef(c,f){var g=c.pendingLanes;if(g===0)return 0;var C=0,S=c.suspendedLanes,P=c.pingedLanes,N=g&268435455;if(N!==0){var Z=N&~S;Z!==0?C=Jc(Z):(P&=N,P!==0&&(C=Jc(P)))}else N=g&~S,N!==0?C=Jc(N):P!==0&&(C=Jc(P));if(C===0)return 0;if(f!==0&&f!==C&&!(f&S)&&(S=C&-C,P=f&-f,S>=P||S===16&&(P&4194240)!==0))return f;if(C&4&&(C|=g&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=C;0<f;)g=31-Co(f),S=1<<g,C|=c[g],f&=~S;return C}function w8(c,f){switch(c){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 S8(c,f){for(var g=c.suspendedLanes,C=c.pingedLanes,S=c.expirationTimes,P=c.pendingLanes;0<P;){var N=31-Co(P),Z=1<<N,ue=S[N];ue===-1?(!(Z&g)||Z&C)&&(S[N]=w8(Z,f)):ue<=f&&(c.expiredLanes|=Z),P&=~Z}}function Ng(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function e2(){var c=Zd;return Zd<<=1,!(Zd&4194240)&&(Zd=64),c}function Tg(c){for(var f=[],g=0;31>g;g++)f.push(c);return f}function eu(c,f,g){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-Co(f),c[f]=g}function k8(c,f){var g=c.pendingLanes&~f;c.pendingLanes=f,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=f,c.mutableReadLanes&=f,c.entangledLanes&=f,f=c.entanglements;var C=c.eventTimes;for(c=c.expirationTimes;0<g;){var S=31-Co(g),P=1<<S;f[S]=0,C[S]=-1,c[S]=-1,g&=~P}}function $g(c,f){var g=c.entangledLanes|=f;for(c=c.entanglements;g;){var C=31-Co(g),S=1<<C;S&f|c[C]&f&&(c[C]|=f),g&=~S}}var Et=0;function t2(c){return c&=-c,1<c?4<c?c&268435455?16:536870912:4:1}var Lg=o.unstable_scheduleCallback,n2=o.unstable_cancelCallback,_8=o.unstable_shouldYield,j8=o.unstable_requestPaint,Ln=o.unstable_now,zg=o.unstable_ImmediatePriority,P8=o.unstable_UserBlockingPriority,Fg=o.unstable_NormalPriority,I8=o.unstable_IdlePriority,tf=null,Yo=null;function E8(c){if(Yo&&typeof Yo.onCommitFiberRoot=="function")try{Yo.onCommitFiberRoot(tf,c,void 0,(c.current.flags&128)===128)}catch{}}function M8(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var wo=typeof Object.is=="function"?Object.is:M8,Os=null,nf=!1,Bg=!1;function r2(c){Os===null?Os=[c]:Os.push(c)}function O8(c){nf=!0,r2(c)}function Qo(){if(!Bg&&Os!==null){Bg=!0;var c=0,f=Et;try{var g=Os;for(Et=1;c<g.length;c++){var C=g[c];do C=C(!0);while(C!==null)}Os=null,nf=!1}catch(S){throw Os!==null&&(Os=Os.slice(c+1)),Lg(zg,Qo),S}finally{Et=f,Bg=!1}}return null}var dl=[],fl=0,rf=null,of=0,Gr=[],Kr=0,ii=null,Ds=1,Rs="";function li(c,f){dl[fl++]=of,dl[fl++]=rf,rf=c,of=f}function o2(c,f,g){Gr[Kr++]=Ds,Gr[Kr++]=Rs,Gr[Kr++]=ii,ii=c;var C=Ds;c=Rs;var S=32-Co(C)-1;C&=~(1<<S),g+=1;var P=32-Co(f)+S;if(30<P){var N=S-S%5;P=(C&(1<<N)-1).toString(32),C>>=N,S-=N,Ds=1<<32-Co(f)+S|g<<S|C,Rs=P+c}else Ds=1<<P|g<<S|C,Rs=c}function Hg(c){c.return!==null&&(li(c,1),o2(c,1,0))}function Vg(c){for(;c===rf;)rf=dl[--fl],dl[fl]=null,of=dl[--fl],dl[fl]=null;for(;c===ii;)ii=Gr[--Kr],Gr[Kr]=null,Rs=Gr[--Kr],Gr[Kr]=null,Ds=Gr[--Kr],Gr[Kr]=null}var Ar=null,qr=null,Zt=!1,tu=!1,So=null;function s2(c,f){var g=Jr(5,null,null,0);g.elementType="DELETED",g.stateNode=f,g.return=c,f=c.deletions,f===null?(c.deletions=[g],c.flags|=16):f.push(g)}function a2(c,f){switch(c.tag){case 5:return f=ar(f,c.type,c.pendingProps),f!==null?(c.stateNode=f,Ar=c,qr=ll(f),!0):!1;case 6:return f=ir(f,c.pendingProps),f!==null?(c.stateNode=f,Ar=c,qr=null,!0):!1;case 13:if(f=Is(f),f!==null){var g=ii!==null?{id:Ds,overflow:Rs}:null;return c.memoizedState={dehydrated:f,treeContext:g,retryLane:1073741824},g=Jr(18,null,null,0),g.stateNode=f,g.return=c,c.child=g,Ar=c,qr=null,!0}return!1;default:return!1}}function Wg(c){return(c.mode&1)!==0&&(c.flags&128)===0}function Ug(c){if(Zt){var f=qr;if(f){var g=f;if(!a2(c,f)){if(Wg(c))throw Error(i(418));f=ma(g);var C=Ar;f&&a2(c,f)?s2(C,g):(c.flags=c.flags&-4097|2,Zt=!1,Ar=c)}}else{if(Wg(c))throw Error(i(418));c.flags=c.flags&-4097|2,Zt=!1,Ar=c}}}function i2(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Ar=c}function sf(c){if(!Ce||c!==Ar)return!1;if(!Zt)return i2(c),Zt=!0,!1;if(c.tag!==3&&(c.tag!==5||Ms(c.type)&&!W(c.type,c.memoizedProps))){var f=qr;if(f){if(Wg(c))throw l2(),Error(i(418));for(;f;)s2(c,f),f=ma(f)}}if(i2(c),c.tag===13){if(!Ce)throw Error(i(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));qr=Rr(c)}else qr=Ar?ma(c.stateNode):null;return!0}function l2(){for(var c=qr;c;)c=ma(c)}function pl(){Ce&&(qr=Ar=null,tu=Zt=!1)}function Gg(c){So===null?So=[c]:So.push(c)}var D8=l.ReactCurrentBatchConfig;function af(c,f){if(wo(c,f))return!0;if(typeof c!="object"||c===null||typeof f!="object"||f===null)return!1;var g=Object.keys(c),C=Object.keys(f);if(g.length!==C.length)return!1;for(C=0;C<g.length;C++){var S=g[C];if(!Ag.call(f,S)||!wo(c[S],f[S]))return!1}return!0}function R8(c){switch(c.tag){case 5:return ai(c.type);case 16:return ai("Lazy");case 13:return ai("Suspense");case 19:return ai("SuspenseList");case 0:case 2:case 15:return c=Zc(c.type,!1),c;case 11:return c=Zc(c.type.render,!1),c;case 1:return c=Zc(c.type,!0),c;default:return""}}function ko(c,f){if(c&&c.defaultProps){f=s({},f),c=c.defaultProps;for(var g in c)f[g]===void 0&&(f[g]=c[g]);return f}return f}var lf=St(null),cf=null,hl=null,Kg=null;function qg(){Kg=hl=cf=null}function c2(c,f,g){pe?(kt(lf,f._currentValue),f._currentValue=g):(kt(lf,f._currentValue2),f._currentValue2=g)}function Xg(c){var f=lf.current;bt(lf),pe?c._currentValue=f:c._currentValue2=f}function Yg(c,f,g){for(;c!==null;){var C=c.alternate;if((c.childLanes&f)!==f?(c.childLanes|=f,C!==null&&(C.childLanes|=f)):C!==null&&(C.childLanes&f)!==f&&(C.childLanes|=f),c===g)break;c=c.return}}function ml(c,f){cf=c,Kg=hl=null,c=c.dependencies,c!==null&&c.firstContext!==null&&(c.lanes&f&&(vr=!0),c.firstContext=null)}function Xr(c){var f=pe?c._currentValue:c._currentValue2;if(Kg!==c)if(c={context:c,memoizedValue:f,next:null},hl===null){if(cf===null)throw Error(i(308));hl=c,cf.dependencies={lanes:0,firstContext:c}}else hl=hl.next=c;return f}var ci=null;function Qg(c){ci===null?ci=[c]:ci.push(c)}function u2(c,f,g,C){var S=f.interleaved;return S===null?(g.next=g,Qg(f)):(g.next=S.next,S.next=g),f.interleaved=g,Zo(c,C)}function Zo(c,f){c.lanes|=f;var g=c.alternate;for(g!==null&&(g.lanes|=f),g=c,c=c.return;c!==null;)c.childLanes|=f,g=c.alternate,g!==null&&(g.childLanes|=f),g=c,c=c.return;return g.tag===3?g.stateNode:null}var xa=!1;function Zg(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function d2(c,f){c=c.updateQueue,f.updateQueue===c&&(f.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function As(c,f){return{eventTime:c,lane:f,tag:0,payload:null,callback:null,next:null}}function ba(c,f,g){var C=c.updateQueue;if(C===null)return null;if(C=C.shared,yt&2){var S=C.pending;return S===null?f.next=f:(f.next=S.next,S.next=f),C.pending=f,Zo(c,g)}return S=C.interleaved,S===null?(f.next=f,Qg(C)):(f.next=S.next,S.next=f),C.interleaved=f,Zo(c,g)}function uf(c,f,g){if(f=f.updateQueue,f!==null&&(f=f.shared,(g&4194240)!==0)){var C=f.lanes;C&=c.pendingLanes,g|=C,f.lanes=g,$g(c,g)}}function f2(c,f){var g=c.updateQueue,C=c.alternate;if(C!==null&&(C=C.updateQueue,g===C)){var S=null,P=null;if(g=g.firstBaseUpdate,g!==null){do{var N={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};P===null?S=P=N:P=P.next=N,g=g.next}while(g!==null);P===null?S=P=f:P=P.next=f}else S=P=f;g={baseState:C.baseState,firstBaseUpdate:S,lastBaseUpdate:P,shared:C.shared,effects:C.effects},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=f:c.next=f,g.lastBaseUpdate=f}function df(c,f,g,C){var S=c.updateQueue;xa=!1;var P=S.firstBaseUpdate,N=S.lastBaseUpdate,Z=S.shared.pending;if(Z!==null){S.shared.pending=null;var ue=Z,Ee=ue.next;ue.next=null,N===null?P=Ee:N.next=Ee,N=ue;var Ke=c.alternate;Ke!==null&&(Ke=Ke.updateQueue,Z=Ke.lastBaseUpdate,Z!==N&&(Z===null?Ke.firstBaseUpdate=Ee:Z.next=Ee,Ke.lastBaseUpdate=ue))}if(P!==null){var pt=S.baseState;N=0,Ke=Ee=ue=null,Z=P;do{var He=Z.lane,qt=Z.eventTime;if((C&He)===He){Ke!==null&&(Ke=Ke.next={eventTime:qt,lane:0,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null});e:{var Bt=c,yr=Z;switch(He=f,qt=g,yr.tag){case 1:if(Bt=yr.payload,typeof Bt=="function"){pt=Bt.call(qt,pt,He);break e}pt=Bt;break e;case 3:Bt.flags=Bt.flags&-65537|128;case 0:if(Bt=yr.payload,He=typeof Bt=="function"?Bt.call(qt,pt,He):Bt,He==null)break e;pt=s({},pt,He);break e;case 2:xa=!0}}Z.callback!==null&&Z.lane!==0&&(c.flags|=64,He=S.effects,He===null?S.effects=[Z]:He.push(Z))}else qt={eventTime:qt,lane:He,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Ke===null?(Ee=Ke=qt,ue=pt):Ke=Ke.next=qt,N|=He;if(Z=Z.next,Z===null){if(Z=S.shared.pending,Z===null)break;He=Z,Z=He.next,He.next=null,S.lastBaseUpdate=He,S.shared.pending=null}}while(1);if(Ke===null&&(ue=pt),S.baseState=ue,S.firstBaseUpdate=Ee,S.lastBaseUpdate=Ke,f=S.shared.interleaved,f!==null){S=f;do N|=S.lane,S=S.next;while(S!==f)}else P===null&&(S.shared.lanes=0);di|=N,c.lanes=N,c.memoizedState=pt}}function p2(c,f,g){if(c=f.effects,f.effects=null,c!==null)for(f=0;f<c.length;f++){var C=c[f],S=C.callback;if(S!==null){if(C.callback=null,C=g,typeof S!="function")throw Error(i(191,S));S.call(C)}}}var h2=new r.Component().refs;function Jg(c,f,g,C){f=c.memoizedState,g=g(C,f),g=g==null?f:s({},f,g),c.memoizedState=g,c.lanes===0&&(c.updateQueue.baseState=g)}var ff={isMounted:function(c){return(c=c._reactInternals)?A(c)===c:!1},enqueueSetState:function(c,f,g){c=c._reactInternals;var C=Qn(),S=wa(c),P=As(C,S);P.payload=f,g!=null&&(P.callback=g),f=ba(c,P,S),f!==null&&(Zr(f,c,S,C),uf(f,c,S))},enqueueReplaceState:function(c,f,g){c=c._reactInternals;var C=Qn(),S=wa(c),P=As(C,S);P.tag=1,P.payload=f,g!=null&&(P.callback=g),f=ba(c,P,S),f!==null&&(Zr(f,c,S,C),uf(f,c,S))},enqueueForceUpdate:function(c,f){c=c._reactInternals;var g=Qn(),C=wa(c),S=As(g,C);S.tag=2,f!=null&&(S.callback=f),f=ba(c,S,C),f!==null&&(Zr(f,c,C,g),uf(f,c,C))}};function m2(c,f,g,C,S,P,N){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(C,P,N):f.prototype&&f.prototype.isPureReactComponent?!af(g,C)||!af(S,P):!0}function g2(c,f,g){var C=!1,S=Kn,P=f.contextType;return typeof P=="object"&&P!==null?P=Xr(P):(S=gr(f)?lr:Wt.current,C=f.contextTypes,P=(C=C!=null)?ul(c,S):Kn),f=new f(g,P),c.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=ff,c.stateNode=f,f._reactInternals=c,C&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=S,c.__reactInternalMemoizedMaskedChildContext=P),f}function v2(c,f,g,C){c=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(g,C),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(g,C),f.state!==c&&ff.enqueueReplaceState(f,f.state,null)}function e0(c,f,g,C){var S=c.stateNode;S.props=g,S.state=c.memoizedState,S.refs=h2,Zg(c);var P=f.contextType;typeof P=="object"&&P!==null?S.context=Xr(P):(P=gr(f)?lr:Wt.current,S.context=ul(c,P)),S.state=c.memoizedState,P=f.getDerivedStateFromProps,typeof P=="function"&&(Jg(c,f,P,g),S.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(f=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),f!==S.state&&ff.enqueueReplaceState(S,S.state,null),df(c,g,S,C),S.state=c.memoizedState),typeof S.componentDidMount=="function"&&(c.flags|=4194308)}function nu(c,f,g){if(c=g.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(i(309));var C=g.stateNode}if(!C)throw Error(i(147,c));var S=C,P=""+c;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===P?f.ref:(f=function(N){var Z=S.refs;Z===h2&&(Z=S.refs={}),N===null?delete Z[P]:Z[P]=N},f._stringRef=P,f)}if(typeof c!="string")throw Error(i(284));if(!g._owner)throw Error(i(290,c))}return c}function pf(c,f){throw c=Object.prototype.toString.call(f),Error(i(31,c==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":c))}function x2(c){var f=c._init;return f(c._payload)}function b2(c){function f(ce,ne){if(c){var he=ce.deletions;he===null?(ce.deletions=[ne],ce.flags|=16):he.push(ne)}}function g(ce,ne){if(!c)return null;for(;ne!==null;)f(ce,ne),ne=ne.sibling;return null}function C(ce,ne){for(ce=new Map;ne!==null;)ne.key!==null?ce.set(ne.key,ne):ce.set(ne.index,ne),ne=ne.sibling;return ce}function S(ce,ne){return ce=ka(ce,ne),ce.index=0,ce.sibling=null,ce}function P(ce,ne,he){return ce.index=he,c?(he=ce.alternate,he!==null?(he=he.index,he<ne?(ce.flags|=2,ne):he):(ce.flags|=2,ne)):(ce.flags|=1048576,ne)}function N(ce){return c&&ce.alternate===null&&(ce.flags|=2),ce}function Z(ce,ne,he,Ve){return ne===null||ne.tag!==6?(ne=B0(he,ce.mode,Ve),ne.return=ce,ne):(ne=S(ne,he),ne.return=ce,ne)}function ue(ce,ne,he,Ve){var nt=he.type;return nt===h?Ke(ce,ne,he.props.children,Ve,he.key):ne!==null&&(ne.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===j&&x2(nt)===ne.type)?(Ve=S(ne,he.props),Ve.ref=nu(ce,ne,he),Ve.return=ce,Ve):(Ve=zf(he.type,he.key,he.props,null,ce.mode,Ve),Ve.ref=nu(ce,ne,he),Ve.return=ce,Ve)}function Ee(ce,ne,he,Ve){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==he.containerInfo||ne.stateNode.implementation!==he.implementation?(ne=H0(he,ce.mode,Ve),ne.return=ce,ne):(ne=S(ne,he.children||[]),ne.return=ce,ne)}function Ke(ce,ne,he,Ve,nt){return ne===null||ne.tag!==7?(ne=mi(he,ce.mode,Ve,nt),ne.return=ce,ne):(ne=S(ne,he),ne.return=ce,ne)}function pt(ce,ne,he){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=B0(""+ne,ce.mode,he),ne.return=ce,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case u:return he=zf(ne.type,ne.key,ne.props,null,ce.mode,he),he.ref=nu(ce,null,ne),he.return=ce,he;case p:return ne=H0(ne,ce.mode,he),ne.return=ce,ne;case j:var Ve=ne._init;return pt(ce,Ve(ne._payload),he)}if(Y(ne)||E(ne))return ne=mi(ne,ce.mode,he,null),ne.return=ce,ne;pf(ce,ne)}return null}function He(ce,ne,he,Ve){var nt=ne!==null?ne.key:null;if(typeof he=="string"&&he!==""||typeof he=="number")return nt!==null?null:Z(ce,ne,""+he,Ve);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case u:return he.key===nt?ue(ce,ne,he,Ve):null;case p:return he.key===nt?Ee(ce,ne,he,Ve):null;case j:return nt=he._init,He(ce,ne,nt(he._payload),Ve)}if(Y(he)||E(he))return nt!==null?null:Ke(ce,ne,he,Ve,null);pf(ce,he)}return null}function qt(ce,ne,he,Ve,nt){if(typeof Ve=="string"&&Ve!==""||typeof Ve=="number")return ce=ce.get(he)||null,Z(ne,ce,""+Ve,nt);if(typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case u:return ce=ce.get(Ve.key===null?he:Ve.key)||null,ue(ne,ce,Ve,nt);case p:return ce=ce.get(Ve.key===null?he:Ve.key)||null,Ee(ne,ce,Ve,nt);case j:var gt=Ve._init;return qt(ce,ne,he,gt(Ve._payload),nt)}if(Y(Ve)||E(Ve))return ce=ce.get(he)||null,Ke(ne,ce,Ve,nt,null);pf(ne,Ve)}return null}function Bt(ce,ne,he,Ve){for(var nt=null,gt=null,ht=ne,Mt=ne=0,Bn=null;ht!==null&&Mt<he.length;Mt++){ht.index>Mt?(Bn=ht,ht=null):Bn=ht.sibling;var Ot=He(ce,ht,he[Mt],Ve);if(Ot===null){ht===null&&(ht=Bn);break}c&&ht&&Ot.alternate===null&&f(ce,ht),ne=P(Ot,ne,Mt),gt===null?nt=Ot:gt.sibling=Ot,gt=Ot,ht=Bn}if(Mt===he.length)return g(ce,ht),Zt&&li(ce,Mt),nt;if(ht===null){for(;Mt<he.length;Mt++)ht=pt(ce,he[Mt],Ve),ht!==null&&(ne=P(ht,ne,Mt),gt===null?nt=ht:gt.sibling=ht,gt=ht);return Zt&&li(ce,Mt),nt}for(ht=C(ce,ht);Mt<he.length;Mt++)Bn=qt(ht,ce,Mt,he[Mt],Ve),Bn!==null&&(c&&Bn.alternate!==null&&ht.delete(Bn.key===null?Mt:Bn.key),ne=P(Bn,ne,Mt),gt===null?nt=Bn:gt.sibling=Bn,gt=Bn);return c&&ht.forEach(function(_a){return f(ce,_a)}),Zt&&li(ce,Mt),nt}function yr(ce,ne,he,Ve){var nt=E(he);if(typeof nt!="function")throw Error(i(150));if(he=nt.call(he),he==null)throw Error(i(151));for(var gt=nt=null,ht=ne,Mt=ne=0,Bn=null,Ot=he.next();ht!==null&&!Ot.done;Mt++,Ot=he.next()){ht.index>Mt?(Bn=ht,ht=null):Bn=ht.sibling;var _a=He(ce,ht,Ot.value,Ve);if(_a===null){ht===null&&(ht=Bn);break}c&&ht&&_a.alternate===null&&f(ce,ht),ne=P(_a,ne,Mt),gt===null?nt=_a:gt.sibling=_a,gt=_a,ht=Bn}if(Ot.done)return g(ce,ht),Zt&&li(ce,Mt),nt;if(ht===null){for(;!Ot.done;Mt++,Ot=he.next())Ot=pt(ce,Ot.value,Ve),Ot!==null&&(ne=P(Ot,ne,Mt),gt===null?nt=Ot:gt.sibling=Ot,gt=Ot);return Zt&&li(ce,Mt),nt}for(ht=C(ce,ht);!Ot.done;Mt++,Ot=he.next())Ot=qt(ht,ce,Mt,Ot.value,Ve),Ot!==null&&(c&&Ot.alternate!==null&&ht.delete(Ot.key===null?Mt:Ot.key),ne=P(Ot,ne,Mt),gt===null?nt=Ot:gt.sibling=Ot,gt=Ot);return c&&ht.forEach(function(c7){return f(ce,c7)}),Zt&&li(ce,Mt),nt}function $s(ce,ne,he,Ve){if(typeof he=="object"&&he!==null&&he.type===h&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case u:e:{for(var nt=he.key,gt=ne;gt!==null;){if(gt.key===nt){if(nt=he.type,nt===h){if(gt.tag===7){g(ce,gt.sibling),ne=S(gt,he.props.children),ne.return=ce,ce=ne;break e}}else if(gt.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===j&&x2(nt)===gt.type){g(ce,gt.sibling),ne=S(gt,he.props),ne.ref=nu(ce,gt,he),ne.return=ce,ce=ne;break e}g(ce,gt);break}else f(ce,gt);gt=gt.sibling}he.type===h?(ne=mi(he.props.children,ce.mode,Ve,he.key),ne.return=ce,ce=ne):(Ve=zf(he.type,he.key,he.props,null,ce.mode,Ve),Ve.ref=nu(ce,ne,he),Ve.return=ce,ce=Ve)}return N(ce);case p:e:{for(gt=he.key;ne!==null;){if(ne.key===gt)if(ne.tag===4&&ne.stateNode.containerInfo===he.containerInfo&&ne.stateNode.implementation===he.implementation){g(ce,ne.sibling),ne=S(ne,he.children||[]),ne.return=ce,ce=ne;break e}else{g(ce,ne);break}else f(ce,ne);ne=ne.sibling}ne=H0(he,ce.mode,Ve),ne.return=ce,ce=ne}return N(ce);case j:return gt=he._init,$s(ce,ne,gt(he._payload),Ve)}if(Y(he))return Bt(ce,ne,he,Ve);if(E(he))return yr(ce,ne,he,Ve);pf(ce,he)}return typeof he=="string"&&he!==""||typeof he=="number"?(he=""+he,ne!==null&&ne.tag===6?(g(ce,ne.sibling),ne=S(ne,he),ne.return=ce,ce=ne):(g(ce,ne),ne=B0(he,ce.mode,Ve),ne.return=ce,ce=ne),N(ce)):g(ce,ne)}return $s}var gl=b2(!0),y2=b2(!1),ru={},Yr=St(ru),ou=St(ru),vl=St(ru);function Jo(c){if(c===ru)throw Error(i(174));return c}function t0(c,f){kt(vl,f),kt(ou,c),kt(Yr,ru),c=L(f),bt(Yr),kt(Yr,c)}function xl(){bt(Yr),bt(ou),bt(vl)}function C2(c){var f=Jo(vl.current),g=Jo(Yr.current);f=q(g,c.type,f),g!==f&&(kt(ou,c),kt(Yr,f))}function n0(c){ou.current===c&&(bt(Yr),bt(ou))}var sn=St(0);function hf(c){for(var f=c;f!==null;){if(f.tag===13){var g=f.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Es(g)||pa(g)))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===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var r0=[];function o0(){for(var c=0;c<r0.length;c++){var f=r0[c];pe?f._workInProgressVersionPrimary=null:f._workInProgressVersionSecondary=null}r0.length=0}var mf=l.ReactCurrentDispatcher,s0=l.ReactCurrentBatchConfig,ui=0,an=null,On=null,zn=null,gf=!1,su=!1,au=0,A8=0;function qn(){throw Error(i(321))}function a0(c,f){if(f===null)return!1;for(var g=0;g<f.length&&g<c.length;g++)if(!wo(c[g],f[g]))return!1;return!0}function i0(c,f,g,C,S,P){if(ui=P,an=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,mf.current=c===null||c.memoizedState===null?L8:z8,c=g(C,S),su){P=0;do{if(su=!1,au=0,25<=P)throw Error(i(301));P+=1,zn=On=null,f.updateQueue=null,mf.current=F8,c=g(C,S)}while(su)}if(mf.current=bf,f=On!==null&&On.next!==null,ui=0,zn=On=an=null,gf=!1,f)throw Error(i(300));return c}function l0(){var c=au!==0;return au=0,c}function es(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zn===null?an.memoizedState=zn=c:zn=zn.next=c,zn}function Qr(){if(On===null){var c=an.alternate;c=c!==null?c.memoizedState:null}else c=On.next;var f=zn===null?an.memoizedState:zn.next;if(f!==null)zn=f,On=c;else{if(c===null)throw Error(i(310));On=c,c={memoizedState:On.memoizedState,baseState:On.baseState,baseQueue:On.baseQueue,queue:On.queue,next:null},zn===null?an.memoizedState=zn=c:zn=zn.next=c}return zn}function iu(c,f){return typeof f=="function"?f(c):f}function c0(c){var f=Qr(),g=f.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=c;var C=On,S=C.baseQueue,P=g.pending;if(P!==null){if(S!==null){var N=S.next;S.next=P.next,P.next=N}C.baseQueue=S=P,g.pending=null}if(S!==null){P=S.next,C=C.baseState;var Z=N=null,ue=null,Ee=P;do{var Ke=Ee.lane;if((ui&Ke)===Ke)ue!==null&&(ue=ue.next={lane:0,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null}),C=Ee.hasEagerState?Ee.eagerState:c(C,Ee.action);else{var pt={lane:Ke,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null};ue===null?(Z=ue=pt,N=C):ue=ue.next=pt,an.lanes|=Ke,di|=Ke}Ee=Ee.next}while(Ee!==null&&Ee!==P);ue===null?N=C:ue.next=Z,wo(C,f.memoizedState)||(vr=!0),f.memoizedState=C,f.baseState=N,f.baseQueue=ue,g.lastRenderedState=C}if(c=g.interleaved,c!==null){S=c;do P=S.lane,an.lanes|=P,di|=P,S=S.next;while(S!==c)}else S===null&&(g.lanes=0);return[f.memoizedState,g.dispatch]}function u0(c){var f=Qr(),g=f.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=c;var C=g.dispatch,S=g.pending,P=f.memoizedState;if(S!==null){g.pending=null;var N=S=S.next;do P=c(P,N.action),N=N.next;while(N!==S);wo(P,f.memoizedState)||(vr=!0),f.memoizedState=P,f.baseQueue===null&&(f.baseState=P),g.lastRenderedState=P}return[P,C]}function w2(){}function S2(c,f){var g=an,C=Qr(),S=f(),P=!wo(C.memoizedState,S);if(P&&(C.memoizedState=S,vr=!0),C=C.queue,d0(j2.bind(null,g,C,c),[c]),C.getSnapshot!==f||P||zn!==null&&zn.memoizedState.tag&1){if(g.flags|=2048,lu(9,_2.bind(null,g,C,S,f),void 0,null),Fn===null)throw Error(i(349));ui&30||k2(g,f,S)}return S}function k2(c,f,g){c.flags|=16384,c={getSnapshot:f,value:g},f=an.updateQueue,f===null?(f={lastEffect:null,stores:null},an.updateQueue=f,f.stores=[c]):(g=f.stores,g===null?f.stores=[c]:g.push(c))}function _2(c,f,g,C){f.value=g,f.getSnapshot=C,P2(f)&&I2(c)}function j2(c,f,g){return g(function(){P2(f)&&I2(c)})}function P2(c){var f=c.getSnapshot;c=c.value;try{var g=f();return!wo(c,g)}catch{return!0}}function I2(c){var f=Zo(c,1);f!==null&&Zr(f,c,1,-1)}function E2(c){var f=es();return typeof c=="function"&&(c=c()),f.memoizedState=f.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:iu,lastRenderedState:c},f.queue=c,c=c.dispatch=$8.bind(null,an,c),[f.memoizedState,c]}function lu(c,f,g,C){return c={tag:c,create:f,destroy:g,deps:C,next:null},f=an.updateQueue,f===null?(f={lastEffect:null,stores:null},an.updateQueue=f,f.lastEffect=c.next=c):(g=f.lastEffect,g===null?f.lastEffect=c.next=c:(C=g.next,g.next=c,c.next=C,f.lastEffect=c)),c}function M2(){return Qr().memoizedState}function vf(c,f,g,C){var S=es();an.flags|=c,S.memoizedState=lu(1|f,g,void 0,C===void 0?null:C)}function xf(c,f,g,C){var S=Qr();C=C===void 0?null:C;var P=void 0;if(On!==null){var N=On.memoizedState;if(P=N.destroy,C!==null&&a0(C,N.deps)){S.memoizedState=lu(f,g,P,C);return}}an.flags|=c,S.memoizedState=lu(1|f,g,P,C)}function O2(c,f){return vf(8390656,8,c,f)}function d0(c,f){return xf(2048,8,c,f)}function D2(c,f){return xf(4,2,c,f)}function R2(c,f){return xf(4,4,c,f)}function A2(c,f){if(typeof f=="function")return c=c(),f(c),function(){f(null)};if(f!=null)return c=c(),f.current=c,function(){f.current=null}}function N2(c,f,g){return g=g!=null?g.concat([c]):null,xf(4,4,A2.bind(null,f,c),g)}function f0(){}function T2(c,f){var g=Qr();f=f===void 0?null:f;var C=g.memoizedState;return C!==null&&f!==null&&a0(f,C[1])?C[0]:(g.memoizedState=[c,f],c)}function $2(c,f){var g=Qr();f=f===void 0?null:f;var C=g.memoizedState;return C!==null&&f!==null&&a0(f,C[1])?C[0]:(c=c(),g.memoizedState=[c,f],c)}function L2(c,f,g){return ui&21?(wo(g,f)||(g=e2(),an.lanes|=g,di|=g,c.baseState=!0),f):(c.baseState&&(c.baseState=!1,vr=!0),c.memoizedState=g)}function N8(c,f){var g=Et;Et=g!==0&&4>g?g:4,c(!0);var C=s0.transition;s0.transition={};try{c(!1),f()}finally{Et=g,s0.transition=C}}function z2(){return Qr().memoizedState}function T8(c,f,g){var C=wa(c);if(g={lane:C,action:g,hasEagerState:!1,eagerState:null,next:null},F2(c))B2(f,g);else if(g=u2(c,f,g,C),g!==null){var S=Qn();Zr(g,c,C,S),H2(g,f,C)}}function $8(c,f,g){var C=wa(c),S={lane:C,action:g,hasEagerState:!1,eagerState:null,next:null};if(F2(c))B2(f,S);else{var P=c.alternate;if(c.lanes===0&&(P===null||P.lanes===0)&&(P=f.lastRenderedReducer,P!==null))try{var N=f.lastRenderedState,Z=P(N,g);if(S.hasEagerState=!0,S.eagerState=Z,wo(Z,N)){var ue=f.interleaved;ue===null?(S.next=S,Qg(f)):(S.next=ue.next,ue.next=S),f.interleaved=S;return}}catch{}finally{}g=u2(c,f,S,C),g!==null&&(S=Qn(),Zr(g,c,C,S),H2(g,f,C))}}function F2(c){var f=c.alternate;return c===an||f!==null&&f===an}function B2(c,f){su=gf=!0;var g=c.pending;g===null?f.next=f:(f.next=g.next,g.next=f),c.pending=f}function H2(c,f,g){if(g&4194240){var C=f.lanes;C&=c.pendingLanes,g|=C,f.lanes=g,$g(c,g)}}var bf={readContext:Xr,useCallback:qn,useContext:qn,useEffect:qn,useImperativeHandle:qn,useInsertionEffect:qn,useLayoutEffect:qn,useMemo:qn,useReducer:qn,useRef:qn,useState:qn,useDebugValue:qn,useDeferredValue:qn,useTransition:qn,useMutableSource:qn,useSyncExternalStore:qn,useId:qn,unstable_isNewReconciler:!1},L8={readContext:Xr,useCallback:function(c,f){return es().memoizedState=[c,f===void 0?null:f],c},useContext:Xr,useEffect:O2,useImperativeHandle:function(c,f,g){return g=g!=null?g.concat([c]):null,vf(4194308,4,A2.bind(null,f,c),g)},useLayoutEffect:function(c,f){return vf(4194308,4,c,f)},useInsertionEffect:function(c,f){return vf(4,2,c,f)},useMemo:function(c,f){var g=es();return f=f===void 0?null:f,c=c(),g.memoizedState=[c,f],c},useReducer:function(c,f,g){var C=es();return f=g!==void 0?g(f):f,C.memoizedState=C.baseState=f,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:f},C.queue=c,c=c.dispatch=T8.bind(null,an,c),[C.memoizedState,c]},useRef:function(c){var f=es();return c={current:c},f.memoizedState=c},useState:E2,useDebugValue:f0,useDeferredValue:function(c){return es().memoizedState=c},useTransition:function(){var c=E2(!1),f=c[0];return c=N8.bind(null,c[1]),es().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,g){var C=an,S=es();if(Zt){if(g===void 0)throw Error(i(407));g=g()}else{if(g=f(),Fn===null)throw Error(i(349));ui&30||k2(C,f,g)}S.memoizedState=g;var P={value:g,getSnapshot:f};return S.queue=P,O2(j2.bind(null,C,P,c),[c]),C.flags|=2048,lu(9,_2.bind(null,C,P,g,f),void 0,null),g},useId:function(){var c=es(),f=Fn.identifierPrefix;if(Zt){var g=Rs,C=Ds;g=(C&~(1<<32-Co(C)-1)).toString(32)+g,f=":"+f+"R"+g,g=au++,0<g&&(f+="H"+g.toString(32)),f+=":"}else g=A8++,f=":"+f+"r"+g.toString(32)+":";return c.memoizedState=f},unstable_isNewReconciler:!1},z8={readContext:Xr,useCallback:T2,useContext:Xr,useEffect:d0,useImperativeHandle:N2,useInsertionEffect:D2,useLayoutEffect:R2,useMemo:$2,useReducer:c0,useRef:M2,useState:function(){return c0(iu)},useDebugValue:f0,useDeferredValue:function(c){var f=Qr();return L2(f,On.memoizedState,c)},useTransition:function(){var c=c0(iu)[0],f=Qr().memoizedState;return[c,f]},useMutableSource:w2,useSyncExternalStore:S2,useId:z2,unstable_isNewReconciler:!1},F8={readContext:Xr,useCallback:T2,useContext:Xr,useEffect:d0,useImperativeHandle:N2,useInsertionEffect:D2,useLayoutEffect:R2,useMemo:$2,useReducer:u0,useRef:M2,useState:function(){return u0(iu)},useDebugValue:f0,useDeferredValue:function(c){var f=Qr();return On===null?f.memoizedState=c:L2(f,On.memoizedState,c)},useTransition:function(){var c=u0(iu)[0],f=Qr().memoizedState;return[c,f]},useMutableSource:w2,useSyncExternalStore:S2,useId:z2,unstable_isNewReconciler:!1};function bl(c,f){try{var g="",C=f;do g+=R8(C),C=C.return;while(C);var S=g}catch(P){S=`
|
||
Error generating stack: `+P.message+`
|
||
`+P.stack}return{value:c,source:f,stack:S,digest:null}}function p0(c,f,g){return{value:c,source:null,stack:g??null,digest:f??null}}function h0(c,f){try{console.error(f.value)}catch(g){setTimeout(function(){throw g})}}var B8=typeof WeakMap=="function"?WeakMap:Map;function V2(c,f,g){g=As(-1,g),g.tag=3,g.payload={element:null};var C=f.value;return g.callback=function(){Rf||(Rf=!0,A0=C),h0(c,f)},g}function W2(c,f,g){g=As(-1,g),g.tag=3;var C=c.type.getDerivedStateFromError;if(typeof C=="function"){var S=f.value;g.payload=function(){return C(S)},g.callback=function(){h0(c,f)}}var P=c.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(g.callback=function(){h0(c,f),typeof C!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var N=f.stack;this.componentDidCatch(f.value,{componentStack:N!==null?N:""})}),g}function U2(c,f,g){var C=c.pingCache;if(C===null){C=c.pingCache=new B8;var S=new Set;C.set(f,S)}else S=C.get(f),S===void 0&&(S=new Set,C.set(f,S));S.has(g)||(S.add(g),c=t7.bind(null,c,f,g),f.then(c,c))}function G2(c){do{var f;if((f=c.tag===13)&&(f=c.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return c;c=c.return}while(c!==null);return null}function K2(c,f,g,C,S){return c.mode&1?(c.flags|=65536,c.lanes=S,c):(c===f?c.flags|=65536:(c.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(f=As(-1,1),f.tag=2,ba(g,f,1))),g.lanes|=1),c)}var H8=l.ReactCurrentOwner,vr=!1;function cr(c,f,g,C){f.child=c===null?y2(f,null,g,C):gl(f,c.child,g,C)}function q2(c,f,g,C,S){g=g.render;var P=f.ref;return ml(f,S),C=i0(c,f,g,C,P,S),g=l0(),c!==null&&!vr?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~S,Ns(c,f,S)):(Zt&&g&&Hg(f),f.flags|=1,cr(c,f,C,S),f.child)}function X2(c,f,g,C,S){if(c===null){var P=g.type;return typeof P=="function"&&!F0(P)&&P.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(f.tag=15,f.type=P,Y2(c,f,P,C,S)):(c=zf(g.type,null,C,f,f.mode,S),c.ref=f.ref,c.return=f,f.child=c)}if(P=c.child,!(c.lanes&S)){var N=P.memoizedProps;if(g=g.compare,g=g!==null?g:af,g(N,C)&&c.ref===f.ref)return Ns(c,f,S)}return f.flags|=1,c=ka(P,C),c.ref=f.ref,c.return=f,f.child=c}function Y2(c,f,g,C,S){if(c!==null){var P=c.memoizedProps;if(af(P,C)&&c.ref===f.ref)if(vr=!1,f.pendingProps=C=P,(c.lanes&S)!==0)c.flags&131072&&(vr=!0);else return f.lanes=c.lanes,Ns(c,f,S)}return m0(c,f,g,C,S)}function Q2(c,f,g){var C=f.pendingProps,S=C.children,P=c!==null?c.memoizedState:null;if(C.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null,transitions:null},kt(Cl,Nr),Nr|=g;else{if(!(g&1073741824))return c=P!==null?P.baseLanes|g:g,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null,transitions:null},f.updateQueue=null,kt(Cl,Nr),Nr|=c,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},C=P!==null?P.baseLanes:g,kt(Cl,Nr),Nr|=C}else P!==null?(C=P.baseLanes|g,f.memoizedState=null):C=g,kt(Cl,Nr),Nr|=C;return cr(c,f,S,g),f.child}function Z2(c,f){var g=f.ref;(c===null&&g!==null||c!==null&&c.ref!==g)&&(f.flags|=512,f.flags|=2097152)}function m0(c,f,g,C,S){var P=gr(g)?lr:Wt.current;return P=ul(f,P),ml(f,S),g=i0(c,f,g,C,P,S),C=l0(),c!==null&&!vr?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~S,Ns(c,f,S)):(Zt&&C&&Hg(f),f.flags|=1,cr(c,f,g,S),f.child)}function J2(c,f,g,C,S){if(gr(g)){var P=!0;Qd(f)}else P=!1;if(ml(f,S),f.stateNode===null)Cf(c,f),g2(f,g,C),e0(f,g,C,S),C=!0;else if(c===null){var N=f.stateNode,Z=f.memoizedProps;N.props=Z;var ue=N.context,Ee=g.contextType;typeof Ee=="object"&&Ee!==null?Ee=Xr(Ee):(Ee=gr(g)?lr:Wt.current,Ee=ul(f,Ee));var Ke=g.getDerivedStateFromProps,pt=typeof Ke=="function"||typeof N.getSnapshotBeforeUpdate=="function";pt||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==C||ue!==Ee)&&v2(f,N,C,Ee),xa=!1;var He=f.memoizedState;N.state=He,df(f,C,N,S),ue=f.memoizedState,Z!==C||He!==ue||kn.current||xa?(typeof Ke=="function"&&(Jg(f,g,Ke,C),ue=f.memoizedState),(Z=xa||m2(f,g,Z,C,He,ue,Ee))?(pt||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(f.flags|=4194308)):(typeof N.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=C,f.memoizedState=ue),N.props=C,N.state=ue,N.context=Ee,C=Z):(typeof N.componentDidMount=="function"&&(f.flags|=4194308),C=!1)}else{N=f.stateNode,d2(c,f),Z=f.memoizedProps,Ee=f.type===f.elementType?Z:ko(f.type,Z),N.props=Ee,pt=f.pendingProps,He=N.context,ue=g.contextType,typeof ue=="object"&&ue!==null?ue=Xr(ue):(ue=gr(g)?lr:Wt.current,ue=ul(f,ue));var qt=g.getDerivedStateFromProps;(Ke=typeof qt=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==pt||He!==ue)&&v2(f,N,C,ue),xa=!1,He=f.memoizedState,N.state=He,df(f,C,N,S);var Bt=f.memoizedState;Z!==pt||He!==Bt||kn.current||xa?(typeof qt=="function"&&(Jg(f,g,qt,C),Bt=f.memoizedState),(Ee=xa||m2(f,g,Ee,C,He,Bt,ue)||!1)?(Ke||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(C,Bt,ue),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(C,Bt,ue)),typeof N.componentDidUpdate=="function"&&(f.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof N.componentDidUpdate!="function"||Z===c.memoizedProps&&He===c.memoizedState||(f.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&He===c.memoizedState||(f.flags|=1024),f.memoizedProps=C,f.memoizedState=Bt),N.props=C,N.state=Bt,N.context=ue,C=Ee):(typeof N.componentDidUpdate!="function"||Z===c.memoizedProps&&He===c.memoizedState||(f.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&He===c.memoizedState||(f.flags|=1024),C=!1)}return g0(c,f,g,C,P,S)}function g0(c,f,g,C,S,P){Z2(c,f);var N=(f.flags&128)!==0;if(!C&&!N)return S&&Jy(f,g,!1),Ns(c,f,P);C=f.stateNode,H8.current=f;var Z=N&&typeof g.getDerivedStateFromError!="function"?null:C.render();return f.flags|=1,c!==null&&N?(f.child=gl(f,c.child,null,P),f.child=gl(f,null,Z,P)):cr(c,f,Z,P),f.memoizedState=C.state,S&&Jy(f,g,!0),f.child}function eC(c){var f=c.stateNode;f.pendingContext?Qy(c,f.pendingContext,f.pendingContext!==f.context):f.context&&Qy(c,f.context,!1),t0(c,f.containerInfo)}function tC(c,f,g,C,S){return pl(),Gg(S),f.flags|=256,cr(c,f,g,C),f.child}var v0={dehydrated:null,treeContext:null,retryLane:0};function x0(c){return{baseLanes:c,cachePool:null,transitions:null}}function nC(c,f,g){var C=f.pendingProps,S=sn.current,P=!1,N=(f.flags&128)!==0,Z;if((Z=N)||(Z=c!==null&&c.memoizedState===null?!1:(S&2)!==0),Z?(P=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(S|=1),kt(sn,S&1),c===null)return Ug(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?pa(c)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(N=C.children,c=C.fallback,P?(C=f.mode,P=f.child,N={mode:"hidden",children:N},!(C&1)&&P!==null?(P.childLanes=0,P.pendingProps=N):P=Ff(N,C,0,null),c=mi(c,C,g,null),P.return=f,c.return=f,P.sibling=c,f.child=P,f.child.memoizedState=x0(g),f.memoizedState=v0,c):b0(f,N));if(S=c.memoizedState,S!==null&&(Z=S.dehydrated,Z!==null))return V8(c,f,N,C,Z,S,g);if(P){P=C.fallback,N=f.mode,S=c.child,Z=S.sibling;var ue={mode:"hidden",children:C.children};return!(N&1)&&f.child!==S?(C=f.child,C.childLanes=0,C.pendingProps=ue,f.deletions=null):(C=ka(S,ue),C.subtreeFlags=S.subtreeFlags&14680064),Z!==null?P=ka(Z,P):(P=mi(P,N,g,null),P.flags|=2),P.return=f,C.return=f,C.sibling=P,f.child=C,C=P,P=f.child,N=c.child.memoizedState,N=N===null?x0(g):{baseLanes:N.baseLanes|g,cachePool:null,transitions:N.transitions},P.memoizedState=N,P.childLanes=c.childLanes&~g,f.memoizedState=v0,C}return P=c.child,c=P.sibling,C=ka(P,{mode:"visible",children:C.children}),!(f.mode&1)&&(C.lanes=g),C.return=f,C.sibling=null,c!==null&&(g=f.deletions,g===null?(f.deletions=[c],f.flags|=16):g.push(c)),f.child=C,f.memoizedState=null,C}function b0(c,f){return f=Ff({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function yf(c,f,g,C){return C!==null&&Gg(C),gl(f,c.child,null,g),c=b0(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function V8(c,f,g,C,S,P,N){if(g)return f.flags&256?(f.flags&=-257,C=p0(Error(i(422))),yf(c,f,N,C)):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(P=C.fallback,S=f.mode,C=Ff({mode:"visible",children:C.children},S,0,null),P=mi(P,S,N,null),P.flags|=2,C.return=f,P.return=f,C.sibling=P,f.child=C,f.mode&1&&gl(f,c.child,null,N),f.child.memoizedState=x0(N),f.memoizedState=v0,P);if(!(f.mode&1))return yf(c,f,N,null);if(pa(S))return C=ha(S).digest,P=Error(i(419)),C=p0(P,C,void 0),yf(c,f,N,C);if(g=(N&c.childLanes)!==0,vr||g){if(C=Fn,C!==null){switch(N&-N){case 4:S=2;break;case 16:S=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:S=32;break;case 536870912:S=268435456;break;default:S=0}S=S&(C.suspendedLanes|N)?0:S,S!==0&&S!==P.retryLane&&(P.retryLane=S,Zo(c,S),Zr(C,c,S,-1))}return z0(),C=p0(Error(i(421))),yf(c,f,N,C)}return Es(S)?(f.flags|=128,f.child=c.child,f=n7.bind(null,c),il(S,f),null):(c=P.treeContext,Ce&&(qr=Nt(S),Ar=f,Zt=!0,So=null,tu=!1,c!==null&&(Gr[Kr++]=Ds,Gr[Kr++]=Rs,Gr[Kr++]=ii,Ds=c.id,Rs=c.overflow,ii=f)),f=b0(f,C.children),f.flags|=4096,f)}function rC(c,f,g){c.lanes|=f;var C=c.alternate;C!==null&&(C.lanes|=f),Yg(c.return,f,g)}function y0(c,f,g,C,S){var P=c.memoizedState;P===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:C,tail:g,tailMode:S}:(P.isBackwards=f,P.rendering=null,P.renderingStartTime=0,P.last=C,P.tail=g,P.tailMode=S)}function oC(c,f,g){var C=f.pendingProps,S=C.revealOrder,P=C.tail;if(cr(c,f,C.children,g),C=sn.current,C&2)C=C&1|2,f.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&rC(c,g,f);else if(c.tag===19)rC(c,g,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}C&=1}if(kt(sn,C),!(f.mode&1))f.memoizedState=null;else switch(S){case"forwards":for(g=f.child,S=null;g!==null;)c=g.alternate,c!==null&&hf(c)===null&&(S=g),g=g.sibling;g=S,g===null?(S=f.child,f.child=null):(S=g.sibling,g.sibling=null),y0(f,!1,S,g,P);break;case"backwards":for(g=null,S=f.child,f.child=null;S!==null;){if(c=S.alternate,c!==null&&hf(c)===null){f.child=S;break}c=S.sibling,S.sibling=g,g=S,S=c}y0(f,!0,g,null,P);break;case"together":y0(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Cf(c,f){!(f.mode&1)&&c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2)}function Ns(c,f,g){if(c!==null&&(f.dependencies=c.dependencies),di|=f.lanes,!(g&f.childLanes))return null;if(c!==null&&f.child!==c.child)throw Error(i(153));if(f.child!==null){for(c=f.child,g=ka(c,c.pendingProps),f.child=g,g.return=f;c.sibling!==null;)c=c.sibling,g=g.sibling=ka(c,c.pendingProps),g.return=f;g.sibling=null}return f.child}function W8(c,f,g){switch(f.tag){case 3:eC(f),pl();break;case 5:C2(f);break;case 1:gr(f.type)&&Qd(f);break;case 4:t0(f,f.stateNode.containerInfo);break;case 10:c2(f,f.type._context,f.memoizedProps.value);break;case 13:var C=f.memoizedState;if(C!==null)return C.dehydrated!==null?(kt(sn,sn.current&1),f.flags|=128,null):g&f.child.childLanes?nC(c,f,g):(kt(sn,sn.current&1),c=Ns(c,f,g),c!==null?c.sibling:null);kt(sn,sn.current&1);break;case 19:if(C=(g&f.childLanes)!==0,c.flags&128){if(C)return oC(c,f,g);f.flags|=128}var S=f.memoizedState;if(S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),kt(sn,sn.current),C)break;return null;case 22:case 23:return f.lanes=0,Q2(c,f,g)}return Ns(c,f,g)}function ts(c){c.flags|=4}function sC(c,f){if(c!==null&&c.child===f.child)return!0;if(f.flags&16)return!1;for(c=f.child;c!==null;){if(c.flags&12854||c.subtreeFlags&12854)return!1;c=c.sibling}return!0}var cu,uu,wf,Sf;if(fe)cu=function(c,f){for(var g=f.child;g!==null;){if(g.tag===5||g.tag===6)Q(c,g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===f)break;for(;g.sibling===null;){if(g.return===null||g.return===f)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},uu=function(){},wf=function(c,f,g,C,S){if(c=c.memoizedProps,c!==C){var P=f.stateNode,N=Jo(Yr.current);g=se(P,g,c,C,S,N),(f.updateQueue=g)&&ts(f)}},Sf=function(c,f,g,C){g!==C&&ts(f)};else if(ge){cu=function(c,f,g,C){for(var S=f.child;S!==null;){if(S.tag===5){var P=S.stateNode;g&&C&&(P=mr(P,S.type,S.memoizedProps,S)),Q(c,P)}else if(S.tag===6)P=S.stateNode,g&&C&&(P=yo(P,S.memoizedProps,S)),Q(c,P);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)P=S.child,P!==null&&(P.return=S),cu(c,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===f)break;for(;S.sibling===null;){if(S.return===null||S.return===f)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};var aC=function(c,f,g,C){for(var S=f.child;S!==null;){if(S.tag===5){var P=S.stateNode;g&&C&&(P=mr(P,S.type,S.memoizedProps,S)),pn(c,P)}else if(S.tag===6)P=S.stateNode,g&&C&&(P=yo(P,S.memoizedProps,S)),pn(c,P);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)P=S.child,P!==null&&(P.return=S),aC(c,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===f)break;for(;S.sibling===null;){if(S.return===null||S.return===f)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};uu=function(c,f){var g=f.stateNode;if(!sC(c,f)){c=g.containerInfo;var C=In(c);aC(C,f,!1,!1),g.pendingChildren=C,ts(f),on(c,C)}},wf=function(c,f,g,C,S){var P=c.stateNode,N=c.memoizedProps;if((c=sC(c,f))&&N===C)f.stateNode=P;else{var Z=f.stateNode,ue=Jo(Yr.current),Ee=null;N!==C&&(Ee=se(Z,g,N,C,S,ue)),c&&Ee===null?f.stateNode=P:(P=sr(P,Ee,g,N,C,f,c,Z),le(P,g,C,S,ue)&&ts(f),f.stateNode=P,c?ts(f):cu(P,f,!1,!1))}},Sf=function(c,f,g,C){g!==C?(c=Jo(vl.current),g=Jo(Yr.current),f.stateNode=G(C,c,g,f),ts(f)):f.stateNode=c.stateNode}}else uu=function(){},wf=function(){},Sf=function(){};function du(c,f){if(!Zt)switch(c.tailMode){case"hidden":f=c.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?c.tail=null:g.sibling=null;break;case"collapsed":g=c.tail;for(var C=null;g!==null;)g.alternate!==null&&(C=g),g=g.sibling;C===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:C.sibling=null}}function Xn(c){var f=c.alternate!==null&&c.alternate.child===c.child,g=0,C=0;if(f)for(var S=c.child;S!==null;)g|=S.lanes|S.childLanes,C|=S.subtreeFlags&14680064,C|=S.flags&14680064,S.return=c,S=S.sibling;else for(S=c.child;S!==null;)g|=S.lanes|S.childLanes,C|=S.subtreeFlags,C|=S.flags,S.return=c,S=S.sibling;return c.subtreeFlags|=C,c.childLanes=g,f}function U8(c,f,g){var C=f.pendingProps;switch(Vg(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xn(f),null;case 1:return gr(f.type)&&Yd(),Xn(f),null;case 3:return g=f.stateNode,xl(),bt(kn),bt(Wt),o0(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(c===null||c.child===null)&&(sf(f)?ts(f):c===null||c.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,So!==null&&($0(So),So=null))),uu(c,f),Xn(f),null;case 5:n0(f),g=Jo(vl.current);var S=f.type;if(c!==null&&f.stateNode!=null)wf(c,f,S,C,g),c.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!C){if(f.stateNode===null)throw Error(i(166));return Xn(f),null}if(c=Jo(Yr.current),sf(f)){if(!Ce)throw Error(i(175));c=En(f.stateNode,f.type,f.memoizedProps,g,c,f,!tu),f.updateQueue=c,c!==null&&ts(f)}else{var P=re(S,C,g,c,f);cu(P,f,!1,!1),f.stateNode=P,le(P,S,C,g,c)&&ts(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return Xn(f),null;case 6:if(c&&f.stateNode!=null)Sf(c,f,c.memoizedProps,C);else{if(typeof C!="string"&&f.stateNode===null)throw Error(i(166));if(c=Jo(vl.current),g=Jo(Yr.current),sf(f)){if(!Ce)throw Error(i(176));if(c=f.stateNode,g=f.memoizedProps,(C=xt(c,g,f,!tu))&&(S=Ar,S!==null))switch(S.tag){case 3:Xd(S.stateNode.containerInfo,c,g,(S.mode&1)!==0);break;case 5:cl(S.type,S.memoizedProps,S.stateNode,c,g,(S.mode&1)!==0)}C&&ts(f)}else f.stateNode=G(C,c,g,f)}return Xn(f),null;case 13:if(bt(sn),C=f.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(Zt&&qr!==null&&f.mode&1&&!(f.flags&128))l2(),pl(),f.flags|=98560,S=!1;else if(S=sf(f),C!==null&&C.dehydrated!==null){if(c===null){if(!S)throw Error(i(318));if(!Ce)throw Error(i(344));if(S=f.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(i(317));ga(S,f)}else pl(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;Xn(f),S=!1}else So!==null&&($0(So),So=null),S=!0;if(!S)return f.flags&65536?f:null}return f.flags&128?(f.lanes=g,f):(g=C!==null,g!==(c!==null&&c.memoizedState!==null)&&g&&(f.child.flags|=8192,f.mode&1&&(c===null||sn.current&1?Dn===0&&(Dn=3):z0())),f.updateQueue!==null&&(f.flags|=4),Xn(f),null);case 4:return xl(),uu(c,f),c===null&&de(f.stateNode.containerInfo),Xn(f),null;case 10:return Xg(f.type._context),Xn(f),null;case 17:return gr(f.type)&&Yd(),Xn(f),null;case 19:if(bt(sn),S=f.memoizedState,S===null)return Xn(f),null;if(C=(f.flags&128)!==0,P=S.rendering,P===null)if(C)du(S,!1);else{if(Dn!==0||c!==null&&c.flags&128)for(c=f.child;c!==null;){if(P=hf(c),P!==null){for(f.flags|=128,du(S,!1),c=P.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),f.subtreeFlags=0,c=g,g=f.child;g!==null;)C=g,S=c,C.flags&=14680066,P=C.alternate,P===null?(C.childLanes=0,C.lanes=S,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=P.childLanes,C.lanes=P.lanes,C.child=P.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=P.memoizedProps,C.memoizedState=P.memoizedState,C.updateQueue=P.updateQueue,C.type=P.type,S=P.dependencies,C.dependencies=S===null?null:{lanes:S.lanes,firstContext:S.firstContext}),g=g.sibling;return kt(sn,sn.current&1|2),f.child}c=c.sibling}S.tail!==null&&Ln()>R0&&(f.flags|=128,C=!0,du(S,!1),f.lanes=4194304)}else{if(!C)if(c=hf(P),c!==null){if(f.flags|=128,C=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),du(S,!0),S.tail===null&&S.tailMode==="hidden"&&!P.alternate&&!Zt)return Xn(f),null}else 2*Ln()-S.renderingStartTime>R0&&g!==1073741824&&(f.flags|=128,C=!0,du(S,!1),f.lanes=4194304);S.isBackwards?(P.sibling=f.child,f.child=P):(c=S.last,c!==null?c.sibling=P:f.child=P,S.last=P)}return S.tail!==null?(f=S.tail,S.rendering=f,S.tail=f.sibling,S.renderingStartTime=Ln(),f.sibling=null,c=sn.current,kt(sn,C?c&1|2:c&1),f):(Xn(f),null);case 22:case 23:return L0(),g=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==g&&(f.flags|=8192),g&&f.mode&1?Nr&1073741824&&(Xn(f),fe&&f.subtreeFlags&6&&(f.flags|=8192)):Xn(f),null;case 24:return null;case 25:return null}throw Error(i(156,f.tag))}function G8(c,f){switch(Vg(f),f.tag){case 1:return gr(f.type)&&Yd(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return xl(),bt(kn),bt(Wt),o0(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return n0(f),null;case 13:if(bt(sn),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(i(340));pl()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return bt(sn),null;case 4:return xl(),null;case 10:return Xg(f.type._context),null;case 22:case 23:return L0(),null;case 24:return null;default:return null}}var kf=!1,Yn=!1,K8=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function yl(c,f){var g=c.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(C){Jt(c,f,C)}else g.current=null}function C0(c,f,g){try{g()}catch(C){Jt(c,f,C)}}var iC=!1;function q8(c,f){for(z(c.containerInfo),Ge=f;Ge!==null;)if(c=Ge,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,Ge=f;else for(;Ge!==null;){c=Ge;try{var g=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var C=g.memoizedProps,S=g.memoizedState,P=c.stateNode,N=P.getSnapshotBeforeUpdate(c.elementType===c.type?C:ko(c.type,C),S);P.__reactInternalSnapshotBeforeUpdate=N}break;case 3:fe&&Pt(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Z){Jt(c,c.return,Z)}if(f=c.sibling,f!==null){f.return=c.return,Ge=f;break}Ge=c.return}return g=iC,iC=!1,g}function fu(c,f,g){var C=f.updateQueue;if(C=C!==null?C.lastEffect:null,C!==null){var S=C=C.next;do{if((S.tag&c)===c){var P=S.destroy;S.destroy=void 0,P!==void 0&&C0(f,g,P)}S=S.next}while(S!==C)}}function _f(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&c)===c){var C=g.create;g.destroy=C()}g=g.next}while(g!==f)}}function w0(c){var f=c.ref;if(f!==null){var g=c.stateNode;switch(c.tag){case 5:c=V(g);break;default:c=g}typeof f=="function"?f(c):f.current=c}}function lC(c){var f=c.alternate;f!==null&&(c.alternate=null,lC(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&je(f)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function cC(c){return c.tag===5||c.tag===3||c.tag===4}function uC(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||cC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function S0(c,f,g){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?At(g,c,f):Ye(g,c);else if(C!==4&&(c=c.child,c!==null))for(S0(c,f,g),c=c.sibling;c!==null;)S0(c,f,g),c=c.sibling}function k0(c,f,g){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?$e(g,c,f):ve(g,c);else if(C!==4&&(c=c.child,c!==null))for(k0(c,f,g),c=c.sibling;c!==null;)k0(c,f,g),c=c.sibling}var Vn=null,_o=!1;function ns(c,f,g){for(g=g.child;g!==null;)_0(c,f,g),g=g.sibling}function _0(c,f,g){if(Yo&&typeof Yo.onCommitFiberUnmount=="function")try{Yo.onCommitFiberUnmount(tf,g)}catch{}switch(g.tag){case 5:Yn||yl(g,f);case 6:if(fe){var C=Vn,S=_o;Vn=null,ns(c,f,g),Vn=C,_o=S,Vn!==null&&(_o?ze(Vn,g.stateNode):ke(Vn,g.stateNode))}else ns(c,f,g);break;case 18:fe&&Vn!==null&&(_o?Mn(Vn,g.stateNode):Rg(Vn,g.stateNode));break;case 4:fe?(C=Vn,S=_o,Vn=g.stateNode.containerInfo,_o=!0,ns(c,f,g),Vn=C,_o=S):(ge&&(C=g.stateNode.containerInfo,S=In(C),Qt(C,S)),ns(c,f,g));break;case 0:case 11:case 14:case 15:if(!Yn&&(C=g.updateQueue,C!==null&&(C=C.lastEffect,C!==null))){S=C=C.next;do{var P=S,N=P.destroy;P=P.tag,N!==void 0&&(P&2||P&4)&&C0(g,f,N),S=S.next}while(S!==C)}ns(c,f,g);break;case 1:if(!Yn&&(yl(g,f),C=g.stateNode,typeof C.componentWillUnmount=="function"))try{C.props=g.memoizedProps,C.state=g.memoizedState,C.componentWillUnmount()}catch(Z){Jt(g,f,Z)}ns(c,f,g);break;case 21:ns(c,f,g);break;case 22:g.mode&1?(Yn=(C=Yn)||g.memoizedState!==null,ns(c,f,g),Yn=C):ns(c,f,g);break;default:ns(c,f,g)}}function dC(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var g=c.stateNode;g===null&&(g=c.stateNode=new K8),f.forEach(function(C){var S=r7.bind(null,c,C);g.has(C)||(g.add(C),C.then(S,S))})}}function jo(c,f){var g=f.deletions;if(g!==null)for(var C=0;C<g.length;C++){var S=g[C];try{var P=c,N=f;if(fe){var Z=N;e:for(;Z!==null;){switch(Z.tag){case 5:Vn=Z.stateNode,_o=!1;break e;case 3:Vn=Z.stateNode.containerInfo,_o=!0;break e;case 4:Vn=Z.stateNode.containerInfo,_o=!0;break e}Z=Z.return}if(Vn===null)throw Error(i(160));_0(P,N,S),Vn=null,_o=!1}else _0(P,N,S);var ue=S.alternate;ue!==null&&(ue.return=null),S.return=null}catch(Ee){Jt(S,f,Ee)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)fC(f,c),f=f.sibling}function fC(c,f){var g=c.alternate,C=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(jo(f,c),rs(c),C&4){try{fu(3,c,c.return),_f(3,c)}catch(He){Jt(c,c.return,He)}try{fu(5,c,c.return)}catch(He){Jt(c,c.return,He)}}break;case 1:jo(f,c),rs(c),C&512&&g!==null&&yl(g,g.return);break;case 5:if(jo(f,c),rs(c),C&512&&g!==null&&yl(g,g.return),fe){if(c.flags&32){var S=c.stateNode;try{Le(S)}catch(He){Jt(c,c.return,He)}}if(C&4&&(S=c.stateNode,S!=null)){var P=c.memoizedProps;if(g=g!==null?g.memoizedProps:P,C=c.type,f=c.updateQueue,c.updateQueue=null,f!==null)try{Me(S,f,C,g,P,c)}catch(He){Jt(c,c.return,He)}}}break;case 6:if(jo(f,c),rs(c),C&4&&fe){if(c.stateNode===null)throw Error(i(162));S=c.stateNode,P=c.memoizedProps,g=g!==null?g.memoizedProps:P;try{ot(S,g,P)}catch(He){Jt(c,c.return,He)}}break;case 3:if(jo(f,c),rs(c),C&4){if(fe&&Ce&&g!==null&&g.memoizedState.isDehydrated)try{qd(f.containerInfo)}catch(He){Jt(c,c.return,He)}if(ge){S=f.containerInfo,P=f.pendingChildren;try{Qt(S,P)}catch(He){Jt(c,c.return,He)}}}break;case 4:if(jo(f,c),rs(c),C&4&&ge){P=c.stateNode,S=P.containerInfo,P=P.pendingChildren;try{Qt(S,P)}catch(He){Jt(c,c.return,He)}}break;case 13:jo(f,c),rs(c),S=c.child,S.flags&8192&&(P=S.memoizedState!==null,S.stateNode.isHidden=P,!P||S.alternate!==null&&S.alternate.memoizedState!==null||(D0=Ln())),C&4&&dC(c);break;case 22:var N=g!==null&&g.memoizedState!==null;if(c.mode&1?(Yn=(g=Yn)||N,jo(f,c),Yn=g):jo(f,c),rs(c),C&8192){if(g=c.memoizedState!==null,(c.stateNode.isHidden=g)&&!N&&c.mode&1)for(Ge=c,C=c.child;C!==null;){for(f=Ge=C;Ge!==null;){N=Ge;var Z=N.child;switch(N.tag){case 0:case 11:case 14:case 15:fu(4,N,N.return);break;case 1:yl(N,N.return);var ue=N.stateNode;if(typeof ue.componentWillUnmount=="function"){var Ee=N,Ke=N.return;try{var pt=Ee;ue.props=pt.memoizedProps,ue.state=pt.memoizedState,ue.componentWillUnmount()}catch(He){Jt(Ee,Ke,He)}}break;case 5:yl(N,N.return);break;case 22:if(N.memoizedState!==null){mC(f);continue}}Z!==null?(Z.return=N,Ge=Z):mC(f)}C=C.sibling}if(fe){e:if(C=null,fe)for(f=c;;){if(f.tag===5){if(C===null){C=f;try{S=f.stateNode,g?We(S):xn(f.stateNode,f.memoizedProps)}catch(He){Jt(c,c.return,He)}}}else if(f.tag===6){if(C===null)try{P=f.stateNode,g?ct(P):jt(P,f.memoizedProps)}catch(He){Jt(c,c.return,He)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===c)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break e;for(;f.sibling===null;){if(f.return===null||f.return===c)break e;C===f&&(C=null),f=f.return}C===f&&(C=null),f.sibling.return=f.return,f=f.sibling}}}break;case 19:jo(f,c),rs(c),C&4&&dC(c);break;case 21:break;default:jo(f,c),rs(c)}}function rs(c){var f=c.flags;if(f&2){try{if(fe){e:{for(var g=c.return;g!==null;){if(cC(g)){var C=g;break e}g=g.return}throw Error(i(160))}switch(C.tag){case 5:var S=C.stateNode;C.flags&32&&(Le(S),C.flags&=-33);var P=uC(c);k0(c,P,S);break;case 3:case 4:var N=C.stateNode.containerInfo,Z=uC(c);S0(c,Z,N);break;default:throw Error(i(161))}}}catch(ue){Jt(c,c.return,ue)}c.flags&=-3}f&4096&&(c.flags&=-4097)}function X8(c,f,g){Ge=c,pC(c)}function pC(c,f,g){for(var C=(c.mode&1)!==0;Ge!==null;){var S=Ge,P=S.child;if(S.tag===22&&C){var N=S.memoizedState!==null||kf;if(!N){var Z=S.alternate,ue=Z!==null&&Z.memoizedState!==null||Yn;Z=kf;var Ee=Yn;if(kf=N,(Yn=ue)&&!Ee)for(Ge=S;Ge!==null;)N=Ge,ue=N.child,N.tag===22&&N.memoizedState!==null?gC(S):ue!==null?(ue.return=N,Ge=ue):gC(S);for(;P!==null;)Ge=P,pC(P),P=P.sibling;Ge=S,kf=Z,Yn=Ee}hC(c)}else S.subtreeFlags&8772&&P!==null?(P.return=S,Ge=P):hC(c)}}function hC(c){for(;Ge!==null;){var f=Ge;if(f.flags&8772){var g=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:Yn||_f(5,f);break;case 1:var C=f.stateNode;if(f.flags&4&&!Yn)if(g===null)C.componentDidMount();else{var S=f.elementType===f.type?g.memoizedProps:ko(f.type,g.memoizedProps);C.componentDidUpdate(S,g.memoizedState,C.__reactInternalSnapshotBeforeUpdate)}var P=f.updateQueue;P!==null&&p2(f,P,C);break;case 3:var N=f.updateQueue;if(N!==null){if(g=null,f.child!==null)switch(f.child.tag){case 5:g=V(f.child.stateNode);break;case 1:g=f.child.stateNode}p2(f,N,g)}break;case 5:var Z=f.stateNode;g===null&&f.flags&4&<(Z,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(Ce&&f.memoizedState===null){var ue=f.alternate;if(ue!==null){var Ee=ue.memoizedState;if(Ee!==null){var Ke=Ee.dehydrated;Ke!==null&&Dg(Ke)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}Yn||f.flags&512&&w0(f)}catch(pt){Jt(f,f.return,pt)}}if(f===c){Ge=null;break}if(g=f.sibling,g!==null){g.return=f.return,Ge=g;break}Ge=f.return}}function mC(c){for(;Ge!==null;){var f=Ge;if(f===c){Ge=null;break}var g=f.sibling;if(g!==null){g.return=f.return,Ge=g;break}Ge=f.return}}function gC(c){for(;Ge!==null;){var f=Ge;try{switch(f.tag){case 0:case 11:case 15:var g=f.return;try{_f(4,f)}catch(ue){Jt(f,g,ue)}break;case 1:var C=f.stateNode;if(typeof C.componentDidMount=="function"){var S=f.return;try{C.componentDidMount()}catch(ue){Jt(f,S,ue)}}var P=f.return;try{w0(f)}catch(ue){Jt(f,P,ue)}break;case 5:var N=f.return;try{w0(f)}catch(ue){Jt(f,N,ue)}}}catch(ue){Jt(f,f.return,ue)}if(f===c){Ge=null;break}var Z=f.sibling;if(Z!==null){Z.return=f.return,Ge=Z;break}Ge=f.return}}var jf=0,Pf=1,If=2,Ef=3,Mf=4;if(typeof Symbol=="function"&&Symbol.for){var pu=Symbol.for;jf=pu("selector.component"),Pf=pu("selector.has_pseudo_class"),If=pu("selector.role"),Ef=pu("selector.test_id"),Mf=pu("selector.text")}function j0(c){var f=me(c);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(i(364));return f}if(c=wt(c),c===null)throw Error(i(362));return c.stateNode.current}function P0(c,f){switch(f.$$typeof){case jf:if(c.type===f.value)return!0;break;case Pf:e:{f=f.value,c=[c,0];for(var g=0;g<c.length;){var C=c[g++],S=c[g++],P=f[S];if(C.tag!==5||!xe(C)){for(;P!=null&&P0(C,P);)S++,P=f[S];if(S===f.length){f=!0;break e}else for(C=C.child;C!==null;)c.push(C,S),C=C.sibling}}f=!1}return f;case If:if(c.tag===5&&Re(c.stateNode,f.value))return!0;break;case Mf:if((c.tag===5||c.tag===6)&&(c=tt(c),c!==null&&0<=c.indexOf(f.value)))return!0;break;case Ef:if(c.tag===5&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function I0(c){switch(c.$$typeof){case jf:return"<"+(O(c.value)||"Unknown")+">";case Pf:return":has("+(I0(c)||"")+")";case If:return'[role="'+c.value+'"]';case Mf:return'"'+c.value+'"';case Ef:return'[data-testname="'+c.value+'"]';default:throw Error(i(365))}}function vC(c,f){var g=[];c=[c,0];for(var C=0;C<c.length;){var S=c[C++],P=c[C++],N=f[P];if(S.tag!==5||!xe(S)){for(;N!=null&&P0(S,N);)P++,N=f[P];if(P===f.length)g.push(S);else for(S=S.child;S!==null;)c.push(S,P),S=S.sibling}}return g}function E0(c,f){if(!Ue)throw Error(i(363));c=j0(c),c=vC(c,f),f=[],c=Array.from(c);for(var g=0;g<c.length;){var C=c[g++];if(C.tag===5)xe(C)||f.push(C.stateNode);else for(C=C.child;C!==null;)c.push(C),C=C.sibling}return f}var Y8=Math.ceil,Of=l.ReactCurrentDispatcher,M0=l.ReactCurrentOwner,bn=l.ReactCurrentBatchConfig,yt=0,Fn=null,_n=null,Wn=0,Nr=0,Cl=St(0),Dn=0,hu=null,di=0,Df=0,O0=0,mu=null,xr=null,D0=0,R0=1/0,Ts=null;function wl(){R0=Ln()+500}var Rf=!1,A0=null,ya=null,Af=!1,Ca=null,Nf=0,gu=0,N0=null,Tf=-1,$f=0;function Qn(){return yt&6?Ln():Tf!==-1?Tf:Tf=Ln()}function wa(c){return c.mode&1?yt&2&&Wn!==0?Wn&-Wn:D8.transition!==null?($f===0&&($f=e2()),$f):(c=Et,c!==0?c:De()):1}function Zr(c,f,g,C){if(50<gu)throw gu=0,N0=null,Error(i(185));eu(c,g,C),(!(yt&2)||c!==Fn)&&(c===Fn&&(!(yt&2)&&(Df|=g),Dn===4&&Sa(c,Wn)),br(c,C),g===1&&yt===0&&!(f.mode&1)&&(wl(),nf&&Qo()))}function br(c,f){var g=c.callbackNode;S8(c,f);var C=ef(c,c===Fn?Wn:0);if(C===0)g!==null&&n2(g),c.callbackNode=null,c.callbackPriority=0;else if(f=C&-C,c.callbackPriority!==f){if(g!=null&&n2(g),f===1)c.tag===0?O8(bC.bind(null,c)):r2(bC.bind(null,c)),Be?rt(function(){!(yt&6)&&Qo()}):Lg(zg,Qo),g=null;else{switch(t2(C)){case 1:g=zg;break;case 4:g=P8;break;case 16:g=Fg;break;case 536870912:g=I8;break;default:g=Fg}g=IC(g,xC.bind(null,c))}c.callbackPriority=f,c.callbackNode=g}}function xC(c,f){if(Tf=-1,$f=0,yt&6)throw Error(i(327));var g=c.callbackNode;if(hi()&&c.callbackNode!==g)return null;var C=ef(c,c===Fn?Wn:0);if(C===0)return null;if(C&30||C&c.expiredLanes||f)f=Lf(c,C);else{f=C;var S=yt;yt|=2;var P=wC();(Fn!==c||Wn!==f)&&(Ts=null,wl(),fi(c,f));do try{J8();break}catch(Z){CC(c,Z)}while(1);qg(),Of.current=P,yt=S,_n!==null?f=0:(Fn=null,Wn=0,f=Dn)}if(f!==0){if(f===2&&(S=Ng(c),S!==0&&(C=S,f=T0(c,S))),f===1)throw g=hu,fi(c,0),Sa(c,C),br(c,Ln()),g;if(f===6)Sa(c,C);else{if(S=c.current.alternate,!(C&30)&&!Q8(S)&&(f=Lf(c,C),f===2&&(P=Ng(c),P!==0&&(C=P,f=T0(c,P))),f===1))throw g=hu,fi(c,0),Sa(c,C),br(c,Ln()),g;switch(c.finishedWork=S,c.finishedLanes=C,f){case 0:case 1:throw Error(i(345));case 2:pi(c,xr,Ts);break;case 3:if(Sa(c,C),(C&130023424)===C&&(f=D0+500-Ln(),10<f)){if(ef(c,0)!==0)break;if(S=c.suspendedLanes,(S&C)!==C){Qn(),c.pingedLanes|=c.suspendedLanes&S;break}c.timeoutHandle=te(pi.bind(null,c,xr,Ts),f);break}pi(c,xr,Ts);break;case 4:if(Sa(c,C),(C&4194240)===C)break;for(f=c.eventTimes,S=-1;0<C;){var N=31-Co(C);P=1<<N,N=f[N],N>S&&(S=N),C&=~P}if(C=S,C=Ln()-C,C=(120>C?120:480>C?480:1080>C?1080:1920>C?1920:3e3>C?3e3:4320>C?4320:1960*Y8(C/1960))-C,10<C){c.timeoutHandle=te(pi.bind(null,c,xr,Ts),C);break}pi(c,xr,Ts);break;case 5:pi(c,xr,Ts);break;default:throw Error(i(329))}}}return br(c,Ln()),c.callbackNode===g?xC.bind(null,c):null}function T0(c,f){var g=mu;return c.current.memoizedState.isDehydrated&&(fi(c,f).flags|=256),c=Lf(c,f),c!==2&&(f=xr,xr=g,f!==null&&$0(f)),c}function $0(c){xr===null?xr=c:xr.push.apply(xr,c)}function Q8(c){for(var f=c;;){if(f.flags&16384){var g=f.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var C=0;C<g.length;C++){var S=g[C],P=S.getSnapshot;S=S.value;try{if(!wo(P(),S))return!1}catch{return!1}}}if(g=f.child,f.subtreeFlags&16384&&g!==null)g.return=f,f=g;else{if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Sa(c,f){for(f&=~O0,f&=~Df,c.suspendedLanes|=f,c.pingedLanes&=~f,c=c.expirationTimes;0<f;){var g=31-Co(f),C=1<<g;c[g]=-1,f&=~C}}function bC(c){if(yt&6)throw Error(i(327));hi();var f=ef(c,0);if(!(f&1))return br(c,Ln()),null;var g=Lf(c,f);if(c.tag!==0&&g===2){var C=Ng(c);C!==0&&(f=C,g=T0(c,C))}if(g===1)throw g=hu,fi(c,0),Sa(c,f),br(c,Ln()),g;if(g===6)throw Error(i(345));return c.finishedWork=c.current.alternate,c.finishedLanes=f,pi(c,xr,Ts),br(c,Ln()),null}function yC(c){Ca!==null&&Ca.tag===0&&!(yt&6)&&hi();var f=yt;yt|=1;var g=bn.transition,C=Et;try{if(bn.transition=null,Et=1,c)return c()}finally{Et=C,bn.transition=g,yt=f,!(yt&6)&&Qo()}}function L0(){Nr=Cl.current,bt(Cl)}function fi(c,f){c.finishedWork=null,c.finishedLanes=0;var g=c.timeoutHandle;if(g!==oe&&(c.timeoutHandle=oe,ae(g)),_n!==null)for(g=_n.return;g!==null;){var C=g;switch(Vg(C),C.tag){case 1:C=C.type.childContextTypes,C!=null&&Yd();break;case 3:xl(),bt(kn),bt(Wt),o0();break;case 5:n0(C);break;case 4:xl();break;case 13:bt(sn);break;case 19:bt(sn);break;case 10:Xg(C.type._context);break;case 22:case 23:L0()}g=g.return}if(Fn=c,_n=c=ka(c.current,null),Wn=Nr=f,Dn=0,hu=null,O0=Df=di=0,xr=mu=null,ci!==null){for(f=0;f<ci.length;f++)if(g=ci[f],C=g.interleaved,C!==null){g.interleaved=null;var S=C.next,P=g.pending;if(P!==null){var N=P.next;P.next=S,C.next=N}g.pending=C}ci=null}return c}function CC(c,f){do{var g=_n;try{if(qg(),mf.current=bf,gf){for(var C=an.memoizedState;C!==null;){var S=C.queue;S!==null&&(S.pending=null),C=C.next}gf=!1}if(ui=0,zn=On=an=null,su=!1,au=0,M0.current=null,g===null||g.return===null){Dn=1,hu=f,_n=null;break}e:{var P=c,N=g.return,Z=g,ue=f;if(f=Wn,Z.flags|=32768,ue!==null&&typeof ue=="object"&&typeof ue.then=="function"){var Ee=ue,Ke=Z,pt=Ke.tag;if(!(Ke.mode&1)&&(pt===0||pt===11||pt===15)){var He=Ke.alternate;He?(Ke.updateQueue=He.updateQueue,Ke.memoizedState=He.memoizedState,Ke.lanes=He.lanes):(Ke.updateQueue=null,Ke.memoizedState=null)}var qt=G2(N);if(qt!==null){qt.flags&=-257,K2(qt,N,Z,P,f),qt.mode&1&&U2(P,Ee,f),f=qt,ue=Ee;var Bt=f.updateQueue;if(Bt===null){var yr=new Set;yr.add(ue),f.updateQueue=yr}else Bt.add(ue);break e}else{if(!(f&1)){U2(P,Ee,f),z0();break e}ue=Error(i(426))}}else if(Zt&&Z.mode&1){var $s=G2(N);if($s!==null){!($s.flags&65536)&&($s.flags|=256),K2($s,N,Z,P,f),Gg(bl(ue,Z));break e}}P=ue=bl(ue,Z),Dn!==4&&(Dn=2),mu===null?mu=[P]:mu.push(P),P=N;do{switch(P.tag){case 3:P.flags|=65536,f&=-f,P.lanes|=f;var ce=V2(P,ue,f);f2(P,ce);break e;case 1:Z=ue;var ne=P.type,he=P.stateNode;if(!(P.flags&128)&&(typeof ne.getDerivedStateFromError=="function"||he!==null&&typeof he.componentDidCatch=="function"&&(ya===null||!ya.has(he)))){P.flags|=65536,f&=-f,P.lanes|=f;var Ve=W2(P,Z,f);f2(P,Ve);break e}}P=P.return}while(P!==null)}kC(g)}catch(nt){f=nt,_n===g&&g!==null&&(_n=g=g.return);continue}break}while(1)}function wC(){var c=Of.current;return Of.current=bf,c===null?bf:c}function z0(){(Dn===0||Dn===3||Dn===2)&&(Dn=4),Fn===null||!(di&268435455)&&!(Df&268435455)||Sa(Fn,Wn)}function Lf(c,f){var g=yt;yt|=2;var C=wC();(Fn!==c||Wn!==f)&&(Ts=null,fi(c,f));do try{Z8();break}catch(S){CC(c,S)}while(1);if(qg(),yt=g,Of.current=C,_n!==null)throw Error(i(261));return Fn=null,Wn=0,Dn}function Z8(){for(;_n!==null;)SC(_n)}function J8(){for(;_n!==null&&!_8();)SC(_n)}function SC(c){var f=PC(c.alternate,c,Nr);c.memoizedProps=c.pendingProps,f===null?kC(c):_n=f,M0.current=null}function kC(c){var f=c;do{var g=f.alternate;if(c=f.return,f.flags&32768){if(g=G8(g,f),g!==null){g.flags&=32767,_n=g;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Dn=6,_n=null;return}}else if(g=U8(g,f,Nr),g!==null){_n=g;return}if(f=f.sibling,f!==null){_n=f;return}_n=f=c}while(f!==null);Dn===0&&(Dn=5)}function pi(c,f,g){var C=Et,S=bn.transition;try{bn.transition=null,Et=1,e7(c,f,g,C)}finally{bn.transition=S,Et=C}return null}function e7(c,f,g,C){do hi();while(Ca!==null);if(yt&6)throw Error(i(327));g=c.finishedWork;var S=c.finishedLanes;if(g===null)return null;if(c.finishedWork=null,c.finishedLanes=0,g===c.current)throw Error(i(177));c.callbackNode=null,c.callbackPriority=0;var P=g.lanes|g.childLanes;if(k8(c,P),c===Fn&&(_n=Fn=null,Wn=0),!(g.subtreeFlags&2064)&&!(g.flags&2064)||Af||(Af=!0,IC(Fg,function(){return hi(),null})),P=(g.flags&15990)!==0,g.subtreeFlags&15990||P){P=bn.transition,bn.transition=null;var N=Et;Et=1;var Z=yt;yt|=4,M0.current=null,q8(c,g),fC(g,c),K(c.containerInfo),c.current=g,X8(g),j8(),yt=Z,Et=N,bn.transition=P}else c.current=g;if(Af&&(Af=!1,Ca=c,Nf=S),P=c.pendingLanes,P===0&&(ya=null),E8(g.stateNode),br(c,Ln()),f!==null)for(C=c.onRecoverableError,g=0;g<f.length;g++)S=f[g],C(S.value,{componentStack:S.stack,digest:S.digest});if(Rf)throw Rf=!1,c=A0,A0=null,c;return Nf&1&&c.tag!==0&&hi(),P=c.pendingLanes,P&1?c===N0?gu++:(gu=0,N0=c):gu=0,Qo(),null}function hi(){if(Ca!==null){var c=t2(Nf),f=bn.transition,g=Et;try{if(bn.transition=null,Et=16>c?16:c,Ca===null)var C=!1;else{if(c=Ca,Ca=null,Nf=0,yt&6)throw Error(i(331));var S=yt;for(yt|=4,Ge=c.current;Ge!==null;){var P=Ge,N=P.child;if(Ge.flags&16){var Z=P.deletions;if(Z!==null){for(var ue=0;ue<Z.length;ue++){var Ee=Z[ue];for(Ge=Ee;Ge!==null;){var Ke=Ge;switch(Ke.tag){case 0:case 11:case 15:fu(8,Ke,P)}var pt=Ke.child;if(pt!==null)pt.return=Ke,Ge=pt;else for(;Ge!==null;){Ke=Ge;var He=Ke.sibling,qt=Ke.return;if(lC(Ke),Ke===Ee){Ge=null;break}if(He!==null){He.return=qt,Ge=He;break}Ge=qt}}}var Bt=P.alternate;if(Bt!==null){var yr=Bt.child;if(yr!==null){Bt.child=null;do{var $s=yr.sibling;yr.sibling=null,yr=$s}while(yr!==null)}}Ge=P}}if(P.subtreeFlags&2064&&N!==null)N.return=P,Ge=N;else e:for(;Ge!==null;){if(P=Ge,P.flags&2048)switch(P.tag){case 0:case 11:case 15:fu(9,P,P.return)}var ce=P.sibling;if(ce!==null){ce.return=P.return,Ge=ce;break e}Ge=P.return}}var ne=c.current;for(Ge=ne;Ge!==null;){N=Ge;var he=N.child;if(N.subtreeFlags&2064&&he!==null)he.return=N,Ge=he;else e:for(N=ne;Ge!==null;){if(Z=Ge,Z.flags&2048)try{switch(Z.tag){case 0:case 11:case 15:_f(9,Z)}}catch(nt){Jt(Z,Z.return,nt)}if(Z===N){Ge=null;break e}var Ve=Z.sibling;if(Ve!==null){Ve.return=Z.return,Ge=Ve;break e}Ge=Z.return}}if(yt=S,Qo(),Yo&&typeof Yo.onPostCommitFiberRoot=="function")try{Yo.onPostCommitFiberRoot(tf,c)}catch{}C=!0}return C}finally{Et=g,bn.transition=f}}return!1}function _C(c,f,g){f=bl(g,f),f=V2(c,f,1),c=ba(c,f,1),f=Qn(),c!==null&&(eu(c,1,f),br(c,f))}function Jt(c,f,g){if(c.tag===3)_C(c,c,g);else for(;f!==null;){if(f.tag===3){_C(f,c,g);break}else if(f.tag===1){var C=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(ya===null||!ya.has(C))){c=bl(g,c),c=W2(f,c,1),f=ba(f,c,1),c=Qn(),f!==null&&(eu(f,1,c),br(f,c));break}}f=f.return}}function t7(c,f,g){var C=c.pingCache;C!==null&&C.delete(f),f=Qn(),c.pingedLanes|=c.suspendedLanes&g,Fn===c&&(Wn&g)===g&&(Dn===4||Dn===3&&(Wn&130023424)===Wn&&500>Ln()-D0?fi(c,0):O0|=g),br(c,f)}function jC(c,f){f===0&&(c.mode&1?(f=Jd,Jd<<=1,!(Jd&130023424)&&(Jd=4194304)):f=1);var g=Qn();c=Zo(c,f),c!==null&&(eu(c,f,g),br(c,g))}function n7(c){var f=c.memoizedState,g=0;f!==null&&(g=f.retryLane),jC(c,g)}function r7(c,f){var g=0;switch(c.tag){case 13:var C=c.stateNode,S=c.memoizedState;S!==null&&(g=S.retryLane);break;case 19:C=c.stateNode;break;default:throw Error(i(314))}C!==null&&C.delete(f),jC(c,g)}var PC;PC=function(c,f,g){if(c!==null)if(c.memoizedProps!==f.pendingProps||kn.current)vr=!0;else{if(!(c.lanes&g)&&!(f.flags&128))return vr=!1,W8(c,f,g);vr=!!(c.flags&131072)}else vr=!1,Zt&&f.flags&1048576&&o2(f,of,f.index);switch(f.lanes=0,f.tag){case 2:var C=f.type;Cf(c,f),c=f.pendingProps;var S=ul(f,Wt.current);ml(f,g),S=i0(null,f,C,c,S,g);var P=l0();return f.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,gr(C)?(P=!0,Qd(f)):P=!1,f.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Zg(f),S.updater=ff,f.stateNode=S,S._reactInternals=f,e0(f,C,c,g),f=g0(null,f,C,!0,P,g)):(f.tag=0,Zt&&P&&Hg(f),cr(null,f,S,g),f=f.child),f;case 16:C=f.elementType;e:{switch(Cf(c,f),c=f.pendingProps,S=C._init,C=S(C._payload),f.type=C,S=f.tag=s7(C),c=ko(C,c),S){case 0:f=m0(null,f,C,c,g);break e;case 1:f=J2(null,f,C,c,g);break e;case 11:f=q2(null,f,C,c,g);break e;case 14:f=X2(null,f,C,ko(C.type,c),g);break e}throw Error(i(306,C,""))}return f;case 0:return C=f.type,S=f.pendingProps,S=f.elementType===C?S:ko(C,S),m0(c,f,C,S,g);case 1:return C=f.type,S=f.pendingProps,S=f.elementType===C?S:ko(C,S),J2(c,f,C,S,g);case 3:e:{if(eC(f),c===null)throw Error(i(387));C=f.pendingProps,P=f.memoizedState,S=P.element,d2(c,f),df(f,C,null,g);var N=f.memoizedState;if(C=N.element,Ce&&P.isDehydrated)if(P={element:C,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},f.updateQueue.baseState=P,f.memoizedState=P,f.flags&256){S=bl(Error(i(423)),f),f=tC(c,f,C,g,S);break e}else if(C!==S){S=bl(Error(i(424)),f),f=tC(c,f,C,g,S);break e}else for(Ce&&(qr=qe(f.stateNode.containerInfo),Ar=f,Zt=!0,So=null,tu=!1),g=y2(f,null,C,g),f.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(pl(),C===S){f=Ns(c,f,g);break e}cr(c,f,C,g)}f=f.child}return f;case 5:return C2(f),c===null&&Ug(f),C=f.type,S=f.pendingProps,P=c!==null?c.memoizedProps:null,N=S.children,W(C,S)?N=null:P!==null&&W(C,P)&&(f.flags|=32),Z2(c,f),cr(c,f,N,g),f.child;case 6:return c===null&&Ug(f),null;case 13:return nC(c,f,g);case 4:return t0(f,f.stateNode.containerInfo),C=f.pendingProps,c===null?f.child=gl(f,null,C,g):cr(c,f,C,g),f.child;case 11:return C=f.type,S=f.pendingProps,S=f.elementType===C?S:ko(C,S),q2(c,f,C,S,g);case 7:return cr(c,f,f.pendingProps,g),f.child;case 8:return cr(c,f,f.pendingProps.children,g),f.child;case 12:return cr(c,f,f.pendingProps.children,g),f.child;case 10:e:{if(C=f.type._context,S=f.pendingProps,P=f.memoizedProps,N=S.value,c2(f,C,N),P!==null)if(wo(P.value,N)){if(P.children===S.children&&!kn.current){f=Ns(c,f,g);break e}}else for(P=f.child,P!==null&&(P.return=f);P!==null;){var Z=P.dependencies;if(Z!==null){N=P.child;for(var ue=Z.firstContext;ue!==null;){if(ue.context===C){if(P.tag===1){ue=As(-1,g&-g),ue.tag=2;var Ee=P.updateQueue;if(Ee!==null){Ee=Ee.shared;var Ke=Ee.pending;Ke===null?ue.next=ue:(ue.next=Ke.next,Ke.next=ue),Ee.pending=ue}}P.lanes|=g,ue=P.alternate,ue!==null&&(ue.lanes|=g),Yg(P.return,g,f),Z.lanes|=g;break}ue=ue.next}}else if(P.tag===10)N=P.type===f.type?null:P.child;else if(P.tag===18){if(N=P.return,N===null)throw Error(i(341));N.lanes|=g,Z=N.alternate,Z!==null&&(Z.lanes|=g),Yg(N,g,f),N=P.sibling}else N=P.child;if(N!==null)N.return=P;else for(N=P;N!==null;){if(N===f){N=null;break}if(P=N.sibling,P!==null){P.return=N.return,N=P;break}N=N.return}P=N}cr(c,f,S.children,g),f=f.child}return f;case 9:return S=f.type,C=f.pendingProps.children,ml(f,g),S=Xr(S),C=C(S),f.flags|=1,cr(c,f,C,g),f.child;case 14:return C=f.type,S=ko(C,f.pendingProps),S=ko(C.type,S),X2(c,f,C,S,g);case 15:return Y2(c,f,f.type,f.pendingProps,g);case 17:return C=f.type,S=f.pendingProps,S=f.elementType===C?S:ko(C,S),Cf(c,f),f.tag=1,gr(C)?(c=!0,Qd(f)):c=!1,ml(f,g),g2(f,C,S),e0(f,C,S,g),g0(null,f,C,!0,c,g);case 19:return oC(c,f,g);case 22:return Q2(c,f,g)}throw Error(i(156,f.tag))};function IC(c,f){return Lg(c,f)}function o7(c,f,g,C){this.tag=c,this.key=g,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=C,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jr(c,f,g,C){return new o7(c,f,g,C)}function F0(c){return c=c.prototype,!(!c||!c.isReactComponent)}function s7(c){if(typeof c=="function")return F0(c)?1:0;if(c!=null){if(c=c.$$typeof,c===b)return 11;if(c===_)return 14}return 2}function ka(c,f){var g=c.alternate;return g===null?(g=Jr(c.tag,f,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=f,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&14680064,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,f=c.dependencies,g.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g}function zf(c,f,g,C,S,P){var N=2;if(C=c,typeof c=="function")F0(c)&&(N=1);else if(typeof c=="string")N=5;else e:switch(c){case h:return mi(g.children,S,P,f);case m:N=8,S|=8;break;case v:return c=Jr(12,g,f,S|2),c.elementType=v,c.lanes=P,c;case w:return c=Jr(13,g,f,S),c.elementType=w,c.lanes=P,c;case k:return c=Jr(19,g,f,S),c.elementType=k,c.lanes=P,c;case I:return Ff(g,S,P,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case x:N=10;break e;case y:N=9;break e;case b:N=11;break e;case _:N=14;break e;case j:N=16,C=null;break e}throw Error(i(130,c==null?c:typeof c,""))}return f=Jr(N,g,f,S),f.elementType=c,f.type=C,f.lanes=P,f}function mi(c,f,g,C){return c=Jr(7,c,C,f),c.lanes=g,c}function Ff(c,f,g,C){return c=Jr(22,c,C,f),c.elementType=I,c.lanes=g,c.stateNode={isHidden:!1},c}function B0(c,f,g){return c=Jr(6,c,null,f),c.lanes=g,c}function H0(c,f,g){return f=Jr(4,c.children!==null?c.children:[],c.key,f),f.lanes=g,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function a7(c,f,g,C,S){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=oe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Tg(0),this.expirationTimes=Tg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tg(0),this.identifierPrefix=C,this.onRecoverableError=S,Ce&&(this.mutableSourceEagerHydrationData=null)}function EC(c,f,g,C,S,P,N,Z,ue){return c=new a7(c,f,g,Z,ue),f===1?(f=1,P===!0&&(f|=8)):f=0,P=Jr(3,null,null,f),c.current=P,P.stateNode=c,P.memoizedState={element:C,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zg(P),c}function MC(c){if(!c)return Kn;c=c._reactInternals;e:{if(A(c)!==c||c.tag!==1)throw Error(i(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(gr(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(i(171))}if(c.tag===1){var g=c.type;if(gr(g))return Zy(c,g,f)}return f}function OC(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(i(188)):(c=Object.keys(c).join(","),Error(i(268,c)));return c=X(f),c===null?null:c.stateNode}function DC(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g<f?g:f}}function Bf(c,f){DC(c,f),(c=c.alternate)&&DC(c,f)}function i7(c){return c=X(c),c===null?null:c.stateNode}function l7(){return null}return n.attemptContinuousHydration=function(c){if(c.tag===13){var f=Zo(c,134217728);if(f!==null){var g=Qn();Zr(f,c,134217728,g)}Bf(c,134217728)}},n.attemptDiscreteHydration=function(c){if(c.tag===13){var f=Zo(c,1);if(f!==null){var g=Qn();Zr(f,c,1,g)}Bf(c,1)}},n.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var f=wa(c),g=Zo(c,f);if(g!==null){var C=Qn();Zr(g,c,f,C)}Bf(c,f)}},n.attemptSynchronousHydration=function(c){switch(c.tag){case 3:var f=c.stateNode;if(f.current.memoizedState.isDehydrated){var g=Jc(f.pendingLanes);g!==0&&($g(f,g|1),br(f,Ln()),!(yt&6)&&(wl(),Qo()))}break;case 13:yC(function(){var C=Zo(c,1);if(C!==null){var S=Qn();Zr(C,c,1,S)}}),Bf(c,1)}},n.batchedUpdates=function(c,f){var g=yt;yt|=1;try{return c(f)}finally{yt=g,yt===0&&(wl(),nf&&Qo())}},n.createComponentSelector=function(c){return{$$typeof:jf,value:c}},n.createContainer=function(c,f,g,C,S,P,N){return EC(c,f,!1,null,g,C,S,P,N)},n.createHasPseudoClassSelector=function(c){return{$$typeof:Pf,value:c}},n.createHydrationContainer=function(c,f,g,C,S,P,N,Z,ue){return c=EC(g,C,!0,c,S,P,N,Z,ue),c.context=MC(null),g=c.current,C=Qn(),S=wa(g),P=As(C,S),P.callback=f??null,ba(g,P,S),c.current.lanes=S,eu(c,S,C),br(c,C),c},n.createPortal=function(c,f,g){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:C==null?null:""+C,children:c,containerInfo:f,implementation:g}},n.createRoleSelector=function(c){return{$$typeof:If,value:c}},n.createTestNameSelector=function(c){return{$$typeof:Ef,value:c}},n.createTextSelector=function(c){return{$$typeof:Mf,value:c}},n.deferredUpdates=function(c){var f=Et,g=bn.transition;try{return bn.transition=null,Et=16,c()}finally{Et=f,bn.transition=g}},n.discreteUpdates=function(c,f,g,C,S){var P=Et,N=bn.transition;try{return bn.transition=null,Et=1,c(f,g,C,S)}finally{Et=P,bn.transition=N,yt===0&&wl()}},n.findAllNodes=E0,n.findBoundingRects=function(c,f){if(!Ue)throw Error(i(363));f=E0(c,f),c=[];for(var g=0;g<f.length;g++)c.push(Xe(f[g]));for(f=c.length-1;0<f;f--){g=c[f];for(var C=g.x,S=C+g.width,P=g.y,N=P+g.height,Z=f-1;0<=Z;Z--)if(f!==Z){var ue=c[Z],Ee=ue.x,Ke=Ee+ue.width,pt=ue.y,He=pt+ue.height;if(C>=Ee&&P>=pt&&S<=Ke&&N<=He){c.splice(f,1);break}else if(C!==Ee||g.width!==ue.width||He<P||pt>N){if(!(P!==pt||g.height!==ue.height||Ke<C||Ee>S)){Ee>C&&(ue.width+=Ee-C,ue.x=C),Ke<S&&(ue.width=S-Ee),c.splice(f,1);break}}else{pt>P&&(ue.height+=pt-P,ue.y=P),He<N&&(ue.height=N-pt),c.splice(f,1);break}}}return c},n.findHostInstance=OC,n.findHostInstanceWithNoPortals=function(c){return c=T(c),c=c!==null?U(c):null,c===null?null:c.stateNode},n.findHostInstanceWithWarning=function(c){return OC(c)},n.flushControlled=function(c){var f=yt;yt|=1;var g=bn.transition,C=Et;try{bn.transition=null,Et=1,c()}finally{Et=C,bn.transition=g,yt=f,yt===0&&(wl(),Qo())}},n.flushPassiveEffects=hi,n.flushSync=yC,n.focusWithin=function(c,f){if(!Ue)throw Error(i(363));for(c=j0(c),f=vC(c,f),f=Array.from(f),c=0;c<f.length;){var g=f[c++];if(!xe(g)){if(g.tag===5&&st(g.stateNode))return!0;for(g=g.child;g!==null;)f.push(g),g=g.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Et},n.getFindAllNodesFailureDescription=function(c,f){if(!Ue)throw Error(i(363));var g=0,C=[];c=[j0(c),0];for(var S=0;S<c.length;){var P=c[S++],N=c[S++],Z=f[N];if((P.tag!==5||!xe(P))&&(P0(P,Z)&&(C.push(I0(Z)),N++,N>g&&(g=N)),N<f.length))for(P=P.child;P!==null;)c.push(P,N),P=P.sibling}if(g<f.length){for(c=[];g<f.length;g++)c.push(I0(f[g]));return`findAllNodes was able to match part of the selector:
|
||
`+(C.join(" > ")+`
|
||
|
||
No matching component was found for:
|
||
`)+c.join(" > ")}return null},n.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return V(c.child.stateNode);default:return c.child.stateNode}},n.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:i7,findFiberByHostInstance:c.findFiberByHostInstance||l7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)c=!0;else{try{tf=f.inject(c),Yo=f}catch{}c=!!f.checkDCE}}return c},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(c,f,g,C){if(!Ue)throw Error(i(363));c=E0(c,f);var S=mt(c,g,C).disconnect;return{disconnect:function(){S()}}},n.registerMutableSourceForHydration=function(c,f){var g=f._getVersion;g=g(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,g]:c.mutableSourceEagerHydrationData.push(f,g)},n.runWithPriority=function(c,f){var g=Et;try{return Et=c,f()}finally{Et=g}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(c,f,g,C){var S=f.current,P=Qn(),N=wa(S);return g=MC(g),f.context===null?f.context=g:f.pendingContext=g,f=As(P,N),f.payload={element:c},C=C===void 0?null:C,C!==null&&(f.callback=C),c=ba(S,f,N),c!==null&&(Zr(c,S,N,P),uf(c,S,N)),N},n};i8.exports=the;var nhe=i8.exports;const rhe=Dc(nhe);var l8={exports:{}},al={};/**
|
||
* @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.
|
||
*/al.ConcurrentRoot=1;al.ContinuousEventPriority=4;al.DefaultEventPriority=16;al.DiscreteEventPriority=1;al.IdleEventPriority=536870912;al.LegacyRoot=0;l8.exports=al;var c8=l8.exports;const cj={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let uj=!1,dj=!1;const qy=".react-konva-event",ohe=`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
|
||
`,she=`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
|
||
`,ahe={};function Og(e,t,n=ahe){if(!uj&&"zIndex"in t&&(console.warn(she),uj=!0),!dj&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(ohe),dj=!0)}for(var s in n)if(!cj[s]){var i=s.slice(0,2)==="on",l=n[s]!==t[s];if(i&&l){var u=s.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,n[s])}var p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var h=t._useStrictMode,m={},v=!1;const x={};for(var s in t)if(!cj[s]){var i=s.slice(0,2)==="on",y=n[s]!==t[s];if(i&&y){var u=s.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[s]&&(x[u]=t[s])}!i&&(t[s]!==n[s]||h&&t[s]!==e.getAttr(s))&&(v=!0,m[s]=t[s])}v&&(e.setAttrs(m),si(e));for(var u in x)e.on(u+qy,x[u])}function si(e){if(!i9.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const u8={},ihe={};dd.Node.prototype._applyProps=Og;function lhe(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),si(e)}function che(e,t,n){let r=dd[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=dd.Group);const o={},s={};for(var i in t){var l=i.slice(0,2)==="on";l?s[i]=t[i]:o[i]=t[i]}const u=new r(o);return Og(u,s),u}function uhe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function dhe(e,t,n){return!1}function fhe(e){return e}function phe(){return null}function hhe(){return null}function mhe(e,t,n,r){return ihe}function ghe(){}function vhe(e){}function xhe(e,t){return!1}function bhe(){return u8}function yhe(){return u8}const Che=setTimeout,whe=clearTimeout,She=-1;function khe(e,t){return!1}const _he=!1,jhe=!0,Phe=!0;function Ihe(e,t){t.parent===e?t.moveToTop():e.add(t),si(e)}function Ehe(e,t){t.parent===e?t.moveToTop():e.add(t),si(e)}function d8(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),si(e)}function Mhe(e,t,n){d8(e,t,n)}function Ohe(e,t){t.destroy(),t.off(qy),si(e)}function Dhe(e,t){t.destroy(),t.off(qy),si(e)}function Rhe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function Ahe(e,t,n){}function Nhe(e,t,n,r,o){Og(e,o,r)}function The(e){e.hide(),si(e)}function $he(e){}function Lhe(e,t){(t.visible==null||t.visible)&&e.show()}function zhe(e,t){}function Fhe(e){}function Bhe(){}const Hhe=()=>c8.DefaultEventPriority,Vhe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Ihe,appendChildToContainer:Ehe,appendInitialChild:lhe,cancelTimeout:whe,clearContainer:Fhe,commitMount:Ahe,commitTextUpdate:Rhe,commitUpdate:Nhe,createInstance:che,createTextInstance:uhe,detachDeletedInstance:Bhe,finalizeInitialChildren:dhe,getChildHostContext:yhe,getCurrentEventPriority:Hhe,getPublicInstance:fhe,getRootHostContext:bhe,hideInstance:The,hideTextInstance:$he,idlePriority:Ip.unstable_IdlePriority,insertBefore:d8,insertInContainerBefore:Mhe,isPrimaryRenderer:_he,noTimeout:She,now:Ip.unstable_now,prepareForCommit:phe,preparePortalMount:hhe,prepareUpdate:mhe,removeChild:Ohe,removeChildFromContainer:Dhe,resetAfterCommit:ghe,resetTextContent:vhe,run:Ip.unstable_runWithPriority,scheduleTimeout:Che,shouldDeprioritizeSubtree:xhe,shouldSetTextContent:khe,supportsMutation:Phe,unhideInstance:Lhe,unhideTextInstance:zhe,warnsIfNotActing:jhe},Symbol.toStringTag,{value:"Module"}));var Whe=Object.defineProperty,Uhe=Object.defineProperties,Ghe=Object.getOwnPropertyDescriptors,fj=Object.getOwnPropertySymbols,Khe=Object.prototype.hasOwnProperty,qhe=Object.prototype.propertyIsEnumerable,pj=(e,t,n)=>t in e?Whe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hj=(e,t)=>{for(var n in t||(t={}))Khe.call(t,n)&&pj(e,n,t[n]);if(fj)for(var n of fj(t))qhe.call(t,n)&&pj(e,n,t[n]);return e},Xhe=(e,t)=>Uhe(e,Ghe(t));function f8(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=f8(r,t,n);if(o)return o;r=t?null:r.sibling}}function p8(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const Xy=p8(d.createContext(null));class h8 extends d.Component{render(){return d.createElement(Xy.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:mj,ReactCurrentDispatcher:gj}=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Yhe(){const e=d.useContext(Xy);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[mj==null?void 0:mj.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=f8(r,!1,s=>{let i=s.memoizedState;for(;i;){if(i.memoizedState===t)return!0;i=i.next}});if(o)return o}},[e,t])}function Qhe(){var e,t;const n=Yhe(),[r]=d.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==Xy&&!r.has(s)&&r.set(s,(t=gj==null?void 0:gj.current)==null?void 0:t.readContext(p8(s))),o=o.return}return r}function Zhe(){const e=Qhe();return d.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>d.createElement(t,null,d.createElement(n.Provider,Xhe(hj({},r),{value:e.get(n)}))),t=>d.createElement(h8,hj({},t))),[e])}function Jhe(e){const t=H.useRef({});return H.useLayoutEffect(()=>{t.current=e}),H.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const eme=e=>{const t=H.useRef(),n=H.useRef(),r=H.useRef(),o=Jhe(e),s=Zhe(),i=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return H.useLayoutEffect(()=>(n.current=new dd.Stage({width:e.width,height:e.height,container:t.current}),i(n.current),r.current=Tu.createContainer(n.current,c8.LegacyRoot,!1,null),Tu.updateContainer(H.createElement(s,{},e.children),r.current),()=>{dd.isBrowser&&(i(null),Tu.updateContainer(null,r.current,null),n.current.destroy())}),[]),H.useLayoutEffect(()=>{i(n.current),Og(n.current,e,o),Tu.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})},Iu="Layer",sa="Group",ks="Rect",vi="Circle",lm="Line",m8="Image",tme="Transformer",Tu=rhe(Vhe);Tu.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:H.version,rendererPackageName:"react-konva"});const nme=H.forwardRef((e,t)=>H.createElement(h8,{},H.createElement(eme,{...e,forwardedRef:t}))),rme=ie([Lt,bo],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:_t}}),ome=()=>{const e=ee(),{tool:t,isStaging:n,isMovingBoundingBox:r}=F(rme);return{handleDragStart:d.useCallback(()=>{(t==="move"||n)&&!r&&e(qp(!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(f5(s))},[e,r,n,t]),handleDragEnd:d.useCallback(()=>{(t==="move"||n)&&!r&&e(qp(!1))},[e,r,n,t])}},sme=ie([Lt,wn,bo],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isMaskEnabled:l,shouldSnapToGrid:u}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isStaging:n,isMaskEnabled:l,shouldSnapToGrid:u}},{memoizeOptions:{resultEqualityCheck:_t}}),ame=()=>{const e=ee(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:i}=F(sme),l=d.useRef(null),u=p5(),p=()=>e(h5());Qe(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const h=()=>e(Yx(!s));Qe(["h"],()=>{h()},{enabled:()=>!o,preventDefault:!0},[s]),Qe(["n"],()=>{e(Xp(!i))},{enabled:!0,preventDefault:!0},[i]),Qe("esc",()=>{e(l9())},{enabled:()=>!0,preventDefault:!0}),Qe("shift+h",()=>{e(c9(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),Qe(["space"],m=>{m.repeat||(u==null||u.container().focus(),r!=="move"&&(l.current=r,e(Ql("move"))),r==="move"&&l.current&&l.current!=="move"&&(e(Ql(l.current)),l.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,l])},Yy=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}},g8=()=>{const e=ee(),t=u1(),n=p5();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=u9.pixelRatio,[s,i,l,u]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;u&&s&&i&&l&&e(d9({r:s,g:i,b:l,a:u}))},commitColorUnderCursor:()=>{e(f9())}}},ime=ie([wn,Lt,bo],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:_t}}),lme=e=>{const t=ee(),{tool:n,isStaging:r}=F(ime),{commitColorUnderCursor:o}=g8();return d.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(qp(!0));return}if(n==="colorPicker"){o();return}const i=Yy(e.current);i&&(s.evt.preventDefault(),t(m5(!0)),t(p9([i.x,i.y])))},[e,n,r,t,o])},cme=ie([wn,Lt,bo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:_t}}),ume=(e,t,n)=>{const r=ee(),{isDrawing:o,tool:s,isStaging:i}=F(cme),{updateColorUnderCursor:l}=g8();return d.useCallback(()=>{if(!e.current)return;const u=Yy(e.current);if(u){if(r(h9(u)),n.current=u,s==="colorPicker"){l();return}!o||s==="move"||i||(t.current=!0,r(g5([u.x,u.y])))}},[t,r,o,i,n,e,s,l])},dme=()=>{const e=ee();return d.useCallback(()=>{e(m9())},[e])},fme=ie([wn,Lt,bo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:_t}}),pme=(e,t)=>{const n=ee(),{tool:r,isDrawing:o,isStaging:s}=F(fme);return d.useCallback(()=>{if(r==="move"||s){n(qp(!1));return}if(!t.current&&o&&e.current){const i=Yy(e.current);if(!i)return;n(g5([i.x,i.y]))}else t.current=!1;n(m5(!1))},[t,n,o,s,e,r])},hme=ie([Lt],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:_t}}),mme=e=>{const t=ee(),{isMoveStageKeyHeld:n,stageScale:r}=F(hme);return d.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const i={x:(s.x-e.current.x())/r,y:(s.y-e.current.y())/r};let l=o.evt.deltaY;o.evt.ctrlKey&&(l=-l);const u=Ri(r*x9**l,v9,g9),p={x:s.x-i.x*u,y:s.y-i.y*u};t(b9(u)),t(f5(p))},[e,n,r,t])},gme=ie(Lt,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:_t}}),vme=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=F(gme);return a.jsxs(sa,{children:[a.jsx(ks,{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(ks,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},xme=d.memo(vme),bme=ie([Lt],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:_t}}),yme=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=F(bme),{colorMode:r}=ia(),[o,s]=d.useState([]),[i,l]=ds("colors",["base.800","base.200"]),u=d.useCallback(p=>p/e,[e]);return d.useLayoutEffect(()=>{const{width:p,height:h}=n,{x:m,y:v}=t,x={x1:0,y1:0,x2:p,y2:h,offset:{x:u(m),y:u(v)}},y={x:Math.ceil(u(m)/64)*64,y:Math.ceil(u(v)/64)*64},b={x1:-y.x,y1:-y.y,x2:u(p)-y.x+64,y2:u(h)-y.y+64},k={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)},_=k.x2-k.x1,j=k.y2-k.y1,I=Math.round(_/64)+1,M=Math.round(j/64)+1,E=Sw(0,I).map(D=>a.jsx(lm,{x:k.x1+D*64,y:k.y1,points:[0,0,0,j],stroke:r==="dark"?i:l,strokeWidth:1},`x_${D}`)),O=Sw(0,M).map(D=>a.jsx(lm,{x:k.x1,y:k.y1+D*64,points:[0,0,_,0],stroke:r==="dark"?i:l,strokeWidth:1},`y_${D}`));s(E.concat(O))},[e,t,n,u,r,i,l]),a.jsx(sa,{children:o})},Cme=d.memo(yme),wme=ie([vo,Lt],(e,t)=>{const{progressImage:n,sessionId:r}=e,{sessionId:o,boundingBox:s}=t.layerState.stagingArea;return{boundingBox:s,progressImage:r===o?n:void 0}},{memoizeOptions:{resultEqualityCheck:_t}}),Sme=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=F(wme),[o,s]=d.useState(null);return d.useEffect(()=>{if(!n)return;const i=new Image;i.onload=()=>{s(i)},i.src=n.dataURL},[n]),n&&r&&o?a.jsx(m8,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},kme=d.memo(Sme),Di=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},_me=ie(Lt,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Di(t)}}),vj=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),jme=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=F(_me),[i,l]=d.useState(null),[u,p]=d.useState(0),h=d.useRef(null),m=d.useCallback(()=>{p(u+1),setTimeout(m,500)},[u]);return d.useEffect(()=>{if(i)return;const v=new Image;v.onload=()=>{l(v)},v.src=vj(n)},[i,n]),d.useEffect(()=>{i&&(i.src=vj(n))},[i,n]),d.useEffect(()=>{const v=setInterval(()=>p(x=>(x+1)%5),50);return()=>clearInterval(v)},[]),!i||!Sl(r.x)||!Sl(r.y)||!Sl(s)||!Sl(o.width)||!Sl(o.height)?null:a.jsx(ks,{ref:h,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:i,fillPatternOffsetY:Sl(u)?u:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Pme=d.memo(jme),Ime=ie([Lt],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:_t}}),Eme=e=>{const{...t}=e,{objects:n}=F(Ime);return a.jsx(sa,{listening:!1,...t,children:n.filter(y9).map((r,o)=>a.jsx(lm,{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))})},Mme=d.memo(Eme);var xi=d,Ome=function(t,n,r){const o=xi.useRef("loading"),s=xi.useRef(),[i,l]=xi.useState(0),u=xi.useRef(),p=xi.useRef(),h=xi.useRef();return(u.current!==t||p.current!==n||h.current!==r)&&(o.current="loading",s.current=void 0,u.current=t,p.current=n,h.current=r),xi.useLayoutEffect(function(){if(!t)return;var m=document.createElement("img");function v(){o.current="loaded",s.current=m,l(Math.random())}function x(){o.current="failed",s.current=void 0,l(Math.random())}return m.addEventListener("load",v),m.addEventListener("error",x),n&&(m.crossOrigin=n),r&&(m.referrerPolicy=r),m.src=t,function(){m.removeEventListener("load",v),m.removeEventListener("error",x)}},[t,n,r]),[s.current,o.current]};const Dme=Dc(Ome),Rme=e=>{const{width:t,height:n,x:r,y:o,imageName:s}=e.canvasImage,{currentData:i,isError:l}=po(s??Fr.skipToken),[u]=Dme((i==null?void 0:i.image_url)??"",C9.get()?"use-credentials":"anonymous");return l?a.jsx(ks,{x:r,y:o,width:t,height:n,fill:"red"}):a.jsx(m8,{x:r,y:o,image:u,listening:!1})},v8=d.memo(Rme),Ame=ie([Lt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:_t}}),Nme=()=>{const{objects:e}=F(Ame);return e?a.jsx(sa,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(w9(t))return a.jsx(v8,{canvasImage:t},n);if(S9(t)){const r=a.jsx(lm,{points:t.points,stroke:t.color?Di(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(sa,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(k9(t))return a.jsx(ks,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Di(t.color)},n);if(_9(t))return a.jsx(ks,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Tme=d.memo(Nme),$me=ie([Lt],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:{x:o,y:s},boundingBoxDimensions:{width:i,height:l}}=e,{selectedImageIndex:u,images:p}=t.stagingArea;return{currentStagingAreaImage:p.length>0&&u!==void 0?p[u]:void 0,isOnFirstImage:u===0,isOnLastImage:u===p.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:o,y:s,width:i,height:l}},{memoizeOptions:{resultEqualityCheck:_t}}),Lme=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:i,width:l,height:u}=F($me);return a.jsxs(sa,{...t,children:[r&&n&&a.jsx(v8,{canvasImage:n}),o&&a.jsxs(sa,{children:[a.jsx(ks,{x:s,y:i,width:l,height:u,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(ks,{x:s,y:i,width:l,height:u,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},zme=d.memo(Lme),Fme=ie([Lt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n,sessionId:r}},shouldShowStagingOutline:o,shouldShowStagingImage:s}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:s,shouldShowStagingOutline:o,sessionId:r}},{memoizeOptions:{resultEqualityCheck:_t}}),Bme=()=>{const e=ee(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o,sessionId:s}=F(Fme),{t:i}=J(),l=d.useCallback(()=>{e(gw(!0))},[e]),u=d.useCallback(()=>{e(gw(!1))},[e]);Qe(["left"],()=>{p()},{enabled:()=>!0,preventDefault:!0}),Qe(["right"],()=>{h()},{enabled:()=>!0,preventDefault:!0}),Qe(["enter"],()=>{m()},{enabled:()=>!0,preventDefault:!0});const p=d.useCallback(()=>e(j9()),[e]),h=d.useCallback(()=>e(P9()),[e]),m=d.useCallback(()=>e(I9(s)),[e,s]),{data:v}=po((r==null?void 0:r.imageName)??Fr.skipToken);return r?a.jsx($,{pos:"absolute",bottom:4,w:"100%",align:"center",justify:"center",onMouseOver:l,onMouseOut:u,children:a.jsxs(mn,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(Te,{tooltip:`${i("unifiedCanvas.previous")} (Left)`,"aria-label":`${i("unifiedCanvas.previous")} (Left)`,icon:a.jsx(cZ,{}),onClick:p,colorScheme:"accent",isDisabled:t}),a.jsx(Te,{tooltip:`${i("unifiedCanvas.next")} (Right)`,"aria-label":`${i("unifiedCanvas.next")} (Right)`,icon:a.jsx(uZ,{}),onClick:h,colorScheme:"accent",isDisabled:n}),a.jsx(Te,{tooltip:`${i("unifiedCanvas.accept")} (Enter)`,"aria-label":`${i("unifiedCanvas.accept")} (Enter)`,icon:a.jsx(jE,{}),onClick:m,colorScheme:"accent"}),a.jsx(Te,{tooltip:i("unifiedCanvas.showHide"),"aria-label":i("unifiedCanvas.showHide"),"data-alert":!o,icon:o?a.jsx(_Z,{}):a.jsx(kZ,{}),onClick:()=>e(E9(!o)),colorScheme:"accent"}),a.jsx(Te,{tooltip:i("unifiedCanvas.saveToGallery"),"aria-label":i("unifiedCanvas.saveToGallery"),isDisabled:!v||!v.is_intermediate,icon:a.jsx(eg,{}),onClick:()=>{v&&e(M9({imageDTO:v}))},colorScheme:"accent"}),a.jsx(Te,{tooltip:i("unifiedCanvas.discardAll"),"aria-label":i("unifiedCanvas.discardAll"),icon:a.jsx(nl,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(O9()),colorScheme:"error",fontSize:20})]})}):null},Hme=d.memo(Bme),Vme=()=>{const e=F(l=>l.canvas.layerState),t=F(l=>l.canvas.boundingBoxCoordinates),n=F(l=>l.canvas.boundingBoxDimensions),r=F(l=>l.canvas.isMaskEnabled),o=F(l=>l.canvas.shouldPreserveMaskedArea),[s,i]=d.useState();return d.useEffect(()=>{i(void 0)},[e,t,n,r,o]),YZ(async()=>{const l=await D9(e,t,n,r,o);if(!l)return;const{baseImageData:u,maskImageData:p}=l,h=R9(u,p);i(h)},1e3,[e,t,n,r,o]),s},Wme={txt2img:"Text to Image",img2img:"Image to Image",inpaint:"Inpaint",outpaint:"Inpaint"},Ume=()=>{const e=Vme();return a.jsxs(Ie,{children:["Mode: ",e?Wme[e]:"..."]})},Gme=d.memo(Ume),Xl=e=>Math.round(e*100)/100,Kme=ie([Lt],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Xl(n)}, ${Xl(r)})`}},{memoizeOptions:{resultEqualityCheck:_t}});function qme(){const{cursorCoordinatesString:e}=F(Kme),{t}=J();return a.jsx(Ie,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Ox="var(--invokeai-colors-warning-500)",Xme=ie([Lt],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:i},scaledBoundingBoxDimensions:{width:l,height:u},boundingBoxCoordinates:{x:p,y:h},stageScale:m,shouldShowCanvasDebugInfo:v,layer:x,boundingBoxScaleMethod:y,shouldPreserveMaskedArea:b}=e;let w="inherit";return(y==="none"&&(s<512||i<512)||y==="manual"&&l*u<512*512)&&(w=Ox),{activeLayerColor:x==="mask"?Ox:"inherit",activeLayerString:x.charAt(0).toUpperCase()+x.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${Xl(p)}, ${Xl(h)})`,boundingBoxDimensionsString:`${s}×${i}`,scaledBoundingBoxDimensionsString:`${l}×${u}`,canvasCoordinatesString:`${Xl(r)}×${Xl(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(m*100),shouldShowCanvasDebugInfo:v,shouldShowBoundingBox:y!=="auto",shouldShowScaledBoundingBox:y!=="none",shouldPreserveMaskedArea:b}},{memoizeOptions:{resultEqualityCheck:_t}}),Yme=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:i,canvasCoordinatesString:l,canvasDimensionsString:u,canvasScaleString:p,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:m,shouldPreserveMaskedArea:v}=F(Xme),{t:x}=J();return a.jsxs($,{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(Gme,{}),a.jsx(Ie,{style:{color:e},children:`${x("unifiedCanvas.activeLayer")}: ${t}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasScale")}: ${p}%`}),v&&a.jsx(Ie,{style:{color:Ox},children:"Preserve Masked Area: On"}),m&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.boundingBox")}: ${o}`}),i&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.scaledBoundingBox")}: ${s}`}),h&&a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:`${x("unifiedCanvas.boundingBoxPosition")}: ${r}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasDimensions")}: ${u}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasPosition")}: ${l}`}),a.jsx(qme,{})]})]})},Qme=d.memo(Yme),Zme=ie([be],({canvas:e,generation:t})=>{const{boundingBoxCoordinates:n,boundingBoxDimensions:r,stageScale:o,isDrawing:s,isTransformingBoundingBox:i,isMovingBoundingBox:l,tool:u,shouldSnapToGrid:p}=e,{aspectRatio:h}=t;return{boundingBoxCoordinates:n,boundingBoxDimensions:r,isDrawing:s,isMovingBoundingBox:l,isTransformingBoundingBox:i,stageScale:o,shouldSnapToGrid:p,tool:u,hitStrokeWidth:20/o,aspectRatio:h}},{memoizeOptions:{resultEqualityCheck:_t}}),Jme=e=>{const{...t}=e,n=ee(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:i,isTransformingBoundingBox:l,stageScale:u,shouldSnapToGrid:p,tool:h,hitStrokeWidth:m,aspectRatio:v}=F(Zme),x=d.useRef(null),y=d.useRef(null),[b,w]=d.useState(!1);d.useEffect(()=>{var B;!x.current||!y.current||(x.current.nodes([y.current]),(B=x.current.getLayer())==null||B.batchDraw())},[]);const k=64*u;Qe("N",()=>{n(Xp(!p))});const _=d.useCallback(B=>{if(!p){n(X0({x:Math.floor(B.target.x()),y:Math.floor(B.target.y())}));return}const U=B.target.x(),Y=B.target.y(),V=fr(U,64),L=fr(Y,64);B.target.x(V),B.target.y(L),n(X0({x:V,y:L}))},[n,p]),j=d.useCallback(()=>{if(!y.current)return;const B=y.current,U=B.scaleX(),Y=B.scaleY(),V=Math.round(B.width()*U),L=Math.round(B.height()*Y),q=Math.round(B.x()),z=Math.round(B.y());if(v){const K=fr(V/v,64);n(Ao({width:V,height:K}))}else n(Ao({width:V,height:L}));n(X0({x:p?Eu(q,64):q,y:p?Eu(z,64):z})),B.scaleX(1),B.scaleY(1)},[n,p,v]),I=d.useCallback((B,U,Y)=>{const V=B.x%k,L=B.y%k;return{x:Eu(U.x,k)+V,y:Eu(U.y,k)+L}},[k]),M=()=>{n(Y0(!0))},E=()=>{n(Y0(!1)),n(Q0(!1)),n(Uf(!1)),w(!1)},O=()=>{n(Q0(!0))},D=()=>{n(Y0(!1)),n(Q0(!1)),n(Uf(!1)),w(!1)},A=()=>{w(!0)},R=()=>{!l&&!i&&w(!1)},T=()=>{n(Uf(!0))},X=()=>{n(Uf(!1))};return a.jsxs(sa,{...t,children:[a.jsx(ks,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:T,onMouseOver:T,onMouseLeave:X,onMouseOut:X}),a.jsx(ks,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:m,listening:!s&&h==="move",onDragStart:O,onDragEnd:D,onDragMove:_,onMouseDown:O,onMouseOut:R,onMouseOver:A,onMouseEnter:A,onMouseUp:D,onTransform:j,onTransformEnd:E,ref:y,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/u,width:o.width,x:r.x,y:r.y}),a.jsx(tme,{anchorCornerRadius:3,anchorDragBoundFunc:I,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:h==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&h==="move",onDragStart:O,onDragEnd:D,onMouseDown:M,onMouseUp:E,onTransformEnd:E,ref:x,rotateEnabled:!1})]})},ege=d.memo(Jme),tge=ie(Lt,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:i,layer:l,shouldShowBrush:u,isMovingBoundingBox:p,isTransformingBoundingBox:h,stageScale:m,stageDimensions:v,boundingBoxCoordinates:x,boundingBoxDimensions:y,shouldRestrictStrokesToBox:b}=e,w=b?{clipX:x.x,clipY:x.y,clipWidth:y.width,clipHeight:y.height}:{};return{cursorPosition:t,brushX:t?t.x:v.width/2,brushY:t?t.y:v.height/2,radius:n/2,colorPickerOuterRadius:vw/m,colorPickerInnerRadius:(vw-d1+1)/m,maskColorString:Di({...o,a:.5}),brushColorString:Di(s),colorPickerColorString:Di(r),tool:i,layer:l,shouldShowBrush:u,shouldDrawBrushPreview:!(p||h||!t)&&u,strokeWidth:1.5/m,dotRadius:1.5/m,clip:w}},{memoizeOptions:{resultEqualityCheck:_t}}),nge=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:i,layer:l,shouldDrawBrushPreview:u,dotRadius:p,strokeWidth:h,brushColorString:m,colorPickerColorString:v,colorPickerInnerRadius:x,colorPickerOuterRadius:y,clip:b}=F(tge);return u?a.jsxs(sa,{listening:!1,...b,...t,children:[i==="colorPicker"?a.jsxs(a.Fragment,{children:[a.jsx(vi,{x:n,y:r,radius:y,stroke:m,strokeWidth:d1,strokeScaleEnabled:!1}),a.jsx(vi,{x:n,y:r,radius:x,stroke:v,strokeWidth:d1,strokeScaleEnabled:!1})]}):a.jsxs(a.Fragment,{children:[a.jsx(vi,{x:n,y:r,radius:o,fill:l==="mask"?s:m,globalCompositeOperation:i==="eraser"?"destination-out":"source-out"}),a.jsx(vi,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:h*2,strokeEnabled:!0,listening:!1}),a.jsx(vi,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:h,strokeEnabled:!0,listening:!1})]}),a.jsx(vi,{x:n,y:r,radius:p*2,fill:"rgba(255,255,255,0.4)",listening:!1}),a.jsx(vi,{x:n,y:r,radius:p,fill:"rgba(0,0,0,1)",listening:!1})]}):null},rge=d.memo(nge),oge=ie([Lt,bo],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:i,isMovingBoundingBox:l,stageDimensions:u,stageCoordinates:p,tool:h,isMovingStage:m,shouldShowIntermediates:v,shouldShowGrid:x,shouldRestrictStrokesToBox:y,shouldAntialias:b}=e;let w="none";return h==="move"||t?m?w="grabbing":w="grab":s?w=void 0:y&&!i&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||l,shouldShowBoundingBox:o,shouldShowGrid:x,stageCoordinates:p,stageCursor:w,stageDimensions:u,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:v,shouldAntialias:b}},we),sge=_e(nme,{shouldForwardProp:e=>!["sx"].includes(e)}),age=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:i,stageScale:l,tool:u,isStaging:p,shouldShowIntermediates:h,shouldAntialias:m}=F(oge);ame();const v=ee(),x=d.useRef(null),y=d.useRef(null),b=d.useRef(null),w=d.useCallback(X=>{A9(X),y.current=X},[]),k=d.useCallback(X=>{N9(X),b.current=X},[]),_=d.useRef({x:0,y:0}),j=d.useRef(!1),I=mme(y),M=lme(y),E=pme(y,j),O=ume(y,j,_),D=dme(),{handleDragStart:A,handleDragMove:R,handleDragEnd:T}=ome();return d.useEffect(()=>{if(!x.current)return;const X=new ResizeObserver(B=>{for(const U of B)if(U.contentBoxSize){const{width:Y,height:V}=U.contentRect;v(xw({width:Y,height:V}))}});return X.observe(x.current),v(xw(x.current.getBoundingClientRect())),()=>{X.disconnect()}},[v]),a.jsxs($,{id:"canvas-container",ref:x,sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:[a.jsx(Ie,{sx:{position:"absolute"},children:a.jsxs(sge,{tabIndex:-1,ref:w,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:i.width,height:i.height,scale:{x:l,y:l},onTouchStart:M,onTouchMove:O,onTouchEnd:E,onMouseDown:M,onMouseLeave:D,onMouseMove:O,onMouseUp:E,onDragStart:A,onDragMove:R,onDragEnd:T,onContextMenu:X=>X.evt.preventDefault(),onWheel:I,draggable:(u==="move"||p)&&!t,children:[a.jsx(Iu,{id:"grid",visible:r,children:a.jsx(Cme,{})}),a.jsx(Iu,{id:"base",ref:k,listening:!1,imageSmoothingEnabled:m,children:a.jsx(Tme,{})}),a.jsxs(Iu,{id:"mask",visible:e,listening:!1,children:[a.jsx(Mme,{visible:!0,listening:!1}),a.jsx(Pme,{listening:!1})]}),a.jsx(Iu,{children:a.jsx(xme,{})}),a.jsxs(Iu,{id:"preview",imageSmoothingEnabled:m,children:[!p&&a.jsx(rge,{visible:u!=="move",listening:!1}),a.jsx(zme,{visible:p}),h&&a.jsx(kme,{}),a.jsx(ege,{visible:n&&!p})]})]})}),a.jsx(Qme,{}),a.jsx(Hme,{})]})},ige=d.memo(age);function lge(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 cge=_e(hO,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),Qv={width:6,height:6,borderColor:"base.100"},uge=e=>{const{styleClass:t="",...n}=e;return a.jsx(cge,{sx:{".react-colorful__hue-pointer":Qv,".react-colorful__saturation-pointer":Qv,".react-colorful__alpha-pointer":Qv},className:t,...n})},x8=d.memo(uge),dge=ie([Lt,bo],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Di(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:_t}}),fge=()=>{const e=ee(),{t}=J(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:i}=F(dge);Qe(["q"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[n]),Qe(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]),Qe(["h"],()=>{p()},{enabled:()=>!i,preventDefault:!0},[o]);const l=()=>{e(v5(n==="mask"?"base":"mask"))},u=()=>e(h5()),p=()=>e(Yx(!o)),h=async()=>{e(L9())};return a.jsx(Wd,{triggerComponent:a.jsx(mn,{children:a.jsx(Te,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:a.jsx(AE,{}),isChecked:n==="mask",isDisabled:i})}),children:a.jsxs($,{direction:"column",gap:2,children:[a.jsx(ur,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:p}),a.jsx(ur,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:m=>e(T9(m.target.checked))}),a.jsx(x8,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:m=>e($9(m))}),a.jsx(it,{size:"sm",leftIcon:a.jsx(eg,{}),onClick:h,children:"Save Mask"}),a.jsxs(it,{size:"sm",leftIcon:a.jsx(Wr,{}),onClick:u,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},pge=d.memo(fge),hge=ie([Lt,wn,vo],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:_t}});function mge(){const e=ee(),{canRedo:t,activeTabName:n}=F(hge),{t:r}=J(),o=()=>{e(z9())};return Qe(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),a.jsx(Te,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:a.jsx(TZ,{}),onClick:o,isDisabled:!t})}const gge=()=>{const e=F(bo),t=ee(),{t:n}=J();return a.jsxs(Vy,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(F9()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:a.jsx(it,{size:"sm",leftIcon:a.jsx(Wr,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),a.jsx("br",{}),a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},vge=d.memo(gge),xge=ie([Lt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u,shouldAntialias:p}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u,shouldAntialias:p}},{memoizeOptions:{resultEqualityCheck:_t}}),bge=()=>{const e=ee(),{t}=J(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:i,shouldShowIntermediates:l,shouldSnapToGrid:u,shouldRestrictStrokesToBox:p,shouldAntialias:h}=F(xge);Qe(["n"],()=>{e(Xp(!u))},{enabled:!0,preventDefault:!0},[u]);const m=v=>e(Xp(v.target.checked));return a.jsx(Wd,{isLazy:!1,triggerComponent:a.jsx(Te,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(zE,{})}),children:a.jsxs($,{direction:"column",gap:2,children:[a.jsx(ur,{label:t("unifiedCanvas.showIntermediates"),isChecked:l,onChange:v=>e(B9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.showGrid"),isChecked:i,onChange:v=>e(H9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.snapToGrid"),isChecked:u,onChange:m}),a.jsx(ur,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:v=>e(V9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:v=>e(W9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:v=>e(U9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:v=>e(G9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:v=>e(K9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.antialiasing"),isChecked:h,onChange:v=>e(q9(v.target.checked))}),a.jsx(vge,{})]})})},yge=d.memo(bge),Cge=ie([Lt,bo,vo],(e,t,n)=>{const{isProcessing:r}=n,{tool:o,brushColor:s,brushSize:i}=e;return{tool:o,isStaging:t,isProcessing:r,brushColor:s,brushSize:i}},{memoizeOptions:{resultEqualityCheck:_t}}),wge=()=>{const e=ee(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=F(Cge),{t:s}=J();Qe(["b"],()=>{i()},{enabled:()=>!o,preventDefault:!0},[]),Qe(["e"],()=>{l()},{enabled:()=>!o,preventDefault:!0},[t]),Qe(["c"],()=>{u()},{enabled:()=>!o,preventDefault:!0},[t]),Qe(["shift+f"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),Qe(["delete","backspace"],()=>{h()},{enabled:()=>!o,preventDefault:!0}),Qe(["BracketLeft"],()=>{r-5<=5?e(Gf(Math.max(r-1,1))):e(Gf(Math.max(r-5,1)))},{enabled:()=>!o,preventDefault:!0},[r]),Qe(["BracketRight"],()=>{e(Gf(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),Qe(["Shift+BracketLeft"],()=>{e(Z0({...n,a:Ri(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),Qe(["Shift+BracketRight"],()=>{e(Z0({...n,a:Ri(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const i=()=>e(Ql("brush")),l=()=>e(Ql("eraser")),u=()=>e(Ql("colorPicker")),p=()=>e(X9()),h=()=>e(Y9());return a.jsxs(mn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:a.jsx(AZ,{}),isChecked:t==="brush"&&!o,onClick:i,isDisabled:o}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:a.jsx(xZ,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:l}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(jZ,{}),isDisabled:o,onClick:p}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(nl,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:h}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(SZ,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:u}),a.jsx(Wd,{triggerComponent:a.jsx(Te,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:a.jsx($E,{})}),children:a.jsxs($,{minWidth:60,direction:"column",gap:4,width:"100%",children:[a.jsx($,{gap:4,justifyContent:"space-between",children:a.jsx(Ze,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:m=>e(Gf(m)),sliderNumberInputProps:{max:500}})}),a.jsx(x8,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:m=>e(Z0(m))})]})})]})},Sge=d.memo(wge),kge=ie([Lt,wn,vo],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:_t}});function _ge(){const e=ee(),{t}=J(),{canUndo:n,activeTabName:r}=F(kge),o=()=>{e(Q9())};return Qe(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),a.jsx(Te,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:a.jsx(tg,{}),onClick:o,isDisabled:!n})}const jge=ie([vo,Lt,bo],(e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:s,layer:i,isMaskEnabled:l}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:l,tool:o,layer:i,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:_t}}),Pge=()=>{const e=ee(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s}=F(jge),i=u1(),{t:l}=J(),{isClipboardAPIAvailable:u}=LM(),{getUploadButtonProps:p,getUploadInputProps:h}=_y({postUploadAction:{type:"SET_CANVAS_INITIAL_IMAGE"}});Qe(["v"],()=>{m()},{enabled:()=>!n,preventDefault:!0},[]),Qe(["r"],()=>{x()},{enabled:()=>!0,preventDefault:!0},[i]),Qe(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[i,t]),Qe(["shift+s"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[i,t]),Qe(["meta+c","ctrl+c"],()=>{k()},{enabled:()=>!n&&u,preventDefault:!0},[i,t,u]),Qe(["shift+d"],()=>{_()},{enabled:()=>!n,preventDefault:!0},[i,t]);const m=()=>e(Ql("move")),v=lge(()=>x(!1),()=>x(!0)),x=(I=!1)=>{const M=u1();if(!M)return;const E=M.getClientRect({skipTransform:!0});e(J9({contentRect:E,shouldScaleTo1:I}))},y=()=>{e(Nj())},b=()=>{e(eN())},w=()=>{e(tN())},k=()=>{u&&e(nN())},_=()=>{e(rN())},j=I=>{const M=I;e(v5(M)),M==="mask"&&!r&&e(Yx(!0))};return a.jsxs($,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[a.jsx(Ie,{w:24,children:a.jsx($n,{tooltip:`${l("unifiedCanvas.layer")} (Q)`,value:o,data:Z9,onChange:j,disabled:n})}),a.jsx(pge,{}),a.jsx(Sge,{}),a.jsxs(mn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${l("unifiedCanvas.move")} (V)`,tooltip:`${l("unifiedCanvas.move")} (V)`,icon:a.jsx(dZ,{}),isChecked:s==="move"||n,onClick:m}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.resetView")} (R)`,tooltip:`${l("unifiedCanvas.resetView")} (R)`,icon:a.jsx(mZ,{}),onClick:v})]}),a.jsxs(mn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(OZ,{}),onClick:b,isDisabled:n}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(eg,{}),onClick:w,isDisabled:n}),u&&a.jsx(Te,{"aria-label":`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(Hc,{}),onClick:k,isDisabled:n}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(Jm,{}),onClick:_,isDisabled:n})]}),a.jsxs(mn,{isAttached:!0,children:[a.jsx(_ge,{}),a.jsx(mge,{})]}),a.jsxs(mn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${l("common.upload")}`,tooltip:`${l("common.upload")}`,icon:a.jsx(ng,{}),isDisabled:n,...p()}),a.jsx("input",{...h()}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.clearCanvas")}`,tooltip:`${l("unifiedCanvas.clearCanvas")}`,icon:a.jsx(Wr,{}),onClick:y,colorScheme:"error",isDisabled:n})]}),a.jsx(mn,{isAttached:!0,children:a.jsx(yge,{})})]})},Ige=d.memo(Pge),xj={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},Ege=()=>{const{isOver:e,setNodeRef:t,active:n}=vM({id:"unifiedCanvas",data:xj});return a.jsxs($,{layerStyle:"first",ref:t,tabIndex:-1,sx:{flexDirection:"column",alignItems:"center",gap:4,p:2,borderRadius:"base",w:"full",h:"full"},children:[a.jsx(Ige,{}),a.jsx(ige,{}),xM(xj,n)&&a.jsx(bM,{isOver:e,label:"Set Canvas Initial Image"})]})},Mge=d.memo(Ege),Oge=()=>a.jsx(Mge,{}),Dge=d.memo(Oge),Rge=[{id:"txt2img",translationKey:"common.txt2img",icon:a.jsx(An,{as:PZ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Jpe,{})},{id:"img2img",translationKey:"common.img2img",icon:a.jsx(An,{as:Vi,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(iue,{})},{id:"unifiedCanvas",translationKey:"common.unifiedCanvas",icon:a.jsx(An,{as:kne,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Dge,{})},{id:"nodes",translationKey:"common.nodes",icon:a.jsx(An,{as:xg,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Qpe,{})},{id:"modelManager",translationKey:"modelManager.modelManager",icon:a.jsx(An,{as:gZ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(ade,{})}],Age=ie([be],({config:e})=>{const{disabledTabs:t}=e;return Rge.filter(r=>!t.includes(r.id))},{memoizeOptions:{resultEqualityCheck:_t}}),Nge=448,Tge=448,$ge=360,Lge=["modelManager"],zge=["modelManager"],Fge=()=>{const e=F(oN),t=F(wn),n=F(Age),{t:r}=J(),o=ee(),s=d.useCallback(R=>{R.target instanceof HTMLElement&&R.target.blur()},[]),i=d.useMemo(()=>n.map(R=>a.jsx(Rt,{hasArrow:!0,label:String(r(R.translationKey)),placement:"end",children:a.jsxs(Pr,{onClick:s,children:[a.jsx(A5,{children:String(r(R.translationKey))}),R.icon]})},R.id)),[n,r,s]),l=d.useMemo(()=>n.map(R=>a.jsx(fo,{children:R.content},R.id)),[n]),u=d.useCallback(R=>{const T=sN[R];T&&o(Ra(T))},[o]),{minSize:p,isCollapsed:h,setIsCollapsed:m,ref:v,reset:x,expand:y,collapse:b,toggle:w}=__(Nge,"pixels"),{ref:k,minSize:_,isCollapsed:j,setIsCollapsed:I,reset:M,expand:E,collapse:O,toggle:D}=__($ge,"pixels");Qe("f",()=>{j||h?(E(),y()):(b(),O())},[o,j,h]),Qe(["t","o"],()=>{w()},[o]),Qe("g",()=>{D()},[o]);const A=Dy();return a.jsxs(Qi,{variant:"appTabs",defaultIndex:e,index:e,onChange:u,sx:{flexGrow:1,gap:4},isLazy:!0,children:[a.jsxs(Zi,{sx:{pt:2,gap:4,flexDir:"column"},children:[i,a.jsx(Za,{}),a.jsx(bJ,{})]}),a.jsxs(Cg,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},storage:A,units:"pixels",children:[!zge.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(Wa,{order:0,id:"side",ref:v,defaultSize:p,minSize:p,onCollapse:m,collapsible:!0,children:t==="nodes"?a.jsx(nse,{}):a.jsx(Ece,{})}),a.jsx(om,{onDoubleClick:x,collapsedDirection:h?"left":void 0}),a.jsx(ase,{isSidePanelCollapsed:h,sidePanelRef:v})]}),a.jsx(Wa,{id:"main",order:1,minSize:Tge,children:a.jsx(zc,{style:{height:"100%",width:"100%"},children:l})}),!Lge.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(om,{onDoubleClick:M,collapsedDirection:j?"right":void 0}),a.jsx(Wa,{id:"gallery",ref:k,order:2,defaultSize:_,minSize:_,onCollapse:I,collapsible:!0,children:a.jsx(tre,{})}),a.jsx(ose,{isGalleryCollapsed:j,galleryPanelRef:k})]})]})]})},Bge=d.memo(Fge),Hge=d.createContext(null),Zv={didCatch:!1,error:null};class Vge extends d.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Zv}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),i=0;i<o;i++)s[i]=arguments[i];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:s,reason:"imperative-api"}),this.setState(Zv)}}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&&Wge(t.resetKeys,o)){var s,i;(s=(i=this.props).onReset)===null||s===void 0||s.call(i,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Zv)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:s,error:i}=this.state;let l=t;if(s){const u={error:i,resetErrorBoundary:this.resetErrorBoundary};if(d.isValidElement(o))l=o;else if(typeof n=="function")l=n(u);else if(r)l=d.createElement(r,u);else throw i}return d.createElement(Hge.Provider,{value:{didCatch:s,error:i,resetErrorBoundary:this.resetErrorBoundary}},l)}}function Wge(){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]))}const Uge=()=>{const e=ee(),[t,n]=d.useState(),[r,o]=d.useState(),{recallAllParameters:s}=vg(),i=Ji(),{currentData:l}=po(t??Fr.skipToken),{currentData:u}=aN(r??Fr.skipToken);return{handlePreselectedImage:d.useCallback(h=>{h&&(h.action==="sendToCanvas"&&(n(h==null?void 0:h.imageName),l&&(e(Vj(l)),e(Ra("unifiedCanvas")),i({title:iN("toast.sentToUnifiedCanvas"),status:"info",duration:2500,isClosable:!0}))),h.action==="sendToImg2Img"&&(n(h==null?void 0:h.imageName),l&&e(pm(l))),h.action==="useAllParameters"&&(o(h==null?void 0:h.imageName),u&&s(u.metadata)))},[e,l,u,s,i])}};function Gge(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 Kge=({error:e,resetErrorBoundary:t})=>{const n=j5(),r=d.useCallback(()=>{const s=JSON.stringify(lN(e),null,2);navigator.clipboard.writeText(`\`\`\`
|
||
${s}
|
||
\`\`\``),n({title:"Error Copied"})},[e,n]),o=d.useMemo(()=>Gge({user:"invoke-ai",repo:"InvokeAI",template:"BUG_REPORT.yml",title:`[bug]: ${e.name}: ${e.message}`}),[e.message,e.name]);return a.jsx($,{layerStyle:"body",sx:{w:"100vw",h:"100vh",alignItems:"center",justifyContent:"center",p:4},children:a.jsxs($,{layerStyle:"first",sx:{flexDir:"column",borderRadius:"base",justifyContent:"center",gap:8,p:16},children:[a.jsx(so,{children:"Something went wrong"}),a.jsx($,{layerStyle:"second",sx:{px:8,py:4,borderRadius:"base",gap:4,justifyContent:"space-between",alignItems:"center"},children:a.jsxs(ye,{sx:{fontWeight:600,color:"error.500",_dark:{color:"error.400"}},children:[e.name,": ",e.message]})}),a.jsxs($,{sx:{gap:4},children:[a.jsx(it,{leftIcon:a.jsx(Lpe,{}),onClick:t,children:"Reset UI"}),a.jsx(it,{leftIcon:a.jsx(Hc,{}),onClick:r,children:"Copy Error"}),a.jsx(Im,{href:o,isExternal:!0,children:a.jsx(it,{leftIcon:a.jsx(EE,{}),children:"Create Issue"})})]})]})})},qge=d.memo(Kge),Xge=ie([be],({hotkeys:e})=>{const{shift:t,ctrl:n,meta:r}=e;return{shift:t,ctrl:n,meta:r}},{memoizeOptions:{resultEqualityCheck:_t}}),Yge=()=>{const e=ee(),{shift:t,ctrl:n,meta:r}=F(Xge);return Qe("*",()=>{Tp("shift")?!t&&e(Ir(!0)):t&&e(Ir(!1)),Tp("ctrl")?!n&&e(bw(!0)):n&&e(bw(!1)),Tp("meta")?!r&&e(yw(!0)):r&&e(yw(!1))},{keyup:!0,keydown:!0},[t,n,r]),Qe("1",()=>{e(Ra("txt2img"))}),Qe("2",()=>{e(Ra("img2img"))}),Qe("3",()=>{e(Ra("unifiedCanvas"))}),Qe("4",()=>{e(Ra("nodes"))}),Qe("5",()=>{e(Ra("modelManager"))}),null},Qge=d.memo(Yge),Zge={},Jge=({config:e=Zge,selectedImage:t})=>{const n=F(RP),r=AP("system"),o=ee(),{handlePreselectedImage:s}=Uge(),i=d.useCallback(()=>(localStorage.clear(),location.reload(),!1),[]);d.useEffect(()=>{vt.changeLanguage(n)},[n]),d.useEffect(()=>{Qj(e)&&(r.info({config:e},"Received config"),o(cN(e)))},[o,e,r]),d.useEffect(()=>{o(uN())},[o]),d.useEffect(()=>{s(t)},[s,t]);const l=gg(dN);return a.jsxs(Vge,{onReset:i,FallbackComponent:qge,children:[a.jsx(Ua,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:a.jsx($W,{children:a.jsxs(Ua,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[l||a.jsx(gJ,{}),a.jsx($,{sx:{gap:4,w:"full",h:"full"},children:a.jsx(Bge,{})})]})})}),a.jsx(tZ,{}),a.jsx(YQ,{}),a.jsx(jV,{}),a.jsx(Qge,{})]})},l0e=d.memo(Jge);export{l0e as default};
|